diff --git a/Config.ini b/Config.ini new file mode 100644 index 00000000..2015654c --- /dev/null +++ b/Config.ini @@ -0,0 +1,389 @@ +;------------------- +[System] + +; リリースバージョン +; Release Version. +Version=1.5.7 + +; 譜面ファイルが格納されているフォルダへのパス。 +; セミコロン(;)で区切ることにより複数のパスを指定できます。(例: d:\tja\;e:\tja2\) +; Pathes for TJA data. +; You can specify many pathes separated with semicolon(;). (e.g. d:\tja\;e:\tja2\) +TJAPath=.\ + +; 使用するSkinのフォルダ名。 +; 例えば System\Default\Graphics\... などの場合は、SkinPath=.\Default\ を指定します。 +; Skin folder path. +; e.g. System\Default\Graphics\... -> Set SkinPath=.\Default\ +SkinPath=SimpleStyle\ + +; 事前画像描画機能を使うかどうか。(0: OFF, 1: ON) +; Use pre-textures render. +FastRender=1 + +; 画面モード(0:ウィンドウ, 1:全画面) +; Screen mode. (0:Window, 1:Fullscreen) +FullScreen=0 + +; ウインドウモード時の画面幅 +; A width size in the window mode. +WindowWidth=1280 + +; ウインドウモード時の画面高さ +; A height size in the window mode. +WindowHeight=720 + +; ウィンドウモード時の位置X +; X position in the window mode. +WindowX=310 + +; ウィンドウモード時の位置Y +; Y position in the window mode. +WindowY=152 + +; ウインドウをダブルクリックした時にフルスクリーンに移行するか(0:移行しない,1:移行する) +; Whether double click to go full screen mode or not.(0:No, 1:Yes) +DoubleClickFullScreen=1 + +; ALT+SPACEのメニュー表示を抑制するかどうか(0:抑制する 1:抑制しない) +; Whether ALT+SPACE menu would be masked or not.(0=masked 1=not masked) +EnableSystemMenu=1 + +; 非フォーカス時のsleep値[ms] +; A sleep time[ms] while the window is inactive. +BackSleep=1 + +; フォントレンダリングに使用するフォント名 +; Font name used for font rendering. +FontName=FOT-大江戸勘亭流 Std E + +; 垂直帰線同期(0:OFF,1:ON) +VSyncWait=1 + +; フレーム毎のsleep値[ms] (-1でスリープ無し, 0以上で毎フレームスリープ。動画キャプチャ等で活用下さい) +; A sleep time[ms] per frame. +SleepTimePerFrame=-1 + +; サウンド出力方式(0=ACM(って今はまだDirectSoundですが), 1=ASIO, 2=WASAPI) +; WASAPIはVista以降のOSで使用可能。推奨方式はWASAPI。 +; なお、WASAPIが使用不可ならASIOを、ASIOが使用不可ならACMを使用します。 +; Sound device type(0=ACM, 1=ASIO, 2=WASAPI) +; WASAPI can use on Vista or later OSs. +; If WASAPI is not available, DTXMania try to use ASIO. If ASIO can't be used, ACM is used. +SoundDeviceType=2 + +; WASAPI使用時のサウンドバッファサイズ +; (0=デバイスに設定されている値を使用, 1〜9999=バッファサイズ(単位:ms)の手動指定 +; WASAPI Sound Buffer Size. +; (0=Use system default buffer size, 1-9999=specify the buffer size(ms) by yourself) +WASAPIBufferSizeMs=50 + +; ASIO使用時のサウンドデバイス +; 存在しないデバイスを指定すると、DTXManiaが起動しないことがあります。 +; Sound device used by ASIO. +; Don't specify unconnected device, as the DTXMania may not bootup. +; 0: None +ASIODevice=0 + +; WASAPI/ASIO時に使用する演奏タイマーの種類 +; Playback timer used for WASAPI/ASIO +; (0=FDK Timer, 1=System Timer) +SoundTimerType=0 + +; 背景画像の半透明割合(0:透明〜255:不透明) +; Transparency for background image in playing screen.(0:tranaparent - 255:no transparent) +BGAlpha=100 + +; ゲージゼロでSTAGE FAILED (0:OFF, 1:ON) +StageFailed=1 + +; AVIの表示(0:OFF, 1:ON) +AVI=0 + +; BGAの表示(0:OFF, 1:ON) +BGA=1 + +; 動画表示モード( 0:表示しない, 1:背景のみ, 2:窓表示のみ, 3:両方) +ClipDispType=1 + +; 曲選択からプレビュー音の再生までのウェイト[ms] +PreviewSoundWait=1000 + +; 曲選択からプレビュー画像表示までのウェイト[ms] +PreviewImageWait=100 + +; BGM の再生(0:OFF, 1:ON) +BGMSound=1 + +; 演奏記録(〜.score.ini)の出力 (0:OFF, 1:ON) +SaveScoreIni=1 + +; 最小表示コンボ数 +MinComboDrums=10 + +; RANDOM SELECT で子BOXを検索対象に含める (0:OFF, 1:ON) +RandomFromSubBox=1 + +; 演奏情報を表示する (0:OFF, 1:ON) +; Showing playing info on the playing screen. (0:OFF, 1:ON) +ShowDebugStatus=0 + +; BS1770GAIN によるラウドネスメータの測量を適用する (0:OFF, 1:ON) +; Apply BS1770GAIN loudness metadata (0:OFF, 1:ON) +ApplyLoudnessMetadata=1 + +; BS1770GAIN によるラウドネスメータの目標値 (0). (-100-10) +; Loudness Target in dB (decibels) relative to full scale (0). (-100-10) +TargetLoudness=-7.4 + +; .tjaファイルのSONGVOLヘッダを音源の音量に適用する (0:OFF, 1:ON) +; Apply SONGVOL (0:OFF, 1:ON) +ApplySongVol=0 + +; 効果音の音量 (0-100%) +; Sound effect level (0-100%) +SoundEffectLevel=100 + +; 各ボイス、コンボボイスの音量 (0-100%) +; Voice level (0-100%) +VoiceLevel=90 + +; 選曲画面のプレビュー時の音量 (0-100%) +; Song preview level (0-100%) +SongPreviewLevel=80 + +; ゲーム中の音源の音量 (0-100%) +; Song playback level (0-100%) +SongPlaybackLevel=100 + +; キーボードによる音量変更の増加量、減少量 (1-20) +; Keyboard sound level increment (1-20) +KeyboardSoundLevelIncrement=5 + +; 2P演奏時に叩いた音を左右別々にならすか (0:OFF, 1:ON) +; Use panning for SE (0:OFF, 1:ON) +UsePanning=1 + +; 音源再生前の空白時間 (ms) +; Blank time before music source to play. (ms) +MusicPreTimeMs=1000 + +; ストイックモード(0:OFF, 1:ON) +; Stoic mode. (0:OFF, 1:ON) +StoicMode=0 + +; バッファ入力モード(0:OFF, 1:ON) +; Using Buffered input (0:OFF, 1:ON) +BufferedInput=1 + +; リザルト画像自動保存機能(0:OFF, 1:ON) +; Set "1" if you'd like to save result screen image automatically +; when you get hiscore/hiskill. +AutoResultCapture=0 + +; Discordに再生中の譜面情報を送信する(0:OFF, 1:ON) +; Share Playing .tja file infomation on Discord. +SendDiscordPlayingInformation=1 + +; 再生速度変更を、ピッチ変更で行うかどうか(0:ピッチ変更, 1:タイムストレッチ +; (WASAPI/ASIO使用時のみ有効) +; Set "0" if you'd like to use pitch shift with PlaySpeed. +; Set "1" for time stretch. +; (Only available when you're using using WASAPI or ASIO) +TimeStretch=0 + +; 動画再生にDirectShowを使用する(0:OFF, 1:ON) +; 動画再生にDirectShowを使うことによって、再生時の負担を軽減できます。 +; ただし使用時にはセットアップが必要になるのでご注意ください。 +DirectShowMode=0 + +; 判定タイミング調整(-99〜99)[ms] +; Revision value to adjust judgment timing. +InputAdjustTime=11 + +; 判定ラインの表示位置調整(ドラム, ギター, ベース)(-99〜99)[px] +; Offset value to adjust displaying judgement line for the drums, guitar and bass. +JudgeLinePosOffsetDrums=0 + +; 「また遊んでね」画面(0:OFF, 1:ON) +EndingAnime=0 + +;------------------- +[AutoPlay] + +; 自動演奏(0:OFF, 1:ON) +Taiko=0 +Taiko2P=0 +TaikoAutoRoll=1 + +;------------------- +[HitRange] + +; Perfect〜Poor とみなされる範囲[ms] +Perfect=30 +Good=100 +Poor=130 + +;------------------- +[Log] + +; Log出力(0:OFF, 1:ON) +OutputLog=1 + +; 曲データ検索に関するLog出力(0:OFF, 1:ON) +TraceSongSearch=0 + +; 画像やサウンドの作成_解放に関するLog出力(0:OFF, 1:ON) +TraceCreatedDisposed=0 + +; DTX読み込み詳細に関するLog出力(0:OFF, 1:ON) +TraceDTXDetails=0 + +;------------------- +[PlayOption] + +; 各画像の表示設定 +; キャラクター画像を表示する (0:OFF, 1:ON) +ShowChara=1 +; ダンサー画像を表示する (0:OFF, 1:ON) +ShowDancer=1 +; ランナー画像を表示する (0:OFF, 1:ON) +ShowRunner=1 +; モブ画像を表示する (0:OFF, 1:ON) +ShowMob=1 +; フッター画像 (0:OFF, 1:ON) +ShowFooter=1 +; ぷちキャラ画像 (0:OFF, 1:ON) +ShowPuchiChara=1 + +; DARKモード(0:OFF, 1:HALF, 2:FULL) +Dark=0 + + +; 選曲画面でのタイマーを有効にするかどうか(0:無効,1:有効) +; Enable countdown in songselect.(0:No, 1:Yes) +EnableCountDownTimer=1 + +; ドラムSUDDENモード(0:OFF, 1:ON) +DrumsSudden=0 + +; ドラムHIDDENモード(0:OFF, 1:ON) +DrumsHidden=0 + +; ドラムチップ非表示モード (0:OFF, 1=SEMI, 2:FULL) +; Drums chip invisible mode +DrumsInvisible=0 + +; ドラムREVERSEモード(0:OFF, 1:ON) +DrumsReverse=0 + +; RISKYモード(0:OFF, 1-10) +; RISKY mode. 0=OFF, 1-10 is the times of misses to be Failed. +Risky=0 + +; TIGHTモード(0:OFF, 1:ON) +; TIGHT mode. 0=OFF, 1=ON +DrumsTight=0 + +; ドラム譜面スクロール速度(0:x0.5, 1:x1.0, 2:x1.5,…,1999:x1000.0) +DrumsScrollSpeed=1 + +; 演奏速度(5〜40)(→x5/20〜x40/20) +PlaySpeed=20 + +; 演奏速度が一倍速であるときのみBGMを再生する(0:OFF, 1:ON) +PlaySpeedNotEqualOneNoSound=0 + +; デフォルトで選択される難易度 +DefaultCourse=3 + +; 譜面分岐のガイド表示(0:OFF, 1:ON) +BranchGuide=0 + +; スコア計算方法(0:旧配点, 1:旧筐体配点, 2:新配点) +ScoreMode=2 + +; 真打モード (0:OFF, 1:ON) +; Fixed score mode (0:OFF, 1:ON) +ShinuchiMode=1 +; 大音符の両手入力待機時間(ms) +BigNotesWaitTime=50 + +; 大音符の両手判定(0:OFF, 1:ON) +BigNotesJudge=0 + +; NoInfo(0:OFF, 1:ON) +NoInfo=0 + +; 譜面分岐のアニメーション(0:7〜14, 1:15) +BranchAnime=1 + +; デフォルトの曲ソート(0:絶対パス順, 1:ジャンル名ソートOLD, 2:ジャンル名ソートNEW ) +0:Path, 1:GenreName(AC8〜AC14), 2GenreName(AC15〜) +DefaultSongSort=2 + +; RANDOMモード(0:OFF, 1:Random, 2:Mirorr 3:SuperRandom, 4:HyperRandom) +TaikoRandom=0 + +; STEALTHモード(0:OFF, 1:ドロン, 2:ステルス) +TaikoStealth=0 + +; ゲーム(0:OFF, 1:完走!叩ききりまショー!, 2:完走!叩ききりまショー!(激辛) ) +GameMode=0 + + +; 特訓モード時にPgUp/PgDnで何小節飛ばすか +TokkunSkipMeasures=0 + +; 特訓モード時にジャンプポイントに飛ばすための時間(ms) +; 指定ms以内に5回縁を叩きましょう +TokkunMashInterval=750 + +; JUST(0:OFF, 1:ON) +Just=0 + +; 判定数の表示(0:OFF, 1:ON) +JudgeCountDisplay=0 + +; プレイ人数 +PlayerCount=1 + +;------------------- +[GUID] + + +;------------------- +; キーアサイン +; 項 目:Keyboard → 'K'+'0'+キーコード(10進数) +; Mouse → 'N'+'0'+ボタン番号(0〜7) +; MIDI In → 'M'+デバイス番号1桁(0〜9,A〜Z)+ノート番号(10進数) +; Joystick → 'J'+デバイス番号1桁(0〜9,A〜Z)+ 0 ...... X減少(左)ボタン +; 1 ...... X増加(右)ボタン +; 2 ...... Y減少(上)ボタン +; 3 ...... Y増加(下)ボタン +; 4 ...... Z減少(前)ボタン +; 5 ...... Z増加(後)ボタン +; 6〜133.. ボタン1〜128 +; これらの項目を 16 個まで指定可能(',' で区切って記述)。 +; +; 表記例:HH=K044,M042,J16 +; → HiHat を Keyboard の 44 ('Z'), MidiIn#0 の 42, JoyPad#1 の 6(ボタン1) に割当て +; +; ※Joystick のデバイス番号とデバイスとの関係は [GUID] セクションに記してあるものが有効。 +; + +[DrumsKeyAssign] + +LeftRed=K016,K015 +RightRed=K017,K019 +LeftBlue=K028,K013 +RightBlue=K020,K021 +LeftRed2P=K031,K011 +RightRed2P=K022,K023 +LeftBlue2P=K033,K012 +RightBlue2P=K0111,K047 + +[SystemKeyAssign] + +Capture=K065 + diff --git a/FDK19/FDK19.csproj b/FDK19/FDK19.csproj new file mode 100644 index 00000000..4cf3c82c --- /dev/null +++ b/FDK19/FDK19.csproj @@ -0,0 +1,205 @@ +サソ + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {BCD40908-F3E2-4707-BFAA-1DD99DF6357D} + Library + Properties + FDK + FDK + v4.6.1 + 512 + true + + + + + + + + + 3.5 + + + + x86 + bin\x86\Debug\ + true + + + false + 0219 + TRACE;TEST_CancelEnterCodeInAltEnter2 TEST_Direct3D9Ex_ + false + full + 7.3 + true + false + + + x86 + bin\x86\Release\ + true + + + true + 0219 + TRACE;TEST_ENGLISH_ TEST_Direct3D9Ex_ + true + 7.3 + full + true + false + + + + ..\Test\dll\Bass.Net.dll + True + + + False + ..\Test\dll\DirectShowLib-2005.dll + True + + + + + + + + + + + + + + + + + + + + + + + + Form + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GameWindow.cs + + + Designer + + + + + + + + 1.3.1.2 + + + 4.2.0 + + + 4.2.0 + + + 4.2.0 + + + 4.2.0 + + + 4.0.13.44 + + + + + + + + + \ No newline at end of file diff --git a/FDK19/FDK19.csproj.user b/FDK19/FDK19.csproj.user new file mode 100644 index 00000000..eb6ef04a --- /dev/null +++ b/FDK19/FDK19.csproj.user @@ -0,0 +1,7 @@ +サソ + + + + + + \ No newline at end of file diff --git a/FDK19/Properties/AssemblyInfo.cs b/FDK19/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..6561304f --- /dev/null +++ b/FDK19/Properties/AssemblyInfo.cs @@ -0,0 +1,39 @@ +サソusing System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Resources; + +// 繧「繧サ繝ウ繝悶Μ縺ォ髢「縺吶k荳闊ャ諠蝣ア縺ッ莉・荳九ョ螻樊ァ繧サ繝繝医r縺ィ縺翫@縺ヲ蛻カ蠕。縺輔l縺セ縺吶 +// 繧「繧サ繝ウ繝悶Μ縺ォ髢「騾」莉倥¢繧峨l縺ヲ縺繧区ュ蝣ア繧貞、画峩縺吶k縺ォ縺ッ縲 +// 縺薙l繧峨ョ螻樊ァ蛟、繧貞、画峩縺励※縺上□縺輔>縲 +[assembly: AssemblyTitle( "FDK繝ゥ繧、繝悶Λ繝ェ" )] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct( "FDK繝ゥ繧、繝悶Λ繝ェ ver.21" )] +[assembly: AssemblyCopyright( "Copyright(C) 2000-2013 DTXMania Group" )] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +//[assembly: AssemblyKeyName( "FROMsCspContainer" )] + +// ComVisible 繧 false 縺ォ險ュ螳壹☆繧九→縲√◎縺ョ蝙九ッ縺薙ョ繧「繧サ繝ウ繝悶Μ蜀縺ァ COM 繧ウ繝ウ繝昴シ繝阪Φ繝医°繧 +// 蜿らァ荳榊庄閭ス縺ォ縺ェ繧翫∪縺吶COM 縺九i縺薙ョ繧「繧サ繝ウ繝悶Μ蜀縺ョ蝙九↓繧「繧ッ繧サ繧ケ縺吶k蝣エ蜷医ッ縲 +// 縺昴ョ蝙九ョ ComVisible 螻樊ァ繧 true 縺ォ險ュ螳壹@縺ヲ縺上□縺輔>縲 +[assembly: ComVisible(false)] + +// 谺。縺ョ GUID 縺ッ縲√%縺ョ繝励Ο繧ク繧ァ繧ッ繝医′ COM 縺ォ蜈ャ髢九&繧後k蝣エ蜷医ョ縲》ypelib 縺ョ ID 縺ァ縺 +[assembly: Guid("c5f9e698-bec1-4d94-b8a4-3e39b636ccb8")] + +// 繧「繧サ繝ウ繝悶Μ縺ョ繝舌シ繧ク繝ァ繝ウ諠蝣ア縺ッ縲∽サ・荳九ョ 4 縺、縺ョ蛟、縺ァ讒区舌&繧後※縺縺セ縺: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 縺吶∋縺ヲ縺ョ蛟、繧呈欠螳壹☆繧九°縲∽ク九ョ繧医≧縺ォ '*' 繧剃スソ縺」縺ヲ繝薙Ν繝峨♀繧医ウ繝ェ繝薙ず繝ァ繝ウ逡ェ蜿キ繧 +// 譌「螳壼、縺ォ縺吶k縺薙→縺後〒縺阪∪縺: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "21.0.0.0" )] +[assembly: AssemblyFileVersion( "21.0.0.0" )] +[assembly: NeutralResourcesLanguageAttribute("ja-JP")] diff --git a/FDK19/packages.config b/FDK19/packages.config new file mode 100644 index 00000000..5dd07c98 --- /dev/null +++ b/FDK19/packages.config @@ -0,0 +1,11 @@ +サソ + + + + + + + + + + \ No newline at end of file diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CActivity.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CActivity.cs new file mode 100644 index 00000000..6afd9ae7 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CActivity.cs @@ -0,0 +1,176 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; + +namespace FDK +{ + public class CActivity + { + // 繝励Ο繝代ユ繧」 + + public bool b豢サ諤ァ蛹悶@縺ヲ繧 { get; private set; } + public bool b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 + { + get + { + return !this.b豢サ諤ァ蛹悶@縺ヲ繧; + } + set + { + this.b豢サ諤ァ蛹悶@縺ヲ繧 = !value; + } + } + public List list蟄植ctivities; + + /// + /// 蛻昴a縺ヲ On騾イ陦梧緒逕サ() 繧貞他縺ウ蜃コ縺吝エ蜷医↓ true 繧堤、コ縺吶ゑシOn豢サ諤ァ蛹() 蜀縺ァ true 縺ォ繧サ繝繝医&繧後k縲ゑシ + /// 縺薙ョ繝輔Λ繧ー縺ッ縲^n豢サ諤ァ蛹() 縺ァ縺ッ陦後∴縺ェ縺繧ソ繧、繝溘Φ繧ー縺ョ繧キ繝薙い縺ェ蛻晄悄蛹悶r On騾イ陦梧緒逕サ() 縺ァ陦後≧縺溘a縺ォ貅門y縺輔l縺ヲ縺繧九ょ茜逕ィ縺ッ蠢鬆医〒縺ッ縺ェ縺縲 + /// On騾イ陦梧緒逕サ() 蛛エ縺ァ縺ッ縲∝ソ隕√↑蛻晄悄蛹悶r霑ス縺医◆繧 false 繧偵そ繝繝医☆繧九%縺ィ縲 + /// + protected bool b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = true; + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CActivity() + { + this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + this.list蟄植ctivities = new List(); + } + + + // 繝ゥ繧、繝輔し繧、繧ッ繝ォ繝。繧ス繝繝 + + #region [ 蟄舌け繝ゥ繧ケ縺ァ蠢隕√↑繧ゅョ縺ョ縺ソ override 縺吶k縺薙→縲] + //----------------- + + public virtual void On豢サ諤ァ蛹() + { + // 縺吶〒縺ォ豢サ諤ァ蛹悶@縺ヲ繧九↑繧我ス輔b縺励↑縺縲 + if( this.b豢サ諤ァ蛹悶@縺ヲ繧 ) + return; + + this.b豢サ諤ァ蛹悶@縺ヲ繧 = true; // 縺薙ョ繝輔Λ繧ー縺ッ縲∽サ・荳九ョ蜃ヲ逅繧偵☆繧句燕縺ォ繧サ繝繝医☆繧九 + + // 閾ェ霄ォ縺ョ繝ェ繧ス繝シ繧ケ繧剃ス懈舌☆繧九 + this.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + this.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + + // 縺吶∋縺ヲ縺ョ蟄 Activity 繧呈エサ諤ァ蛹悶☆繧九 + foreach( CActivity activity in this.list蟄植ctivities ) + activity.On豢サ諤ァ蛹(); + + // 縺昴ョ莉悶ョ蛻晄悄蛹 + this.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = true; + } + public virtual void On髱樊エサ諤ァ蛹() + { + // 豢サ諤ァ蛹悶@縺ヲ縺ェ縺縺ェ繧我ス輔b縺励↑縺縲 + if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return; + + // 閾ェ霄ォ縺ョ繝ェ繧ス繝シ繧ケ繧定ァ」謾セ縺吶k縲 + this.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + this.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + + // 縺吶∋縺ヲ縺ョ 蟄植ctivity 繧帝撼豢サ諤ァ蛹悶☆繧九 + foreach( CActivity activity in this.list蟄植ctivities ) + activity.On髱樊エサ諤ァ蛹(); + + this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; // 縺薙ョ繝輔Λ繧ー縺ッ縲∽サ・荳翫ョ繝。繧ス繝繝峨r蜻シ縺ウ蜃コ縺励◆蠕後↓繧サ繝繝医☆繧九 + } + + /// + /// Managed 繝ェ繧ス繝シ繧ケ縺ョ菴懈舌r陦後≧縲 + /// Direct3D 繝繝舌う繧ケ縺御ス懈舌&繧後◆逶エ蠕後↓蜻シ縺ウ蜃コ縺輔l繧九ョ縺ァ縲∬ェ蛻縺梧エサ諤ァ蛹悶@縺ヲ縺繧区凾縺ォ髯舌j縲 + /// Managed 繝ェ繧ス繝シ繧ケ繧剃ス懈撰シ医∪縺溘ッ蜀肴ァ狗ッ会シ峨☆繧九%縺ィ縲 + /// 縺縺、縺ゥ縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蜻シ縺ウ蜃コ縺輔l繧九°シ医>縺、Direct3D縺悟堺ス懈舌&繧後k縺具シ牙縺九i縺ェ縺縺ョ縺ァ縲 + /// 縺縺、菴墓凾蜻シ縺ウ蜃コ縺輔l縺ヲ繧ょ撫鬘檎┌縺繧医≧縺ォ繧ウ繝シ繝繧」繝ウ繧ー縺励※縺翫¥縺薙→縲 + /// + public virtual void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + // 豢サ諤ァ蛹悶@縺ヲ縺ェ縺縺ェ繧我ス輔b縺励↑縺縲 + if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return; + + // 縺吶∋縺ヲ縺ョ 蟄植ctivity 縺ョ Managed 繝ェ繧ス繝シ繧ケ繧剃ス懈舌☆繧九 + foreach( CActivity activity in this.list蟄植ctivities ) + activity.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + + /// + /// Unmanaged 繝ェ繧ス繝シ繧ケ縺ョ菴懈舌r陦後≧縲 + /// Direct3D 繝繝舌う繧ケ縺御ス懈舌∪縺溘ッ繝ェ繧サ繝繝医&繧後◆逶エ蠕後↓蜻シ縺ウ蜃コ縺輔l繧九ョ縺ァ縲∬ェ蛻縺梧エサ諤ァ蛹悶@縺ヲ縺繧区凾縺ォ髯舌j縲 + /// Unmanaged 繝ェ繧ス繝シ繧ケ繧剃ス懈撰シ医∪縺溘ッ蜀肴ァ狗ッ会シ峨☆繧九%縺ィ縲 + /// 縺縺、縺ゥ縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蜻シ縺ウ蜃コ縺輔l繧九°シ医>縺、Direct3D縺悟堺ス懈舌∪縺溘ッ繝ェ繧サ繝繝医&繧後k縺具シ牙縺九i縺ェ縺縺ョ縺ァ縲 + /// 縺縺、菴墓凾蜻シ縺ウ蜃コ縺輔l縺ヲ繧ょ撫鬘檎┌縺繧医≧縺ォ繧ウ繝シ繝繧」繝ウ繧ー縺励※縺翫¥縺薙→縲 + /// + public virtual void OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + // 豢サ諤ァ蛹悶@縺ヲ縺ェ縺縺ェ繧我ス輔b縺励↑縺縲 + if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return; + + // 縺吶∋縺ヲ縺ョ 蟄植ctivity 縺ョ Unmanaged 繝ェ繧ス繝シ繧ケ繧剃ス懈舌☆繧九 + foreach( CActivity activity in this.list蟄植ctivities ) + activity.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + + /// + /// Unmanaged 繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ繧定。後≧縲 + /// Direct3D 繝繝舌う繧ケ縺ョ隗」謾セ逶エ蜑阪∪縺溘ッ繝ェ繧サ繝繝育峩蜑阪↓蜻シ縺ウ蜃コ縺輔l繧九 + /// 縺縺、縺ゥ縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蜻シ縺ウ蜃コ縺輔l繧九°シ医>縺、Direct3D縺瑚ァ」謾セ縺セ縺溘ッ繝ェ繧サ繝繝医&繧後k縺具シ牙縺九i縺ェ縺縺ョ縺ァ縲 + /// 縺縺、菴墓凾蜻シ縺ウ蜃コ縺輔l縺ヲ繧ょ撫鬘檎┌縺繧医≧縺ォ繧ウ繝シ繝繧」繝ウ繧ー縺励※縺翫¥縺薙→縲 + /// + public virtual void OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + // 豢サ諤ァ蛹悶@縺ヲ縺ェ縺縺ェ繧我ス輔b縺励↑縺縲 + if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return; + + // 縺吶∋縺ヲ縺ョ 蟄植ctivity 縺ョ Unmanaged 繝ェ繧ス繝シ繧ケ繧定ァ」謾セ縺吶k縲 + foreach( CActivity activity in this.list蟄植ctivities ) + activity.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + /// + /// Managed 繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ繧定。後≧縲 + /// Direct3D 繝繝舌う繧ケ縺ョ隗」謾セ逶エ蜑阪↓蜻シ縺ウ蜃コ縺輔l繧九 + /// シUnmanaged 繝ェ繧ス繝シ繧ケ縺ィ縺ッ逡ー縺ェ繧翫.irect3D 繝繝舌う繧ケ縺ョ繝ェ繧サ繝繝域凾縺ォ縺ッ蜻シ縺ウ蜃コ縺輔l縺ェ縺縲ゑシ + /// 縺縺、縺ゥ縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蜻シ縺ウ蜃コ縺輔l繧九°シ医>縺、Direct3D縺瑚ァ」謾セ縺輔l繧九°シ牙縺九i縺ェ縺縺ョ縺ァ縲 + /// 縺縺、菴墓凾蜻シ縺ウ蜃コ縺輔l縺ヲ繧ょ撫鬘檎┌縺繧医≧縺ォ繧ウ繝シ繝繧」繝ウ繧ー縺励※縺翫¥縺薙→縲 + /// + public virtual void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + // 豢サ諤ァ蛹悶@縺ヲ縺ェ縺縺ェ繧我ス輔b縺励↑縺縲 + if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return; + + // 縺吶∋縺ヲ縺ョ 蟄植ctivity 縺ョ Managed 繝ェ繧ス繝シ繧ケ繧定ァ」謾セ縺吶k縲 + foreach( CActivity activity in this.list蟄植ctivities ) + activity.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + /// + /// 騾イ陦後→謠冗判繧定。後≧縲ゑシ医%繧後i縺ッ蛻髮「縺輔l縺壹√%縺ョシ代▽縺ョ繝。繧ス繝繝峨□縺代〒螳溯」縺吶k縲ゑシ + /// 縺薙ョ繝。繧ス繝繝峨ッ BeginScene() 縺ョ蠕後↓蜻シ縺ウ蜃コ縺輔l繧九ョ縺ァ縲√Γ繧ス繝繝牙縺ァ縺縺阪↑繧頑緒逕サ繧定。後▲縺ヲ縺九∪繧上↑縺縲 + /// + /// 莉サ諢上ョ謨エ謨ー縲ょ他縺ウ蜃コ縺怜縺ィ縺ョ謨エ蜷域ァ繧貞粋繧上○縺ヲ縺翫¥縺薙→縲 + public virtual int On騾イ陦梧緒逕サ() + { + // 豢サ諤ァ蛹悶@縺ヲ縺ェ縺縺ェ繧我ス輔b縺励↑縺縲 + if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return 0; + + + /* 縺薙%縺ァ騾イ陦後→謠冗判繧定。後≧縲*/ + + + // 謌サ繧雁、縺ィ縺昴ョ諢丞袖縺ッ蟄舌け繝ゥ繧ケ縺ァ閾ェ逕ア縺ォ豎コ繧√※縺縺縲 + return 0; + } + + //----------------- + #endregion + } +} \ No newline at end of file diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CCounter.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CCounter.cs new file mode 100644 index 00000000..d209aa9d --- /dev/null +++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CCounter.cs @@ -0,0 +1,315 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; + +namespace FDK +{ + /// + /// 荳螳夐俣髫斐〒蜊倡エ泌「怜刈縺吶k謨エ謨ーシ医き繧ヲ繝ウ繝亥、シ峨r謇ア縺縲 + /// + /// + /// 笳倶スソ縺譁ケ + /// 1.CCounter縺ョ螟画焚繧偵▽縺上k縲 + /// 2.CCounter繧堤函謌 + /// ctCounter = new CCounter( 0, 3, 10, CDTXMania.Timer ); + /// 3.騾イ陦後Γ繧ス繝繝峨r菴ソ逕ィ縺吶k縲 + /// 4.繧ヲ繝槭シ縲 + /// + /// double蛟、繧剃スソ縺蝣エ蜷医》騾イ陦慧b縲》騾イ陦鍬oopDb繧剃スソ縺縺薙→縲 + /// 縺セ縺溘‥ouble迚医〒縺ッ髢馴囈縺ョ蛟、縺ッ繝溘Μ遘貞腰菴阪〒縺ッ縺ェ縺上騾壼クク縺ョ遘貞腰菴阪↓縺ェ繧翫∪縺吶 + /// + public class CCounter + { + public bool b髢句ァ九@縺 + { + get; + set; + } + // 蛟、繝励Ο繝代ユ繧」 + public float n髢句ァ句、 + { + get; + private set; + } + public float n邨ゆコ蛟、 + { + get; + set; + } + public int n迴セ蝨ィ縺ョ蛟、 + { + get; + set; + } + + public double _n髢馴囈 + { + get + { + return this.n髢馴囈; + } + set + { + this.n髢馴囈 = value >= 0 ? value : value * -1; + } + } + + public float n迴セ蝨ィ縺ョ邨碁℃譎る俣ms + { + get; + set; + } + // 迥カ諷九励Ο繝代ユ繧」 + + public bool b騾イ陦御クュ + { + get { return (this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms != -1); } + } + public bool b蛛懈ュ「荳ュ + { + get { return !this.b騾イ陦御クュ; } + } + public bool b邨ゆコ蛟、縺ォ驕斐@縺 + { + get { return (this.n迴セ蝨ィ縺ョ蛟、 >= this.n邨ゆコ蛟、); } + } + public bool b邨ゆコ蛟、縺ォ驕斐@縺ヲ縺ェ縺 + { + get { return !this.b邨ゆコ蛟、縺ォ驕斐@縺; } + } + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CCounter() + { + this.timer = null; + this.n髢句ァ句、 = 0; + this.n邨ゆコ蛟、 = 0; + this.n迴セ蝨ィ縺ョ蛟、 = 0; + this.n迴セ蝨ィ縺ョ蛟、 = 0; + this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = CSoundTimer.n譛ェ菴ソ逕ィ; + } + + /// 逕滓舌→蜷梧凾縺ォ髢句ァ九☆繧九 + public CCounter(float n髢句ァ句、, float n邨ゆコ蛟、, float n髢馴囈ms, CTimer timer) + : this() + { + this.t髢句ァ(n髢句ァ句、, n邨ゆコ蛟、, n髢馴囈ms, timer); + } + + /// 逕滓舌→蜷梧凾縺ォ髢句ァ九☆繧九(double迚) + public CCounter(double db髢句ァ句、, double db邨ゆコ蛟、, double db髢馴囈, CSoundTimer timer) + : this() + { + this.t髢句ァ(db髢句ァ句、, db邨ゆコ蛟、, db髢馴囈 * 1000.0f, timer); + } + + + // 迥カ諷区桃菴懊Γ繧ス繝繝 + + /// + /// 繧ォ繧ヲ繝ウ繝医r髢句ァ九☆繧九 + /// + /// 譛蛻昴ョ繧ォ繧ヲ繝ウ繝亥、縲 + /// 譛蠕後ョ繧ォ繧ヲ繝ウ繝亥、縲 + /// 繧ォ繧ヲ繝ウ繝亥、繧抵シ大「怜刈縺輔○繧九ョ縺ォ縺九¢繧区凾髢難シ医Α繝ェ遘貞腰菴搾シ峨 + /// 繧ォ繧ヲ繝ウ繝医↓菴ソ逕ィ縺吶k繧ソ繧、繝槭 + public void t髢句ァ(float n髢句ァ句、, float n邨ゆコ蛟、, float n髢馴囈ms, CTimer timer) + { + this.n髢句ァ句、 = n髢句ァ句、; + this.n邨ゆコ蛟、 = n邨ゆコ蛟、; + this._n髢馴囈 = n髢馴囈ms; + this.timer = timer; + this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = this.timer.n迴セ蝨ィ譎ょ綾; + this.n迴セ蝨ィ縺ョ蛟、 = (int)n髢句ァ句、; + this.b髢句ァ九@縺 = true; + } + + /// + /// 繧ォ繧ヲ繝ウ繝医r髢句ァ九☆繧九(double迚) + /// + /// 譛蛻昴ョ繧ォ繧ヲ繝ウ繝亥、縲 + /// 譛蠕後ョ繧ォ繧ヲ繝ウ繝亥、縲 + /// 繧ォ繧ヲ繝ウ繝亥、繧抵シ大「怜刈縺輔○繧九ョ縺ォ縺九¢繧区凾髢難シ育ァ貞腰菴搾シ峨 + /// 繧ォ繧ヲ繝ウ繝医↓菴ソ逕ィ縺吶k繧ソ繧、繝槭 + public void t髢句ァ(double db髢句ァ句、, double db邨ゆコ蛟、, double db髢馴囈, CSoundTimer timer) + { + this.n髢句ァ句、 = (float)db髢句ァ句、; + this.n邨ゆコ蛟、 = (float)db邨ゆコ蛟、; + this._n髢馴囈 = db髢馴囈; + this.timerdb = timer; + this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = (float)this.timerdb.db繧キ繧ケ繝繝譎ょ綾; + this.n迴セ蝨ィ縺ョ蛟、 = (int)db髢句ァ句、; + this.b髢句ァ九@縺 = true; + } + + /// + /// 蜑榊屓縺ョ t騾イ陦() 縺ョ蜻シ縺ウ蜃コ縺励°繧峨ョ邨碁℃譎る俣繧偵b縺ィ縺ォ縲∝ソ隕√↑縺縺代き繧ヲ繝ウ繝亥、繧貞「怜刈縺輔○繧九 + /// 繧ォ繧ヲ繝ウ繝亥、縺檎オゆコ蛟、縺ォ驕斐@縺ヲ縺繧句エ蜷医ッ縲√◎繧御サ・荳雁「怜刈縺励↑縺シ育オゆコ蛟、繧堤カュ謖√☆繧具シ峨 + /// + public void t騾イ陦() + { + if ((this.timer != null) && (this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms != CTimer.n譛ェ菴ソ逕ィ)) + { + long num = this.timer.n迴セ蝨ィ譎ょ綾; + if (num < this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms) + this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = num; + + while ((num - this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms) >= this.n髢馴囈) + { + if (++this.n迴セ蝨ィ縺ョ蛟、 > this.n邨ゆコ蛟、) + this.n迴セ蝨ィ縺ョ蛟、 = (int)this.n邨ゆコ蛟、; + + this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms += (float)this.n髢馴囈; + } + } + } + + /// + /// 蜑榊屓縺ョ t騾イ陦() 縺ョ蜻シ縺ウ蜃コ縺励°繧峨ョ邨碁℃譎る俣繧偵b縺ィ縺ォ縲∝ソ隕√↑縺縺代き繧ヲ繝ウ繝亥、繧貞「怜刈縺輔○繧九 + /// 繧ォ繧ヲ繝ウ繝亥、縺檎オゆコ蛟、縺ォ驕斐@縺ヲ縺繧句エ蜷医ッ縲√◎繧御サ・荳雁「怜刈縺励↑縺シ育オゆコ蛟、繧堤カュ謖√☆繧具シ峨 + /// + public void t騾イ陦慧b() + { + if ((this.timerdb != null) && (this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms != CSoundTimer.n譛ェ菴ソ逕ィ)) + { + double num = this.timerdb.n迴セ蝨ィ譎ょ綾; + if (num < this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms) + this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = (float)num; + + while ((num - this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms) >= this.n髢馴囈) + { + if (++this.n迴セ蝨ィ縺ョ蛟、 > this.n邨ゆコ蛟、) + this.n迴セ蝨ィ縺ョ蛟、 = (int)this.n邨ゆコ蛟、; + + this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms += (float)this.n髢馴囈; + } + } + } + + /// + /// 蜑榊屓縺ョ t騾イ陦鍬oop() 縺ョ蜻シ縺ウ蜃コ縺励°繧峨ョ邨碁℃譎る俣繧偵b縺ィ縺ォ縲∝ソ隕√↑縺縺代き繧ヲ繝ウ繝亥、繧貞「怜刈縺輔○繧九 + /// 繧ォ繧ヲ繝ウ繝亥、縺檎オゆコ蛟、縺ォ驕斐@縺ヲ縺繧句エ蜷医ッ縲∵ャ。縺ョ蠅怜刈繧ソ繧、繝溘Φ繧ー縺ァ髢句ァ句、縺ォ謌サ繧具シ亥、縺後Ν繝シ繝励☆繧具シ峨 + /// + public void t騾イ陦鍬oop() + { + if ((this.timer != null) && (this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms != CTimer.n譛ェ菴ソ逕ィ)) + { + long num = this.timer.n迴セ蝨ィ譎ょ綾; + if (num < this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms) + this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = num; + + while ((num - this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms) >= this.n髢馴囈) + { + if (++this.n迴セ蝨ィ縺ョ蛟、 > this.n邨ゆコ蛟、) + this.n迴セ蝨ィ縺ョ蛟、 = (int)this.n髢句ァ句、; + + this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms += (float)this.n髢馴囈; + } + } + } + + /// + /// 蜑榊屓縺ョ t騾イ陦鍬oop() 縺ョ蜻シ縺ウ蜃コ縺励°繧峨ョ邨碁℃譎る俣繧偵b縺ィ縺ォ縲∝ソ隕√↑縺縺代き繧ヲ繝ウ繝亥、繧貞「怜刈縺輔○繧九 + /// 繧ォ繧ヲ繝ウ繝亥、縺檎オゆコ蛟、縺ォ驕斐@縺ヲ縺繧句エ蜷医ッ縲∵ャ。縺ョ蠅怜刈繧ソ繧、繝溘Φ繧ー縺ァ髢句ァ句、縺ォ謌サ繧具シ亥、縺後Ν繝シ繝励☆繧具シ峨 + /// + public void t騾イ陦鍬oopDb() + { + if ((this.timerdb != null) && (this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms != CSoundTimer.n譛ェ菴ソ逕ィ)) + { + double num = this.timerdb.n迴セ蝨ィ譎ょ綾; + if (num < this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms) + this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = (float)num; + + while ((num - this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms) >= this.n髢馴囈) + { + if (++this.n迴セ蝨ィ縺ョ蛟、 > this.n邨ゆコ蛟、) + this.n迴セ蝨ィ縺ョ蛟、 = (int)this.n髢句ァ句、; + + this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms += (float)this.n髢馴囈; + } + } + } + + /// + /// 繧ォ繧ヲ繝ウ繝医r蛛懈ュ「縺吶k縲 + /// 縺薙l莉・髯阪↓ t騾イ陦() 繧 t騾イ陦鍬oop() 繧貞他縺ウ蜃コ縺励※繧ゆス輔b蜃ヲ逅縺輔l縺ェ縺縲 + /// + public void t蛛懈ュ「() + { + this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = CTimer.n譛ェ菴ソ逕ィ; + } + + public void t髢馴囈蛟、螟画峩(double Value) + { + this._n髢馴囈 = Value; + } + + // 縺昴ョ莉 + + #region [ 蠢懃畑シ壹く繝シ縺ョ蜿榊セゥ蜈・蜉帙r繧ィ繝溘Η繝ャ繝シ繧キ繝ァ繝ウ縺吶k ] + //----------------- + + /// + /// 縲恵繧ュ繝シ謚シ荳九榊シ墓焚縺 true 縺ョ髢謎クュ縲√荊繧ュ繝シ蜃ヲ逅縲阪ョ繝ェ繧イ繝シ繝亥シ墓焚繧貞他縺ウ蜃コ縺吶 + /// 縺溘□縺励2蝗樒岼縺ョ蜻シ縺ウ蜃コ縺励ッ1蝗樒岼縺九i 200ms 縺ョ髢薙r髢九¢縺ヲ縺九i陦後>縲3蝗樒岼莉・髯阪ョ蜻シ縺ウ蜃コ縺励ッ縺昴l縺槭l 30ms 縺ョ髢馴囈縺ァ蜻シ縺ウ蜃コ縺吶 + /// 縲恵繧ュ繝シ謚シ荳九阪′ false 縺ョ蝣エ蜷医ッ菴輔b縺帙★縲∝他縺ウ蜃コ縺怜屓謨ー繧 0 縺ォ繝ェ繧サ繝繝医☆繧九 + /// + /// 繧ュ繝シ縺梧款荳九&繧後※縺繧句エ蜷医ッ true縲 + /// 繧ュ繝シ縺梧款荳九&繧後※縺繧句エ蜷医↓螳溯。後☆繧句ヲ逅縲 + public void t繧ュ繝シ蜿榊セゥ(bool b繧ュ繝シ謚シ荳, DG繧ュ繝シ蜃ヲ逅 t繧ュ繝シ蜃ヲ逅) + { + const int n1蝗樒岼 = 0; + const int n2蝗樒岼 = 1; + const int n3蝗樒岼莉・髯 = 2; + + if (b繧ュ繝シ謚シ荳) + { + switch (this.n迴セ蝨ィ縺ョ蛟、) + { + case n1蝗樒岼: + + t繧ュ繝シ蜃ヲ逅(); + this.n迴セ蝨ィ縺ョ蛟、 = n2蝗樒岼; + this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = this.timer.n迴セ蝨ィ譎ょ綾; + return; + + case n2蝗樒岼: + + if ((this.timer.n迴セ蝨ィ譎ょ綾 - this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms) > 200) + { + t繧ュ繝シ蜃ヲ逅(); + this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = this.timer.n迴セ蝨ィ譎ょ綾; + this.n迴セ蝨ィ縺ョ蛟、 = n3蝗樒岼莉・髯; + } + return; + + case n3蝗樒岼莉・髯: + + if ((this.timer.n迴セ蝨ィ譎ょ綾 - this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms) > 30) + { + t繧ュ繝シ蜃ヲ逅(); + this.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = this.timer.n迴セ蝨ィ譎ょ綾; + } + return; + } + } + else + { + this.n迴セ蝨ィ縺ョ蛟、 = n1蝗樒岼; + } + } + public delegate void DG繧ュ繝シ蜃ヲ逅(); + + //----------------- + #endregion + + #region [ private ] + //----------------- + private CTimer timer; + private CSoundTimer timerdb; + private double n髢馴囈; + //----------------- + #endregion + } +} diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CCpuCores.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CCpuCores.cs new file mode 100644 index 00000000..02ecccfc --- /dev/null +++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CCpuCores.cs @@ -0,0 +1,26 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; + +namespace FDK +{ + public static class CpuCores + { + [DllImport("kernel32")] + public static extern void GetSystemInfo(ref SYSTEM_INFO ptmpsi); + [StructLayout(LayoutKind.Sequential)] + public struct SYSTEM_INFO { + public uint dwOemId; + public uint dwPageSize; + public uint lpMinimumApplicationAddress; + public uint lpMaximumApplicationAddress; + public uint dwActiveProcessorMask; + public uint dwNumberOfProcessors; + public uint dwProcessorType; + public uint dwAllocationGranularity; + public uint dwProcessorLevel; + public uint dwProcessorRevision; + } + } +} diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CFPS.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CFPS.cs new file mode 100644 index 00000000..1d67b950 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CFPS.cs @@ -0,0 +1,64 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; + +namespace FDK +{ + public class CFPS + { + // 繝励Ο繝代ユ繧」 + + public int n迴セ蝨ィ縺ョFPS + { + get; + private set; + } + public bool bFPS縺ョ蛟、縺悟、牙喧縺励◆ + { + get; + private set; + } + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CFPS() + { + this.n迴セ蝨ィ縺ョFPS = 0; + this.timer = new CTimer( CTimer.E遞ョ蛻・.MultiMedia ); + this.蝓コ轤ケ譎ょ綾ms = this.timer.n迴セ蝨ィ譎ょ綾; + this.蜀驛ィFPS = 0; + this.bFPS縺ョ蛟、縺悟、牙喧縺励◆ = false; + } + + + // 繝。繧ス繝繝 + + public void t繧ォ繧ヲ繝ウ繧ソ譖エ譁ー() + { + this.timer.t譖エ譁ー(); + this.bFPS縺ョ蛟、縺悟、牙喧縺励◆ = false; + + const long INTERVAL = 1000; + while( ( this.timer.n迴セ蝨ィ譎ょ綾 - this.蝓コ轤ケ譎ょ綾ms ) >= INTERVAL ) + { + this.n迴セ蝨ィ縺ョFPS = this.蜀驛ィFPS; + this.蜀驛ィFPS = 0; + this.bFPS縺ョ蛟、縺悟、牙喧縺励◆ = true; + this.蝓コ轤ケ譎ょ綾ms += INTERVAL; + } + this.蜀驛ィFPS++; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private CTimer timer; + private long 蝓コ轤ケ譎ょ綾ms; + private int 蜀驛ィFPS; + //----------------- + #endregion + } +} diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CIniFile.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CIniFile.cs new file mode 100644 index 00000000..a6422a6c --- /dev/null +++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CIniFile.cs @@ -0,0 +1,134 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Diagnostics; + +namespace FDK +{ + /// + /// 豎守畑逧縺ェ .ini繝輔ぃ繧、繝ォ繧呈桶縺縲 + /// + public class CIniFile + { + // 繝励Ο繝代ユ繧」 + + public string str繝輔ぃ繧、繝ォ蜷 + { + get; + private set; + } + public List Sections + { + get; + set; + } + public class CSection + { + public string str繧サ繧ッ繧キ繝ァ繝ウ蜷 = ""; + public List> list繝代Λ繝。繝シ繧ソ繝ェ繧ケ繝 = new List>(); + } + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CIniFile() + { + this.str繝輔ぃ繧、繝ォ蜷 = ""; + this.Sections = new List(); + } + public CIniFile( string str繝輔ぃ繧、繝ォ蜷 ) + :this() + { + this.t隱ュ縺ソ霎シ縺ソ( str繝輔ぃ繧、繝ォ蜷 ); + } + + + // 繝。繧ス繝繝 + + public void t隱ュ縺ソ霎シ縺ソ( string str繝輔ぃ繧、繝ォ蜷 ) + { + this.str繝輔ぃ繧、繝ォ蜷 = str繝輔ぃ繧、繝ォ蜷; + + StreamReader sr = null; + CSection section = null; + try + { + sr = new StreamReader( this.str繝輔ぃ繧、繝ォ蜷, Encoding.GetEncoding( "Shift_JIS" ) ); // 繝輔ぃ繧、繝ォ縺悟ュ伜惠縺励↑縺蝣エ蜷医ッ萓句、也匱逕溘 + + string line; + while( ( line = sr.ReadLine() ) != null ) + { + line = line.Replace( '\t', ' ' ).TrimStart( new char[] { '\t', ' ' } ); + if( string.IsNullOrEmpty( line ) || line[ 0 ] == ';' ) // ';'莉・髯阪ッ繧ウ繝。繝ウ繝医→縺励※辟。隕 + continue; + + if( line[ 0 ] == '[' ) + { + #region [ 繧サ繧ッ繧キ繝ァ繝ウ縺ョ螟画峩 ] + //----------------------------- + var builder = new StringBuilder( 32 ); + int num = 1; + while( ( num < line.Length ) && ( line[ num ] != ']' ) ) + builder.Append( line[ num++ ] ); + + // 螟画焚 section 縺御スソ逕ィ荳ュ縺ョ蝣エ蜷医ッ縲´ist 縺ォ霑ス蜉縺励※譁ー縺励> section 繧剃ス懈舌☆繧九 + if( section != null ) + this.Sections.Add( section ); + + section = new CSection(); + section.str繧サ繧ッ繧キ繝ァ繝ウ蜷 = builder.ToString(); + //----------------------------- + #endregion + + continue; + } + + string[] strArray = line.Split( new char[] { '=' } ); + if( strArray.Length != 2 ) + continue; + + string key = strArray[ 0 ].Trim(); + string value = strArray[ 1 ].Trim(); + + if( section != null && !string.IsNullOrEmpty( key ) && !string.IsNullOrEmpty( value ) ) + section.list繝代Λ繝。繝シ繧ソ繝ェ繧ケ繝.Add( new KeyValuePair( key, value ) ); + } + + if( section != null ) + this.Sections.Add( section ); + } + finally + { + if( sr != null ) + sr.Close(); + } + } + public void t譖ク縺榊コ縺( string str繝輔ぃ繧、繝ォ蜷 ) + { + this.str繝輔ぃ繧、繝ォ蜷 = str繝輔ぃ繧、繝ォ蜷; + this.t譖ク縺榊コ縺(); + } + public void t譖ク縺榊コ縺() + { + StreamWriter sw = null; + try + { + sw = new StreamWriter( this.str繝輔ぃ繧、繝ォ蜷, false, Encoding.GetEncoding( "Shift_JIS" ) ); // 繧ェ繝シ繝励Φ螟ア謨励ョ蝣エ蜷医ッ萓句、也匱逕溘 + + foreach( CSection section in this.Sections ) + { + sw.WriteLine( "[{0}]", section.str繧サ繧ッ繧キ繝ァ繝ウ蜷 ); + + foreach( KeyValuePair kvp in section.list繝代Λ繝。繝シ繧ソ繝ェ繧ケ繝 ) + sw.WriteLine( "{0}={1}", kvp.Key, kvp.Value ); + } + } + finally + { + if( sw != null ) + sw.Close(); + } + } + } +} diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CJudgeTextEncoding.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CJudgeTextEncoding.cs new file mode 100644 index 00000000..9d2952e5 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CJudgeTextEncoding.cs @@ -0,0 +1,81 @@ +サソusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; +using System.Diagnostics; + +namespace TJAPlayer3 +{ + public class CJudgeTextEncoding + { + /// + /// Hnc8讒倥ョReadJEnc繧剃スソ逕ィ縺励※譁蟄励さ繝シ繝峨ョ蛻、蛻・繧偵☆繧九 + /// + public static Encoding JudgeFileEncoding(string path) + { + if (!File.Exists(path)) return null; + Encoding enc; + FileInfo file = new FileInfo(path); + + using (Hnx8.ReadJEnc.FileReader reader = new Hnx8.ReadJEnc.FileReader(file)) + { + // 蛻、蛻・隱ュ縺ソ蜃コ縺怜ョ溯。後ょ愛蛻・邨先棡縺ッRead繝。繧ス繝繝峨ョ謌サ繧雁、縺ァ謚頑升縺ァ縺阪∪縺 + Hnx8.ReadJEnc.CharCode c = reader.Read(file); + // 謌サ繧雁、縺ョName繝励Ο繝代ユ繧」縺九i譁蟄励さ繝シ繝牙錐繧貞叙蠕励〒縺阪∪縺 + string name = c.Name; + Console.WriteLine("縲" + name + "縲" + file.Name); + // GetEncoding()繧貞他縺ウ蜃コ縺吶→縲√お繝ウ繧ウ繝シ繝繧」繝ウ繧ー繧貞叙蠕励〒縺阪∪縺 + enc = c.GetEncoding(); + } + Debug.Print(path + " Encoding=" + enc.CodePage); + + if (enc == null) + { + enc = Encoding.GetEncoding(932); + } + return enc; + } + /// + /// Hnc8讒倥ョReadJEnc繧剃スソ逕ィ縺励※繝繧ュ繧ケ繝医ヵ繧。繧、繝ォ繧定ェュ縺ソ霎シ繧縲 + /// 謾ケ陦梧枚蟄励ッ縲∝享謇九↓\n縺ォ邨ア荳縺吶k + /// + /// + /// + public static string ReadTextFile(string path) + { + if (!File.Exists(path)) return null; + string str = null; + FileInfo file = new FileInfo(path); + + using (Hnx8.ReadJEnc.FileReader reader = new Hnx8.ReadJEnc.FileReader(file)) + { + reader.Read(file); + str = reader.Text; + } + + str = str.Replace(JudgeNewLine(str), "\n"); + + return str; + } + + /// + /// Environment.NewLine縺ッ繝励Λ繝繝医ヵ繧ゥ繝シ繝萓晏ュ倥〒縺ゅk縲 + /// 縺縺後√ヵ繧。繧、繝ォ縺斐→縺ォ謾ケ陦後さ繝シ繝峨ッ驕輔≧縺ョ縺ァ縲∽スソ逕ィ縺吶∋縺阪〒縺ッ縺ェ縺縲 + /// 縺ェ縺ョ縺ァ縲∝享謇九↓謾ケ陦梧枚蟄励r蛻、譁ュ縺吶k縲 + /// + /// + /// + public static string JudgeNewLine(string str) + { + if (str.Contains("\r\n")) + return ("\r\n"); + + if (str.Contains("\r")) + return ("\r"); + + return ("\n"); + } + + } +} \ No newline at end of file diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/COS.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/COS.cs new file mode 100644 index 00000000..cb339761 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/COS.cs @@ -0,0 +1,35 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; + +namespace FDK +{ + public static class COS + { + /// + /// OS縺傾P莉・蜑阪↑繧映alse, Vista莉・髯阪↑繧液rue繧定ソ斐☆ + /// + /// + public static bool bIsVistaOrLater + { + get + { + //繝励Λ繝繝医ヵ繧ゥ繝シ繝縺ョ蜿門セ + System.OperatingSystem os = System.Environment.OSVersion; + if ( os.Platform != PlatformID.Win32NT ) // NT邉サ縺ァ縺ェ縺代l縺ー縲々P莉・蜑阪°縲 ̄C Windows邉サ莉・螟悶ョOS縺ョ縺溘a縲〃ista莉・髯阪〒縺ッ縺ェ縺縲ゅh縺」縺ヲfalse繧定ソ斐☆縲 + { + return false; + } + + if ( os.Version.Major >= 6 ) + { + return true; + } + else + { + return false; + } + } + } + } +} diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CPowerManagement.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CPowerManagement.cs new file mode 100644 index 00000000..a746a413 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CPowerManagement.cs @@ -0,0 +1,28 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; + +namespace FDK +{ + /// + /// 繧キ繧ケ繝繝縺ィ繝「繝九ち縺ョ逵髮サ蜉帛宛蠕。繧定。後≧ + /// + public static class CPowerManagement + { + /// + /// 譛ャ菴/繝「繝九ち縺ョ逵髮サ蜉帙Δ繝シ繝臥ァサ陦後r謚第ュ「縺吶k + /// + public static void tDisableMonitorSuspend() + { + CWin32.SetThreadExecutionState( CWin32.ExecutionState.SystemRequired | CWin32.ExecutionState.DisplayRequired ); + } + + /// + /// 譛ャ菴/繝「繝九ち縺ョ逵髮サ蜉帙Δ繝シ繝臥ァサ陦梧椛蛻カ繧定ァ」髯、縺吶k + /// + public static void tEnableMonitorSuspend() + { + CWin32.SetThreadExecutionState( CWin32.ExecutionState.Continuous ); // 繧ケ繝ェ繝シ繝玲椛豁「迥カ諷九r隗」髯、 + } + } +} diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CSendMessage.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CSendMessage.cs new file mode 100644 index 00000000..80d84109 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CSendMessage.cs @@ -0,0 +1,33 @@ +サソusing System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Diagnostics; +using System.Text; + +namespace FDK +{ + public static class CSendMessage + { + + [DllImport( "USER32.dll" )] + static extern uint SendMessage( IntPtr window, int msg, IntPtr wParam, ref SampleFramework.COPYDATASTRUCT lParam ); + + + public static uint sendmessage( IntPtr MainWindowHandle, IntPtr FromWindowHandle, string arg) + { + uint len = (uint) arg.Length; + + SampleFramework.COPYDATASTRUCT cds; + cds.dwData = IntPtr.Zero; // 菴ソ逕ィ縺励↑縺 + cds.lpData = Marshal.StringToHGlobalUni( arg ); // 繝繧ュ繧ケ繝医ョ繝昴う繝ウ繧ソ繝シ繧偵そ繝繝 + cds.cbData = ( len + 1 ) * 2; // 髟キ縺輔r繧サ繝繝 + + //譁蟄怜励r騾√k + uint result = SendMessage( MainWindowHandle, SampleFramework.WindowConstants.WM_COPYDATA, FromWindowHandle, ref cds ); + + Marshal.FreeHGlobal( cds.lpData ); + + return result; + } + } +} diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CTimer.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CTimer.cs new file mode 100644 index 00000000..d9e9fbb4 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CTimer.cs @@ -0,0 +1,162 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Diagnostics; +using DirectShowLib; + +namespace FDK +{ + public class CTimer : CTimerBase + { + public enum E遞ョ蛻・ + { + Unknown = -1, + PerformanceCounter = 0, + MultiMedia = 1, + GetTickCount = 2, + } + public E遞ョ蛻・ e繧ソ繧、繝樒ィョ蛻・ + { + get; + protected set; + } + + + public override long n繧キ繧ケ繝繝譎ょ綾ms + { + get + { + switch( this.e繧ソ繧、繝樒ィョ蛻・ ) + { + case E遞ョ蛻・.PerformanceCounter: + { + double num = 0.0; + if( this.n迴セ蝨ィ縺ョ蜻ィ豕「謨ー != 0L ) + { + long x = 0L; + QueryPerformanceCounter( ref x ); + num = ( (double) x ) / ( ( (double) this.n迴セ蝨ィ縺ョ蜻ィ豕「謨ー ) / 1000.0 ); + } + return (long) num; + } + case E遞ョ蛻・.MultiMedia: + return (long) timeGetTime(); + + case E遞ョ蛻・.GetTickCount: + return (long) Environment.TickCount; + } + return 0; + } + } + + public CTimer( E遞ョ蛻・ e繧ソ繧、繝樒ィョ蛻・ ) + :base() + { + this.e繧ソ繧、繝樒ィョ蛻・ = e繧ソ繧、繝樒ィョ蛻・; + + if( n蜿らァ繧ォ繧ヲ繝ウ繝[ (int) this.e繧ソ繧、繝樒ィョ蛻・ ] == 0 ) + { + switch( this.e繧ソ繧、繝樒ィョ蛻・ ) + { + case E遞ョ蛻・.PerformanceCounter: + if( !this.b遒コ隱阪→險ュ螳喟PerformanceCounter() && !this.b遒コ隱阪→險ュ螳喟MultiMedia() ) + this.b遒コ隱阪→險ュ螳喟GetTickCount(); + break; + + case E遞ョ蛻・.MultiMedia: + if( !this.b遒コ隱阪→險ュ螳喟MultiMedia() && !this.b遒コ隱阪→險ュ螳喟PerformanceCounter() ) + this.b遒コ隱阪→險ュ螳喟GetTickCount(); + break; + + case E遞ョ蛻・.GetTickCount: + this.b遒コ隱阪→險ュ螳喟GetTickCount(); + break; + + default: + throw new ArgumentException( string.Format( "譛ェ遏・縺ョ繧ソ繧、繝樒ィョ蛻・縺ァ縺吶[{0}]", this.e繧ソ繧、繝樒ィョ蛻・ ) ); + } + } + + base.t繝ェ繧サ繝繝(); + + n蜿らァ繧ォ繧ヲ繝ウ繝[ (int) this.e繧ソ繧、繝樒ィョ蛻・ ]++; + } + + public override void Dispose() + { + if( this.e繧ソ繧、繝樒ィョ蛻・ == E遞ョ蛻・.Unknown ) + return; + + int type = (int) this.e繧ソ繧、繝樒ィョ蛻・; + + n蜿らァ繧ォ繧ヲ繝ウ繝[ type ] = Math.Max( n蜿らァ繧ォ繧ヲ繝ウ繝[ type ] - 1, 0 ); + + if( n蜿らァ繧ォ繧ヲ繝ウ繝[ type ] == 0 ) + { + if( this.e繧ソ繧、繝樒ィョ蛻・ == E遞ョ蛻・.MultiMedia ) + timeEndPeriod( this.timeCaps.wPeriodMin ); + } + + this.e繧ソ繧、繝樒ィョ蛻・ = E遞ョ蛻・.Unknown; + } + + #region [ protected ] + //----------------- + protected long n迴セ蝨ィ縺ョ蜻ィ豕「謨ー; + protected static int[] n蜿らァ繧ォ繧ヲ繝ウ繝 = new int[ 3 ]; + protected TimeCaps timeCaps; + + protected bool b遒コ隱阪→險ュ螳喟GetTickCount() + { + this.e繧ソ繧、繝樒ィョ蛻・ = E遞ョ蛻・.GetTickCount; + return true; + } + protected bool b遒コ隱阪→險ュ螳喟MultiMedia() + { + this.timeCaps = new TimeCaps(); + if( ( timeGetDevCaps( out this.timeCaps, (uint) Marshal.SizeOf( typeof( TimeCaps ) ) ) == 0 ) && ( this.timeCaps.wPeriodMin < 10 ) ) + { + this.e繧ソ繧、繝樒ィョ蛻・ = E遞ョ蛻・.MultiMedia; + timeBeginPeriod( this.timeCaps.wPeriodMin ); + return true; + } + return false; + } + protected bool b遒コ隱阪→險ュ螳喟PerformanceCounter() + { + if( QueryPerformanceFrequency( ref this.n迴セ蝨ィ縺ョ蜻ィ豕「謨ー ) != 0 ) + { + this.e繧ソ繧、繝樒ィョ蛻・ = E遞ョ蛻・.PerformanceCounter; + return true; + } + return false; + } + //----------------- + #endregion + + #region [ DllImport ] + //----------------- + [DllImport( "kernel32.dll" )] + protected static extern short QueryPerformanceCounter( ref long x ); + [DllImport( "kernel32.dll" )] + protected static extern short QueryPerformanceFrequency( ref long x ); + [DllImport( "winmm.dll" )] + protected static extern void timeBeginPeriod( uint x ); + [DllImport( "winmm.dll" )] + protected static extern void timeEndPeriod( uint x ); + [DllImport( "winmm.dll" )] + protected static extern uint timeGetDevCaps( out TimeCaps timeCaps, uint size ); + [DllImport( "winmm.dll" )] + protected static extern uint timeGetTime(); + + [StructLayout( LayoutKind.Sequential )] + protected struct TimeCaps + { + public uint wPeriodMin; + public uint wPeriodMax; + } + //----------------- + #endregion + } +} diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CTimerBase.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CTimerBase.cs new file mode 100644 index 00000000..1e96177d --- /dev/null +++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CTimerBase.cs @@ -0,0 +1,179 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; + +namespace FDK +{ + /// + /// 繧ソ繧、繝槭ョ謚ス雎。繧ッ繝ゥ繧ケ縲 + /// 縺薙ョ繧ッ繝ゥ繧ケ繧堤カ呎価縺励{verride 縺励◆繧ッ繝ゥ繧ケ繧剃ス懈舌☆繧九%縺ィ縺ァ縲∽ササ諢上ョ繧ッ繝ュ繝繧ッ繧呈戟縺、繧ソ繧、繝槭r菴懈舌〒縺阪k縲 + /// + public abstract class CTimerBase : IDisposable + { + public const long n譛ェ菴ソ逕ィ = -1; + + // 縺薙ョシ偵▽繧 override 縺吶k縲 + public abstract long n繧キ繧ケ繝繝譎ょ綾ms + { + get; + } + public double db繧キ繧ケ繝繝譎ょ綾ms + { + get; + set; + } + public abstract void Dispose(); + + #region [ DTXMania逕ィ縺ォ縲∬ェ槫ーセ縺ォms縺ョ縺、縺九↑縺螳」險繧定ソス蜉 ] + public long n繧キ繧ケ繝繝譎ょ綾 + { + get { return n繧キ繧ケ繝繝譎ょ綾ms; } + } + public long n迴セ蝨ィ譎ょ綾 + { + get { return n迴セ蝨ィ譎ょ綾ms; } + set { n迴セ蝨ィ譎ょ綾ms = value; } + } + public long n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾 + { + get { return n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms; } + } + + //double + public double db繧キ繧ケ繝繝譎ょ綾 + { + get { return db繧キ繧ケ繝繝譎ょ綾ms; } + } + public double db迴セ蝨ィ譎ょ綾 + { + get { return db迴セ蝨ィ譎ょ綾ms; } + set { db迴セ蝨ィ譎ょ綾ms = value; } + } + public double db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾 + { + get { return db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms; } + } + #endregion + + public long n迴セ蝨ィ譎ょ綾ms + { + get + { + if( this.n蛛懈ュ「謨ー > 0 ) + return ( this.n荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms - this.n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms ); + + return ( this.n譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms - this.n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms ); + } + set + { + if( this.n蛛懈ュ「謨ー > 0 ) + this.n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms = this.n荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms - value; + else + this.n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms = this.n譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms - value; + } + } + public long n繝ェ繧「繝ォ繧ソ繧、繝迴セ蝨ィ譎ょ綾ms + { + get + { + if( this.n蛛懈ュ「謨ー > 0 ) + return ( this.n荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms - this.n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms ); + + return ( this.n繧キ繧ケ繝繝譎ょ綾ms - this.n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms ); + } + } + public long n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms + { + get; + protected set; + } + + + public double db迴セ蝨ィ譎ょ綾ms + { + get + { + if( this.n蛛懈ュ「謨ー > 0 ) + return ( this.db荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms - this.db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms ); + + return ( this.db譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms - this.db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms ); + } + set + { + if( this.n蛛懈ュ「謨ー > 0 ) + this.db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms = this.db荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms - value; + else + this.db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms = this.db譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms - value; + } + } + public double db繝ェ繧「繝ォ繧ソ繧、繝迴セ蝨ィ譎ょ綾ms + { + get + { + if( this.n蛛懈ュ「謨ー > 0 ) + return ( this.db荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms - this.db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms ); + + return ( this.db繧キ繧ケ繝繝譎ょ綾ms - this.db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms ); + } + } + public double db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms + { + get; + protected set; + } + + public bool b蛛懈ュ「縺励※縺縺ェ縺 + { + get + { + return ( this.n蛛懈ュ「謨ー == 0 ); + } + } + + public void t繝ェ繧サ繝繝() + { + this.t譖エ譁ー(); + this.n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms = this.n譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms; + this.n荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms = this.n譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms; + this.n蛛懈ュ「謨ー = 0; + } + public void t荳譎ょ●豁「() + { + if( this.n蛛懈ュ「謨ー == 0 ) + { + this.n荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms = this.n譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms; + this.db荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms = this.db譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms; + } + + this.n蛛懈ュ「謨ー++; + } + public void t譖エ譁ー() + { + this.n譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms = this.n繧キ繧ケ繝繝譎ょ綾ms; + this.db譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms = this.db繧キ繧ケ繝繝譎ょ綾ms; + } + public void t蜀埼幕() + { + if( this.n蛛懈ュ「謨ー > 0 ) + { + this.n蛛懈ュ「謨ー--; + if( this.n蛛懈ュ「謨ー == 0 ) + { + this.t譖エ譁ー(); + this.n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms += this.n譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms - this.n荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms; + this.db蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾ms += this.db譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms - this.db荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms; + } + } + } + + #region [ protected ] + //----------------- + protected long n荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms = 0; + protected long n譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms = 0; + protected double db荳譎ょ●豁「繧キ繧ケ繝繝譎ょ綾ms = 0; + protected double db譖エ譁ー繧キ繧ケ繝繝譎ょ綾ms = 0; + protected int n蛛懈ュ「謨ー = 0; + //----------------- + #endregion + } +} diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CTraceLogListener.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CTraceLogListener.cs new file mode 100644 index 00000000..d89ff96c --- /dev/null +++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CTraceLogListener.cs @@ -0,0 +1,157 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Diagnostics; + +namespace FDK +{ + public class CTraceLogListener : TraceListener + { + public CTraceLogListener( StreamWriter stream ) + { + this.streamWriter = stream; + } + + public override void Flush() + { + if( this.streamWriter != null ) + { + try + { + this.streamWriter.Flush(); + } + catch( ObjectDisposedException ) + { + } + } + } + public override void TraceEvent( TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message ) + { + if( this.streamWriter != null ) + { + try + { + this.t繧、繝吶Φ繝育ィョ蛻・繧貞コ蜉帙☆繧( eventType ); + this.t繧、繝ウ繝繝ウ繝医r蜃コ蜉帙☆繧(); + this.streamWriter.WriteLine( message ); + } + catch( ObjectDisposedException ) + { + } + } + } + public override void TraceEvent( TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format, params object[] args ) + { + if( this.streamWriter != null ) + { + try + { + this.t繧、繝吶Φ繝育ィョ蛻・繧貞コ蜉帙☆繧( eventType ); + this.t繧、繝ウ繝繝ウ繝医r蜃コ蜉帙☆繧(); + this.streamWriter.WriteLine( string.Format( format, args ) ); + } + catch( ObjectDisposedException ) + { + } + } + } + public override void Write( string message ) + { + if( this.streamWriter != null ) + { + try + { + this.streamWriter.Write( message ); + } + catch( ObjectDisposedException ) + { + } + } + } + public override void WriteLine( string message ) + { + if( this.streamWriter != null ) + { + try + { + this.streamWriter.WriteLine( message ); + } + catch( ObjectDisposedException ) + { + } + } + } + + protected override void Dispose( bool disposing ) + { + if( this.streamWriter != null ) + { + try + { + this.streamWriter.Close(); + } + catch + { + } + this.streamWriter = null; + } + base.Dispose( disposing ); + } + + #region [ private ] + //----------------- + private StreamWriter streamWriter; + + private void t繧、繝吶Φ繝育ィョ蛻・繧貞コ蜉帙☆繧( TraceEventType eventType ) + { + if( this.streamWriter != null ) + { + try + { + var now = DateTime.Now; + this.streamWriter.Write( string.Format( "{0:D4}/{1:D2}/{2:D2} {3:D2}:{4:D2}:{5:D2}.{6:D3} ", new object[] { now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second, now.Millisecond } ) ); + switch( eventType ) + { + case TraceEventType.Error: + this.streamWriter.Write( "[ERROR] " ); + return; + + case ( TraceEventType.Error | TraceEventType.Critical ): + return; + + case TraceEventType.Warning: + this.streamWriter.Write( "[WARNING] " ); + return; + + case TraceEventType.Information: + break; + + default: + return; + } + this.streamWriter.Write( "[INFO] " ); + } + catch( ObjectDisposedException ) + { + } + } + } + private void t繧、繝ウ繝繝ウ繝医r蜃コ蜉帙☆繧() + { + if( ( this.streamWriter != null ) && ( base.IndentLevel > 0 ) ) + { + try + { + for( int i = 0; i < base.IndentLevel; i++ ) + this.streamWriter.Write( " " ); + } + catch( ObjectDisposedException ) + { + } + } + } + //----------------- + #endregion + } +} diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/CWin32.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CWin32.cs new file mode 100644 index 00000000..94b272ff --- /dev/null +++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/CWin32.cs @@ -0,0 +1,661 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; + +namespace FDK +{ + public class CWin32 + { + #region [ Win32 螳壽焚 ] + //----------------- + public const int S_OK = 0x00000000; + public const int S_FALSE = 0x00000001; + public const int E_FAIL = unchecked( (int) 0x80004005 ); + public const int E_ABORT = unchecked( (int) 0x80004004 ); + + public const int BROADCAST_QUERY_DENY = 0x424d5144; + + public const uint CALLBACK_FUNCTION = 0x30000; + public const uint ES_CONTINUOUS = 0x80000000; + public const uint ES_DISPLAY_REQUIRED = 2; + public const uint ES_SYSTEM_REQUIRED = 1; + public const uint ES_USER_PRESENT = 4; + + public const int GWL_EXSTYLE = -20; + public const int GWL_HINSTANCE = -6; + public const int GWL_HWNDPARENT = -8; + public const int GWL_ID = -12; + public const int GWL_STYLE = -16; + public const int GWL_USERDATA = -21; + public const int GWL_WNDPROC = -4; + + public static readonly IntPtr HWND_NOTOPMOST = new IntPtr( -2 ); + public static readonly IntPtr HWND_TOPMOST = new IntPtr( -1 ); + public const uint MAXPNAMELEN = 0x20; + + #region [ MIDI繝。繝繧サ繝シ繧ク ] + public const uint MIM_CLOSE = 0x3c2; + public const uint MIM_DATA = 0x3c3; + public const uint MIM_ERROR = 0x3c5; + public const uint MIM_LONGDATA = 0x3c4; + public const uint MIM_LONGERROR = 0x3c6; + public const uint MIM_OPEN = 0x3c1; + #endregion + + public const int MONITOR_DEFAULTTOPRIMARY = 1; + + public const int PBT_APMQUERYSTANDBY = 1; + public const int PBT_APMQUERYSUSPEND = 0; + + public const int SC_MONITORPOWER = 0xf170; + public const int SC_SCREENSAVE = 0xf140; + + public const int SIZE_MAXIMIZED = 2; + public const int SIZE_MINIMIZED = 1; + public const int SIZE_RESTORED = 0; + + public const uint SWP_FRAMECHANGED = 0x20; + public const uint SWP_HIDEWINDOW = 0x80; + public const uint SWP_NOACTIVATE = 0x10; + public const uint SWP_NOCOPYBITS = 0x100; + public const uint SWP_NOMOVE = 2; + public const uint SWP_NOOWNERZORDER = 0x200; + public const uint SWP_NOREDRAW = 8; + public const uint SWP_NOSENDCHANGING = 0x400; + public const uint SWP_NOSIZE = 1; + public const uint SWP_NOZORDER = 4; + public const uint SWP_SHOWWINDOW = 0x40; + + public const uint PM_NOREMOVE = 0; + public const uint PM_REMOVE = 1; + + #region [ DirectShow, VFW 髢「騾」 ] + //----------------- + public const int S_WARN_OUTPUTRESET = 0x00009DD4; + public const int E_NOTINTREE = unchecked( (int) 0x80040400 ); + public const int E_RENDER_ENGINE_IS_BROKEN = unchecked( (int) 0x80040401 ); + public const int E_MUST_INIT_RENDERER = unchecked( (int) 0x80040402 ); + public const int E_NOTDETERMINED = unchecked( (int) 0x80040403 ); + public const int E_NO_TIMELINE = unchecked( (int) 0x80040404 ); + + public const int VFW_E_INVALIDMEDIATYPE = unchecked( (int) 0x80040200 ); + public const int VFW_E_INVALIDSUBTYPE = unchecked( (int) 0x80040201 ); + public const int VFW_E_NEED_OWNER = unchecked( (int) 0x80040202 ); + public const int VFW_E_ENUM_OUT_OF_SYNC = unchecked( (int) 0x80040203 ); + public const int VFW_E_ALREADY_CONNECTED = unchecked( (int) 0x80040204 ); + public const int VFW_E_FILTER_ACTIVE = unchecked( (int) 0x80040205 ); + public const int VFW_E_NO_TYPES = unchecked( (int) 0x80040206 ); + public const int VFW_E_NO_ACCEPTABLE_TYPES = unchecked( (int) 0x80040207 ); + public const int VFW_E_INVALID_DIRECTION = unchecked( (int) 0x80040208 ); + public const int VFW_E_NOT_CONNECTED = unchecked( (int) 0x80040209 ); + public const int VFW_E_NO_ALLOCATOR = unchecked( (int) 0x8004020A ); + public const int VFW_E_RUNTIME_ERROR = unchecked( (int) 0x8004020B ); + public const int VFW_E_BUFFER_NOTSET = unchecked( (int) 0x8004020C ); + public const int VFW_E_BUFFER_OVERFLOW = unchecked( (int) 0x8004020D ); + public const int VFW_E_BADALIGN = unchecked( (int) 0x8004020E ); + public const int VFW_E_ALREADY_COMMITTED = unchecked( (int) 0x8004020F ); + public const int VFW_E_BUFFERS_OUTSTANDING = unchecked( (int) 0x80040210 ); + public const int VFW_E_NOT_COMMITTED = unchecked( (int) 0x80040211 ); + public const int VFW_E_SIZENOTSET = unchecked( (int) 0x80040212 ); + public const int VFW_E_NO_CLOCK = unchecked( (int) 0x80040213 ); + public const int VFW_E_NO_SINK = unchecked( (int) 0x80040214 ); + public const int VFW_E_NO_INTERFACE = unchecked( (int) 0x80040215 ); + public const int VFW_E_NOT_FOUND = unchecked( (int) 0x80040216 ); + public const int VFW_E_CANNOT_CONNECT = unchecked( (int) 0x80040217 ); + public const int VFW_E_CANNOT_RENDER = unchecked( (int) 0x80040218 ); + public const int VFW_E_CHANGING_FORMAT = unchecked( (int) 0x80040219 ); + public const int VFW_E_NO_COLOR_KEY_SET = unchecked( (int) 0x8004021A ); + public const int VFW_E_NOT_OVERLAY_CONNECTION = unchecked( (int) 0x8004021B ); + public const int VFW_E_NOT_SAMPLE_CONNECTION = unchecked( (int) 0x8004021C ); + public const int VFW_E_PALETTE_SET = unchecked( (int) 0x8004021D ); + public const int VFW_E_COLOR_KEY_SET = unchecked( (int) 0x8004021E ); + public const int VFW_E_NO_COLOR_KEY_FOUND = unchecked( (int) 0x8004021F ); + public const int VFW_E_NO_PALETTE_AVAILABLE = unchecked( (int) 0x80040220 ); + public const int VFW_E_NO_DISPLAY_PALETTE = unchecked( (int) 0x80040221 ); + public const int VFW_E_TOO_MANY_COLORS = unchecked( (int) 0x80040222 ); + public const int VFW_E_STATE_CHANGED = unchecked( (int) 0x80040223 ); + public const int VFW_E_NOT_STOPPED = unchecked( (int) 0x80040224 ); + public const int VFW_E_NOT_PAUSED = unchecked( (int) 0x80040225 ); + public const int VFW_E_NOT_RUNNING = unchecked( (int) 0x80040226 ); + public const int VFW_E_WRONG_STATE = unchecked( (int) 0x80040227 ); + public const int VFW_E_START_TIME_AFTER_END = unchecked( (int) 0x80040228 ); + public const int VFW_E_INVALID_RECT = unchecked( (int) 0x80040229 ); + public const int VFW_E_TYPE_NOT_ACCEPTED = unchecked( (int) 0x8004022A ); + public const int VFW_E_SAMPLE_REJECTED = unchecked( (int) 0x8004022B ); + public const int VFW_E_SAMPLE_REJECTED_EOS = unchecked( (int) 0x8004022C ); + public const int VFW_E_DUPLICATE_NAME = unchecked( (int) 0x8004022D ); + public const int VFW_S_DUPLICATE_NAME = 0x0004022D; + public const int VFW_E_TIMEOUT = unchecked( (int) 0x8004022E ); + public const int VFW_E_INVALID_FILE_FORMAT = unchecked( (int) 0x8004022F ); + public const int VFW_E_ENUM_OUT_OF_RANGE = unchecked( (int) 0x80040230 ); + public const int VFW_E_CIRCULAR_GRAPH = unchecked( (int) 0x80040231 ); + public const int VFW_E_NOT_ALLOWED_TO_SAVE = unchecked( (int) 0x80040232 ); + public const int VFW_E_TIME_ALREADY_PASSED = unchecked( (int) 0x80040233 ); + public const int VFW_E_ALREADY_CANCELLED = unchecked( (int) 0x80040234 ); + public const int VFW_E_CORRUPT_GRAPH_FILE = unchecked( (int) 0x80040235 ); + public const int VFW_E_ADVISE_ALREADY_SET = unchecked( (int) 0x80040236 ); + public const int VFW_S_STATE_INTERMEDIATE = 0x00040237; + public const int VFW_E_NO_MODEX_AVAILABLE = unchecked( (int) 0x80040238 ); + public const int VFW_E_NO_ADVISE_SET = unchecked( (int) 0x80040239 ); + public const int VFW_E_NO_FULLSCREEN = unchecked( (int) 0x8004023A ); + public const int VFW_E_IN_FULLSCREEN_MODE = unchecked( (int) 0x8004023B ); + public const int VFW_E_UNKNOWN_FILE_TYPE = unchecked( (int) 0x80040240 ); + public const int VFW_E_CANNOT_LOAD_SOURCE_FILTER = unchecked( (int) 0x80040241 ); + public const int VFW_S_PARTIAL_RENDER = 0x00040242; + public const int VFW_E_FILE_TOO_SHORT = unchecked( (int) 0x80040243 ); + public const int VFW_E_INVALID_FILE_VERSION = unchecked( (int) 0x80040244 ); + public const int VFW_S_SOME_DATA_IGNORED = 0x00040245; + public const int VFW_S_CONNECTIONS_DEFERRED = 0x00040246; + public const int VFW_E_INVALID_CLSID = unchecked( (int) 0x80040247 ); + public const int VFW_E_INVALID_MEDIA_TYPE = unchecked( (int) 0x80040248 ); + public const int VFW_E_SAMPLE_TIME_NOT_SET = unchecked( (int) 0x80040249 ); + public const int VFW_S_RESOURCE_NOT_NEEDED = 0x00040250; + public const int VFW_E_MEDIA_TIME_NOT_SET = unchecked( (int) 0x80040251 ); + public const int VFW_E_NO_TIME_FORMAT_SET = unchecked( (int) 0x80040252 ); + public const int VFW_E_MONO_AUDIO_HW = unchecked( (int) 0x80040253 ); + public const int VFW_S_MEDIA_TYPE_IGNORED = 0x00040254; + public const int VFW_E_NO_DECOMPRESSOR = unchecked( (int) 0x80040255 ); + public const int VFW_E_NO_AUDIO_HARDWARE = unchecked( (int) 0x80040256 ); + public const int VFW_S_VIDEO_NOT_RENDERED = 0x00040257; + public const int VFW_S_AUDIO_NOT_RENDERED = 0x00040258; + public const int VFW_E_RPZA = unchecked( (int) 0x80040259 ); + public const int VFW_S_RPZA = 0x0004025A; + public const int VFW_E_PROCESSOR_NOT_SUITABLE = unchecked( (int) 0x8004025B ); + public const int VFW_E_UNSUPPORTED_AUDIO = unchecked( (int) 0x8004025C ); + public const int VFW_E_UNSUPPORTED_VIDEO = unchecked( (int) 0x8004025D ); + public const int VFW_E_MPEG_NOT_CONSTRAINED = unchecked( (int) 0x8004025E ); + public const int VFW_E_NOT_IN_GRAPH = unchecked( (int) 0x8004025F ); + public const int VFW_S_ESTIMATED = 0x00040260; + public const int VFW_E_NO_TIME_FORMAT = unchecked( (int) 0x80040261 ); + public const int VFW_E_READ_ONLY = unchecked( (int) 0x80040262 ); + public const int VFW_S_RESERVED = 0x00040263; + public const int VFW_E_BUFFER_UNDERFLOW = unchecked( (int) 0x80040264 ); + public const int VFW_E_UNSUPPORTED_STREAM = unchecked( (int) 0x80040265 ); + public const int VFW_E_NO_TRANSPORT = unchecked( (int) 0x80040266 ); + public const int VFW_S_STREAM_OFF = 0x00040267; + public const int VFW_S_CANT_CUE = 0x00040268; + public const int VFW_E_BAD_VIDEOCD = unchecked( (int) 0x80040269 ); + public const int VFW_S_NO_STOP_TIME = 0x00040270; + public const int VFW_E_OUT_OF_VIDEO_MEMORY = unchecked( (int) 0x80040271 ); + public const int VFW_E_VP_NEGOTIATION_FAILED = unchecked( (int) 0x80040272 ); + public const int VFW_E_DDRAW_CAPS_NOT_SUITABLE = unchecked( (int) 0x80040273 ); + public const int VFW_E_NO_VP_HARDWARE = unchecked( (int) 0x80040274 ); + public const int VFW_E_NO_CAPTURE_HARDWARE = unchecked( (int) 0x80040275 ); + public const int VFW_E_DVD_OPERATION_INHIBITED = unchecked( (int) 0x80040276 ); + public const int VFW_E_DVD_INVALIDDOMAIN = unchecked( (int) 0x80040277 ); + public const int VFW_E_DVD_NO_BUTTON = unchecked( (int) 0x80040278 ); + public const int VFW_E_DVD_GRAPHNOTREADY = unchecked( (int) 0x80040279 ); + public const int VFW_E_DVD_RENDERFAIL = unchecked( (int) 0x8004027A ); + public const int VFW_E_DVD_DECNOTENOUGH = unchecked( (int) 0x8004027B ); + public const int VFW_E_DVD_NOT_IN_KARAOKE_MODE = unchecked( (int) 0x8004028B ); + public const int VFW_E_FRAME_STEP_UNSUPPORTED = unchecked( (int) 0x8004028E ); + public const int VFW_E_PIN_ALREADY_BLOCKED_ON_THIS_THREAD = unchecked( (int) 0x80040293 ); + public const int VFW_E_PIN_ALREADY_BLOCKED = unchecked( (int) 0x80040294 ); + public const int VFW_E_CERTIFICATION_FAILURE = unchecked( (int) 0x80040295 ); + public const int VFW_E_BAD_KEY = unchecked( (int) 0x800403F2 ); + //----------------- + #endregion + + #region [ Windows繝。繝繧サ繝シ繧ク ] + public const uint WM_ACTIVATEAPP = 0x1c; + public const uint WM_COPYDATA = 0x4a; + public const uint WM_CLOSE = 0x10; + public const uint WM_POWERBROADCAST = 0x218; + public const uint WM_SIZE = 5; + public const uint WM_SYSCOMMAND = 0x112; + public const uint WM_SYSKEYDOWN = 260; + public const uint WM_APP = 0x00008000; + public const uint WM_QUIT = 0x12; + public const uint WPF_RESTORETOMAXIMIZED = 2; + #endregion + + #region [ WindowsStyle 繝輔Λ繧ー] + public const long WS_BORDER = 0x800000L; + public const long WS_CAPTION = 0xc00000L; + public const long WS_CHILD = 0x40000000L; + public const long WS_CHILDWINDOW = 0x40000000L; + public const long WS_CLIPCHILDREN = 0x2000000L; + public const long WS_CLIPSIBLINGS = 0x4000000L; + public const long WS_DISABLED = 0x8000000L; + public const long WS_DLGFRAME = 0x400000L; + public const long WS_GROUP = 0x20000L; + public const long WS_HSCROLL = 0x100000L; + public const long WS_ICONIC = 0x20000000L; + public const long WS_MAXIMIZE = 0x1000000L; + public const long WS_MAXIMIZEBOX = 0x10000L; + public const long WS_MINIMIZE = 0x20000000L; + public const long WS_MINIMIZEBOX = 0x20000L; + public const long WS_OVERLAPPED = 0L; + public const long WS_OVERLAPPEDWINDOW = 0xcf0000L; + public const long WS_POPUP = 0x80000000L; + public const long WS_POPUPWINDOW = 0x80880000L; + public const long WS_SIZEBOX = 0x40000L; + public const long WS_SYSMENU = 0x80000L; + public const long WS_TABSTOP = 0x10000L; + public const long WS_THICKFRAME = 0x40000L; + public const long WS_TILED = 0L; + public const long WS_TILEDWINDOW = 0xcf0000L; + public const long WS_VISIBLE = 0x10000000L; + public const long WS_VSCROLL = 0x200000L; + public const long WS_EX_ACCEPTFILES = 0x10L; + public const long WS_EX_APPWINDOW = 0x40000L; + public const long WS_EX_CLIENTEDGE = 0x200L; + public const long WS_EX_COMPOSITED = 0x2000000L; + public const long WS_EX_CONTEXTHELP = 0x400L; + public const long WS_EX_CONTROLPARENT = 0x10000L; + public const long WS_EX_DLGMODALFRAME = 1L; + public const long WS_EX_LAYERED = 0x80000L; + public const long WS_EX_LAYOUTRTL = 0x400000L; + public const long WS_EX_LEFT = 0L; + public const long WS_EX_LEFTSCROLLBAR = 0x4000L; + public const long WS_EX_LTRREADING = 0L; + public const long WS_EX_MDICHILD = 0x40L; + public const long WS_EX_NOACTIVATE = 0x8000000L; + public const long WS_EX_NOINHERITLAYOUT = 0x100000L; + public const long WS_EX_NOPARENTNOTIFY = 4L; + public const long WS_EX_OVERLAPPEDWINDOW = 0x300L; + public const long WS_EX_PALETTEWINDOW = 0x188L; + public const long WS_EX_RIGHT = 0x1000L; + public const long WS_EX_RIGHTSCROLLBAR = 0L; + public const long WS_EX_RTLREADING = 0x2000L; + public const long WS_EX_STATICEDGE = 0x20000L; + public const long WS_EX_TOOLWINDOW = 0x80L; + public const long WS_EX_TOPMOST = 8L; + public const long WS_EX_TRANSPARENT = 0x20L; + public const long WS_EX_WINDOWEDGE = 0x100L; + #endregion + + + public enum EShowWindow + { + ForceMinimize = 11, + Hide = 0, + Maximize = 3, + Minimize = 6, + Normal = 1, + Restore = 9, + Show = 5, + ShowDefault = 10, + ShowMaximized = 3, + ShowMinimized = 2, + ShowMinNoActive = 7, + ShowNA = 8, + ShowNoActivate = 4 + } + public enum MMSYSERR + { + NOERROR, + ERROR, + BADDEVICEID, + NOTENABLED, + ALLOCATED, + INVALHANDLE, + NODRIVER, + NOMEM, + NOTSUPPORTED, + BADERRNUM, + INVALFLAG, + INVALPARAM, + HANDLEBUSY, + INVALIDALIAS, + BADDB, + KEYNOTFOUND, + READERROR, + WRITEERROR, + DELETEERROR, + VALNOTFOUND, + NODRIVERCB, + MOREDATA + } + [FlagsAttribute] + internal enum ExecutionState : uint + { + Null = 0, // 髢「謨ー縺悟、ア謨励@縺滓凾縺ョ謌サ繧雁、 + SystemRequired = 1, // 繧ケ繧ソ繝ウ繝舌う繧呈椛豁「 + DisplayRequired = 2, // 逕サ髱「OFF繧呈椛豁「 + Continuous = 0x80000000, // 蜉ケ譫懊r豌ク邯壹&縺帙k縲ゅ⊇縺九が繝励す繝ァ繝ウ縺ィ菴オ逕ィ縺吶k縲 + } + //----------------- + #endregion + + #region [ Win32 髢「謨ー ] + //----------------- + [return: MarshalAs( UnmanagedType.Bool )] + [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )] + public static extern bool AdjustWindowRect( ref RECT lpRect, uint dwStyle, [MarshalAs( UnmanagedType.Bool )] bool bMenu ); + [return: MarshalAs( UnmanagedType.Bool )] + [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )] + public static extern bool GetClientRect( IntPtr hWnd, out RECT lpRect ); + [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )] + public static extern uint GetWindowLong( IntPtr hWnd, int nIndex ); + [return: MarshalAs( UnmanagedType.Bool )] + [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )] + public static extern bool GetWindowPlacement( IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl ); + [return: MarshalAs( UnmanagedType.Bool )] + [DllImport( "user32.dll", CharSet = CharSet.Auto )] + public static extern bool IsIconic( IntPtr hWnd ); + [return: MarshalAs( UnmanagedType.Bool )] + [DllImport( "user32.dll", CharSet = CharSet.Auto )] + public static extern bool IsWindowVisible( IntPtr hWnd ); + [return: MarshalAs( UnmanagedType.Bool )] + [DllImport( "user32.dll", CharSet = CharSet.Auto )] + public static extern bool IsZoomed( IntPtr hWnd ); + [DllImport("winmm.dll")] + public static extern uint midiInClose(IntPtr hMidiIn); + [DllImport("winmm.dll")] + public static extern uint midiInGetDevCaps(uint uDeviceID, ref MIDIINCAPS lpMidiInCaps, uint cbMidiInCaps); + [DllImport("winmm.dll")] + public static extern uint midiInGetID(IntPtr hMidiIn, ref IntPtr puDeviceID); + [DllImport("winmm.dll")] + public static extern uint midiInGetNumDevs(); + [DllImport("winmm.dll")] + public static extern uint midiInOpen(ref IntPtr phMidiIn, uint uDeviceID, MidiInProc dwCallback, IntPtr dwInstance, int fdwOpen); + [DllImport("winmm.dll")] + public static extern uint midiInReset(IntPtr hMidiIn); + [DllImport("winmm.dll")] + public static extern uint midiInStart(IntPtr hMidiIn); + [DllImport("winmm.dll")] + public static extern uint midiInStop(IntPtr hMidiIn); + [DllImport( "user32.dll", CharSet = CharSet.Auto )] + public static extern IntPtr MonitorFromWindow( IntPtr hwnd, uint dwFlags ); + [return: MarshalAs( UnmanagedType.Bool )] + [DllImport( "user32.dll", CharSet = CharSet.Auto )] + public static extern bool PeekMessage( out WindowMessage message, IntPtr hwnd, uint messageFilterMin, uint messageFilterMax, uint flags ); + [DllImport( "kernel32.dll", CharSet = CharSet.Auto )] + public static extern uint SetThreadExecutionState( uint esFlags ); + [DllImport( "Kernel32.Dll" )] + public static unsafe extern void CopyMemory( void* pDest, void* pSrc, uint numOfBytes ); + + [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )] + public static extern uint SetWindowLong( IntPtr hWnd, int nIndex, uint dwNewLong ); + [return: MarshalAs( UnmanagedType.Bool )] + [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )] + public static extern bool SetWindowPlacement( IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl ); + [return: MarshalAs( UnmanagedType.Bool )] + [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )] + public static extern bool SetWindowPos( IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags ); + [return: MarshalAs( UnmanagedType.Bool )] + [DllImport( "user32.dll", CharSet = CharSet.Auto )] + public static extern bool ShowWindow( IntPtr hWnd, EShowWindow nCmdShow ); + [return: MarshalAs( UnmanagedType.Bool )] + [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )] + public static extern bool SystemParametersInfo( uint uiAction, uint uiParam, IntPtr pvParam, uint fWinIni ); + [DllImport( "kernel32.dll" )] + public static extern void GetSystemInfo( ref SYSTEM_INFO ptmpsi ); + [DllImport( "kernel32.dll" )] + internal static extern ExecutionState SetThreadExecutionState( ExecutionState esFlags ); + //----------------- + #endregion + + #region [ Win32 讒矩菴 ] + //----------------- + [StructLayout( LayoutKind.Sequential )] + private struct FILTERKEYS + { + public int cbSize; + public int dwFlags; + } + + [StructLayout( LayoutKind.Sequential )] + public struct MIDIINCAPS + { + public ushort wMid; + public ushort wPid; + public uint vDriverVersion; + [MarshalAs( UnmanagedType.ByValTStr, SizeConst = 0x20 )] + public string szPname; + public uint dwSupport; + } + + [StructLayout( LayoutKind.Sequential )] + public struct RECT + { + public int left; + public int top; + public int right; + public int bottom; + } + + [StructLayout( LayoutKind.Sequential )] + private struct STICKYKEYS + { + public int cbSize; + public int dwFlags; + } + + [StructLayout( LayoutKind.Sequential )] + private struct TOGGLEKEYS + { + public int cbSize; + public int dwFlags; + } + + [StructLayout( LayoutKind.Sequential )] + public struct WAVEFORMATEX + { + public ushort wFormatTag; + public ushort nChannels; + public uint nSamplesPerSec; + public uint nAvgBytesPerSec; + public ushort nBlockAlign; + public ushort wBitsPerSample; + public ushort cbSize; + } + + [StructLayout( LayoutKind.Sequential )] + public struct WindowMessage + { + public IntPtr hWnd; + public uint msg; + public IntPtr wParam; + public IntPtr lParam; + public uint time; + public Point p; + } + + [StructLayout( LayoutKind.Sequential )] + public struct WINDOWPLACEMENT + { + public int length; + public int flags; + public CWin32.EShowWindow showCmd; + public Point ptMinPosition; + public Point ptMaxPosition; + public CWin32.RECT rcNormalPosition; + public static int Length + { + get + { + return Marshal.SizeOf( typeof( CWin32.WINDOWPLACEMENT ) ); + } + } + } + [StructLayout( LayoutKind.Sequential )] + public struct SYSTEM_INFO + { + public uint dwOemId; + public uint dwPageSize; + public uint lpMinimumApplicationAddress; + public uint lpMaximumApplicationAddress; + public uint dwActiveProcessorMask; + public uint dwNumberOfProcessors; + public uint dwProcessorType; + public uint dwAllocationGranularity; + public uint dwProcessorLevel; + public uint dwProcessorRevision; + } + //----------------- + #endregion + + + // 繝励Ο繝代ユ繧」 + + public static bool b繧「繝励Μ縺栗dle迥カ諷九〒縺ゅk + { + get + { + WindowMessage message; + return !PeekMessage( out message, IntPtr.Zero, 0, 0, 0 ); + } + } + + + // 繧ュ繝シ繝懊シ繝峨ョ迚ケ谿頑ゥ溯ス縺ョ蛻カ蠕。 + + public static class C繝医げ繝ォ繧ュ繝シ讖溯ス + { + public static void t辟。蜉ケ蛹悶☆繧() + { + if( ( stored.dwFlags & 1L ) == 0L ) + { + CWin32.TOGGLEKEYS structure = new CWin32.TOGGLEKEYS(); + structure.dwFlags = stored.dwFlags; + structure.cbSize = stored.cbSize; + structure.dwFlags &= -5; + structure.dwFlags &= -9; + int cb = Marshal.SizeOf( structure ); + IntPtr ptr = Marshal.AllocCoTaskMem( cb ); + Marshal.StructureToPtr( structure, ptr, false ); + CWin32.SystemParametersInfo( 0x35, (uint) cb, ptr, 0 ); + Marshal.FreeCoTaskMem( ptr ); + } + } + public static void t蠕ゥ蜈縺吶k() + { + int cb = Marshal.SizeOf( stored ); + IntPtr ptr = Marshal.AllocCoTaskMem( cb ); + Marshal.StructureToPtr( stored, ptr, false ); + CWin32.SystemParametersInfo( 0x35, (uint) cb, ptr, 0 ); + Marshal.FreeCoTaskMem( ptr ); + } + + #region [ private ] + //----------------- + static C繝医げ繝ォ繧ュ繝シ讖溯ス() + { + int cb = Marshal.SizeOf( stored ); + IntPtr ptr = Marshal.AllocCoTaskMem( cb ); + Marshal.StructureToPtr( stored, ptr, false ); + CWin32.SystemParametersInfo( 0x34, (uint) cb, ptr, 0 ); + stored = (CWin32.TOGGLEKEYS) Marshal.PtrToStructure( ptr, typeof( CWin32.TOGGLEKEYS ) ); + Marshal.FreeCoTaskMem( ptr ); + } + + private const uint SPI_GETTOGGLEKEYS = 0x34; + private const uint SPI_SETTOGGLEKEYS = 0x35; + private static CWin32.TOGGLEKEYS stored = new CWin32.TOGGLEKEYS(); + private const uint TKF_CONFIRMHOTKEY = 8; + private const uint TKF_HOTKEYACTIVE = 4; + private const uint TKF_TOGGLEKEYSON = 1; + //----------------- + #endregion + } + public static class C繝輔ぅ繝ォ繧ソ繧ュ繝シ讖溯ス + { + public static void t辟。蜉ケ蛹悶☆繧() + { + if( ( stored.dwFlags & 1L ) == 0L ) + { + CWin32.FILTERKEYS structure = new CWin32.FILTERKEYS(); + structure.dwFlags = stored.dwFlags; + structure.cbSize = stored.cbSize; + structure.dwFlags &= -5; + structure.dwFlags &= -9; + int cb = Marshal.SizeOf( structure ); + IntPtr ptr = Marshal.AllocCoTaskMem( cb ); + Marshal.StructureToPtr( structure, ptr, false ); + CWin32.SystemParametersInfo( 0x3b, (uint) cb, ptr, 0 ); + Marshal.FreeCoTaskMem( ptr ); + } + } + public static void t蠕ゥ蜈縺吶k() + { + int cb = Marshal.SizeOf( stored ); + IntPtr ptr = Marshal.AllocCoTaskMem( cb ); + Marshal.StructureToPtr( stored, ptr, false ); + CWin32.SystemParametersInfo( 0x3b, (uint) cb, ptr, 0 ); + Marshal.FreeCoTaskMem( ptr ); + } + + #region [ private ] + //----------------- + static C繝輔ぅ繝ォ繧ソ繧ュ繝シ讖溯ス() + { + stored.cbSize = 0; + stored.dwFlags = 0; + int cb = Marshal.SizeOf( stored ); + IntPtr ptr = Marshal.AllocCoTaskMem( cb ); + Marshal.StructureToPtr( stored, ptr, false ); + CWin32.SystemParametersInfo( 50, (uint) cb, ptr, 0 ); + stored = (CWin32.FILTERKEYS) Marshal.PtrToStructure( ptr, typeof( CWin32.FILTERKEYS ) ); + Marshal.FreeCoTaskMem( ptr ); + } + + private const uint FKF_CONFIRMHOTKEY = 8; + private const uint FKF_FILTERKEYSON = 1; + private const uint FKF_HOTKEYACTIVE = 4; + private const uint SPI_GETFILTERKEYS = 50; + private const uint SPI_SETFILTERKEYS = 0x3b; + private static CWin32.FILTERKEYS stored = new CWin32.FILTERKEYS(); + //----------------- + #endregion + } + public static class C蝗コ螳壹く繝シ讖溯ス + { + public static void t辟。蜉ケ蛹悶☆繧() + { + if( ( stored.dwFlags & 1L ) == 0L ) + { + CWin32.STICKYKEYS structure = new CWin32.STICKYKEYS(); + structure.dwFlags = stored.dwFlags; + structure.cbSize = stored.cbSize; + structure.dwFlags &= -5; + structure.dwFlags &= -9; + int cb = Marshal.SizeOf( structure ); + IntPtr ptr = Marshal.AllocCoTaskMem( cb ); + Marshal.StructureToPtr( structure, ptr, false ); + CWin32.SystemParametersInfo( 0x3b, (uint) cb, ptr, 0 ); + Marshal.FreeCoTaskMem( ptr ); + } + } + public static void t蠕ゥ蜈縺吶k() + { + int cb = Marshal.SizeOf( stored ); + IntPtr ptr = Marshal.AllocCoTaskMem( cb ); + Marshal.StructureToPtr( stored, ptr, false ); + CWin32.SystemParametersInfo( 0x3b, (uint) cb, ptr, 0 ); + Marshal.FreeCoTaskMem( ptr ); + } + + #region [ private ] + //----------------- + static C蝗コ螳壹く繝シ讖溯ス() + { + stored.cbSize = 0; + stored.dwFlags = 0; + int cb = Marshal.SizeOf( stored ); + IntPtr ptr = Marshal.AllocCoTaskMem( cb ); + Marshal.StructureToPtr( stored, ptr, false ); + CWin32.SystemParametersInfo( 0x3a, (uint) cb, ptr, 0 ); + stored = (CWin32.STICKYKEYS) Marshal.PtrToStructure( ptr, typeof( CWin32.STICKYKEYS ) ); + Marshal.FreeCoTaskMem( ptr ); + } + + private const uint SKF_CONFIRMHOTKEY = 8; + private const uint SKF_HOTKEYACTIVE = 4; + private const uint SKF_STICKYKEYSON = 1; + private const uint SPI_GETSTICKYKEYS = 0x3a; + private const uint SPI_SETSTICKYKEYS = 0x3b; + private static CWin32.STICKYKEYS stored = new CWin32.STICKYKEYS(); + //----------------- + #endregion + } + + + // Win32 繝。繝繧サ繝シ繧ク蜃ヲ逅繝繝ェ繧イ繝シ繝 + + public delegate void MidiInProc(IntPtr hMidiIn, uint wMsg, IntPtr dwInstance, IntPtr dwParam1, IntPtr dwParam2); + } +} diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/C荳螳夐俣髫泌ヲ逅.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/C荳螳夐俣髫泌ヲ逅.cs new file mode 100644 index 00000000..60d2accf --- /dev/null +++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/C荳螳夐俣髫泌ヲ逅.cs @@ -0,0 +1,61 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; + +namespace FDK +{ + /// + /// 荳螳壹ョ髢馴囈縺ァ蜃ヲ逅繧定。後≧繝繝ウ繝励Ξ繝シ繝医ヱ繧ソ繝シ繝ウ縺ョ螳夂セゥ縲 + /// 縺溘→縺医ー縲》騾イ陦() 縺ァ 5ms 縺斐→縺ォ陦後≧蜃ヲ逅繧貞燕蝗槭ョt騾イ陦()縺ョ蜻シ縺ウ蜃コ縺励°繧 15ms 蠕後↓蜻シ縺ウ蜃コ縺励◆蝣エ蜷医ッ縲∝ヲ逅縺 3蝗 螳溯。後&繧後k縲 + /// + public class C荳螳夐俣髫泌ヲ逅 : IDisposable + { + public delegate void dg蜃ヲ逅(); + public void t騾イ陦( long n髢馴囈ms, dg蜃ヲ逅 dg蜃ヲ逅 ) + { + // 繧ソ繧、繝樊峩譁ー + + if( this.timer == null ) + return; + this.timer.t譖エ譁ー(); + + + // 蛻昴a縺ヲ縺ョ騾イ陦悟ヲ逅 + + if( this.n蜑榊屓縺ョ譎ょ綾 == CTimer.n譛ェ菴ソ逕ィ ) + this.n蜑榊屓縺ョ譎ょ綾 = this.timer.n迴セ蝨ィ譎ょ綾ms; + + + // 繧ソ繧、繝槭′荳蝗槭j縺励※縺励∪縺」縺滓凾縺ョ縺溘a窶ヲ窶ヲ + + if( this.timer.n迴セ蝨ィ譎ょ綾ms < this.n蜑榊屓縺ョ譎ょ綾 ) + this.n蜑榊屓縺ョ譎ょ綾 = this.timer.n迴セ蝨ィ譎ょ綾ms; + + + // 譎る俣蜀縺ョ蜃ヲ逅繧貞ョ溯。後 + + while( ( this.timer.n迴セ蝨ィ譎ょ綾ms - this.n蜑榊屓縺ョ譎ょ綾 ) >= n髢馴囈ms ) + { + dg蜃ヲ逅(); + + this.n蜑榊屓縺ョ譎ょ綾 += n髢馴囈ms; + } + } + + #region [ IDisposable 螳溯」 ] + //----------------- + public void Dispose() + { + C蜈ア騾.tDispose縺吶k( ref this.timer ); + } + //----------------- + #endregion + + #region [ protected ] + //----------------- + protected CTimer timer = new CTimer( CTimer.E遞ョ蛻・.MultiMedia ); + protected long n蜑榊屓縺ョ譎ょ綾 = CTimer.n譛ェ菴ソ逕ィ; + //----------------- + #endregion + } +} diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/C蜈ア騾.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/C蜈ア騾.cs new file mode 100644 index 00000000..6de72ecc --- /dev/null +++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/C蜈ア騾.cs @@ -0,0 +1,180 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using System.Windows.Forms; +using System.IO; +using System.Runtime.InteropServices; + +namespace FDK +{ + public class C蜈ア騾 + { + // 隗」謾セ + + public static void tDispose縺吶k( ref T obj ) + { + if( obj == null ) + return; + + var d = obj as IDisposable; + + if( d != null ) + { + d.Dispose(); + obj = default( T ); + } + } + public static void tDispose縺吶k( T obj ) + { + if( obj == null ) + return; + + var d = obj as IDisposable; + + if( d != null ) + d.Dispose(); + } + public static void tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref T obj ) + { + if( obj != null ) + { + try + { + Marshal.ReleaseComObject( obj ); + } + catch + { + // COM縺後槭ロ繝シ繧ク繝峨さ繝シ繝峨〒譖ク縺九l縺ヲ縺繧句エ蜷医ヽeleaseComObject 縺ッ萓句、悶r逋コ逕溘&縺帙k縲 + // http://www.infoq.com/jp/news/2010/03/ReleaseComObject-Dangerous + } + + obj = default( T ); + } + } + + public static void t螳悟ィ縺ェ繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ滓命縺吶k() + { + GC.Collect(); // 繧「繧ッ繧サ繧ケ荳榊庄閭ス縺ェ繧ェ繝悶ず繧ァ繧ッ繝医r髯、蜴サ縺励√ヵ繧。繧、繝翫Λ繧、縺懊シ繧キ繝ァ繝ウ螳滓命縲 + GC.WaitForPendingFinalizers(); // 繝輔ぃ繧、繝翫Λ繧、繧シ繝シ繧キ繝ァ繝ウ縺檎オゅo繧九∪縺ァ繧ケ繝ャ繝繝峨r蠕讖溘 + GC.Collect(); // 繝輔ぃ繧、繝翫Λ繧、繧コ縺輔l縺溘ー縺九j縺ョ繧ェ繝悶ず繧ァ繧ッ繝医↓髢「騾」縺吶k繝。繝「繝ェ繧帝幕謾セ縲 + + // 蜃コ螻: http://msdn.microsoft.com/ja-jp/library/ms998547.aspx#scalenetchapt05_topic10 + } + + + // 繝ュ繧ー + + public static void LogBlock( string str蜃ヲ逅蜷, MethodInvoker method ) + { + Trace.TraceInformation( "--------------------" ); + Trace.TraceInformation( "髢句ァ - " + str蜃ヲ逅蜷 ); + Trace.Indent(); + try + { + method(); + } + finally + { + Trace.Unindent(); + Trace.TraceInformation( "邨ゆコ - " + str蜃ヲ逅蜷 ); + Trace.TraceInformation( "--------------------" ); + } + } + public static void t萓句、悶ョ隧ウ邏ー繧偵Ο繧ー縺ォ蜃コ蜉帙☆繧( Exception e ) + { + Trace.WriteLine( "---萓句、悶%縺薙°繧----" ); + Trace.WriteLine( e.ToString() ); + Trace.WriteLine( "---萓句、悶%縺薙∪縺ァ----" ); + } + + + // IO + + public static string t謖螳壹@縺滓僑蠑オ蟄舌r謖√▽繝輔ぃ繧、繝ォ繧呈、懃エ「縺玲怙蛻昴↓隕九▽縺代◆繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ繧定ソ斐☆( string str繝輔か繝ォ繝繝代せ, List list諡。蠑オ蟄舌Μ繧ケ繝 ) + { + string[] files = Directory.GetFiles( str繝輔か繝ォ繝繝代せ ); // GetFiles() 縺ッ螳悟ィ繝代せ繧定ソ斐☆縲 + + + // 繝輔ぃ繧、繝ォ鬆繧医j諡。蠑オ蟄宣繧貞━蜈医@縺ヲ讀懃エ「縺吶k縲や 諡。蠑オ蟄舌Μ繧ケ繝医ョ蜑肴婿縺ョ諡。蠑オ蟄舌⊇縺ゥ蜈医↓逋コ隕九&繧後k繧医≧縺ォ縺吶k縺溘a縲 + + foreach( string ext in list諡。蠑オ蟄舌Μ繧ケ繝 ) + { + foreach( string file in files ) + { + string fileExt = Path.GetExtension( file ); + + if( fileExt.Equals( ext, StringComparison.OrdinalIgnoreCase ) ) + return file; // 縺ゅ▲縺 + } + } + + return null; // 縺ェ縺九▲縺 + } + + public static void tXML繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧( string strXML繝輔ぃ繧、繝ォ蜷, out T xmlObject ) + { + xmlObject = default( T ); + + FileStream fs = null; + StreamReader sr = null; + try + { + fs = new FileStream( strXML繝輔ぃ繧、繝ォ蜷, FileMode.Open, FileAccess.Read, FileShare.ReadWrite ); // FileShare 繧剃サ倥¢縺ィ縺九↑縺縺ィ縲,lose() 蠕後b繝ュ繝繧ッ縺後°縺九k縲 + sr = new StreamReader( fs, Encoding.UTF8 ); + var xmlsl = new System.Xml.Serialization.XmlSerializer( typeof( T ) ); + xmlObject = (T) xmlsl.Deserialize( sr ); + } + finally + { + if( sr != null ) + sr.Close(); // fr 繧ゆク邱偵↓Close()縺輔l繧 + } + } + public static void tXML繝輔ぃ繧、繝ォ繧剃ソ晏ュ倥☆繧( string strXML繝輔ぃ繧、繝ォ蜷, T xmlObject ) + { + FileStream fs = null; + StreamWriter sw = null; + try + { + fs = new FileStream( strXML繝輔ぃ繧、繝ォ蜷, FileMode.Create, FileAccess.Write, FileShare.ReadWrite ); // FileShare 繧剃サ倥¢縺ィ縺九↑縺縺ィ縲,lose() 蠕後b繝ュ繝繧ッ縺後°縺九k縲 + sw = new StreamWriter( fs, Encoding.UTF8 ); + var xmlsl = new System.Xml.Serialization.XmlSerializer( typeof( T ) ); + xmlsl.Serialize( sw, xmlObject ); + } + finally + { + if( sw != null ) + sw.Close(); // fs 繧ゆク邱偵↓Close()縺輔l繧 + } + } + + + // 謨ー蟄ヲ + + public static double DegreeToRadian( double angle ) + { + return ( ( Math.PI * angle ) / 180.0 ); + } + public static double RadianToDegree( double angle ) + { + return ( angle * 180.0 / Math.PI ); + } + public static float DegreeToRadian( float angle ) + { + return (float) DegreeToRadian( (double) angle ); + } + public static float RadianToDegree( float angle ) + { + return (float) RadianToDegree( (double) angle ); + } + + public static bool bToggleBoolian( ref bool bFlag ) + { + if( bFlag == true ) bFlag = false; + else if( bFlag == false ) bFlag = true; + + return true; + } + } +} diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/C螟画鋤.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/C螟画鋤.cs new file mode 100644 index 00000000..4e8b5ef3 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/C螟画鋤.cs @@ -0,0 +1,252 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; + +namespace FDK +{ + public class C螟画鋤 + { + // 繝励Ο繝代ユ繧」 + + public static readonly string str16騾イ謨ー譁蟄 = "0123456789ABCDEFabcdef"; + public static readonly string str36騾イ謨ー譁蟄 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + + + // 繝。繧ス繝繝 + + public static bool bONorOFF( char c ) + { + return ( c != '0' ); + } + + public static double DegreeToRadian( double angle ) + { + return ( ( Math.PI * angle ) / 180.0 ); + } + public static double RadianToDegree( double angle ) + { + return ( angle * 180.0 / Math.PI ); + } + public static float DegreeToRadian( float angle ) + { + return (float) DegreeToRadian( (double) angle ); + } + public static float RadianToDegree( float angle ) + { + return (float) RadianToDegree( (double) angle ); + } + + public static int n蛟、繧堤ッ蝗イ蜀縺ォ荳ク繧√※霑斐☆( int n蛟、, int n譛蟆丞、, int n譛螟ァ蛟、 ) + { + if( n蛟、 < n譛蟆丞、 ) + return n譛蟆丞、; + + if( n蛟、 > n譛螟ァ蛟、 ) + return n譛螟ァ蛟、; + + return n蛟、; + } + public static int n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( string str謨ー蛟、譁蟄怜, int n譛蟆丞、, int n譛螟ァ蛟、, int n蜿門セ怜、ア謨玲凾縺ョ繝繝輔か繝ォ繝亥、 ) + { + int num; + if( ( int.TryParse( str謨ー蛟、譁蟄怜, out num ) && ( num >= n譛蟆丞、 ) ) && ( num <= n譛螟ァ蛟、 ) ) + return num; + + return n蜿門セ怜、ア謨玲凾縺ョ繝繝輔か繝ォ繝亥、; + } + + public static double db蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( string str謨ー蛟、譁蟄怜, double db譛蟆丞、, double db譛螟ァ蛟、, double db蜿門セ怜、ア謨玲凾縺ョ繝繝輔か繝ォ繝亥、 ) + { + double num; + if( ( double.TryParse( str謨ー蛟、譁蟄怜, out num ) && ( num >= db譛蟆丞、 ) ) && ( num <= db譛螟ァ蛟、 ) ) + return num; + + return db蜿門セ怜、ア謨玲凾縺ョ繝繝輔か繝ォ繝亥、; + } + + // #23568 2010.11.04 ikanick add + public static int n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ縺。繧繧薙→荳ク繧√※霑斐☆(string str謨ー蛟、譁蟄怜, int n譛蟆丞、, int n譛螟ァ蛟、, int n蜿門セ怜、ア謨玲凾縺ョ繝繝輔か繝ォ繝亥、) + { + // 1 縺ィ驕輔▲縺ヲ遽蝗イ螟悶ョ蝣エ蜷医■繧繧薙→荳ク繧√※霑斐@縺セ縺吶 + int num; + if (int.TryParse(str謨ー蛟、譁蟄怜, out num)) { + if ((num >= n譛蟆丞、) && (num <= n譛螟ァ蛟、)) + return num; + if ( num < n譛蟆丞、 ) + return n譛蟆丞、; + if ( num > n譛螟ァ蛟、 ) + return n譛螟ァ蛟、; + } + + return n蜿門セ怜、ア謨玲凾縺ョ繝繝輔か繝ォ繝亥、; + } + // --------------------縺薙%縺セ縺ァ-------------------------/ + public static int n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆( string str謨ー蛟、譁蟄怜, int n蜿門セ怜、ア謨玲凾縺ョ繝繝輔か繝ォ繝亥、 ) + { + int num; + if( !int.TryParse( str謨ー蛟、譁蟄怜, out num ) ) + num = n蜿門セ怜、ア謨玲凾縺ョ繝繝輔か繝ォ繝亥、; + + return num; + } + + public static int n16騾イ謨ー2譯√ョ譁蟄怜励r謨ー蛟、縺ォ螟画鋤縺励※霑斐☆( string strNum ) + { + if( strNum.Length < 2 ) + return -1; + + int digit2 = str16騾イ謨ー譁蟄.IndexOf( strNum[ 0 ] ); + if( digit2 < 0 ) + return -1; + + if( digit2 >= 16 ) + digit2 -= (16 - 10); // A,B,C... -> 1,2,3... + + int digit1 = str16騾イ謨ー譁蟄.IndexOf( strNum[ 1 ] ); + if( digit1 < 0 ) + return -1; + + if( digit1 >= 16 ) + digit1 -= (16 - 10); + + return digit2 * 16 + digit1; + } + public static int n36騾イ謨ー2譯√ョ譁蟄怜励r謨ー蛟、縺ォ螟画鋤縺励※霑斐☆( string strNum ) + { + if( strNum.Length < 2 ) + return -1; + + int digit2 = str36騾イ謨ー譁蟄.IndexOf( strNum[ 0 ] ); + if( digit2 < 0 ) + return -1; + + if( digit2 >= 36 ) + digit2 -= (36 - 10); // A,B,C... -> 1,2,3... + + int digit1 = str36騾イ謨ー譁蟄.IndexOf( strNum[ 1 ] ); + if( digit1 < 0 ) + return -1; + + if( digit1 >= 36 ) + digit1 -= (36 - 10); + + return digit2 * 36 + digit1; + } + public static int n蟆冗ッ逡ェ蜿キ縺ョ譁蟄怜3譯√r謨ー蛟、縺ォ螟画鋤縺励※霑斐☆( string strNum ) + { + if( strNum.Length >= 3 ) + { + int digit3 = str36騾イ謨ー譁蟄.IndexOf( strNum[ 0 ] ); + if( digit3 < 0 ) + return -1; + + if( digit3 >= 36 ) // 3譯∫岼縺ッ36騾イ謨ー + digit3 -= (36 - 10); + + int digit2 = str16騾イ謨ー譁蟄.IndexOf( strNum[ 1 ] ); // 2譯∫岼縺ッ10騾イ謨ー + if( ( digit2 < 0 ) || ( digit2 > 9 ) ) + return -1; + + int digit1 = str16騾イ謨ー譁蟄.IndexOf( strNum[ 2 ] ); // 1譯∫岼繧10騾イ謨ー + if( ( digit1 >= 0 ) && ( digit1 <= 9 ) ) + return digit3 * 100 + digit2 * 10 + digit1; + } + return -1; + } + + public static string str蟆冗ッ逡ェ蜿キ繧呈枚蟄怜3譯√↓螟画鋤縺励※霑斐☆( int num ) + { + if( ( num < 0 ) || ( num >= 3600 ) ) // 3600 == Z99 + 1 + return "000"; + + int digit4 = num / 100; + int digit2 = ( num % 100 ) / 10; + int digit1 = ( num % 100 ) % 10; + char ch3 = str36騾イ謨ー譁蟄夕 digit4 ]; + char ch2 = str16騾イ謨ー譁蟄夕 digit2 ]; + char ch1 = str16騾イ謨ー譁蟄夕 digit1 ]; + return ( ch3.ToString() + ch2.ToString() + ch1.ToString() ); + } + public static string str謨ー蛟、繧16騾イ謨ー2譯√↓螟画鋤縺励※霑斐☆( int num ) + { + if( ( num < 0 ) || ( num >= 0x100 ) ) + return "00"; + + char ch2 = str16騾イ謨ー譁蟄夕 num / 0x10 ]; + char ch1 = str16騾イ謨ー譁蟄夕 num % 0x10 ]; + return ( ch2.ToString() + ch1.ToString() ); + } + public static string str謨ー蛟、繧36騾イ謨ー2譯√↓螟画鋤縺励※霑斐☆( int num ) + { + if( ( num < 0 ) || ( num >= 36 * 36 ) ) + return "00"; + + char ch2 = str36騾イ謨ー譁蟄夕 num / 36 ]; + char ch1 = str36騾イ謨ー譁蟄夕 num % 36 ]; + return ( ch2.ToString() + ch1.ToString() ); + } + + public static int[] ar驟榊怜ス「蠑上ョstring繧段nt驟榊励↓螟画鋤縺励※霑斐☆( string str ) + { + //0,1,2 ...縺ョ蠖「蠑上〒譖ク縺九l縺殱tring繧段nt驟榊励↓螟画鋤縺吶k縲 + //荳蠢懷ョ溯」縺ッ縺励◆繧ゅョ縺ョ縲∽セ句、門ヲ逅縺ェ縺ゥ縺ッ縺セ縺螳梧舌@縺ヲ縺縺ェ縺縲 + //str = "0,1,2"; + if( String.IsNullOrEmpty( str ) ) + return null; + + string[] strArray = str.Split( ',' ); + List listIntArray; + listIntArray = new List(); + + for( int n = 0; n < strArray.Length; n++ ) + { + int n霑ス蜉縺吶k謨ー蛟、 = Convert.ToInt32( strArray[ n ] ); + listIntArray.Add( n霑ス蜉縺吶k謨ー蛟、 ); + } + int[] nArray = new int[] { 1 }; + nArray = listIntArray.ToArray(); + + return nArray; + } + + + /// + /// 逋セ蛻邇謨ー蛟、繧255谿オ髫取焚蛟、縺ォ螟画鋤縺吶k繝。繧ス繝繝峨る乗主コヲ逕ィ縲 + /// + /// + /// + public static int nParsentTo255( double num ) + { + return (int)(255.0 * num); + } + + /// + /// 255谿オ髫取焚蛟、繧堤卆蛻邇縺ォ螟画鋤縺吶k繝。繧ス繝繝峨 + /// + /// + /// + public static int n255ToParsent( int num ) + { + return (int)(100.0 / num); + } + + public static SlimDX.Color4 n255ToColor4( int nR, int nG, int nB ) + { + float fR = n255ToParsent( nR ); + float fG = n255ToParsent( nG ); + float fB = n255ToParsent( nB ); + + return new SlimDX.Color4( fR, fG, fB ); + } + + #region [ private ] + //----------------- + + // private 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ縺ァ繧、繝ウ繧ケ繧ソ繝ウ繧ケ逕滓舌r遖∵ュ「縺吶k縲 + private C螟画鋤() + { + } + //----------------- + #endregion + } +} diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/ExtensionMethods/DoubleExtensions.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/ExtensionMethods/DoubleExtensions.cs new file mode 100644 index 00000000..d7e94c11 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/ExtensionMethods/DoubleExtensions.cs @@ -0,0 +1,12 @@ +サソusing System; + +namespace FDK.ExtensionMethods +{ + public static class DoubleExtensions + { + public static double Clamp(this double value, double min, double max) + { + return Math.Min(Math.Max(value, min), max); + } + } +} \ No newline at end of file diff --git a/FDK19/繧ウ繝シ繝/00.蜈ア騾/ExtensionMethods/Int32Extensions.cs b/FDK19/繧ウ繝シ繝/00.蜈ア騾/ExtensionMethods/Int32Extensions.cs new file mode 100644 index 00000000..019d3f5d --- /dev/null +++ b/FDK19/繧ウ繝シ繝/00.蜈ア騾/ExtensionMethods/Int32Extensions.cs @@ -0,0 +1,12 @@ +サソusing System; + +namespace FDK.ExtensionMethods +{ + public static class Int32Extensions + { + public static int Clamp(this int value, int min, int max) + { + return Math.Min(Math.Max(value, min), max); + } + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/Game.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/Game.cs new file mode 100644 index 00000000..64932ff0 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/Game.cs @@ -0,0 +1,569 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ +using System; +using System.ComponentModel; +using System.Threading; +using System.Windows.Forms; +using SlimDX; +using SlimDX.Direct3D9; +using System.Collections.ObjectModel; + +namespace SampleFramework +{ + /// + /// Presents an easy to use wrapper for making games and samples. + /// + public abstract class Game : IDisposable + { + GameClock clock = new GameClock(); + GameTime gameTime = new GameTime(); + TimeSpan maximumElapsedTime = TimeSpan.FromMilliseconds(500.0); + TimeSpan totalGameTime; + TimeSpan accumulatedElapsedGameTime; + TimeSpan lastFrameElapsedGameTime; + TimeSpan lastFrameElapsedRealTime; + TimeSpan targetElapsedTime = TimeSpan.FromTicks(166667); + TimeSpan inactiveSleepTime = TimeSpan.FromMilliseconds(20.0); + int updatesSinceRunningSlowly1 = int.MaxValue; + int updatesSinceRunningSlowly2 = int.MaxValue; + bool forceElapsedTimeToZero; + bool drawRunningSlowly; + long lastUpdateFrame; + float lastUpdateTime; + + /// + /// Occurs when the game is disposed. + /// + public event EventHandler Disposed; + + /// + /// Occurs when the game is activated. + /// + public event EventHandler Activated; + + /// + /// Occurs when the game is deactivated. + /// + public event EventHandler Deactivated; + + /// + /// Occurs when the game is exiting. + /// + public event EventHandler Exiting; + + /// + /// Occurs when a drawing frame is about to start. + /// + public event CancelEventHandler FrameStart; + + /// + /// Occurs when a drawing frame ends. + /// + public event EventHandler FrameEnd; + + /// + /// Gets or sets the inactive sleep time. + /// + /// The inactive sleep time. + public TimeSpan InactiveSleepTime + { + get { return inactiveSleepTime; } + set + { + // error checking + if (value < TimeSpan.Zero) + throw new ArgumentOutOfRangeException("value", "Inactive sleep time cannot be less than zero."); + inactiveSleepTime = value; + } + } + + /// + /// Gets or sets the target elapsed time. + /// + /// The target elapsed time. + public TimeSpan TargetElapsedTime + { + get { return targetElapsedTime; } + set + { + // error checking + if (value <= TimeSpan.Zero) + throw new ArgumentOutOfRangeException("value", "Target elapsed time must be greater than zero."); + targetElapsedTime = value; + } + } + + /// + /// Gets or sets a value indicating whether the game is using a fixed time step. + /// + /// + /// true if the game is using a fixed time step; otherwise, false. + /// + public bool IsFixedTimeStep + { + get; + set; + } + + /// + /// Gets a value indicating whether this is exiting. + /// + /// true if exiting; otherwise, false. + public bool IsExiting + { + get; + private set; + } + + /// + /// Gets or sets a value indicating whether this instance is running. + /// + /// + /// true if this instance is running; otherwise, false. + /// + public bool IsRunning + { + get; + private set; + } + + /// + /// Gets the game window. + /// + /// The game window. + public GameWindow Window + { + get; + private set; + } + + /// + /// Gets the graphics device manager. + /// + /// The graphics device manager. + public GraphicsDeviceManager GraphicsDeviceManager + { + get; + private set; + } + + /// + /// Gets or sets a value indicating whether this is active. + /// + /// true if active; otherwise, false. + public bool IsActive + { + get; + private set; + } + + /// + /// Initializes the class. + /// + static Game() + { + // configure SlimDX + Configuration.ThrowOnError = true; + Configuration.AddResultWatch(ResultCode.DeviceLost, ResultWatchFlags.AlwaysIgnore); + Configuration.AddResultWatch(ResultCode.WasStillDrawing, ResultWatchFlags.AlwaysIgnore); + +#if DEBUG + Configuration.DetectDoubleDispose = true; + Configuration.EnableObjectTracking = true; +#else + Configuration.DetectDoubleDispose = false; + Configuration.EnableObjectTracking = false; +#endif + + // setup the application + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + } + + /// + /// Initializes a new instance of the class. + /// + protected Game() + { + IsFixedTimeStep = true; + + Window = new GameWindow(); + Window.ApplicationActivated += Window_ApplicationActivated; + Window.ApplicationDeactivated += Window_ApplicationDeactivated; + Window.Suspend += Window_Suspend; + Window.Resume += Window_Resume; + Window.Paint += Window_Paint; + + GraphicsDeviceManager = new GraphicsDeviceManager(this); + } + + /// + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// + public void Dispose() + { + // GraphicsDeviceManager.Dispose will come around and call the Dispose(bool) + // overload, so we don't need to do it here. It's convoluted, but it works well. + if (GraphicsDeviceManager != null) + GraphicsDeviceManager.Dispose(); + GraphicsDeviceManager = null; + + if (Disposed != null) + Disposed(this, EventArgs.Empty); + + GC.SuppressFinalize(this); + } + + /// + /// Exits the game. + /// + public void Exit() + { + // request the game to terminate + IsExiting = true; + } + + /// + /// Runs the game. + /// + public void Run() + { + IsRunning = true; + + try + { + gameTime.ElapsedGameTime = 0; + gameTime.ElapsedRealTime = 0; + gameTime.TotalGameTime = (float)totalGameTime.TotalSeconds; + gameTime.TotalRealTime = (float)clock.CurrentTime.TotalSeconds; + gameTime.IsRunningSlowly = false; + + Update(gameTime); + + Application.Idle += Application_Idle; + Application.Run(Window); + } + finally + { + Application.Idle -= Application_Idle; + IsRunning = false; + OnExiting(EventArgs.Empty); + } + } + + /// + /// Performs one complete frame for the game. + /// + public void Tick() + { + // if we are exiting, do nothing + if (IsExiting) + return; + + // if we are inactive, sleep for a bit + //if (!IsActive) + // Thread.Sleep((int)InactiveSleepTime.TotalMilliseconds); + + clock.Step(); + + gameTime.TotalRealTime = (float)clock.CurrentTime.TotalSeconds; + gameTime.ElapsedRealTime = (float)clock.ElapsedTime.TotalSeconds; + lastFrameElapsedRealTime += clock.ElapsedTime; + TimeSpan elapsedAdjustedTime = clock.ElapsedAdjustedTime; + if (elapsedAdjustedTime < TimeSpan.Zero) + elapsedAdjustedTime = TimeSpan.Zero; + + if (forceElapsedTimeToZero) + { + gameTime.ElapsedRealTime = 0; + lastFrameElapsedRealTime = elapsedAdjustedTime = TimeSpan.Zero; + forceElapsedTimeToZero = false; + } + + // cap the adjusted time + if (elapsedAdjustedTime > maximumElapsedTime) + elapsedAdjustedTime = maximumElapsedTime; + + // check if we are using a fixed or variable time step + if (IsFixedTimeStep) + { + accumulatedElapsedGameTime += elapsedAdjustedTime; + long ratio = accumulatedElapsedGameTime.Ticks / TargetElapsedTime.Ticks; + accumulatedElapsedGameTime = TimeSpan.FromTicks(accumulatedElapsedGameTime.Ticks % TargetElapsedTime.Ticks); + lastFrameElapsedGameTime = TimeSpan.Zero; + if (ratio == 0) + return; + TimeSpan targetElapsedTime = TargetElapsedTime; + + if (ratio > 1) + { + updatesSinceRunningSlowly2 = updatesSinceRunningSlowly1; + updatesSinceRunningSlowly1 = 0; + } + else + { + if (updatesSinceRunningSlowly1 < int.MaxValue) + updatesSinceRunningSlowly1++; + if (updatesSinceRunningSlowly2 < int.MaxValue) + updatesSinceRunningSlowly2++; + } + + drawRunningSlowly = updatesSinceRunningSlowly2 < 20; + + // update until it's time to draw the next frame + while (ratio > 0 && !IsExiting) + { + ratio -= 1; + + try + { + gameTime.ElapsedGameTime = (float)targetElapsedTime.TotalSeconds; + gameTime.TotalGameTime = (float)totalGameTime.TotalSeconds; + gameTime.IsRunningSlowly = drawRunningSlowly; + + Update(gameTime); + } + finally + { + lastFrameElapsedGameTime += targetElapsedTime; + totalGameTime += targetElapsedTime; + } + } + } + else + { + drawRunningSlowly = false; + updatesSinceRunningSlowly1 = int.MaxValue; + updatesSinceRunningSlowly2 = int.MaxValue; + + // make sure we shouldn't be exiting + if (!IsExiting) + { + try + { + gameTime.ElapsedGameTime = 0; + lastFrameElapsedGameTime = elapsedAdjustedTime; + gameTime.TotalGameTime = (float)totalGameTime.TotalSeconds; + gameTime.IsRunningSlowly = false; + + Update(gameTime); + } + finally + { + totalGameTime += elapsedAdjustedTime; + } + } + } + + DrawFrame(); + + // refresh the FPS counter once per second + lastUpdateFrame++; + if ((float)clock.CurrentTime.TotalSeconds - lastUpdateTime > 1.0f) + { + gameTime.FramesPerSecond = (float)lastUpdateFrame / (float)(clock.CurrentTime.TotalSeconds - lastUpdateTime); + lastUpdateTime = (float)clock.CurrentTime.TotalSeconds; + lastUpdateFrame = 0; + } + } + + /// + /// Resets the elapsed time. + /// + public void ResetElapsedTime() + { + forceElapsedTimeToZero = true; + updatesSinceRunningSlowly1 = int.MaxValue; + updatesSinceRunningSlowly2 = int.MaxValue; + } + + /// + /// Allows the game to perform logic processing. + /// + /// The time passed since the last update. + protected virtual void Update(GameTime gameTime) + { + } + + /// + /// Called when a frame is ready to be drawn. + /// + /// The time passed since the last frame. + protected virtual void Draw(GameTime gameTime) + { + } + + /// + /// Initializes the game. + /// + protected internal virtual void Initialize() + { + } + + /// + /// Loads graphical resources. + /// + protected internal virtual void LoadContent() + { + } + + /// + /// Unloads graphical resources. + /// + protected internal virtual void UnloadContent() + { + } + + /// + /// Releases unmanaged and - optionally - managed resources + /// + /// true to release both managed and unmanaged resources; false to release only unmanaged resources. + protected internal virtual void Dispose(bool disposing) + { + + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnActivated(EventArgs e) + { + if (Activated != null) + Activated(this, e); + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnDeactivated(EventArgs e) + { + if (Deactivated != null) + Deactivated(this, e); + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnExiting(EventArgs e) + { + if (Exiting != null) + Exiting(this, e); + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnFrameStart(CancelEventArgs e) + { + if (FrameStart != null) + FrameStart(this, e); + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnFrameEnd(EventArgs e) + { + if (FrameEnd != null) + FrameEnd(this, e); + } + + void DrawFrame() + { + try + { + if ( !IsExiting /* && !Window.IsMinimized */ ) // #28230 2012.5.1 yyagi + { + CancelEventArgs e = new CancelEventArgs(false); + OnFrameStart(e); + if (!e.Cancel) + { + gameTime.TotalRealTime = (float)clock.CurrentTime.TotalSeconds; + gameTime.ElapsedRealTime = (float)lastFrameElapsedRealTime.TotalSeconds; + gameTime.TotalGameTime = (float)totalGameTime.TotalSeconds; + gameTime.ElapsedGameTime = (float)lastFrameElapsedGameTime.TotalSeconds; + gameTime.IsRunningSlowly = drawRunningSlowly; + + Draw(gameTime); + + OnFrameEnd(EventArgs.Empty); + } + } + } + finally + { + lastFrameElapsedGameTime = TimeSpan.Zero; + lastFrameElapsedRealTime = TimeSpan.Zero; + } + } + + void Application_Idle(object sender, EventArgs e) + { + NativeMessage message; + while (!NativeMethods.PeekMessage(out message, IntPtr.Zero, 0, 0, 0)) + { + if (IsExiting) + Window.Close(); + else + Tick(); + } + } + + void Window_ApplicationDeactivated(object sender, EventArgs e) + { + if (IsActive) + { + IsActive = false; + OnDeactivated(EventArgs.Empty); + } + } + + void Window_ApplicationActivated(object sender, EventArgs e) + { + if (!IsActive) + { + IsActive = true; + OnActivated(EventArgs.Empty); + } + } + + void Window_Paint(object sender, PaintEventArgs e) + { + DrawFrame(); + } + + void Window_Resume(object sender, EventArgs e) + { + clock.Resume(); + } + + void Window_Suspend(object sender, EventArgs e) + { + clock.Suspend(); + } + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameClock.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameClock.cs new file mode 100644 index 00000000..fe201f18 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameClock.cs @@ -0,0 +1,153 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ +using System; +using System.Diagnostics; + +namespace SampleFramework +{ + class GameClock + { + long baseRealTime; + long lastRealTime; + bool lastRealTimeValid; + int suspendCount; + long suspendStartTime; + long timeLostToSuspension; + TimeSpan currentTimeBase; + TimeSpan currentTimeOffset; + + public TimeSpan CurrentTime + { + get { return currentTimeBase + currentTimeOffset; } + } + + public TimeSpan ElapsedTime + { + get; + private set; + } + + public TimeSpan ElapsedAdjustedTime + { + get; + private set; + } + + public static long Frequency + { + get { return Stopwatch.Frequency; } + } + + public GameClock() + { + Reset(); + } + + public void Reset() + { + currentTimeBase = TimeSpan.Zero; + currentTimeOffset = TimeSpan.Zero; + baseRealTime = Stopwatch.GetTimestamp(); + lastRealTimeValid = false; + } + + public void Suspend() + { + suspendCount++; + if (suspendCount == 1) + suspendStartTime = Stopwatch.GetTimestamp(); + } + + /// + /// Resumes a previously suspended clock. + /// + public void Resume() + { + suspendCount--; + if (suspendCount <= 0) + { + timeLostToSuspension += Stopwatch.GetTimestamp() - suspendStartTime; + suspendStartTime = 0; + } + } + + public void Step() + { + long counter = Stopwatch.GetTimestamp(); + + if (!lastRealTimeValid) + { + lastRealTime = counter; + lastRealTimeValid = true; + } + + try + { + currentTimeOffset = CounterToTimeSpan(counter - baseRealTime); + } + catch (OverflowException) + { + // update the base value and try again to adjust for overflow + currentTimeBase += currentTimeOffset; + baseRealTime = lastRealTime; + + try + { + // get the current offset + currentTimeOffset = CounterToTimeSpan(counter - baseRealTime); + } + catch (OverflowException) + { + // account for overflow + baseRealTime = counter; + currentTimeOffset = TimeSpan.Zero; + } + } + + try + { + ElapsedTime = CounterToTimeSpan(counter - lastRealTime); + } + catch (OverflowException) + { + ElapsedTime = TimeSpan.Zero; + } + + try + { + ElapsedAdjustedTime = CounterToTimeSpan(counter - (lastRealTime + timeLostToSuspension)); + timeLostToSuspension = 0; + } + catch (OverflowException) + { + ElapsedAdjustedTime = TimeSpan.Zero; + } + + lastRealTime = counter; + } + + static TimeSpan CounterToTimeSpan(long delta) + { + return TimeSpan.FromTicks((delta * 10000000) / Frequency); + } + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameTime.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameTime.cs new file mode 100644 index 00000000..904caf26 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameTime.cs @@ -0,0 +1,120 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ + +namespace SampleFramework +{ + /// + /// Contains the current timing state of the game. + /// + public class GameTime + { + private float m_FramesPerSecond; + /// + /// Gets the current frames-per-second measure. + /// + /// The current frames-per-second measure. + public float FramesPerSecond + { + get { return m_FramesPerSecond; } + internal set { m_FramesPerSecond = value; } + } + + private float m_ElapsedGameTime; + /// + /// Gets the elapsed game time, in seconds. + /// + /// The elapsed game time. + public float ElapsedGameTime + { + get { return m_ElapsedGameTime; } + internal set { m_ElapsedGameTime = value; } + } + + private float m_ElapsedRealTime; + /// + /// Gets the elapsed real time, in seconds. + /// + /// The elapsed real time. + public float ElapsedRealTime + { + get { return m_ElapsedRealTime; } + internal set { m_ElapsedRealTime = value; } + } + + private float m_TotalGameTime; + /// + /// Gets the total game time, in seconds. + /// + /// The total game time. + public float TotalGameTime + { + get { return m_TotalGameTime; } + internal set { m_TotalGameTime = value; } + } + + private float m_TotalRealTime; + /// + /// Gets the total real time, in seconds. + /// + /// The total real time. + public float TotalRealTime + { + get { return m_TotalRealTime; } + internal set { m_TotalRealTime = value; } + } + + private bool m_IsRunningSlowly; + /// + /// Gets or sets a value indicating whether this instance is running slowly. + /// + /// + /// true if this instance is running slowly; otherwise, false. + /// + public bool IsRunningSlowly + { + get { return m_IsRunningSlowly; } + internal set { m_IsRunningSlowly = value; } + } + + /// + /// Initializes a new instance of the class. + /// + public GameTime() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The total real time. + /// The elapsed real time. + /// The total game time. + /// The elapsed game time. + public GameTime(float totalRealTime, float elapsedRealTime, float totalGameTime, float elapsedGameTime) + { + TotalRealTime = totalRealTime; + ElapsedRealTime = elapsedRealTime; + TotalGameTime = totalGameTime; + ElapsedGameTime = elapsedGameTime; + } + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameWindow.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameWindow.cs new file mode 100644 index 00000000..e4cf1509 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameWindow.cs @@ -0,0 +1,634 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ +using System; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.Reflection; +using System.Security.Permissions; +using System.Windows.Forms; +using System.Runtime.InteropServices; +using System.Diagnostics; +using SampleFramework.Properties; + +namespace SampleFramework +{ + /// + /// Implements a specialized window for games and rendering. + /// + public class GameWindow : Form + { + const int DefaultWidth = 800; + const int DefaultHeight = 600; + const string DefaultTitle = "Game"; + + Size cachedSize; + bool minimized; + bool maximized; + bool inSizeMove; + + /// + /// Occurs when the application is suspended. + /// + public event EventHandler Suspend; + + /// + /// Occurs when the application is resumed. + /// + public event EventHandler Resume; + + /// + /// Occurs when the user resizes the window. + /// + public event EventHandler UserResized; + + /// + /// Occurs when the screen on which the window resides is changed. + /// + public event EventHandler ScreenChanged; + + /// + /// Occurs when the application is activated. + /// + public event EventHandler ApplicationActivated; + + /// + /// Occurs when the application is deactivated. + /// + public event EventHandler ApplicationDeactivated; + + /// + /// Occurs when the system is suspended. + /// + public event EventHandler SystemSuspend; + + /// + /// Occurs when the system is resumed. + /// + public event EventHandler SystemResume; + + /// + /// Occurs when a screen saver is about to be activated. + /// + public event CancelEventHandler Screensaver; + + /// + /// Gets a value indicating whether this instance is minimized. + /// + /// + /// true if this instance is minimized; otherwise, false. + /// + public bool IsMinimized + { + get { return minimized; } + } + + /// + /// Gets a value indicating whether this instance is maximized. + /// + /// + /// true if this instance is maximized; otherwise, false. + /// + public bool IsMaximized + { + get { return maximized; } + } + + /// + /// Gets or sets a value indicating whether System Menu is enabled. + /// + /// true if System Menu is enabled; otherwise, false. + public bool EnableSystemMenu // #28200 2012.5.1 yyagi + { + get; + set; + } + public string strMessage // #28821 2014.1.23 yyagi + { + get; + private set; + } + public bool IsReceivedMessage + { + get; + set; + } + + private Screen m_Screen; + /// + /// Gets the screen on which the window resides. + /// + /// The screen. + public Screen Screen + { + get { return m_Screen; } + private set { m_Screen = value; } + } + + /// + /// Initializes a new instance of the class. + /// + public GameWindow() + { + MinimumSize = new Size(200, 200); + + Screen = ScreenFromHandle(Handle); + + //Icon = GetDefaultIcon(); + Text = GetDefaultTitle(); + strMessage = ""; + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnSuspend(EventArgs e) + { + if (Suspend != null) + Suspend(this, e); + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnResume(EventArgs e) + { + if (Resume != null) + Resume(this, e); + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnUserResized(EventArgs e) + { + if (UserResized != null) + UserResized(this, e); + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnScreenChanged(EventArgs e) + { + if (ScreenChanged != null) + ScreenChanged(this, e); + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnApplicationActivated(EventArgs e) + { + if (ApplicationActivated != null) + ApplicationActivated(this, e); + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnApplicationDeactivated(EventArgs e) + { + if (ApplicationDeactivated != null) + ApplicationDeactivated(this, e); + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnSystemSuspend(EventArgs e) + { + if (SystemSuspend != null) + SystemSuspend(this, e); + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnSystemResume(EventArgs e) + { + if (SystemResume != null) + SystemResume(this, e); + } + + /// + /// Raises the event. + /// + /// The instance containing the event data. + protected virtual void OnScreensaver(CancelEventArgs e) + { + if (Screensaver != null) + Screensaver(this, e); + } + + /// + /// Raises the event. + /// + /// An that contains the event data. + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + + cachedSize = Size; + } + + /// + /// Raises the event. + /// + /// A that contains the event data. + protected override void OnResizeBegin(EventArgs e) + { + base.OnResizeBegin(e); + + // suspend any processing until we are done being minimized + inSizeMove = true; + cachedSize = Size; + OnSuspend(EventArgs.Empty); + } + + /// + /// Raises the event. + /// + /// A that contains the event data. + protected override void OnResizeEnd(EventArgs e) + { + base.OnResizeEnd(e); + + // check for screen and size changes + OnUserResized(EventArgs.Empty); + UpdateScreen(); + inSizeMove = false; + + // resume application processing + OnResume(EventArgs.Empty); + } + + + #region #23510 2010.11.14 yyagi add: 邵ヲ讓ェ豈泌崋螳壹〒縺ョ繧ヲ繧、繝ウ繝峨え繧オ繧、繧コ螟画峩 螳壽焚螳夂セゥ from http://www.vcskicks.com/maintain-aspect-ratio.php + //double so division keeps decimal points + const double widthRatio = SampleFramework.GameWindowSize.Width; + const double heightRatio = SampleFramework.GameWindowSize.Height; + const int WM_SIZING = 0x214; + const int WMSZ_LEFT = 1; + const int WMSZ_RIGHT = 2; + const int WMSZ_TOP = 3; + const int WMSZ_TOPLEFT = 4; + const int WMSZ_TOPRIGHT = 5; + const int WMSZ_BOTTOM = 6; + const int WMSZ_BOTTOMLEFT = 7; + const int WMSZ_BOTTOMRIGHT = 8; + + public struct RECT + { + public int Left; + public int Top; + public int Right; + public int Bottom; + } + #endregion + + + + /// + /// Handles raw window messages. + /// + /// The raw message. + [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] + protected override void WndProc(ref Message m) + { + if (m.Msg == WindowConstants.WM_SIZE) + { + if (m.WParam == WindowConstants.SIZE_MINIMIZED) + { + minimized = true; + maximized = false; + + OnSuspend(EventArgs.Empty); + } + else + { + Rectangle client = NativeMethods.GetClientRectangle(m.HWnd); + if (client.Height == 0) + { + // rapidly clicking the task bar to minimize and restore a window + // can cause a WM_SIZE message with SIZE_RESTORED when + // the window has actually become minimized due to rapid change + // so just ignore this message + } + else if (m.WParam == WindowConstants.SIZE_MAXIMIZED) + { + if (minimized) + OnResume(EventArgs.Empty); + + minimized = false; + maximized = true; + + OnUserResized(EventArgs.Empty); + UpdateScreen(); + } + else if (m.WParam == WindowConstants.SIZE_RESTORED) + { + if (minimized) + OnResume(EventArgs.Empty); + + minimized = false; + maximized = false; + + if (!inSizeMove && Size != cachedSize) + { + OnUserResized(EventArgs.Empty); + UpdateScreen(); + cachedSize = Size; + } + } + } + } + else if (m.Msg == WindowConstants.WM_ACTIVATEAPP) + { + if (m.WParam != IntPtr.Zero) + OnApplicationActivated(EventArgs.Empty); + else + OnApplicationDeactivated(EventArgs.Empty); + } + else if (m.Msg == WindowConstants.WM_POWERBROADCAST) + { + if (m.WParam == WindowConstants.PBT_APMQUERYSUSPEND) + { + OnSystemSuspend(EventArgs.Empty); + m.Result = (IntPtr)1; + return; + } + else if (m.WParam == WindowConstants.PBT_APMRESUMESUSPEND) + { + OnSystemResume(EventArgs.Empty); + m.Result = (IntPtr)1; + return; + } + } + else if (m.Msg == WindowConstants.WM_SYSCOMMAND) + { + long wparam = m.WParam.ToInt64() & 0xFFF0; + if (wparam == WindowConstants.SC_MONITORPOWER || wparam == WindowConstants.SC_SCREENSAVE) + { + CancelEventArgs e = new CancelEventArgs(); + OnScreensaver(e); + if (e.Cancel) + { + m.Result = IntPtr.Zero; + return; + } + } + #region #28200 2012.5.1 yyagi: Disable system menu + if ( ( m.WParam.ToInt32() & 0xFFFF ) == 0xF100 && !EnableSystemMenu ) // SC_KEYMENU + { + m.Result = IntPtr.Zero; + return; + } + #endregion + #region #23510 2010.11.13 yyagi: reset to 640x480 + if ((m.WParam.ToInt32() & 0xFFFF) == MENU_VIEW) + { + base.ClientSize = new Size(SampleFramework.GameWindowSize.Width, SampleFramework.GameWindowSize.Height); + this.OnResizeEnd(new EventArgs()); // #23510 2010.11.20 yyagi: to set window size to Config.ini + } + #endregion + } + #region #28821 2014.1.23 yyagi (WM_COPYDATA) + else if ( m.Msg == WindowConstants.WM_COPYDATA ) + { +//Trace.WriteLine( "FDK;msg received" ); + COPYDATASTRUCT cds = (COPYDATASTRUCT) Marshal.PtrToStructure( m.LParam, typeof( COPYDATASTRUCT ) ); + strMessage = Marshal.PtrToStringUni( cds.lpData ); + IsReceivedMessage = true; +//Trace.WriteLine( "FDK;msg=" + strMessage + ", len=" + strMessage.Length + ", truelen=" + cds.cbData ); + } + #endregion + #region #23510 2010.11.16 yyagi add: 邵ヲ讓ェ豈泌崋螳壹〒縺ョ繧ヲ繧、繝ウ繝峨え繧オ繧、繧コ螟画峩 from http://d.hatena.ne.jp/iselix/20080917/1221666614 http://hp.vector.co.jp/authors/VA016117/sizing.html + else if ( m.Msg == WM_SIZING ) + { + RECT rc = (RECT) Marshal.PtrToStructure( m.LParam, typeof( RECT ) ); + int w = rc.Right - rc.Left - ( Size.Width - ClientSize.Width ); + int h = rc.Bottom - rc.Top - ( Size.Height - ClientSize.Height ); + int dw = (int) ( h * widthRatio / heightRatio + 0.5 ) - w; + int dh = (int) ( w / ( widthRatio / heightRatio ) + 0.5 ) - h; + + switch ( m.WParam.ToInt32() ) + { + case WMSZ_LEFT: + case WMSZ_RIGHT: + rc.Bottom += dh; + break; + case WMSZ_TOP: + case WMSZ_BOTTOM: + rc.Right += dw; + break; + case WMSZ_BOTTOMRIGHT: + if ( dw > 0 ) + { + rc.Right += dw; + } + else + { + rc.Bottom += dh; + } + break; + case WMSZ_TOPLEFT: + if ( dw > 0 ) + { + rc.Left -= dw; + } + else + { + rc.Top -= dh; + } + break; + case WMSZ_TOPRIGHT: + if ( dw > 0 ) + { + rc.Right += dw; + } + else + { + rc.Top -= dh; + } + break; + case WMSZ_BOTTOMLEFT: + if ( dw > 0 ) + { + rc.Left -= dw; + } + else + { + rc.Bottom += dh; + } + break; + case 9: // #32383 2013.11.2 yyagi; exitting maximized window by using Aero snap + break; + default: + throw new ArgumentOutOfRangeException( "value", "Illegal WM_SIZING value." ); + } + Marshal.StructureToPtr( rc, m.LParam, true ); + } + #endregion + + + base.WndProc(ref m); + } + + void UpdateScreen() + { + Screen current = Screen.FromHandle(Handle); + if (Screen == null || Screen.DeviceName != current.DeviceName) + { + Screen = current; + if (Screen != null) + OnScreenChanged(EventArgs.Empty); + } + } + + static Screen ScreenFromHandle(IntPtr windowHandle) + { + Rectangle rectangle = NativeMethods.GetWindowRectangle(windowHandle); + + Screen bestScreen = null; + int mostArea = 0; + foreach (Screen screen in Screen.AllScreens) + { + Rectangle r = Rectangle.Intersect(rectangle, screen.Bounds); + int area = r.Width * r.Height; + + if (area > mostArea) + { + mostArea = area; + bestScreen = screen; + } + } + + if (bestScreen == null) + bestScreen = Screen.PrimaryScreen; + return bestScreen; + } + + static string GetAssemblyTitle(Assembly assembly) + { + if (assembly == null) + return null; + + AssemblyTitleAttribute[] customAttributes = (AssemblyTitleAttribute[])assembly.GetCustomAttributes(typeof(AssemblyTitleAttribute), true); + if (customAttributes != null && customAttributes.Length > 0) + return customAttributes[0].Title; + + return null; + } + + static string GetDefaultTitle() + { + string assemblyTitle = GetAssemblyTitle(Assembly.GetEntryAssembly()); + if (!string.IsNullOrEmpty(assemblyTitle)) + return assemblyTitle; + + try + { + Uri uri = new Uri(Application.ExecutablePath); + return Path.GetFileNameWithoutExtension(uri.LocalPath); + } + catch (ArgumentNullException e) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (6216f3e1-e1a5-45ca-bfd8-30bbc44bfa9a)" ); + } + catch (UriFormatException e) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (771f37b5-0b56-4a47-933e-3c178b3e27a7)" ); + } + + return DefaultTitle; + } + + static Icon GetDefaultIcon() + { + return (Icon)Resources.sdx_icon_black.Clone(); + } + + #region 繧キ繧ケ繝繝繝。繝九Η繝シ縺ォ"640x480"繧定ソス蜉 #23510 2010.11.13 yyagi add: to set "640x480" menu in systemmenu. See also http://cs2ch.blog123.fc2.com/blog-entry-80.html + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + private struct MENUITEMINFO + { + public uint cbSize; + public uint fMask; + public uint fType; + public uint fState; + public uint wID; + public IntPtr hSubMenu; + public IntPtr hbmpChecked; + public IntPtr hbmpUnchecked; + public IntPtr dwItemData; + public string dwTypeData; + public uint cch; + public IntPtr hbmpItem; + } + + [DllImport("user32", ExactSpelling = true)] + private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert); + [DllImport("user32", CharSet = CharSet.Auto)] + private static extern bool InsertMenuItem(IntPtr hMenu, uint uItem, bool fByPosition, ref MENUITEMINFO lpmii); + + private const uint MENU_VIEW = 0x9999; + private const uint MFT_SEPARATOR = 0x00000800; + private const uint MIIM_FTYPE = 0x00000100; + private const uint MIIM_STRING = 0x00000040; + private const uint MIIM_ID = 0x00000002; + + protected override void OnCreateControl() + { + base.OnCreateControl(); + + //繧キ繧ケ繝繝繝。繝九Η繝シ縺ョ繝上Φ繝峨Ν蜿門セ + IntPtr hSysMenu = GetSystemMenu(this.Handle, false); + + //繧サ繝代Ξ繝シ繧ソ繝シ縺ョ謖ソ蜈・ + MENUITEMINFO item1 = new MENUITEMINFO(); + item1.cbSize = (uint)Marshal.SizeOf(item1); + item1.fMask = MIIM_FTYPE; + item1.fType = MFT_SEPARATOR; + InsertMenuItem(hSysMenu, 5, true, ref item1); + + //繝。繝九Η繝シ鬆逶ョ縺ョ謖ソ蜈・ + MENUITEMINFO item2 = new MENUITEMINFO(); + item2.cbSize = (uint)Marshal.SizeOf(item2); + item2.fMask = MIIM_STRING | MIIM_ID; + item2.wID = MENU_VIEW; + item2.dwTypeData = "&" + SampleFramework.GameWindowSize.Width.ToString() + "x" + SampleFramework.GameWindowSize.Height.ToString(); + InsertMenuItem(hSysMenu, 6, true, ref item2); + } + #endregion + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameWindow.resx b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameWindow.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameWindow.resx @@ -0,0 +1,120 @@ +サソ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameWindowSize.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameWindowSize.cs new file mode 100644 index 00000000..2d7a1c58 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Core/GameWindowSize.cs @@ -0,0 +1,10 @@ +using System; + +namespace SampleFramework +{ + public static class GameWindowSize + { + public const int Width = 1280; + public const int Height = 720; + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/DeviceSettings/ConversionMethods.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/DeviceSettings/ConversionMethods.cs new file mode 100644 index 00000000..60915b37 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/DeviceSettings/ConversionMethods.cs @@ -0,0 +1,204 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ +using SlimDX; +using SlimDX.Direct3D9; +using DXGI = SlimDX.DXGI; + +namespace SampleFramework +{ + static class ConversionMethods + { + public static int GetDepthBits(Format format) + { + switch (format) + { + case Format.D32SingleLockable: + case Format.D32: + return 32; + + case Format.D24X8: + case Format.D24S8: + case Format.D24X4S4: + case Format.D24SingleS8: + return 24; + + case Format.D16Lockable: + case Format.D16: + return 16; + + case Format.D15S1: + return 15; + + default: + return 0; + } + } + + public static int GetStencilBits(Format format) + { + switch (format) + { + case Format.D15S1: + return 1; + + case Format.D24X4S4: + return 4; + + case Format.D24S8: + case Format.D24SingleS8: + return 8; + + default: + return 0; + } + } + + public static int GetColorBits(Format format) + { + switch (format) + { + case Format.R8G8B8: + case Format.A8R8G8B8: + case Format.A8B8G8R8: + case Format.X8R8G8B8: + return 8; + + case Format.R5G6B5: + case Format.X1R5G5B5: + case Format.A1R5G5B5: + return 5; + + case Format.A4R4G4B4: + case Format.X4R4G4B4: + return 4; + + case Format.R3G3B2: + case Format.A8R3G3B2: + return 2; + + case Format.A2R10G10B10: + case Format.A2B10G10R10: + return 10; + + case Format.A16B16G16R16: + return 16; + + default: + return 0; + } + } + + public static int GetColorBits(DXGI.Format format) + { + switch (format) + { + case SlimDX.DXGI.Format.R32G32B32A32_Float: + case SlimDX.DXGI.Format.R32G32B32A32_SInt: + case SlimDX.DXGI.Format.R32G32B32A32_Typeless: + case SlimDX.DXGI.Format.R32G32B32A32_UInt: + case SlimDX.DXGI.Format.R32G32B32_Float: + case SlimDX.DXGI.Format.R32G32B32_SInt: + case SlimDX.DXGI.Format.R32G32B32_Typeless: + case SlimDX.DXGI.Format.R32G32B32_UInt: + return 32; + + case SlimDX.DXGI.Format.R16G16B16A16_Float: + case SlimDX.DXGI.Format.R16G16B16A16_SInt: + case SlimDX.DXGI.Format.R16G16B16A16_SNorm: + case SlimDX.DXGI.Format.R16G16B16A16_Typeless: + case SlimDX.DXGI.Format.R16G16B16A16_UInt: + case SlimDX.DXGI.Format.R16G16B16A16_UNorm: + return 16; + + case SlimDX.DXGI.Format.R10G10B10A2_Typeless: + case SlimDX.DXGI.Format.R10G10B10A2_UInt: + case SlimDX.DXGI.Format.R10G10B10A2_UNorm: + return 10; + + case SlimDX.DXGI.Format.R8G8B8A8_SInt: + case SlimDX.DXGI.Format.R8G8B8A8_SNorm: + case SlimDX.DXGI.Format.R8G8B8A8_Typeless: + case SlimDX.DXGI.Format.R8G8B8A8_UInt: + case SlimDX.DXGI.Format.R8G8B8A8_UNorm: + case SlimDX.DXGI.Format.R8G8B8A8_UNorm_SRGB: + return 8; + + case SlimDX.DXGI.Format.B5G5R5A1_UNorm: + case SlimDX.DXGI.Format.B5G6R5_UNorm: + return 5; + + default: + return 0; + } + } + + public static MultisampleType ToDirect3D9(int type) + { + return (MultisampleType)type; + } + + public static Format ToDirect3D9(DXGI.Format format) + { + switch (format) + { + case SlimDX.DXGI.Format.R8G8B8A8_UNorm: + return Format.A8R8G8B8; + case SlimDX.DXGI.Format.B5G6R5_UNorm: + return Format.R5G6B5; + case SlimDX.DXGI.Format.B5G5R5A1_UNorm: + return Format.A1R5G5B5; + case SlimDX.DXGI.Format.A8_UNorm: + return Format.A8; + case SlimDX.DXGI.Format.R10G10B10A2_UNorm: + return Format.A2B10G10R10; + case SlimDX.DXGI.Format.B8G8R8A8_UNorm: + return Format.A8B8G8R8; + case SlimDX.DXGI.Format.R16G16_UNorm: + return Format.G16R16; + case SlimDX.DXGI.Format.R16G16B16A16_UNorm: + return Format.A16B16G16R16; + case SlimDX.DXGI.Format.R16_Float: + return Format.R16F; + case SlimDX.DXGI.Format.R16G16_Float: + return Format.G16R16F; + case SlimDX.DXGI.Format.R16G16B16A16_Float: + return Format.A16B16G16R16F; + case SlimDX.DXGI.Format.R32_Float: + return Format.R32F; + case SlimDX.DXGI.Format.R32G32_Float: + return Format.G32R32F; + case SlimDX.DXGI.Format.R32G32B32A32_Float: + return Format.A32B32G32R32F; + } + + return Format.Unknown; + } + + public static float ToFloat(Rational rational) + { + float denom = 1; + if (rational.Denominator != 0) + denom = rational.Denominator; + return rational.Numerator / denom; + } + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/DeviceSettings/DeviceSettings.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/DeviceSettings/DeviceSettings.cs new file mode 100644 index 00000000..80063121 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/DeviceSettings/DeviceSettings.cs @@ -0,0 +1,285 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ +using System; +using SlimDX.Direct3D9; +namespace SampleFramework +{ + /// + /// Contains settings for creating a 3D device. + /// + public class DeviceSettings : ICloneable + { + /// + /// Gets or sets the adapter ordinal. + /// + /// The adapter ordinal. + public int AdapterOrdinal + { + get; + set; + } + + /// + /// Gets or sets the type of the device. + /// + /// The type of the device. + public DeviceType DeviceType + { + get; + set; + } + + /// + /// Gets or sets the refresh rate. + /// + /// The refresh rate. + public int RefreshRate + { + get; + set; + } + + /// + /// Gets or sets the width of the back buffer. + /// + /// The width of the back buffer. + public int BackBufferWidth + { + get; + set; + } + + /// + /// Gets or sets the height of the back buffer. + /// + /// The height of the back buffer. + public int BackBufferHeight + { + get; + set; + } + + /// + /// Gets or sets the back buffer format. + /// + /// The back buffer format. + public Format BackBufferFormat + { + get; + set; + } + + /// + /// Gets or sets the back buffer count. + /// + /// The back buffer count. + public int BackBufferCount + { + get; + set; + } + + /// + /// Gets or sets a value indicating whether the device is windowed. + /// + /// true if windowed; otherwise, false. + public bool Windowed + { + get; + set; + } + + /// + /// Gets or sets a value indicating whether VSync is enabled. + /// + /// true if VSync is enabled; otherwise, false. + public bool EnableVSync + { + get; + set; + } + + /// + /// Gets or sets a value indicating whether this is multithreaded. + /// + /// true if multithreaded; otherwise, false. + /// This only has an effect for Direct3D9 devices. + public bool Multithreaded + { + get; + set; + } + + /// + /// Gets or sets the multisample type. + /// + /// The multisample type. + public MultisampleType MultisampleType + { + get; + set; + } + + /// + /// Gets or sets the multisample quality. + /// + /// The multisample quality. + public int MultisampleQuality + { + get; + set; + } + + /// + /// Gets or sets the depth stencil format. + /// + /// The depth stencil format. + public Format DepthStencilFormat + { + get; + set; + } + + /// + /// Gets or sets the Direct3D9 specific settings. + /// + /// The Direct3D9 specific settings. + internal Direct3D9Settings Direct3D9 + { + get; + set; + } + + /// + /// Initializes a new instance of the class. + /// + public DeviceSettings() + { + // set sane defaults + DeviceType = DeviceType.Hardware; + BackBufferFormat = Format.Unknown; + BackBufferCount = 1; + MultisampleType = MultisampleType.None; + DepthStencilFormat = Format.Unknown; + Windowed = true; + EnableVSync = true; + } + + /// + /// Creates a new object that is a copy of the current instance. + /// + /// + /// A new object that is a copy of this instance. + /// + public DeviceSettings Clone() + { + DeviceSettings result = new DeviceSettings(); + result.DeviceType = DeviceType; + result.RefreshRate = RefreshRate; + result.BackBufferCount = BackBufferCount; + result.BackBufferFormat = BackBufferFormat; + result.BackBufferHeight = BackBufferHeight; + result.BackBufferWidth = BackBufferWidth; + result.DepthStencilFormat = DepthStencilFormat; + result.MultisampleQuality = MultisampleQuality; + result.MultisampleType = MultisampleType; + result.Windowed = Windowed; + result.EnableVSync = EnableVSync; + result.AdapterOrdinal = AdapterOrdinal; + result.Multithreaded = Multithreaded; + + if (Direct3D9 != null) + result.Direct3D9 = Direct3D9.Clone(); + + return result; + } + + /// + /// Creates a new object that is a copy of the current instance. + /// + /// + /// A new object that is a copy of this instance. + /// + object ICloneable.Clone() + { + return Clone(); + } + + /// + /// Finds valid device settings based upon the desired settings. + /// + /// The desired settings. + /// The best valid device settings matching the input settings. + public static DeviceSettings FindValidSettings( DeviceSettings settings ) + { + try + { + GraphicsDeviceManager.EnsureD3D9(); + } + catch( Exception e ) + { + throw new NoCompatibleDevicesException( "Could not initialize Direct3D9.", e ); + } + + if( !Enumeration9.HasEnumerated ) + Enumeration9.Enumerate(); + + DeviceSettings newSettings = settings.Clone(); + Direct3D9Settings d3d9 = FindValidD3D9Settings( settings ); + newSettings.Direct3D9 = d3d9; + return newSettings; + } + + static Direct3D9Settings FindValidD3D9Settings(DeviceSettings settings) + { + Direct3D9Settings optimal = Direct3D9Settings.BuildOptimalSettings(settings); + + SettingsCombo9 bestCombo = null; + float bestRanking = -1.0f; + + foreach (AdapterInfo9 adapterInfo in Enumeration9.Adapters) + { + DisplayMode desktopMode = GraphicsDeviceManager.Direct3D9Object.GetAdapterDisplayMode(adapterInfo.AdapterOrdinal); + foreach (DeviceInfo9 deviceInfo in adapterInfo.Devices) + { + foreach (SettingsCombo9 combo in deviceInfo.DeviceSettings) + { + if (combo.Windowed && combo.AdapterFormat != desktopMode.Format) + continue; + + float ranking = Direct3D9Settings.RankSettingsCombo(combo, optimal, desktopMode); + if (ranking > bestRanking) + { + bestCombo = combo; + bestRanking = ranking; + } + } + } + } + + if (bestCombo == null) + throw new NoCompatibleDevicesException("No compatible Direct3D9 devices found."); + + return Direct3D9Settings.BuildValidSettings(bestCombo, optimal); + } + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/DeviceSettings/Direct3D9Settings.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/DeviceSettings/Direct3D9Settings.cs new file mode 100644 index 00000000..b44a3aac --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/DeviceSettings/Direct3D9Settings.cs @@ -0,0 +1,440 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ +using System; +using System.Collections.Generic; +using SlimDX.Direct3D9; + +namespace SampleFramework +{ + class Direct3D9Settings : ICloneable + { + public int AdapterOrdinal + { + get; + set; + } + + public DeviceType DeviceType + { + get; + set; + } + + public Format AdapterFormat + { + get; + set; + } + + public CreateFlags CreationFlags + { + get; + set; + } + + public PresentParameters PresentParameters + { + get; + private set; + } + + public Direct3D9Settings() + { + PresentParameters = new PresentParameters(); + DeviceType = DeviceType.Hardware; + PresentParameters.Windowed = true; + AdapterFormat = Format.Unknown; + CreationFlags = CreateFlags.HardwareVertexProcessing; + PresentParameters.BackBufferFormat = Format.Unknown; + PresentParameters.BackBufferCount = 1; + PresentParameters.Multisample = MultisampleType.None; + PresentParameters.SwapEffect = SwapEffect.Discard; + PresentParameters.EnableAutoDepthStencil = true; + PresentParameters.AutoDepthStencilFormat = Format.Unknown; + PresentParameters.PresentFlags = PresentFlags.DiscardDepthStencil; + PresentParameters.PresentationInterval = PresentInterval.Default; + } + + public Direct3D9Settings Clone() + { + Direct3D9Settings clone = new Direct3D9Settings(); + clone.AdapterFormat = AdapterFormat; + clone.AdapterOrdinal = AdapterOrdinal; + clone.CreationFlags = CreationFlags; + clone.DeviceType = DeviceType; + clone.PresentParameters = PresentParameters.Clone(); + + return clone; + } + + object ICloneable.Clone() + { + return Clone(); + } + + public static Direct3D9Settings BuildOptimalSettings(DeviceSettings settings) + { + DisplayMode desktopMode = GraphicsDeviceManager.Direct3D9Object.GetAdapterDisplayMode(0); + Direct3D9Settings optimal = new Direct3D9Settings(); + + optimal.AdapterOrdinal = settings.AdapterOrdinal; + optimal.DeviceType = settings.DeviceType; + optimal.PresentParameters.Windowed = settings.Windowed; + optimal.PresentParameters.BackBufferCount = settings.BackBufferCount; + optimal.PresentParameters.Multisample = settings.MultisampleType; + optimal.PresentParameters.MultisampleQuality = settings.MultisampleQuality; + optimal.PresentParameters.FullScreenRefreshRateInHertz = settings.RefreshRate; + + if(settings.Multithreaded) + optimal.CreationFlags |= CreateFlags.Multithreaded; + + if(optimal.PresentParameters.Windowed || ConversionMethods.GetColorBits(desktopMode.Format) >= 8) + optimal.AdapterFormat = desktopMode.Format; + else + optimal.AdapterFormat = Format.X8R8G8B8; + + if(settings.BackBufferWidth == 0 || settings.BackBufferHeight == 0) + { + if(optimal.PresentParameters.Windowed) + { + optimal.PresentParameters.BackBufferWidth = 640; + optimal.PresentParameters.BackBufferHeight = 480; + } + else + { + optimal.PresentParameters.BackBufferWidth = desktopMode.Width; + optimal.PresentParameters.BackBufferHeight = desktopMode.Height; + } + } + else + { + optimal.PresentParameters.BackBufferWidth = settings.BackBufferWidth; + optimal.PresentParameters.BackBufferHeight = settings.BackBufferHeight; + } + + if(settings.BackBufferFormat == Format.Unknown) + optimal.PresentParameters.BackBufferFormat = optimal.AdapterFormat; + else + optimal.PresentParameters.BackBufferFormat = settings.BackBufferFormat; + + if(settings.DepthStencilFormat == Format.Unknown) + { + if(ConversionMethods.GetColorBits(optimal.PresentParameters.BackBufferFormat) >= 8) + optimal.PresentParameters.AutoDepthStencilFormat = Format.D32; + else + optimal.PresentParameters.AutoDepthStencilFormat = Format.D16; + } + else + optimal.PresentParameters.AutoDepthStencilFormat = settings.DepthStencilFormat; + + if(!settings.EnableVSync) + optimal.PresentParameters.PresentationInterval = PresentInterval.Immediate; + + return optimal; + } + + public static float RankSettingsCombo(SettingsCombo9 combo, Direct3D9Settings optimal, DisplayMode desktopMode) + { + float ranking = 0.0f; + + if(combo.AdapterOrdinal == optimal.AdapterOrdinal) + ranking += 1000.0f; + + if(combo.DeviceType == optimal.DeviceType) + ranking += 100.0f; + + if(combo.DeviceType == DeviceType.Hardware) + ranking += 0.1f; + + if(combo.Windowed == optimal.PresentParameters.Windowed) + ranking += 10.0f; + + if(combo.AdapterFormat == optimal.AdapterFormat) + ranking += 1.0f; + else + { + int bitDepthDelta = Math.Abs(ConversionMethods.GetColorBits(combo.AdapterFormat) - + ConversionMethods.GetColorBits(optimal.AdapterFormat)); + float scale = Math.Max(0.9f - bitDepthDelta * 0.2f, 0.0f); + ranking += scale; + } + + if(!combo.Windowed) + { + bool match; + if(ConversionMethods.GetColorBits(desktopMode.Format) >= 8) + match = (combo.AdapterFormat == desktopMode.Format); + else + match = (combo.AdapterFormat == Format.X8R8G8B8); + + if(match) + ranking += 0.1f; + } + + if((optimal.CreationFlags & CreateFlags.HardwareVertexProcessing) != 0 && + (optimal.CreationFlags & CreateFlags.MixedVertexProcessing) != 0) + { + if((combo.DeviceInfo.Capabilities.DeviceCaps & DeviceCaps.HWTransformAndLight) != 0) + ranking += 1.0f; + } + + if((combo.DeviceInfo.Capabilities.DeviceCaps & DeviceCaps.HWTransformAndLight) != 0) + ranking += 0.1f; + + foreach(DisplayMode displayMode in combo.AdapterInfo.DisplayModes) + { + if(displayMode.Format == combo.AdapterFormat && + displayMode.Width == optimal.PresentParameters.BackBufferWidth && + displayMode.Height == optimal.PresentParameters.BackBufferHeight) + { + ranking += 1.0f; + break; + } + } + + if(combo.BackBufferFormat == optimal.PresentParameters.BackBufferFormat) + ranking += 1.0f; + else + { + int bitDepthDelta = Math.Abs(ConversionMethods.GetColorBits(combo.BackBufferFormat) - + ConversionMethods.GetColorBits(optimal.PresentParameters.BackBufferFormat)); + float scale = Math.Max(0.9f - bitDepthDelta * 0.2f, 0.0f); + ranking += scale; + } + + if(combo.BackBufferFormat == combo.AdapterFormat) + ranking += 0.1f; + + for(int i = 0; i < combo.MultisampleTypes.Count; i++) + { + MultisampleType type = combo.MultisampleTypes[i]; + int quality = combo.MultisampleQualities[i]; + + if(type == optimal.PresentParameters.Multisample && quality == optimal.PresentParameters.MultisampleQuality) + { + ranking += 1.0f; + break; + } + } + + if(combo.DepthStencilFormats.Contains(optimal.PresentParameters.AutoDepthStencilFormat)) + ranking += 1.0f; + + foreach(DisplayMode displayMode in combo.AdapterInfo.DisplayModes) + { + if(displayMode.Format == combo.AdapterFormat && + displayMode.RefreshRate == optimal.PresentParameters.FullScreenRefreshRateInHertz) + { + ranking += 1.0f; + break; + } + } + + if(combo.PresentIntervals.Contains(optimal.PresentParameters.PresentationInterval)) + ranking += 1.0f; + + return ranking; + } + + public static Direct3D9Settings BuildValidSettings(SettingsCombo9 combo, Direct3D9Settings input) + { + Direct3D9Settings settings = new Direct3D9Settings(); + + settings.AdapterOrdinal = combo.AdapterOrdinal; + settings.DeviceType = combo.DeviceType; + settings.PresentParameters.Windowed = combo.Windowed; + settings.AdapterFormat = combo.AdapterFormat; + settings.PresentParameters.BackBufferFormat = combo.BackBufferFormat; + settings.PresentParameters.SwapEffect = input.PresentParameters.SwapEffect; + settings.PresentParameters.PresentFlags = input.PresentParameters.PresentFlags | PresentFlags.DiscardDepthStencil; + + settings.CreationFlags = input.CreationFlags; + if((combo.DeviceInfo.Capabilities.DeviceCaps & DeviceCaps.HWTransformAndLight) == 0 && + ((settings.CreationFlags & CreateFlags.HardwareVertexProcessing) != 0 || + (settings.CreationFlags & CreateFlags.MixedVertexProcessing) != 0)) + { + settings.CreationFlags &= ~CreateFlags.HardwareVertexProcessing; + settings.CreationFlags &= ~CreateFlags.MixedVertexProcessing; + settings.CreationFlags |= CreateFlags.SoftwareVertexProcessing; + } + + if((settings.CreationFlags & CreateFlags.HardwareVertexProcessing) == 0 && + (settings.CreationFlags & CreateFlags.MixedVertexProcessing) == 0 && + (settings.CreationFlags & CreateFlags.SoftwareVertexProcessing) == 0) + { + if((combo.DeviceInfo.Capabilities.DeviceCaps & DeviceCaps.HWTransformAndLight) != 0) + settings.CreationFlags |= CreateFlags.HardwareVertexProcessing; + else + settings.CreationFlags |= CreateFlags.SoftwareVertexProcessing; + } + + DisplayMode bestDisplayMode = FindValidResolution(combo, input); + settings.PresentParameters.BackBufferWidth = bestDisplayMode.Width; + settings.PresentParameters.BackBufferHeight = bestDisplayMode.Height; + + settings.PresentParameters.BackBufferCount = input.PresentParameters.BackBufferCount; + if(settings.PresentParameters.BackBufferCount > 3) + settings.PresentParameters.BackBufferCount = 3; + if(settings.PresentParameters.BackBufferCount < 1) + settings.PresentParameters.BackBufferCount = 1; + + if(input.PresentParameters.SwapEffect != SwapEffect.Discard) + { + settings.PresentParameters.Multisample = MultisampleType.None; + settings.PresentParameters.MultisampleQuality = 0; + } + else + { + MultisampleType bestType = MultisampleType.None; + int bestQuality = 0; + + for(int i = 0; i < combo.MultisampleTypes.Count; i++) + { + MultisampleType type = combo.MultisampleTypes[i]; + int quality = combo.MultisampleQualities[0]; + + if(Math.Abs(type - input.PresentParameters.Multisample) < Math.Abs(bestType - + input.PresentParameters.Multisample)) + { + bestType = type; + bestQuality = Math.Min(quality - 1, input.PresentParameters.MultisampleQuality); + } + } + + settings.PresentParameters.Multisample = bestType; + settings.PresentParameters.MultisampleQuality = bestQuality; + } + + List rankings = new List(); + int inputDepthBitDepth = ConversionMethods.GetDepthBits(input.PresentParameters.AutoDepthStencilFormat); + int inputStencilBitDepth = ConversionMethods.GetStencilBits(input.PresentParameters.AutoDepthStencilFormat); + + foreach(Format format in combo.DepthStencilFormats) + { + int currentBitDepth = ConversionMethods.GetDepthBits(format); + int currentStencilDepth = ConversionMethods.GetStencilBits(format); + + int ranking = Math.Abs(currentBitDepth - inputDepthBitDepth); + ranking += Math.Abs(currentStencilDepth - inputStencilBitDepth); + rankings.Add(ranking); + } + + int bestRanking = int.MaxValue; + foreach(int ranking in rankings) + { + if(ranking < bestRanking) + bestRanking = ranking; + } + int bestIndex = rankings.IndexOf(bestRanking); + + if(bestIndex >= 0) + { + settings.PresentParameters.AutoDepthStencilFormat = combo.DepthStencilFormats[bestIndex]; + settings.PresentParameters.EnableAutoDepthStencil = true; + } + else + { + settings.PresentParameters.AutoDepthStencilFormat = Format.Unknown; + settings.PresentParameters.EnableAutoDepthStencil = false; + } + + if(combo.Windowed) + settings.PresentParameters.FullScreenRefreshRateInHertz = 0; + else + { + int match = input.PresentParameters.FullScreenRefreshRateInHertz; + bestDisplayMode.RefreshRate = 0; + if(match != 0) + { + bestRanking = 100000; + foreach(DisplayMode displayMode in combo.AdapterInfo.DisplayModes) + { + if(displayMode.Format != combo.AdapterFormat || + displayMode.Width != bestDisplayMode.Width || + displayMode.Height != bestDisplayMode.Height) + continue; + + int ranking = Math.Abs(displayMode.RefreshRate - match); + + if(ranking < bestRanking) + { + bestDisplayMode.RefreshRate = displayMode.RefreshRate; + bestRanking = ranking; + + if(bestRanking == 0) + break; + } + } + } + + settings.PresentParameters.FullScreenRefreshRateInHertz = bestDisplayMode.RefreshRate; + } + + if(combo.PresentIntervals.Contains(input.PresentParameters.PresentationInterval)) + settings.PresentParameters.PresentationInterval = input.PresentParameters.PresentationInterval; + else + settings.PresentParameters.PresentationInterval = PresentInterval.Default; + + return settings; + } + + static DisplayMode FindValidResolution(SettingsCombo9 combo, Direct3D9Settings input) + { + DisplayMode bestMode = new DisplayMode(); + + if(combo.Windowed) + { + bestMode.Width = input.PresentParameters.BackBufferWidth; + bestMode.Height = input.PresentParameters.BackBufferHeight; + return bestMode; + } + + int bestRanking = 100000; + int ranking; + foreach(DisplayMode mode in combo.AdapterInfo.DisplayModes) + { + if(mode.Format != combo.AdapterFormat) + continue; + + ranking = Math.Abs(mode.Width - input.PresentParameters.BackBufferWidth) + + Math.Abs(mode.Height - input.PresentParameters.BackBufferHeight); + + if(ranking < bestRanking) + { + bestMode = mode; + bestRanking = ranking; + + if(bestRanking == 0) + break; + } + } + + if(bestMode.Width == 0) + { + bestMode.Width = input.PresentParameters.BackBufferWidth; + bestMode.Height = input.PresentParameters.BackBufferHeight; + } + + return bestMode; + } + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Enumeration/Enumeration9.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Enumeration/Enumeration9.cs new file mode 100644 index 00000000..0aa8f41d --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Enumeration/Enumeration9.cs @@ -0,0 +1,447 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ +using System.Collections.Generic; +using System.Globalization; +using SlimDX.Direct3D9; + +namespace SampleFramework +{ + class AdapterInfo9 + { + public int AdapterOrdinal + { + get; + set; + } + + public AdapterDetails Details + { + get; + set; + } + + public string Description + { + get; + set; + } + + public List DisplayModes + { + get; + private set; + } + + public List Devices + { + get; + private set; + } + + public AdapterInfo9() + { + // create lists + DisplayModes = new List(); + Devices = new List(); + } + } + + class DeviceInfo9 + { + public DeviceType DeviceType + { + get; + set; + } + + public Capabilities Capabilities + { + get; + set; + } + + public List DeviceSettings + { + get; + private set; + } + + public DeviceInfo9() + { + DeviceSettings = new List(); + } + } + + class SettingsCombo9 + { + public int AdapterOrdinal + { + get; + set; + } + + public DeviceType DeviceType + { + get; + set; + } + + public Format AdapterFormat + { + get; + set; + } + + public Format BackBufferFormat + { + get; + set; + } + + public bool Windowed + { + get; + set; + } + + public List DepthStencilFormats + { + get; + internal set; + } + + public List MultisampleTypes + { + get; + private set; + } + + public List MultisampleQualities + { + get; + private set; + } + + public List PresentIntervals + { + get; + private set; + } + + public AdapterInfo9 AdapterInfo + { + get; + set; + } + + public DeviceInfo9 DeviceInfo + { + get; + set; + } + + public SettingsCombo9() + { + DepthStencilFormats = new List(); + MultisampleQualities = new List(); + MultisampleTypes = new List(); + PresentIntervals = new List(); + } + } + + class DisplayModeComparer9 : IComparer + { + static DisplayModeComparer9 comparer = new DisplayModeComparer9(); + + public static DisplayModeComparer9 Comparer + { + get { return comparer; } + } + + public DisplayModeComparer9() + { + } + + public int Compare(DisplayMode x, DisplayMode y) + { + if (x.Width > y.Width) + return 1; + if (x.Width < y.Width) + return -1; + if (x.Height > y.Height) + return 1; + if (x.Height < y.Height) + return -1; + if (x.Format > y.Format) + return 1; + if (x.Format < y.Format) + return -1; + if (x.RefreshRate > y.RefreshRate) + return 1; + if (x.RefreshRate < y.RefreshRate) + return -1; + + return 0; + } + } + + static class Enumeration9 + { + public static DeviceSettings MinimumSettings + { + get; + set; + } + + public static List Adapters + { + get; + private set; + } + + public static bool HasEnumerated + { + get; + private set; + } + + public static void Enumerate() + { + HasEnumerated = true; + Adapters = new List(); + List adapterFormats = new List(); + Format[] allowedAdapterFormats = { Format.X8R8G8B8, Format.X1R5G5B5, Format.R5G6B5, + Format.A2R10G10B10 }; + + foreach (AdapterInformation adapter in GraphicsDeviceManager.Direct3D9Object.Adapters) // + { + AdapterInfo9 info = new AdapterInfo9(); + info.AdapterOrdinal = adapter.Adapter; + info.Details = adapter.Details; + + adapterFormats.Clear(); + foreach (Format adapterFormat in allowedAdapterFormats) + { + foreach (DisplayMode displayMode in adapter.GetDisplayModes(adapterFormat)) + { + if (MinimumSettings != null) + { + if (displayMode.Width < MinimumSettings.BackBufferWidth || + displayMode.Height < MinimumSettings.BackBufferHeight || + displayMode.RefreshRate < MinimumSettings.RefreshRate) + continue; + } + + info.DisplayModes.Add(displayMode); + + if (!adapterFormats.Contains(displayMode.Format)) + adapterFormats.Add(displayMode.Format); + } + } + + if (!adapterFormats.Contains(adapter.CurrentDisplayMode.Format)) + adapterFormats.Add(adapter.CurrentDisplayMode.Format); + + info.DisplayModes.Sort(DisplayModeComparer9.Comparer); + + EnumerateDevices(info, adapterFormats); + + if (info.Devices.Count > 0) + Adapters.Add(info); + } + + bool unique = true; + foreach (AdapterInfo9 adapter1 in Adapters) + { + foreach (AdapterInfo9 adapter2 in Adapters) + { + if (adapter1 == adapter2) + continue; + if (adapter1.Details.Description == adapter2.Details.Description) + { + unique = false; + break; + } + } + + if (!unique) + break; + } + + foreach (AdapterInfo9 info in Adapters) + { + info.Description = info.Details.Description; + if (!unique) + info.Description += " " + info.AdapterOrdinal.ToString(CultureInfo.CurrentCulture); + } + } + + static void EnumerateDevices(AdapterInfo9 info, List adapterFormats) + { + DeviceType[] deviceTypes = { DeviceType.Hardware, DeviceType.Reference }; + + foreach (DeviceType deviceType in deviceTypes) + { + if (MinimumSettings != null && MinimumSettings.DeviceType != deviceType) + continue; + + DeviceInfo9 deviceInfo = new DeviceInfo9(); + deviceInfo.DeviceType = deviceType; + try + { + deviceInfo.Capabilities = GraphicsDeviceManager.Direct3D9Object.GetDeviceCaps(info.AdapterOrdinal, deviceInfo.DeviceType); + + EnumerateSettingsCombos(info, deviceInfo, adapterFormats); + + if (deviceInfo.DeviceSettings.Count > 0) + info.Devices.Add(deviceInfo); + } + catch (Direct3D9Exception) + { + // #23681 2010.11.17 yyagi: GetDeviceCaps()縺ァ萓句、悶′逋コ逕溘☆繧九Δ繝九ち縺ォ蟇セ縺励※縺ッ縲‘numerate繧偵せ繧ュ繝繝励☆繧九 + } + } + } + + static void EnumerateSettingsCombos(AdapterInfo9 adapterInfo, DeviceInfo9 deviceInfo, List adapterFormats) + { + Format[] backBufferFormats = { Format.A8R8G8B8, Format.X8R8G8B8, Format.A2R10G10B10, + Format.R5G6B5, Format.A1R5G5B5, Format.X1R5G5B5 }; + + foreach (Format adapterFormat in adapterFormats) + { + foreach (Format backBufferFormat in backBufferFormats) + { + for (int windowed = 0; windowed < 2; windowed++) + { + if (windowed == 0 && adapterInfo.DisplayModes.Count == 0) + continue; + + if (!GraphicsDeviceManager.Direct3D9Object.CheckDeviceType(adapterInfo.AdapterOrdinal, deviceInfo.DeviceType, + adapterFormat, backBufferFormat, (windowed == 1))) + continue; + + if (!GraphicsDeviceManager.Direct3D9Object.CheckDeviceFormat(adapterInfo.AdapterOrdinal, + deviceInfo.DeviceType, adapterFormat, Usage.QueryPostPixelShaderBlending, + ResourceType.Texture, backBufferFormat)) + continue; + + SettingsCombo9 combo = new SettingsCombo9(); + combo.AdapterOrdinal = adapterInfo.AdapterOrdinal; + combo.DeviceType = deviceInfo.DeviceType; + combo.AdapterFormat = adapterFormat; + combo.BackBufferFormat = backBufferFormat; + combo.Windowed = (windowed == 1); + combo.AdapterInfo = adapterInfo; + combo.DeviceInfo = deviceInfo; + + BuildDepthStencilFormatList(combo); + BuildMultisampleTypeList(combo); + + if (combo.MultisampleTypes.Count == 0) + continue; + + BuildPresentIntervalList(combo); + + if (MinimumSettings != null) + { + if (MinimumSettings.BackBufferFormat != Format.Unknown && + MinimumSettings.BackBufferFormat != backBufferFormat) + continue; + + if (MinimumSettings.DepthStencilFormat != Format.Unknown && + !combo.DepthStencilFormats.Contains(MinimumSettings.DepthStencilFormat)) + continue; + + if (!combo.MultisampleTypes.Contains(MinimumSettings.MultisampleType)) + continue; + } + + deviceInfo.DeviceSettings.Add(combo); + } + } + } + } + + static void BuildDepthStencilFormatList(SettingsCombo9 combo) + { + List possibleDepthStencilFormats = new List { + Format.D16, Format.D15S1, Format.D24X8, + Format.D24S8, Format.D24X4S4, Format.D32 }; + + foreach (Format format in possibleDepthStencilFormats) + { + if (GraphicsDeviceManager.Direct3D9Object.CheckDeviceFormat(combo.AdapterOrdinal, combo.DeviceType, combo.AdapterFormat, + Usage.DepthStencil, ResourceType.Surface, format) && + GraphicsDeviceManager.Direct3D9Object.CheckDepthStencilMatch(combo.AdapterOrdinal, combo.DeviceType, + combo.AdapterFormat, combo.BackBufferFormat, format)) + combo.DepthStencilFormats.Add(format); + } + } + + static void BuildMultisampleTypeList(SettingsCombo9 combo) + { + List possibleMultisampleTypes = new List() { + MultisampleType.None, MultisampleType.NonMaskable, + MultisampleType.TwoSamples, MultisampleType.ThreeSamples, + MultisampleType.FourSamples, MultisampleType.FiveSamples, + MultisampleType.SixSamples, MultisampleType.SevenSamples, + MultisampleType.EightSamples, MultisampleType.NineSamples, + MultisampleType.TenSamples, MultisampleType.ElevenSamples, + MultisampleType.TwelveSamples, MultisampleType.ThirteenSamples, + MultisampleType.FourteenSamples, MultisampleType.FifteenSamples, + MultisampleType.SixteenSamples + }; + + int quality; + foreach (MultisampleType type in possibleMultisampleTypes) + { + if (GraphicsDeviceManager.Direct3D9Object.CheckDeviceMultisampleType(combo.AdapterOrdinal, combo.DeviceType, + combo.AdapterFormat, combo.Windowed, type, out quality)) + { + combo.MultisampleTypes.Add(type); + combo.MultisampleQualities.Add(quality); + } + } + } + + static void BuildPresentIntervalList(SettingsCombo9 combo) + { + List possiblePresentIntervals = new List() { + PresentInterval.Immediate, PresentInterval.Default, + PresentInterval.One, PresentInterval.Two, + PresentInterval.Three, PresentInterval.Four + }; + + foreach (PresentInterval interval in possiblePresentIntervals) + { + if (combo.Windowed && (interval == PresentInterval.Two || + interval == PresentInterval.Three || interval == PresentInterval.Four)) + continue; + + if (interval == PresentInterval.Default || + (combo.DeviceInfo.Capabilities.PresentationIntervals & interval) != 0) + combo.PresentIntervals.Add(interval); + } + } + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Properties/Resources.Designer.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Properties/Resources.Designer.cs new file mode 100644 index 00000000..eecc3623 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Properties/Resources.Designer.cs @@ -0,0 +1,70 @@ +サソ//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.1434 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SampleFramework.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SampleFramework.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Icon sdx_icon_black { + get { + object obj = ResourceManager.GetObject("sdx_icon_black", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Properties/Resources.resx b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Properties/Resources.resx new file mode 100644 index 00000000..827822b2 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Properties/Resources.resx @@ -0,0 +1,124 @@ +サソ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\sdx_icon_black.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/DeviceCache.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/DeviceCache.cs new file mode 100644 index 00000000..3a3dd8fe --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/DeviceCache.cs @@ -0,0 +1,200 @@ +サソusing System; +using System.Drawing; +using SlimDX; +using SlimDX.Direct3D9; + +namespace SampleFramework +{ + public sealed class DeviceCache + { + private readonly Device _device; + + public DeviceCache(Device device) + { + _device = device; + } + + public Device UnderlyingDevice => _device; + + public void Dispose() + { + _device.Dispose(); + } + + public object Tag + { + get => _device.Tag; + set => _device.Tag = value; + } + + public Result TestCooperativeLevel() + { + return _device.TestCooperativeLevel(); + } + + public Result Reset(PresentParameters presentParameters) + { + return _device.Reset(presentParameters); + } + + public Result Clear(ClearFlags clearFlags, in Color4 color, float zdepth, int stencil) + { + return _device.Clear(clearFlags, color, zdepth, stencil); + } + + public Result BeginScene() + { + return _device.BeginScene(); + } + + public Result EndScene() + { + return _device.EndScene(); + } + + public Result Present() + { + return _device.Present(); + } + + public Surface GetBackBuffer(int swapChain, int backBuffer) + { + return _device.GetBackBuffer(swapChain, backBuffer); + } + + public Surface GetRenderTarget(int index) + { + return _device.GetRenderTarget(index); + } + + public Result SetRenderState(RenderState state, T value) where T : Enum + { + return _device.SetRenderState(state, value); + } + + private BlendOperation? _lastBlendOperation; + public void SetRenderState(RenderState state, BlendOperation value) + { + if (state == RenderState.BlendOperation) + { + if (_lastBlendOperation == value) + { + return; + } + + _lastBlendOperation = value; + } + + _device.SetRenderState(state, value); + } + + private Blend? _lastSourceBlend; + private Blend? _lastDestinationBlend; + public void SetRenderState(RenderState state, Blend value) + { + if (state == RenderState.SourceBlend) + { + if (_lastSourceBlend == value) + { + return; + } + + _lastSourceBlend = value; + } + else if (state == RenderState.DestinationBlend) + { + if (_lastDestinationBlend == value) + { + return; + } + + _lastDestinationBlend = value; + } + + _device.SetRenderState(state, value); + } + + public Result SetRenderState(RenderState state, bool value) + { + return _device.SetRenderState(state, value); + } + + public Result SetRenderState(RenderState state, int value) + { + return _device.SetRenderState(state, value); + } + + public Result SetTextureStageState(int stage, TextureStage type, TextureOperation textureOperation) + { + return _device.SetTextureStageState(stage, type, textureOperation); + } + + public Result SetTextureStageState(int stage, TextureStage type, int value) + { + return _device.SetTextureStageState(stage, type, value); + } + + public Result SetSamplerState(int sampler, SamplerState type, TextureFilter textureFilter) + { + return _device.SetSamplerState(sampler, type, textureFilter); + } + + public Result SetTransform(TransformState state, in Matrix value) + { + return _device.SetTransform(state, value); + } + + private int? _lastSetTextureSampler; + private object _lastSetTextureTexture; + public void SetTexture(int sampler, BaseTexture texture) + { + if ( ReferenceEquals(_lastSetTextureTexture, texture) && _lastSetTextureSampler == sampler) + { + return; + } + + _lastSetTextureSampler = sampler; + _lastSetTextureTexture = texture; + _device.SetTexture(sampler, texture); + } + + public Result SetRenderTarget(int targetIndex, Surface target) + { + return _device.SetRenderTarget(targetIndex, target); + } + + public Result DrawUserPrimitives(PrimitiveType primitiveType, int startIndex, int primitiveCount, in T[] data) where T : struct//, new() + { + return _device.DrawUserPrimitives(primitiveType, startIndex, primitiveCount, data); + } + + public Result DrawUserPrimitives(PrimitiveType primitiveType, int primitiveCount, in T[] data) where T : struct//, new() + { + return _device.DrawUserPrimitives(primitiveType, primitiveCount, data); + } + + public Result StretchRectangle(Surface source, Surface destination, TextureFilter filter) + { + return _device.StretchRectangle(source, destination, filter); + } + + public Result UpdateSurface(Surface source, in Rectangle sourceRectangle, Surface destination, in Point destinationPoint) + { + return _device.UpdateSurface(source, sourceRectangle, destination, destinationPoint); + } + + public Viewport Viewport + { + get => _device.Viewport; + set => _device.Viewport = value; + } + + public VertexFormat VertexFormat + { + get => _device.VertexFormat; + set => _device.VertexFormat = value; + } + + public Capabilities Capabilities => _device.Capabilities; + } +} \ No newline at end of file diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/DeviceCreationException.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/DeviceCreationException.cs new file mode 100644 index 00000000..c6104b80 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/DeviceCreationException.cs @@ -0,0 +1,71 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ +using System; +using System.Runtime.Serialization; + +namespace SampleFramework +{ + /// + /// Thrown when a graphics device cannot be created. + /// + [Serializable] + public class DeviceCreationException : Exception + { + /// + /// Initializes a new instance of the class. + /// + public DeviceCreationException() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The message. + public DeviceCreationException(string message) + : base(message) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The message. + /// The inner exception. + public DeviceCreationException(string message, Exception innerException) + : base(message, innerException) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + /// The parameter is null. + /// The class name is null or is zero (0). + protected DeviceCreationException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/Direct3D9Manager.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/Direct3D9Manager.cs new file mode 100644 index 00000000..f7cf7b85 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/Direct3D9Manager.cs @@ -0,0 +1,219 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security.Permissions; +using SlimDX; +using SlimDX.Direct3D9; + +namespace SampleFramework +{ + /// + /// Manages aspects of the graphics device unique to Direct3D9. + /// + public class Direct3D9Manager + { + GraphicsDeviceManager manager; + + /// + /// Gets the graphics device. + /// + /// The graphics device. +#if TEST_Direct3D9Ex + public DeviceEx Device //yyagi +#else + public DeviceCache Device +#endif + { + get; + internal set; + } + + /// + /// Initializes a new instance of the class. + /// + /// The parent manager. + internal Direct3D9Manager(GraphicsDeviceManager manager) + { + this.manager = manager; + } + + /// + /// Creates a vertex declaration using the specified vertex type. + /// + /// Type of the vertex. + /// The vertex declaration for the specified vertex type. + [EnvironmentPermission(SecurityAction.LinkDemand)] + public VertexDeclaration CreateVertexDeclaration(Type vertexType) + { + // ensure that we have a value type + if (!vertexType.IsValueType) + throw new InvalidOperationException("Vertex types must be value types."); + + // grab the list of elements in the vertex + List objectAttributes = new List(); + FieldInfo[] fields = vertexType.GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); + foreach (FieldInfo field in fields) + { + // check for the custom attribute + VertexElementAttribute[] attributes = (VertexElementAttribute[])field.GetCustomAttributes(typeof(VertexElementAttribute), false); + if (field.Name.Contains("<") && field.Name.Contains(">")) + { + // look up the property matching this field to see if it has the attribute + int index1 = field.Name.IndexOf('<'); + int index2 = field.Name.IndexOf('>'); + + // parse out the name + string propertyName = field.Name.Substring(index1 + 1, index2 - index1 - 1); + PropertyInfo property = vertexType.GetProperty(propertyName, field.FieldType); + if (property != null) + attributes = (VertexElementAttribute[])property.GetCustomAttributes(typeof(VertexElementAttribute), false); + } + if (attributes.Length == 1) + { + // add the attribute to the list + attributes[0].Offset = Marshal.OffsetOf(vertexType, field.Name).ToInt32(); + objectAttributes.Add(attributes[0]); + } + } + + // make sure we have at least one element + if (objectAttributes.Count < 1) + throw new InvalidOperationException("The vertex type must have at least one field or property marked with the VertexElement attribute."); + + // loop through the attributes and start building vertex elements + List elements = new List(); + Dictionary usages = new Dictionary(); + foreach (VertexElementAttribute attribute in objectAttributes) + { + // check the current usage index + if (!usages.ContainsKey(attribute.Usage)) + usages.Add(attribute.Usage, 0); + + // advance the current usage count + int index = usages[attribute.Usage]; + usages[attribute.Usage]++; + + // create the element + elements.Add(new VertexElement((short)attribute.Stream, (short)attribute.Offset, attribute.Type, + attribute.Method, attribute.Usage, (byte)index)); + } + + elements.Add(VertexElement.VertexDeclarationEnd); + return new VertexDeclaration(Device.UnderlyingDevice, elements.ToArray()); + } + + /// + /// Creates a render target surface that is compatible with the current device settings. + /// + /// The width of the surface. + /// The height of the surface. + /// The newly created render target surface. + public Texture CreateRenderTarget(int width, int height) + { + return new Texture(Device.UnderlyingDevice, width, height, 1, Usage.RenderTarget, manager.CurrentSettings.BackBufferFormat, Pool.Default); + } + + /// + /// Creates a resolve target for capturing the back buffer. + /// + /// The newly created resolve target. + public Texture CreateResolveTarget() + { + return new Texture(Device.UnderlyingDevice, manager.ScreenWidth, manager.ScreenHeight, 1, Usage.RenderTarget, manager.CurrentSettings.BackBufferFormat, Pool.Default); + } + + /// + /// Resolves the current back buffer into a texture. + /// + /// The target texture. + /// Thrown when the resolve process fails. + public void ResolveBackBuffer(Texture target) + { + ResolveBackBuffer(target, 0); + } + + /// + /// Resolves the current back buffer into a texture. + /// + /// The target texture. + /// The index of the back buffer. + /// Thrown when the resolve process fails. + public void ResolveBackBuffer(Texture target, int backBufferIndex) + { + // disable exceptions for this method + bool storedThrow = Configuration.ThrowOnError; + Configuration.ThrowOnError = false; + Surface destination = null; + + try + { + // grab the current back buffer + Surface backBuffer = Device.GetBackBuffer(0, backBufferIndex); + if (backBuffer == null || Result.Last.IsFailure) + throw new InvalidOperationException("Could not obtain back buffer surface."); + + // grab the destination surface + destination = target.GetSurfaceLevel(0); + if (destination == null || Result.Last.IsFailure) + throw new InvalidOperationException("Could not obtain resolve target surface."); + + // first try to copy using linear filtering + if (Device.StretchRectangle(backBuffer, destination, TextureFilter.Linear).IsFailure) + { + // that failed, so try with no filtering + if (Device.StretchRectangle(backBuffer, destination, TextureFilter.None).IsFailure) + { + // that failed as well, so the last thing we can try is a load surface call + if (Surface.FromSurface(destination, backBuffer, Filter.Default, 0).IsFailure) + throw new InvalidOperationException("Could not copy surfaces."); + } + } + } + finally + { + if (destination != null) + destination.Dispose(); + Configuration.ThrowOnError = storedThrow; + } + } + + /// + /// Resets the render target. + /// + public void ResetRenderTarget() + { + Surface backBuffer = Device.GetBackBuffer(0, 0); + + try + { + Device.SetRenderTarget(0, backBuffer); + } + finally + { + backBuffer.Dispose(); + } + } + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/Enums.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/Enums.cs new file mode 100644 index 00000000..2e6e35df --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/Enums.cs @@ -0,0 +1,25 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ + +namespace SampleFramework +{ +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/GraphicsDeviceManager.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/GraphicsDeviceManager.cs new file mode 100644 index 00000000..55dc16bc --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/GraphicsDeviceManager.cs @@ -0,0 +1,701 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ +using System; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using SlimDX; +using SlimDX.Direct3D9; +using SlimDX.DXGI; +using System.Diagnostics; + +namespace SampleFramework +{ + /// + /// Handles the configuration and management of the graphics device. + /// + public class GraphicsDeviceManager : IDisposable + { + Game game; + bool ignoreSizeChanges; + bool deviceLost; +// bool doNotStoreBufferSize; +// bool renderingOccluded; + + int fullscreenWindowWidth; + int fullscreenWindowHeight; + int windowedWindowWidth; + int windowedWindowHeight; + WINDOWPLACEMENT windowedPlacement; + long windowedStyle; + bool savedTopmost; + +#if TEST_Direct3D9Ex + internal static Direct3DEx Direct3D9Object // yyagi +#else + internal static Direct3D Direct3D9Object +#endif + { + get; + private set; + } + + public DeviceSettings CurrentSettings + { + get; + private set; + } + public bool IsWindowed + { + get { return CurrentSettings.Windowed; } + } + public int ScreenWidth + { + get { return CurrentSettings.BackBufferWidth; } + } + public int ScreenHeight + { + get { return CurrentSettings.BackBufferHeight; } + } + public Size ScreenSize + { + get { return new Size(CurrentSettings.BackBufferWidth, CurrentSettings.BackBufferHeight); } + } + public Direct3D9Manager Direct3D9 + { + get; + private set; + } + public string DeviceStatistics + { + get; + private set; + } + public string DeviceInformation + { + get; + private set; + } + + public GraphicsDeviceManager( Game game ) + { + if( game == null ) + throw new ArgumentNullException( "game" ); + + this.game = game; + + game.Window.ScreenChanged += Window_ScreenChanged; + game.Window.UserResized += Window_UserResized; + + game.FrameStart += game_FrameStart; + game.FrameEnd += game_FrameEnd; + + Direct3D9 = new Direct3D9Manager( this ); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + public void ChangeDevice( DeviceSettings settings, DeviceSettings minimumSettings ) + { + if( settings == null ) + throw new ArgumentNullException( "settings" ); + + Enumeration9.MinimumSettings = minimumSettings; + + DeviceSettings validSettings = DeviceSettings.FindValidSettings( settings ); + + validSettings.Direct3D9.PresentParameters.DeviceWindowHandle = game.Window.Handle; + + CreateDevice( validSettings ); + } + public void ChangeDevice(bool windowed, int desiredWidth, int desiredHeight) + { + DeviceSettings desiredSettings = new DeviceSettings(); + desiredSettings.Windowed = windowed; + desiredSettings.BackBufferWidth = desiredWidth; + desiredSettings.BackBufferHeight = desiredHeight; + + ChangeDevice(desiredSettings, null); + } + public void ChangeDevice(DeviceSettings settings) + { + ChangeDevice(settings, null); + } + + public void ToggleFullScreen() + { + if (!EnsureDevice()) + throw new InvalidOperationException("No valid device."); + + DeviceSettings newSettings = CurrentSettings.Clone(); + + newSettings.Windowed = !newSettings.Windowed; + + int width = newSettings.Windowed ? windowedWindowWidth : fullscreenWindowWidth; + int height = newSettings.Windowed ? windowedWindowHeight : fullscreenWindowHeight; + + newSettings.BackBufferWidth = width; + newSettings.BackBufferHeight = height; + + ChangeDevice(newSettings); + } + public bool EnsureDevice() + { + if (Direct3D9.Device != null && !deviceLost) + return true; + + return false; + } + + protected virtual void Dispose( bool disposing ) + { + if( this.bDisposed ) + return; + this.bDisposed = true; + + if( disposing ) + ReleaseDevice(); + + } + private bool bDisposed = false; + + void CreateDevice(DeviceSettings settings) + { + DeviceSettings oldSettings = CurrentSettings; + CurrentSettings = settings; + + ignoreSizeChanges = true; + + bool keepCurrentWindowSize = false; + if (settings.BackBufferWidth == 0 && settings.BackBufferHeight == 0) + keepCurrentWindowSize = true; + + // handle the window state in Direct3D9 (it will be handled for us in DXGI) + // check if we are going to windowed or fullscreen mode + if( settings.Windowed ) + { + if( oldSettings != null && !oldSettings.Windowed ) + NativeMethods.SetWindowLong( game.Window.Handle, WindowConstants.GWL_STYLE, (uint) windowedStyle ); + } + else + { + if( oldSettings == null || oldSettings.Windowed ) + { + savedTopmost = game.Window.TopMost; + long style = NativeMethods.GetWindowLong( game.Window.Handle, WindowConstants.GWL_STYLE ); + style &= ~WindowConstants.WS_MAXIMIZE & ~WindowConstants.WS_MINIMIZE; + windowedStyle = style; + + windowedPlacement = new WINDOWPLACEMENT(); + windowedPlacement.length = WINDOWPLACEMENT.Length; + NativeMethods.GetWindowPlacement( game.Window.Handle, ref windowedPlacement ); + } + + // hide the window until we are done messing with it + game.Window.Hide(); + NativeMethods.SetWindowLong( game.Window.Handle, WindowConstants.GWL_STYLE, (uint) ( WindowConstants.WS_POPUP | WindowConstants.WS_SYSMENU ) ); + + WINDOWPLACEMENT placement = new WINDOWPLACEMENT(); + placement.length = WINDOWPLACEMENT.Length; + NativeMethods.GetWindowPlacement( game.Window.Handle, ref placement ); + + // check if we are in the middle of a restore + if( ( placement.flags & WindowConstants.WPF_RESTORETOMAXIMIZED ) != 0 ) + { + // update the flags to avoid sizing issues + placement.flags &= ~WindowConstants.WPF_RESTORETOMAXIMIZED; + placement.showCmd = WindowConstants.SW_RESTORE; + NativeMethods.SetWindowPlacement( game.Window.Handle, ref placement ); + } + } + + if (settings.Windowed) + { + if (oldSettings != null && !oldSettings.Windowed) + { + fullscreenWindowWidth = oldSettings.BackBufferWidth; + fullscreenWindowHeight = oldSettings.BackBufferHeight; + } + } + else + { + if (oldSettings != null && oldSettings.Windowed) + { + windowedWindowWidth = oldSettings.BackBufferWidth; + windowedWindowHeight = oldSettings.BackBufferHeight; + } + } + + // check if the device can be reset, or if we need to completely recreate it + Result result = SlimDX.Direct3D9.ResultCode.Success; + bool canReset = CanDeviceBeReset(oldSettings, settings); + if (canReset) + result = ResetDevice(); + + if (result == SlimDX.Direct3D9.ResultCode.DeviceLost) + deviceLost = true; + else if (!canReset || result.IsFailure) + { + if (oldSettings != null) + ReleaseDevice(); + + InitializeDevice(); + } + + UpdateDeviceInformation(); + + // check if we changed from fullscreen to windowed mode + if (oldSettings != null && !oldSettings.Windowed && settings.Windowed) + { + NativeMethods.SetWindowPlacement(game.Window.Handle, ref windowedPlacement); + game.Window.TopMost = savedTopmost; + } + + // check if we need to resize + if (settings.Windowed && !keepCurrentWindowSize) + { + int width; + int height; + if (NativeMethods.IsIconic(game.Window.Handle)) + { + WINDOWPLACEMENT placement = new WINDOWPLACEMENT(); + placement.length = WINDOWPLACEMENT.Length; + NativeMethods.GetWindowPlacement(game.Window.Handle, ref placement); + + // check if we are being restored + if ((placement.flags & WindowConstants.WPF_RESTORETOMAXIMIZED) != 0 && placement.showCmd == WindowConstants.SW_SHOWMINIMIZED) + { + NativeMethods.ShowWindow(game.Window.Handle, WindowConstants.SW_RESTORE); + + Rectangle rect = NativeMethods.GetClientRectangle(game.Window.Handle); + + width = rect.Width; + height = rect.Height; + NativeMethods.ShowWindow(game.Window.Handle, WindowConstants.SW_MINIMIZE); + } + else + { + NativeRectangle frame = new NativeRectangle(); + NativeMethods.AdjustWindowRect(ref frame, (uint)windowedStyle, false); + int frameWidth = frame.right - frame.left; + int frameHeight = frame.bottom - frame.top; + + width = placement.rcNormalPosition.right - placement.rcNormalPosition.left - frameWidth; + height = placement.rcNormalPosition.bottom - placement.rcNormalPosition.top - frameHeight; + } + } + else + { + Rectangle rect = NativeMethods.GetClientRectangle(game.Window.Handle); + width = rect.Width; + height = rect.Height; + } + + // check if we have a different desired size + if (width != settings.BackBufferWidth || + height != settings.BackBufferHeight) + { + if (NativeMethods.IsIconic(game.Window.Handle)) + NativeMethods.ShowWindow(game.Window.Handle, WindowConstants.SW_RESTORE); + if (NativeMethods.IsZoomed(game.Window.Handle)) + NativeMethods.ShowWindow(game.Window.Handle, WindowConstants.SW_RESTORE); + + NativeRectangle rect = new NativeRectangle(); + rect.right = settings.BackBufferWidth; + rect.bottom = settings.BackBufferHeight; + NativeMethods.AdjustWindowRect(ref rect, + NativeMethods.GetWindowLong(game.Window.Handle, WindowConstants.GWL_STYLE), false); + + NativeMethods.SetWindowPos(game.Window.Handle, IntPtr.Zero, 0, 0, rect.right - rect.left, + rect.bottom - rect.top, WindowConstants.SWP_NOZORDER | WindowConstants.SWP_NOMOVE); + + Rectangle r = NativeMethods.GetClientRectangle(game.Window.Handle); + int clientWidth = r.Width; + int clientHeight = r.Height; + + // check if the size was modified by Windows + if (clientWidth != settings.BackBufferWidth || + clientHeight != settings.BackBufferHeight) + { + DeviceSettings newSettings = CurrentSettings.Clone(); + newSettings.BackBufferWidth = 0; + newSettings.BackBufferHeight = 0; + if (newSettings.Direct3D9 != null) + { + newSettings.Direct3D9.PresentParameters.BackBufferWidth = GameWindowSize.Width; // #23510 2010.10.31 add yyagi: to avoid setting BackBufferSize=ClientSize + newSettings.Direct3D9.PresentParameters.BackBufferHeight = GameWindowSize.Height; // #23510 2010.10.31 add yyagi: to avoid setting BackBufferSize=ClientSize + } + + CreateDevice(newSettings); + } + } + } + + // if the window is still hidden, make sure it is shown + if (!game.Window.Visible) + NativeMethods.ShowWindow(game.Window.Handle, WindowConstants.SW_SHOW); + + // set the execution state of the thread + if (!IsWindowed) + NativeMethods.SetThreadExecutionState(WindowConstants.ES_DISPLAY_REQUIRED | WindowConstants.ES_CONTINUOUS); + else + NativeMethods.SetThreadExecutionState(WindowConstants.ES_CONTINUOUS); + + ignoreSizeChanges = false; + } + + void Window_UserResized( object sender, EventArgs e ) + { + if( ignoreSizeChanges || !EnsureDevice() || ( !IsWindowed ) ) + return; + + DeviceSettings newSettings = CurrentSettings.Clone(); + + Rectangle rect = NativeMethods.GetClientRectangle( game.Window.Handle ); + if( rect.Width != newSettings.BackBufferWidth || rect.Height != newSettings.BackBufferHeight ) + { + newSettings.BackBufferWidth = 0; + newSettings.BackBufferHeight = 0; + newSettings.Direct3D9.PresentParameters.BackBufferWidth = GameWindowSize.Width; // #23510 2010.10.31 add yyagi: to avoid setting BackBufferSize=ClientSize + newSettings.Direct3D9.PresentParameters.BackBufferHeight = GameWindowSize.Height; // + CreateDevice( newSettings ); + } + } + void Window_ScreenChanged( object sender, EventArgs e ) + { + if( !EnsureDevice() || !CurrentSettings.Windowed || ignoreSizeChanges ) + return; + + IntPtr windowMonitor = NativeMethods.MonitorFromWindow( game.Window.Handle, WindowConstants.MONITOR_DEFAULTTOPRIMARY ); + + DeviceSettings newSettings = CurrentSettings.Clone(); + int adapterOrdinal = GetAdapterOrdinal( windowMonitor ); + if( adapterOrdinal == -1 ) + return; + newSettings.Direct3D9.AdapterOrdinal = adapterOrdinal; + + newSettings.BackBufferWidth = 0; // #23510 2010.11.1 add yyagi to avoid to reset to 640x480 for the first time in XP. + newSettings.BackBufferHeight = 0; // + newSettings.Direct3D9.PresentParameters.BackBufferWidth = GameWindowSize.Width; // + newSettings.Direct3D9.PresentParameters.BackBufferHeight = GameWindowSize.Height; // + + CreateDevice(newSettings); + } + + void game_FrameEnd( object sender, EventArgs e ) + { + Result result = SlimDX.Direct3D9.ResultCode.Success; + try + { + result = Direct3D9.Device.Present(); + } + catch (Direct3D9Exception) // #23842 2011.1.6 yyagi: catch D3D9Exception to avoid unexpected termination by changing VSyncWait in fullscreen. + { + deviceLost = true; + } + if( result == SlimDX.Direct3D9.ResultCode.DeviceLost ) + deviceLost = true; + } + void game_FrameStart(object sender, CancelEventArgs e) + { + if (Direct3D9.Device == null ) + { + e.Cancel = true; + return; + } + +// if (!game.IsActive || deviceLost) // #23568 2010.11.3 yyagi: separate conditions to support valiable sleep value when !IsActive. + if (deviceLost) + Thread.Sleep(50); + else if (!game.IsActive && !this.CurrentSettings.EnableVSync) // #23568 2010.11.4 yyagi: Don't add sleep() while VSync is enabled. + Thread.Sleep(this.game.InactiveSleepTime.Milliseconds); + + if (deviceLost) + { + Result result = Direct3D9.Device.TestCooperativeLevel(); + if (result == SlimDX.Direct3D9.ResultCode.DeviceLost) + { + e.Cancel = true; + return; + } + + // if we are windowed, check the adapter format to see if the user + // changed the desktop format, causing a lost device + if (IsWindowed) + { + DisplayMode displayMode = GraphicsDeviceManager.Direct3D9Object.GetAdapterDisplayMode(CurrentSettings.Direct3D9.AdapterOrdinal); + if (CurrentSettings.Direct3D9.AdapterFormat != displayMode.Format) + { + DeviceSettings newSettings = CurrentSettings.Clone(); + ChangeDevice(newSettings); + e.Cancel = true; + return; + } + } + + result = ResetDevice(); + if (result.IsFailure) + { + e.Cancel = true; + return; + } + } + + deviceLost = false; + } + + bool CanDeviceBeReset( DeviceSettings oldSettings, DeviceSettings newSettings ) + { + if( oldSettings == null ) + return false; + + return Direct3D9.Device != null && + oldSettings.Direct3D9.AdapterOrdinal == newSettings.Direct3D9.AdapterOrdinal && + oldSettings.Direct3D9.DeviceType == newSettings.Direct3D9.DeviceType && + oldSettings.Direct3D9.CreationFlags == newSettings.Direct3D9.CreationFlags; + } + + void InitializeDevice() + { + try + { + EnsureD3D9(); + +#if TEST_Direct3D9Ex + // 2011.4.26 yyagi + // Direct3D9.DeviceEx繧貞他縺カ髫(IDirect3D9Ex::CreateDeviceEx繧貞他縺カ髫)縲 + // 繝輔Ν繧ケ繧ッ繝ェ繝シ繝ウ繝「繝シ繝峨〒蛻晄悄蛹悶☆繧句エ蜷医ッDisplayModeEx(D3DDISPLAYMODEEX *pFullscreenDisplayMode)縺ォ + // 驕ゥ蛻縺ェ蛟、繧定ィュ螳壹☆繧句ソ隕√≠繧翫 + // 荳譁ケ縲√え繧、繝ウ繝峨え繝「繝シ繝峨〒蛻晄悄蛹悶☆繧句エ蜷医ッ縲.3DDISPLAYMODEEX繧誰ULL縺ォ縺吶k蠢隕√′縺ゅk縺後 + // DisplayModeEx縺君ULL荳榊庄縺ィ螳夂セゥ縺輔l縺ヲ縺繧九◆繧√.eviceEx縺ョoverload縺ョ荳ュ縺ァDisplayModeEx繧貞シ墓焚縺ォ蜿悶i縺ェ縺繧ゅョ繧 + // 菴ソ縺縲(DeviceEx蛛エ縺ァD3DDISPLAYMODEEX繧誰ULL縺ォ縺励※縺上l繧) + // 邨仙ア縲.eviceEx縺ョ蜻シ縺ウ蜃コ縺励ョ髫帙↓縲√ヵ繝ォ繧ケ繧ッ繝ェ繝シ繝ウ縺九←縺縺九〒蝣エ蜷亥縺代′蠢隕√→縺ェ繧九 + if ( CurrentSettings.Direct3D9.PresentParameters.Windowed == false ) + { + DisplayModeEx fullScreenDisplayMode = new DisplayModeEx(); + fullScreenDisplayMode.Width = CurrentSettings.Direct3D9.PresentParameters.BackBufferWidth; + fullScreenDisplayMode.Height = CurrentSettings.Direct3D9.PresentParameters.BackBufferHeight; + fullScreenDisplayMode.RefreshRate = CurrentSettings.Direct3D9.PresentParameters.FullScreenRefreshRateInHertz; + fullScreenDisplayMode.Format = CurrentSettings.Direct3D9.PresentParameters.BackBufferFormat; + + Direct3D9.Device = new SlimDX.Direct3D9.DeviceEx( Direct3D9Object, CurrentSettings.Direct3D9.AdapterOrdinal, + CurrentSettings.Direct3D9.DeviceType, game.Window.Handle, + CurrentSettings.Direct3D9.CreationFlags, CurrentSettings.Direct3D9.PresentParameters, fullScreenDisplayMode ); + } + else + { + Direct3D9.Device = new SlimDX.Direct3D9.DeviceEx( Direct3D9Object, CurrentSettings.Direct3D9.AdapterOrdinal, + CurrentSettings.Direct3D9.DeviceType, game.Window.Handle, + CurrentSettings.Direct3D9.CreationFlags, CurrentSettings.Direct3D9.PresentParameters ); + } + Direct3D9.Device.MaximumFrameLatency = 1; +#else + Direct3D9.Device = new DeviceCache( new SlimDX.Direct3D9.Device( Direct3D9Object, CurrentSettings.Direct3D9.AdapterOrdinal, + CurrentSettings.Direct3D9.DeviceType, game.Window.Handle, + CurrentSettings.Direct3D9.CreationFlags, CurrentSettings.Direct3D9.PresentParameters ) ); +#endif + if ( Result.Last == SlimDX.Direct3D9.ResultCode.DeviceLost ) + { + deviceLost = true; + return; + } +#if TEST_Direct3D9Ex + Direct3D9.Device.MaximumFrameLatency = 1; // yyagi +#endif + } + catch( Exception e ) + { + throw new DeviceCreationException( "Could not create graphics device.", e ); + } + + PropogateSettings(); + + UpdateDeviceStats(); + + game.Initialize(); + game.LoadContent(); + } + + Result ResetDevice() + { + game.UnloadContent(); + + Result result = Direct3D9.Device.Reset( CurrentSettings.Direct3D9.PresentParameters ); + if( result == SlimDX.Direct3D9.ResultCode.DeviceLost ) + return result; + + PropogateSettings(); + UpdateDeviceStats(); + game.LoadContent(); + + return Result.Last; + } + + void ReleaseDevice() + { + ReleaseDevice9(); + } + void ReleaseDevice9() + { + if (Direct3D9.Device == null) + return; + + if (game != null) + { + game.UnloadContent(); + game.Dispose(true); + } + + try + { + Direct3D9.Device.Dispose(); + } + catch( ObjectDisposedException e ) + { + // 譎ゅ逋コ逕溘☆繧九ョ縺ァ繧ュ繝」繝繝√@縺ヲ縺翫¥縲 + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (fc0b6e70-181e-410f-b47f-5490ca4ce0c3)" ); + } + Direct3D9Object.Dispose(); + + Direct3D9Object = null; + Direct3D9.Device = null; + } + void PropogateSettings() + { + CurrentSettings.BackBufferCount = CurrentSettings.Direct3D9.PresentParameters.BackBufferCount; + CurrentSettings.BackBufferWidth = CurrentSettings.Direct3D9.PresentParameters.BackBufferWidth; + CurrentSettings.BackBufferHeight = CurrentSettings.Direct3D9.PresentParameters.BackBufferHeight; + CurrentSettings.BackBufferFormat = CurrentSettings.Direct3D9.PresentParameters.BackBufferFormat; + CurrentSettings.DepthStencilFormat = CurrentSettings.Direct3D9.PresentParameters.AutoDepthStencilFormat; + CurrentSettings.DeviceType = CurrentSettings.Direct3D9.DeviceType; + CurrentSettings.MultisampleQuality = CurrentSettings.Direct3D9.PresentParameters.MultisampleQuality; + CurrentSettings.MultisampleType = CurrentSettings.Direct3D9.PresentParameters.Multisample; + CurrentSettings.RefreshRate = CurrentSettings.Direct3D9.PresentParameters.FullScreenRefreshRateInHertz; + CurrentSettings.Windowed = CurrentSettings.Direct3D9.PresentParameters.Windowed; + } + + void UpdateDeviceInformation() + { + StringBuilder builder = new StringBuilder(); + + if( CurrentSettings.Direct3D9.DeviceType == DeviceType.Hardware ) + builder.Append( "HAL" ); + else if( CurrentSettings.Direct3D9.DeviceType == DeviceType.Reference ) + builder.Append( "REF" ); + else if( CurrentSettings.Direct3D9.DeviceType == DeviceType.Software ) + builder.Append( "SW" ); + + if( ( CurrentSettings.Direct3D9.CreationFlags & CreateFlags.HardwareVertexProcessing ) != 0 ) + if( CurrentSettings.Direct3D9.DeviceType == DeviceType.Hardware ) + builder.Append( " (hw vp)" ); + else + builder.Append( " (simulated hw vp)" ); + else if( ( CurrentSettings.Direct3D9.CreationFlags & CreateFlags.MixedVertexProcessing ) != 0 ) + if( CurrentSettings.Direct3D9.DeviceType == DeviceType.Hardware ) + builder.Append( " (mixed vp)" ); + else + builder.Append( " (simulated mixed vp)" ); + else + builder.Append( " (sw vp)" ); + + if( CurrentSettings.Direct3D9.DeviceType == DeviceType.Hardware ) + { + // loop through each adapter until we find the right one + foreach( AdapterInfo9 adapterInfo in Enumeration9.Adapters ) + { + if( adapterInfo.AdapterOrdinal == CurrentSettings.Direct3D9.AdapterOrdinal ) + { + builder.AppendFormat( ": {0}", adapterInfo.Description ); + break; + } + } + } + + DeviceInformation = builder.ToString(); + } + + void UpdateDeviceStats() + { + StringBuilder builder = new StringBuilder(); + + builder.Append( "D3D9 Vsync " ); + + if( CurrentSettings.Direct3D9.PresentParameters.PresentationInterval == PresentInterval.Immediate ) + builder.Append( "off" ); + else + builder.Append( "on" ); + + builder.AppendFormat( " ({0}x{1}), ", CurrentSettings.Direct3D9.PresentParameters.BackBufferWidth, CurrentSettings.Direct3D9.PresentParameters.BackBufferHeight ); + + if( CurrentSettings.Direct3D9.AdapterFormat == CurrentSettings.Direct3D9.PresentParameters.BackBufferFormat ) + builder.Append( Enum.GetName( typeof( SlimDX.Direct3D9.Format ), CurrentSettings.Direct3D9.AdapterFormat ) ); + else + builder.AppendFormat( "backbuf {0}, adapter {1}", + Enum.GetName( typeof( SlimDX.Direct3D9.Format ), CurrentSettings.Direct3D9.AdapterFormat ), + Enum.GetName( typeof( SlimDX.Direct3D9.Format ), CurrentSettings.Direct3D9.PresentParameters.BackBufferFormat ) ); + + builder.AppendFormat( " ({0})", Enum.GetName( typeof( SlimDX.Direct3D9.Format ), CurrentSettings.Direct3D9.PresentParameters.AutoDepthStencilFormat ) ); + + if( CurrentSettings.Direct3D9.PresentParameters.Multisample == MultisampleType.NonMaskable ) + builder.Append( " (Nonmaskable Multisample)" ); + else if( CurrentSettings.Direct3D9.PresentParameters.Multisample != MultisampleType.None ) + builder.AppendFormat( " ({0}x Multisample)", (int) CurrentSettings.Direct3D9.PresentParameters.Multisample ); + + DeviceStatistics = builder.ToString(); + } + + int GetAdapterOrdinal( IntPtr screen ) + { + AdapterInfo9 adapter = null; + foreach( AdapterInfo9 a in Enumeration9.Adapters ) + { + if( Direct3D9Object.GetAdapterMonitor( a.AdapterOrdinal ) == screen ) + { + adapter = a; + break; + } + } + + if( adapter != null ) + return adapter.AdapterOrdinal; + + return -1; + } + + internal static void EnsureD3D9() + { + if ( Direct3D9Object == null ) +#if TEST_Direct3D9Ex + Direct3D9Object = new Direct3DEx(); // yyagi +#else + Direct3D9Object = new Direct3D(); +#endif + } + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/NoCompatibleDevicesException.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/NoCompatibleDevicesException.cs new file mode 100644 index 00000000..0bb45d00 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/NoCompatibleDevicesException.cs @@ -0,0 +1,71 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ +using System; +using System.Runtime.Serialization; + +namespace SampleFramework +{ + /// + /// Thrown when no available graphics device fits the given device preferences. + /// + [Serializable] + public class NoCompatibleDevicesException : Exception + { + /// + /// Initializes a new instance of the class. + /// + public NoCompatibleDevicesException() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The message. + public NoCompatibleDevicesException(string message) + : base(message) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The message. + /// The inner exception. + public NoCompatibleDevicesException(string message, Exception innerException) + : base(message, innerException) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + /// The parameter is null. + /// The class name is null or is zero (0). + protected NoCompatibleDevicesException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/VertexElementAttribute.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/VertexElementAttribute.cs new file mode 100644 index 00000000..cd598321 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Rendering/VertexElementAttribute.cs @@ -0,0 +1,94 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ +using System; +using SlimDX.Direct3D9; + +namespace SampleFramework +{ + /// + /// Indicates that the target code element is part of a vertex declaration. + /// + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public sealed class VertexElementAttribute : Attribute + { + /// + /// Gets or sets the stream index. + /// + /// The stream index. + public int Stream + { + get; + set; + } + + /// + /// Gets or sets the tessellation method. + /// + /// The tessellation method. + public DeclarationMethod Method + { + get; + set; + } + + /// + /// Gets or sets the element usage. + /// + /// The element usage. + public DeclarationUsage Usage + { + get; + private set; + } + + /// + /// Gets or sets the type of the data. + /// + /// The type of the data. + public DeclarationType Type + { + get; + private set; + } + + /// + /// Gets or sets the offset. + /// + /// The offset. + internal int Offset + { + get; + set; + } + + /// + /// Initializes a new instance of the class. + /// + /// The type. + /// The vertex element usage. + public VertexElementAttribute(DeclarationType type, DeclarationUsage usage) + { + Type = type; + Usage = usage; + } + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Resources/sdx_icon_black.ico b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Resources/sdx_icon_black.ico new file mode 100644 index 00000000..a579579b Binary files /dev/null and b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Resources/sdx_icon_black.ico differ diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Utilities/Camera.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Utilities/Camera.cs new file mode 100644 index 00000000..a5651b66 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Utilities/Camera.cs @@ -0,0 +1,197 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ +using SlimDX; + +namespace SampleFramework +{ + /// + /// Represents a view onto a 3D scene. + /// + public class Camera + { + Vector3 location; + Vector3 target; + float fieldOfView; + float aspectRatio; + float nearPlane; + float farPlane; + Matrix viewMatrix; + Matrix projectionMatrix; + bool viewDirty = true; + bool projectionDirty = true; + + /// + /// Gets or sets the location of the camera eye point. + /// + /// The location of the camera eye point. + public Vector3 Location + { + get { return location; } + set + { + if (location == value) + return; + + location = value; + viewDirty = true; + } + } + + /// + /// Gets or sets the view target point. + /// + /// The view target point. + public Vector3 Target + { + get { return target; } + set + { + if (target == value) + return; + + target = value; + viewDirty = true; + } + } + + /// + /// Gets or sets the field of view. + /// + /// The field of view. + public float FieldOfView + { + get { return fieldOfView; } + set + { + if (fieldOfView == value) + return; + + fieldOfView = value; + projectionDirty = true; + } + } + + /// + /// Gets or sets the aspect ratio. + /// + /// The aspect ratio. + public float AspectRatio + { + get { return aspectRatio; } + set + { + if (aspectRatio == value) + return; + + aspectRatio = value; + projectionDirty = true; + } + } + + /// + /// Gets or sets the near plane. + /// + /// The near plane. + public float NearPlane + { + get { return nearPlane; } + set + { + if (nearPlane == value) + return; + + nearPlane = value; + projectionDirty = true; + } + } + + /// + /// Gets or sets the far plane. + /// + /// The far plane. + public float FarPlane + { + get { return farPlane; } + set + { + if (farPlane == value) + return; + + farPlane = value; + projectionDirty = true; + } + } + + /// + /// Gets the view matrix. + /// + /// The view matrix. + public Matrix ViewMatrix + { + get + { + if (viewDirty) + RebuildViewMatrix(); + return viewMatrix; + } + } + + /// + /// Gets the projection matrix. + /// + /// The projection matrix. + public Matrix ProjectionMatrix + { + get + { + if (projectionDirty) + RebuildProjectionMatrix(); + return projectionMatrix; + } + } + + /// + /// Initializes a new instance of the class. + /// + public Camera() + { + } + + /// + /// Rebuilds the view matrix. + /// + protected virtual void RebuildViewMatrix() + { + viewMatrix = Matrix.LookAtLH(Location, Target, Vector3.UnitY); + viewDirty = false; + } + + /// + /// Rebuilds the projection matrix. + /// + protected virtual void RebuildProjectionMatrix() + { + projectionMatrix = Matrix.PerspectiveFovLH(FieldOfView, AspectRatio, NearPlane, FarPlane); + projectionDirty = false; + } + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Utilities/TransformedColoredTexturedVertex.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Utilities/TransformedColoredTexturedVertex.cs new file mode 100644 index 00000000..44299168 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Utilities/TransformedColoredTexturedVertex.cs @@ -0,0 +1,178 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ +using System; +using System.Globalization; +using System.Runtime.InteropServices; +using SlimDX; +using SlimDX.Direct3D9; + +namespace SampleFramework +{ + /// + /// Represents a single transformed, colored, and textured vertex. + /// + [StructLayout(LayoutKind.Sequential)] + public struct TransformedColoredTexturedVertex : IEquatable + { + private Vector4 m_Position; + /// + /// Gets or sets the transformed position of the vertex. + /// + /// The transformed position of the vertex. + [VertexElement(DeclarationType.Float4, DeclarationUsage.PositionTransformed)] + public Vector4 Position + { + get { return m_Position; } + set { m_Position = value; } + } + + private int m_Color; + /// + /// Gets or sets the color of the vertex. + /// + /// The color of the vertex. + [VertexElement(DeclarationType.Color, DeclarationUsage.Color)] + public int Color + { + get { return m_Color; } + set { m_Color = value; } + } + + private Vector2 m_TextureCoordinates; + /// + /// Gets or sets the texture coordinates. + /// + /// The texture coordinates. + [VertexElement(DeclarationType.Float2, DeclarationUsage.TextureCoordinate)] + public Vector2 TextureCoordinates + { + get { return m_TextureCoordinates; } + set { m_TextureCoordinates = value; } + } + + /// + /// Gets the size in bytes. + /// + /// The size in bytes. + public static int SizeInBytes + { + get { return Marshal.SizeOf(typeof(TransformedColoredTexturedVertex)); } + } + + /// + /// Gets the format. + /// + /// The format. + public static VertexFormat Format + { + get { return VertexFormat.PositionRhw | VertexFormat.Diffuse | VertexFormat.Texture1; } + } + + /// + /// Initializes a new instance of the struct. + /// + /// The position. + /// The color. + /// The texture coordinates. + public TransformedColoredTexturedVertex(Vector4 position, int color, Vector2 textureCoordinates) + : this() + { + Position = position; + Color = color; + TextureCoordinates = textureCoordinates; + } + + /// + /// Implements the operator ==. + /// + /// The left side of the operator. + /// The right side of the operator. + /// The result of the operator. + public static bool operator ==(TransformedColoredTexturedVertex left, TransformedColoredTexturedVertex right) + { + return left.Equals(right); + } + + /// + /// Implements the operator !=. + /// + /// The left side of the operator. + /// The right side of the operator. + /// The result of the operator. + public static bool operator !=(TransformedColoredTexturedVertex left, TransformedColoredTexturedVertex right) + { + return !(left == right); + } + + /// + /// Returns the hash code for this instance. + /// + /// + /// A 32-bit signed integer that is the hash code for this instance. + /// + public override int GetHashCode() + { + return Position.GetHashCode() + Color.GetHashCode() + TextureCoordinates.GetHashCode(); + } + + /// + /// Indicates whether this instance and a specified object are equal. + /// + /// Another object to compare to. + /// + /// true if and this instance are the same type and represent the same value; otherwise, false. + /// + public override bool Equals(object obj) + { + if (obj == null) + return false; + + if (GetType() != obj.GetType()) + return false; + + return Equals((TransformedColoredTexturedVertex)obj); + } + + /// + /// Indicates whether the current object is equal to another object of the same type. + /// + /// An object to compare with this object. + /// + /// true if the current object is equal to the parameter; otherwise, false. + /// + public bool Equals(TransformedColoredTexturedVertex other) + { + return (Position == other.Position && Color == other.Color && TextureCoordinates == other.TextureCoordinates); + } + + /// + /// Returns a string representation of the current object. + /// + /// + /// A representing the vertex. + /// + public override string ToString() + { + return string.Format(CultureInfo.CurrentCulture, "{0} ({1}, {2})", Position.ToString(), System.Drawing.Color.FromArgb(Color).ToString(), TextureCoordinates.ToString()); + } + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Utilities/TransformedColoredVertex.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Utilities/TransformedColoredVertex.cs new file mode 100644 index 00000000..92d92566 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Utilities/TransformedColoredVertex.cs @@ -0,0 +1,162 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ +using System; +using System.Globalization; +using System.Runtime.InteropServices; +using SlimDX; +using SlimDX.Direct3D9; + +namespace SampleFramework +{ + /// + /// Represents a single transformed and colored vertex. + /// + [StructLayout(LayoutKind.Sequential)] + public struct TransformedColoredVertex : IEquatable + { + /// + /// Gets or sets the transformed position of the vertex. + /// + /// The transformed position of the vertex. + [VertexElement(DeclarationType.Float4, DeclarationUsage.PositionTransformed)] + public Vector4 Position + { + get; + set; + } + + /// + /// Gets or sets the color of the vertex. + /// + /// The color of the vertex. + [VertexElement(DeclarationType.Color, DeclarationUsage.Color)] + public int Color + { + get; + set; + } + + /// + /// Gets the size in bytes. + /// + /// The size in bytes. + public static int SizeInBytes + { + get { return Marshal.SizeOf(typeof(TransformedColoredVertex)); } + } + + /// + /// Gets the format. + /// + /// The format. + public static VertexFormat Format + { + get { return VertexFormat.PositionRhw | VertexFormat.Diffuse; } + } + + /// + /// Initializes a new instance of the struct. + /// + /// The position. + /// The color. + public TransformedColoredVertex(Vector4 position, int color) + : this() + { + Position = position; + Color = color; + } + + /// + /// Implements the operator ==. + /// + /// The left side of the operator. + /// The right side of the operator. + /// The result of the operator. + public static bool operator ==(TransformedColoredVertex left, TransformedColoredVertex right) + { + return left.Equals(right); + } + + /// + /// Implements the operator !=. + /// + /// The left side of the operator. + /// The right side of the operator. + /// The result of the operator. + public static bool operator !=(TransformedColoredVertex left, TransformedColoredVertex right) + { + return !(left == right); + } + + /// + /// Returns the hash code for this instance. + /// + /// + /// A 32-bit signed integer that is the hash code for this instance. + /// + public override int GetHashCode() + { + return Position.GetHashCode() + Color.GetHashCode(); + } + + /// + /// Indicates whether this instance and a specified object are equal. + /// + /// Another object to compare to. + /// + /// true if and this instance are the same type and represent the same value; otherwise, false. + /// + public override bool Equals(object obj) + { + if (obj == null) + return false; + + if (GetType() != obj.GetType()) + return false; + + return Equals((TransformedColoredVertex)obj); + } + + /// + /// Indicates whether the current object is equal to another object of the same type. + /// + /// An object to compare with this object. + /// + /// true if the current object is equal to the parameter; otherwise, false. + /// + public bool Equals(TransformedColoredVertex other) + { + return (Position == other.Position && Color == other.Color); + } + + /// + /// Returns a string representation of the current object. + /// + /// + /// A representing the vertex. + /// + public override string ToString() + { + return string.Format(CultureInfo.CurrentCulture, "{0} ({1})", Position.ToString(), System.Drawing.Color.FromArgb(Color).ToString()); + } + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Win32/NativeMethods.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Win32/NativeMethods.cs new file mode 100644 index 00000000..6cd66ec8 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Win32/NativeMethods.cs @@ -0,0 +1,115 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ +using System; +using System.Drawing; +using System.Runtime.InteropServices; +using System.Security; + +namespace SampleFramework +{ + static class NativeMethods + { + [SuppressUnmanagedCodeSecurityAttribute] + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool PeekMessage(out NativeMessage message, IntPtr hwnd, uint messageFilterMin, uint messageFilterMax, uint flags); + + [SuppressUnmanagedCodeSecurityAttribute] + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool GetClientRect(IntPtr hWnd, out NativeRectangle lpRect); + + [SuppressUnmanagedCodeSecurityAttribute] + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool GetWindowRect(IntPtr hWnd, out NativeRectangle lpRect); + + [SuppressUnmanagedCodeSecurityAttribute] + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool GetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl); + + [SuppressUnmanagedCodeSecurityAttribute] + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool SetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl); + + [SuppressUnmanagedCodeSecurityAttribute] + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] + public static extern uint SetWindowLong(IntPtr hWnd, int nIndex, uint dwNewLong); + + [SuppressUnmanagedCodeSecurityAttribute] + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] + public static extern uint GetWindowLong(IntPtr hWnd, int nIndex); + + [SuppressUnmanagedCodeSecurityAttribute] + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool IsIconic(IntPtr hWnd); + + [SuppressUnmanagedCodeSecurityAttribute] + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool IsZoomed(IntPtr hWnd); + + [SuppressUnmanagedCodeSecurityAttribute] + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); + + [SuppressUnmanagedCodeSecurityAttribute] + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool AdjustWindowRect(ref NativeRectangle lpRect, uint dwStyle, [MarshalAs(UnmanagedType.Bool)]bool bMenu); + + [SuppressUnmanagedCodeSecurityAttribute] + [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = false)] + public static extern uint SetThreadExecutionState(uint esFlags); + + [SuppressUnmanagedCodeSecurityAttribute] + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); + + [SuppressUnmanagedCodeSecurityAttribute] + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] + public static extern IntPtr MonitorFromWindow(IntPtr hwnd, uint dwFlags); + + public static Rectangle GetClientRectangle(IntPtr handle) + { + NativeRectangle rect; + if (!GetClientRect(handle, out rect)) + return Rectangle.Empty; + + return Rectangle.FromLTRB(rect.left, rect.top, rect.right, rect.bottom); + } + + public static Rectangle GetWindowRectangle(IntPtr handle) + { + NativeRectangle rect; + if (!GetWindowRect(handle, out rect)) + return Rectangle.Empty; + + return Rectangle.FromLTRB(rect.left, rect.top, rect.right, rect.bottom); + } + } +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Win32/NativeStructures.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Win32/NativeStructures.cs new file mode 100644 index 00000000..3506cee4 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Win32/NativeStructures.cs @@ -0,0 +1,72 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ +using System; +using System.Drawing; +using System.Runtime.InteropServices; + +namespace SampleFramework +{ + [StructLayout(LayoutKind.Sequential)] + struct NativeRectangle + { + public int left; + public int top; + public int right; + public int bottom; + } + + [StructLayout(LayoutKind.Sequential)] + struct NativeMessage + { + public IntPtr hWnd; + public uint msg; + public IntPtr wParam; + public IntPtr lParam; + public uint time; + public Point p; + } + + [StructLayout(LayoutKind.Sequential)] + struct WINDOWPLACEMENT + { + public int length; + public int flags; + public int showCmd; + public Point ptMinPosition; + public Point ptMaxPosition; + public NativeRectangle rcNormalPosition; + + public static int Length + { + get { return Marshal.SizeOf(typeof(WINDOWPLACEMENT)); } + } + } + #region #28821 2014.1.23 yyagi add: 螟夜Κ縺九i縺ョ譁蟄怜励Γ繝繧サ繝シ繧ク騾∝女菫。 螳壽焚螳夂セゥ + [StructLayout( LayoutKind.Sequential )] + public struct COPYDATASTRUCT + { + public IntPtr dwData; + public UInt32 cbData; + public IntPtr lpData; + } + #endregion +} diff --git a/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Win32/WindowConstants.cs b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Win32/WindowConstants.cs new file mode 100644 index 00000000..f212024c --- /dev/null +++ b/FDK19/繧ウ繝シ繝/01.繝輔Ξ繝シ繝繝ッ繝シ繧ッ/Win32/WindowConstants.cs @@ -0,0 +1,77 @@ +サソ/* +* Copyright (c) 2007-2009 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ +using System; + +namespace SampleFramework +{ + static class WindowConstants + { + public const int WM_SIZE = 0x5; + public const int WM_SYSCOMMAND = 0x112; + public const int WM_ACTIVATEAPP = 0x001C; + public const int WM_POWERBROADCAST = 0x0218; + public const int WM_COPYDATA = 0x004A; + + public const int SC_SCREENSAVE = 0xF140; + public const int SC_MONITORPOWER = 0xF170; + + public const int VK_LWIN = 0x5B; + public const int VK_RWIN = 0x5C; + + public static readonly IntPtr SIZE_MINIMIZED = new IntPtr(1); + public static readonly IntPtr SIZE_MAXIMIZED = new IntPtr(2); + public static readonly IntPtr SIZE_RESTORED = new IntPtr(0); + + public static readonly IntPtr PBT_APMQUERYSUSPEND = new IntPtr(0x0000); + public static readonly IntPtr PBT_APMRESUMESUSPEND = new IntPtr(0x0007); + + public const int WPF_RESTORETOMAXIMIZED = 2; + + public const int SW_RESTORE = 9; + public const int SW_SHOWMINIMIZED = 2; + public const int SW_MAXIMIZE = 3; + public const int SW_SHOW = 5; + public const int SW_MINIMIZE = 6; + + public const int GWL_STYLE = -16; + public const int GWL_EXSTYLE = -20; + + public const long WS_MAXIMIZE = 0x01000000; + public const long WS_MINIMIZE = 0x20000000; + public const long WS_POPUP = 0x80000000; + public const long WS_SYSMENU = 0x00080000; + + public const long WS_EX_TOPMOST = 0x00000008; + + public const uint SWP_NOSIZE = 0x0001; + public const uint SWP_NOMOVE = 0x0002; + public const uint SWP_NOZORDER = 0x0004; + public const uint SWP_NOREDRAW = 0x0008; + + public const uint ES_CONTINUOUS = 0x80000000; + public const uint ES_DISPLAY_REQUIRED = 0x00000002; + + public const int MONITOR_DEFAULTTOPRIMARY = 1; + + public const int WM_USER = 0x400; + } +} diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputJoystick.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputJoystick.cs new file mode 100644 index 00000000..90889d5e --- /dev/null +++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputJoystick.cs @@ -0,0 +1,820 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using SharpDX; +using SharpDX.DirectInput; + +namespace FDK +{ + public class CInputJoystick : IInputDevice, IDisposable + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CInputJoystick( IntPtr hWnd, DeviceInstance di, DirectInput directInput ) + { + this.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ = E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Joystick; + this.GUID = di.InstanceGuid.ToString(); + this.ID = 0; + try + { + this.devJoystick = new Joystick( directInput, di.InstanceGuid ); + this.devJoystick.SetCooperativeLevel( hWnd, CooperativeLevel.Foreground | CooperativeLevel.Exclusive ); + this.devJoystick.Properties.BufferSize = 32; + Trace.TraceInformation( this.devJoystick.Information.InstanceName + "繧堤函謌舌@縺セ縺励◆縲" ); + this.strDeviceName = this.devJoystick.Information.InstanceName; + } + catch + { + if( this.devJoystick != null ) + { + this.devJoystick.Dispose(); + this.devJoystick = null; + } + Trace.TraceError( this.devJoystick.Information.InstanceName, new object[] { " 縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲" } ); + throw; + } + foreach( DeviceObjectInstance instance in this.devJoystick.GetObjects() ) + { + if ((instance.ObjectId.Flags & DeviceObjectTypeFlags.Axis) != DeviceObjectTypeFlags.All) + { + this.devJoystick.GetObjectPropertiesById(instance.ObjectId).Range = new InputRange(-1000, 1000); + this.devJoystick.GetObjectPropertiesById(instance.ObjectId).DeadZone = 5000; // 50%繧偵ョ繝繝峨だ繝シ繝ウ縺ォ險ュ螳 + // 霆ク繧丹N/OFF縺ョ2蛟、縺ァ菴ソ縺縺ェ繧峨%繧後〒蜊∝ + } + } + try + { + this.devJoystick.Acquire(); + } + catch + { + } + + for( int i = 0; i < this.bButtonState.Length; i++ ) + this.bButtonState[ i ] = false; + for ( int i = 0; i < this.nPovState.Length; i++ ) + this.nPovState[ i ] = -1; + + //this.timer = new CTimer( CTimer.E遞ョ蛻・.MultiMedia ); + + this.list蜈・蜉帙う繝吶Φ繝 = new List(32); + } + + + // 繝。繧ス繝繝 + + public void SetID( int nID ) + { + this.ID = nID; + } + + #region [ IInputDevice 螳溯」 ] + //----------------- + public E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ + { + get; + private set; + } + public string GUID + { + get; + private set; + } + public int ID + { + get; + private set; + } + public List list蜈・蜉帙う繝吶Φ繝 + { + get; + private set; + } + public string strDeviceName + { + get; + set; + } + + #region [ 繝ュ繝シ繧ォ繝ォ髢「謨ー ] + private void POV縺ョ蜃ヲ逅(int p, JoystickUpdate data) + { + int nPovDegree = data.Value; + STInputEvent e = new STInputEvent(); + int nWay = (nPovDegree + 2250) / 4500; + if (nWay == 8) nWay = 0; + //Debug.WriteLine( "POVS:" + povs[ 0 ].ToString( CultureInfo.CurrentCulture ) + ", " +stevent.nKey ); + //Debug.WriteLine( "nPovDegree=" + nPovDegree ); + if (nPovDegree == -1) + { + e.nKey = 8 + 128 + this.nPovState[p]; + this.nPovState[p] = -1; + //Debug.WriteLine( "POVS髮「縺輔l縺" + data.TimeStamp + " " + e.nKey ); + e.b謚シ縺輔l縺 = false; + e.nVelocity = 0; + this.bButtonState[e.nKey] = false; + this.bButtonPullUp[e.nKey] = true; + } + else + { + this.nPovState[p] = nWay; + e.nKey = 8 + 128 + nWay; + e.b謚シ縺輔l縺 = true; + e.nVelocity = CInput邂。逅.n騾壼クク髻ウ驥; + this.bButtonState[e.nKey] = true; + this.bButtonPushDown[e.nKey] = true; + //Debug.WriteLine( "POVS謚シ縺輔l縺" + data.TimeStamp + " " + e.nKey ); + } + //e.nTimeStamp = data.TimeStamp; + e.nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧オ繧ヲ繝ウ繝峨ち繧、繝槭シ縺ョ繧キ繧ケ繝繝譎ょ綾ms縺ク縺ョ螟画鋤(data.Timestamp); + this.list蜈・蜉帙う繝吶Φ繝.Add(e); + } + #endregion + + public void t繝昴シ繝ェ繝ウ繧ー(bool bWindow縺後い繧ッ繝繧」繝紋クュ, bool b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k) + { + #region [ bButton繝輔Λ繧ー蛻晄悄蛹 ] + for ( int i = 0; i < 256; i++ ) + { + this.bButtonPushDown[i] = false; + this.bButtonPullUp[i] = false; + } + #endregion + + if (bWindow縺後い繧ッ繝繧」繝紋クュ) + { + this.devJoystick.Acquire(); + this.devJoystick.Poll(); + + // this.list蜈・蜉帙う繝吶Φ繝 = new List( 32 ); + this.list蜈・蜉帙う繝吶Φ繝.Clear(); // #xxxxx 2012.6.11 yyagi; To optimize, I removed new(); + + + if( b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k ) + { + #region [ a.繝舌ャ繝輔ぃ蜈・蜉 ] + //----------------------------- + + var bufferedData = this.devJoystick.GetBufferedData(); + //if( Result.Last.IsSuccess && bufferedData != null ) + { + foreach (JoystickUpdate data in bufferedData) + { + switch (data.Offset) + { + case JoystickOffset.X: + #region [ X霆クシ ] + //----------------------------- + bButtonUpDown(data, data.Value, 0, 1); + //----------------------------- + #endregion + #region [ X霆クシ ] + //----------------------------- + bButtonUpDown(data, data.Value, 1, 0); + //----------------------------- + #endregion + break; + case JoystickOffset.Y: + #region [ Y霆クシ ] + //----------------------------- + bButtonUpDown(data, data.Value, 2, 3); + //----------------------------- + #endregion + #region [ Y霆クシ ] + //----------------------------- + bButtonUpDown(data, data.Value, 3, 2); + //----------------------------- + #endregion + break; + case JoystickOffset.Z: + #region [ Z霆クシ ] + //----------------------------- + bButtonUpDown(data, data.Value, 4, 5); + //----------------------------- + #endregion + #region [ Z霆クシ ] + //----------------------------- + bButtonUpDown(data, data.Value, 5, 4); + //----------------------------- + #endregion + break; + case JoystickOffset.RotationZ: + #region [ Z霆クシ ] + //----------------------------- + bButtonUpDown(data, data.Value, 6, 7); + //----------------------------- + #endregion + #region [ Z霆クシ ] + //----------------------------- + bButtonUpDown(data, data.Value, 7, 6); + //----------------------------- + #endregion + break; + // #24341 2011.3.12 yyagi: POV support + // #26880 2011.12.6 yyagi: improve to support "pullup" of POV buttons + case JoystickOffset.PointOfViewControllers0: + #region [ POV HAT 4/8way ] + POV縺ョ蜃ヲ逅(0, data); + #endregion + break; + case JoystickOffset.PointOfViewControllers1: + #region [ POV HAT 4/8way ] + POV縺ョ蜃ヲ逅(1, data); + #endregion + break; + case JoystickOffset.PointOfViewControllers2: + #region [ POV HAT 4/8way ] + POV縺ョ蜃ヲ逅(2, data); + #endregion + break; + case JoystickOffset.PointOfViewControllers3: + #region [ POV HAT 4/8way ] + POV縺ョ蜃ヲ逅(3, data); + #endregion + break; + default: + #region [ 繝懊ち繝ウ ] + //----------------------------- + + //for ( int i = 0; i < 32; i++ ) + if (data.Offset >= JoystickOffset.Buttons0 && data.Offset <= JoystickOffset.Buttons31) + { + int i = data.Offset - JoystickOffset.Buttons0; + + if ((data.Value & 0x80) != 0) + { + STInputEvent e = new STInputEvent() + { + nKey = 8 + i, + b謚シ縺輔l縺 = true, + b髮「縺輔l縺 = false, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧オ繧ヲ繝ウ繝峨ち繧、繝槭シ縺ョ繧キ繧ケ繝繝譎ょ綾ms縺ク縺ョ螟画鋤(data.Timestamp), + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(e); + + this.bButtonState[8 + i] = true; + this.bButtonPushDown[8 + i] = true; + } + else //if ( ( data.Value & 0x80 ) == 0 ) + { + var ev = new STInputEvent() + { + nKey = 8 + i, + b謚シ縺輔l縺 = false, + b髮「縺輔l縺 = true, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧オ繧ヲ繝ウ繝峨ち繧、繝槭シ縺ョ繧キ繧ケ繝繝譎ょ綾ms縺ク縺ョ螟画鋤(data.Timestamp), + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥, + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(ev); + + this.bButtonState[8 + i] = false; + this.bButtonPullUp[8 + i] = true; + } + } + //----------------------------- + #endregion + break; + } + } + } + //----------------------------- + #endregion + } + else + { + #region [ b.迥カ諷句・蜉 ] + //----------------------------- + JoystickState currentState = this.devJoystick.GetCurrentState(); + //if( Result.Last.IsSuccess && currentState != null ) + { + #region [ X霆クシ ] + //----------------------------- + if( currentState.X < -500 ) + { + if( this.bButtonState[ 0 ] == false ) + { + STInputEvent ev = new STInputEvent() + { + nKey = 0, + b謚シ縺輔l縺 = true, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(ev); + + this.bButtonState[0] = true; + this.bButtonPushDown[0] = true; + } + } + else + { + if( this.bButtonState[0] == true ) + { + STInputEvent ev = new STInputEvent() + { + nKey = 0, + b謚シ縺輔l縺 = false, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(ev); + + this.bButtonState[0] = false; + this.bButtonPullUp[0] = true; + } + } + //----------------------------- + #endregion + #region [ X霆クシ ] + //----------------------------- + if(currentState.X > 500) + { + if(this.bButtonState[1] == false) + { + STInputEvent ev = new STInputEvent() + { + nKey = 1, + b謚シ縺輔l縺 = true, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(ev); + + this.bButtonState[1] = true; + this.bButtonPushDown[1] = true; + } + } + else + { + if(this.bButtonState[1] == true) + { + STInputEvent event7 = new STInputEvent() + { + nKey = 1, + b謚シ縺輔l縺 = false, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(event7); + + this.bButtonState[1] = false; + this.bButtonPullUp[1] = true; + } + } + //----------------------------- + #endregion + #region [ Y霆クシ ] + //----------------------------- + if(currentState.Y < -500) + { + if(this.bButtonState[ 2 ] == false) + { + STInputEvent ev = new STInputEvent() + { + nKey = 2, + b謚シ縺輔l縺 = true, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(ev); + + this.bButtonState[2] = true; + this.bButtonPushDown[2] = true; + } + } + else + { + if(this.bButtonState[2] == true) + { + STInputEvent ev = new STInputEvent() + { + nKey = 2, + b謚シ縺輔l縺 = false, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(ev); + + this.bButtonState[2] = false; + this.bButtonPullUp[2] = true; + } + } + //----------------------------- + #endregion + #region [ Y霆クシ ] + //----------------------------- + if(currentState.Y > 500) + { + if(this.bButtonState[3] == false) + { + STInputEvent ev = new STInputEvent() + { + nKey = 3, + b謚シ縺輔l縺 = true, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(ev); + + this.bButtonState[3] = true; + this.bButtonPushDown[3] = true; + } + } + else + { + if(this.bButtonState[3] == true) + { + STInputEvent ev = new STInputEvent() + { + nKey = 3, + b謚シ縺輔l縺 = false, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(ev); + + this.bButtonState[3] = false; + this.bButtonPullUp[3] = true; + } + } + //----------------------------- + #endregion + #region [ Z霆クシ ] + //----------------------------- + if(currentState.Z < -500) + { + if(this.bButtonState[4] == false) + { + STInputEvent ev = new STInputEvent() + { + nKey = 4, + b謚シ縺輔l縺 = true, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(ev); + + this.bButtonState[4] = true; + this.bButtonPushDown[4] = true; + } + } + else + { + if(this.bButtonState[4] == true) + { + STInputEvent ev = new STInputEvent() + { + nKey = 4, + b謚シ縺輔l縺 = false, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(ev); + + this.bButtonState[4] = false; + this.bButtonPullUp[4] = true; + } + } + //----------------------------- + #endregion + #region [ Z霆クシ ] + //----------------------------- + if(currentState.Z > 500) + { + if( this.bButtonState[5] == false ) + { + STInputEvent ev = new STInputEvent() + { + nKey = 5, + b謚シ縺輔l縺 = true, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add( ev ); + + this.bButtonState[5] = true; + this.bButtonPushDown[5] = true; + } + } + else + { + if(this.bButtonState[5] == true) + { + STInputEvent event15 = new STInputEvent() + { + nKey = 5, + b謚シ縺輔l縺 = false, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(event15); + + this.bButtonState[5] = false; + this.bButtonPullUp[5] = true; + } + } + //----------------------------- + #endregion + #region [ Z霆ク蝗櫁サ「シ ] + //----------------------------- + if (currentState.RotationZ < -500) + { + if (this.bButtonState[6] == false) + { + STInputEvent ev = new STInputEvent() + { + nKey = 6, + b謚シ縺輔l縺 = true, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(ev); + + this.bButtonState[6] = true; + this.bButtonPushDown[6] = true; + } + } + else + { + if (this.bButtonState[6] == true) + { + STInputEvent ev = new STInputEvent() + { + nKey = 6, + b謚シ縺輔l縺 = false, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(ev); + + this.bButtonState[6] = false; + this.bButtonPullUp[6] = true; + } + } + //----------------------------- + #endregion + #region [ Z霆ク蝗櫁サ「シ ] + //----------------------------- + if (currentState.RotationZ > 500) + { + if (this.bButtonState[7] == false) + { + STInputEvent ev = new STInputEvent() + { + nKey = 7, + b謚シ縺輔l縺 = true, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(ev); + + this.bButtonState[7] = true; + this.bButtonPushDown[7] = true; + } + } + else + { + if (this.bButtonState[7] == true) + { + STInputEvent event15 = new STInputEvent() + { + nKey = 7, + b謚シ縺輔l縺 = false, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(event15); + + this.bButtonState[7] = false; + this.bButtonPullUp[7] = true; + } + } + //----------------------------- + #endregion + #region [ 繝懊ち繝ウ ] + //----------------------------- + bool bIsButtonPressedReleased = false; + bool[] buttons = currentState.Buttons; + for (int j = 0; (j < buttons.Length) && (j < 128); j++) + { + if (this.bButtonState[8 + j] == false && buttons[j]) + { + STInputEvent item = new STInputEvent() + { + nKey = 8 + j, + b謚シ縺輔l縺 = true, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(item); + + this.bButtonState[8 + j] = true; + this.bButtonPushDown[8 + j] = true; + bIsButtonPressedReleased = true; + } + else if( this.bButtonState[8 + j] == true && !buttons[j] ) + { + STInputEvent item = new STInputEvent() + { + nKey = 8 + j, + b謚シ縺輔l縺 = false, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(item); + + this.bButtonState[8 + j] = false; + this.bButtonPullUp[8 + j] = true; + bIsButtonPressedReleased = true; + } + } + //----------------------------- + #endregion + // #24341 2011.3.12 yyagi: POV support + #region [ POV HAT 4/8way (only single POV switch is supported)] + int[] povs = currentState.PointOfViewControllers; + if (povs != null) + { + if ( povs[0] >= 0 ) + { + int nPovDegree = povs[0]; + int nWay = (nPovDegree + 2250) / 4500; + if (nWay == 8) nWay = 0; + + if (this.bButtonState[8 + 128 + nWay] == false) + { + STInputEvent stevent = new STInputEvent() + { + nKey = 8 + 128 + nWay, + //Debug.WriteLine( "POVS:" + povs[ 0 ].ToString( CultureInfo.CurrentCulture ) + ", " +stevent.nKey ); + b謚シ縺輔l縺 = true, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(stevent); + + this.bButtonState[stevent.nKey] = true; + this.bButtonPushDown[stevent.nKey] = true; + } + } + else if (bIsButtonPressedReleased == false) // #xxxxx 2011.12.3 yyagi 莉悶ョ繝懊ち繝ウ縺御ス輔b謚シ縺輔l/髮「縺輔l縺ヲ縺ェ縺シ抉OV縺碁屬縺輔l縺 + { + int nWay = 0; + for (int i = 8 + 0x80; i < 8 + 0x80 + 8; i++) + { // 髮「縺輔l縺溘懊ち繝ウ繧定ェソ縺ケ繧九◆繧√↓縲∝縲謚シ縺輔l縺ヲ縺縺溘懊ち繝ウ繧呈爾縺吶 + if (this.bButtonState[i] == true) // DirectInput繧堤峩謗・縺縺倥k縺ェ繧峨%繧薙↑縺薙→縺励↑縺上※濶ッ縺縺ョ縺ォ縲√≠縺髱「蛟偵 + { // 縺薙ョ蜃ヲ逅縺悟ソ隕√↑縺溘a縺ォ縲 ̄OV繧1蛟九@縺九し繝昴シ繝医〒縺阪↑縺縲ら┌蠢オ縲 + nWay = i; + break; + } + } + if (nWay != 0) + { + STInputEvent stevent = new STInputEvent() + { + nKey = nWay, + b謚シ縺輔l縺 = false, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = 0 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(stevent); + + this.bButtonState[nWay] = false; + this.bButtonPullUp[nWay] = true; + } + } + } + #endregion + } + //----------------------------- + #endregion + } + } + } + + public bool b繧ュ繝シ縺梧款縺輔l縺(int nButton) + { + return this.bButtonPushDown[nButton]; + } + public bool b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧(int nButton) + { + return this.bButtonState[nButton]; + } + public bool b繧ュ繝シ縺碁屬縺輔l縺(int nButton) + { + return this.bButtonPullUp[nButton]; + } + public bool b繧ュ繝シ縺碁屬縺輔l縺ヲ縺繧(int nButton) + { + return !this.bButtonState[nButton]; + } + //----------------- + #endregion + + #region [ IDisposable 螳溯」 ] + //----------------- + public void Dispose() + { + if(!this.bDispose螳御コ貂医∩) + { + if(this.devJoystick != null) + { + this.devJoystick.Dispose(); + this.devJoystick = null; + } + //if( this.timer != null ) + //{ + // this.timer.Dispose(); + // this.timer = null; + //} + if (this.list蜈・蜉帙う繝吶Φ繝 != null) + { + this.list蜈・蜉帙う繝吶Φ繝 = null; + } + this.bDispose螳御コ貂医∩ = true; + } + } + //----------------- + #endregion + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private bool[] bButtonPullUp = new bool[0x100]; + private bool[] bButtonPushDown = new bool[0x100]; + private bool[] bButtonState = new bool[0x100]; // 0-5: XYZ, 6 - 0x128+5: buttons, 0x128+6 - 0x128+6+8: POV/HAT + private int[] nPovState = new int[4]; + private bool bDispose螳御コ貂医∩; + private Joystick devJoystick; + //private CTimer timer; + + private void bButtonUpDown(JoystickUpdate data, int axisdata, int target, int contrary) // #26871 2011.12.3 霆ク縺ョ蜿崎サ「縺ォ蟇セ蠢懊☆繧九◆繧√↓繝ェ繝輔ぃ繧ッ繧ソ + { + int targetsign = (target < contrary) ? -1 : 1; + if (Math.Abs(axisdata) > 500 && (targetsign == Math.Sign(axisdata))) // 霆ク縺ョ譛螟ァ蛟、縺ョ蜊雁繧定カ縺医※縺縺ヲ縲√°縺、 + { + if (bDoUpDownCore(target, data, false)) // 逶エ蜑阪∪縺ァ縺ッ雜縺医※縺縺ェ縺代l縺ー縲∽サ雁屓ON + { + //Debug.WriteLine( "X-ON " + data.TimeStamp + " " + axisdata ); + } + else + { + //Debug.WriteLine( "X-ONx " + data.TimeStamp + " " + axisdata ); + } + bDoUpDownCore(contrary, data, true); // X霆ク+ == ON 縺九i X霆ク-縺ョON繝ャ繝ウ繧ク縺ォ譚・縺溘i縲々霆ク+縺ッOFF + } + else if ((axisdata <= 0 && targetsign <= 0) || (axisdata >= 0 && targetsign >= 0)) // 霆ク縺ョ譛螟ァ蛟、縺ョ蜊雁繧定カ縺医※縺翫i縺壹√°縺、 + { + //Debug.WriteLine( "X-OFF? " + data.TimeStamp + " " + axisdata ); + if (bDoUpDownCore(target, data, true)) // 逶エ蜑阪∪縺ァ縺ッ雜縺医※縺縺溘ョ縺ェ繧峨ー縲∽サ雁屓OFF + { + //Debug.WriteLine( "X-OFF " + data.TimeStamp + " " + axisdata ); + } + else if (bDoUpDownCore(contrary, data, true)) // X霆ク+ == ON 縺九i X霆ク-縺ョOFF繝ャ繝ウ繧ク縺ォ縺阪◆繧峨々霆ク+縺ッOFF + { + //Debug.WriteLine( "X-OFFx " + data.TimeStamp + " " + axisdata ); + } + } + } + + /// + /// 蠢隕√↓蠢懊§縺ヲ霆ク繝懊ち繝ウ縺ョ荳翫£荳九£繧、繝吶Φ繝医r逋コ逕溘☆繧 + /// + /// 霆ク繝懊ち繝ウ逡ェ蜿キ 0=-X 1=+X ... 5=+Z + /// + /// 逶エ蜑阪ョ繝懊ち繝ウ迥カ諷 true=謚シ縺輔l縺ヲ縺縺 + /// 荳翫£荳九£繧、繝吶Φ繝育匱逕滓凾true + private bool bDoUpDownCore(int target, JoystickUpdate data, bool lastMode) + { + if ( this.bButtonState[target] == lastMode ) + { + STInputEvent e = new STInputEvent() + { + nKey = target, + b謚シ縺輔l縺 = !lastMode, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧オ繧ヲ繝ウ繝峨ち繧、繝槭シ縺ョ繧キ繧ケ繝繝譎ょ綾ms縺ク縺ョ螟画鋤(data.Timestamp), + nVelocity = (lastMode) ? 0 : CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(e); + + this.bButtonState[target] = !lastMode; + if (lastMode) + { + this.bButtonPullUp[target] = true; + } + else + { + this.bButtonPushDown[target] = true; + } + return true; + } + return false; + } + //----------------- + #endregion + } +} diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputKeyboard.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputKeyboard.cs new file mode 100644 index 00000000..44d49609 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputKeyboard.cs @@ -0,0 +1,296 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using SharpDX; +using SharpDX.DirectInput; + +using SlimDXKey = SlimDXKeys.Key; +using SharpDXKey = SharpDX.DirectInput.Key; + +namespace FDK +{ + public class CInputKeyboard : IInputDevice, IDisposable + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CInputKeyboard(IntPtr hWnd, DirectInput directInput) + { + this.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ = E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Keyboard; + this.GUID = ""; + this.ID = 0; + try + { + this.devKeyboard = new Keyboard(directInput); + this.devKeyboard.SetCooperativeLevel(hWnd, CooperativeLevel.NoWinKey | CooperativeLevel.Foreground | CooperativeLevel.NonExclusive); + this.devKeyboard.Properties.BufferSize = 32; + Trace.TraceInformation(this.devKeyboard.Information.ProductName.Trim(new char[] { '\0' }) + " 繧堤函謌舌@縺セ縺励◆縲"); // 縺ェ縺懊°0x00縺ョ繧エ繝溘′蜃コ繧九ョ縺ァ蜑企勁 + this.strDeviceName = this.devKeyboard.Information.ProductName.Trim(new char[] { '\0' }); + } + catch + { + if(this.devKeyboard != null) + { + this.devKeyboard.Dispose(); + this.devKeyboard = null; + } + Trace.TraceWarning("Keyboard 繝繝舌う繧ケ縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲"); + throw; + } + try + { + this.devKeyboard.Acquire(); + } + catch + { + } + + for (int i = 0; i < this.bKeyState.Length; i++) + this.bKeyState[i] = false; + + //this.timer = new CTimer( CTimer.E遞ョ蛻・.MultiMedia ); + this.list蜈・蜉帙う繝吶Φ繝 = new List(32); + // this.ct = new CTimer( CTimer.E遞ョ蛻・.PerformanceCounter ); + } + + + // 繝。繧ス繝繝 + + #region [ IInputDevice 螳溯」 ] + //----------------- + public E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ { get; private set; } + public string GUID { get; private set; } + public int ID { get; private set; } + public List list蜈・蜉帙う繝吶Φ繝 { get; private set; } + public string strDeviceName { get; set; } + + public void t繝昴シ繝ェ繝ウ繧ー(bool bWindow縺後い繧ッ繝繧」繝紋クュ, bool b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k) + { + for (int i = 0; i < 256; i++) + { + this.bKeyPushDown[i] = false; + this.bKeyPullUp[i] = false; + } + + if (bWindow縺後い繧ッ繝繧」繝紋クュ && (this.devKeyboard != null)) + { + this.devKeyboard.Acquire(); + this.devKeyboard.Poll(); + + //this.list蜈・蜉帙う繝吶Φ繝 = new List( 32 ); + this.list蜈・蜉帙う繝吶Φ繝.Clear(); // #xxxxx 2012.6.11 yyagi; To optimize, I removed new(); + int posEnter = -1; + //string d = DateTime.Now.ToString( "yyyy/MM/dd HH:mm:ss.ffff" ); + + if (b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k) + { + #region [ a.繝舌ャ繝輔ぃ蜈・蜉 ] + //----------------------------- + var bufferedData = this.devKeyboard.GetBufferedData(); + //if ( Result.Last.IsSuccess && bufferedData != null ) + { + foreach (KeyboardUpdate data in bufferedData) + { + // #xxxxx: 2017.5.7: from: DIK (SharpDX.DirectInput.Key) 繧 SlimDX.DirectInput.Key 縺ォ螟画鋤縲 + var key = DeviceConstantConverter.DIKtoKey(data.Key); + if (SlimDXKey.Unknown == key) + continue; // 譛ェ蟇セ蠢懊く繝シ縺ッ辟。隕悶 + + //foreach ( Key key in data.PressedKeys ) + if (data.IsPressed) + { + // #23708 2016.3.19 yyagi; Even if we remove ALT+ENTER key input by SuppressKeyPress = true in Form, + // it doesn't affect to DirectInput (ALT+ENTER does not remove) + // So we ignore ENTER input in ALT+ENTER combination here. + // Note: ENTER will be alived if you keyup ALT after ALT+ENTER. + if (key != SlimDXKey.Return || (bKeyState[(int)SlimDXKey.LeftAlt] == false && bKeyState[(int)SlimDXKey.RightAlt] == false)) + { + STInputEvent item = new STInputEvent() + { + nKey = (int)key, + b謚シ縺輔l縺 = true, + b髮「縺輔l縺 = false, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧オ繧ヲ繝ウ繝峨ち繧、繝槭シ縺ョ繧キ繧ケ繝繝譎ょ綾ms縺ク縺ョ螟画鋤(data.Timestamp), + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(item); + + this.bKeyState[(int)key] = true; + this.bKeyPushDown[(int)key] = true; + } + //if ( item.nKey == (int) SlimDXKey.Space ) + //{ + // Trace.TraceInformation( "FDK(buffered): SPACE key registered. " + ct.n繧キ繧ケ繝繝譎ょ綾 ); + //} + } + //foreach ( Key key in data.ReleasedKeys ) + if (data.IsReleased) + { + STInputEvent item = new STInputEvent() + { + nKey = (int)key, + b謚シ縺輔l縺 = false, + b髮「縺輔l縺 = true, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧オ繧ヲ繝ウ繝峨ち繧、繝槭シ縺ョ繧キ繧ケ繝繝譎ょ綾ms縺ク縺ョ螟画鋤(data.Timestamp), + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(item); + this.bKeyState[(int)key] = false; + this.bKeyPullUp[(int)key] = true; + } + } + } + //----------------------------- + #endregion + } + else + { + #region [ b.迥カ諷句・蜉 ] + //----------------------------- + KeyboardState currentState = this.devKeyboard.GetCurrentState(); + //if ( Result.Last.IsSuccess && currentState != null ) + { + foreach (SharpDXKey dik in currentState.PressedKeys) + { + // #xxxxx: 2017.5.7: from: DIK (SharpDX.DirectInput.Key) 繧 SlimDX.DirectInput.Key 縺ォ螟画鋤縲 + var key = DeviceConstantConverter.DIKtoKey(dik); + if (SlimDXKey.Unknown == key) + continue; // 譛ェ蟇セ蠢懊く繝シ縺ッ辟。隕悶 + + if (this.bKeyState[(int)key] == false) + { + if (key != SlimDXKey.Return || (bKeyState[(int)SlimDXKey.LeftAlt] == false && bKeyState[(int)SlimDXKey.RightAlt] == false)) // #23708 2016.3.19 yyagi + { + var ev = new STInputEvent() + { + nKey = (int)key, + b謚シ縺輔l縺 = true, + b髮「縺輔l縺 = false, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥, + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(ev); + + this.bKeyState[(int)key] = true; + this.bKeyPushDown[(int)key] = true; + } + + //if ( (int) key == (int) SlimDXKey.Space ) + //{ + // Trace.TraceInformation( "FDK(direct): SPACE key registered. " + ct.n繧キ繧ケ繝繝譎ょ綾 ); + //} + } + } + //foreach ( Key key in currentState.ReleasedKeys ) + foreach (SharpDXKey dik in currentState.AllKeys) + { + // #xxxxx: 2017.5.7: from: DIK (SharpDX.DirectInput.Key) 繧 SlimDX.DirectInput.Key 縺ォ螟画鋤縲 + var key = DeviceConstantConverter.DIKtoKey(dik); + if (SlimDXKey.Unknown == key) + continue; // 譛ェ蟇セ蠢懊く繝シ縺ッ辟。隕悶 + + if (this.bKeyState[(int)key] == true && !currentState.IsPressed(dik)) // 蜑榊屓縺ッ謚シ縺輔l縺ヲ縺繧九ョ縺ォ莉雁屓縺ッ謚シ縺輔l縺ヲ縺縺ェ縺 竊 髮「縺輔l縺 + { + var ev = new STInputEvent() + { + nKey = (int)key, + b謚シ縺輔l縺 = false, + b髮「縺輔l縺 = true, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥, + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(ev); + + this.bKeyState[(int) key] = false; + this.bKeyPullUp[(int) key] = true; + } + } + } + //----------------------------- + #endregion + } + #region [#23708 2011.4.8 yyagi Alt縺梧款縺輔l縺ヲ縺繧九→縺阪ッ縲・nter謚シ荳区ュ蝣ア繧貞炎髯、縺吶k -> 蜑ッ菴懃畑縺瑚ヲ九▽縺九j蜑企勁] + //if ( this.bKeyState[ (int) SlimDXKey.RightAlt ] || + // this.bKeyState[ (int) SlimDXKey.LeftAlt ] ) + //{ + // int cr = (int) SlimDXKey.Return; + // this.bKeyPushDown[ cr ] = false; + // this.bKeyPullUp[ cr ] = false; + // this.bKeyState[ cr ] = false; + //} + #endregion + } + } + /// + /// 隱ソ縺ケ繧 SlimDX.DirectInput.Key 繧 int 縺ォ繧ュ繝」繧ケ繝医@縺溷、縲ゑシSharpDX.DirectInput.Key 縺ァ縺ッ縺ェ縺縺ョ縺ァ豕ィ諢上ゑシ + /// + public bool b繧ュ繝シ縺梧款縺輔l縺(int nKey) + { + return this.bKeyPushDown[nKey]; + } + /// + /// 隱ソ縺ケ繧 SlimDX.DirectInput.Key 繧 int 縺ォ繧ュ繝」繧ケ繝医@縺溷、縲ゑシSharpDX.DirectInput.Key 縺ァ縺ッ縺ェ縺縺ョ縺ァ豕ィ諢上ゑシ + /// + public bool b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧(int nKey) + { + return this.bKeyState[ nKey ]; + } + /// + /// 隱ソ縺ケ繧 SlimDX.DirectInput.Key 繧 int 縺ォ繧ュ繝」繧ケ繝医@縺溷、縲ゑシSharpDX.DirectInput.Key 縺ァ縺ッ縺ェ縺縺ョ縺ァ豕ィ諢上ゑシ + /// + public bool b繧ュ繝シ縺碁屬縺輔l縺(int nKey) + { + return this.bKeyPullUp[nKey]; + } + /// + /// 隱ソ縺ケ繧 SlimDX.DirectInput.Key 繧 int 縺ォ繧ュ繝」繧ケ繝医@縺溷、縲ゑシSharpDX.DirectInput.Key 縺ァ縺ッ縺ェ縺縺ョ縺ァ豕ィ諢上ゑシ + /// + public bool b繧ュ繝シ縺碁屬縺輔l縺ヲ縺繧(int nKey) + { + return !this.bKeyState[nKey]; + } + //----------------- + #endregion + + #region [ IDisposable 螳溯」 ] + //----------------- + public void Dispose() + { + if(!this.bDispose螳御コ貂医∩) + { + if(this.devKeyboard != null) + { + this.devKeyboard.Dispose(); + this.devKeyboard = null; + } + //if( this.timer != null ) + //{ + // this.timer.Dispose(); + // this.timer = null; + //} + if (this.list蜈・蜉帙う繝吶Φ繝 != null) + { + this.list蜈・蜉帙う繝吶Φ繝 = null; + } + this.bDispose螳御コ貂医∩ = true; + } + } + //----------------- + #endregion + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private bool[] bKeyPullUp = new bool[256]; + private bool[] bKeyPushDown = new bool[256]; + private bool[] bKeyState = new bool[256]; + private bool bDispose螳御コ貂医∩; + private Keyboard devKeyboard; + //private CTimer timer; + //private CTimer ct; + //----------------- + #endregion + } +} diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputMIDI.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputMIDI.cs new file mode 100644 index 00000000..8b8308d9 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputMIDI.cs @@ -0,0 +1,124 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; + +namespace FDK +{ + public class CInputMIDI : IInputDevice, IDisposable + { + // 繝励Ο繝代ユ繧」 + + public IntPtr hMidiIn; + public List listEventBuffer; + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CInputMIDI(uint nID) + { + this.hMidiIn = IntPtr.Zero; + this.listEventBuffer = new List(32); + this.list蜈・蜉帙う繝吶Φ繝 = new List(32); + this.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ = E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.MidiIn; + this.GUID = ""; + this.ID = (int)nID; + this.strDeviceName = ""; // CInput邂。逅縺ァ蛻晄悄蛹悶☆繧 + } + + + // 繝。繧ス繝繝 + + public void t繝。繝繧サ繝シ繧ク縺九iMIDI菫。蜿キ縺ョ縺ソ蜿嶺ソ。(uint wMsg, IntPtr dwInstance, IntPtr dwParam1, IntPtr dwParam2, long n蜿嶺ソ。繧キ繧ケ繝繝譎ょ綾) + { + if (wMsg == CWin32.MIM_DATA) + { + int nMIDIevent = (int)dwParam1 & 0xF0; + int nPara1 = ((int)dwParam1 >> 8) & 0xFF; + int nPara2 = ((int)dwParam1 >> 16) & 0xFF; + int nPara3 = ((int)dwParam2 >> 8) & 0xFF; + int nPara4 = ((int)dwParam2 >> 16) & 0xFF; + + // Trace.TraceInformation( "MIDIevent={0:X2} para1={1:X2} para2={2:X2}", nMIDIevent, nPara1, nPara2 ,nPara3,nPara4); + + if ((nMIDIevent == 0x90) && (nPara2 != 0)) // Note ON + { + STInputEvent item = new STInputEvent(); + item.nKey = nPara1; + item.b謚シ縺輔l縺 = true; + item.nTimeStamp = n蜿嶺ソ。繧キ繧ケ繝繝譎ょ綾; + item.nVelocity = nPara2; + this.listEventBuffer.Add(item); + } + //else if ( ( nMIDIevent == 0xB0 ) && ( nPara1 == 4 ) ) // Ctrl Chg #04: Foot Controller + //{ + // STInputEvent item = new STInputEvent(); + // item.nKey = nPara1; + // item.b謚シ縺輔l縺 = true; + // item.nTimeStamp = n蜿嶺ソ。繧キ繧ケ繝繝譎ょ綾; + // item.nVelocity = nPara2; + // this.listEventBuffer.Add( item ); + //} + } + } + + #region [ IInputDevice 螳溯」 ] + //----------------- + public E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ { get; private set; } + public string GUID { get; private set; } + public int ID { get; private set; } + public List list蜈・蜉帙う繝吶Φ繝 { get; private set; } + public string strDeviceName { get; set; } + + public void t繝昴シ繝ェ繝ウ繧ー(bool bWindow縺後い繧ッ繝繧」繝紋クュ, bool b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k) + { + // this.list蜈・蜉帙う繝吶Φ繝 = new List( 32 ); + this.list蜈・蜉帙う繝吶Φ繝.Clear(); // #xxxxx 2012.6.11 yyagi; To optimize, I removed new(); + + for (int i = 0; i < this.listEventBuffer.Count; i++) + this.list蜈・蜉帙う繝吶Φ繝.Add(this.listEventBuffer[i]); + + this.listEventBuffer.Clear(); + } + public bool b繧ュ繝シ縺梧款縺輔l縺(int nKey) + { + foreach (STInputEvent event2 in this.list蜈・蜉帙う繝吶Φ繝) + { + if ((event2.nKey == nKey) && event2.b謚シ縺輔l縺) + { + return true; + } + } + return false; + } + public bool b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧(int nKey) + { + return false; + } + public bool b繧ュ繝シ縺碁屬縺輔l縺(int nKey) + { + return false; + } + public bool b繧ュ繝シ縺碁屬縺輔l縺ヲ縺繧(int nKey) + { + return false; + } + //----------------- + #endregion + + #region [ IDisposable 螳溯」 ] + //----------------- + public void Dispose() + { + if (this.listEventBuffer != null) + { + this.listEventBuffer = null; + } + if (this.list蜈・蜉帙う繝吶Φ繝 != null) + { + this.list蜈・蜉帙う繝吶Φ繝 = null; + } + } + //----------------- + #endregion + } +} diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputMouse.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputMouse.cs new file mode 100644 index 00000000..01d2dd9c --- /dev/null +++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInputMouse.cs @@ -0,0 +1,251 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using SharpDX; +using SharpDX.DirectInput; + +namespace FDK +{ + public class CInputMouse : IInputDevice, IDisposable + { + // 螳壽焚 + + public const int n繝槭え繧ケ縺ョ譛螟ァ繝懊ち繝ウ謨ー = 8; + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CInputMouse(IntPtr hWnd, DirectInput directInput) + { + this.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ = E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Mouse; + this.GUID = ""; + this.ID = 0; + try + { + this.devMouse = new Mouse(directInput); + this.devMouse.SetCooperativeLevel(hWnd, CooperativeLevel.Foreground | CooperativeLevel.NonExclusive); + this.devMouse.Properties.BufferSize = 0x20; + Trace.TraceInformation(this.devMouse.Information.ProductName.Trim(new char[] { '\0' }) + " 繧堤函謌舌@縺セ縺励◆縲"); // 縺ェ縺懊°0x00縺ョ繧エ繝溘′蜃コ繧九ョ縺ァ蜑企勁 + this.strDeviceName = this.devMouse.Information.ProductName.Trim(new char[] { '\0' }); + } + catch + { + if (this.devMouse != null) + { + this.devMouse.Dispose(); + this.devMouse = null; + } + Trace.TraceWarning("Mouse 繝繝舌う繧ケ縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲"); + throw; + } + try + { + this.devMouse.Acquire(); + } + catch + { + } + + for (int i = 0; i < this.bMouseState.Length; i++) + this.bMouseState[i] = false; + + //this.timer = new CTimer( CTimer.E遞ョ蛻・.MultiMedia ); + this.list蜈・蜉帙う繝吶Φ繝 = new List(32); + } + + + // 繝。繧ス繝繝 + + #region [ IInputDevice 螳溯」 ] + //----------------- + public E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ { get; private set; } + public string GUID { get; private set; } + public int ID { get; private set; } + public List list蜈・蜉帙う繝吶Φ繝 { get; private set; } + public string strDeviceName { get; set; } + + public void t繝昴シ繝ェ繝ウ繧ー(bool bWindow縺後い繧ッ繝繧」繝紋クュ, bool b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k) + { + for (int i = 0; i < 8; i++) + { + this.bMousePushDown[i] = false; + this.bMousePullUp[i] = false; + } + + if (bWindow縺後い繧ッ繝繧」繝紋クュ && (this.devMouse != null)) + { + this.devMouse.Acquire(); + this.devMouse.Poll(); + + // this.list蜈・蜉帙う繝吶Φ繝 = new List( 32 ); + this.list蜈・蜉帙う繝吶Φ繝.Clear(); // #xxxxx 2012.6.11 yyagi; To optimize, I removed new(); + + if (b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k) + { + #region [ a.繝舌ャ繝輔ぃ蜈・蜉 ] + //----------------------------- + var bufferedData = this.devMouse.GetBufferedData(); + //if( Result.Last.IsSuccess && bufferedData != null ) + { + foreach (MouseUpdate data in bufferedData) + { + var mouseButton = new[] { + MouseOffset.Buttons0, + MouseOffset.Buttons1, + MouseOffset.Buttons2, + MouseOffset.Buttons3, + MouseOffset.Buttons4, + MouseOffset.Buttons5, + MouseOffset.Buttons6, + MouseOffset.Buttons7, + }; + + for (int k = 0; k < 8; k++) + { + //if( data.IsPressed( k ) ) + if (data.Offset == mouseButton[k] && ((data.Value & 0x80) != 0)) + { + STInputEvent item = new STInputEvent() + { + nKey = k, + b謚シ縺輔l縺 = true, + b髮「縺輔l縺 = false, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧オ繧ヲ繝ウ繝峨ち繧、繝槭シ縺ョ繧キ繧ケ繝繝譎ょ綾ms縺ク縺ョ螟画鋤(data.Timestamp), + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(item); + + this.bMouseState[k] = true; + this.bMousePushDown[k] = true; + } + else if (data.Offset == mouseButton[k] && this.bMouseState[k] == true && ((data.Value & 0x80) == 0)) + //else if( data.IsReleased( k ) ) + { + STInputEvent item = new STInputEvent() + { + nKey = k, + b謚シ縺輔l縺 = false, + b髮「縺輔l縺 = true, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧オ繧ヲ繝ウ繝峨ち繧、繝槭シ縺ョ繧キ繧ケ繝繝譎ょ綾ms縺ク縺ョ螟画鋤(data.Timestamp), + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥 + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(item); + + this.bMouseState[k] = false; + this.bMousePullUp[k] = true; + } + } + } + } + //----------------------------- + #endregion + } + else + { + #region [ b.迥カ諷句・蜉 ] + //----------------------------- + MouseState currentState = this.devMouse.GetCurrentState(); + //if( Result.Last.IsSuccess && currentState != null ) + { + bool[] buttons = currentState.Buttons; + + for (int j = 0; (j < buttons.Length) && (j < 8); j++) + { + if (this.bMouseState[j] == false && buttons[j] == true) + { + var ev = new STInputEvent() + { + nKey = j, + b謚シ縺輔l縺 = true, + b髮「縺輔l縺 = false, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥, + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(ev); + + this.bMouseState[j] = true; + this.bMousePushDown[j] = true; + } + else if(this.bMouseState[j] == true && buttons[j] == false) + { + var ev = new STInputEvent() + { + nKey = j, + b謚シ縺輔l縺 = false, + b髮「縺輔l縺 = true, + nTimeStamp = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾, // 貍泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + nVelocity = CInput邂。逅.n騾壼クク髻ウ驥, + }; + this.list蜈・蜉帙う繝吶Φ繝.Add(ev); + + this.bMouseState[j] = false; + this.bMousePullUp[j] = true; + } + } + } + //----------------------------- + #endregion + } + } + } + public bool b繧ュ繝シ縺梧款縺輔l縺(int nButton) + { + return (((0 <= nButton) && (nButton < 8)) && this.bMousePushDown[nButton]); + } + public bool b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧(int nButton) + { + return (((0 <= nButton) && (nButton < 8)) && this.bMouseState[nButton]); + } + public bool b繧ュ繝シ縺碁屬縺輔l縺(int nButton) + { + return (((0 <= nButton) && (nButton < 8)) && this.bMousePullUp[nButton]); + } + public bool b繧ュ繝シ縺碁屬縺輔l縺ヲ縺繧(int nButton) + { + return (((0 <= nButton) && (nButton < 8)) && !this.bMouseState[nButton]); + } + //----------------- + #endregion + + #region [ IDisposable 螳溯」 ] + //----------------- + public void Dispose() + { + if(!this.bDispose螳御コ貂医∩) + { + if(this.devMouse != null) + { + this.devMouse.Dispose(); + this.devMouse = null; + } + //if( this.timer != null ) + //{ + // this.timer.Dispose(); + // this.timer = null; + //} + if (this.list蜈・蜉帙う繝吶Φ繝 != null) + { + this.list蜈・蜉帙う繝吶Φ繝 = null; + } + this.bDispose螳御コ貂医∩ = true; + } + } + //----------------- + #endregion + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private bool bDispose螳御コ貂医∩; + private bool[] bMousePullUp = new bool[8]; + private bool[] bMousePushDown = new bool[8]; + private bool[] bMouseState = new bool[8]; + private Mouse devMouse; + //private CTimer timer; + //----------------- + #endregion + } +} diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInput邂。逅.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInput邂。逅.cs new file mode 100644 index 00000000..63475af1 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/CInput邂。逅.cs @@ -0,0 +1,297 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using System.Runtime.InteropServices; +using SharpDX.DirectInput; + +namespace FDK +{ + public class CInput邂。逅 : IDisposable + { + // 螳壽焚 + + public static int n騾壼クク髻ウ驥 = 110; + + + // 繝励Ο繝代ユ繧」 + + public List list蜈・蜉帙ョ繝舌う繧ケ + { + get; + private set; + } + public IInputDevice Keyboard + { + get + { + if (this._Keyboard != null) + { + return this._Keyboard; + } + foreach (IInputDevice device in this.list蜈・蜉帙ョ繝舌う繧ケ) + { + if (device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Keyboard) + { + this._Keyboard = device; + return device; + } + } + return null; + } + } + public IInputDevice Mouse + { + get + { + if (this._Mouse != null) + { + return this._Mouse; + } + foreach (IInputDevice device in this.list蜈・蜉帙ョ繝舌う繧ケ) + { + if (device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Mouse) + { + this._Mouse = device; + return device; + } + } + return null; + } + } + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + public CInput邂。逅(IntPtr hWnd, bool bUseMidiIn = true) + { + CInput邂。逅蛻晄悄蛹(hWnd, bUseMidiIn); + } + + public void CInput邂。逅蛻晄悄蛹(IntPtr hWnd, bool bUseMidiIn) + { + this.directInput = new DirectInput(); + // this.timer = new CTimer( CTimer.E遞ョ蛻・.MultiMedia ); + + this.list蜈・蜉帙ョ繝舌う繧ケ = new List(10); + #region [ Enumerate keyboard/mouse: exception is masked if keyboard/mouse is not connected ] + CInputKeyboard cinputkeyboard = null; + CInputMouse cinputmouse = null; + try + { + cinputkeyboard = new CInputKeyboard(hWnd, directInput); + cinputmouse = new CInputMouse(hWnd, directInput); + } + + catch + { + } + if (cinputkeyboard != null) + { + this.list蜈・蜉帙ョ繝舌う繧ケ.Add(cinputkeyboard); + } + if (cinputmouse != null) + { + this.list蜈・蜉帙ョ繝舌う繧ケ.Add(cinputmouse); + } + #endregion + #region [ Enumerate joypad ] + foreach (DeviceInstance instance in this.directInput.GetDevices(DeviceClass.GameControl, DeviceEnumerationFlags.AttachedOnly)) + { + this.list蜈・蜉帙ョ繝舌う繧ケ.Add(new CInputJoystick(hWnd, instance, directInput)); + } + #endregion + if (bUseMidiIn) + { + this.proc = new CWin32.MidiInProc(this.MidiInCallback); + uint nMidiDevices = CWin32.midiInGetNumDevs(); + Trace.TraceInformation("MIDI蜈・蜉帙ョ繝舌う繧ケ謨ー: {0}", nMidiDevices); + for (uint i = 0; i < nMidiDevices; i++) + { + CInputMIDI item = new CInputMIDI(i); + CWin32.MIDIINCAPS lpMidiInCaps = new CWin32.MIDIINCAPS(); + uint num3 = CWin32.midiInGetDevCaps(i, ref lpMidiInCaps, (uint)Marshal.SizeOf(lpMidiInCaps)); + if (num3 != 0) + { + Trace.TraceError("MIDI In: Device{0}: midiInDevCaps(): {1:X2}: ", i, num3); + } + else + { + uint ret = CWin32.midiInOpen(ref item.hMidiIn, i, this.proc, IntPtr.Zero, 0x30000); + Trace.TraceInformation("midiInOpen()==" + ret); + Trace.TraceInformation("item.hMidiIn==" + item.hMidiIn.ToString()); + if ((ret == 0) && (item.hMidiIn != IntPtr.Zero)) + { + CWin32.midiInStart(item.hMidiIn); + Trace.TraceInformation("MIDI In: [{0}] \"{1}\" 縺ョ蜈・蜉帛女莉倥r髢句ァ九@縺セ縺励◆縲", i, lpMidiInCaps.szPname); + item.strDeviceName = lpMidiInCaps.szPname; + this.list蜈・蜉帙ョ繝舌う繧ケ.Add(item); + continue; + } + } + Trace.TraceError("MIDI In: [{0}] \"{1}\" 縺ョ蜈・蜉帛女莉倥ョ髢句ァ九↓螟ア謨励@縺セ縺励◆縲", i, lpMidiInCaps.szPname); + } + } + else + { + Trace.TraceInformation("DTXV繝「繝シ繝峨ョ縺溘a縲`IDI蜈・蜉帙ッ菴ソ逕ィ縺励∪縺帙s縲"); + } + } + + + // 繝。繧ス繝繝 + + public IInputDevice Joystick(int ID) + { + foreach (IInputDevice device in this.list蜈・蜉帙ョ繝舌う繧ケ) + { + if ((device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Joystick) && (device.ID == ID)) + { + return device; + } + } + return null; + } + public IInputDevice Joystick(string GUID) + { + foreach (IInputDevice device in this.list蜈・蜉帙ョ繝舌う繧ケ) + { + if ((device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Joystick) && device.GUID.Equals(GUID)) + { + return device; + } + } + return null; + } + public IInputDevice MidiIn(int ID) + { + foreach (IInputDevice device in this.list蜈・蜉帙ョ繝舌う繧ケ) + { + if ((device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.MidiIn) && (device.ID == ID)) + { + return device; + } + } + return null; + } + public void t繝昴シ繝ェ繝ウ繧ー(bool bWindow縺後い繧ッ繝繧」繝紋クュ, bool b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k) + { + lock (this.objMidiIn謗剃サ也畑) + { + // foreach( IInputDevice device in this.list蜈・蜉帙ョ繝舌う繧ケ ) + for (int i = this.list蜈・蜉帙ョ繝舌う繧ケ.Count - 1; i >= 0; i--) // #24016 2011.1.6 yyagi: change not to use "foreach" to avoid InvalidOperation exception by Remove(). + { + IInputDevice device = this.list蜈・蜉帙ョ繝舌う繧ケ[i]; + try + { + device.t繝昴シ繝ェ繝ウ繧ー(bWindow縺後い繧ッ繝繧」繝紋クュ, b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k); + } + catch (SharpDX.SharpDXException e) // #24016 2011.1.6 yyagi: catch exception for unplugging USB joystick, and remove the device object from the polling items. + { + if (e.ResultCode == ResultCode.OtherApplicationHasPriority) + { + // #xxxxx: 2017.5.9: from: 縺薙ョ繧ィ繝ゥ繝シ縺ョ譎ゅッ縲∽ス輔b縺励↑縺縲 + } + else + { + // #xxxxx: 2017.5.9: from: 縺昴ョ莉悶ョ繧ィ繝ゥ繝シ縺ョ蝣エ蜷医ッ縲√ョ繝舌う繧ケ縺悟、悶&繧後◆縺ィ諠ウ螳壹@縺ヲRemove縺吶k縲 + this.list蜈・蜉帙ョ繝舌う繧ケ.Remove(device); + device.Dispose(); + Trace.TraceError("t繝昴シ繝ェ繝ウ繧ー譎ゅ↓蟇セ雎。device縺梧栢縺九l縺ヲ縺翫j萓句、也匱逕溘ょ酔device繧偵昴シ繝ェ繝ウ繧ー蟇セ雎。縺九iRemove縺励∪縺励◆縲"); + } + } + } + } + } + + #region [ IDisposableシ勤ア ] + //----------------- + public void Dispose() + { + this.Dispose(true); + } + public void Dispose(bool disposeManagedObjects) + { + if (!this.bDisposed貂医∩) + { + if (disposeManagedObjects) + { + foreach (IInputDevice device in this.list蜈・蜉帙ョ繝舌う繧ケ) + { + CInputMIDI tmidi = device as CInputMIDI; + if (tmidi != null) + { + CWin32.midiInStop(tmidi.hMidiIn); + CWin32.midiInReset(tmidi.hMidiIn); + CWin32.midiInClose(tmidi.hMidiIn); + Trace.TraceInformation("MIDI In: [{0}] 繧貞●豁「縺励∪縺励◆縲", new object[] { tmidi.ID }); + } + } + foreach (IInputDevice device2 in this.list蜈・蜉帙ョ繝舌う繧ケ) + { + device2.Dispose(); + } + lock (this.objMidiIn謗剃サ也畑) + { + this.list蜈・蜉帙ョ繝舌う繧ケ.Clear(); + } + + this.directInput.Dispose(); + + //if( this.timer != null ) + //{ + // this.timer.Dispose(); + // this.timer = null; + //} + } + this.bDisposed貂医∩ = true; + } + } + ~CInput邂。逅() + { + this.Dispose(false); + GC.KeepAlive(this); + } + //----------------- + #endregion + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private DirectInput directInput; + private IInputDevice _Keyboard; + private IInputDevice _Mouse; + private bool bDisposed貂医∩; + private List listHMIDIIN = new List(8); + private object objMidiIn謗剃サ也畑 = new object(); + private CWin32.MidiInProc proc; + //private CTimer timer; + + private void MidiInCallback(IntPtr hMidiIn, uint wMsg, IntPtr dwInstance, IntPtr dwParam1, IntPtr dwParam2) + { + int p = (int)dwParam1 & 0xF0; + if (wMsg != CWin32.MIM_DATA || (p != 0x80 && p != 0x90 && p != 0xB0)) + return; + + long time = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾; // lock蜑阪↓蜿門セ励よシ泌・冗畑繧ソ繧、繝槭→蜷後§繧ソ繧、繝槭r菴ソ縺縺薙→縺ァ縲。GM縺ィ隴憺擇縲∝・蜉帙★繧後r髦イ縺舌 + lock (this.objMidiIn謗剃サ也畑) + { + if ((this.list蜈・蜉帙ョ繝舌う繧ケ != null) && (this.list蜈・蜉帙ョ繝舌う繧ケ.Count != 0)) + { + foreach (IInputDevice device in this.list蜈・蜉帙ョ繝舌う繧ケ) + { + CInputMIDI tmidi = device as CInputMIDI; + if ((tmidi != null) && (tmidi.hMidiIn == hMidiIn)) + { + tmidi.t繝。繝繧サ繝シ繧ク縺九iMIDI菫。蜿キ縺ョ縺ソ蜿嶺ソ。(wMsg, dwInstance, dwParam1, dwParam2, time); + break; + } + } + } + } + } + //----------------- + #endregion + } +} diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/DeviceConstantConverter.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/DeviceConstantConverter.cs new file mode 100644 index 00000000..0228a86b --- /dev/null +++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/DeviceConstantConverter.cs @@ -0,0 +1,1666 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; +using SlimDXKeys; + +using WindowsKey = System.Windows.Forms.Keys; +using SlimDXKey = SlimDXKeys.Key; +using SharpDXKey = SharpDX.DirectInput.Key; + +namespace FDK +{ + public class DeviceConstantConverter + { + // 繝。繧ス繝繝 + + public static Key DIKtoKey( int dik ) + { + switch( dik ) + { + case 1: + return Key.Escape; + + case 2: + return Key.D1; + + case 3: + return Key.D2; + + case 4: + return Key.D3; + + case 5: + return Key.D4; + + case 6: + return Key.D5; + + case 7: + return Key.D6; + + case 8: + return Key.D7; + + case 9: + return Key.D8; + + case 10: + return Key.D9; + + case 11: + return Key.D0; + + case 12: + return Key.Minus; + + case 13: + return Key.Equals; + + case 14: + return Key.Backspace; + + case 15: + return Key.Tab; + + case 0x10: + return Key.Q; + + case 0x11: + return Key.W; + + case 0x12: + return Key.E; + + case 0x13: + return Key.R; + + case 20: + return Key.T; + + case 0x15: + return Key.Y; + + case 0x16: + return Key.U; + + case 0x17: + return Key.I; + + case 0x18: + return Key.O; + + case 0x19: + return Key.P; + + case 0x1a: + return Key.LeftBracket; + + case 0x1b: + return Key.RightBracket; + + case 0x1c: + return Key.Return; + + case 0x1d: + return Key.LeftControl; + + case 30: + return Key.A; + + case 0x1f: + return Key.S; + + case 0x20: + return Key.D; + + case 0x21: + return Key.F; + + case 0x22: + return Key.G; + + case 0x23: + return Key.H; + + case 0x24: + return Key.J; + + case 0x25: + return Key.K; + + case 0x26: + return Key.L; + + case 0x27: + return Key.Semicolon; + + case 40: + return Key.Apostrophe; + + case 0x29: + return Key.Grave; + + case 0x2a: + return Key.LeftShift; + + case 0x2b: + return Key.Backslash; + + case 0x2c: + return Key.Z; + + case 0x2d: + return Key.X; + + case 0x2e: + return Key.C; + + case 0x2f: + return Key.V; + + case 0x30: + return Key.B; + + case 0x31: + return Key.N; + + case 50: + return Key.M; + + case 0x33: + return Key.Comma; + + case 0x34: + return Key.Period; + + case 0x35: + return Key.Slash; + + case 0x36: + return Key.RightShift; + + case 0x37: + return Key.NumberPadStar; + + case 0x38: + return Key.LeftAlt; + + case 0x39: + return Key.Space; + + case 0x3a: + return Key.CapsLock; + + case 0x3b: + return Key.F1; + + case 60: + return Key.F2; + + case 0x3d: + return Key.F3; + + case 0x3e: + return Key.F4; + + case 0x3f: + return Key.F5; + + case 0x40: + return Key.F6; + + case 0x41: + return Key.F7; + + case 0x42: + return Key.F8; + + case 0x43: + return Key.F9; + + case 0x44: + return Key.F10; + + case 0x45: + return Key.NumberLock; + + case 70: + return Key.ScrollLock; + + case 0x47: + return Key.NumberPad7; + + case 0x48: + return Key.NumberPad8; + + case 0x49: + return Key.NumberPad9; + + case 0x4a: + return Key.NumberPadMinus; + + case 0x4b: + return Key.NumberPad4; + + case 0x4c: + return Key.NumberPad5; + + case 0x4d: + return Key.NumberPad6; + + case 0x4e: + return Key.NumberPadPlus; + + case 0x4f: + return Key.NumberPad1; + + case 80: + return Key.NumberPad2; + + case 0x51: + return Key.NumberPad3; + + case 0x52: + return Key.NumberPad0; + + case 0x53: + return Key.NumberPadPeriod; + + case 0x56: + return Key.Oem102; + + case 0x57: + return Key.F11; + + case 0x58: + return Key.F12; + + case 100: + return Key.F13; + + case 0x65: + return Key.F14; + + case 0x66: + return Key.F15; + + case 0x70: + return Key.Kana; + + case 0x73: + return Key.AbntC1; + + case 0x79: + return Key.Convert; + + case 0x7b: + return Key.NoConvert; + + case 0x7d: + return Key.Yen; + + case 0x7e: + return Key.AbntC2; + + case 0x8d: + return Key.NumberPadEquals; + + case 0x90: + return Key.PreviousTrack; + + case 0x91: + return Key.AT; + + case 0x92: + return Key.Colon; + + case 0x93: + return Key.Underline; + + case 0x94: + return Key.Kanji; + + case 0x95: + return Key.Stop; + + case 150: + return Key.AX; + + case 0x97: + return Key.Unlabeled; + + case 0x99: + return Key.NextTrack; + + case 0x9c: + return Key.NumberPadEnter; + + case 0x9d: + return Key.RightControl; + + case 160: + return Key.Mute; + + case 0xa1: + return Key.Calculator; + + case 0xa2: + return Key.PlayPause; + + case 0xa4: + return Key.MediaStop; + + case 0xae: + return Key.VolumeDown; + + case 0xb0: + return Key.VolumeUp; + + case 0xb2: + return Key.WebHome; + + case 0xb3: + return Key.NumberPadComma; + + case 0xb5: + return Key.NumberPadSlash; + + case 0xb7: + return Key.PrintScreen; + + case 0xb8: + return Key.RightAlt; + + case 0xc5: + return Key.Pause; + + case 0xc7: + return Key.Home; + + case 200: + return Key.UpArrow; + + case 0xc9: + return Key.PageUp; + + case 0xcb: + return Key.LeftArrow; + + case 0xcd: + return Key.RightArrow; + + case 0xcf: + return Key.End; + + case 0xd0: + return Key.DownArrow; + + case 0xd1: + return Key.PageDown; + + case 210: + return Key.Insert; + + case 0xd3: + return Key.Delete; + + case 0xdb: + return Key.LeftWindowsKey; + + case 220: + return Key.RightWindowsKey; + + case 0xdd: + return Key.Applications; + + case 0xde: + return Key.Power; + + case 0xdf: + return Key.Sleep; + + case 0xe3: + return Key.Wake; + + case 0xe5: + return Key.WebSearch; + + case 230: + return Key.WebFavorites; + + case 0xe7: + return Key.WebRefresh; + + case 0xe8: + return Key.WebStop; + + case 0xe9: + return Key.WebForward; + + case 0xea: + return Key.WebBack; + + case 0xeb: + return Key.MyComputer; + + case 0xec: + return Key.Mail; + + case 0xed: + return Key.MediaSelect; + } + return Key.Unknown; + } + public static int KeyToDIK( Key key ) + { + switch( key ) + { + case Key.D0: + return 11; + + case Key.D1: + return 2; + + case Key.D2: + return 3; + + case Key.D3: + return 4; + + case Key.D4: + return 5; + + case Key.D5: + return 6; + + case Key.D6: + return 7; + + case Key.D7: + return 8; + + case Key.D8: + return 9; + + case Key.D9: + return 10; + + case Key.A: + return 30; + + case Key.B: + return 0x30; + + case Key.C: + return 0x2e; + + case Key.D: + return 0x20; + + case Key.E: + return 0x12; + + case Key.F: + return 0x21; + + case Key.G: + return 0x22; + + case Key.H: + return 0x23; + + case Key.I: + return 0x17; + + case Key.J: + return 0x24; + + case Key.K: + return 0x25; + + case Key.L: + return 0x26; + + case Key.M: + return 50; + + case Key.N: + return 0x31; + + case Key.O: + return 0x18; + + case Key.P: + return 0x19; + + case Key.Q: + return 0x10; + + case Key.R: + return 0x13; + + case Key.S: + return 0x1f; + + case Key.T: + return 20; + + case Key.U: + return 0x16; + + case Key.V: + return 0x2f; + + case Key.W: + return 0x11; + + case Key.X: + return 0x2d; + + case Key.Y: + return 0x15; + + case Key.Z: + return 0x2c; + + case Key.AbntC1: + return 0x73; + + case Key.AbntC2: + return 0x7e; + + case Key.Apostrophe: + return 40; + + case Key.Applications: + return 0xdd; + + case Key.AT: + return 0x91; + + case Key.AX: + return 150; + + case Key.Backspace: + return 14; + + case Key.Backslash: + return 0x2b; + + case Key.Calculator: + return 0xa1; + + case Key.CapsLock: + return 0x3a; + + case Key.Colon: + return 0x92; + + case Key.Comma: + return 0x33; + + case Key.Convert: + return 0x79; + + case Key.Delete: + return 0xd3; + + case Key.DownArrow: + return 0xd0; + + case Key.End: + return 0xcf; + + case Key.Equals: + return 13; + + case Key.Escape: + return 1; + + case Key.F1: + return 0x3b; + + case Key.F2: + return 60; + + case Key.F3: + return 0x3d; + + case Key.F4: + return 0x3e; + + case Key.F5: + return 0x3f; + + case Key.F6: + return 0x40; + + case Key.F7: + return 0x41; + + case Key.F8: + return 0x42; + + case Key.F9: + return 0x43; + + case Key.F10: + return 0x44; + + case Key.F11: + return 0x57; + + case Key.F12: + return 0x58; + + case Key.F13: + return 100; + + case Key.F14: + return 0x65; + + case Key.F15: + return 0x66; + + case Key.Grave: + return 0x29; + + case Key.Home: + return 0xc7; + + case Key.Insert: + return 210; + + case Key.Kana: + return 0x70; + + case Key.Kanji: + return 0x94; + + case Key.LeftBracket: + return 0x1a; + + case Key.LeftControl: + return 0x1d; + + case Key.LeftArrow: + return 0xcb; + + case Key.LeftAlt: + return 0x38; + + case Key.LeftShift: + return 0x2a; + + case Key.LeftWindowsKey: + return 0xdb; + + case Key.Mail: + return 0xec; + + case Key.MediaSelect: + return 0xed; + + case Key.MediaStop: + return 0xa4; + + case Key.Minus: + return 12; + + case Key.Mute: + return 160; + + case Key.MyComputer: + return 0xeb; + + case Key.NextTrack: + return 0x99; + + case Key.NoConvert: + return 0x7b; + + case Key.NumberLock: + return 0x45; + + case Key.NumberPad0: + return 0x52; + + case Key.NumberPad1: + return 0x4f; + + case Key.NumberPad2: + return 80; + + case Key.NumberPad3: + return 0x51; + + case Key.NumberPad4: + return 0x4b; + + case Key.NumberPad5: + return 0x4c; + + case Key.NumberPad6: + return 0x4d; + + case Key.NumberPad7: + return 0x47; + + case Key.NumberPad8: + return 0x48; + + case Key.NumberPad9: + return 0x49; + + case Key.NumberPadComma: + return 0xb3; + + case Key.NumberPadEnter: + return 0x9c; + + case Key.NumberPadEquals: + return 0x8d; + + case Key.NumberPadMinus: + return 0x4a; + + case Key.NumberPadPeriod: + return 0x53; + + case Key.NumberPadPlus: + return 0x4e; + + case Key.NumberPadSlash: + return 0xb5; + + case Key.NumberPadStar: + return 0x37; + + case Key.Oem102: + return 0x56; + + case Key.PageDown: + return 0xd1; + + case Key.PageUp: + return 0xc9; + + case Key.Pause: + return 0xc5; + + case Key.Period: + return 0x34; + + case Key.PlayPause: + return 0xa2; + + case Key.Power: + return 0xde; + + case Key.PreviousTrack: + return 0x90; + + case Key.RightBracket: + return 0x1b; + + case Key.RightControl: + return 0x9d; + + case Key.Return: + return 0x1c; + + case Key.RightArrow: + return 0xcd; + + case Key.RightAlt: + return 0xb8; + + case Key.RightShift: + return 0x36; + + case Key.RightWindowsKey: + return 220; + + case Key.ScrollLock: + return 70; + + case Key.Semicolon: + return 0x27; + + case Key.Slash: + return 0x35; + + case Key.Sleep: + return 0xdf; + + case Key.Space: + return 0x39; + + case Key.Stop: + return 0x95; + + case Key.PrintScreen: + return 0xb7; + + case Key.Tab: + return 15; + + case Key.Underline: + return 0x93; + + case Key.Unlabeled: + return 0x97; + + case Key.UpArrow: + return 200; + + case Key.VolumeDown: + return 0xae; + + case Key.VolumeUp: + return 0xb0; + + case Key.Wake: + return 0xe3; + + case Key.WebBack: + return 0xea; + + case Key.WebFavorites: + return 230; + + case Key.WebForward: + return 0xe9; + + case Key.WebHome: + return 0xb2; + + case Key.WebRefresh: + return 0xe7; + + case Key.WebSearch: + return 0xe5; + + case Key.WebStop: + return 0xe8; + + case Key.Yen: + return 0x7d; + } + return 0; + } + public static Keys KeyToKeyCode(SlimDXKey key) + { + switch ( key ) + { + case Key.D0: + return Keys.D0; + + case Key.D1: + return Keys.D1; + + case Key.D2: + return Keys.D2; + + case Key.D3: + return Keys.D3; + + case Key.D4: + return Keys.D4; + + case Key.D5: + return Keys.D5; + + case Key.D6: + return Keys.D6; + + case Key.D7: + return Keys.D7; + + case Key.D8: + return Keys.D8; + + case Key.D9: + return Keys.D9; + + case Key.A: + return Keys.A; + + case Key.B: + return Keys.B; + + case Key.C: + return Keys.C; + + case Key.D: + return Keys.D; + + case Key.E: + return Keys.E; + + case Key.F: + return Keys.F; + + case Key.G: + return Keys.G; + + case Key.H: + return Keys.H; + + case Key.I: + return Keys.I; + + case Key.J: + return Keys.J; + + case Key.K: + return Keys.K; + + case Key.L: + return Keys.L; + + case Key.M: + return Keys.M; + + case Key.N: + return Keys.N; + + case Key.O: + return Keys.O; + + case Key.P: + return Keys.P; + + case Key.Q: + return Keys.Q; + + case Key.R: + return Keys.R; + + case Key.S: + return Keys.S; + + case Key.T: + return Keys.T; + + case Key.U: + return Keys.U; + + case Key.V: + return Keys.V; + + case Key.W: + return Keys.W; + + case Key.X: + return Keys.X; + + case Key.Y: + return Keys.Y; + + case Key.Z: + return Keys.Z; + +// case Key.AbntC1: +// return Keys.A; //0x73; + //147 +// case Key.AbntC2: +// return Keys.A; //0x7e; + +// case Key.Apostrophe: +// return Keys.A; /// + + case Key.Applications: + return Keys.Apps; + + case Key.AT: + return Keys.Oem3; + +// case Key.AX: +// return Keys.A; /// + + case Key.Backspace: + return Keys.Back; + + case Key.Backslash: + return Keys.Oem5; + +// case Key.Calculator: +// return Keys.A; /// + + case Key.CapsLock: + return Keys.CapsLock; + + case Key.Colon: + return Keys.Oem1; + + case Key.Comma: + return Keys.Oemcomma; + + case Key.Convert: + return Keys.IMEConvert; + + case Key.Delete: + return Keys.Delete; + + case Key.DownArrow: + return Keys.Down; + + case Key.End: + return Keys.End; + + case Key.Equals: + return Keys.A; /// + + case Key.Escape: + return Keys.Escape; + + case Key.F1: + return Keys.F1; + + case Key.F2: + return Keys.F2; + + case Key.F3: + return Keys.F3; + + case Key.F4: + return Keys.F4; + + case Key.F5: + return Keys.F5; + + case Key.F6: + return Keys.F6; + + case Key.F7: + return Keys.F7; + + case Key.F8: + return Keys.F8; + + case Key.F9: + return Keys.F9; + + case Key.F10: + return Keys.F10; + + case Key.F11: + return Keys.F11; + + case Key.F12: + return Keys.F12; + + case Key.F13: + return Keys.F13; + + case Key.F14: + return Keys.F14; + + case Key.F15: + return Keys.F15; + + case Key.Grave: + return Keys.A; /// + + case Key.Home: + return Keys.Home; + + case Key.Insert: + return Keys.Insert; + + case Key.Kana: + return Keys.KanaMode; + + case Key.Kanji: + return Keys.KanjiMode; + + case Key.LeftBracket: + return Keys.Oem4; + + case Key.LeftControl: + return Keys.LControlKey; + + case Key.LeftArrow: + return Keys.Left; + + case Key.LeftAlt: + return Keys.LMenu; + + case Key.LeftShift: + return Keys.LShiftKey; + + case Key.LeftWindowsKey: + return Keys.LWin; + + case Key.Mail: + return Keys.LaunchMail; + + case Key.MediaSelect: + return Keys.SelectMedia; + + case Key.MediaStop: + return Keys.MediaStop; + + case Key.Minus: + return Keys.OemMinus; + + case Key.Mute: + return Keys.VolumeMute; + + case Key.MyComputer: /// + return Keys.A; + + case Key.NextTrack: + return Keys.MediaNextTrack; + + case Key.NoConvert: + return Keys.IMENonconvert; + + case Key.NumberLock: + return Keys.NumLock; + + case Key.NumberPad0: + return Keys.NumPad0; + + case Key.NumberPad1: + return Keys.NumPad1; + + case Key.NumberPad2: + return Keys.NumPad2; + + case Key.NumberPad3: + return Keys.NumPad3; + + case Key.NumberPad4: + return Keys.NumPad4; + + case Key.NumberPad5: + return Keys.NumPad5; + + case Key.NumberPad6: + return Keys.NumPad6; + + case Key.NumberPad7: + return Keys.NumPad7; + + case Key.NumberPad8: + return Keys.NumPad8; + + case Key.NumberPad9: + return Keys.NumPad9; + + case Key.NumberPadComma: + return Keys.Separator; + + case Key.NumberPadEnter: + return Keys.A; // + + case Key.NumberPadEquals: + return Keys.A; // + + case Key.NumberPadMinus: + return Keys.Subtract; + + case Key.NumberPadPeriod: + return Keys.Decimal; + + case Key.NumberPadPlus: + return Keys.Add; + + case Key.NumberPadSlash: + return Keys.Divide; + + case Key.NumberPadStar: + return Keys.Multiply; // + + case Key.Oem102: + return Keys.Oem102; + + case Key.PageDown: + return Keys.PageDown; + + case Key.PageUp: + return Keys.PageUp; + + case Key.Pause: + return Keys.Pause; + + case Key.Period: + return Keys.OemPeriod; + + case Key.PlayPause: + return Keys.MediaPlayPause; + + case Key.Power: + return Keys.A; /// + + case Key.PreviousTrack: + return Keys.MediaPreviousTrack; + + case Key.RightBracket: + return Keys.Oem6; + + case Key.RightControl: + return Keys.RControlKey; + + case Key.Return: + return Keys.Return; + + case Key.RightArrow: + return Keys.Right; + + case Key.RightAlt: + return Keys.RMenu; + + case Key.RightShift: + return Keys.A; + + case Key.RightWindowsKey: + return Keys.RWin; + + case Key.ScrollLock: + return Keys.Scroll; + + case Key.Semicolon: + return Keys.Oemplus; ///?? + + case Key.Slash: + return Keys.Oem2; + + case Key.Sleep: + return Keys.Sleep; + + case Key.Space: + return Keys.Space; + + case Key.Stop: + return Keys.MediaStop; + + case Key.PrintScreen: + return Keys.PrintScreen; + + case Key.Tab: + return Keys.Tab; + + case Key.Underline: + return Keys.Oem102; + +// case Key.Unlabeled: /// +// return Keys.A; + + case Key.UpArrow: + return Keys.Up; + + case Key.VolumeDown: + return Keys.VolumeDown; + + case Key.VolumeUp: + return Keys.VolumeUp; + + case Key.Wake: + return Keys.A; /// + + case Key.WebBack: + return Keys.BrowserBack; + + case Key.WebFavorites: + return Keys.BrowserFavorites; + + case Key.WebForward: + return Keys.BrowserForward; + + case Key.WebHome: + return Keys.BrowserHome; + + case Key.WebRefresh: + return Keys.BrowserRefresh; + + case Key.WebSearch: + return Keys.BrowserSearch; + + case Key.WebStop: + return Keys.BrowserStop; + + case Key.Yen: + return Keys.OemBackslash; + } + return 0; + } + + /// + /// 蟇セ蠢懊☆繧句、縺後↑縺代l縺ー SlimDX.DirectInput.Unknown 繧定ソ斐☆縲 + /// + public static SlimDXKey DIKtoKey(SharpDXKey key) + { + if (_DIKtoKey.ContainsKey(key)) + { + return _DIKtoKey[key]; + } + else + { + return SlimDXKey.Unknown; + } + } + + /// + /// 蟇セ蠢懊☆繧句、縺後↑縺代l縺ー System.Windows.Forms.Keys.None 繧定ソ斐☆縲 + /// + public static WindowsKey KeyToKeys(SlimDXKey key) + { + if (_KeyToKeys.ContainsKey(key)) + { + return _KeyToKeys[key]; + } + else + { + return WindowsKey.None; + } + } + + + /// + /// DIK (SharpDX.DirectInput.Key) 縺九i SlimDX.DirectInput.Key 縺ク縺ョ螟画鋤陦ィ縲 + /// + private static readonly Dictionary _DIKtoKey = new Dictionary() { + #region [ *** ] + { SharpDXKey.Unknown, SlimDXKey.Unknown }, + { SharpDXKey.Escape, SlimDXKey.Escape }, + { SharpDXKey.D1, SlimDXKey.D1 }, + { SharpDXKey.D2, SlimDXKey.D2 }, + { SharpDXKey.D3, SlimDXKey.D3 }, + { SharpDXKey.D4, SlimDXKey.D4 }, + { SharpDXKey.D5, SlimDXKey.D5 }, + { SharpDXKey.D6, SlimDXKey.D6 }, + { SharpDXKey.D7, SlimDXKey.D7 }, + { SharpDXKey.D8, SlimDXKey.D8 }, + { SharpDXKey.D9, SlimDXKey.D9 }, + { SharpDXKey.D0, SlimDXKey.D0 }, + { SharpDXKey.Minus, SlimDXKey.Minus }, + { SharpDXKey.Equals, SlimDXKey.Equals }, + { SharpDXKey.Back, SlimDXKey.Backspace }, + { SharpDXKey.Tab, SlimDXKey.Tab }, + { SharpDXKey.Q, SlimDXKey.Q }, + { SharpDXKey.W, SlimDXKey.W }, + { SharpDXKey.E, SlimDXKey.E }, + { SharpDXKey.R, SlimDXKey.R }, + { SharpDXKey.T, SlimDXKey.T }, + { SharpDXKey.Y, SlimDXKey.Y }, + { SharpDXKey.U, SlimDXKey.U }, + { SharpDXKey.I, SlimDXKey.I }, + { SharpDXKey.O, SlimDXKey.O }, + { SharpDXKey.P, SlimDXKey.P }, + { SharpDXKey.LeftBracket, SlimDXKey.LeftBracket }, + { SharpDXKey.RightBracket, SlimDXKey.RightBracket }, + { SharpDXKey.Return, SlimDXKey.Return }, + { SharpDXKey.LeftControl, SlimDXKey.LeftControl }, + { SharpDXKey.A, SlimDXKey.A }, + { SharpDXKey.S, SlimDXKey.S }, + { SharpDXKey.D, SlimDXKey.D }, + { SharpDXKey.F, SlimDXKey.F }, + { SharpDXKey.G, SlimDXKey.G }, + { SharpDXKey.H, SlimDXKey.H }, + { SharpDXKey.J, SlimDXKey.J }, + { SharpDXKey.K, SlimDXKey.K }, + { SharpDXKey.L, SlimDXKey.L }, + { SharpDXKey.Semicolon, SlimDXKey.Semicolon }, + { SharpDXKey.Apostrophe, SlimDXKey.Apostrophe }, + { SharpDXKey.Grave, SlimDXKey.Grave }, + { SharpDXKey.LeftShift, SlimDXKey.LeftShift }, + { SharpDXKey.Backslash, SlimDXKey.Backslash }, + { SharpDXKey.Z, SlimDXKey.Z }, + { SharpDXKey.X, SlimDXKey.X }, + { SharpDXKey.C, SlimDXKey.C }, + { SharpDXKey.V, SlimDXKey.V }, + { SharpDXKey.B, SlimDXKey.B }, + { SharpDXKey.N, SlimDXKey.N }, + { SharpDXKey.M, SlimDXKey.M }, + { SharpDXKey.Comma, SlimDXKey.Comma }, + { SharpDXKey.Period, SlimDXKey.Period }, + { SharpDXKey.Slash, SlimDXKey.Slash }, + { SharpDXKey.RightShift, SlimDXKey.RightShift }, + { SharpDXKey.Multiply, SlimDXKey.NumberPadStar }, + { SharpDXKey.LeftAlt, SlimDXKey.LeftAlt }, + { SharpDXKey.Space, SlimDXKey.Space }, + { SharpDXKey.Capital, SlimDXKey.CapsLock }, + { SharpDXKey.F1, SlimDXKey.F1 }, + { SharpDXKey.F2, SlimDXKey.F2 }, + { SharpDXKey.F3, SlimDXKey.F3 }, + { SharpDXKey.F4, SlimDXKey.F4 }, + { SharpDXKey.F5, SlimDXKey.F5 }, + { SharpDXKey.F6, SlimDXKey.F6 }, + { SharpDXKey.F7, SlimDXKey.F7 }, + { SharpDXKey.F8, SlimDXKey.F8 }, + { SharpDXKey.F9, SlimDXKey.F9 }, + { SharpDXKey.F10, SlimDXKey.F10 }, + { SharpDXKey.NumberLock, SlimDXKey.NumberLock }, + { SharpDXKey.ScrollLock, SlimDXKey.ScrollLock }, + { SharpDXKey.NumberPad7, SlimDXKey.NumberPad7 }, + { SharpDXKey.NumberPad8, SlimDXKey.NumberPad8 }, + { SharpDXKey.NumberPad9, SlimDXKey.NumberPad9 }, + { SharpDXKey.Subtract, SlimDXKey.NumberPadMinus }, + { SharpDXKey.NumberPad4, SlimDXKey.NumberPad4 }, + { SharpDXKey.NumberPad5, SlimDXKey.NumberPad5 }, + { SharpDXKey.NumberPad6, SlimDXKey.NumberPad6 }, + { SharpDXKey.Add, SlimDXKey.NumberPadPlus }, + { SharpDXKey.NumberPad1, SlimDXKey.NumberPad1 }, + { SharpDXKey.NumberPad2, SlimDXKey.NumberPad2 }, + { SharpDXKey.NumberPad3, SlimDXKey.NumberPad3 }, + { SharpDXKey.NumberPad0, SlimDXKey.NumberPad0 }, + { SharpDXKey.Decimal, SlimDXKey.NumberPadPeriod }, + { SharpDXKey.Oem102, SlimDXKey.Oem102 }, + { SharpDXKey.F11, SlimDXKey.F11 }, + { SharpDXKey.F12, SlimDXKey.F12 }, + { SharpDXKey.F13, SlimDXKey.F13 }, + { SharpDXKey.F14, SlimDXKey.F14 }, + { SharpDXKey.F15, SlimDXKey.F15 }, + { SharpDXKey.Kana, SlimDXKey.Kana }, + { SharpDXKey.AbntC1, SlimDXKey.AbntC1 }, + { SharpDXKey.Convert, SlimDXKey.Convert }, + { SharpDXKey.NoConvert, SlimDXKey.NoConvert }, + { SharpDXKey.Yen, SlimDXKey.Yen }, + { SharpDXKey.AbntC2, SlimDXKey.AbntC2 }, + { SharpDXKey.NumberPadEquals, SlimDXKey.NumberPadEquals }, + { SharpDXKey.PreviousTrack, SlimDXKey.PreviousTrack }, + { SharpDXKey.AT, SlimDXKey.AT }, + { SharpDXKey.Colon, SlimDXKey.Colon }, + { SharpDXKey.Underline, SlimDXKey.Underline }, + { SharpDXKey.Kanji, SlimDXKey.Kanji }, + { SharpDXKey.Stop, SlimDXKey.Stop }, + { SharpDXKey.AX, SlimDXKey.AX }, + { SharpDXKey.Unlabeled, SlimDXKey.Unlabeled }, + { SharpDXKey.NextTrack, SlimDXKey.NextTrack }, + { SharpDXKey.NumberPadEnter, SlimDXKey.NumberPadEnter }, + { SharpDXKey.RightControl, SlimDXKey.RightControl }, + { SharpDXKey.Mute, SlimDXKey.Mute }, + { SharpDXKey.Calculator, SlimDXKey.Calculator }, + { SharpDXKey.PlayPause, SlimDXKey.PlayPause }, + { SharpDXKey.MediaStop, SlimDXKey.MediaStop }, + { SharpDXKey.VolumeDown, SlimDXKey.VolumeDown }, + { SharpDXKey.VolumeUp, SlimDXKey.VolumeUp }, + { SharpDXKey.WebHome, SlimDXKey.WebHome }, + { SharpDXKey.PrintScreen, SlimDXKey.PrintScreen }, + { SharpDXKey.RightAlt, SlimDXKey.RightAlt }, + { SharpDXKey.Pause, SlimDXKey.Pause }, + { SharpDXKey.Home, SlimDXKey.Home }, + { SharpDXKey.Up, SlimDXKey.UpArrow }, + { SharpDXKey.PageUp, SlimDXKey.PageUp }, + { SharpDXKey.Left, SlimDXKey.LeftArrow }, + { SharpDXKey.Right, SlimDXKey.RightArrow }, + { SharpDXKey.End, SlimDXKey.End }, + { SharpDXKey.Down, SlimDXKey.DownArrow }, + { SharpDXKey.PageDown, SlimDXKey.PageDown }, + { SharpDXKey.Insert, SlimDXKey.Insert }, + { SharpDXKey.Delete, SlimDXKey.Delete }, + { SharpDXKey.LeftWindowsKey, SlimDXKey.LeftWindowsKey }, + { SharpDXKey.RightWindowsKey, SlimDXKey.RightWindowsKey }, + { SharpDXKey.Applications, SlimDXKey.Applications }, + { SharpDXKey.Power, SlimDXKey.Power }, + { SharpDXKey.Sleep, SlimDXKey.Sleep }, + { SharpDXKey.Wake, SlimDXKey.Wake }, + { SharpDXKey.WebSearch, SlimDXKey.WebSearch }, + { SharpDXKey.WebFavorites, SlimDXKey.WebFavorites }, + { SharpDXKey.WebRefresh, SlimDXKey.WebRefresh }, + { SharpDXKey.WebStop, SlimDXKey.WebStop }, + { SharpDXKey.WebForward, SlimDXKey.WebForward }, + { SharpDXKey.WebBack, SlimDXKey.WebBack }, + { SharpDXKey.MyComputer, SlimDXKey.MyComputer }, + { SharpDXKey.Mail, SlimDXKey.Mail }, + { SharpDXKey.MediaSelect, SlimDXKey.MediaSelect }, + #endregion + }; + + /// + /// SlimDX.DirectInput.Key 縺九i System.Windows.Form.Keys 縺ク縺ョ螟画鋤陦ィ縲 + /// + private static readonly Dictionary _KeyToKeys = new Dictionary() { + #region [ *** ] + { SlimDXKey.D0, WindowsKey.D0 }, + { SlimDXKey.D1, WindowsKey.D1 }, + { SlimDXKey.D2, WindowsKey.D2 }, + { SlimDXKey.D3, WindowsKey.D3 }, + { SlimDXKey.D4, WindowsKey.D4 }, + { SlimDXKey.D5, WindowsKey.D5 }, + { SlimDXKey.D6, WindowsKey.D6 }, + { SlimDXKey.D7, WindowsKey.D7 }, + { SlimDXKey.D8, WindowsKey.D8 }, + { SlimDXKey.D9, WindowsKey.D9 }, + { SlimDXKey.A, WindowsKey.A }, + { SlimDXKey.B, WindowsKey.B }, + { SlimDXKey.C, WindowsKey.C }, + { SlimDXKey.D, WindowsKey.D }, + { SlimDXKey.E, WindowsKey.E }, + { SlimDXKey.F, WindowsKey.F }, + { SlimDXKey.G, WindowsKey.G }, + { SlimDXKey.H, WindowsKey.H }, + { SlimDXKey.I, WindowsKey.I }, + { SlimDXKey.J, WindowsKey.J }, + { SlimDXKey.K, WindowsKey.K }, + { SlimDXKey.L, WindowsKey.L }, + { SlimDXKey.M, WindowsKey.M }, + { SlimDXKey.N, WindowsKey.N }, + { SlimDXKey.O, WindowsKey.O }, + { SlimDXKey.P, WindowsKey.P }, + { SlimDXKey.Q, WindowsKey.Q }, + { SlimDXKey.R, WindowsKey.R }, + { SlimDXKey.S, WindowsKey.S }, + { SlimDXKey.T, WindowsKey.T }, + { SlimDXKey.U, WindowsKey.U }, + { SlimDXKey.V, WindowsKey.V }, + { SlimDXKey.W, WindowsKey.W }, + { SlimDXKey.X, WindowsKey.X }, + { SlimDXKey.Y, WindowsKey.Y }, + { SlimDXKey.Z, WindowsKey.Z }, + //{ SlimDXKey.AbntC1, WindowsKey.A }, + //{ SlimDXKey.AbntC2, WindowsKey.A }, + { SlimDXKey.Apostrophe, WindowsKey.OemQuotes }, + { SlimDXKey.Applications, WindowsKey.Apps }, + { SlimDXKey.AT, WindowsKey.Oem3 }, // OemTilde 縺ィ蜷悟、 + //{ SlimDXKey.AX, WindowsKey.A }, // OemAX (225) 縺ッ譛ェ螳夂セゥ + { SlimDXKey.Backspace, WindowsKey.Back }, + { SlimDXKey.Backslash, WindowsKey.OemBackslash }, + //{ SlimDXKey.Calculator, WindowsKey.A }, + { SlimDXKey.CapsLock, WindowsKey.CapsLock }, + { SlimDXKey.Colon, WindowsKey.Oem1 }, + { SlimDXKey.Comma, WindowsKey.Oemcomma }, + { SlimDXKey.Convert, WindowsKey.IMEConvert }, + { SlimDXKey.Delete, WindowsKey.Delete }, + { SlimDXKey.DownArrow, WindowsKey.Down }, + { SlimDXKey.End, WindowsKey.End }, + { SlimDXKey.Equals, WindowsKey.A }, // ? + { SlimDXKey.Escape, WindowsKey.Escape }, + { SlimDXKey.F1, WindowsKey.F1 }, + { SlimDXKey.F2, WindowsKey.F2 }, + { SlimDXKey.F3, WindowsKey.F3 }, + { SlimDXKey.F4, WindowsKey.F4 }, + { SlimDXKey.F5, WindowsKey.F5 }, + { SlimDXKey.F6, WindowsKey.F6 }, + { SlimDXKey.F7, WindowsKey.F7 }, + { SlimDXKey.F8, WindowsKey.F8 }, + { SlimDXKey.F9, WindowsKey.F9 }, + { SlimDXKey.F10, WindowsKey.F10 }, + { SlimDXKey.F11, WindowsKey.F11 }, + { SlimDXKey.F12, WindowsKey.F12 }, + { SlimDXKey.F13, WindowsKey.F13 }, + { SlimDXKey.F14, WindowsKey.F14 }, + { SlimDXKey.F15, WindowsKey.F15 }, + { SlimDXKey.Grave, WindowsKey.A }, // ? + { SlimDXKey.Home, WindowsKey.Home }, + { SlimDXKey.Insert, WindowsKey.Insert }, + { SlimDXKey.Kana, WindowsKey.KanaMode }, + { SlimDXKey.Kanji, WindowsKey.KanjiMode }, + { SlimDXKey.LeftBracket, WindowsKey.Oem4 }, + { SlimDXKey.LeftControl, WindowsKey.LControlKey }, + { SlimDXKey.LeftArrow, WindowsKey.Left }, + { SlimDXKey.LeftAlt, WindowsKey.LMenu }, + { SlimDXKey.LeftShift, WindowsKey.LShiftKey }, + { SlimDXKey.LeftWindowsKey, WindowsKey.LWin }, + { SlimDXKey.Mail, WindowsKey.LaunchMail }, + { SlimDXKey.MediaSelect, WindowsKey.SelectMedia }, + { SlimDXKey.MediaStop, WindowsKey.MediaStop }, + { SlimDXKey.Minus, WindowsKey.OemMinus }, + { SlimDXKey.Mute, WindowsKey.VolumeMute }, + { SlimDXKey.MyComputer, WindowsKey.A }, // ? + { SlimDXKey.NextTrack, WindowsKey.MediaNextTrack }, + { SlimDXKey.NoConvert, WindowsKey.IMENonconvert }, + { SlimDXKey.NumberLock, WindowsKey.NumLock }, + { SlimDXKey.NumberPad0, WindowsKey.NumPad0 }, + { SlimDXKey.NumberPad1, WindowsKey.NumPad1 }, + { SlimDXKey.NumberPad2, WindowsKey.NumPad2 }, + { SlimDXKey.NumberPad3, WindowsKey.NumPad3 }, + { SlimDXKey.NumberPad4, WindowsKey.NumPad4 }, + { SlimDXKey.NumberPad5, WindowsKey.NumPad5 }, + { SlimDXKey.NumberPad6, WindowsKey.NumPad6 }, + { SlimDXKey.NumberPad7, WindowsKey.NumPad7 }, + { SlimDXKey.NumberPad8, WindowsKey.NumPad8 }, + { SlimDXKey.NumberPad9, WindowsKey.NumPad9 }, + { SlimDXKey.NumberPadComma, WindowsKey.Separator }, + { SlimDXKey.NumberPadEnter, WindowsKey.A }, // ? + { SlimDXKey.NumberPadEquals, WindowsKey.A }, // ? + { SlimDXKey.NumberPadMinus, WindowsKey.Subtract }, + { SlimDXKey.NumberPadPeriod, WindowsKey.Decimal }, + { SlimDXKey.NumberPadPlus, WindowsKey.Add }, + { SlimDXKey.NumberPadSlash, WindowsKey.Divide }, + { SlimDXKey.NumberPadStar, WindowsKey.Multiply }, + { SlimDXKey.Oem102, WindowsKey.Oem102 }, + { SlimDXKey.PageDown, WindowsKey.PageDown }, + { SlimDXKey.PageUp, WindowsKey.PageUp }, + { SlimDXKey.Pause, WindowsKey.Pause }, + { SlimDXKey.Period, WindowsKey.OemPeriod }, + { SlimDXKey.PlayPause, WindowsKey.MediaPlayPause }, + { SlimDXKey.Power, WindowsKey.A }, // ? + { SlimDXKey.PreviousTrack, WindowsKey.MediaPreviousTrack }, + { SlimDXKey.RightBracket, WindowsKey.Oem6 }, + { SlimDXKey.RightControl, WindowsKey.RControlKey }, + { SlimDXKey.Return, WindowsKey.Return }, + { SlimDXKey.RightArrow, WindowsKey.Right }, + { SlimDXKey.RightAlt, WindowsKey.RMenu }, + { SlimDXKey.RightShift, WindowsKey.A }, // ? + { SlimDXKey.RightWindowsKey, WindowsKey.RWin }, + { SlimDXKey.ScrollLock, WindowsKey.Scroll }, + { SlimDXKey.Semicolon, WindowsKey.Oemplus }, // OemSemicolon 縺倥c縺ェ縺上※シ + { SlimDXKey.Slash, WindowsKey.Oem2 }, + { SlimDXKey.Sleep, WindowsKey.Sleep }, + { SlimDXKey.Space, WindowsKey.Space }, + { SlimDXKey.Stop, WindowsKey.MediaStop }, + { SlimDXKey.PrintScreen, WindowsKey.PrintScreen }, + { SlimDXKey.Tab, WindowsKey.Tab }, + { SlimDXKey.Underline, WindowsKey.Oem102 }, + //{ SlimDXKey.Unlabeled, WindowsKey.A }, // ? + { SlimDXKey.UpArrow, WindowsKey.Up }, + { SlimDXKey.VolumeDown, WindowsKey.VolumeDown }, + { SlimDXKey.VolumeUp, WindowsKey.VolumeUp }, + { SlimDXKey.Wake, WindowsKey.A }, // ? + { SlimDXKey.WebBack, WindowsKey.BrowserBack }, + { SlimDXKey.WebFavorites, WindowsKey.BrowserFavorites }, + { SlimDXKey.WebForward, WindowsKey.BrowserForward }, + { SlimDXKey.WebHome, WindowsKey.BrowserHome }, + { SlimDXKey.WebRefresh, WindowsKey.BrowserRefresh }, + { SlimDXKey.WebSearch, WindowsKey.BrowserSearch }, + { SlimDXKey.WebStop, WindowsKey.BrowserStop }, + { SlimDXKey.Yen, WindowsKey.OemBackslash }, + #endregion + }; + } +} diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.cs new file mode 100644 index 00000000..2109b159 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.cs @@ -0,0 +1,17 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; + +namespace FDK +{ + // 螳壽焚 + + public enum E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ + { + Keyboard, + Mouse, + Joystick, + MidiIn, + Unknown + } +} diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/IInputDevice.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/IInputDevice.cs new file mode 100644 index 00000000..7b42faa4 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/IInputDevice.cs @@ -0,0 +1,37 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; + +namespace FDK +{ + public interface IInputDevice : IDisposable + { + // 繝励Ο繝代ユ繧」 + + E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ + { + get; + } + string GUID + { + get; + } + int ID + { + get; + } + List list蜈・蜉帙う繝吶Φ繝 + { + get; + } + + + // 繝。繧ス繝繝峨う繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ + + void t繝昴シ繝ェ繝ウ繧ー( bool bWindow縺後い繧ッ繝繧」繝紋クュ, bool b繝舌ャ繝輔ぃ蜈・蜉帙r菴ソ逕ィ縺吶k ); + bool b繧ュ繝シ縺梧款縺輔l縺( int nKey ); + bool b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( int nKey ); + bool b繧ュ繝シ縺碁屬縺輔l縺( int nKey ); + bool b繧ュ繝シ縺碁屬縺輔l縺ヲ縺繧( int nKey ); + } +} diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/STInputEvent.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/STInputEvent.cs new file mode 100644 index 00000000..1903df4f --- /dev/null +++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/STInputEvent.cs @@ -0,0 +1,19 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; + +namespace FDK +{ + // 讒矩菴 + + [StructLayout( LayoutKind.Sequential )] + public struct STInputEvent + { + public int nKey { get; set; } + public bool b謚シ縺輔l縺 { get; set; } + public bool b髮「縺輔l縺 { get; set; } + public long nTimeStamp { get; set; } + public int nVelocity { get; set; } + } +} diff --git a/FDK19/繧ウ繝シ繝/02.蜈・蜉/SlimDXKeys.cs b/FDK19/繧ウ繝シ繝/02.蜈・蜉/SlimDXKeys.cs new file mode 100644 index 00000000..3a876285 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/02.蜈・蜉/SlimDXKeys.cs @@ -0,0 +1,171 @@ +サソusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SlimDXKeys +{ + public enum Key + { + D0 = 0, + D1 = 1, + D2 = 2, + D3 = 3, + D4 = 4, + D5 = 5, + D6 = 6, + D7 = 7, + D8 = 8, + D9 = 9, + A = 10, + B = 11, + C = 12, + D = 13, + E = 14, + F = 15, + G = 16, + H = 17, + I = 18, + J = 19, + K = 20, + L = 21, + M = 22, + N = 23, + O = 24, + P = 25, + Q = 26, + R = 27, + S = 28, + T = 29, + U = 30, + V = 31, + W = 32, + X = 33, + Y = 34, + Z = 35, + AbntC1 = 36, + AbntC2 = 37, + Apostrophe = 38, + Applications = 39, + AT = 40, + AX = 41, + Backspace = 42, + Backslash = 43, + Calculator = 44, + CapsLock = 45, + Colon = 46, + Comma = 47, + Convert = 48, + Delete = 49, + DownArrow = 50, + End = 51, + Equals = 52, + Escape = 53, + F1 = 54, + F2 = 55, + F3 = 56, + F4 = 57, + F5 = 58, + F6 = 59, + F7 = 60, + F8 = 61, + F9 = 62, + F10 = 63, + F11 = 64, + F12 = 65, + F13 = 66, + F14 = 67, + F15 = 68, + Grave = 69, + Home = 70, + Insert = 71, + Kana = 72, + Kanji = 73, + LeftBracket = 74, + LeftControl = 75, + LeftArrow = 76, + LeftAlt = 77, + LeftShift = 78, + LeftWindowsKey = 79, + Mail = 80, + MediaSelect = 81, + MediaStop = 82, + Minus = 83, + Mute = 84, + MyComputer = 85, + NextTrack = 86, + NoConvert = 87, + NumberLock = 88, + NumberPad0 = 89, + NumberPad1 = 90, + NumberPad2 = 91, + NumberPad3 = 92, + NumberPad4 = 93, + NumberPad5 = 94, + NumberPad6 = 95, + NumberPad7 = 96, + NumberPad8 = 97, + NumberPad9 = 98, + NumberPadComma = 99, + NumberPadEnter = 100, + NumberPadEquals = 101, + NumberPadMinus = 102, + NumberPadPeriod = 103, + NumberPadPlus = 104, + NumberPadSlash = 105, + NumberPadStar = 106, + Oem102 = 107, + PageDown = 108, + PageUp = 109, + Pause = 110, + Period = 111, + PlayPause = 112, + Power = 113, + PreviousTrack = 114, + RightBracket = 115, + RightControl = 116, + Return = 117, + RightArrow = 118, + RightAlt = 119, + RightShift = 120, + RightWindowsKey = 121, + ScrollLock = 122, + Semicolon = 123, + Slash = 124, + Sleep = 125, + Space = 126, + Stop = 127, + PrintScreen = 128, + Tab = 129, + Underline = 130, + Unlabeled = 131, + UpArrow = 132, + VolumeDown = 133, + VolumeUp = 134, + Wake = 135, + WebBack = 136, + WebFavorites = 137, + WebForward = 138, + WebHome = 139, + WebRefresh = 140, + WebSearch = 141, + WebStop = 142, + Yen = 143, + Unknown = 144 + } + public enum MouseObject + { + Button1 = 0, + Button2 = 1, + Button3 = 2, + Button4 = 3, + Button5 = 4, + Button6 = 5, + Button7 = 6, + Button8 = 7, + XAxis = 8, + YAxis = 9, + ZAxis = 10 + } +} \ No newline at end of file diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSound.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSound.cs new file mode 100644 index 00000000..ba66b6fc --- /dev/null +++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSound.cs @@ -0,0 +1,2052 @@ +using System; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.IO; +using System.Linq; +using System.Threading; +using FDK.ExtensionMethods; +using SharpDX.DirectSound; +using SharpDX.Multimedia; +using Un4seen.Bass; +using Un4seen.BassAsio; +using Un4seen.BassWasapi; +using Un4seen.Bass.AddOn.Mix; +using Un4seen.Bass.AddOn.Fx; + + +namespace FDK +{ + #region [ DTXMania逕ィ諡。蠑オ ] + public class CSound邂。逅 // : CSound + { + private static ISoundDevice SoundDevice + { + get; set; + } + private static ESoundDeviceType SoundDeviceType + { + get; set; + } + public static CSoundTimer rc貍泌・冗畑繧ソ繧、繝 = null; + public static bool bUseOSTimer = false; // OS縺ョ繧ソ繧、繝槭シ繧剃スソ縺縺九,SoundTimer繧剃スソ縺縺九DTXC縺ァ縺ッfalse, DTXMania縺ァ縺ッtrue縲 + // DTXC(DirectSound)縺ァCSoundTimer繧剃スソ縺縺ィ縲∝驛ィ縺ァ辟。髻ウ縺ョ繝ォ繝シ繝励し繧ヲ繝ウ繝峨r蜀咲函縺吶k縺溘a + // 繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ繧貞頃譛峨@縺ヲ縺励∪縺縲〃iewer縺ィ縺励※蜻シ縺ウ蜃コ縺輔l繧汽TXMania縺ァ縲、SIO縺御スソ縺医↑縺上↑繧九 + + // DTXMania蜊倅ス薙〒縺薙l繧稚rue縺ォ縺吶k縺ィ縲仝ASAPI/ASIO譎ゅ↓貍泌・上ち繧、繝槭シ縺ィ縺励※FDK繧ソ繧、繝槭シ縺ァ縺ッ縺ェ縺 + // 繧キ繧ケ繝繝縺ョ繧ソ繧、繝槭シ繧剃スソ縺繧医≧縺ォ縺ェ繧九ゅ%縺縺吶k縺ィ繧ケ繧ッ繝ュ繝シ繝ォ縺ッ貊代i縺九↓縺ェ繧九′縲髻ウ繧コ繝ャ縺悟コ繧九°繧ゅ@繧後↑縺縲 + + public static IntPtr WindowHandle; + + public static bool bIsTimeStretch = false; + + private static int _nMasterVolume; + public int nMasterVolume + { + get + { + return _nMasterVolume; + } + //get + //{ + // if ( SoundDeviceType == ESoundDeviceType.ExclusiveWASAPI || SoundDeviceType == ESoundDeviceType.ASIO ) + // { + // return Bass.BASS_GetConfig(BASSConfig.BASS_CONFIG_GVOL_STREAM ) / 100; + // } + // else + // { + // return 100; + // } + //} + //set + //{ + // if ( SoundDeviceType == ESoundDeviceType.ExclusiveWASAPI ) + // { + // // LINEAR縺ァ縺ェ縺集INDOWS(2)繧剃スソ縺蠢隕√′縺ゅk縺後‘xclusive譎ゅッ菴ソ逕ィ荳榊庄縲√∪縺溘ョ繝舌う繧ケ蛛エ縺悟ッセ蠢懊@縺ヲ縺ェ縺縺ィ菴ソ逕ィ荳榊庄 + // bool b = BassWasapi.BASS_WASAPI_SetVolume( BASSWASAPIVolume.BASS_WASAPI_CURVE_LINEAR, value / 100.0f ); + // if ( !b ) + // { + // BASSError be = Bass.BASS_ErrorGetCode(); + // Trace.TraceInformation( "WASAPI Master Volume Set Error: " + be.ToString() ); + // } + // } + //} + //set + //{ + // if ( SoundDeviceType == ESoundDeviceType.ExclusiveWASAPI || SoundDeviceType == ESoundDeviceType.ASIO ) + // { + // bool b = Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_GVOL_STREAM, value * 100 ); + // if ( !b ) + // { + // BASSError be = Bass.BASS_ErrorGetCode(); + // Trace.TraceInformation( "Master Volume Set Error: " + be.ToString() ); + // } + // } + //} + //set + //{ + // if ( SoundDeviceType == ESoundDeviceType.ExclusiveWASAPI || SoundDeviceType == ESoundDeviceType.ASIO ) + // { + // var nodes = new BASS_MIXER_NODE[ 1 ] { new BASS_MIXER_NODE( 0, (float) value ) }; + // BassMix.BASS_Mixer_ChannelSetEnvelope( SoundDevice.hMixer, BASSMIXEnvelope.BASS_MIXER_ENV_VOL, nodes ); + // } + //} + set + { + SoundDevice.nMasterVolume = value; + _nMasterVolume = value; + } + } + + ///// + ///// BASS譎ゅ[p3繧偵せ繝医Μ繝シ繝溘Φ繧ー蜀咲函縺帙★縺ォ縲√ョ繧ウ繝シ繝峨@縺殲aw wav繧偵が繝ウ繝。繝「繝ェ蜀咲函縺吶k蝣エ蜷医ッtrue縺ォ縺吶k縲 + ///// 迚ケ谿翫↑mp3繧剃スソ逕ィ譎ゅッ繧キ繝シ繧ッ縺御ケア繧後k縺ョ縺ァ縲∝ソ隕√↓蠢懊§縺ヲtrue縺ォ縺吶k縺薙→縲(Config.ini縺ョNoMP3Streaming縺ァ險ュ螳壼庄閭ス縲) + ///// 縺溘□縺励》rue縺ォ縺吶k縺ィ縲√◎縺ョ蛻蜀咲函髢句ァ九∪縺ァ縺ョ譎る俣縺碁聞縺上↑繧九 + ///// + //public static bool bIsMP3DecodeByWindowsCodec = false; + + public static int nMixing = 0; + public int GetMixingStreams() + { + return nMixing; + } + public static int nStreams = 0; + public int GetStreams() + { + return nStreams; + } + #region [ WASAPI/ASIO/DirectSound險ュ螳壼、 ] + /// + /// WASAPI 謗剃サ悶Δ繝シ繝牙コ蜉帙↓縺翫¢繧句咲函驕蟒カ[ms]シ医ョ蟶梧悍蛟、シ峨よ怙邨ら噪縺ォ縺ッ縺薙ョ謨ー蛟、繧貞渕縺ォ繝峨Λ繧、繝舌′豎コ螳壹☆繧具シ峨 + /// 0莉・荳九ョ蛟、繧呈欠螳壹☆繧九→縲√%縺ョ謨ー蛟、縺ッWASAPI蛻晄悄蛹匁凾縺ォ閾ェ蜍戊ィュ螳壹☆繧九よュ」謨ー繧呈欠螳壹☆繧九→縲√◎縺ョ蛟、繧定ィュ螳壹@繧医≧縺ィ隧ヲ縺ソ繧九 + /// + public static int SoundDelayExclusiveWASAPI = 0; // SST縺ァ縺ッ縲50ms + public int GetSoundExclusiveWASAPI() + { + return SoundDelayExclusiveWASAPI; + } + public void SetSoundDelayExclusiveWASAPI( int value ) + { + SoundDelayExclusiveWASAPI = value; + } + /// + /// WASAPI 蜈ア譛峨Δ繝シ繝牙コ蜉帙↓縺翫¢繧句咲函驕蟒カ[ms]縲ゅΘ繝シ繧カ縺梧アコ螳壹☆繧九 + /// + public static int SoundDelaySharedWASAPI = 100; + /// + /// 謗剃サ妨ASAPI繝舌ャ繝輔ぃ縺ョ譖エ譁ー髢馴囈縲ょコ蜉幃俣髫斐〒縺ッ縺ェ縺縺ョ縺ァ豕ィ諢上 + /// 竊 閾ェ蜍戊ィュ螳壹&繧後k縺ョ縺ァSoundDelay 繧医j繧ょー上&縺蛟、縺ァ縺ゅk縺薙→縲ゑシ亥ー上&縺吶℃繧句エ蜷医ッBASS縺ォ繧医▲縺ヲ閾ェ蜍穂ソョ豁」縺輔l繧九ゑシ + /// + public static int SoundUpdatePeriodExclusiveWASAPI = 6; + /// + /// 蜈ア譛姥ASAPI繝舌ャ繝輔ぃ縺ョ譖エ譁ー髢馴囈縲ょコ蜉幃俣髫斐〒縺ッ縺ェ縺縺ョ縺ァ豕ィ諢上 + /// SoundDelay 繧医j繧ょー上&縺蛟、縺ァ縺ゅk縺薙→縲ゑシ亥ー上&縺吶℃繧句エ蜷医ッBASS縺ォ繧医▲縺ヲ閾ェ蜍穂ソョ豁」縺輔l繧九ゑシ + /// + public static int SoundUpdatePeriodSharedWASAPI = 6; + ///// + ///// ASIO 蜃コ蜉帙↓縺翫¢繧句咲函驕蟒カ[ms]シ医ョ蟶梧悍蛟、シ峨よ怙邨ら噪縺ォ縺ッ縺薙ョ謨ー蛟、繧貞渕縺ォ繝峨Λ繧、繝舌′豎コ螳壹☆繧具シ峨 + ///// + //public static int SoundDelayASIO = 0; // SST縺ァ縺ッ50ms縲0縺ォ縺吶k縺ィ縲√ョ繝舌う繧ケ縺ョ險ュ螳壼、繧偵◎縺ョ縺セ縺セ菴ソ縺縲 + /// + /// ASIO 蜃コ蜉帙↓縺翫¢繧九ヰ繝繝輔ぃ繧オ繧、繧コ縲 + /// + public static int SoundDelayASIO = 0; // 0縺ォ縺吶k縺ィ縲√ョ繝舌う繧ケ縺ョ險ュ螳壼、繧偵◎縺ョ縺セ縺セ菴ソ縺縲 + public int GetSoundDelayASIO() + { + return SoundDelayASIO; + } + public void SetSoundDelayASIO(int value) + { + SoundDelayASIO = value; + } + public static int ASIODevice = 0; + public int GetASIODevice() + { + return ASIODevice; + } + public void SetASIODevice(int value) + { + ASIODevice = value; + } + /// + /// DirectSound 蜃コ蜉帙↓縺翫¢繧句咲函驕蟒カ[ms]縲ゅΘ繝シ繧カ縺梧アコ螳壹☆繧九 + /// + public static int SoundDelayDirectSound = 100; + + public long GetSoundDelay() + { + if ( SoundDevice != null ) + { + return SoundDevice.n螳溘ヰ繝繝輔ぃ繧オ繧、繧コms; + } + else + { + return -1; + } + } + + #endregion + + + /// + /// DTXMania逕ィ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + /// + /// + /// + /// + /// + /// + public CSound邂。逅( IntPtr handle, ESoundDeviceType soundDeviceType, int nSoundDelayExclusiveWASAPI, int nSoundDelayASIO, int nASIODevice, bool _bUseOSTimer ) + { + WindowHandle = handle; + SoundDevice = null; + //bUseOSTimer = false; + t蛻晄悄蛹( soundDeviceType, nSoundDelayExclusiveWASAPI, nSoundDelayASIO, nASIODevice, _bUseOSTimer ); + } + public void Dispose() + { + t邨ゆコ(); + } + + //public static void t蛻晄悄蛹() + //{ + // t蛻晄悄蛹( ESoundDeviceType.DirectSound, 0, 0, 0 ); + //} + + public void t蛻晄悄蛹( ESoundDeviceType soundDeviceType, int _nSoundDelayExclusiveWASAPI, int _nSoundDelayASIO, int _nASIODevice, IntPtr handle ) + { + //if ( !bInitialized ) + { + WindowHandle = handle; + t蛻晄悄蛹( soundDeviceType, _nSoundDelayExclusiveWASAPI, _nSoundDelayASIO, _nASIODevice ); + //bInitialized = true; + } + } + public void t蛻晄悄蛹( ESoundDeviceType soundDeviceType, int _nSoundDelayExclusiveWASAPI, int _nSoundDelayASIO, int _nASIODevice ) + { + t蛻晄悄蛹( soundDeviceType, _nSoundDelayExclusiveWASAPI, _nSoundDelayASIO, _nASIODevice, false ); + } + + public void t蛻晄悄蛹( ESoundDeviceType soundDeviceType, int _nSoundDelayExclusiveWASAPI, int _nSoundDelayASIO, int _nASIODevice, bool _bUseOSTimer ) + { + //SoundDevice = null; // 蠕後〒蜀榊晄悄蛹悶☆繧九%縺ィ縺後≠繧九ョ縺ァ縲]ull蛻晄悄蛹悶ッ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ縺ォ蝗槭☆ + rc貍泌・冗畑繧ソ繧、繝 = null; // Global.Bass 萓晏ュ假シ医▽縺セ繧翫Θ繝シ繧カ萓晏ュ假シ + nMixing = 0; + + SoundDelayExclusiveWASAPI = _nSoundDelayExclusiveWASAPI; + SoundDelayASIO = _nSoundDelayASIO; + ASIODevice = _nASIODevice; + bUseOSTimer = _bUseOSTimer; + + ESoundDeviceType[] ESoundDeviceTypes = new ESoundDeviceType[ 4 ] + { + ESoundDeviceType.ExclusiveWASAPI, + ESoundDeviceType.ASIO, + ESoundDeviceType.DirectSound, + ESoundDeviceType.Unknown + }; + + int n蛻晄悄繝繝舌う繧ケ; + switch ( soundDeviceType ) + { + case ESoundDeviceType.ExclusiveWASAPI: + n蛻晄悄繝繝舌う繧ケ = 0; + break; + case ESoundDeviceType.ASIO: + n蛻晄悄繝繝舌う繧ケ = 1; + break; + case ESoundDeviceType.DirectSound: + n蛻晄悄繝繝舌う繧ケ = 2; + break; + default: + n蛻晄悄繝繝舌う繧ケ = 3; + break; + } + for ( SoundDeviceType = ESoundDeviceTypes[ n蛻晄悄繝繝舌う繧ケ ]; ; SoundDeviceType = ESoundDeviceTypes[ ++n蛻晄悄繝繝舌う繧ケ ] ) + { + try + { + t迴セ蝨ィ縺ョ繝ヲ繝シ繧カConfig縺ォ蠕薙▲縺ヲ繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ィ縺吶∋縺ヲ縺ョ譌「蟄倥し繧ヲ繝ウ繝峨r蜀肴ァ狗ッ峨☆繧(); + break; + } + catch ( Exception e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (2609806d-23e8-45c2-9389-b427e80915bc)" ); + if ( ESoundDeviceTypes[ n蛻晄悄繝繝舌う繧ケ ] == ESoundDeviceType.Unknown ) + { + Trace.TraceError( string.Format( "繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲" ) ); + break; + } + } + } + if ( soundDeviceType == ESoundDeviceType.ExclusiveWASAPI || soundDeviceType == ESoundDeviceType.ASIO ) + { + //Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATETHREADS, 4 ); + //Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0 ); + + Trace.TraceInformation( "BASS_CONFIG_UpdatePeriod=" + Bass.BASS_GetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD ) ); + Trace.TraceInformation( "BASS_CONFIG_UpdateThreads=" + Bass.BASS_GetConfig( BASSConfig.BASS_CONFIG_UPDATETHREADS ) ); + } + } + + public void tDisableUpdateBufferAutomatically() + { + //Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATETHREADS, 0 ); + //Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0 ); + + //Trace.TraceInformation( "BASS_CONFIG_UpdatePeriod=" + Bass.BASS_GetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD ) ); + //Trace.TraceInformation( "BASS_CONFIG_UpdateThreads=" + Bass.BASS_GetConfig( BASSConfig.BASS_CONFIG_UPDATETHREADS ) ); + } + + + public static void t邨ゆコ() + { + C蜈ア騾.tDispose縺吶k( SoundDevice ); SoundDevice = null; + C蜈ア騾.tDispose縺吶k( ref rc貍泌・冗畑繧ソ繧、繝 ); // Global.Bass 繧定ァ」謾セ縺励◆蠕後↓隗」謾セ縺吶k縺薙→縲ゑシGlobal.Bass 縺ァ蜿らァ縺輔l縺ヲ縺繧九◆繧シ + } + + + public static void t迴セ蝨ィ縺ョ繝ヲ繝シ繧カConfig縺ォ蠕薙▲縺ヲ繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ィ縺吶∋縺ヲ縺ョ譌「蟄倥し繧ヲ繝ウ繝峨r蜀肴ァ狗ッ峨☆繧() + { + #region [ 縺吶〒縺ォ繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ィ貍泌・上ち繧、繝槭′讒狗ッ峨&繧後※縺繧後ー隗」謾セ縺吶k縲] + //----------------- + if ( SoundDevice != null ) + { + // 縺吶〒縺ォ逕滓先ク医∩縺ョ繧オ繧ヲ繝ウ繝峨′縺ゅl縺ー蛻晄悄迥カ諷九↓謌サ縺吶 + + CSound.t縺吶∋縺ヲ縺ョ繧オ繧ヲ繝ウ繝峨r蛻晄悄迥カ諷九↓謌サ縺(); // 繝ェ繧ス繝シ繧ケ縺ッ隗」謾セ縺吶k縺後,Sound縺ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ッ谿九☆縲 + + + // 繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ィ貍泌・上ち繧、繝槭r隗」謾セ縺吶k縲 + + C蜈ア騾.tDispose縺吶k( SoundDevice ); SoundDevice = null; + C蜈ア騾.tDispose縺吶k( ref rc貍泌・冗畑繧ソ繧、繝 ); // Global.SoundDevice 繧定ァ」謾セ縺励◆蠕後↓隗」謾セ縺吶k縺薙→縲ゑシGlobal.SoundDevice 縺ァ蜿らァ縺輔l縺ヲ縺繧九◆繧シ + } + //----------------- + #endregion + + #region [ 譁ー縺励>繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ繧呈ァ狗ッ峨☆繧九] + //----------------- + switch ( SoundDeviceType ) + { + case ESoundDeviceType.ExclusiveWASAPI: + SoundDevice = new CSoundDeviceWASAPI( CSoundDeviceWASAPI.E繝繝舌う繧ケ繝「繝シ繝.蜈ア譛, SoundDelayExclusiveWASAPI, SoundUpdatePeriodExclusiveWASAPI ); + break; + + case ESoundDeviceType.SharedWASAPI: + SoundDevice = new CSoundDeviceWASAPI( CSoundDeviceWASAPI.E繝繝舌う繧ケ繝「繝シ繝.蜈ア譛, SoundDelaySharedWASAPI, SoundUpdatePeriodSharedWASAPI ); + break; + + case ESoundDeviceType.ASIO: + SoundDevice = new CSoundDeviceASIO( SoundDelayASIO, ASIODevice ); + break; + + case ESoundDeviceType.DirectSound: + SoundDevice = new CSoundDeviceDirectSound( WindowHandle, SoundDelayDirectSound, bUseOSTimer ); + break; + + default: + throw new Exception( string.Format( "譛ェ蟇セ蠢懊ョ SoundDeviceType 縺ァ縺吶[{0}]", SoundDeviceType.ToString() ) ); + } + //----------------- + #endregion + #region [ 譁ー縺励>貍泌・上ち繧、繝槭r讒狗ッ峨☆繧九] + //----------------- + rc貍泌・冗畑繧ソ繧、繝 = new CSoundTimer( SoundDevice ); + //----------------- + #endregion + + SoundDevice.nMasterVolume = _nMasterVolume; // 繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ォ蟇セ縺励※縲√槭せ繧ソ繝シ繝懊Μ繝・繝シ繝繧貞崎ィュ螳壹☆繧 + + CSound.t縺吶∋縺ヲ縺ョ繧オ繧ヲ繝ウ繝峨r蜀肴ァ狗ッ峨☆繧( SoundDevice ); // 縺吶〒縺ォ逕滓先ク医∩縺ョ繧オ繧ヲ繝ウ繝峨′縺ゅl縺ー菴懊j逶エ縺吶 + } + public CSound t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧( string filename, ESoundGroup soundGroup ) + { + if( !File.Exists( filename ) ) + { + Trace.TraceWarning($"[i18n] File does not exist: {filename}"); + return null; + } + + if ( SoundDeviceType == ESoundDeviceType.Unknown ) + { + throw new Exception( string.Format( "譛ェ蟇セ蠢懊ョ SoundDeviceType 縺ァ縺吶[{0}]", SoundDeviceType.ToString() ) ); + } + return SoundDevice.t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( filename, soundGroup ); + } + + private static DateTime lastUpdateTime = DateTime.MinValue; + public void t蜀咲函荳ュ縺ョ蜃ヲ逅繧偵☆繧( object o ) // #26122 2011.9.1 yyagi; delegate邨檎罰縺ョ蜻シ縺ウ蜃コ縺礼畑 + { + t蜀咲函荳ュ縺ョ蜃ヲ逅繧偵☆繧(); + } + public void t蜀咲函荳ュ縺ョ蜃ヲ逅繧偵☆繧() + { +//笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘繝繝溘シ笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘 +// Debug.Write( "蜀咲函荳ュ縺ョ蜃ヲ逅繧偵☆繧()" ); + //DateTime now = DateTime.Now; + //TimeSpan ts = now - lastUpdateTime; + //if ( ts.Milliseconds > 5 ) + //{ + // bool b = Bass.BASS_Update( 100 * 2 ); + // lastUpdateTime = DateTime.Now; + // if ( !b ) + // { + // Trace.TraceInformation( "BASS_UPdate() failed: " + Bass.BASS_ErrorGetCode().ToString() ); + // } + //} + } + + public void t繧オ繧ヲ繝ウ繝峨r遐エ譽縺吶k( CSound csound ) + { + csound?.t隗」謾セ縺吶k( true ); // 繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ッ蟄倡カ壺堤エ譽縺ォ縺吶k縲 + } + + public float GetCPUusage() + { + float f; + switch ( SoundDeviceType ) + { + case ESoundDeviceType.ExclusiveWASAPI: + case ESoundDeviceType.SharedWASAPI: + f = BassWasapi.BASS_WASAPI_GetCPU(); + break; + case ESoundDeviceType.ASIO: + f = BassAsio.BASS_ASIO_GetCPU(); + break; + case ESoundDeviceType.DirectSound: + f = 0.0f; + break; + default: + f = 0.0f; + break; + } + return f; + } + + public string GetCurrentSoundDeviceType() + { + switch ( SoundDeviceType ) + { + case ESoundDeviceType.ExclusiveWASAPI: + case ESoundDeviceType.SharedWASAPI: + return "WASAPI"; + case ESoundDeviceType.ASIO: + return "ASIO"; + case ESoundDeviceType.DirectSound: + return "DirectSound"; + default: + return "Unknown"; + } + } + + public void AddMixer( CSound cs, double db蜀咲函騾溷コヲ, bool _b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk ) + { + cs.b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk = _b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk; + cs.db蜀咲函騾溷コヲ = db蜀咲函騾溷コヲ; + cs.tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺ォ霑ス蜉縺吶k(); + } + public void AddMixer( CSound cs, double db蜀咲函騾溷コヲ ) + { + cs.db蜀咲函騾溷コヲ = db蜀咲函騾溷コヲ; + cs.tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺ォ霑ス蜉縺吶k(); + } + public void AddMixer( CSound cs ) + { + cs.tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺ォ霑ス蜉縺吶k(); + } + public void RemoveMixer( CSound cs ) + { + cs.tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺九i蜑企勁縺吶k(); + } + } + #endregion + + // CSound 縺ッ縲√し繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺悟、画峩縺輔l縺溘→縺阪b縲√う繝ウ繧ケ繧ソ繝ウ繧ケ繧貞堺ス懈舌☆繧九%縺ィ縺ェ縺上∵眠縺励>繝繝舌う繧ケ縺ァ菴懊j逶エ縺帙k蠢隕√′縺ゅk縲 + // 縺昴ョ縺溘a縲√ョ繝舌う繧ケ縺斐→縺ォ蛻・縺ョ繧ッ繝ゥ繧ケ縺ォ蛻蜑イ縺吶k縺ョ縺ァ縺ッ縺ェ縺上シ代▽縺ョ繧ッ繝ゥ繧ケ縺ォ髮邏縺吶k繧ゅョ縺ィ縺吶k縲 + + public class CSound : IDisposable + { + public const int MinimumSongVol = 0; + public const int MaximumSongVol = 200; // support an approximate doubling in volume. + public const int DefaultSongVol = 100; + + // 2018-08-19 twopointzero: Note the present absence of a MinimumAutomationLevel. + // We will revisit this if/when song select BGM fade-in/fade-out needs + // updating due to changing the type or range of AutomationLevel + public const int MaximumAutomationLevel = 100; + public const int DefaultAutomationLevel = 100; + + public const int MinimumGroupLevel = 0; + public const int MaximumGroupLevel = 100; + public const int DefaultGroupLevel = 100; + public const int DefaultSoundEffectLevel = 80; + public const int DefaultVoiceLevel = 90; + public const int DefaultSongPlaybackLevel = 90; + + public static readonly Lufs MinimumLufs = new Lufs(-100.0); + public static readonly Lufs MaximumLufs = new Lufs(10.0); // support an approximate doubling in volume. + + private static readonly Lufs DefaultGain = new Lufs(0.0); + + public readonly ESoundGroup SoundGroup; + + #region [ DTXMania逕ィ諡。蠑オ ] + + public int n邱乗シ泌・乗凾髢杜s + { + get; + private set; + } + public int n繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ繧オ繧、繧コ // 蜿悶j縺ゅ∴縺0蝗コ螳壺笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘 + { + get { return 0; } + } + public bool b繧ケ繝医Μ繝シ繝蜀咲函縺吶k // 蜿悶j縺ゅ∴縺喃alse蝗コ螳壺笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘 + // true縺ォ縺吶k縺ィ蜷御ク繝√ャ繝鈴浹縺ョ螟夐榊咲函縺ァ蝠城。後′蜃コ繧(4POLY髻ウ貅舌→縺励※蜍輔°縺ェ縺) + { + get { return false; } + } + public double db蜻ィ豕「謨ー蛟咲紫 + { + get + { + return _db蜻ィ豕「謨ー蛟咲紫; + } + set + { + if ( _db蜻ィ豕「謨ー蛟咲紫 != value ) + { + _db蜻ィ豕「謨ー蛟咲紫 = value; + if ( bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk ) + { + Bass.BASS_ChannelSetAttribute( this.hBassStream, BASSAttribute.BASS_ATTRIB_FREQ, ( float ) ( _db蜻ィ豕「謨ー蛟咲紫 * _db蜀咲函騾溷コヲ * n繧ェ繝ェ繧ク繝翫Ν縺ョ蜻ィ豕「謨ー ) ); + } + else + { + try + { + this.Buffer.Frequency = (int)(_db蜻ィ豕「謨ー蛟咲紫 * _db蜀咲函騾溷コヲ * n繧ェ繝ェ繧ク繝翫Ν縺ョ蜻ィ豕「謨ー); + } + catch + { + //萓句、門ヲ逅縺ッ蜃コ縺輔↑縺 + this.b騾溷コヲ荳翫£縺吶℃蝠城。 = true; + } + } + } + } + } + public double db蜀咲函騾溷コヲ + { + get + { + return _db蜀咲函騾溷コヲ; + } + set + { + if ( _db蜀咲函騾溷コヲ != value ) + { + _db蜀咲函騾溷コヲ = value; + bIs1蛟埼溷咲函 = ( _db蜀咲函騾溷コヲ == 1.000f ); + if ( bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk ) + { + if ( _hTempoStream != 0 && !this.bIs1蛟埼溷咲函 ) // 蜀咲函騾溷コヲ縺警1.000縺ョ縺ィ縺阪ッ縲ゝempoStream繧堤畑縺縺ェ縺繧医≧縺ォ縺励※鬮倬溷喧縺吶k + { + this.hBassStream = _hTempoStream; + } + else + { + this.hBassStream = _hBassStream; + } + + if ( CSound邂。逅.bIsTimeStretch ) + { + Bass.BASS_ChannelSetAttribute( this.hBassStream, BASSAttribute.BASS_ATTRIB_TEMPO, (float) ( db蜀咲函騾溷コヲ * 100 - 100 ) ); + //double seconds = Bass.BASS_ChannelBytes2Seconds( this.hTempoStream, nBytes ); + //this.n邱乗シ泌・乗凾髢杜s = (int) ( seconds * 1000 ); + } + else + { + Bass.BASS_ChannelSetAttribute( this.hBassStream, BASSAttribute.BASS_ATTRIB_FREQ, ( float ) ( _db蜻ィ豕「謨ー蛟咲紫 * _db蜀咲函騾溷コヲ * n繧ェ繝ェ繧ク繝翫Ν縺ョ蜻ィ豕「謨ー ) ); + } + } + else + { + try + { + this.Buffer.Frequency = (int)(_db蜻ィ豕「謨ー蛟咲紫 * _db蜀咲函騾溷コヲ * n繧ェ繝ェ繧ク繝翫Ν縺ョ蜻ィ豕「謨ー); + } + catch + { + //萓句、門ヲ逅縺ッ蜃コ縺輔↑縺 + this.b騾溷コヲ荳翫£縺吶℃蝠城。 = true; + } + } + } + } + } + #endregion + + public bool b騾溷コヲ荳翫£縺吶℃蝠城。 = false; + public bool b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk = false; // 縺薙l縺荊rue縺ェ繧峨∵悽繧オ繧ヲ繝ウ繝峨ョ蜀咲函邨ゆコ縺ョ繧ウ繝シ繝ォ繝舌ャ繧ッ譎ゅ↓閾ェ蜍輔〒繝溘く繧オ繝シ縺九i蜑企勁縺吶k + + //private STREAMPROC _cbStreamXA; // make it global, so that the GC can not remove it + private SYNCPROC _cbEndofStream; // 繧ケ繝医Μ繝シ繝縺ョ邨らォッ縺セ縺ァ蜀咲函縺輔l縺溘→縺阪↓蜻シ縺ウ蜃コ縺輔l繧九さ繝シ繝ォ繝舌ャ繧ッ +// private WaitCallback _cbRemoveMixerChannel; + + /// + /// Gain is applied "first" to the audio data, much as in a physical or + /// software mixer. Later steps in the flow of audio apply "channel" level + /// (e.g. AutomationLevel) and mixing group level (e.g. GroupLevel) before + /// the audio is output. + /// + /// This method, taking an integer representing a percent value, is used + /// for mixing in the SONGVOL value, when available. It is also used for + /// DTXViewer preview mode. + /// + public void SetGain(int songVol) + { + SetGain(LinearIntegerPercentToLufs(songVol), null); + } + + private static Lufs LinearIntegerPercentToLufs(int percent) + { + // 2018-08-27 twopointzero: We'll use the standard conversion until an appropriate curve can be selected + return new Lufs(20.0 * Math.Log10(percent / 100.0)); + } + + /// + /// Gain is applied "first" to the audio data, much as in a physical or + /// software mixer. Later steps in the flow of audio apply "channel" level + /// (e.g. AutomationLevel) and mixing group level (e.g. GroupLevel) before + /// the audio is output. + /// + /// This method, taking a LUFS gain value and a LUFS true audio peak value, + /// is used for mixing in the loudness-metadata-base gain value, when available. + /// + public void SetGain(Lufs gain, Lufs? truePeak) + { + if (Equals(_gain, gain)) + { + return; + } + + _gain = gain; + _truePeak = truePeak; + + if (SoundGroup == ESoundGroup.SongPlayback) + { + Trace.TraceInformation($"{nameof(CSound)}.{nameof(SetGain)}: Gain: {_gain}. True Peak: {_truePeak}"); + } + + SetVolume(); + } + + /// + /// AutomationLevel is applied "second" to the audio data, much as in a + /// physical or sofware mixer and its channel level. Before this Gain is + /// applied, and after this the mixing group level is applied. + /// + /// This is currently used only for automated fade in and out as is the + /// case right now for the song selection screen background music fade + /// in and fade out. + /// + public int AutomationLevel + { + get => _automationLevel; + set + { + if (_automationLevel == value) + { + return; + } + + _automationLevel = value; + + if (SoundGroup == ESoundGroup.SongPlayback) + { + Trace.TraceInformation($"{nameof(CSound)}.{nameof(AutomationLevel)} set: {AutomationLevel}"); + } + + SetVolume(); + } + } + + /// + /// GroupLevel is applied "third" to the audio data, much as in the sub + /// mixer groups of a physical or software mixer. Before this both the + /// Gain and AutomationLevel are applied, and after this the audio + /// flows into the audio subsystem for mixing and output based on the + /// master volume. + /// + /// This is currently automatically managed for each sound based on the + /// configured and dynamically adjustable sound group levels for each of + /// sound effects, voice, song preview, and song playback. + /// + /// See the SoundGroupLevelController and related classes for more. + /// + public int GroupLevel + { + private get => _groupLevel; + set + { + if (_groupLevel == value) + { + return; + } + + _groupLevel = value; + + if (SoundGroup == ESoundGroup.SongPlayback) + { + Trace.TraceInformation($"{nameof(CSound)}.{nameof(GroupLevel)} set: {GroupLevel}"); + } + + SetVolume(); + } + } + + private void SetVolume() + { + var automationLevel = LinearIntegerPercentToLufs(AutomationLevel); + var groupLevel = LinearIntegerPercentToLufs(GroupLevel); + + var gain = + _gain + + automationLevel + + groupLevel; + + var safeTruePeakGain = _truePeak?.Negate() ?? new Lufs(0); + var finalGain = gain.Min(safeTruePeakGain); + + if (SoundGroup == ESoundGroup.SongPlayback) + { + Trace.TraceInformation( + $"{nameof(CSound)}.{nameof(SetVolume)}: Gain:{_gain}. Automation Level: {automationLevel}. Group Level: {groupLevel}. Summed Gain: {gain}. Safe True Peak Gain: {safeTruePeakGain}. Final Gain: {finalGain}."); + } + + lufs髻ウ驥 = finalGain; + } + + private Lufs lufs髻ウ驥 + { + set + { + if (this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk) + { + var db髻ウ驥 = ((value.ToDouble() / 100.0) + 1.0).Clamp(0, 1); + Bass.BASS_ChannelSetAttribute(this.hBassStream, BASSAttribute.BASS_ATTRIB_VOL, (float) db髻ウ驥); + } + else if (this.bDirectSound縺ァ縺ゅk) + { + var db髻ウ驥 = (value.ToDouble() * 100.0).Clamp(-10000, 0); + this.Buffer.Volume = (int) Math.Round(db髻ウ驥); + } + } + } + + /// + /// 蟾ヲ:-100ス樔クュ螟ョ:0ス100:蜿ウ縲Tet 縺ョ縺ソ縲 + /// + public int n菴咲スョ + { + get + { + if( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk ) + { + float f菴咲スョ = 0.0f; + if ( !Bass.BASS_ChannelGetAttribute( this.hBassStream, BASSAttribute.BASS_ATTRIB_PAN, ref f菴咲スョ ) ) + //if( BassMix.BASS_Mixer_ChannelGetEnvelopePos( this.hBassStream, BASSMIXEnvelope.BASS_MIXER_ENV_PAN, ref f菴咲スョ ) == -1 ) + return 0; + return (int) ( f菴咲スョ * 100 ); + } + else if( this.bDirectSound縺ァ縺ゅk ) + { + return this._n菴咲スョ; + } + return -9999; + } + set + { + if( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk ) + { + float f菴咲スョ = Math.Min( Math.Max( value, -100 ), 100 ) / 100.0f; // -100ス100 竊 -1.0ス1.0 + //var nodes = new BASS_MIXER_NODE[ 1 ] { new BASS_MIXER_NODE( 0, f菴咲スョ ) }; + //BassMix.BASS_Mixer_ChannelSetEnvelope( this.hBassStream, BASSMIXEnvelope.BASS_MIXER_ENV_PAN, nodes ); + Bass.BASS_ChannelSetAttribute( this.hBassStream, BASSAttribute.BASS_ATTRIB_PAN, f菴咲スョ ); + } + else if( this.bDirectSound縺ァ縺ゅk ) + { + this._n菴咲スョ = Math.Min( Math.Max( -100, value ), 100 ); // -100ス100 + + if( this._n菴咲スョ == 0 ) + { + this._n菴咲スョdb = 0; + } + else if( this._n菴咲スョ == -100 ) + { + this._n菴咲スョdb = -10000; + } + else if( this._n菴咲スョ == 100 ) + { + this._n菴咲スョdb = 10000; + } + else if( this._n菴咲スョ < 0 ) + { + this._n菴咲スョdb = (int) ( ( 20.0 * Math.Log10( ( (double) ( this._n菴咲スョ + 100 ) ) / 100.0 ) ) * 100.0 ); + } + else + { + this._n菴咲スョdb = (int) ( ( -20.0 * Math.Log10( ( (double) ( 100 - this._n菴咲スョ ) ) / 100.0 ) ) * 100.0 ); + } + + this.Buffer.Pan = this._n菴咲スョdb; + } + } + } + + /// + /// DirectSound縺ョ繧サ繧ォ繝ウ繝繝ェ繝舌ャ繝輔ぃ縲 + /// + //public SecondarySoundBuffer DirectSoundBuffer + public SoundBuffer DirectSoundBuffer + { + get { return this.Buffer; } + } + + /// + /// DirectSound縺ョ繧サ繧ォ繝ウ繝繝ェ繝舌ャ繝輔ぃ菴懈先凾縺ョ繝輔Λ繧ー縲 + /// + public BufferFlags DirectSoundBufferFlags + { + get; + protected set; + } + + /// + /// 蜈ィ繧、繝ウ繧ケ繧ソ繝ウ繧ケ繝ェ繧ケ繝医 + /// ス槭r菴懈舌☆繧() 縺ァ霑ス蜉縺輔l縲》隗」謾セ縺吶k() or Dispose() 縺ァ隗」謾セ縺輔l繧九 + /// + public static readonly ObservableCollection list繧、繝ウ繧ケ繧ソ繝ウ繧ケ = new ObservableCollection(); + + public static void ShowAllCSoundFiles() + { + int i = 0; + foreach ( CSound cs in list繧、繝ウ繧ケ繧ソ繝ウ繧ケ ) + { + Debug.WriteLine( i++.ToString( "d3" ) + ": " + Path.GetFileName( cs.str繝輔ぃ繧、繝ォ蜷 ) ); + } + } + + public CSound(ESoundGroup soundGroup) + { + SoundGroup = soundGroup; + this.n菴咲スョ = 0; + this._db蜻ィ豕「謨ー蛟咲紫 = 1.0; + this._db蜀咲函騾溷コヲ = 1.0; +// this._cbRemoveMixerChannel = new WaitCallback( RemoveMixerChannelLater ); + this._hBassStream = -1; + this._hTempoStream = 0; + } + + public void tASIO繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, int hMixer ) + { + this.e繝繝舌う繧ケ遞ョ蛻・ = ESoundDeviceType.ASIO; // 菴懈仙セ後↓險ュ螳壹☆繧九ゑシ井ス懈舌↓螟ア謨励@縺ヲ繧九→萓句、也匱蜃コ縺輔l縺ヲ縺薙%縺ッ螳溯。後&繧後↑縺シ + this.tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( str繝輔ぃ繧、繝ォ蜷, hMixer, BASSFlag.BASS_STREAM_DECODE ); + } + public void tASIO繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, int hMixer ) + { + this.e繝繝舌う繧ケ遞ョ蛻・ = ESoundDeviceType.ASIO; // 菴懈仙セ後↓險ュ螳壹☆繧九ゑシ井ス懈舌↓螟ア謨励@縺ヲ繧九→萓句、也匱蜃コ縺輔l縺ヲ縺薙%縺ッ螳溯。後&繧後↑縺シ + this.tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, hMixer, BASSFlag.BASS_STREAM_DECODE ); + } + public void tWASAPI繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, int hMixer, ESoundDeviceType e繝繝舌う繧ケ遞ョ蛻・ ) + { + this.e繝繝舌う繧ケ遞ョ蛻・ = e繝繝舌う繧ケ遞ョ蛻・; // 菴懈仙セ後↓險ュ螳壹☆繧九ゑシ井ス懈舌↓螟ア謨励@縺ヲ繧九→萓句、也匱蜃コ縺輔l縺ヲ縺薙%縺ッ螳溯。後&繧後↑縺シ + this.tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( str繝輔ぃ繧、繝ォ蜷, hMixer, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_FLOAT ); + } + public void tWASAPI繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, int hMixer, ESoundDeviceType e繝繝舌う繧ケ遞ョ蛻・ ) + { + this.e繝繝舌う繧ケ遞ョ蛻・ = e繝繝舌う繧ケ遞ョ蛻・; // 菴懈仙セ後↓險ュ螳壹☆繧九ゑシ井ス懈舌↓螟ア謨励@縺ヲ繧九→萓句、也匱蜃コ縺輔l縺ヲ縺薙%縺ッ螳溯。後&繧後↑縺シ + this.tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, hMixer, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_FLOAT ); + } + public void tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, DirectSound DirectSound ) + { + this.e菴懈先婿豕 = E菴懈先婿豕.繝輔ぃ繧、繝ォ縺九i; + this.str繝輔ぃ繧、繝ォ蜷 = str繝輔ぃ繧、繝ォ蜷; + if ( String.Compare( Path.GetExtension( str繝輔ぃ繧、繝ォ蜷 ), ".xa", true ) == 0 || + String.Compare( Path.GetExtension( str繝輔ぃ繧、繝ォ蜷 ), ".mp3", true ) == 0 || + String.Compare( Path.GetExtension( str繝輔ぃ繧、繝ォ蜷 ), ".ogg", true ) == 0 ) // caseless縺ァ譁蟄怜玲ッ碑シ + { + tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧宜aOggMp3( str繝輔ぃ繧、繝ォ蜷, DirectSound ); + return; + } + + // 縺吶∋縺ヲ縺ョ繝輔ぃ繧、繝ォ繧 DirectShow 縺ァ繝繧ウ繝シ繝峨☆繧九→譎る俣縺後°縺九k縺ョ縺ァ縲√ヵ繧。繧、繝ォ縺 WAV 縺九▽ PCM 繝輔か繝シ繝槭ャ繝医〒縺ェ縺蝣エ蜷医ョ縺ソ DirectShow 縺ァ繝繧ウ繝シ繝峨☆繧九 + + byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = null; + bool b繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医〒縺ゅk = true; + + { + #region [ 繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医°蜷ヲ縺玖ェソ縺ケ繧九] + //----------------- + try + { + Stream str = File.Open(str繝輔ぃ繧、繝ォ蜷, FileMode.Open, FileAccess.Read); + using (var ws = new SoundStream(str)) + { + if (ws.Format.Encoding != WaveFormatEncoding.Pcm) + b繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医〒縺ゅk = false; + } + } + catch + { + b繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医〒縺ゅk = false; + } + //----------------- + #endregion + + if ( b繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医〒縺ゅk ) + { + #region [ 繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧薙〒 byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺ク譬シ邏阪] + //----------------- + var fs = File.Open( str繝輔ぃ繧、繝ォ蜷, FileMode.Open, FileAccess.Read ); + var br = new BinaryReader( fs ); + + byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = new byte[ fs.Length ]; + br.Read( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, 0, (int) fs.Length ); + + br.Close(); + fs.Close(); + //----------------- + #endregion + } + else + { + #region [ DirectShow 縺ァ繝繧ウ繝シ繝牙、画鋤縺励 byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺ク譬シ邏阪] + //----------------- + CDStoWAVFileImage.t螟画鋤( str繝輔ぃ繧、繝ォ蜷, out byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク ); + //----------------- + #endregion + } + } + + // 縺ゅ→縺ッ縺ゅ■繧峨〒縲 + + this.tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, DirectSound ); + } + public void tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧宜aOggMp3( string str繝輔ぃ繧、繝ォ蜷, DirectSound DirectSound ) + { + try + { + this.e菴懈先婿豕 = E菴懈先婿豕.繝輔ぃ繧、繝ォ縺九i; + this.str繝輔ぃ繧、繝ォ蜷 = str繝輔ぃ繧、繝ォ蜷; + WaveFormat wfx = new WaveFormat(); + int nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ = 0; + // int nPCM繧オ繧、繧コbyte = (int) ( xa.xaheader.nSamples * xa.xaheader.nChannels * 2 ); // nBytes = Bass.BASS_ChannelGetLength( this.hBassStream ); + + + + int nPCM繧オ繧、繧コbyte; + CWin32.WAVEFORMATEX cw32wfx; + t繧ェ繝ウ繝。繝「繝ェ譁ケ蠑上〒繝繧ウ繝シ繝峨☆繧(str繝輔ぃ繧、繝ォ蜷, out this.byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, + out nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ, out nPCM繧オ繧、繧コbyte, out cw32wfx, false); + + wfx = WaveFormat.CreateCustomFormat((WaveFormatEncoding)cw32wfx.wFormatTag, (int)cw32wfx.nSamplesPerSec, cw32wfx.nChannels, (int)cw32wfx.nAvgBytesPerSec, cw32wfx.nBlockAlign, cw32wfx.wBitsPerSample); + + // 繧サ繧ォ繝ウ繝繝ェ繝舌ャ繝輔ぃ繧剃ス懈舌@縲 ̄CM繝繝シ繧ソ繧呈嶌縺崎セシ繧縲 + tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧祇繧サ繧ォ繝ウ繝繝ェ繝舌ャ繝輔ぃ縺ョ菴懈舌→WAV繝繝シ繧ソ譖ク縺崎セシ縺ソ + (ref this.byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, DirectSound, CSoundDeviceDirectSound.DefaultFlags, wfx, + nPCM繧オ繧、繧コbyte, nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ); + return; + } + catch (Exception e) + { + string s = Path.GetFileName(str繝輔ぃ繧、繝ォ蜷); + Trace.TraceWarning($"Failed to create DirectSound buffer by using BASS.DLL.({s}: {e.Message})"); + Trace.TraceWarning("Retrying by using DirectShow decoder."); + } + // 縺吶∋縺ヲ縺ョ繝輔ぃ繧、繝ォ繧 DirectShow 縺ァ繝繧ウ繝シ繝峨☆繧九→譎る俣縺後°縺九k縺ョ縺ァ縲√ヵ繧。繧、繝ォ縺 WAV 縺九▽ PCM 繝輔か繝シ繝槭ャ繝医〒縺ェ縺蝣エ蜷医ョ縺ソ DirectShow 縺ァ繝繧ウ繝シ繝峨☆繧九 + + byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = null; + bool b繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医〒縺ゅk = true; + + { + #region [ 繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医°蜷ヲ縺玖ェソ縺ケ繧九] + //----------------- + SoundStream ws = null; + try + { + using (ws = new SoundStream(new FileStream(str繝輔ぃ繧、繝ォ蜷, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))) + { + if (ws.Format.Encoding != WaveFormatEncoding.Pcm) + b繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医〒縺ゅk = false; + } + } + catch + { + b繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医〒縺ゅk = false; + } + finally + { + if (ws != null) + { + ws.Close(); + ws.Dispose(); + } + } + //----------------- + #endregion + + if (b繝輔ぃ繧、繝ォ縺係AV縺九▽PCM繝輔か繝シ繝槭ャ繝医〒縺ゅk) + { + #region [ 繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧薙〒 byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺ク譬シ邏阪] + //----------------- + var fs = File.Open(str繝輔ぃ繧、繝ォ蜷, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); + var br = new BinaryReader(fs); + + byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = new byte[fs.Length]; + br.Read(byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, 0, (int)fs.Length); + + br.Close(); + fs.Close(); + //----------------- + #endregion + } + else + { + #region [ DirectShow 縺ァ繝繧ウ繝シ繝牙、画鋤縺励 byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺ク譬シ邏阪] + //----------------- + CDStoWAVFileImage.t螟画鋤(str繝輔ぃ繧、繝ォ蜷, out byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク); + //----------------- + #endregion + } + } + + // 縺ゅ→縺ッ縺ゅ■繧峨〒縲 + + this.tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧(byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, DirectSound); + } + + public void tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, DirectSound DirectSound ) + { + this.tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, DirectSound, CSoundDeviceDirectSound.DefaultFlags ); + } + public void tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, DirectSound DirectSound, BufferFlags flags ) + { + if( this.e菴懈先婿豕 == E菴懈先婿豕.Unknown ) + this.e菴懈先婿豕 = E菴懈先婿豕.WAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺九i; + + WaveFormat wfx = null; + int nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ = -1; + int nPCM繧オ繧、繧コbyte = -1; + + #region [ byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク[] 縺九i荳願ィ假シ薙▽縺ョ繝繝シ繧ソ繧貞叙蠕励] + //----------------- + var ms = new MemoryStream( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク ); + var br = new BinaryReader( ms ); + + try + { + // 'RIFF'シ騎IFF繝繝シ繧ソ繧オ繧、繧コ + + if( br.ReadUInt32() != 0x46464952 ) + throw new InvalidDataException( "RIFF繝輔ぃ繧、繝ォ縺ァ縺ッ縺ゅj縺セ縺帙s縲" ); + br.ReadInt32(); + + // 'WAVE' + if( br.ReadUInt32() != 0x45564157 ) + throw new InvalidDataException( "WAVE繝輔ぃ繧、繝ォ縺ァ縺ッ縺ゅj縺セ縺帙s縲" ); + + // 繝√Ε繝ウ繧ッ + while( ( ms.Position + 8 ) < ms.Length ) // +8 縺ッ縲√メ繝」繝ウ繧ッ蜷搾シ九メ繝」繝ウ繧ッ繧オ繧、繧コ縲よョ九j8繝舌う繝域悴貅縺ェ繧峨Ν繝シ繝礼オゆコ縲 + { + uint chunkName = br.ReadUInt32(); + + // 'fmt ' + if( chunkName == 0x20746D66 ) + { + long chunkSize = (long) br.ReadUInt32(); + + var tag = (WaveFormatEncoding)br.ReadUInt16(); + int Channels = br.ReadInt16(); + int SamplesPerSecond = br.ReadInt32(); + int AverageBytesPerSecond = br.ReadInt32(); + int BlockAlignment = br.ReadInt16(); + int BitsPerSample = br.ReadInt16(); + + if (tag == WaveFormatEncoding.Pcm) wfx = new WaveFormat(); + else if (tag == WaveFormatEncoding.Extensible) wfx = new WaveFormatExtensible(SamplesPerSecond, BitsPerSample, Channels); // 縺薙ョ繧ッ繝ゥ繧ケ縺ッ WaveFormat 繧堤カ呎価縺励※縺繧九 + else + throw new InvalidDataException( string.Format( "譛ェ蟇セ蠢懊ョWAVE繝輔か繝シ繝槭ャ繝医ち繧ー縺ァ縺吶(Tag:{0})", tag.ToString() ) ); + + wfx = WaveFormat.CreateCustomFormat((WaveFormatEncoding)tag, SamplesPerSecond, Channels, AverageBytesPerSecond, BlockAlignment, BitsPerSample); + + long n繝輔か繝シ繝槭ャ繝医し繧、繧コbyte = 16; + + if (wfx.Encoding == WaveFormatEncoding.Extensible) + { + br.ReadUInt16(); // 諡。蠑オ鬆伜沺繧オ繧、繧コbyte + var wfxEx = (SharpDX.Multimedia.WaveFormatExtensible)wfx; + int ValidBitsPerSample = br.ReadInt16(); + wfxEx.ChannelMask = (Speakers) br.ReadInt32(); + wfxEx.GuidSubFormat = new Guid(br.ReadBytes(16)); // GUID 縺ッ 16byte (128bit) + + n繝輔か繝シ繝槭ャ繝医し繧、繧コbyte += 24; + } + + ms.Seek( chunkSize - n繝輔か繝シ繝槭ャ繝医し繧、繧コbyte, SeekOrigin.Current ); + continue; + } + + // 'data' + else if( chunkName == 0x61746164 ) + { + nPCM繧オ繧、繧コbyte = br.ReadInt32(); + nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ = (int) ms.Position; + + ms.Seek( nPCM繧オ繧、繧コbyte, SeekOrigin.Current ); + continue; + } + + // 縺昴ョ莉 + else + { + long chunkSize = (long) br.ReadUInt32(); + ms.Seek( chunkSize, SeekOrigin.Current ); + continue; + } + } + + if( wfx == null ) + throw new InvalidDataException( "fmt 繝√Ε繝ウ繧ッ縺悟ュ伜惠縺励∪縺帙s縲ゆク肴ュ」縺ェ繧オ繧ヲ繝ウ繝峨ョ繝シ繧ソ縺ァ縺吶" ); + if( nPCM繧オ繧、繧コbyte < 0 ) + throw new InvalidDataException( "data 繝√Ε繝ウ繧ッ縺悟ュ伜惠縺励∪縺帙s縲ゆク肴ュ」縺ェ繧オ繧ヲ繝ウ繝峨ョ繝シ繧ソ縺ァ縺吶" ); + } + finally + { + ms.Close(); + br.Close(); + } + //----------------- + #endregion + + + // 繧サ繧ォ繝ウ繝繝ェ繝舌ャ繝輔ぃ繧剃ス懈舌@縲 ̄CM繝繝シ繧ソ繧呈嶌縺崎セシ繧縲 + tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧祇繧サ繧ォ繝ウ繝繝ェ繝舌ャ繝輔ぃ縺ョ菴懈舌→WAV繝繝シ繧ソ譖ク縺崎セシ縺ソ( + ref byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, DirectSound, flags, wfx, nPCM繧オ繧、繧コbyte, nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ ); + } + + private void tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧祇繧サ繧ォ繝ウ繝繝ェ繝舌ャ繝輔ぃ縺ョ菴懈舌→WAV繝繝シ繧ソ譖ク縺崎セシ縺ソ + ( ref byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, DirectSound DirectSound, BufferFlags flags, WaveFormat wfx, + int nPCM繧オ繧、繧コbyte, int nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ ) + { + this._Format = wfx; + // 繧サ繧ォ繝ウ繝繝ェ繝舌ャ繝輔ぃ繧剃ス懈舌@縲 ̄CM繝繝シ繧ソ繧呈嶌縺崎セシ繧縲 + + this.Buffer = new SecondarySoundBuffer( DirectSound, new SoundBufferDescription() + { + Format = (wfx.Encoding == WaveFormatEncoding.Pcm) ? wfx : (SharpDX.Multimedia.WaveFormatExtensible)wfx, + Flags = flags, + BufferBytes = nPCM繧オ繧、繧コbyte, + }); + this.Buffer.Write( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ, nPCM繧オ繧、繧コbyte, 0, LockFlags.None ); + + // 菴懈仙ョ御コ縲 + + this.e繝繝舌う繧ケ遞ョ蛻・ = ESoundDeviceType.DirectSound; + this.DirectSoundBufferFlags = flags; + this.byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク; + this.DirectSound = DirectSound; + + // DTXMania逕ィ縺ォ霑ス蜉 + this.n繧ェ繝ェ繧ク繝翫Ν縺ョ蜻ィ豕「謨ー = wfx.SampleRate; + n邱乗シ泌・乗凾髢杜s = (int)(((double)nPCM繧オ繧、繧コbyte) / (this._Format.AverageBytesPerSecond * 0.001)); + + + // 繧、繝ウ繧ケ繧ソ繝ウ繧ケ繝ェ繧ケ繝医↓逋サ骭イ縲 + + CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Add( this ); + } + + #region [ DTXMania逕ィ縺ョ螟画鋤 ] + + public void t繧オ繧ヲ繝ウ繝峨r遐エ譽縺吶k( CSound cs ) + { + cs.t隗」謾セ縺吶k(); + } + public void t蜀咲函繧帝幕蟋九☆繧() + { + t蜀咲函菴咲スョ繧貞磯ュ縺ォ謌サ縺(); + if (!b騾溷コヲ荳翫£縺吶℃蝠城。) + t繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k(false); + } + public void t蜀咲函繧帝幕蟋九☆繧( bool b繝ォ繝シ繝励☆繧 ) + { + if ( bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk ) + { + if ( b繝ォ繝シ繝励☆繧 ) + { + Bass.BASS_ChannelFlags( this.hBassStream, BASSFlag.BASS_SAMPLE_LOOP, BASSFlag.BASS_SAMPLE_LOOP ); + } + else + { + Bass.BASS_ChannelFlags( this.hBassStream, BASSFlag.BASS_DEFAULT, BASSFlag.BASS_DEFAULT ); + } + } + t蜀咲函菴咲スョ繧貞磯ュ縺ォ謌サ縺(); + t繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k( b繝ォ繝シ繝励☆繧 ); + } + public void t蜀咲函繧貞●豁「縺吶k() + { + t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺吶k(); + t蜀咲函菴咲スョ繧貞磯ュ縺ォ謌サ縺(); + } + public void t蜀咲函繧剃ク譎ょ●豁「縺吶k() + { + t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺吶k(true); + this.n荳譎ょ●豁「蝗樊焚++; + } + public void t蜀咲函繧貞埼幕縺吶k( long t ) // 笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘笘 + { + Debug.WriteLine( "t蜀咲函繧貞埼幕縺吶k(long " + t + ")" ); + t蜀咲函菴咲スョ繧貞、画峩縺吶k( t ); + t繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k(); + this.n荳譎ょ●豁「蝗樊焚--; + } + public bool b荳譎ょ●豁「荳ュ + { + get + { + if ( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk ) + { + bool ret = ( BassMix.BASS_Mixer_ChannelIsActive( this.hBassStream ) == BASSActive.BASS_ACTIVE_PAUSED ) & + ( BassMix.BASS_Mixer_ChannelGetPosition( this.hBassStream ) > 0 ); + return ret; + } + else + { + return ( this.n荳譎ょ●豁「蝗樊焚 > 0 ); + } + } + } + public bool b蜀咲函荳ュ + { + get + { + if ( this.e繝繝舌う繧ケ遞ョ蛻・ == ESoundDeviceType.DirectSound ) + { + return ((this.Buffer.Status & (int)BufferStatus.Playing) != (int)BufferStatus.None); + } + else + { + // 蝓コ譛ャ逧縺ォ縺ッBASS_ACTIVE_PLAYING縺ェ繧牙咲函荳ュ縺縺後∵怙蠕後∪縺ァ蜀咲函縺励″縺」縺歡hannel繧 + // BASS_ACTIVE_PLAYING縺ョ縺セ縺セ縺ォ縺ェ縺」縺ヲ縺繧九ョ縺ァ縲∝ー冗エー蟾・縺悟ソ隕√ + bool ret = ( BassMix.BASS_Mixer_ChannelIsActive( this.hBassStream ) == BASSActive.BASS_ACTIVE_PLAYING ); + if ( BassMix.BASS_Mixer_ChannelGetPosition( this.hBassStream ) >= nBytes ) + { + ret = false; + } + return ret; + } + } + } + //public lint t譎ょ綾縺九i菴咲スョ繧定ソ斐☆( long t ) + //{ + // double num = ( n譎ょ綾 * this.db蜀咲函騾溷コヲ ) * this.db蜻ィ豕「謨ー蛟咲紫; + // return (int) ( ( num * 0.01 ) * this.nSamplesPerSecond ); + //} + #endregion + + + public void t隗」謾セ縺吶k() + { + t隗」謾セ縺吶k( false ); + } + + public void t隗」謾セ縺吶k( bool _b繧、繝ウ繧ケ繧ソ繝ウ繧ケ蜑企勁 ) + { + if ( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk ) // stream謨ー縺ョ蜑頑ク帷畑 + { + tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺九i蜑企勁縺吶k(); + _cbEndofStream = null; + //_cbStreamXA = null; + CSound邂。逅.nStreams--; + } + bool bManaged繧りァ」謾セ縺吶k = true; + bool b繧、繝ウ繧ケ繧ソ繝ウ繧ケ蜑企勁 = _b繧、繝ウ繧ケ繧ソ繝ウ繧ケ蜑企勁; // CSound縺ョ蜀榊晄悄蛹匁凾縺ッ縲√う繝ウ繧ケ繧ソ繝ウ繧ケ縺ッ蟄倡カ壹☆繧九 + this.Dispose( bManaged繧りァ」謾セ縺吶k, b繧、繝ウ繧ケ繧ソ繝ウ繧ケ蜑企勁 ); +//Debug.WriteLine( "Disposed: " + _b繧、繝ウ繧ケ繧ソ繝ウ繧ケ蜑企勁 + " : " + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) ); + } + public void t繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k() + { + t繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k( false ); + } + private void t繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k( bool b繝ォ繝シ繝励☆繧 ) + { + if ( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk ) // BASS繧オ繧ヲ繝ウ繝画凾縺ョ繝ォ繝シ繝怜ヲ逅縺ッ縲》蜀咲函繧帝幕蟋九☆繧()蛛エ縺ォ螳溯」縲ゅ%縺薙〒縺ッ縲恵繝ォ繝シ繝励☆繧九阪ッ譛ェ菴ソ逕ィ縲 + { +//Debug.WriteLine( "蜀咲函荳ュ?: " + System.IO.Path.GetFileName(this.str繝輔ぃ繧、繝ォ蜷) + " status=" + BassMix.BASS_Mixer_ChannelIsActive( this.hBassStream ) + " current=" + BassMix.BASS_Mixer_ChannelGetPosition( this.hBassStream ) + " nBytes=" + nBytes ); + bool b = BassMix.BASS_Mixer_ChannelPlay( this.hBassStream ); + if ( !b ) + { +//Debug.WriteLine( "蜀咲函縺励h縺縺ィ縺励◆縺後`ixer縺ォ逋サ骭イ縺輔l縺ヲ縺縺ェ縺九▲縺: " + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + ", stream#=" + this.hBassStream + ", ErrCode=" + Bass.BASS_ErrorGetCode() ); + + bool bb = tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺ォ霑ス蜉縺吶k(); + if ( !bb ) + { +Debug.WriteLine( "Mixer縺ク縺ョ逋サ骭イ縺ォ螟ア謨: " + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + ", ErrCode=" + Bass.BASS_ErrorGetCode() ); + } + else + { +//Debug.WriteLine( "Mixer縺ク縺ョ逋サ骭イ縺ォ謌仙粥: " + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + ": " + Bass.BASS_ErrorGetCode() ); + } + //this.t蜀咲函菴咲スョ繧貞磯ュ縺ォ謌サ縺(); + + bool bbb = BassMix.BASS_Mixer_ChannelPlay( this.hBassStream ); + if (!bbb) + { +Debug.WriteLine("譖エ縺ォ蜀咲函縺ォ螟ア謨: " + Path.GetFileName(this.str繝輔ぃ繧、繝ォ蜷) + ", ErrCode=" + Bass.BASS_ErrorGetCode() ); + } + else + { +// Debug.WriteLine("蜀咲函謌仙粥(繝溘く繧オ繝シ霑ス蜉蠕) : " + Path.GetFileName(this.str繝輔ぃ繧、繝ォ蜷)); + } + } + else + { +//Debug.WriteLine( "蜀咲函謌仙粥: " + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + " (" + hBassStream + ")" ); + } + } + else if( this.bDirectSound縺ァ縺ゅk ) + { + PlayFlags pf = ( b繝ォ繝シ繝励☆繧 ) ? PlayFlags.Looping : PlayFlags.None; + this.Buffer.Play( 0, pf ); + } + } + public void t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺励※Mixer縺九i繧ょ炎髯、縺吶k() + { + t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺吶k( false ); + if ( bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk ) + { + tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺九i蜑企勁縺吶k(); + } + } + public void t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺吶k() + { + t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺吶k( false ); + } + public void t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺吶k( bool pause ) + { + if( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk ) + { +//Debug.WriteLine( "蛛懈ュ「: " + System.IO.Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + " status=" + BassMix.BASS_Mixer_ChannelIsActive( this.hBassStream ) + " current=" + BassMix.BASS_Mixer_ChannelGetPosition( this.hBassStream ) + " nBytes=" + nBytes ); + BassMix.BASS_Mixer_ChannelPause( this.hBassStream ); + if ( !pause ) + { + // tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺九i蜑企勁縺吶k(); // PAUSE縺ィ蜀咲函蛛懈ュ「繧貞玄蛻・縺ァ縺阪k繧医≧縺ォ縺吶k縺薙→!! + } + } + else if( this.bDirectSound縺ァ縺ゅk ) + { + try + { + this.Buffer.Stop(); + } + catch ( Exception ) + { + // WASAPI/ASIO縺ィDirectSound繧貞酔譎ゆスソ逕ィ縺吶k縺ィ縲。uffer縺畦ost縺励※縺薙%縺ァ萓句、也匱逕溘☆繧九や catch縺励※辟。隕悶☆繧九 + // DTXC縺九iDTXMania繧貞他縺ウ蜃コ縺吶→縲.TXC邨ゆコ譎ゅ↓縺薙ョ迴セ雎。縺檎匱逕溘☆繧九 + } + } + this.n荳譎ょ●豁「蝗樊焚 = 0; + } + + public void t蜀咲函菴咲スョ繧貞磯ュ縺ォ謌サ縺() + { + if( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk ) + { + BassMix.BASS_Mixer_ChannelSetPosition( this.hBassStream, 0 ); + //pos = 0; + } + else if( this.bDirectSound縺ァ縺ゅk ) + { + this.Buffer.CurrentPosition = 0; + } + } + public void t蜀咲函菴咲スョ繧貞、画峩縺吶k( long n菴咲スョms ) + { + if( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk ) + { + bool b = true; + try + { + b = BassMix.BASS_Mixer_ChannelSetPosition( this.hBassStream, Bass.BASS_ChannelSeconds2Bytes( this.hBassStream, n菴咲スョms * this.db蜻ィ豕「謨ー蛟咲紫 * this.db蜀咲函騾溷コヲ / 1000.0 ), BASSMode.BASS_POS_BYTES ); + } + catch( Exception e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceInformation( Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + ": Seek error: " + e.ToString() + ": " + n菴咲スョms + "ms" ); + } + finally + { + if ( !b ) + { + BASSError be = Bass.BASS_ErrorGetCode(); + Trace.TraceInformation( Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + ": Seek error: " + be.ToString() + ": " + n菴咲スョms + "MS" ); + } + } + //if ( this.n邱乗シ泌・乗凾髢杜s > 5000 ) + //{ + // Trace.TraceInformation( Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + ": Seeked to " + n菴咲スョms + "ms = " + Bass.BASS_ChannelSeconds2Bytes( this.hBassStream, n菴咲スョms * this.db蜻ィ豕「謨ー蛟咲紫 * this.db蜀咲函騾溷コヲ / 1000.0 ) ); + //} + } + else if( this.bDirectSound縺ァ縺ゅk ) + { + int n菴咲スョsample = (int)(this._Format.SampleRate * n菴咲スョms * 0.001 * _db蜻ィ豕「謨ー蛟咲紫 * _db蜀咲函騾溷コヲ); // #30839 2013.2.24 yyagi; add _db蜻ィ豕「謨ー蛟咲紫 and _db蜀咲函騾溷コヲ + try + { + this.Buffer.CurrentPosition = n菴咲スョsample * this._Format.BlockAlign; + } + catch + { + Trace.TraceError( "{0}: Seek error: {1}", Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ), n菴咲スョms); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (95dee242-1f92-4fcf-aaf6-b162ad2bfc03)" ); + } + //if ( this.n邱乗シ泌・乗凾髢杜s > 5000 ) + //{ + // Trace.TraceInformation( Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + ": Seeked to " + n菴咲スョms + "ms = " + n菴咲スョsample ); + //} + } + } + /// + /// 繝繝舌ャ繧ー逕ィ + /// + /// + /// + public void t蜀咲函菴咲スョ繧貞叙蠕励☆繧( out long n菴咲スョbyte, out double db菴咲スョms ) + { + if ( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk ) + { + n菴咲スョbyte = BassMix.BASS_Mixer_ChannelGetPosition( this.hBassStream ); + db菴咲スョms = Bass.BASS_ChannelBytes2Seconds( this.hBassStream, n菴咲スョbyte ); + } + else if ( this.bDirectSound縺ァ縺ゅk ) + { + this.Buffer.GetCurrentPosition(out int n菴咲スョtmp, out int _); + n菴咲スョbyte = (long)n菴咲スョtmp; + db菴咲スョms = n菴咲スョbyte / this._Format.SampleRate / 0.001 / _db蜻ィ豕「謨ー蛟咲紫 / _db蜀咲函騾溷コヲ; + } + else + { + n菴咲スョbyte = 0; + db菴咲スョms = 0.0; + } + } + + + public static void t縺吶∋縺ヲ縺ョ繧オ繧ヲ繝ウ繝峨r蛻晄悄迥カ諷九↓謌サ縺() + { + foreach ( var sound in CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ ) + { + sound.t隗」謾セ縺吶k( false ); + } + } + internal static void t縺吶∋縺ヲ縺ョ繧オ繧ヲ繝ウ繝峨r蜀肴ァ狗ッ峨☆繧( ISoundDevice device ) + { + if( CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Count == 0 ) + return; + + + // 繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k髫帙↓繧、繝ウ繧ケ繧ソ繝ウ繧ケ繝ェ繧ケ繝医b譖エ譁ー縺輔l繧九ョ縺ァ縲驟榊励↓繧ウ繝斐シ繧貞叙縺」縺ヲ縺翫″縲√Μ繧ケ繝医ッ繧ッ繝ェ繧「縺吶k縲 + + var sounds = CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.ToArray(); + CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Clear(); + + + // 驟榊励↓蝓コ縺・縺縺ヲ蛟九縺ョ繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧九 + + for( int i = 0; i < sounds.Length; i++ ) + { + switch( sounds[ i ].e菴懈先婿豕 ) + { + #region [ 繝輔ぃ繧、繝ォ縺九i ] + case E菴懈先婿豕.繝輔ぃ繧、繝ォ縺九i: + string str繝輔ぃ繧、繝ォ蜷 = sounds[ i ].str繝輔ぃ繧、繝ォ蜷; + sounds[ i ].Dispose( true, false ); + device.t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( str繝輔ぃ繧、繝ォ蜷, sounds[ i ] ); + break; + #endregion + #region [ WAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺九i ] + case E菴懈先婿豕.WAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺九i: + if( sounds[ i ].bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk ) + { + byte[] byArrWave繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = sounds[ i ].byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク; + sounds[ i ].Dispose( true, false ); + device.t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWave繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, sounds[ i ] ); + } + else if( sounds[ i ].bDirectSound縺ァ縺ゅk ) + { + byte[] byArrWave繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = sounds[ i ].byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク; + var flags = sounds[ i ].DirectSoundBufferFlags; + sounds[ i ].Dispose( true, false ); + ( (CSoundDeviceDirectSound) device ).t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWave繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, flags, sounds[ i ] ); + } + break; + #endregion + } + } + } + + #region [ Dispose-Finalize繝代ち繝シ繝ウ螳溯」 ] + //----------------- + public void Dispose() + { + this.Dispose( true, true ); + GC.SuppressFinalize( this ); + } + private void Dispose( bool bManaged繧りァ」謾セ縺吶k, bool b繧、繝ウ繧ケ繧ソ繝ウ繧ケ蜑企勁 ) + { + if( this.bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk ) + { + #region [ ASIO, WASAPI 縺ョ隗」謾セ ] + //----------------- + if ( _hTempoStream != 0 ) + { + BassMix.BASS_Mixer_ChannelRemove( this._hTempoStream ); + Bass.BASS_StreamFree( this._hTempoStream ); + } + BassMix.BASS_Mixer_ChannelRemove( this._hBassStream ); + Bass.BASS_StreamFree( this._hBassStream ); + this.hBassStream = -1; + this._hBassStream = -1; + this._hTempoStream = 0; + //----------------- + #endregion + } + + if( bManaged繧りァ」謾セ縺吶k ) + { + //int freeIndex = -1; + + //if ( CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ != null ) + //{ + // freeIndex = CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.IndexOf( this ); + // if ( freeIndex == -1 ) + // { + // Debug.WriteLine( "ERR: freeIndex==-1 : Count=" + CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Count + ", filename=" + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) ); + // } + //} + + if( this.e繝繝舌う繧ケ遞ョ蛻・ == ESoundDeviceType.DirectSound ) + { + #region [ DirectSound 縺ョ隗」謾セ ] + //----------------- + if( this.Buffer != null ) + { + try + { + this.Buffer.Stop(); + } + catch (Exception e) + { + // 貍泌・冗オゆコ蠕後髟キ譎る俣隗」謾セ縺励↑縺縺ァ縺繧九→縲√◆縺セ縺ォ AccessViolationException 縺檎匱逕溘☆繧九%縺ィ縺後≠繧九 + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (19bcaa24-5259-4198-bf74-41eb1114ba28)" ); + } + C蜈ア騾.tDispose縺吶k( ref this.Buffer ); + } + //----------------- + #endregion + } + + if( this.e菴懈先婿豕 == E菴懈先婿豕.WAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺九i && + this.e繝繝舌う繧ケ遞ョ蛻・ != ESoundDeviceType.DirectSound ) // DirectSound 縺ッ hGC 譛ェ菴ソ逕ィ縲 + { + if ( this.hGC != null && this.hGC.IsAllocated ) + { + this.hGC.Free(); + this.hGC = default( GCHandle ); + } + } + if ( this.byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク != null ) + { + this.byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = null; + } + + this.e繝繝舌う繧ケ遞ョ蛻・ = ESoundDeviceType.Unknown; + + if ( b繧、繝ウ繧ケ繧ソ繝ウ繧ケ蜑企勁 ) + { + //try + //{ + // CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.RemoveAt( freeIndex ); + //} + //catch + //{ + // Debug.WriteLine( "FAILED to remove CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ: Count=" + CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Count + ", filename=" + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) ); + //} + bool b = CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Remove( this ); // 縺薙l縺縺ィ縲,lone()縺励◆繧オ繧ヲ繝ウ繝峨ョremove縺ォ螟ア謨励☆繧 + if ( !b ) + { + Debug.WriteLine( "FAILED to remove CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ: Count=" + CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Count + ", filename=" + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) ); + } + + } + } + } + ~CSound() + { + this.Dispose( false, true ); + } + //----------------- + #endregion + + #region [ protected ] + //----------------- + protected enum E菴懈先婿豕 { 繝輔ぃ繧、繝ォ縺九i, WAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺九i, Unknown } + protected E菴懈先婿豕 e菴懈先婿豕 = E菴懈先婿豕.Unknown; + protected ESoundDeviceType e繝繝舌う繧ケ遞ョ蛻・ = ESoundDeviceType.Unknown; + public string str繝輔ぃ繧、繝ォ蜷 = null; + protected byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = null; // WAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縲√b縺励¥縺ッchunk縺ョDATA驛ィ縺ョ縺ソ + protected GCHandle hGC; + protected int _hTempoStream = 0; + protected int _hBassStream = -1; // ASIO, WASAPI 逕ィ + protected int hBassStream = 0; // #31076 2013.4.1 yyagi; 繝励Ο繝代ユ繧」縺ィ縺励※螳溯」縺吶k縺ィ蜍穂ス懊′菴朱溘↓縺ェ縺」縺溘◆繧√ + // tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧祇繧ケ繝医Μ繝シ繝逕滓仙セ後ョ蜈ア騾壼ヲ逅()縺ョ繧ソ繧、繝溘Φ繧ー縺ィ縲 + // 蜀咲函騾溷コヲ繧貞、画峩縺励◆繧ソ繧、繝溘Φ繧ー縺ァ縺ョ縺ソ縲 + // hBassStream繧呈峩譁ー縺吶k繧医≧縺ォ縺励◆縲 + //{ + // get + // { + // if ( _hTempoStream != 0 && !this.bIs1蛟埼溷咲函 ) // 蜀咲函騾溷コヲ縺警1.000縺ョ縺ィ縺阪ッ縲ゝempoStream繧堤畑縺縺ェ縺繧医≧縺ォ縺励※鬮倬溷喧縺吶k + // { + // return _hTempoStream; + // } + // else + // { + // return _hBassStream; + // } + // } + // set + // { + // _hBassStream = value; + // } + //} + protected SoundBuffer Buffer = null; // DirectSound 逕ィ + protected DirectSound DirectSound; + protected int hMixer = -1; // 險ュ險亥」翫@縺ヲ繧エ繝。繝ウ Mixer縺ォ蠕後〒逋サ骭イ縺吶k縺ィ縺阪↓菴ソ縺 + //----------------- + #endregion + + #region [ private ] + //----------------- + private bool bDirectSound縺ァ縺ゅk + { + get { return ( this.e繝繝舌う繧ケ遞ョ蛻・ == ESoundDeviceType.DirectSound ); } + } + private bool bBASS繧オ繧ヲ繝ウ繝峨〒縺ゅk + { + get + { + return ( + this.e繝繝舌う繧ケ遞ョ蛻・ == ESoundDeviceType.ASIO || + this.e繝繝舌う繧ケ遞ョ蛻・ == ESoundDeviceType.ExclusiveWASAPI || + this.e繝繝舌う繧ケ遞ョ蛻・ == ESoundDeviceType.SharedWASAPI ); + } + } + private int _n菴咲スョ = 0; + private int _n菴咲スョdb; + private Lufs _gain = DefaultGain; + private Lufs? _truePeak = null; + private int _automationLevel = DefaultAutomationLevel; + private int _groupLevel = DefaultGroupLevel; + private long nBytes = 0; + private int n荳譎ょ●豁「蝗樊焚 = 0; + private int n繧ェ繝ェ繧ク繝翫Ν縺ョ蜻ィ豕「謨ー = 0; + private double _db蜻ィ豕「謨ー蛟咲紫 = 1.0; + private double _db蜀咲函騾溷コヲ = 1.0; + private bool bIs1蛟埼溷咲函 = true; + private WaveFormat _Format; + + private void tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, int hMixer, BASSFlag flags ) + { + #region [ xa縺ィwav(RIFF chunked vorbis)縺ォ蟇セ縺励※縺ッ蟆ら畑縺ョ蜃ヲ逅繧偵☆繧 ] + switch ( Path.GetExtension( str繝輔ぃ繧、繝ォ蜷 ).ToLower() ) + { + case ".xa": + tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧宜A( str繝輔ぃ繧、繝ォ蜷, hMixer, flags ); + return; + + case ".wav": + if ( tRIFFchunkedVorbis縺ェ繧吋irectShow縺ァDecode縺吶k( str繝輔ぃ繧、繝ォ蜷, ref byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク ) ) + { + tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, hMixer, flags ); + return; + } + break; + + default: + break; + } + #endregion + + this.e菴懈先婿豕 = E菴懈先婿豕.繝輔ぃ繧、繝ォ縺九i; + this.str繝輔ぃ繧、繝ォ蜷 = str繝輔ぃ繧、繝ォ蜷; + + + // BASS繝輔ぃ繧、繝ォ繧ケ繝医Μ繝シ繝繧剃ス懈舌 + + this._hBassStream = Bass.BASS_StreamCreateFile( str繝輔ぃ繧、繝ォ蜷, 0, 0, flags ); + if( this._hBassStream == 0 ) + throw new Exception( string.Format( "繧オ繧ヲ繝ウ繝峨せ繝医Μ繝シ繝縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲(BASS_StreamCreateFile)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) ); + + nBytes = Bass.BASS_ChannelGetLength( this._hBassStream ); + + tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧祇繧ケ繝医Μ繝シ繝逕滓仙セ後ョ蜈ア騾壼ヲ逅( hMixer ); + } + private void tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, int hMixer, BASSFlag flags ) + { + this.e菴懈先婿豕 = E菴懈先婿豕.WAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺九i; + this.byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク = byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク; + this.hGC = GCHandle.Alloc( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, GCHandleType.Pinned ); // byte[] 繧偵ヴ繝ウ逡吶a + + + // BASS繝輔ぃ繧、繝ォ繧ケ繝医Μ繝シ繝繧剃ス懈舌 + + this._hBassStream = Bass.BASS_StreamCreateFile( hGC.AddrOfPinnedObject(), 0, byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク.Length, flags ); + if ( this._hBassStream == 0 ) + throw new Exception( string.Format( "繧オ繧ヲ繝ウ繝峨せ繝医Μ繝シ繝縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲(BASS_StreamCreateFile)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) ); + + nBytes = Bass.BASS_ChannelGetLength( this._hBassStream ); + + tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧祇繧ケ繝医Μ繝シ繝逕滓仙セ後ョ蜈ア騾壼ヲ逅( hMixer ); + } + + /// + /// Decode "RIFF chunked Vorbis" to "raw wave" + /// because BASE.DLL has two problems for RIFF chunked Vorbis; + /// 1. time seek is not fine 2. delay occurs (about 10ms) + /// + /// wave filename + /// wav file image + /// + private bool tRIFFchunkedVorbis縺ェ繧吋irectShow縺ァDecode縺吶k( string str繝輔ぃ繧、繝ォ蜷, ref byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク ) + { + bool b繝輔ぃ繧、繝ォ縺ォVorbis繧ウ繝ウ繝繝翫′蜷ォ縺セ繧後※縺繧 = false; + + #region [ 繝輔ぃ繧、繝ォ縺係AV縺九▽縲〃orbis繧ウ繝ウ繝繝翫′蜷ォ縺セ繧後※縺繧九°繧定ェソ縺ケ縲√◎繧後↓隧イ蠖薙☆繧九↑繧峨.irectShow縺ァ繝繧ウ繝シ繝峨☆繧九] + //----------------- + try + { + Stream str = File.Open(str繝輔ぃ繧、繝ォ蜷, FileMode.Open, FileAccess.Read); + using (var ws = new SoundStream(str)) + { + if (ws.Format.Encoding == (WaveFormatEncoding)0x6770 || // Ogg Vorbis Mode 2+ + ws.Format.Encoding == (WaveFormatEncoding)0x6771) // Ogg Vorbis Mode 3+ + { + Trace.TraceInformation( Path.GetFileName( str繝輔ぃ繧、繝ォ蜷 ) + ": RIFF chunked Vorbis. Decode to raw Wave first, to avoid BASS.DLL troubles" ); + try + { + CDStoWAVFileImage.t螟画鋤( str繝輔ぃ繧、繝ォ蜷, out byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク ); + b繝輔ぃ繧、繝ォ縺ォVorbis繧ウ繝ウ繝繝翫′蜷ォ縺セ繧後※縺繧 = true; + } + catch + { + Trace.TraceWarning( "Warning: " + Path.GetFileName( str繝輔ぃ繧、繝ォ蜷 ) + " : RIFF chunked Vorbis縺ョ繝繧ウ繝シ繝峨↓螟ア謨励@縺セ縺励◆縲" ); + } + } + } + } + catch ( InvalidDataException ) + { + // DirectShow縺ョ繝繧ウ繝シ繝峨↓螟ア謨励@縺溘i縲∵ャ。縺ッACM縺ァ縺ョ繝繧ウ繝シ繝峨r隧ヲ縺吶%縺ィ縺ォ縺ェ繧九◆繧√√%縺薙〒縺ッ繧ィ繝ゥ繝シ繝ュ繧ー繧貞コ縺輔↑縺縲 + // Trace.TraceWarning( "Warning: " + Path.GetFileName( str繝輔ぃ繧、繝ォ蜷 ) + " : 繝繧ウ繝シ繝峨↓螟ア謨励@縺セ縺励◆縲" ); + } + catch ( Exception e ) + { + Trace.TraceWarning( e.ToString() ); + Trace.TraceWarning( "Warning: " + Path.GetFileName( str繝輔ぃ繧、繝ォ蜷 ) + " : 隱ュ縺ソ霎シ縺ソ縺ォ螟ア謨励@縺セ縺励◆縲" ); + } + #endregion + + return b繝輔ぃ繧、繝ォ縺ォVorbis繧ウ繝ウ繝繝翫′蜷ォ縺セ繧後※縺繧; + } + + private void tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧宜A( string str繝輔ぃ繧、繝ォ蜷, int hMixer, BASSFlag flags ) + { + int nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ; + CWin32.WAVEFORMATEX wfx; + int totalPCMSize; + + t繧ェ繝ウ繝。繝「繝ェ譁ケ蠑上〒繝繧ウ繝シ繝峨☆繧( str繝輔ぃ繧、繝ォ蜷, out this.byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, + out nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ, out totalPCMSize, out wfx, true ); + + nBytes = totalPCMSize; + + this.e菴懈先婿豕 = E菴懈先婿豕.WAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク縺九i; //.繝輔ぃ繧、繝ォ縺九i; // 蜀肴ァ狗ッ画凾縺ッ繝繧ウ繝シ繝牙セ後ョ繧、繝。繝シ繧ク繧呈オ∫畑縺吶k&Dispose譎ゅ↓hGC繧定ァ」謾セ縺吶k + this.str繝輔ぃ繧、繝ォ蜷 = str繝輔ぃ繧、繝ォ蜷; + this.hGC = GCHandle.Alloc( this.byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, GCHandleType.Pinned ); // byte[] 繧偵ヴ繝ウ逡吶a + + //_cbStreamXA = new STREAMPROC( CallbackPlayingXA ); + + // BASS繝輔ぃ繧、繝ォ繧ケ繝医Μ繝シ繝繧剃ス懈舌 + + //this.hBassStream = Bass.BASS_StreamCreate( xa.xaheader.nSamplesPerSec, xa.xaheader.nChannels, BASSFlag.BASS_STREAM_DECODE, _myStreamCreate, IntPtr.Zero ); + //this._hBassStream = Bass.BASS_StreamCreate( (int) wfx.nSamplesPerSec, (int) wfx.nChannels, BASSFlag.BASS_STREAM_DECODE, _cbStreamXA, IntPtr.Zero ); + + // StreamCreate()縺ァ菴懈舌@縺殱tream縺ッseek荳榊庄縺ョ縺溘a縲ヾtreamCreateFile()繧剃スソ縺縲 + this._hBassStream = Bass.BASS_StreamCreateFile( this.hGC.AddrOfPinnedObject(), 0L, totalPCMSize, flags ); + if ( this._hBassStream == 0 ) + { + hGC.Free(); + throw new Exception( string.Format( "繧オ繧ヲ繝ウ繝峨せ繝医Μ繝シ繝縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲(BASS_SampleCreate)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) ); + } + + nBytes = Bass.BASS_ChannelGetLength( this._hBassStream ); + + + tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧祇繧ケ繝医Μ繝シ繝逕滓仙セ後ョ蜈ア騾壼ヲ逅( hMixer ); + } + + + private void tBASS繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧祇繧ケ繝医Μ繝シ繝逕滓仙セ後ョ蜈ア騾壼ヲ逅( int hMixer ) + { + CSound邂。逅.nStreams++; + + // 蛟九縺ョ繧ケ繝医Μ繝シ繝縺ョ蜃コ蜉帙r繝繝ウ繝晏、画峩縺ョ繧ケ繝医Μ繝シ繝縺ォ蜈・蜉帙☆繧九ゅユ繝ウ繝晏、画峩繧ケ繝医Μ繝シ繝縺ョ蜃コ蜉帙r縲`ixer縺ォ蜃コ蜉帙☆繧九 + +// if ( CSound邂。逅.bIsTimeStretch ) // TimeStretch縺ョON/OFF縺ォ髢「繧上j縺ェ縺上√ユ繝ウ繝晏、画峩縺ョ繧ケ繝医Μ繝シ繝繧堤函謌舌☆繧九ょセ後°繧碓N/OFF蛻繧頑崛縺亥庄閭ス縺ィ縺吶k縺溘a縲 + { + this._hTempoStream = BassFx.BASS_FX_TempoCreate( this._hBassStream, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_FX_FREESOURCE ); + if ( this._hTempoStream == 0 ) + { + hGC.Free(); + throw new Exception( string.Format( "繧オ繧ヲ繝ウ繝峨せ繝医Μ繝シ繝縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲(BASS_FX_TempoCreate)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) ); + } + else + { + Bass.BASS_ChannelSetAttribute( this._hTempoStream, BASSAttribute.BASS_ATTRIB_TEMPO_OPTION_USE_QUICKALGO, 1f ); // 鬮倬溷喧(髻ウ縺ョ蜩∬ウェ縺ッ蟆代@關ス縺。繧) + } + } + + if ( _hTempoStream != 0 && !this.bIs1蛟埼溷咲函 ) // 蜀咲函騾溷コヲ縺警1.000縺ョ縺ィ縺阪ッ縲ゝempoStream繧堤畑縺縺ェ縺繧医≧縺ォ縺励※鬮倬溷喧縺吶k + { + this.hBassStream = _hTempoStream; + } + else + { + this.hBassStream = _hBassStream; + } + + // #32248 蜀咲函邨ゆコ譎ゅ↓逋コ轣ォ縺吶kcallback繧堤匳骭イ縺吶k (貍泌・冗オゆコ蠕後↓蜀咲函邨ゆコ縺吶k繝√ャ繝励r髱槫酔譛溽噪縺ォ繝溘く繧オ繝シ縺九i蜑企勁縺吶k縺溘a縲) + _cbEndofStream = new SYNCPROC( CallbackEndofStream ); + Bass.BASS_ChannelSetSync( hBassStream, BASSSync.BASS_SYNC_END | BASSSync.BASS_SYNC_MIXTIME, 0, _cbEndofStream, IntPtr.Zero ); + + // n邱乗シ泌・乗凾髢薙ョ蜿門セ; DTXMania逕ィ縺ォ霑ス蜉縲 + double seconds = Bass.BASS_ChannelBytes2Seconds( this._hBassStream, nBytes ); + this.n邱乗シ泌・乗凾髢杜s = (int) ( seconds * 1000 ); + //this.pos = 0; + this.hMixer = hMixer; + float freq = 0.0f; + if ( !Bass.BASS_ChannelGetAttribute( this._hBassStream, BASSAttribute.BASS_ATTRIB_FREQ, ref freq ) ) + { + hGC.Free(); + throw new Exception( string.Format( "繧オ繧ヲ繝ウ繝峨せ繝医Μ繝シ繝縺ョ蜻ィ豕「謨ー蜿門セ励↓螟ア謨励@縺セ縺励◆縲(BASS_ChannelGetAttribute)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) ); + } + this.n繧ェ繝ェ繧ク繝翫Ν縺ョ蜻ィ豕「謨ー = (int) freq; + + // 繧、繝ウ繧ケ繧ソ繝ウ繧ケ繝ェ繧ケ繝医↓逋サ骭イ縲 + + CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Add( this ); + } + //----------------- + + //private int pos = 0; + //private int CallbackPlayingXA( int handle, IntPtr buffer, int length, IntPtr user ) + //{ + // int bytesread = ( pos + length > Convert.ToInt32( nBytes ) ) ? Convert.ToInt32( nBytes ) - pos : length; + + // Marshal.Copy( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, pos, buffer, bytesread ); + // pos += bytesread; + // if ( pos >= nBytes ) + // { + // // set indicator flag + // bytesread |= (int) BASSStreamProc.BASS_STREAMPROC_END; + // } + // return bytesread; + //} + /// + /// 繧ケ繝医Μ繝シ繝縺ョ邨らォッ縺セ縺ァ蜀咲函縺励◆縺ィ縺阪↓蜻シ縺ウ蜃コ縺輔l繧九さ繝シ繝ォ繝舌ャ繧ッ + /// + /// + /// + /// + /// + private void CallbackEndofStream( int handle, int channel, int data, IntPtr user ) // #32248 2013.10.14 yyagi + { +// Trace.TraceInformation( "Callback!(remove): " + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) ); + if ( b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk ) // 貍泌・冗オゆコ蠕後↓蜀咲函邨ゆコ縺吶k繝√ャ繝鈴浹縺ョ繝溘く繧オ繝シ蜑企勁縺ッ縲∝咲函邨ゆコ縺ョ繧ウ繝シ繝ォ繝舌ャ繧ッ縺ォ蠑輔▲謗帙¢縺ヲ縲∬ェ蜑阪〒陦後≧縲 + { // 縺昴≧縺ァ縺ェ縺繧ゅョ縺ッ縲√Α繧ュ繧オ繝シ蜑企勁莠亥ョ壽凾蛻サ縺ォ蜑企勁縺吶k縲 + tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺九i蜑企勁縺吶k( channel ); + } + } + +// mixer縺九i縺ョ蜑企勁 + + public bool tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺九i蜑企勁縺吶k() + { + return tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺九i蜑企勁縺吶k( this.hBassStream ); + } + public bool tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺九i蜑企勁縺吶k( int channel ) + { + bool b = BassMix.BASS_Mixer_ChannelRemove( channel ); + if ( b ) + { + Interlocked.Decrement( ref CSound邂。逅.nMixing ); +// Debug.WriteLine( "Removed: " + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + " (" + channel + ")" + " MixedStreams=" + CSound邂。逅.nMixing ); + } + return b; + } + + +// mixer 縺ク縺ョ霑ス蜉 + + public bool tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺ォ霑ス蜉縺吶k() + { + if ( BassMix.BASS_Mixer_ChannelGetMixer( hBassStream ) == 0 ) + { + BASSFlag bf = BASSFlag.BASS_SPEAKER_FRONT | BASSFlag.BASS_MIXER_NORAMPIN | BASSFlag.BASS_MIXER_PAUSE; + Interlocked.Increment( ref CSound邂。逅.nMixing ); + + // preload縺輔l繧九%縺ィ繧呈悄蠕縺励※縲∵覆縺医※flag縺九i縺ッBASS_MIXER_PAUSE繧貞、悶@縺ヲAddChannel縺励◆荳翫〒縲√☆縺舌↓PAUSE縺吶k + // -> ChannelUpdate縺ァprebuffer縺ァ縺阪k縺薙→縺悟縺九▲縺溘◆繧√。ASS_MIXER_PAUSE繧剃スソ逕ィ縺吶k縺薙→縺ォ縺励◆ + + bool b1 = BassMix.BASS_Mixer_StreamAddChannel( this.hMixer, this.hBassStream, bf ); + //bool b2 = BassMix.BASS_Mixer_ChannelPause( this.hBassStream ); + t蜀咲函菴咲スョ繧貞磯ュ縺ォ謌サ縺(); // StreamAddChannel縺ョ蠕後〒蜀咲函菴咲スョ繧呈綾縺輔↑縺縺ィ繝繝。縲る縺縺ィ蜀咲函菴咲スョ縺悟、峨o繧峨↑縺縲 +//Trace.TraceInformation( "Add Mixer: " + Path.GetFileName( this.str繝輔ぃ繧、繝ォ蜷 ) + " (" + hBassStream + ")" + " MixedStreams=" + CSound邂。逅.nMixing ); + Bass.BASS_ChannelUpdate( this.hBassStream, 0 ); // pre-buffer + return b1; // &b2; + } + return true; + } + + #region [ t繧ェ繝ウ繝。繝「繝ェ譁ケ蠑上〒繝繧ウ繝シ繝峨☆繧() ] + public void t繧ェ繝ウ繝。繝「繝ェ譁ケ蠑上〒繝繧ウ繝シ繝峨☆繧( string str繝輔ぃ繧、繝ォ蜷, out byte[] buffer, + out int nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ, out int totalPCMSize, out CWin32.WAVEFORMATEX wfx, + bool bIntegrateWaveHeader ) + { + nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ = 0; + //int nPCM繧オ繧、繧コbyte = (int) ( xa.xaheader.nSamples * xa.xaheader.nChannels * 2 ); // nBytes = Bass.BASS_ChannelGetLength( this.hBassStream ); + + SoundDecoder sounddecoder; + + if ( String.Compare( Path.GetExtension( str繝輔ぃ繧、繝ォ蜷 ), ".xa", true ) == 0 ) + { + sounddecoder = new Cxa(); + } + else if ( String.Compare( Path.GetExtension( str繝輔ぃ繧、繝ォ蜷 ), ".ogg", true ) == 0 ) + { + sounddecoder = new Cogg(); + } + else if ( String.Compare( Path.GetExtension( str繝輔ぃ繧、繝ォ蜷 ), ".mp3", true ) == 0 ) + { + sounddecoder = new Cmp3(); + } + else + { + throw new NotImplementedException(); + } + + if ( !File.Exists( str繝輔ぃ繧、繝ォ蜷 ) ) + { + throw new Exception( string.Format( "繝輔ぃ繧、繝ォ縺瑚ヲ九▽縺九j縺セ縺帙s縺ァ縺励◆縲({0})", str繝輔ぃ繧、繝ォ蜷 ) ); + } + int nHandle = sounddecoder.Open( str繝輔ぃ繧、繝ォ蜷 ); + if ( nHandle < 0 ) + { + throw new Exception( string.Format( "Open() 縺ォ螟ア謨励@縺セ縺励◆縲({0})({1})", nHandle, str繝輔ぃ繧、繝ォ蜷 ) ); + } + wfx = new CWin32.WAVEFORMATEX(); + if ( sounddecoder.GetFormat( nHandle, ref wfx ) < 0 ) + { + sounddecoder.Close( nHandle ); + throw new Exception( string.Format( "GetFormat() 縺ォ螟ア謨励@縺セ縺励◆縲({0})", str繝輔ぃ繧、繝ォ蜷 ) ); + } + //totalPCMSize = (int) sounddecoder.nTotalPCMSize; // t繝繧ウ繝シ繝牙セ後ョ繧オ繧、繧コ繧定ェソ縺ケ繧()縺ァ譌「縺ォ蜿門セ玲ク医∩縺ョ蛟、繧呈オ∫畑縺吶k縲Ns蜊倅ス阪ョ鬮倬溷喧縺縺後√メ繝繝鈴浹縺後◆縺上&繧薙≠繧九→蝪オ遨阪〒邨先ァ句柑譫懊′縺ゅk + totalPCMSize = (int) sounddecoder.GetTotalPCMSize( nHandle ); + if ( totalPCMSize == 0 ) + { + sounddecoder.Close( nHandle ); + throw new Exception( string.Format( "GetTotalPCMSize() 縺ォ螟ア謨励@縺セ縺励◆縲({0})", str繝輔ぃ繧、繝ォ蜷 ) ); + } + totalPCMSize += ( ( totalPCMSize % 2 ) != 0 ) ? 1 : 0; + int wavheadersize = ( bIntegrateWaveHeader ) ? 44 : 0; + byte[] buffer_rawdata = new byte[ totalPCMSize ]; + buffer = new byte[ wavheadersize + totalPCMSize ]; + GCHandle handle = GCHandle.Alloc( buffer_rawdata, GCHandleType.Pinned ); + try + { + if ( sounddecoder.Decode( nHandle, handle.AddrOfPinnedObject(), (uint) totalPCMSize, 0 ) < 0 ) + { + buffer = null; + throw new Exception( string.Format( "繝繧ウ繝シ繝峨↓螟ア謨励@縺セ縺励◆縲({0})", str繝輔ぃ繧、繝ォ蜷 ) ); + } + if ( bIntegrateWaveHeader ) + { + // wave header繧呈嶌縺崎セシ繧 + + int wfx諡。蠑オ鬆伜沺_Length = 0; + var ms = new MemoryStream(); + var bw = new BinaryWriter( ms ); + bw.Write( new byte[] { 0x52, 0x49, 0x46, 0x46 } ); // 'RIFF' + bw.Write( (UInt32) totalPCMSize + 44 - 8 ); // 繝輔ぃ繧、繝ォ繧オ繧、繧コ - 8 [byte]シ帑サ翫ッ荳肴弱↑縺ョ縺ァ蠕後〒荳頑嶌縺阪☆繧九 + bw.Write( new byte[] { 0x57, 0x41, 0x56, 0x45 } ); // 'WAVE' + bw.Write( new byte[] { 0x66, 0x6D, 0x74, 0x20 } ); // 'fmt ' + bw.Write( (UInt32) ( 16 + ( ( wfx諡。蠑オ鬆伜沺_Length > 0 ) ? ( 2/*sizeof(WAVEFORMATEX.cbSize)*/ + wfx諡。蠑オ鬆伜沺_Length ) : 0 ) ) ); // fmt繝√Ε繝ウ繧ッ縺ョ繧オ繧、繧コ[byte] + bw.Write( (UInt16) wfx.wFormatTag ); // 繝輔か繝シ繝槭ャ繝IDシ医Μ繝九いPCM縺ェ繧1シ + bw.Write( (UInt16) wfx.nChannels ); // 繝√Ε繝ウ繝阪Ν謨ー + bw.Write( (UInt32) wfx.nSamplesPerSec ); // 繧オ繝ウ繝励Μ繝ウ繧ー繝ャ繝シ繝 + bw.Write( (UInt32) wfx.nAvgBytesPerSec ); // 繝繝シ繧ソ騾溷コヲ + bw.Write( (UInt16) wfx.nBlockAlign ); // 繝悶Ο繝繧ッ繧オ繧、繧コ + bw.Write( (UInt16) wfx.wBitsPerSample ); // 繧オ繝ウ繝励Ν縺ゅ◆繧翫ョ繝薙ャ繝域焚 + //if ( wfx諡。蠑オ鬆伜沺_Length > 0 ) + //{ + // bw.Write( (UInt16) wfx諡。蠑オ鬆伜沺.Length ); // 諡。蠑オ鬆伜沺縺ョ繧オ繧、繧コ[byte] + // bw.Write( wfx諡。蠑オ鬆伜沺 ); // 諡。蠑オ繝繝シ繧ソ + //} + bw.Write( new byte[] { 0x64, 0x61, 0x74, 0x61 } ); // 'data' + //int nDATA繝√Ε繝ウ繧ッ繧オ繧、繧コ菴咲スョ = (int) ms.Position; + bw.Write( (UInt32) totalPCMSize ); // data繝√Ε繝ウ繧ッ縺ョ繧オ繧、繧コ[byte] + + byte[] bs = ms.ToArray(); + + bw.Close(); + ms.Close(); + + for ( int i = 0; i < bs.Length; i++ ) + { + buffer[ i ] = bs[ i ]; + } + } + int s = ( bIntegrateWaveHeader ) ? 44 : 0; + for ( int i = 0; i < totalPCMSize; i++ ) + { + buffer[ i + s ] = buffer_rawdata[ i ]; + } + totalPCMSize += wavheadersize; + nPCM繝繝シ繧ソ縺ョ蜈磯ュ繧、繝ウ繝繝繧ッ繧ケ = wavheadersize; + } + finally + { + handle.Free(); + sounddecoder.Close( nHandle ); + sounddecoder = null; + } + } + #endregion + #endregion + } +} diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundDeviceASIO.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundDeviceASIO.cs new file mode 100644 index 00000000..8012b8e7 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundDeviceASIO.cs @@ -0,0 +1,455 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using Un4seen.Bass; +using Un4seen.BassAsio; +using Un4seen.Bass.AddOn.Mix; + +namespace FDK +{ + /// + /// 蜈ィASIO繝繝舌う繧ケ繧貞玲嫌縺吶k髱咏噪繧ッ繝ゥ繧ケ縲 + /// BASS_Init()繧ВASS_ASIO_Init()縺ョ迥カ諷九→縺ッ辟。髢「菫ゅ↓菴ソ逕ィ蜿ッ閭ス縲 + /// + public static class CEnumerateAllAsioDevices + { + public static string[] GetAllASIODevices() + { + //Debug.WriteLine( "BassAsio.BASS_ASIO_GetDeviceInfos():" ); + BASS_ASIO_DEVICEINFO[] bassAsioDevInfo = BassAsio.BASS_ASIO_GetDeviceInfos(); + + List asioDeviceList = new List(); + + if ( bassAsioDevInfo.Length == 0 ) + { + asioDeviceList.Add( "None" ); + } + else + { + for ( int i = 0; i < bassAsioDevInfo.Length; i++ ) + { + asioDeviceList.Add( bassAsioDevInfo[ i ].name ); + //Trace.TraceInformation( "ASIO Device {0}: {1}", i, bassAsioDevInfo[ i ].name ); + } + } + + return asioDeviceList.ToArray(); + } + } + + internal class CSoundDeviceASIO : ISoundDevice + { + // 繝励Ο繝代ユ繧」 + + public ESoundDeviceType e蜃コ蜉帙ョ繝舌う繧ケ + { + get; + protected set; + } + public long n螳溷コ蜉幃≦蟒カms + { + get; + protected set; + } + public long n螳溘ヰ繝繝輔ぃ繧オ繧、繧コms + { + get; + protected set; + } + public int nASIODevice + { + get; + set; + } + + // CSoundTimer 逕ィ縺ォ蜈ャ髢九@縺ヲ縺繧九励Ο繝代ユ繧」 + + public long n邨碁℃譎る俣ms + { + get; + protected set; + } + public long n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms + { + get; + protected set; + } + public CTimer tm繧キ繧ケ繝繝繧ソ繧、繝 + { + get; + protected set; + } + + + // 繝槭せ繧ソ繝シ繝懊Μ繝・繝シ繝縺ョ蛻カ蠕。繧ウ繝シ繝峨ッ縲仝ASAPI/ASIO縺ァ蜈ィ縺丞酔縺倥 + public int nMasterVolume + { + get + { + float f髻ウ驥 = 0.0f; + bool b = Bass.BASS_ChannelGetAttribute( this.hMixer, BASSAttribute.BASS_ATTRIB_VOL, ref f髻ウ驥 ); + if ( !b ) + { + BASSError be = Bass.BASS_ErrorGetCode(); + Trace.TraceInformation( "ASIO Master Volume Get Error: " + be.ToString() ); + } + else + { + //Trace.TraceInformation( "ASIO Master Volume Get Success: " + (f髻ウ驥 * 100) ); + + } + return (int) ( f髻ウ驥 * 100 ); + } + set + { + bool b = Bass.BASS_ChannelSetAttribute( this.hMixer, BASSAttribute.BASS_ATTRIB_VOL, (float) ( value / 100.0 ) ); + if ( !b ) + { + BASSError be = Bass.BASS_ErrorGetCode(); + Trace.TraceInformation( "ASIO Master Volume Set Error: " + be.ToString() ); + } + else + { + // int n = this.nMasterVolume; + // Trace.TraceInformation( "ASIO Master Volume Set Success: " + value ); + } + } + } + + // 繝。繧ス繝繝 + + public CSoundDeviceASIO( long n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms, int _nASIODevice ) + { + // 蛻晄悄蛹悶 + + Trace.TraceInformation( "BASS (ASIO) 縺ョ蛻晄悄蛹悶r髢句ァ九@縺セ縺吶" ); + this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.Unknown; + this.n螳溷コ蜉幃≦蟒カms = 0; + this.n邨碁℃譎る俣ms = 0; + this.n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms = CTimer.n譛ェ菴ソ逕ィ; + this.tm繧キ繧ケ繝繝繧ソ繧、繝 = new CTimer( CTimer.E遞ョ蛻・.MultiMedia ); + this.nASIODevice = _nASIODevice; + + #region [ BASS registration ] + // BASS.NET 繝ヲ繝シ繧カ逋サ骭イシBASS繧ケ繝励Λ繝繧キ繝・縺碁撼陦ィ遉コ縺ォ縺ェ繧具シ峨 + BassNet.Registration( "dtx2013@gmail.com", "2X9181017152222" ); + #endregion + + #region [ BASS Version Check ] + // BASS 縺ョ繝舌シ繧ク繝ァ繝ウ繝√ぉ繝繧ッ縲 + int nBASSVersion = Utils.HighWord( Bass.BASS_GetVersion() ); + if( nBASSVersion != Bass.BASSVERSION ) + throw new DllNotFoundException( string.Format( "bass.dll 縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧翫∪縺({0})縲ゅ%縺ョ繝励Ο繧ー繝ゥ繝縺ッ繝舌シ繧ク繝ァ繝ウ{1}縺ァ蜍穂ス懊@縺セ縺吶", nBASSVersion, Bass.BASSVERSION ) ); + + int nBASSMixVersion = Utils.HighWord( BassMix.BASS_Mixer_GetVersion() ); + if( nBASSMixVersion != BassMix.BASSMIXVERSION ) + throw new DllNotFoundException( string.Format( "bassmix.dll 縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧翫∪縺({0})縲ゅ%縺ョ繝励Ο繧ー繝ゥ繝縺ッ繝舌シ繧ク繝ァ繝ウ{1}縺ァ蜍穂ス懊@縺セ縺吶", nBASSMixVersion, BassMix.BASSMIXVERSION ) ); + + int nBASSASIO = Utils.HighWord( BassAsio.BASS_ASIO_GetVersion() ); + if( nBASSASIO != BassAsio.BASSASIOVERSION ) + throw new DllNotFoundException( string.Format( "bassasio.dll 縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧翫∪縺({0})縲ゅ%縺ョ繝励Ο繧ー繝ゥ繝縺ッ繝舌シ繧ク繝ァ繝ウ{1}縺ァ蜍穂ス懊@縺セ縺吶", nBASSASIO, BassAsio.BASSASIOVERSION ) ); + #endregion + + // BASS 縺ョ險ュ螳壹 + + this.bIsBASSFree = true; + + if (!Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0 )) // 0:BASS繧ケ繝医Μ繝シ繝縺ョ閾ェ蜍墓峩譁ー繧定。後o縺ェ縺縲 + { + Trace.TraceWarning($"BASS_SetConfig({nameof(BASSConfig.BASS_CONFIG_UPDATEPERIOD)}) 縺ォ螟ア謨励@縺セ縺励◆縲[{Bass.BASS_ErrorGetCode()}]"); + } + if (!Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATETHREADS, 0 )) // 0:BASS繧ケ繝医Μ繝シ繝縺ョ閾ェ蜍墓峩譁ー繧定。後o縺ェ縺縲 + { + Trace.TraceWarning($"BASS_SetConfig({nameof(BASSConfig.BASS_CONFIG_UPDATETHREADS)}) 縺ォ螟ア謨励@縺セ縺励◆縲[{Bass.BASS_ErrorGetCode()}]"); + } + + // BASS 縺ョ蛻晄悄蛹悶 + + int n繝繝舌う繧ケ = 0; // 0:"no device" 窶ヲ BASS 縺九i縺ッ繝繝舌う繧ケ縺ク繧「繧ッ繧サ繧ケ縺輔○縺ェ縺縲ゅい繧ッ繧サ繧ケ縺ッ BASSASIO 繧「繝峨が繝ウ縺九i陦後≧縲 + int n蜻ィ豕「謨ー = 44100; // 莉ョ豎コ繧√よ怙邨ら噪縺ェ蜻ィ豕「謨ー縺ッ繝繝舌う繧ケシ遺旺繝峨Λ繧、繝撰シ峨′豎コ繧√k縲 + if( !Bass.BASS_Init( n繝繝舌う繧ケ, n蜻ィ豕「謨ー, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero ) ) + throw new Exception( string.Format( "BASS 縺ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲(BASS_Init)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) ); + + Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_CURVE_VOL, true); + +//Debug.WriteLine( "BASS_Init()螳御コ縲" ); + #region [ 繝繝舌ャ繧ー逕ィ: ASIO繝繝舌う繧ケ縺ョenumerate縺ィ縲√Ο繧ー蜃コ蜉 ] +// CEnumerateAllAsioDevices.GetAllASIODevices(); +//Debug.WriteLine( "BassAsio.BASS_ASIO_GetDeviceInfo():" ); +// int a, count = 0; +// BASS_ASIO_DEVICEINFO asioDevInfo; +// for ( a = 0; ( asioDevInfo = BassAsio.BASS_ASIO_GetDeviceInfo( a ) ) != null; a++ ) +// { +// Trace.TraceInformation( "ASIO Device {0}: {1}, driver={2}", a, asioDevInfo.name, asioDevInfo.driver ); +// count++; // count it +// } + #endregion + + // BASS ASIO 縺ョ蛻晄悄蛹悶 + BASS_ASIO_INFO asioInfo = null; + if ( BassAsio.BASS_ASIO_Init( nASIODevice, BASSASIOInit.BASS_ASIO_THREAD ) ) // 蟆ら畑繧ケ繝ャ繝繝峨↓縺ヲ襍キ蜍 + { + #region [ ASIO 縺ョ蛻晄悄蛹悶↓謌仙粥縲] + //----------------- + this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.ASIO; + asioInfo = BassAsio.BASS_ASIO_GetInfo(); + this.n蜃コ蜉帙メ繝」繝ウ繝阪Ν謨ー = asioInfo.outputs; + this.db蜻ィ豕「謨ー = BassAsio.BASS_ASIO_GetRate(); + this.fmtASIO繝繝舌う繧ケ繝輔か繝シ繝槭ャ繝 = BassAsio.BASS_ASIO_ChannelGetFormat( false, 0 ); + + Trace.TraceInformation( "BASS 繧貞晄悄蛹悶@縺セ縺励◆縲(ASIO, 繝繝舌う繧ケ:\"{0}\", 蜈・蜉學1}, 蜃コ蜉學2}, {3}Hz, 繝舌ャ繝輔ぃ{4}ス桀6}sample ({5:0.###}ス桀7:0.###}ms), 繝繝舌う繧ケ繝輔か繝シ繝槭ャ繝:{8})", + asioInfo.name, + asioInfo.inputs, + asioInfo.outputs, + this.db蜻ィ豕「謨ー.ToString( "0.###" ), + asioInfo.bufmin, asioInfo.bufmin * 1000 / this.db蜻ィ豕「謨ー, + asioInfo.bufmax, asioInfo.bufmax * 1000 / this.db蜻ィ豕「謨ー, + this.fmtASIO繝繝舌う繧ケ繝輔か繝シ繝槭ャ繝.ToString() + ); + this.bIsBASSFree = false; + #region [ debug: channel format ] + //BASS_ASIO_CHANNELINFO chinfo = new BASS_ASIO_CHANNELINFO(); + //int chan = 0; + //while ( true ) + //{ + // if ( !BassAsio.BASS_ASIO_ChannelGetInfo( false, chan, chinfo ) ) + // break; + // Debug.WriteLine( "Ch=" + chan + ": " + chinfo.name.ToString() + ", " + chinfo.group.ToString() + ", " + chinfo.format.ToString() ); + // chan++; + //} + #endregion + //----------------- + #endregion + } + else + { + #region [ ASIO 縺ョ蛻晄悄蛹悶↓螟ア謨励] + //----------------- + BASSError errcode = Bass.BASS_ErrorGetCode(); + string errmes = errcode.ToString(); + if ( errcode == BASSError.BASS_OK ) + { + errmes = "BASS_OK; The device may be dissconnected"; + } + Bass.BASS_Free(); + this.bIsBASSFree = true; + throw new Exception( string.Format( "BASS (ASIO) 縺ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲(BASS_ASIO_Init)[{0}]", errmes ) ); + //----------------- + #endregion + } + + + // ASIO 蜃コ蜉帙メ繝」繝ウ繝阪Ν縺ョ蛻晄悄蛹悶 + + this.tAsioProc = new ASIOPROC( this.tAsio蜃ヲ逅 ); // 繧「繝ウ繝槭ロ繝シ繧ク縺ォ貂。縺 delegate 縺ッ縲√ヵ繧」繝シ繝ォ繝峨→縺励※菫晄戟縺励※縺翫°縺ェ縺縺ィGC縺ァ繧「繝峨Ξ繧ケ縺悟、峨o縺」縺ヲ縺励∪縺縲 + if ( !BassAsio.BASS_ASIO_ChannelEnable( false, 0, this.tAsioProc, IntPtr.Zero ) ) // 蜃コ蜉帙メ繝」繝ウ繝阪Ν0 縺ョ譛牙柑蛹悶 + { + #region [ ASIO 蜃コ蜉帙メ繝」繝ウ繝阪Ν縺ョ蛻晄悄蛹悶↓螟ア謨励] + //----------------- + BassAsio.BASS_ASIO_Free(); + Bass.BASS_Free(); + this.bIsBASSFree = true; + throw new Exception( string.Format( "Failed BASS_ASIO_ChannelEnable() [{0}]", BassAsio.BASS_ASIO_ErrorGetCode().ToString() ) ); + //----------------- + #endregion + } + for ( int i = 1; i < this.n蜃コ蜉帙メ繝」繝ウ繝阪Ν謨ー; i++ ) // 蜃コ蜉帙メ繝」繝阪Ν繧貞ィ縺ヲ繝√Ε繝阪Ν0縺ィ繧ー繝ォ繝シ繝怜喧縺吶k縲 + { // 繝√Ε繝阪Ν1縺縺代r0縺ィ繧ー繝ォ繝シ繝怜喧縺吶k縺ィ縲3ch莉・荳翫ョ蜃コ蜉帙r繧オ繝昴シ繝医@縺溘き繝シ繝峨〒縺ョ蜍穂ス懊′縺翫°縺励¥縺ェ繧 + if ( !BassAsio.BASS_ASIO_ChannelJoin( false, i, 0 ) ) + { + #region [ 蛻晄悄蛹悶↓螟ア謨励] + //----------------- + BassAsio.BASS_ASIO_Free(); + Bass.BASS_Free(); + this.bIsBASSFree = true; + throw new Exception( string.Format( "Failed BASS_ASIO_ChannelJoin({1}) [{0}]", BassAsio.BASS_ASIO_ErrorGetCode().ToString(), i ) ); + //----------------- + #endregion + } + } + if ( !BassAsio.BASS_ASIO_ChannelSetFormat( false, 0, this.fmtASIO繝√Ε繝ウ繝阪Ν繝輔か繝シ繝槭ャ繝 ) ) // 蜃コ蜉帙メ繝」繝ウ繝阪Ν0縺ョ繝輔か繝シ繝槭ャ繝 + { + #region [ ASIO 蜃コ蜉帙メ繝」繝ウ繝阪Ν縺ョ蛻晄悄蛹悶↓螟ア謨励] + //----------------- + BassAsio.BASS_ASIO_Free(); + Bass.BASS_Free(); + this.bIsBASSFree = true; + throw new Exception( string.Format( "Failed BASS_ASIO_ChannelSetFormat() [{0}]", BassAsio.BASS_ASIO_ErrorGetCode().ToString() ) ); + //----------------- + #endregion + } + + // ASIO 蜃コ蜉帙→蜷後§繝輔か繝シ繝槭ャ繝医r謖√▽ BASS 繝溘く繧オ繝シ繧剃ス懈舌 + + var flag = BASSFlag.BASS_MIXER_NONSTOP | BASSFlag.BASS_STREAM_DECODE; // 繝繧ウ繝シ繝峨ョ縺ソシ晉匱螢ー縺励↑縺縲ASIO 縺ォ蜃コ蜉帙&繧後k縺縺代 + if( this.fmtASIO繝繝舌う繧ケ繝輔か繝シ繝槭ャ繝 == BASSASIOFormat.BASS_ASIO_FORMAT_FLOAT ) + flag |= BASSFlag.BASS_SAMPLE_FLOAT; + this.hMixer = BassMix.BASS_Mixer_StreamCreate( (int) this.db蜻ィ豕「謨ー, this.n蜃コ蜉帙メ繝」繝ウ繝阪Ν謨ー, flag ); + + if ( this.hMixer == 0 ) + { + BASSError err = Bass.BASS_ErrorGetCode(); + BassAsio.BASS_ASIO_Free(); + Bass.BASS_Free(); + this.bIsBASSFree = true; + throw new Exception( string.Format( "BASS繝溘く繧オ(mixing)縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲[{0}]", err ) ); + } + + // BASS 繝溘く繧オ繝シ縺ョ1遘偵≠縺溘j縺ョ繝舌う繝域焚繧堤ョ怜コ縲 + + var mixerInfo = Bass.BASS_ChannelGetInfo( this.hMixer ); + int n繧オ繝ウ繝励Ν繧オ繧、繧コbyte = 0; + switch( this.fmtASIO繝√Ε繝ウ繝阪Ν繝輔か繝シ繝槭ャ繝 ) + { + case BASSASIOFormat.BASS_ASIO_FORMAT_16BIT: n繧オ繝ウ繝励Ν繧オ繧、繧コbyte = 2; break; + case BASSASIOFormat.BASS_ASIO_FORMAT_24BIT: n繧オ繝ウ繝励Ν繧オ繧、繧コbyte = 3; break; + case BASSASIOFormat.BASS_ASIO_FORMAT_32BIT: n繧オ繝ウ繝励Ν繧オ繧、繧コbyte = 4; break; + case BASSASIOFormat.BASS_ASIO_FORMAT_FLOAT: n繧オ繝ウ繝励Ν繧オ繧、繧コbyte = 4; break; + } + //long n繝溘く繧オ繝シ縺ョ1繧オ繝ウ繝励Ν縺ゅ◆繧翫ョ繝舌う繝域焚 = /*mixerInfo.chans*/ 2 * n繧オ繝ウ繝励Ν繧オ繧、繧コbyte; + long n繝溘く繧オ繝シ縺ョ1繧オ繝ウ繝励Ν縺ゅ◆繧翫ョ繝舌う繝域焚 = mixerInfo.chans * n繧オ繝ウ繝励Ν繧オ繧、繧コbyte; + this.n繝溘く繧オ繝シ縺ョ1遘偵≠縺溘j縺ョ繝舌う繝域焚 = n繝溘く繧オ繝シ縺ョ1繧オ繝ウ繝励Ν縺ゅ◆繧翫ョ繝舌う繝域焚 * mixerInfo.freq; + + + // 蜊倡エ斐↓縲”Mixer縺ョ髻ウ驥上rMasterVolume縺ィ縺励※蛻カ蠕。縺励※繧ゅ + // ChannelGetData()縺ョ蜀螳ケ縺ォ縺ッ蜿肴丐縺輔l縺ェ縺縲 + // 縺昴ョ縺溘a縲√b縺荳谿オmixer繧貞剱縺セ縺帙※縲∽ク谿オ蜈医ョmixer縺九iChannelGetData()縺吶k縺薙→縺ァ縲 + // hMixer縺ョ髻ウ驥丞宛蠕。繧貞渚譏縺輔○繧九 + this.hMixer_DeviceOut = BassMix.BASS_Mixer_StreamCreate( + (int) this.db蜻ィ豕「謨ー, this.n蜃コ蜉帙メ繝」繝ウ繝阪Ν謨ー, flag ); + if ( this.hMixer_DeviceOut == 0 ) + { + BASSError errcode = Bass.BASS_ErrorGetCode(); + BassAsio.BASS_ASIO_Free(); + Bass.BASS_Free(); + this.bIsBASSFree = true; + throw new Exception( string.Format( "BASS繝溘く繧オ(譛邨よョオ)縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲[{0}]", errcode ) ); + } + { + bool b1 = BassMix.BASS_Mixer_StreamAddChannel( this.hMixer_DeviceOut, this.hMixer, BASSFlag.BASS_DEFAULT ); + if ( !b1 ) + { + BASSError errcode = Bass.BASS_ErrorGetCode(); + BassAsio.BASS_ASIO_Free(); + Bass.BASS_Free(); + this.bIsBASSFree = true; + throw new Exception( string.Format( "BASS繝溘く繧オ(譛邨よョオ縺ィmixing)縺ョ謗・邯壹↓螟ア謨励@縺セ縺励◆縲[{0}]", errcode ) ); + }; + } + + + // 蜃コ蜉帙r髢句ァ九 + + this.n繝舌ャ繝輔ぃ繧オ繧、繧コsample = (int) ( n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms * this.db蜻ィ豕「謨ー / 1000.0 ); + //this.n繝舌ャ繝輔ぃ繧オ繧、繧コsample = (int) n繝舌ャ繝輔ぃ繧オ繧、繧コbyte; + if ( !BassAsio.BASS_ASIO_Start( this.n繝舌ャ繝輔ぃ繧オ繧、繧コsample ) ) // 遽蝗イ螟悶ョ蛟、繧呈欠螳壹@縺溷エ蜷医ッ閾ェ蜍慕噪縺ォ繝繝輔か繝ォ繝亥、縺ォ險ュ螳壹&繧後k縲 + { + BASSError err = BassAsio.BASS_ASIO_ErrorGetCode(); + BassAsio.BASS_ASIO_Free(); + Bass.BASS_Free(); + this.bIsBASSFree = true; + throw new Exception( "ASIO 繝繝舌う繧ケ蜃コ蜉幃幕蟋九↓螟ア謨励@縺セ縺励◆縲" + err.ToString() ); + } + else + { + int n驕蟒カsample = BassAsio.BASS_ASIO_GetLatency( false ); // 縺薙ョ髢「謨ー縺ッ BASS_ASIO_Start() 蠕後↓縺励°蜻シ縺ウ蜃コ縺帙↑縺縲 + int n蟶梧悍驕蟒カsample = (int) ( n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms * this.db蜻ィ豕「謨ー / 1000.0 ); + this.n螳溘ヰ繝繝輔ぃ繧オ繧、繧コms = this.n螳溷コ蜉幃≦蟒カms = (long) ( n驕蟒カsample * 1000.0f / this.db蜻ィ豕「謨ー ); + Trace.TraceInformation( "ASIO 繝繝舌う繧ケ蜃コ蜉幃幕蟋具シ壹ヰ繝繝輔ぃ{0}sample(蟶梧悍{1}) [{2}ms(蟶梧悍{3}ms)]", n驕蟒カsample, n蟶梧悍驕蟒カsample, this.n螳溷コ蜉幃≦蟒カms, n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms ); + } + } + + #region [ t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧() ] + public CSound t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, ESoundGroup soundGroup ) + { + var sound = new CSound(soundGroup); + sound.tASIO繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( str繝輔ぃ繧、繝ォ蜷, this.hMixer ); + return sound; + } + + public void t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, CSound sound ) + { + sound.tASIO繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( str繝輔ぃ繧、繝ォ蜷, this.hMixer ); + } + public void t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, CSound sound ) + { + sound.tASIO繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, this.hMixer ); + } + #endregion + + + #region [ Dispose-Finallize繝代ち繝シ繝ウ螳溯」 ] + //----------------- + public void Dispose() + { + this.Dispose( true ); + GC.SuppressFinalize( this ); + } + protected void Dispose( bool bManagedDispose ) + { + this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.Unknown; // 縺セ縺壼コ蜉帛●豁「縺吶k(Dispose荳ュ縺ォ繧ッ繝ゥ繧ケ蜀縺ォ繧「繧ッ繧サ繧ケ縺輔l繧九%縺ィ繧帝亟縺) + if ( hMixer != -1 ) + { + Bass.BASS_StreamFree( this.hMixer ); + } + if ( !this.bIsBASSFree ) + { + BassAsio.BASS_ASIO_Free(); // 繧キ繧ケ繝繝繧ソ繧、繝槭h繧雁医↓蜻シ縺ウ蜃コ縺吶%縺ィ縲ゑシtAsio蜃ヲ逅() 縺ョ荳ュ縺ァ繧キ繧ケ繝繝繧ソ繧、繝槭r蜿らァ縺励※繧九◆繧シ + Bass.BASS_Free(); + } + + if( bManagedDispose ) + { + C蜈ア騾.tDispose縺吶k( this.tm繧キ繧ケ繝繝繧ソ繧、繝 ); + this.tm繧キ繧ケ繝繝繧ソ繧、繝 = null; + } + } + ~CSoundDeviceASIO() + { + this.Dispose( false ); + } + //----------------- + #endregion + + + protected int hMixer = -1; + protected int hMixer_DeviceOut = -1; + protected int n蜃コ蜉帙メ繝」繝ウ繝阪Ν謨ー = 0; + protected double db蜻ィ豕「謨ー = 0.0; + protected int n繝舌ャ繝輔ぃ繧オ繧、繧コsample = 0; + protected BASSASIOFormat fmtASIO繝繝舌う繧ケ繝輔か繝シ繝槭ャ繝 = BASSASIOFormat.BASS_ASIO_FORMAT_UNKNOWN; + protected BASSASIOFormat fmtASIO繝√Ε繝ウ繝阪Ν繝輔か繝シ繝槭ャ繝 = BASSASIOFormat.BASS_ASIO_FORMAT_16BIT; // 16bit 蝗コ螳 + //protected BASSASIOFormat fmtASIO繝√Ε繝ウ繝阪Ν繝輔か繝シ繝槭ャ繝 = BASSASIOFormat.BASS_ASIO_FORMAT_32BIT;// 16bit 蝗コ螳 + protected ASIOPROC tAsioProc = null; + + protected int tAsio蜃ヲ逅( bool input, int channel, IntPtr buffer, int length, IntPtr user ) + { + if( input ) return 0; + + + // BASS繝溘く繧オ縺九i縺ョ蜃コ蜉帙ョ繝シ繧ソ繧偵◎縺ョ縺セ縺セ ASIO buffer 縺ク荳ク謚輔£縲 + + int num = Bass.BASS_ChannelGetData( this.hMixer_DeviceOut, buffer, length ); // num = 螳滄圀縺ォ霆「騾√@縺滄聞縺 + + if ( num == -1 ) num = 0; + + + // 邨碁℃譎る俣繧呈峩譁ー縲 + // 繝繝シ繧ソ縺ョ霆「騾∝キョ蛻縺ァ縺ッ縺ェ縺冗エッ遨崎サ「騾√ヰ繧、繝域焚縺九i邂怜コ縺吶k縲 + + this.n邨碁℃譎る俣ms = ( this.n邏ッ遨崎サ「騾√ヰ繧、繝域焚 * 1000 / this.n繝溘く繧オ繝シ縺ョ1遘偵≠縺溘j縺ョ繝舌う繝域焚 ) - this.n螳溷コ蜉幃≦蟒カms; + this.n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms = this.tm繧キ繧ケ繝繝繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms; + + + // 邨碁℃譎る俣繧呈峩譁ー蠕後↓縲∽サ雁屓蛻縺ョ邏ッ遨崎サ「騾√ヰ繧、繝域焚繧貞渚譏縲 + + this.n邏ッ遨崎サ「騾√ヰ繧、繝域焚 += num; + return num; + } + + private long n繝溘く繧オ繝シ縺ョ1遘偵≠縺溘j縺ョ繝舌う繝域焚 = 0; + private long n邏ッ遨崎サ「騾√ヰ繧、繝域焚 = 0; + private bool bIsBASSFree = true; + } +} diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundDeviceDirectSound.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundDeviceDirectSound.cs new file mode 100644 index 00000000..13a27965 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundDeviceDirectSound.cs @@ -0,0 +1,278 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using System.IO; +using System.Threading; +using SlimDX; +using SharpDX.DirectSound; + +namespace FDK +{ + internal class CSoundDeviceDirectSound : ISoundDevice + { + // 繝励Ο繝代ユ繧」 + + public ESoundDeviceType e蜃コ蜉帙ョ繝舌う繧ケ + { + get; + protected set; + } + public long n螳溷コ蜉幃≦蟒カms + { + get; + protected set; + } + public long n螳溘ヰ繝繝輔ぃ繧オ繧、繧コms + { + get; + protected set; + } + + public static readonly BufferFlags DefaultFlags = BufferFlags.Defer | BufferFlags.GetCurrentPosition2 | BufferFlags.GlobalFocus | BufferFlags.ControlVolume | BufferFlags.ControlPan | BufferFlags.ControlFrequency; + + // CSoundTimer 逕ィ縺ォ蜈ャ髢九@縺ヲ縺繧九励Ο繝代ユ繧」 + + public long n邨碁℃譎る俣ms + { + get + { + if ( ctimer != null ) + { + this.sd邨碁℃譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ.DirectSoundBuffer.GetCurrentPosition(out int n迴セ蝨ィ菴咲スョ, out int _); + long n迴セ蝨ィ縺ョ繧キ繧ケ繝繝譎ょ綾ms = this.tm繧キ繧ケ繝繝繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms; + + + // 繝ォ繝シ繝怜屓謨ー繧定ェソ謨エ縲 + + long n繧キ繧ケ繝繝譎ょ綾縺ァ縺ョ髢馴囈ms = n迴セ蝨ィ縺ョ繧キ繧ケ繝繝譎ょ綾ms - this.n蜑阪↓邨碁℃譎る俣繧呈クャ螳壹@縺溘す繧ケ繝繝譎ょ綾ms; + + while ( n繧キ繧ケ繝繝譎ょ綾縺ァ縺ョ髢馴囈ms >= n蜊倅ス咲ケー繧贋ク翫£髢馴囈ms ) // 蜑榊屓縺九i蜊倅ス咲ケー繧贋ク翫£髢馴囈莉・荳顔オ碁℃縺励※繧九↑繧臥「コ螳溘↓繝ォ繝シ繝励@縺ヲ縺繧九りェ、蟾ョ縺ッ螟ァ縺阪¥縺ェ縺縺繧阪≧縺九i辟。隕悶 + { + this.n繝ォ繝シ繝怜屓謨ー++; + n繧キ繧ケ繝繝譎ょ綾縺ァ縺ョ髢馴囈ms -= n蜊倅ス咲ケー繧贋ク翫£髢馴囈ms; + } + + if ( n迴セ蝨ィ菴咲スョ < this.n蜑榊屓縺ョ菴咲スョ ) // 蜊倅ス咲ケー繧贋ク翫£髢馴囈莉・蜀縺ァ縺ゅ▲縺ヲ繧ゅ∫樟蝨ィ菴咲スョ縺悟燕蝗槭h繧頑焔蜑阪↓縺ゅk縺ェ繧1蝗槭Ν繝シ繝励@縺ヲ縺繧九 + this.n繝ォ繝シ繝怜屓謨ー++; + + + // 邨碁℃譎る俣繧堤ョ怜コ縲 + + long n邨碁℃譎る俣ms = (long) ( ( this.n繝ォ繝シ繝怜屓謨ー * n蜊倅ス咲ケー繧贋ク翫£髢馴囈ms ) + ( n迴セ蝨ィ菴咲スョ * 1000.0 / ( 44100.0 * 2 * 2 ) ) ); + + + // 莉雁屓縺ョ蛟、繧呈ャ。蝗槭↓蜷代¢縺ヲ菫晏ュ倥 + + this.n蜑阪↓邨碁℃譎る俣繧呈クャ螳壹@縺溘す繧ケ繝繝譎ょ綾ms = n迴セ蝨ィ縺ョ繧キ繧ケ繝繝譎ょ綾ms; + this.n蜑榊屓縺ョ菴咲スョ = n迴セ蝨ィ菴咲スョ; + + return n邨碁℃譎る俣ms; + } + else + { + long nRet = ctimer.n繧キ繧ケ繝繝譎ょ綾ms - this.n蜑阪↓邨碁℃譎る俣繧呈クャ螳壹@縺溘す繧ケ繝繝譎ょ綾ms; + if ( nRet < 0 ) // 繧ォ繧ヲ繝ウ繧ソ縺後Ν繝シ繝励@縺溘→縺阪ッ + { + nRet = ( ctimer.n繧キ繧ケ繝繝譎ょ綾 - long.MinValue ) + ( long.MaxValue - this.n蜑阪↓邨碁℃譎る俣繧呈クャ螳壹@縺溘す繧ケ繝繝譎ょ綾ms ) + 1; + } + this.n蜑阪↓邨碁℃譎る俣繧呈クャ螳壹@縺溘す繧ケ繝繝譎ょ綾ms = ctimer.n繧キ繧ケ繝繝譎ょ綾ms; + + return nRet; + } + } + } + public long n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms + { + get { throw new NotImplementedException(); } + } + public CTimer tm繧キ繧ケ繝繝繧ソ繧、繝 + { + get; + protected set; + } + + public int nMasterVolume + { + get + { + return (int) 100; + } + set + { + // 迚ケ縺ォ菴輔b縺励↑縺 + } + } + + + // 繝。繧ス繝繝 + + public CSoundDeviceDirectSound( IntPtr hWnd, long n驕蟒カ譎る俣ms, bool bUseOSTimer ) + { + Trace.TraceInformation( "DirectSound 縺ョ蛻晄悄蛹悶r髢句ァ九@縺セ縺吶" ); + + this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.Unknown; + this.n螳溘ヰ繝繝輔ぃ繧オ繧、繧コms = this.n螳溷コ蜉幃≦蟒カms = n驕蟒カ譎る俣ms; + this.tm繧キ繧ケ繝繝繧ソ繧、繝 = new CTimer( CTimer.E遞ョ蛻・.MultiMedia ); + + #region [ DirectSound 繝繝舌う繧ケ繧剃ス懈舌☆繧九] + //----------------- + this.DirectSound = new DirectSound(); // 螟ア謨励@縺溘i萓句、悶r縺昴ョ縺セ縺セ逋コ蜃コ縲 + + // 繝繝舌う繧ケ縺ョ蜊碑ェソ繝ャ繝吶Ν繧定ィュ螳壹☆繧九 + + bool priority = true; + try + { + this.DirectSound.SetCooperativeLevel( hWnd, CooperativeLevel.Priority ); + } + catch + { + this.DirectSound.SetCooperativeLevel( hWnd, CooperativeLevel.Normal ); // 縺薙l縺ァ繧ょ、ア謨励@縺溘i萓句、悶r縺昴ョ縺セ縺セ逋コ蜃コ縲 + priority = false; + } + + // 繝繝舌う繧ケ菴懈仙ョ御コ縲 + + this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.DirectSound; + //----------------- + #endregion + + if ( !bUseOSTimer ) + { + #region [ 邨碁℃譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ繧剃ス懈舌@縲√Ν繝シ繝怜咲函繧帝幕蟋九☆繧九] + //----------------- + + // 蜊倅ス咲ケー繧贋ク翫£髢馴囈[遘綻縺ョ髟キ縺輔r謖√▽辟。髻ウ縺ョ繧オ繧ヲ繝ウ繝峨r菴懈舌 + + uint n繝繝シ繧ソ繧オ繧、繧コbyte = n蜊倅ス咲ケー繧贋ク翫£髢馴囈sec * 44100 * 2 * 2; + var ms = new MemoryStream(); + var bw = new BinaryWriter( ms ); + bw.Write( (uint) 0x46464952 ); // 'RIFF' + bw.Write( (uint) ( 44 + n繝繝シ繧ソ繧オ繧、繧コbyte - 8 ) ); // 繝輔ぃ繧、繝ォ繧オ繧、繧コ - 8 + bw.Write( (uint) 0x45564157 ); // 'WAVE' + bw.Write( (uint) 0x20746d66 ); // 'fmt ' + bw.Write( (uint) 16 ); // 繝舌う繝域焚 + bw.Write( (ushort) 1 ); // 繝輔か繝シ繝槭ャ繝ID(繝ェ繝九いPCM) + bw.Write( (ushort) 2 ); // 繝√Ε繝ウ繝阪Ν謨ー + bw.Write( (uint) 44100 ); // 繧オ繝ウ繝励Μ繝ウ繧ー蜻ィ豕「謨ー + bw.Write( (uint) ( 44100 * 2 * 2 ) ); // bytes/sec + bw.Write( (ushort) ( 2 * 2 ) ); // block繧オ繧、繧コ + bw.Write( (ushort) 16 ); // bit/sample + bw.Write( (uint) 0x61746164 ); // 'data' + bw.Write( (uint) n繝繝シ繧ソ繧オ繧、繧コbyte ); // 繝繝シ繧ソ髟キ + for ( int i = 0; i < n繝繝シ繧ソ繧オ繧、繧コbyte / sizeof( long ); i++ ) // PCM繝繝シ繧ソ + bw.Write( (long) 0 ); + var byArrWaveFleImage = ms.ToArray(); + bw.Close(); + ms = null; + bw = null; + this.sd邨碁℃譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ = this.t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWaveFleImage, ESoundGroup.Unknown ); + + CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Remove( this.sd邨碁℃譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ ); // 迚ケ谿顔畑騾斐↑縺ョ縺ァ繧、繝ウ繧ケ繧ソ繝ウ繧ケ繝ェ繧ケ繝医°繧峨ッ髯、螟悶☆繧九 + + // 繧オ繧ヲ繝ウ繝峨ョ繝ォ繝シ繝怜咲函髢句ァ九 + + this.n繝ォ繝シ繝怜屓謨ー = 0; + this.n蜑榊屓縺ョ菴咲スョ = 0; + this.sd邨碁℃譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ.DirectSoundBuffer.Play( 0, PlayFlags.Looping ); + this.n蜑阪↓邨碁℃譎る俣繧呈クャ螳壹@縺溘す繧ケ繝繝譎ょ綾ms = this.tm繧キ繧ケ繝繝繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms; + //----------------- + #endregion + } + else + { + ctimer = new CTimer( CTimer.E遞ョ蛻・.MultiMedia ); + } + Trace.TraceInformation( "DirectSound 繧貞晄悄蛹悶@縺セ縺励◆縲({0})({1})", ( priority ) ? "Priority" : "Normal", bUseOSTimer? "OStimer" : "FDKtimer" ); + } + + public CSound t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, ESoundGroup soundGroup ) + { + var sound = new CSound(soundGroup); + sound.tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( str繝輔ぃ繧、繝ォ蜷, this.DirectSound ); + return sound; + } + + private CSound t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, ESoundGroup soundGroup ) + { + var sound = new CSound(soundGroup); + sound.tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, this.DirectSound ); + return sound; + } + + // 譌「蟄倥ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケシ育函謌千峩蠕 or Dispose貂医∩シ峨↓蟇セ縺励※繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧九 + public void t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, CSound sound ) + { + sound.tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( str繝輔ぃ繧、繝ォ蜷, this.DirectSound ); + } + public void t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, CSound sound ) + { + sound.tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, this.DirectSound ); + } + public void t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, BufferFlags flags, CSound sound ) + { + sound.tDirectSound繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, this.DirectSound, flags ); + } + + #region [ Dispose-Finallize繝代ち繝シ繝ウ螳溯」 ] + //----------------- + public void Dispose() + { + this.Dispose( true ); + GC.SuppressFinalize( this ); + } + protected void Dispose( bool bManagedDispose ) + { + this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.Unknown; // 縺セ縺壼コ蜉帛●豁「縺吶k(Dispose荳ュ縺ォ繧ッ繝ゥ繧ケ蜀縺ォ繧「繧ッ繧サ繧ケ縺輔l繧九%縺ィ繧帝亟縺) + if ( bManagedDispose ) + { + #region [ 邨檎キッ譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ繧定ァ」謾セ縲] + //----------------- + if ( this.sd邨碁℃譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ != null ) + { + this.sd邨碁℃譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ.t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺吶k(); + C蜈ア騾.tDispose縺吶k( ref this.sd邨碁℃譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ ); + } + //----------------- + #endregion + #region [ 蜊倅ス咲ケー繧贋ク翫£逕ィ繧ケ繝ャ繝繝牙●豁「縲] + //----------------- + if( this.th邨碁℃譎る俣貂ャ螳夂畑繧ケ繝ャ繝繝 != null ) + { + this.th邨碁℃譎る俣貂ャ螳夂畑繧ケ繝ャ繝繝.Abort(); + this.th邨碁℃譎る俣貂ャ螳夂畑繧ケ繝ャ繝繝 = null; + + } + //----------------- + #endregion + + C蜈ア騾.tDispose縺吶k( ref this.DirectSound ); + C蜈ア騾.tDispose縺吶k( this.tm繧キ繧ケ繝繝繧ソ繧、繝 ); + } + if ( ctimer != null ) + { + C蜈ア騾.tDispose縺吶k( ref this.ctimer ); + } + } + ~CSoundDeviceDirectSound() + { + this.Dispose( false ); + } + //----------------- + #endregion + + protected DirectSound DirectSound = null; + protected CSound sd邨碁℃譎る俣險域クャ逕ィ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ = null; + protected Thread th邨碁℃譎る俣貂ャ螳夂畑繧ケ繝ャ繝繝 = null; +// protected AutoResetEvent autoResetEvent = new AutoResetEvent( false ); + protected const uint n蜊倅ス咲ケー繧贋ク翫£髢馴囈sec = 1; // [遘綻 + protected const uint n蜊倅ス咲ケー繧贋ク翫£髢馴囈ms = n蜊倅ス咲ケー繧贋ク翫£髢馴囈sec * 1000; // [繝溘Μ遘綻 + protected int n繝ォ繝シ繝怜屓謨ー = 0; + + private long n蜑阪↓邨碁℃譎る俣繧呈クャ螳壹@縺溘す繧ケ繝繝譎ょ綾ms = CTimer.n譛ェ菴ソ逕ィ; + private int n蜑榊屓縺ョ菴咲スョ = 0; + + private CTimer ctimer = null; + } +} diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundDeviceWASAPI.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundDeviceWASAPI.cs new file mode 100644 index 00000000..8e1cd920 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundDeviceWASAPI.cs @@ -0,0 +1,447 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using Un4seen.Bass; +using Un4seen.BassWasapi; +using Un4seen.Bass.AddOn.Mix; + +namespace FDK +{ + internal class CSoundDeviceWASAPI : ISoundDevice + { + // 繝励Ο繝代ユ繧」 + + public ESoundDeviceType e蜃コ蜉帙ョ繝舌う繧ケ + { + get; + protected set; + } + public long n螳溷コ蜉幃≦蟒カms + { + get; + protected set; + } + public long n螳溘ヰ繝繝輔ぃ繧オ繧、繧コms + { + get; + protected set; + } + + // CSoundTimer 逕ィ縺ォ蜈ャ髢九@縺ヲ縺繧九励Ο繝代ユ繧」 + + public long n邨碁℃譎る俣ms + { + get; + protected set; + } + public long n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms + { + get; + protected set; + } + public CTimer tm繧キ繧ケ繝繝繧ソ繧、繝 + { + get; + protected set; + } + + public enum E繝繝舌う繧ケ繝「繝シ繝 { 謗剃サ, 蜈ア譛 } + + public int nMasterVolume + { + get + { + float f髻ウ驥 = 0.0f; + //if ( BassMix.BASS_Mixer_ChannelGetEnvelopePos( this.hMixer, BASSMIXEnvelope.BASS_MIXER_ENV_VOL, ref f髻ウ驥 ) == -1 ) + // return 100; + //bool b = Bass.BASS_ChannelGetAttribute( this.hMixer, BASSAttribute.BASS_ATTRIB_VOL, ref f髻ウ驥 ); + bool b = Bass.BASS_ChannelGetAttribute( this.hMixer, BASSAttribute.BASS_ATTRIB_VOL, ref f髻ウ驥 ); + if ( !b ) + { + BASSError be = Bass.BASS_ErrorGetCode(); + Trace.TraceInformation( "WASAPI Master Volume Get Error: " + be.ToString() ); + } + else + { + Trace.TraceInformation( "WASAPI Master Volume Get Success: " + (f髻ウ驥 * 100) ); + + } + return (int) ( f髻ウ驥 * 100 ); + } + set + { + // bool b = Bass.BASS_SetVolume( value / 100.0f ); + // 竊脱xclusive繝「繝シ繝画凾縺ッ辟。蜉ケ + +// bool b = BassWasapi.BASS_WASAPI_SetVolume( BASSWASAPIVolume.BASS_WASAPI_VOL_SESSION, (float) ( value / 100 ) ); +// bool b = BassWasapi.BASS_WASAPI_SetVolume( BASSWASAPIVolume.BASS_WASAPI_CURVE_WINDOWS, (float) ( value / 100 ) ); + bool b = Bass.BASS_ChannelSetAttribute( this.hMixer, BASSAttribute.BASS_ATTRIB_VOL, (float) ( value / 100.0 ) ); + // If you would like to have a volume control in exclusive mode too, and you're using the BASSmix add-on, + // you can adjust the source's BASS_ATTRIB_VOL setting via BASS_ChannelSetAttribute. + // 縺励°縺励”Mixer縺ォ蟇セ縺吶kBASS_ChannelSetAttribute()縺ァBASS_ATTRIB_VOL繧貞、画峩: 縺ェ縺懊°蜃コ蜉幃浹驥上↓蜿肴丐縺輔l縺 + + // Bass_SetVolume(): BASS_ERROR_NOTAVIL ("no sound" device縺ォ縺ッ驕ゥ逕ィ荳榊庄) + + // Mixer_ChannelSetEnvelope(): + + //var nodes = new BASS_MIXER_NODE[ 1 ] { new BASS_MIXER_NODE( 0, (float) value ) }; + //bool b = BassMix.BASS_Mixer_ChannelSetEnvelope( this.hMixer, BASSMIXEnvelope.BASS_MIXER_ENV_VOL, nodes ); + //bool b = Bass.BASS_ChannelSetAttribute( this.hMixer, BASSAttribute.BASS_ATTRIB_VOL, value / 100.0f ); + if ( !b ) + { + BASSError be = Bass.BASS_ErrorGetCode(); + Trace.TraceInformation( "WASAPI Master Volume Set Error: " + be.ToString() ); + } + else + { + // int n = this.nMasterVolume; + // Trace.TraceInformation( "WASAPI Master Volume Set Success: " + value ); + + } + } + } + // 繝。繧ス繝繝 + + /// + /// WASAPI縺ョ蛻晄悄蛹 + /// + /// + /// (譛ェ菴ソ逕ィ; 譛ャ繝。繧ス繝繝牙縺ァ閾ェ蜍戊ィュ螳壹☆繧) + /// (譛ェ菴ソ逕ィ; 譛ャ繝。繧ス繝繝牙縺ァ閾ェ蜍戊ィュ螳壹☆繧) + public CSoundDeviceWASAPI( E繝繝舌う繧ケ繝「繝シ繝 mode, long n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms, long n譖エ譁ー髢馴囈ms ) + { + // 蛻晄悄蛹悶 + + Trace.TraceInformation( "BASS (WASAPI) 縺ョ蛻晄悄蛹悶r髢句ァ九@縺セ縺吶" ); + + this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.Unknown; + this.n螳溷コ蜉幃≦蟒カms = 0; + this.n邨碁℃譎る俣ms = 0; + this.n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms = CTimer.n譛ェ菴ソ逕ィ; + this.tm繧キ繧ケ繝繝繧ソ繧、繝 = new CTimer( CTimer.E遞ョ蛻・.MultiMedia ); + this.b譛蛻昴ョ螳溷コ蜉幃≦蟒カ邂怜コ = true; + + #region [ BASS registration ] + // BASS.NET 繝ヲ繝シ繧カ逋サ骭イシBASS繧ケ繝励Λ繝繧キ繝・縺碁撼陦ィ遉コ縺ォ縺ェ繧具シ峨 + + BassNet.Registration( "dtx2013@gmail.com", "2X9181017152222" ); + #endregion + + #region [ BASS Version Check ] + // BASS 縺ョ繝舌シ繧ク繝ァ繝ウ繝√ぉ繝繧ッ縲 + int nBASSVersion = Utils.HighWord( Bass.BASS_GetVersion() ); + if( nBASSVersion != Bass.BASSVERSION ) + throw new DllNotFoundException( string.Format( "bass.dll 縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧翫∪縺({0})縲ゅ%縺ョ繝励Ο繧ー繝ゥ繝縺ッ繝舌シ繧ク繝ァ繝ウ{1}縺ァ蜍穂ス懊@縺セ縺吶", nBASSVersion, Bass.BASSVERSION ) ); + + int nBASSMixVersion = Utils.HighWord( BassMix.BASS_Mixer_GetVersion() ); + if( nBASSMixVersion != BassMix.BASSMIXVERSION ) + throw new DllNotFoundException( string.Format( "bassmix.dll 縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧翫∪縺({0})縲ゅ%縺ョ繝励Ο繧ー繝ゥ繝縺ッ繝舌シ繧ク繝ァ繝ウ{1}縺ァ蜍穂ス懊@縺セ縺吶", nBASSMixVersion, BassMix.BASSMIXVERSION ) ); + + int nBASSWASAPIVersion = Utils.HighWord( BassWasapi.BASS_WASAPI_GetVersion() ); + if( nBASSWASAPIVersion != BassWasapi.BASSWASAPIVERSION ) + throw new DllNotFoundException( string.Format( "basswasapi.dll 縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧翫∪縺({0})縲ゅ%縺ョ繝励Ο繧ー繝ゥ繝縺ッ繝舌シ繧ク繝ァ繝ウ{1}縺ァ蜍穂ス懊@縺セ縺吶", nBASSWASAPIVersion, BassWasapi.BASSWASAPIVERSION ) ); + #endregion + + // BASS 縺ョ險ュ螳壹 + + this.bIsBASSFree = true; + + if (!Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0 )) // 0:BASS繧ケ繝医Μ繝シ繝縺ョ閾ェ蜍墓峩譁ー繧定。後o縺ェ縺縲 + { + Trace.TraceWarning($"BASS_SetConfig({nameof(BASSConfig.BASS_CONFIG_UPDATEPERIOD)}) 縺ォ螟ア謨励@縺セ縺励◆縲[{Bass.BASS_ErrorGetCode()}]"); + } + if (!Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATETHREADS, 0 )) // 0:BASS繧ケ繝医Μ繝シ繝縺ョ閾ェ蜍墓峩譁ー繧定。後o縺ェ縺縲 + { + Trace.TraceWarning($"BASS_SetConfig({nameof(BASSConfig.BASS_CONFIG_UPDATETHREADS)}) 縺ォ螟ア謨励@縺セ縺励◆縲[{Bass.BASS_ErrorGetCode()}]"); + } + + // BASS 縺ョ蛻晄悄蛹悶 + + int n繝繝舌う繧ケ = 0; // 0:"no device" 窶ヲ BASS 縺九i縺ッ繝繝舌う繧ケ縺ク繧「繧ッ繧サ繧ケ縺輔○縺ェ縺縲ゅい繧ッ繧サ繧ケ縺ッ BASSWASAPI 繧「繝峨が繝ウ縺九i陦後≧縲 + int n蜻ィ豕「謨ー = 44100; // 莉ョ豎コ繧√M繝繝舌う繧ケシ遺旺繝峨Λ繧、繝撰シ峨′繝阪う繝繧」繝悶↓蟇セ蠢懊@縺ヲ縺繧句捉豕「謨ー縺ァ縺ゅl縺ー菴輔〒繧ゅ>縺シ溘h縺縺縲BASSWASAPI縺ァ繝繝舌う繧ケ縺ョ蜻ィ豕「謨ー縺ッ螟峨∴繧峨l繧九ゅ>縺壹l縺ォ縺励mBASSMX縺ァ閾ェ蜍慕噪縺ォ繝ェ繧オ繝ウ繝励Μ繝ウ繧ー縺輔l繧九 + if( !Bass.BASS_Init( n繝繝舌う繧ケ, n蜻ィ豕「謨ー, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero ) ) + throw new Exception( string.Format( "BASS (WASAPI) 縺ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲(BASS_Init)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) ); + + Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_CURVE_VOL, true); + + #region [ 繝繝舌ャ繧ー逕ィ: WASAPI繝繝舌う繧ケ縺ョenumerate縺ィ縲√Ο繧ー蜃コ蜉 ] + // (繝繝舌ャ繧ー逕ィ) + //Trace.TraceInformation( "WASAPI繝繝舌う繧ケ荳隕ァ:" ); + //int a, count = 0; + //BASS_WASAPI_DEVICEINFO wasapiDevInfo; + //for ( a = 0; ( wasapiDevInfo = BassWasapi.BASS_WASAPI_GetDeviceInfo( a ) ) != null; a++ ) + //{ + // if ( ( wasapiDevInfo.flags & BASSWASAPIDeviceInfo.BASS_DEVICE_INPUT ) == 0 // device is an output device (not input) + // && ( wasapiDevInfo.flags & BASSWASAPIDeviceInfo.BASS_DEVICE_ENABLED ) != 0 ) // and it is enabled + // { + // Trace.TraceInformation( "WASAPI Device #{0}: {1}", a, wasapiDevInfo.name ); + // count++; // count it + // } + //} + #endregion + + // BASS WASAPI 縺ョ蛻晄悄蛹悶 + + n繝繝舌う繧ケ = -1; + n蜻ィ豕「謨ー = 0; // 繝繝輔か繝ォ繝医ョ繝舌う繧ケ縺ョ蜻ィ豕「謨ー (0="mix format" sample rate) + int n繝√Ε繝ウ繝阪Ν謨ー = 0; // 繝繝輔か繝ォ繝医ョ繝舌う繧ケ縺ョ繝√Ε繝ウ繝阪Ν謨ー (0="mix format" channels) + this.tWasapiProc = new WASAPIPROC( this.tWASAPI蜃ヲ逅 ); // 繧「繝ウ繝槭ロ繝シ繧ク縺ォ貂。縺 delegate 縺ッ縲√ヵ繧」繝シ繝ォ繝峨→縺励※菫晄戟縺励※縺翫°縺ェ縺縺ィGC縺ァ繧「繝峨Ξ繧ケ縺悟、峨o縺」縺ヲ縺励∪縺縲 + + // WASAPI縺ョ譖エ譁ー髢馴囈(period)縺ッ縲√ヰ繝繝輔ぃ繧オ繧、繧コ縺ォ繧ょスア髻ソ繧剃ク弱∴繧九 + // 譖エ譁ー髢馴囈繧呈怙蟆上↓縺吶k縺ォ縺ッ縲。assWasapi.BASS_WASAPI_GetDeviceInfo( ndevNo ).minperiod 縺ョ蛟、繧剃スソ縺医ー繧医>縲 + // 縺薙l繧偵d繧峨↑縺縺ィ縲∵峩譁ー髢馴囈ms=6ms 縺ィ縺ェ繧翫√ヰ繝繝輔ぃ繧オ繧、繧コ繧 6ms x 4 = 24ms繧医j蟆上&縺上〒縺阪↑縺縲 + #region [ 譌「螳壹ョ蜃コ蜉帙ョ繝舌う繧ケ縺ィ險ュ螳壹&繧後※縺繧妓ASAPI繝繝舌う繧ケ繧呈、懃エ「縺励∵峩譁ー髢馴囈ms繧定ィュ螳壹〒縺阪k譛蟆丞、縺ォ縺吶k ] + int nDevNo = -1; + BASS_WASAPI_DEVICEINFO deviceInfo; + for ( int n = 0; ( deviceInfo = BassWasapi.BASS_WASAPI_GetDeviceInfo( n ) ) != null; n++ ) + { + if ( deviceInfo.IsDefault ) + { + nDevNo = n; + break; + } + } + if ( nDevNo != -1 ) + { + // Trace.TraceInformation( "Selected Default WASAPI Device: {0}", deviceInfo.name ); + // Trace.TraceInformation( "MinPeriod={0}, DefaultPeriod={1}", deviceInfo.minperiod, deviceInfo.defperiod ); + n譖エ譁ー髢馴囈ms = (long) ( deviceInfo.minperiod * 1000 ); + if ( n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms <= 0 || n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms < n譖エ譁ー髢馴囈ms + 1 ) + { + n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms = n譖エ譁ー髢馴囈ms + 1; // 2013.4.25 #31237 yyagi; 繝舌ャ繝輔ぃ繧オ繧、繧コ險ュ螳壹ョ螳悟ィ閾ェ蜍募喧縲よ峩譁ー髢馴囈シ昴ヰ繝繝輔ぃ繧オ繧、繧コ縺ォ縺吶k縺ィBASS_ERROR_UNKNOWN縺ォ縺ェ繧九ョ縺ァ+1縺吶k縲 + } + } + else + { + Trace.TraceError( "Error: Default WASAPI Device is not found." ); + } + #endregion + +//Retry: + var flags = ( mode == E繝繝舌う繧ケ繝「繝シ繝.謗剃サ ) ? BASSWASAPIInit.BASS_WASAPI_AUTOFORMAT | BASSWASAPIInit.BASS_WASAPI_EXCLUSIVE : BASSWASAPIInit.BASS_WASAPI_AUTOFORMAT; + //var flags = ( mode == E繝繝舌う繧ケ繝「繝シ繝.謗剃サ ) ? BASSWASAPIInit.BASS_WASAPI_AUTOFORMAT | BASSWASAPIInit.BASS_WASAPI_EVENT | BASSWASAPIInit.BASS_WASAPI_EXCLUSIVE : BASSWASAPIInit.BASS_WASAPI_AUTOFORMAT | BASSWASAPIInit.BASS_WASAPI_EVENT; + if ( BassWasapi.BASS_WASAPI_Init( n繝繝舌う繧ケ, n蜻ィ豕「謨ー, n繝√Ε繝ウ繝阪Ν謨ー, flags, ( n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms / 1000.0f ), ( n譖エ譁ー髢馴囈ms / 1000.0f ), this.tWasapiProc, IntPtr.Zero ) ) + { + if( mode == E繝繝舌う繧ケ繝「繝シ繝.謗剃サ ) + { + #region [ 謗剃サ悶Δ繝シ繝峨〒菴懈先仙粥縲] + //----------------- + this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.ExclusiveWASAPI; + + nDevNo = BassWasapi.BASS_WASAPI_GetDevice(); + deviceInfo = BassWasapi.BASS_WASAPI_GetDeviceInfo( nDevNo ); + var wasapiInfo = BassWasapi.BASS_WASAPI_GetInfo(); + int n1繧オ繝ウ繝励Ν縺ョ繝舌う繝域焚 = 2 * wasapiInfo.chans; // default; + switch( wasapiInfo.format ) // BASS WASAPI 縺ァ謇ア縺繧オ繝ウ繝励Ν縺ッ縺吶∋縺ヲ 32bit float 縺ァ蝗コ螳壹&繧後※縺繧九′縲√ョ繝舌う繧ケ縺ッ縺昴≧縺ィ縺ッ髯舌i縺ェ縺縲 + { + case BASSWASAPIFormat.BASS_WASAPI_FORMAT_8BIT: n1繧オ繝ウ繝励Ν縺ョ繝舌う繝域焚 = 1 * wasapiInfo.chans; break; + case BASSWASAPIFormat.BASS_WASAPI_FORMAT_16BIT: n1繧オ繝ウ繝励Ν縺ョ繝舌う繝域焚 = 2 * wasapiInfo.chans; break; + case BASSWASAPIFormat.BASS_WASAPI_FORMAT_24BIT: n1繧オ繝ウ繝励Ν縺ョ繝舌う繝域焚 = 3 * wasapiInfo.chans; break; + case BASSWASAPIFormat.BASS_WASAPI_FORMAT_32BIT: n1繧オ繝ウ繝励Ν縺ョ繝舌う繝域焚 = 4 * wasapiInfo.chans; break; + case BASSWASAPIFormat.BASS_WASAPI_FORMAT_FLOAT: n1繧オ繝ウ繝励Ν縺ョ繝舌う繝域焚 = 4 * wasapiInfo.chans; break; + } + int n1遘偵ョ繝舌う繝域焚 = n1繧オ繝ウ繝励Ν縺ョ繝舌う繝域焚 * wasapiInfo.freq; + this.n螳溘ヰ繝繝輔ぃ繧オ繧、繧コms = (long) ( wasapiInfo.buflen * 1000.0f / n1遘偵ョ繝舌う繝域焚 ); + this.n螳溷コ蜉幃≦蟒カms = 0; // 蛻晄悄蛟、縺ッ繧シ繝ュ + Trace.TraceInformation( "菴ソ逕ィ繝繝舌う繧ケ: #" + nDevNo + " : " + deviceInfo.name + ", flags=" + deviceInfo.flags ); + Trace.TraceInformation( "BASS 繧貞晄悄蛹悶@縺セ縺励◆縲(WASAPI謗剃サ悶Δ繝シ繝, {0}Hz, {1}ch, 繝輔か繝シ繝槭ャ繝:{2}, 繝舌ャ繝輔ぃ{3}bytes [{4}ms(蟶梧悍{5}ms)], 譖エ譁ー髢馴囈{6}ms)", + wasapiInfo.freq, + wasapiInfo.chans, + wasapiInfo.format.ToString(), + wasapiInfo.buflen, + n螳溘ヰ繝繝輔ぃ繧オ繧、繧コms.ToString(), + n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms.ToString(), + n譖エ譁ー髢馴囈ms.ToString() ); + Trace.TraceInformation( "繝繝舌う繧ケ縺ョ譛蟆乗峩譁ー譎る俣={0}ms, 譌「螳壹ョ譖エ譁ー譎る俣={1}ms", deviceInfo.minperiod * 1000, deviceInfo.defperiod * 1000 ); + this.bIsBASSFree = false; + //----------------- + #endregion + } + else + { + #region [ 蜈ア譛峨Δ繝シ繝峨〒菴懈先仙粥縲] + //----------------- + this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.SharedWASAPI; + + this.n螳溷コ蜉幃≦蟒カms = 0; // 蛻晄悄蛟、縺ッ繧シ繝ュ + var devInfo = BassWasapi.BASS_WASAPI_GetDeviceInfo( BassWasapi.BASS_WASAPI_GetDevice() ); // 蜈ア譛峨Δ繝シ繝峨ョ蝣エ蜷医∵峩譁ー髢馴囈縺ッ繝繝舌う繧ケ縺ョ繝繝輔か繝ォ繝亥、縺ォ蝗コ螳壹&繧後k縲 + Trace.TraceInformation( "BASS 繧貞晄悄蛹悶@縺セ縺励◆縲(WASAPI蜈ア譛峨Δ繝シ繝, {0}ms, 譖エ譁ー髢馴囈{1}ms)", n蟶梧悍繝舌ャ繝輔ぃ繧オ繧、繧コms, devInfo.defperiod * 1000.0f ); + this.bIsBASSFree = false; + //----------------- + #endregion + } + } + #region [ #31737 WASAPI謗剃サ悶Δ繝シ繝峨ョ縺ソ蛻ゥ逕ィ蜿ッ閭ス縺ィ縺励仝ASAPI蜈ア譛峨Δ繝シ繝峨ッ菴ソ逕ィ縺ァ縺阪↑縺繧医≧縺ォ縺吶k縺溘a縺ォ縲仝ASAPI蜈ア譛峨Δ繝シ繝峨〒縺ョ蛻晄悄蛹悶ヵ繝ュ繝シ繧貞炎髯、縺吶k縲 ] + //else if ( mode == E繝繝舌う繧ケ繝「繝シ繝.謗剃サ ) + //{ + // Trace.TraceInformation("Failed to initialize setting BASS (WASAPI) mode [{0}]", Bass.BASS_ErrorGetCode().ToString() ); + // #region [ 謗剃サ悶Δ繝シ繝峨↓螟ア謨励@縺溘ョ縺ェ繧牙ア譛峨Δ繝シ繝峨〒繝ェ繝医Λ繧、縲] + // //----------------- + // mode = E繝繝舌う繧ケ繝「繝シ繝.蜈ア譛; + // goto Retry; + // //----------------- + // #endregion + //} + #endregion + else + { + #region [ 縺昴l縺ァ繧ょ、ア謨励@縺溘i萓句、也匱逕溘] + //----------------- + BASSError errcode = Bass.BASS_ErrorGetCode(); + Bass.BASS_Free(); + this.bIsBASSFree = true; + throw new Exception( string.Format( "BASS (WASAPI) 縺ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲(BASS_WASAPI_Init)[{0}]", errcode ) ); + //----------------- + #endregion + } + + + // WASAPI蜃コ蜉帙→蜷後§繝輔か繝シ繝槭ャ繝医r謖√▽ BASS 繝溘く繧オ繝シ繧剃ス懈舌 + + var info = BassWasapi.BASS_WASAPI_GetInfo(); + this.hMixer = BassMix.BASS_Mixer_StreamCreate( + info.freq, + info.chans, + BASSFlag.BASS_MIXER_NONSTOP | BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_STREAM_DECODE ); // 繝繧ウ繝シ繝峨ョ縺ソシ晉匱螢ー縺励↑縺縲8ASAPI縺ォ蜃コ蜉帙&繧後k縺縺代 + if ( this.hMixer == 0 ) + { + BASSError errcode = Bass.BASS_ErrorGetCode(); + BassWasapi.BASS_WASAPI_Free(); + Bass.BASS_Free(); + this.bIsBASSFree = true; + throw new Exception( string.Format( "BASS繝溘く繧オ(mixing)縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲[{0}]", errcode ) ); + } + + + // BASS 繝溘く繧オ繝シ縺ョ1遘偵≠縺溘j縺ョ繝舌う繝域焚繧堤ョ怜コ縲 + + var mixerInfo = Bass.BASS_ChannelGetInfo( this.hMixer ); + long n繝溘く繧オ繝シ縺ョ1繧オ繝ウ繝励Ν縺ゅ◆繧翫ョ繝舌う繝域焚 = mixerInfo.chans * 4; // 4 = sizeof(FLOAT) + this.n繝溘く繧オ繝シ縺ョ1遘偵≠縺溘j縺ョ繝舌う繝域焚 = n繝溘く繧オ繝シ縺ョ1繧オ繝ウ繝励Ν縺ゅ◆繧翫ョ繝舌う繝域焚 * mixerInfo.freq; + + + + // 蜊倡エ斐↓縲”Mixer縺ョ髻ウ驥上rMasterVolume縺ィ縺励※蛻カ蠕。縺励※繧ゅ + // ChannelGetData()縺ョ蜀螳ケ縺ォ縺ッ蜿肴丐縺輔l縺ェ縺縲 + // 縺昴ョ縺溘a縲√b縺荳谿オmixer繧貞剱縺セ縺帙※縲∽ク谿オ蜈医ョmixer縺九iChannelGetData()縺吶k縺薙→縺ァ縲 + // hMixer縺ョ髻ウ驥丞宛蠕。繧貞渚譏縺輔○繧九 + this.hMixer_DeviceOut = BassMix.BASS_Mixer_StreamCreate( + info.freq, + info.chans, + BASSFlag.BASS_MIXER_NONSTOP | BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_STREAM_DECODE ); // 繝繧ウ繝シ繝峨ョ縺ソシ晉匱螢ー縺励↑縺縲8ASAPI縺ォ蜃コ蜉帙&繧後k縺縺代 + if ( this.hMixer_DeviceOut == 0 ) + { + BASSError errcode = Bass.BASS_ErrorGetCode(); + BassWasapi.BASS_WASAPI_Free(); + Bass.BASS_Free(); + this.bIsBASSFree = true; + throw new Exception( string.Format( "BASS繝溘く繧オ(譛邨よョオ)縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲[{0}]", errcode ) ); + } + + { + bool b1 = BassMix.BASS_Mixer_StreamAddChannel( this.hMixer_DeviceOut, this.hMixer, BASSFlag.BASS_DEFAULT ); + if ( !b1 ) + { + BASSError errcode = Bass.BASS_ErrorGetCode(); + BassWasapi.BASS_WASAPI_Free(); + Bass.BASS_Free(); + this.bIsBASSFree = true; + throw new Exception( string.Format( "BASS繝溘く繧オ(譛邨よョオ縺ィmixing)縺ョ謗・邯壹↓螟ア謨励@縺セ縺励◆縲[{0}]", errcode ) ); + }; + } + + + // 蜃コ蜉帙r髢句ァ九 + + BassWasapi.BASS_WASAPI_Start(); + } + #region [ t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧() ] + public CSound t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, ESoundGroup soundGroup ) + { + var sound = new CSound(soundGroup); + sound.tWASAPI繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( str繝輔ぃ繧、繝ォ蜷, this.hMixer, this.e蜃コ蜉帙ョ繝舌う繧ケ ); + return sound; + } + + public void t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, CSound sound ) + { + sound.tWASAPI繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( str繝輔ぃ繧、繝ォ蜷, this.hMixer, this.e蜃コ蜉帙ョ繝舌う繧ケ ); + } + public void t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, CSound sound ) + { + sound.tWASAPI繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, this.hMixer, this.e蜃コ蜉帙ョ繝舌う繧ケ ); + } + #endregion + + #region [ Dispose-Finallize繝代ち繝シ繝ウ螳溯」 ] + //----------------- + public void Dispose() + { + this.Dispose( true ); + GC.SuppressFinalize( this ); + } + protected void Dispose( bool bManagedDispose ) + { + this.e蜃コ蜉帙ョ繝舌う繧ケ = ESoundDeviceType.Unknown; // 縺セ縺壼コ蜉帛●豁「縺吶k(Dispose荳ュ縺ォ繧ッ繝ゥ繧ケ蜀縺ォ繧「繧ッ繧サ繧ケ縺輔l繧九%縺ィ繧帝亟縺) + if ( hMixer != -1 ) + { + Bass.BASS_StreamFree( this.hMixer ); + } + if ( !this.bIsBASSFree ) + { + BassWasapi.BASS_WASAPI_Free(); // 繧キ繧ケ繝繝繧ソ繧、繝槭h繧雁医↓蜻シ縺ウ蜃コ縺吶%縺ィ縲ゑシtWasapi蜃ヲ逅() 縺ョ荳ュ縺ァ繧キ繧ケ繝繝繧ソ繧、繝槭r蜿らァ縺励※繧九◆繧シ + Bass.BASS_Free(); + } + if( bManagedDispose ) + { + C蜈ア騾.tDispose縺吶k( this.tm繧キ繧ケ繝繝繧ソ繧、繝 ); + this.tm繧キ繧ケ繝繝繧ソ繧、繝 = null; + } + } + ~CSoundDeviceWASAPI() + { + this.Dispose( false ); + } + //----------------- + #endregion + + protected int hMixer = -1; + protected int hMixer_DeviceOut = -1; + protected WASAPIPROC tWasapiProc = null; + + protected int tWASAPI蜃ヲ逅( IntPtr buffer, int length, IntPtr user ) + { + // BASS繝溘く繧オ縺九i縺ョ蜃コ蜉帙ョ繝シ繧ソ繧偵◎縺ョ縺セ縺セ WASAPI buffer 縺ク荳ク謚輔£縲 + + int num = Bass.BASS_ChannelGetData( this.hMixer_DeviceOut, buffer, length ); // num = 螳滄圀縺ォ霆「騾√@縺滄聞縺 + if ( num == -1 ) num = 0; + + + // 邨碁℃譎る俣繧呈峩譁ー縲 + // 繝繝シ繧ソ縺ョ霆「騾∝キョ蛻縺ァ縺ッ縺ェ縺冗エッ遨崎サ「騾√ヰ繧、繝域焚縺九i邂怜コ縺吶k縲 + + int n譛ェ蜀咲函繝舌う繝域焚 = BassWasapi.BASS_WASAPI_GetData( null, (int) BASSData.BASS_DATA_AVAILABLE ); // 隱、蟾ョ蜑頑ク帙ョ縺溘a縲∝ソ隕√→縺ェ繧九ぐ繝ェ繧ョ繝ェ逶エ蜑阪↓蜿門セ励☆繧九 + this.n邨碁℃譎る俣ms = ( this.n邏ッ遨崎サ「騾√ヰ繧、繝域焚 - n譛ェ蜀咲函繝舌う繝域焚 ) * 1000 / this.n繝溘く繧オ繝シ縺ョ1遘偵≠縺溘j縺ョ繝舌う繝域焚; + this.n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms = this.tm繧キ繧ケ繝繝繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms; + + // 螳溷コ蜉幃≦蟒カ繧呈峩譁ー縲 + // 譛ェ蜀咲函繝舌う繝域焚縺ョ蟷ウ蝮蛟、縲 + + long n莉雁屓縺ョ驕蟒カms = n譛ェ蜀咲函繝舌う繝域焚 * 1000 / this.n繝溘く繧オ繝シ縺ョ1遘偵≠縺溘j縺ョ繝舌う繝域焚; + this.n螳溷コ蜉幃≦蟒カms = ( this.b譛蛻昴ョ螳溷コ蜉幃≦蟒カ邂怜コ ) ? n莉雁屓縺ョ驕蟒カms : ( this.n螳溷コ蜉幃≦蟒カms + n莉雁屓縺ョ驕蟒カms ) / 2; + this.b譛蛻昴ョ螳溷コ蜉幃≦蟒カ邂怜コ = false; + + + // 邨碁℃譎る俣繧呈峩譁ー蠕後↓縲∽サ雁屓蛻縺ョ邏ッ遨崎サ「騾√ヰ繧、繝域焚繧貞渚譏縲 + + this.n邏ッ遨崎サ「騾√ヰ繧、繝域焚 += num; + return num; + } + + private long n繝溘く繧オ繝シ縺ョ1遘偵≠縺溘j縺ョ繝舌う繝域焚 = 0; + private long n邏ッ遨崎サ「騾√ヰ繧、繝域焚 = 0; + private bool b譛蛻昴ョ螳溷コ蜉幃≦蟒カ邂怜コ = true; + private bool bIsBASSFree = true; + } +} diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundTimer.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundTimer.cs new file mode 100644 index 00000000..86060758 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/CSoundTimer.cs @@ -0,0 +1,214 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Runtime.InteropServices; +using System.Diagnostics; + +namespace FDK +{ + public class CSoundTimer : CTimerBase + { + public override long n繧キ繧ケ繝繝譎ょ綾ms + { + get + { + if( this.Device.e蜃コ蜉帙ョ繝舌う繧ケ == ESoundDeviceType.ExclusiveWASAPI || + this.Device.e蜃コ蜉帙ョ繝舌う繧ケ == ESoundDeviceType.SharedWASAPI || + this.Device.e蜃コ蜉帙ョ繝舌う繧ケ == ESoundDeviceType.ASIO ) + { + // BASS 邉サ縺ョ ISoundDevice.n邨碁℃譎る俣ms 縺ッ繧ェ繝シ繝繧」繧ェ繝舌ャ繝輔ぃ縺ョ譖エ譁ー髢馴囈縺壹▽縺ァ縺励°譖エ譁ー縺輔l縺ェ縺縺溘a縲∝腰縺ォ縺薙l繧定ソ斐☆縺縺代〒縺ッ縺ィ縺ウ縺ィ縺ウ縺ョ蛟、縺ォ縺ェ繧九 + // 縺昴%縺ァ縲∵峩譁ー髢馴囈縺ョ譛荳ュ縺ォ蜻シ縺ー繧後◆蝣エ蜷医ッ縲√す繧ケ繝繝繧ソ繧、繝槭r菴ソ縺」縺ヲ陬憺俣縺吶k縲 + // 縺薙ョ蝣エ蜷医ョ邨碁℃譎る俣縺ィ縺ョ隱、蟾ョ縺ッ譖エ譁ー髢馴囈莉・蜀縺ォ蜿弱∪繧九ョ縺ァ蝠城。後↑縺縺ィ蛻、譁ュ縺吶k縲 + // 縺溘□縺励、SIO縺ョ蝣エ蜷医ッ縲∬サ「騾|yte謨ー縺九i譎る俣邂怜コ縺励※縺繧九◆繧√、SIO縺ョ髻ウ螢ー蜷域仙ヲ逅縺ョ雋闕キ縺悟、ァ縺阪☆縺弱k蝣エ蜷(蜃ヲ逅譎る俣縺悟ョ滓凾髢薙r雜縺医※縺繧句エ蜷)縺ッ + // 蜍穂ス懊′縺翫°縺励¥縺ェ繧九(蜈キ菴鍋噪縺ォ縺ッ縲√%縺薙〒霑斐☆繧ソ繧、繝槭シ蛟、縺ョ騾陦後′逋コ逕溘@縲√せ繧ッ繝ュ繝シ繝ォ縺悟キサ縺肴綾繧) + // 縺薙ョ蝣エ蜷医ョ蟇セ遲悶ッ縲、SIO縺ョ繝舌ャ繝輔ぃ驥上r蠅励d縺励※縲、SIO縺ョ髻ウ螢ー蜷域仙ヲ逅縺ョ雋闕キ繧剃ク九£繧九%縺ィ縲 + + if ( this.Device.n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms == CTimer.n譛ェ菴ソ逕ィ ) // #33890 2014.5.27 yyagi + { + // 迺ー蠅縺ォ繧医▲縺ヲ縺ッ縲、SIO繝吶シ繧ケ縺ョ貍泌・上ち繧、繝槭シ縺悟虚菴懊☆繧句燕(縺、縺セ繧晦SIO縺ョ繧オ繧ヲ繝ウ繝芽サ「騾√′蟋九∪繧句燕)縺ォ + // DTX繝繝シ繧ソ縺ョ貍泌・上′蟋九∪繧句エ蜷医′縺ゅk縲 + // 縺昴ョ蝣エ蜷医"this.Device.n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾" 縺梧ュ」縺励>蛟、縺ァ縺ェ縺縺溘a縲 + // 貍泌・上ち繧、繝槭ョ蛟、縺梧ュ」縺励>繧ゅョ縺ィ縺ッ縺ェ繧峨↑縺縲ゅ◎縺励※縲∵シ泌・上ち繧、繝槭シ縺ョ蜍穂ス懊′蟋九∪繧九→蜷梧凾縺ォ縲 + // 貍泌・上ち繧、繝槭ョ蛟、縺後☆縺」鬟帙カ(讌オ遶ッ縺ェ雋縺ョ蛟、縺ォ縺ェ繧)縺溘a縲∵シ泌・上ョ縺ソ縺ェ繧峨★逕サ髱「陦ィ遉コ繧ゅ&繧後↑縺迥カ諷九→縺ェ繧九 + // (逕サ髱「陦ィ遉コ縺ッ繧ソ繧、繝槭ョ蛟、縺ォ騾」蜍輔@縺ヲ陦後o繧後k縺後0莉・荳翫ョ繧ソ繧、繝槫、縺ォ蜷医o縺帙※蜍穂ス懊☆繧九◆繧√ + // 荳阪ョ蛟、縺梧擂繧九→逕サ髱「縺ォ菴輔b陦ィ遉コ縺輔l縺ェ縺上↑繧) + + // 縺昴%縺ァ縲∵シ泌・上ち繧、繝槭′蜍穂ス懊r蟋九a繧句燕(this.Device.n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms == CTimer.n譛ェ菴ソ逕ィ)縺ッ縲 + // 陬懈ュ」驛ィ蛻繧偵ぞ繝ュ縺ォ縺励※縲]邨碁℃譎る俣ms縺縺代r霑斐☆繧医≧縺ォ縺吶k縲 + // 縺薙≧縺吶k縺薙→縺ァ縲∵シ泌・上ち繧、繝槭′蜍穂ス懊r蟋九a縺ヲ繧ゅ∫エ邯サ縺励↑縺上↑繧九 + return this.Device.n邨碁℃譎る俣ms; + } + else + { + if ( FDK.CSound邂。逅.bUseOSTimer ) + //if ( true ) + { + return ctDInputTimer.n繧キ繧ケ繝繝譎ょ綾ms; // 莉ョ縺ォCSoundTimer繧辰Timer逶ク蠖薙ョ蜍穂ス懊↓縺励※縺ソ縺 + } + else + { + return this.Device.n邨碁℃譎る俣ms + + ( this.Device.tm繧キ繧ケ繝繝繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms - this.Device.n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms ); + } + } + } + else if( this.Device.e蜃コ蜉帙ョ繝舌う繧ケ == ESoundDeviceType.DirectSound ) + { + //return this.Device.n邨碁℃譎る俣ms; // #24820 2013.2.3 yyagi TESTCODE DirectSound縺ァ繧ケ繧ッ繝ュ繝シ繝ォ縺梧サ代i縺九↓縺ェ繧峨↑縺縺溘a縲 + return ct.n繧キ繧ケ繝繝譎ょ綾ms; // 莉ョ縺ォCSoundTimer繧辰Timer逶ク蠖薙ョ蜍穂ス懊↓縺励※縺ソ縺 + } + return CTimerBase.n譛ェ菴ソ逕ィ; + } + } + + internal CSoundTimer( ISoundDevice device ) + { + this.Device = device; + + if ( this.Device.e蜃コ蜉帙ョ繝舌う繧ケ != ESoundDeviceType.DirectSound ) + { + TimerCallback timerDelegate = new TimerCallback( SnapTimers ); // CSoundTimer繧偵す繧ケ繝繝譎ょ綾縺ォ螟画鋤縺吶k縺溘a縺ォ縲 + timer = new Timer( timerDelegate, null, 0, 1000 ); // CSoundTimer縺ィCTimer繧剃ク。譁ケ縺ィ繧りオー繧峨○縺ヲ縺翫″縲 + ctDInputTimer = new CTimer( CTimer.E遞ョ蛻・.MultiMedia ); // 1遘偵↓1蝗樊凾蟾ョ繧呈クャ螳壹☆繧九h縺縺ォ縺励※縺翫¥ + } + else // TESTCODE DirectSound譎ゅョ縺ソ縲,SoundTimer縺ァ縺ェ縺修Timer繧剃スソ縺 + { + ct = new CTimer( CTimer.E遞ョ蛻・.MultiMedia ); + } + } + + private void SnapTimers(object o) // 1遘偵↓1蝗槫他縺ウ蜃コ縺輔l縲2縺、縺ョ繧ソ繧、繝槭シ髢薙ョ迴セ蝨ィ蛟、繧偵◎繧後◇繧御ソ晄戟縺吶k縲 + { + if ( this.Device.e蜃コ蜉帙ョ繝舌う繧ケ != ESoundDeviceType.DirectSound ) + { + try + { + this.nDInputTimerCounter = this.ctDInputTimer.n繧キ繧ケ繝繝譎ょ綾ms; + this.nSoundTimerCounter = this.n繧キ繧ケ繝繝譎ょ綾ms; + //Debug.WriteLine( "BaseCounter: " + nDInputTimerCounter + ", " + nSoundTimerCounter ); + } + catch ( Exception e ) + // 繧オ繧ヲ繝ウ繝芽ィュ螳壼、画峩譎ゅ↓縲》imer.Dispose()縺励◆蠕後》imer縺悟ョ滄圀縺ォ蛛懈ュ「縺吶k蜑阪↓縺薙%縺ォ譚・縺ヲ縺励∪縺蝣エ蜷医′縺ゅj + // 縺昴ョ髫帙↓NullReferenceException縺檎匱逕溘☆繧 + // timer縺悟ョ滄圀縺ォ蛛懈ュ「縺励◆縺薙→繧呈、懷コ縺励※縺九i谺。縺ョ險ュ螳壹r縺吶∋縺阪□縺後∝ョ溯」縺碁屮縺励>縺溘a縲 + // 縺薙%縺ァ蜊倥↓萓句、也エ譽縺吶k縺薙→縺ァ莉」譖ソ縺吶k + { + Trace.TraceInformation( e.ToString() ); + Trace.TraceInformation("FDK: CSoundTimer.SnapTimers(): 萓句、也匱逕溘@縺セ縺励◆縺後∫カ咏カ壹@縺セ縺吶" ); + } + } + } + public long n繧オ繧ヲ繝ウ繝峨ち繧、繝槭シ縺ョ繧キ繧ケ繝繝譎ょ綾ms縺ク縺ョ螟画鋤( long nDInput縺ョ繧ソ繧、繝繧ケ繧ソ繝ウ繝 ) + { + return nDInput縺ョ繧ソ繧、繝繧ケ繧ソ繝ウ繝 - this.nDInputTimerCounter + this.nSoundTimerCounter; // Timer驕輔>縺ォ繧医k譎ょキョ繧定」懈ュ」縺吶k + } + +#if false + // 繧ュ繝シ繝懊シ繝峨う繝吶Φ繝(keybd_event縺ョ蠑墓焚縺ィ蜷梧ァ倥ョ繝繝シ繧ソ) + [StructLayout( LayoutKind.Sequential )] + private struct KEYBDINPUT + { + public ushort wVk; + public ushort wScan; + public uint dwFlags; + public uint time; + public IntPtr dwExtraInfo; + }; + // 蜷遞ョ繧、繝吶Φ繝(SendInput縺ョ蠑墓焚繝繝シ繧ソ) + [StructLayout( LayoutKind.Sequential )] + private struct INPUT + { + public int type; + public KEYBDINPUT ki; + }; + // 繧ュ繝シ謫堺ス懊√槭え繧ケ謫堺ス懊r繧キ繝溘Η繝ャ繝シ繝(謫ャ莨シ逧縺ォ謫堺ス懊☆繧) + [DllImport( "user32.dll" )] + private extern static void SendInput( + int nInputs, ref INPUT pInputs, int cbsize ); + + // 莉ョ諠ウ繧ュ繝シ繧ウ繝シ繝峨r繧ケ繧ュ繝」繝ウ繧ウ繝シ繝峨↓螟画鋤 + [DllImport( "user32.dll", EntryPoint = "MapVirtualKeyA" )] + private extern static int MapVirtualKey( + int wCode, int wMapType ); + + [DllImport( "user32.dll" )] + static extern IntPtr GetMessageExtraInfo(); + + private const int INPUT_MOUSE = 0; // 繝槭え繧ケ繧、繝吶Φ繝 + private const int INPUT_KEYBOARD = 1; // 繧ュ繝シ繝懊シ繝峨う繝吶Φ繝 + private const int INPUT_HARDWARE = 2; // 繝上シ繝峨え繧ァ繧「繧、繝吶Φ繝 + private const int KEYEVENTF_KEYDOWN = 0x0; // 繧ュ繝シ繧呈款縺 + private const int KEYEVENTF_KEYUP = 0x2; // 繧ュ繝シ繧帝屬縺 + private const int KEYEVENTF_EXTENDEDKEY = 0x1; // 諡。蠑オ繧ウ繝シ繝 + private const int KEYEVENTF_SCANCODE = 0x8; + private const int KEYEVENTF_UNIOCODE = 0x4; + private const int VK_SHIFT = 0x10; // SHIFT繧ュ繝シ + + private void pollingSendInput() + { +// INPUT[] inp = new INPUT[ 2 ]; + INPUT inp = new INPUT(); + while ( true ) + { + // (2)繧ュ繝シ繝懊シ繝(A)繧呈款縺 + //inp[0].type = INPUT_KEYBOARD; + //inp[ 0 ].ki.wVk = ( ushort ) Key.B; + //inp[ 0 ].ki.wScan = ( ushort ) MapVirtualKey( inp[ 0 ].ki.wVk, 0 ); + //inp[ 0 ].ki.dwFlags = KEYEVENTF_KEYDOWN; + //inp[ 0 ].ki.dwExtraInfo = IntPtr.Zero; + //inp[ 0 ].ki.time = 0; + inp.type = INPUT_KEYBOARD; + inp.ki.wVk = ( ushort ) Key.B; + inp.ki.wScan = ( ushort ) MapVirtualKey( inp.ki.wVk, 0 ); + inp.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYDOWN; + inp.ki.dwExtraInfo = GetMessageExtraInfo(); + inp.ki.time = 0; + + //// (3)繧ュ繝シ繝懊シ繝(A)繧帝屬縺 + //inp[ 1 ].type = INPUT_KEYBOARD; + //inp[ 1 ].ki.wVk = ( short ) Key.B; + //inp[ 1 ].ki.wScan = ( short ) MapVirtualKey( inp[ 1 ].ki.wVk, 0 ); + //inp[ 1 ].ki.dwFlags = KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP; + //inp[ 1 ].ki.dwExtraInfo = 0; + //inp[ 1 ].ki.time = 0; + + // 繧ュ繝シ繝懊シ繝画桃菴懷ョ溯。 + SendInput( 1, ref inp, Marshal.SizeOf( inp ) ); +Debug.WriteLine( "B" ); + Thread.Sleep( 1000 ); + } + } +#endif + public override void Dispose() + { + // 迚ケ縺ォ縺ェ縺暦シ ISoundDevice 縺ョ隗」謾セ縺ッ蜻シ縺ウ蜃コ縺怜縺ァ陦後≧縺薙→縲 + + //sendinput繧ケ繝ャ繝繝牙炎髯、 + if ( timer != null ) + { + timer.Change( System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite ); + // 縺薙%縺ァ縲∝ョ滄圀縺ォtimer縺悟●豁「縺励◆縺薙→繧堤「コ隱阪☆繧九さ繝シ繝峨r霑ス蜉縺吶∋縺阪□縺後√d繧頑婿繧上°繧峨★縲 + // 莉」譖ソ遲悶→縺励※縲ヾnapTimers()荳ュ縺ァ縲∽セ句、也匱逕溘r遐エ譽縺励※縺繧九 + timer.Dispose(); + timer = null; + } + if ( ct != null ) + { + ct.t荳譎ょ●豁「(); + ct.Dispose(); + ct = null; + } + } + + internal ISoundDevice Device = null; // debug縺ョ縺溘a縲∽ク譎ら噪縺ォprotected繧恥ublic縺ォ縺吶k縲ょセ後〒蜈縺ォ謌サ縺励※縺翫¥縺薙→縲 + //protected Thread thSendInput = null; + //protected Thread thSnapTimers = null; + private CTimer ctDInputTimer = null; + private long nDInputTimerCounter = 0; + private long nSoundTimerCounter = 0; + Timer timer = null; + + private CTimer ct = null; // TESTCODE + } +} diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Cmp3.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Cmp3.cs new file mode 100644 index 00000000..761122be --- /dev/null +++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Cmp3.cs @@ -0,0 +1,62 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.IO; +using System.Diagnostics; +using System.Threading; + + +namespace FDK +{ + public unsafe class Cmp3 : SoundDecoder + { +// static byte[] FOURCC = Encoding.ASCII.GetBytes( "SggO" ); // OggS 縺ョ little endian + + + #region [ SoundDecoder.dll 繧、繝ウ繝昴シ繝茨シmpr 髢「騾」シ云 + //----------------- + [DllImport( "SoundDecoder.dll" )] + private static extern void mp3Close( int nHandle ); + [DllImport( "SoundDecoder.dll" )] + private static extern int mp3Decode( int nHandle, IntPtr pDest, uint szDestSize, int bLoop ); + [DllImport( "SoundDecoder.dll" )] + private static extern int mp3GetFormat( int nHandle, ref CWin32.WAVEFORMATEX wfx ); + [DllImport( "SoundDecoder.dll" )] + private static extern uint mp3GetTotalPCMSize( int nHandle ); + [DllImport( "SoundDecoder.dll" )] + private static extern int mp3Open( string fileName ); + [DllImport( "SoundDecoder.dll" )] + private static extern int mp3Seek( int nHandle, uint dwPosition ); + //----------------- + #endregion + + + public override int Open( string filename ) + { + return mp3Open( filename ); + } + public override int GetFormat( int nHandle, ref CWin32.WAVEFORMATEX wfx ) + { + return mp3GetFormat( nHandle, ref wfx ); + } + public override uint GetTotalPCMSize( int nHandle ) + { + return mp3GetTotalPCMSize( nHandle ); + } + public override int Seek( int nHandle, uint dwPosition ) + { + return mp3Seek( nHandle, dwPosition ); + } + public override int Decode( int nHandle, IntPtr pDest, uint szDestSize, int bLoop ) + { + return mp3Decode( nHandle, pDest, szDestSize, bLoop ); + } + + public override void Close( int nHandle ) + { + mp3Close( nHandle ); + } + + } +} diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Cogg.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Cogg.cs new file mode 100644 index 00000000..c99b9ebe --- /dev/null +++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Cogg.cs @@ -0,0 +1,62 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.IO; +using System.Diagnostics; +using System.Threading; + + +namespace FDK +{ + public unsafe class Cogg : SoundDecoder + { + static byte[] FOURCC = Encoding.ASCII.GetBytes( "SggO" ); // OggS 縺ョ little endian + + + #region [ SoundDecoder.dll 繧、繝ウ繝昴シ繝茨シogg 髢「騾」シ云 + //----------------- + [DllImport( "SoundDecoder.dll" )] + private static extern void oggClose( int nHandle ); + [DllImport( "SoundDecoder.dll" )] + private static extern int oggDecode( int nHandle, IntPtr pDest, uint szDestSize, int bLoop ); + [DllImport( "SoundDecoder.dll" )] + private static extern int oggGetFormat( int nHandle, ref CWin32.WAVEFORMATEX wfx ); + [DllImport( "SoundDecoder.dll" )] + private static extern uint oggGetTotalPCMSize( int nHandle ); + [DllImport( "SoundDecoder.dll" )] + private static extern int oggOpen( string fileName ); + [DllImport( "SoundDecoder.dll" )] + private static extern int oggSeek( int nHandle, uint dwPosition ); + //----------------- + #endregion + + + public override int Open( string filename ) + { + return oggOpen( filename ); + } + public override int GetFormat( int nHandle, ref CWin32.WAVEFORMATEX wfx ) + { + return oggGetFormat( nHandle, ref wfx ); + } + public override uint GetTotalPCMSize( int nHandle ) + { + return oggGetTotalPCMSize( nHandle ); + } + public override int Seek( int nHandle, uint dwPosition ) + { + return oggSeek( nHandle, dwPosition ); + } + public override int Decode( int nHandle, IntPtr pDest, uint szDestSize, int bLoop ) + { + return oggDecode( nHandle, pDest, szDestSize, bLoop ); + } + + public override void Close( int nHandle ) + { + oggClose( nHandle ); + } + + } +} diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Cxa.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Cxa.cs new file mode 100644 index 00000000..ee239fe0 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Cxa.cs @@ -0,0 +1,380 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.IO; +using System.Diagnostics; +using System.Threading; + + +namespace FDK +{ + public unsafe class Cxa : SoundDecoder //, IDisposable + { + static byte[] FOURCC = Encoding.ASCII.GetBytes( "1DWK" ); // KWD1 縺ョ little endian + + #region [ XA逕ィ讒矩菴薙ョ螳」險 ] + [StructLayout(LayoutKind.Sequential)] + public struct XASTREAMHEADER { + public byte* pSrc; + public uint nSrcLen; + public uint nSrcUsed; + public byte* pDst; + public uint nDstLen; + public uint nDstUsed; + } + + [StructLayout( LayoutKind.Sequential )] + public struct XAHEADER + { + public uint id; + public uint nDataLen; + public uint nSamples; + public ushort nSamplesPerSec; + public byte nBits; + public byte nChannels; + public uint nLoopPtr; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public short[] befL; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public short[] befR; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] + public byte[] pad; + } + #endregion + + #region [ xadec.dll縺ィ縺ョ繝ェ繝ウ繧ッ ] + [DllImport( "xadec.dll", EntryPoint = "xaDecodeOpen", CallingConvention = CallingConvention.Cdecl )] + public extern static IntPtr xaDecodeOpen( ref XAHEADER pxah, out FDK.CWin32.WAVEFORMATEX pwfx ); + [DllImport( "xadec.dll", EntryPoint = "xaDecodeClose", CallingConvention = CallingConvention.Cdecl )] + public extern static bool xaDecodeClose( IntPtr hxas ); + [DllImport( "xadec.dll", EntryPoint = "xaDecodeSize", CallingConvention = CallingConvention.Cdecl )] + public extern static bool xaDecodeSize( IntPtr hxas, uint slen, out uint pdlen ); + [DllImport( "xadec.dll", EntryPoint = "xaDecodeConvert", CallingConvention = CallingConvention.Cdecl )] + public extern static bool xaDecodeConvert( IntPtr hxas, ref XASTREAMHEADER psh ); + #endregion + + public XAHEADER xaheader; + public XASTREAMHEADER xastreamheader; + public CWin32.WAVEFORMATEX waveformatex; + + private string filename; + private byte[] srcBuf = null; + private int nHandle = -1; + + public override int Open( string filename ) + { + this.filename = filename; + + #region [ XA繝倥ャ繝縺ィ縲々A繝繝シ繧ソ縺ョ隱ュ縺ソ蜃コ縺 ] + xaheader = new XAHEADER(); + using ( FileStream fs = new FileStream( filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite ) ) // FileShare 繧剃サ倥¢縺ィ縺九↑縺縺ィ縲,lose() 蠕後b繝ュ繝繧ッ縺後°縺九k?? + { + using ( BinaryReader br = new BinaryReader( fs ) ) + { + xaheader.id = br.ReadUInt32(); + xaheader.nDataLen = br.ReadUInt32(); + xaheader.nSamples = br.ReadUInt32(); + xaheader.nSamplesPerSec = br.ReadUInt16(); + xaheader.nBits = br.ReadByte(); + xaheader.nChannels = br.ReadByte(); + xaheader.nLoopPtr = br.ReadUInt32(); + + xaheader.befL = new short[ 2 ]; + xaheader.befR = new short[ 2 ]; + xaheader.pad = new byte[ 4 ]; + + xaheader.befL[ 0 ] = br.ReadInt16(); + xaheader.befL[ 1 ] = br.ReadInt16(); + xaheader.befR[ 0 ] = br.ReadInt16(); + xaheader.befR[ 1 ] = br.ReadInt16(); + xaheader.pad = br.ReadBytes( 4 ); + + srcBuf = new byte[ xaheader.nDataLen ]; + srcBuf = br.ReadBytes( (int) xaheader.nDataLen ); + } + } + //string xaid = Encoding.ASCII.GetString( xah.id ); + #region [ 繝繝舌ャ繧ー陦ィ遉コ ] + //Debug.WriteLine( "**XAHEADER**" ); + //Debug.WriteLine( "id= " + xaheader.id.ToString( "X8" ) ); + //Debug.WriteLine( "nDataLen= " + xaheader.nDataLen.ToString( "X8" ) ); + //Debug.WriteLine( "nSamples= " + xaheader.nSamples.ToString( "X8" ) ); + //Debug.WriteLine( "nSamplesPerSec= " + xaheader.nSamplesPerSec.ToString( "X4" ) ); + //Debug.WriteLine( "nBits= " + xaheader.nBits.ToString( "X2" ) ); + //Debug.WriteLine( "nChannels= " + xaheader.nChannels.ToString( "X2" ) ); + //Debug.WriteLine( "nLoopPtr= " + xaheader.nLoopPtr.ToString( "X8" ) ); + //Debug.WriteLine( "befL[0]= " + xaheader.befL[ 0 ].ToString( "X4" ) ); + //Debug.WriteLine( "befL[1]= " + xaheader.befL[ 1 ].ToString( "X4" ) ); + //Debug.WriteLine( "befR[0]= " + xaheader.befR[ 0 ].ToString( "X4" ) ); + //Debug.WriteLine( "befR[1]= " + xaheader.befR[ 1 ].ToString( "X4" ) ); + #endregion + #endregion + + IntPtr hxas; + + #region [ WAVEFORMEX諠蝣ア縺ョ蜿門セ ] + waveformatex = new CWin32.WAVEFORMATEX(); + hxas = xaDecodeOpen( ref xaheader, out waveformatex ); + if ( hxas == null ) + { + Trace.TraceError( "Error: xa: Open(): xaDecodeOpen(): " + Path.GetFileName( filename ) ); + return -1; + } + + #region [ 繝繝舌ャ繧ー陦ィ遉コ ] + //Debug.WriteLine( "**WAVEFORMATEX**" ); + //Debug.WriteLine( "wFormatTag= " + waveformatex.wFormatTag.ToString( "X4" ) ); + //Debug.WriteLine( "nChannels = " + waveformatex.nChannels.ToString( "X4" ) ); + //Debug.WriteLine( "nSamplesPerSec= " + waveformatex.nSamplesPerSec.ToString( "X8" ) ); + //Debug.WriteLine( "nAvgBytesPerSec= " + waveformatex.nAvgBytesPerSec.ToString( "X8" ) ); + //Debug.WriteLine( "nBlockAlign= " + waveformatex.nBlockAlign.ToString( "X4" ) ); + //Debug.WriteLine( "wBitsPerSample= " + waveformatex.wBitsPerSample.ToString( "X4" ) ); + //Debug.WriteLine( "cbSize= " + waveformatex.cbSize.ToString( "X4" ) ); + #endregion + #endregion + + this.nHandle = (int) hxas; + return (int) hxas; + } + public override int GetFormat( int nHandle, ref CWin32.WAVEFORMATEX wfx ) + { + #region [ WAVEFORMATEX讒矩菴薙ョ謇句虚繧ウ繝斐シ ] + wfx.nAvgBytesPerSec = waveformatex.nAvgBytesPerSec; + wfx.wBitsPerSample = waveformatex.wBitsPerSample; + wfx.nBlockAlign = waveformatex.nBlockAlign; + wfx.nChannels = waveformatex.nChannels; + wfx.wFormatTag = waveformatex.wFormatTag; + wfx.nSamplesPerSec = waveformatex.nSamplesPerSec; + + return 0; + #endregion + } + public override uint GetTotalPCMSize( int nHandle ) + { + #region [ 繝繝シ繧ソ髟キ縺ョ蜿門セ ] + uint dlen; + xaDecodeSize( (IntPtr) nHandle, xaheader.nDataLen, out dlen ); + #region [ 繝繝舌ャ繧ー陦ィ遉コ ] + //Debug.WriteLine( "**INTERNAL VALUE**" ); + //Debug.WriteLine( "dlen= " + dlen ); + #endregion + #endregion + + return dlen; + } + public override int Seek( int nHandle, uint dwPosition ) + { + return 0; + } + public override int Decode( int nHandle, IntPtr pDest, uint szDestSize, int bLoop ) + { + #region [ xa繝繝シ繧ソ縺ョ繝繧ウ繝シ繝 ] + xastreamheader = new XASTREAMHEADER(); + unsafe + { + fixed ( byte* pXaBuf = srcBuf ) + { + byte* pWavBuf = (byte*) pDest; + + xastreamheader.pSrc = pXaBuf; + xastreamheader.nSrcLen = xaheader.nDataLen; + xastreamheader.nSrcUsed = 0; + xastreamheader.pDst = pWavBuf; + xastreamheader.nDstLen = szDestSize; + xastreamheader.nDstUsed = 0; + if ( !xaDecodeConvert( (IntPtr) nHandle, ref xastreamheader ) ) + { + Trace.TraceError( "Error: xaDecodeConvert(): " + Path.GetFileName( filename ) ); + return -1; + } + } + } + #region [ 繝繝舌ャ繧ー陦ィ遉コ ] + //Debug.WriteLine( "**XASTREAMHEADER**" ); + //Debug.WriteLine( "nSrcLen= " + xastreamheader.nSrcLen ); + //Debug.WriteLine( "nSrcUsed= " + xastreamheader.nSrcUsed ); + //Debug.WriteLine( "nDstLen= " + xastreamheader.nDstLen ); + //Debug.WriteLine( "nDstUsed= " + xastreamheader.nDstUsed ); + #endregion + #endregion + + return 0; + } + public override void Close( int nHandle ) + { + #region [ xa繝輔ぃ繧、繝ォ縺ョ繧ッ繝ュ繝シ繧コ ] + if ( !xaDecodeClose( (IntPtr) nHandle ) ) + { + Trace.TraceError( "Error: xaDecodeClose(): " + Path.GetFileName( filename ) ); + } + srcBuf = null; + #endregion + } + + + + //#region [ IDisposable 螳溯」 ] + ////----------------- + //private bool bDispose螳御コ貂医∩ = false; + //public void Dispose() + //{ + // if ( !this.bDispose螳御コ貂医∩ ) + // { + // if ( srcBuf != null ) + // { + // srcBuf = null; + // } + // if ( dstBuf != null ) + // { + // dstBuf = null; + // } + + // if ( this.nHandle >= 0 ) + // { + // this.Close( this.nHandle ); + // this.nHandle = -1; + // } + // this.bDispose螳御コ貂医∩ = true; + // } + //} + ////----------------- + //#endregion + +#if false + /// + /// xa繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧薙〒縲『av縺ォdecode縺吶k + /// + /// xa繝輔ぃ繧、繝ォ蜷 + /// wav繝輔ぃ繧、繝ォ縺梧シ邏阪&繧後k繝舌ャ繝輔ぃ + /// + public bool Decode( string filename, out byte[] wavBuf ) + { + // Debug.WriteLine( "xa: Decode: " + Path.GetFileName( filename ) ); + + #region [ XA繝倥ャ繝縺ィ縲々A繝繝シ繧ソ縺ョ隱ュ縺ソ蜃コ縺 ] + xaheader = new XAHEADER(); + byte[] xaBuf; + using ( FileStream fs = new FileStream( filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite ) ) // FileShare 繧剃サ倥¢縺ィ縺九↑縺縺ィ縲,lose() 蠕後b繝ュ繝繧ッ縺後°縺九k?? + { + using ( BinaryReader br = new BinaryReader( fs ) ) + { + xaheader.id = br.ReadUInt32(); + xaheader.nDataLen = br.ReadUInt32(); + xaheader.nSamples = br.ReadUInt32(); + xaheader.nSamplesPerSec = br.ReadUInt16(); + xaheader.nBits = br.ReadByte(); + xaheader.nChannels = br.ReadByte(); + xaheader.nLoopPtr = br.ReadUInt32(); + + xaheader.befL = new short[ 2 ]; + xaheader.befR = new short[ 2 ]; + xaheader.pad = new byte[ 4 ]; + + xaheader.befL[ 0 ] = br.ReadInt16(); + xaheader.befL[ 1 ] = br.ReadInt16(); + xaheader.befR[ 0 ] = br.ReadInt16(); + xaheader.befR[ 1 ] = br.ReadInt16(); + xaheader.pad = br.ReadBytes( 4 ); + + xaBuf = new byte[ xaheader.nDataLen ]; + xaBuf = br.ReadBytes( (int) xaheader.nDataLen ); + } + } + //string xaid = Encoding.ASCII.GetString( xah.id ); + #region [ 繝繝舌ャ繧ー陦ィ遉コ ] + //Debug.WriteLine( "**XAHEADER**" ); + //Debug.WriteLine( "id= " + xaheader.id.ToString( "X8" ) ); + //Debug.WriteLine( "nDataLen= " + xaheader.nDataLen.ToString( "X8" ) ); + //Debug.WriteLine( "nSamples= " + xaheader.nSamples.ToString( "X8" ) ); + //Debug.WriteLine( "nSamplesPerSec= " + xaheader.nSamplesPerSec.ToString( "X4" ) ); + //Debug.WriteLine( "nBits= " + xaheader.nBits.ToString( "X2" ) ); + //Debug.WriteLine( "nChannels= " + xaheader.nChannels.ToString( "X2" ) ); + //Debug.WriteLine( "nLoopPtr= " + xaheader.nLoopPtr.ToString( "X8" ) ); + //Debug.WriteLine( "befL[0]= " + xaheader.befL[ 0 ].ToString( "X4" ) ); + //Debug.WriteLine( "befL[1]= " + xaheader.befL[ 1 ].ToString( "X4" ) ); + //Debug.WriteLine( "befR[0]= " + xaheader.befR[ 0 ].ToString( "X4" ) ); + //Debug.WriteLine( "befR[1]= " + xaheader.befR[ 1 ].ToString( "X4" ) ); + #endregion + #endregion + + object lockobj = new object(); + lock ( lockobj ) // 繧ケ繝ャ繝繝峨そ繝シ繝輔§繧縺ェ縺縺九b遏・繧後↑縺縺ョ縺ァ縲∝ソオ縺ョ縺溘a + { + #region [ WAVEFORMEX諠蝣ア縺ョ蜿門セ ] + waveformatex = new CWin32.WAVEFORMATEX(); + IntPtr hxas = xaDecodeOpen( ref xaheader, out waveformatex ); + if ( hxas == null ) + { + Trace.TraceError( "Error: xaDecodeOpen(): " + Path.GetFileName( filename ) ); + wavBuf = null; + return false; + } + + #region [ 繝繝舌ャ繧ー陦ィ遉コ ] + //Debug.WriteLine( "**WAVEFORMATEX**" ); + //Debug.WriteLine( "wFormatTag= " + waveformatex.wFormatTag.ToString( "X4" ) ); + //Debug.WriteLine( "nChannels = " + waveformatex.nChannels.ToString( "X4" ) ); + //Debug.WriteLine( "nSamplesPerSec= " + waveformatex.nSamplesPerSec.ToString( "X8" ) ); + //Debug.WriteLine( "nAvgBytesPerSec= " + waveformatex.nAvgBytesPerSec.ToString( "X8" ) ); + //Debug.WriteLine( "nBlockAlign= " + waveformatex.nBlockAlign.ToString( "X4" ) ); + //Debug.WriteLine( "wBitsPerSample= " + waveformatex.wBitsPerSample.ToString( "X4" ) ); + //Debug.WriteLine( "cbSize= " + waveformatex.cbSize.ToString( "X4" ) ); + #endregion + #endregion + + #region [ 繝繝シ繧ソ髟キ縺ョ蜿門セ ] + uint dlen; + xaDecodeSize( hxas, xaheader.nDataLen, out dlen ); + #region [ 繝繝舌ャ繧ー陦ィ遉コ ] + //Debug.WriteLine( "**INTERNAL VALUE**" ); + //Debug.WriteLine( "dlen= " + dlen ); + #endregion + #endregion + + #region [ xa繝繝シ繧ソ縺ョ繝繧ウ繝シ繝 ] + wavBuf = new byte[ dlen ]; + xastreamheader = new XASTREAMHEADER(); + + unsafe + { + fixed ( byte* pXaBuf = xaBuf, pWavBuf = wavBuf ) + { + xastreamheader.pSrc = pXaBuf; + xastreamheader.nSrcLen = xaheader.nDataLen; + xastreamheader.nSrcUsed = 0; + xastreamheader.pDst = pWavBuf; + xastreamheader.nDstLen = dlen; + xastreamheader.nDstUsed = 0; + bool b = xaDecodeConvert( hxas, ref xastreamheader ); + if ( !b ) + { + Trace.TraceError( "Error: xaDecodeConvert(): " + Path.GetFileName( filename ) ); + wavBuf = null; + return false; + } + } + } + #region [ 繝繝舌ャ繧ー陦ィ遉コ ] + //Debug.WriteLine( "**XASTREAMHEADER**" ); + //Debug.WriteLine( "nSrcLen= " + xastreamheader.nSrcLen ); + //Debug.WriteLine( "nSrcUsed= " + xastreamheader.nSrcUsed ); + //Debug.WriteLine( "nDstLen= " + xastreamheader.nDstLen ); + //Debug.WriteLine( "nDstUsed= " + xastreamheader.nDstUsed ); + #endregion + #endregion + + #region [ xa繝輔ぃ繧、繝ォ縺ョ繧ッ繝ュ繝シ繧コ ] + bool bb = xaDecodeClose( hxas ); + if ( !bb ) + { + Trace.TraceError( "Error: xaDecodeClose(): " + Path.GetFileName( filename ) ); + } + #endregion + } + + return true; + } +#endif + } +} diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/ESoundDeviceType.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/ESoundDeviceType.cs new file mode 100644 index 00000000..fe0edf0e --- /dev/null +++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/ESoundDeviceType.cs @@ -0,0 +1,15 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; + +namespace FDK +{ + public enum ESoundDeviceType + { + ExclusiveWASAPI, + SharedWASAPI, + ASIO, + DirectSound, + Unknown, + } +} diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/ESoundGroup.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/ESoundGroup.cs new file mode 100644 index 00000000..23d91f8d --- /dev/null +++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/ESoundGroup.cs @@ -0,0 +1,11 @@ +サソnamespace FDK +{ + public enum ESoundGroup + { + SoundEffect = 1, + Voice = 2, + SongPreview = 3, + SongPlayback = 4, + Unknown = 0 + } +} diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/ISoundDevice.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/ISoundDevice.cs new file mode 100644 index 00000000..b362eb22 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/ISoundDevice.cs @@ -0,0 +1,26 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using Un4seen.Bass; +using Un4seen.BassAsio; +using Un4seen.BassWasapi; +using Un4seen.Bass.AddOn.Mix; + +namespace FDK +{ + internal interface ISoundDevice : IDisposable + { + ESoundDeviceType e蜃コ蜉帙ョ繝舌う繧ケ { get; } + int nMasterVolume { get; set; } + long n螳溷コ蜉幃≦蟒カms { get; } + long n螳溘ヰ繝繝輔ぃ繧オ繧、繧コms { get; } + long n邨碁℃譎る俣ms { get; } + long n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms { get; } + CTimer tm繧キ繧ケ繝繝繧ソ繧、繝 { get; } + + CSound t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, ESoundGroup soundGroup ); + void t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( string str繝輔ぃ繧、繝ォ蜷, CSound sound ); + void t繧オ繧ヲ繝ウ繝峨r菴懈舌☆繧( byte[] byArrWAV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク, CSound sound ); + } +} diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/LoudnessMetadata.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/LoudnessMetadata.cs new file mode 100644 index 00000000..8c0f6ee9 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/LoudnessMetadata.cs @@ -0,0 +1,22 @@ +サソusing System; + +namespace FDK +{ + /// + /// The LoudnessMetadata structure is used to carry, and assist with + /// calculations related to, integrated loudness and true peak + /// loudness. + /// + [Serializable] + public struct LoudnessMetadata + { + public readonly Lufs Integrated; + public readonly Lufs? TruePeak; + + public LoudnessMetadata(Lufs integrated, Lufs? truePeak) + { + Integrated = integrated; + TruePeak = truePeak; + } + } +} \ No newline at end of file diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/LoudnessMetadataScanner.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/LoudnessMetadataScanner.cs new file mode 100644 index 00000000..f3d26467 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/LoudnessMetadataScanner.cs @@ -0,0 +1,357 @@ +サソusing System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Threading; +using System.Xml.XPath; + +namespace FDK +{ + /// + /// The LoudnessMetadataScanner plays two roles: + /// 1. Scanning of song audio files using BS1770GAIN (http://bs1770gain.sourceforge.net/) + /// to determine their perceived loudness. Running on a background thread while not + /// in song gameplay, songs without existing loudness metadata files (e.g. *.bs1770gain.xml) + /// have their perceived loudness determined and saved into an associated metadata file + /// without modifying the original audio file. This scanning process begins running + /// with scanning jobs ordered based on the order in which songs are enumerated when + /// the application starts, but shifts to prioritize songs which are browsed and previewed + /// while on the song select screen. + /// 2. Loading of loudness metadata from the BS1770GAIN metadata file alongside each audio file. + /// This occurs when parsing .tja files, when song preview begins, and when song playback + /// begins. When no file is available on disk, a scanning job is passed to the background + /// scanning thread for processing. The loaded metadata is then passed into the + /// SongGainController for combination with a configured target loudness, resulting in a + /// gain value assigned to the sound object just before playback begins. + /// + public static class LoudnessMetadataScanner + { + private const string Bs1770GainExeFileName = "bs1770gain.exe"; + + private static readonly Stack Jobs = new Stack(); + private static readonly object LockObject = new object(); + private static readonly Queue RecentFileScanDurations = new Queue(); + + private static Thread ScanningThread; + private static Semaphore Semaphore; + + public static void StartBackgroundScanning() + { + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(StartBackgroundScanning)}"; + + if (!IsBs1770GainAvailable()) + { + Trace.TraceInformation($"{tracePrefix}: BS1770GAIN is not available. A background scanning thread will not be started."); + return; + } + + Trace.TraceInformation($"{tracePrefix}: BS1770GAIN is available. Starting background scanning thread..."); + + lock (LockObject) + { + Semaphore = new Semaphore(Jobs.Count, int.MaxValue); + ScanningThread = new Thread(Scan) + { + IsBackground = true, + Name = "LoudnessMetadataScanner background scanning thread.", + Priority = ThreadPriority.Lowest + }; + ScanningThread.Start(); + } + + Trace.TraceInformation($"{tracePrefix}: Background scanning thread started."); + } + + public static void StopBackgroundScanning(bool joinImmediately) + { + var scanningThread = ScanningThread; + + if (scanningThread == null) + { + return; + } + + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(StopBackgroundScanning)}"; + + Trace.TraceInformation($"{tracePrefix}: Stopping background scanning thread..."); + + lock (LockObject) + { + ScanningThread = null; + Semaphore.Release(); + Semaphore = null; + } + + if (joinImmediately) + { + scanningThread.Join(); + } + + Trace.TraceInformation($"{tracePrefix}: Background scanning thread stopped."); + } + + public static LoudnessMetadata? LoadForAudioPath(string absoluteBgmPath) + { + try + { + var loudnessMetadataPath = GetLoudnessMetadataPath(absoluteBgmPath); + + if (File.Exists(loudnessMetadataPath)) + { + return LoadFromMetadataPath(loudnessMetadataPath); + } + + SubmitForBackgroundScanning(absoluteBgmPath); + } + catch (Exception e) + { + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(LoadForAudioPath)}"; + Trace.TraceError($"{tracePrefix}: Encountered an exception while attempting to load {absoluteBgmPath}"); + Trace.TraceError(e.ToString()); + } + + return null; + } + + private static string GetLoudnessMetadataPath(string absoluteBgmPath) + { + return Path.Combine( + Path.GetDirectoryName(absoluteBgmPath), + Path.GetFileNameWithoutExtension(absoluteBgmPath) + ".bs1770gain.xml"); + } + + private static LoudnessMetadata? LoadFromMetadataPath(string loudnessMetadataPath) + { + XPathDocument xPathDocument; + try + { + xPathDocument = new XPathDocument(loudnessMetadataPath); + } + catch (IOException) + { + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(LoadFromMetadataPath)}"; + Trace.TraceWarning($"{tracePrefix}: Encountered IOException while attempting to read {loudnessMetadataPath}. This can occur when attempting to load while scanning the same file. Returning null..."); + return null; + } + + var trackNavigator = xPathDocument.CreateNavigator() + .SelectSingleNode(@"//bs1770gain/track[@ToTal=""1"" and @Number=""1""]"); + + var integratedLufsNode = trackNavigator?.SelectSingleNode(@"integrated/@lufs"); + var truePeakTpfsNode = trackNavigator?.SelectSingleNode(@"true-peak/@tpfs"); + + if (trackNavigator == null || integratedLufsNode == null || truePeakTpfsNode == null) + { + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(LoadFromMetadataPath)}"; + Trace.TraceWarning($"{tracePrefix}: Encountered incorrect xml element structure while parsing {loudnessMetadataPath}. Returning null..."); + return null; + } + + var integrated = integratedLufsNode.ValueAsDouble; + var truePeak = truePeakTpfsNode.ValueAsDouble; + + if (integrated <= -70.0 || truePeak >= 12.04) + { + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(LoadFromMetadataPath)}"; + Trace.TraceWarning($"{tracePrefix}: Encountered evidence of extreme clipping while parsing {loudnessMetadataPath}. Returning null..."); + return null; + } + + return new LoudnessMetadata(new Lufs(integrated), new Lufs(truePeak)); + } + + private static void SubmitForBackgroundScanning(string absoluteBgmPath) + { + lock (LockObject) + { + // Quite often, the loading process will cause the same job to be submitted many times. + // As such, we'll do a quick check as when this happens an equivalent job will often + // already be at the top of the stack and we need not add it again. + // + // Note that we will not scan the whole stack as that is an O(n) operation on the main + // thread, whereas redundant file existence checks on the background thread are not harmful. + // + // We also do not want to scan the whole stack, for example to skip pushing a new item onto it, + // because we want to re-submit jobs as the user interacts with their data, usually by + // scrolling through songs and previewing them. Their current interests should drive + // scanning priorities, and it is for this reason that a stack is used instead of a queue. + var semaphore = Semaphore; + if (semaphore != null && (Jobs.Count == 0 || Jobs.Peek() != absoluteBgmPath)) + { + Jobs.Push(absoluteBgmPath); + semaphore.Release(); + } + } + } + + private static void Scan() + { + try + { + while (true) + { + RaiseScanningStateChanged(false); + + Semaphore?.WaitOne(); + + if (ScanningThread == null) + { + return; + } + + RaiseScanningStateChanged(true); + + int jobCount; + string absoluteBgmPath; + lock (LockObject) + { + jobCount = Jobs.Count; + absoluteBgmPath = Jobs.Pop(); + } + + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(Scan)}"; + + try + { + if (!File.Exists(absoluteBgmPath)) + { + Trace.TraceWarning($"{tracePrefix}: Scanning jobs outstanding: {jobCount - 1}. Missing audio file. Skipping {absoluteBgmPath}..."); + continue; + } + + var loudnessMetadataPath = GetLoudnessMetadataPath(absoluteBgmPath); + + if (File.Exists(loudnessMetadataPath)) + { + Trace.TraceWarning($"{tracePrefix}: Scanning jobs outstanding: {jobCount - 1}. Pre-existing metadata. Skipping {absoluteBgmPath}..."); + continue; + } + + Trace.TraceInformation($"{tracePrefix}: Scanning jobs outstanding: {jobCount}. Scanning {absoluteBgmPath}..."); + var stopwatch = Stopwatch.StartNew(); + + File.Delete(loudnessMetadataPath); + var arguments = $"-it --xml -f \"{Path.GetFileName(loudnessMetadataPath)}\" \"{Path.GetFileName(absoluteBgmPath)}\""; + Execute(Path.GetDirectoryName(absoluteBgmPath), Bs1770GainExeFileName, arguments, true); + + var seconds = stopwatch.Elapsed.TotalSeconds; + RecentFileScanDurations.Enqueue(seconds); + while (RecentFileScanDurations.Count > 20) + { + RecentFileScanDurations.Dequeue(); + } + var averageSeconds = RecentFileScanDurations.Average(); + Trace.TraceInformation($"{tracePrefix}: Scanned in {seconds}s. Estimated remaining: {(int)(averageSeconds * (jobCount - 1))}s."); + } + catch (Exception e) + { + Trace.TraceError($"{tracePrefix}: Encountered an exception while attempting to scan {absoluteBgmPath}"); + Trace.TraceError(e.ToString()); + } + } + } + catch (Exception e) + { + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(Scan)}"; + Trace.TraceError($"{tracePrefix}: caught an exception at the level of the thread method. The background scanning thread will now terminate."); + Trace.TraceError(e.ToString()); + } + } + + private static bool IsBs1770GainAvailable() + { + try + { + Execute(null, Bs1770GainExeFileName, "-h"); + return true; + } + catch (Win32Exception) + { + return false; + } + catch (Exception e) + { + var tracePrefix = $"{nameof(LoudnessMetadataScanner)}.{nameof(IsBs1770GainAvailable)}"; + Trace.TraceError($"{tracePrefix}: Encountered an exception. Returning false..."); + Trace.TraceError(e.ToString()); + + return false; + } + } + + private static string Execute( + string workingDirectory, string fileName, string arguments, bool shouldFailOnStdErrDataReceived = false) + { + var processStartInfo = new ProcessStartInfo(fileName, arguments) + { + CreateNoWindow = true, + RedirectStandardError = true, + RedirectStandardOutput = true, + UseShellExecute = false, + WorkingDirectory = workingDirectory ?? "" + }; + + var stdoutWriter = new StringWriter(); + var stderrWriter = new StringWriter(); + using (var process = Process.Start(processStartInfo)) + { + process.OutputDataReceived += (s, e) => + { + if (e.Data != null) + { + stdoutWriter.Write(e.Data); + stdoutWriter.Write(Environment.NewLine); + } + }; + + var errorDataReceived = false; + process.ErrorDataReceived += (s, e) => + { + if (e.Data != null) + { + errorDataReceived = true; + stderrWriter.Write(e.Data); + stderrWriter.Write(Environment.NewLine); + } + }; + + process.BeginOutputReadLine(); + process.BeginErrorReadLine(); + process.WaitForExit(); + + if ((shouldFailOnStdErrDataReceived && errorDataReceived) || process.ExitCode != 0) + { + var stderr = stderrWriter.ToString(); + if (string.IsNullOrEmpty(stderr)) + { + stderr = stdoutWriter.ToString(); + } + + throw new Exception( + $"Execution of {processStartInfo.FileName} with arguments {processStartInfo.Arguments} failed with exit code {process.ExitCode}: {stderr}"); + } + + return stdoutWriter.ToString(); + } + } + + private static void RaiseScanningStateChanged(bool isActivelyScanning) + { + ScanningStateChanged?.Invoke(null, new ScanningStateChangedEventArgs(isActivelyScanning)); + } + + public class ScanningStateChangedEventArgs : EventArgs + { + public ScanningStateChangedEventArgs(bool isActivelyScanning) + { + IsActivelyScanning = isActivelyScanning; + } + + public bool IsActivelyScanning { get; private set; } + } + + public static event EventHandler ScanningStateChanged; + } +} \ No newline at end of file diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Lufs.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Lufs.cs new file mode 100644 index 00000000..aad1efd5 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/Lufs.cs @@ -0,0 +1,47 @@ +サソusing System; + +namespace FDK +{ + /// + /// The Lufs structure is used to carry, and assist with calculations related to, + /// Loudness Units relative to Full Scale. LUFS are measured in absolute scale + /// and whole values represent one decibel. + /// + [Serializable] + public struct Lufs + { + private readonly double _value; + + public Lufs(double value) + { + _value = value; + } + + public double ToDouble() => _value; + + public Lufs Min(Lufs lufs) + { + return new Lufs(Math.Min(_value, lufs._value)); + } + + public Lufs Negate() + { + return new Lufs(-_value); + } + + public override string ToString() + { + return _value.ToString(); + } + + public static Lufs operator- (Lufs left, Lufs right) + { + return new Lufs(left._value - right._value); + } + + public static Lufs operator+ (Lufs left, Lufs right) + { + return new Lufs(left._value + right._value); + } + } +} diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/SongGainController.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/SongGainController.cs new file mode 100644 index 00000000..7020e323 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/SongGainController.cs @@ -0,0 +1,32 @@ +サソnamespace FDK +{ + /// + /// SongGainController provides a central place through which song preview + /// and song playback attempt to apply BS1770GAIN-based loudness metadata + /// or .tja SONGVOL as the Gain of a song sound. + /// + /// By doing so through SongGainController instead of directly against the + /// song (preview) CSound object, SongGainController can override the Gain + /// value based on configuration or other information. + /// + public sealed class SongGainController + { + public bool ApplyLoudnessMetadata { private get; set; } + public Lufs TargetLoudness { private get; set; } + public bool ApplySongVol { private get; set; } + + public void Set(int songVol, LoudnessMetadata? songLoudnessMetadata, CSound sound) + { + if (ApplyLoudnessMetadata && songLoudnessMetadata.HasValue) + { + var gain = TargetLoudness - songLoudnessMetadata.Value.Integrated; + + sound.SetGain(gain, songLoudnessMetadata.Value.TruePeak); + } + else + { + sound.SetGain(ApplySongVol ? songVol : CSound.DefaultSongVol); + } + } + } +} diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/SoundDecoder.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/SoundDecoder.cs new file mode 100644 index 00000000..94d77ad1 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/SoundDecoder.cs @@ -0,0 +1,20 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; + +namespace FDK +{ + /// + /// xa,ogg繝繧ウ繝シ繝臥畑縺ョ蝓コ蠎輔け繝ゥ繧ケ + /// + public abstract class SoundDecoder //: IDisposable + { + public abstract int Open( string filename ); + public abstract int GetFormat( int nHandle, ref CWin32.WAVEFORMATEX wfx ); + public abstract uint GetTotalPCMSize( int nHandle ); + public abstract int Seek( int nHandle, uint dwPosition ); + public abstract int Decode( int nHandle, IntPtr pDest, uint szDestSize, int bLoop ); + public abstract void Close( int nHandle ); + } +} diff --git a/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/SoundGroupLevelController.cs b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/SoundGroupLevelController.cs new file mode 100644 index 00000000..1b3e9d6c --- /dev/null +++ b/FDK19/繧ウ繝シ繝/03.繧オ繧ヲ繝ウ繝/SoundGroupLevelController.cs @@ -0,0 +1,132 @@ +サソusing System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Specialized; +using FDK.ExtensionMethods; + +namespace FDK +{ + /// + /// SoundGroupLevelController holds the current sound level value for each + /// of the unique sound groups, along with an increment by which they can + /// easily be adjusted. + /// + /// Configuration changes to the sound group levels are provided to the + /// controller via binding code which allows CConfigIni and + /// SoundGroupLevelController to be unaware of one another. + /// See ConfigIniToSoundGroupLevelControllerBinder for more details. + /// + /// Dynamic adjustment of sound group levels during song selection and song + /// playback are managed via a small dependency taken by the respective + /// stage classes. See KeyboardSoundGroupLevelControlHandler and its usages + /// for more details. + /// + /// As new sound objects are created, including when reloading sounds due + /// to a changer in audio output device, SoundGroupLevelController ensures + /// that they are provided with the current level for their associated + /// sound group by subscribing to notifications regarding changes to a + /// collection of sound objects provided during construction. This + /// observable collection comes from the sound manager, but without either + /// it or this class being directly aware of one another. + /// + /// As sound group levels are changed, SoundGroupLevelController updates + /// all existing sound objects group levels by iterating that same + /// observable collection. + /// + public sealed class SoundGroupLevelController + { + private readonly Dictionary _levelBySoundGroup = new Dictionary + { + [ESoundGroup.SoundEffect] = CSound.MaximumGroupLevel, + [ESoundGroup.Voice] = CSound.MaximumGroupLevel, + [ESoundGroup.SongPreview] = CSound.MaximumGroupLevel, + [ESoundGroup.SongPlayback] = CSound.MaximumGroupLevel, + [ESoundGroup.Unknown] = CSound.MaximumGroupLevel + }; + + private readonly ObservableCollection _sounds; + + private int _keyboardSoundLevelIncrement; + + public SoundGroupLevelController(ObservableCollection sounds) + { + _sounds = sounds; + + _sounds.CollectionChanged += SoundsOnCollectionChanged; + } + + public void SetLevel(ESoundGroup soundGroup, int level) + { + var clampedLevel = level.Clamp(CSound.MinimumGroupLevel, CSound.MaximumGroupLevel); + + if (_levelBySoundGroup[soundGroup] == clampedLevel) + { + return; + } + + _levelBySoundGroup[soundGroup] = clampedLevel; + + foreach (var sound in _sounds) + { + if (sound.SoundGroup == soundGroup) + { + SetLevel(sound); + } + } + + RaiseLevelChanged(soundGroup, clampedLevel); + } + + public void SetKeyboardSoundLevelIncrement(int keyboardSoundLevelIncrement) + { + _keyboardSoundLevelIncrement = keyboardSoundLevelIncrement; + } + + public void AdjustLevel(ESoundGroup soundGroup, bool isAdjustmentPositive) + { + var adjustmentIncrement = isAdjustmentPositive + ? _keyboardSoundLevelIncrement + : -_keyboardSoundLevelIncrement; + + SetLevel(soundGroup, _levelBySoundGroup[soundGroup] + adjustmentIncrement); + } + + private void SetLevel(CSound sound) + { + sound.GroupLevel = _levelBySoundGroup[sound.SoundGroup]; + } + + private void SoundsOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) + { + switch (e.Action) + { + case NotifyCollectionChangedAction.Add: + case NotifyCollectionChangedAction.Replace: + foreach (CSound sound in e.NewItems) + { + SetLevel(sound); + } + break; + } + } + + private void RaiseLevelChanged(ESoundGroup soundGroup, int level) + { + LevelChanged?.Invoke(this, new LevelChangedEventArgs(soundGroup, level)); + } + + public class LevelChangedEventArgs : EventArgs + { + public LevelChangedEventArgs(ESoundGroup soundGroup, int level) + { + SoundGroup = soundGroup; + Level = level; + } + + public ESoundGroup SoundGroup { get; private set; } + public int Level { get; private set; } + } + + public event EventHandler LevelChanged; + } +} diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/BitmapUtil.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/BitmapUtil.cs new file mode 100644 index 00000000..83061321 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/BitmapUtil.cs @@ -0,0 +1,74 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using System.IO; + +namespace FDK +{ + public static class BitmapUtil + { + // 螳壽焚 + + public const uint DIB_PAL_COLORS = 1; + public const uint DIB_RGB_COLORS = 0; + + + // 讒矩菴 + + [StructLayout( LayoutKind.Sequential, Pack = 1 )] + public struct BITMAPFILEHEADER + { + public ushort bfType; + public uint bfSize; + public ushort bfReserved1; + public ushort bfReserved2; + public uint bfOffBits; + } + + [StructLayout( LayoutKind.Sequential, Pack = 1 )] + public struct BITMAPINFOHEADER + { + public const int BI_RGB = 0; + public uint biSize讒矩菴薙ョ繧オ繧、繧コ; + public int biWidth繝薙ャ繝医槭ャ繝励ョ蟷dot; + public int biHeight繝薙ャ繝医槭ャ繝励ョ鬮倥&dot; + public ushort biPlanes髱「縺ョ謨ー; + public ushort biBitCount; + public uint biCompression蝨ァ邵ョ蠖「蠑; + public uint biSizeImage逕サ蜒上う繝。繝シ繧ク縺ョ繧オ繧、繧コ; + public int biXPelsPerMete豌エ蟷ウ譁ケ蜷代ョ隗」蜒丞コヲ; + public int biYPelsPerMeter蝙ら峩譁ケ蜷代ョ隗」蜒丞コヲ; + public uint biClrUsed濶イ繝繝シ繝悶Ν縺ョ繧、繝ウ繝繝繧ッ繧ケ謨ー; + public uint biClrImportant陦ィ遉コ縺ォ蠢隕√↑濶イ繧、繝ウ繝繝繧ッ繧ケ縺ョ謨ー; + } + + + // 繝。繧ス繝繝 + + public static unsafe Bitmap ToBitmap( IntPtr pBITMAPINFOHEADER ) + { + BITMAPFILEHEADER bitmapfileheader; + BITMAPINFOHEADER* bitmapinfoheaderPtr = (BITMAPINFOHEADER*) pBITMAPINFOHEADER; + bitmapfileheader.bfType = 0x4d42; + bitmapfileheader.bfOffBits = (uint) ( sizeof( BITMAPFILEHEADER ) + sizeof( BITMAPINFOHEADER ) ); + bitmapfileheader.bfSize = bitmapfileheader.bfOffBits + bitmapinfoheaderPtr->biSizeImage逕サ蜒上う繝。繝シ繧ク縺ョ繧オ繧、繧コ; + MemoryStream output = new MemoryStream(); + BinaryWriter writer = new BinaryWriter( output ); + byte[] destination = new byte[ sizeof( BITMAPFILEHEADER ) ]; + Marshal.Copy( (IntPtr) ( &bitmapfileheader ), destination, 0, destination.Length ); + writer.Write( destination ); + destination = new byte[ sizeof( BITMAPINFOHEADER ) ]; + Marshal.Copy( pBITMAPINFOHEADER, destination, 0, destination.Length ); + writer.Write( destination ); + destination = new byte[ bitmapinfoheaderPtr->biSizeImage逕サ蜒上う繝。繝シ繧ク縺ョ繧オ繧、繧コ ]; + bitmapinfoheaderPtr++; + Marshal.Copy( (IntPtr) bitmapinfoheaderPtr, destination, 0, destination.Length ); + writer.Write( destination ); + writer.Flush(); + writer.BaseStream.Position = 0L; + return new Bitmap( writer.BaseStream ); + } + } +} diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CAero.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CAero.cs new file mode 100644 index 00000000..98765b2e --- /dev/null +++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CAero.cs @@ -0,0 +1,78 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using SlimDX; + +namespace FDK +{ + //http://spazzarama.wordpress.com/2009/09/30/enable-or-disable-dwm-composition-aero/ + /// + /// To control Aerograph in Vista and Windows7. Don't use this class in XP. + /// + public static class DWM + { + const uint DWM_EC_DISABLECOMPOSITION = 0; + const uint DWM_EC_ENABLECOMPOSITION = 1; + + [DllImport( "dwmapi.dll", EntryPoint = "DwmEnableComposition" )] + extern static uint DwmEnableComposition( uint compositionAction ); + [DllImport( "dwmapi.dll", EntryPoint = "DwmEnableComposition" )] + public extern static bool DwmIsCompositionEnabled(out bool pfEnabled); + [DllImport( "dwmapi.dll", EntryPoint = "DwmFlush" )] + extern static int DwmFlush(); +// [DllImport( "dwmapi.dll", EntryPoint = "DwmEnableMMCSS" )] +// extern static int DwmEnableMMCSS( bool fEnableMMCSS ); + [DllImport( "dwmapi.dll", EntryPoint = "DwmFlush" )] + extern static int DwmEnableMMCSS( bool fEnableMMCSS ); + + public static int IsCompositionEnabled(out bool enabled) + { +#if TEST_Direct3DEx + return DwmIsCompositionEnabled( out enabled ); +#else + enabled = false; + return 0; +#endif + } + public static int Flush() + { +#if TEST_Direct3DEx + return DwmFlush(); +#else + return 0; // 0(S_OK)縺ェ繧画仙粥 +#endif + } + + /// + /// Enable/Disable DWM composition (aka Aero) + /// + /// True to enable composition, false to disable composition. + /// True if the operation was successful. + public static bool EnableComposition( bool bIsAeroEnabled ) + { +// DwmEnableMMCSS( true ); +#if TEST_Direct3D9Ex + try + { + if ( bIsAeroEnabled ) + { + DwmEnableComposition( DWM_EC_ENABLECOMPOSITION ); + } + else + { + DwmEnableComposition( DWM_EC_DISABLECOMPOSITION ); + } + return true; + } + catch ( DllNotFoundException ) + { + return false; + } +#else + return true; +#endif + } + } +} diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CAvi.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CAvi.cs new file mode 100644 index 00000000..9e8244f4 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CAvi.cs @@ -0,0 +1,306 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using SlimDX; + +namespace FDK +{ + public class CAvi : IDisposable + { + // 繝励Ο繝代ユ繧」 + + public uint dw繧ケ繧ア繝シ繝ォ + { + get; + set; + } + public uint dw繝ャ繝シ繝 + { + get; + set; + } + public uint n繝輔Ξ繝シ繝鬮倥& + { + get; + set; + } + public uint n繝輔Ξ繝シ繝蟷 + { + get; + set; + } + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CAvi( string filename ) + { + if ( AVIFileOpen( out this.aviFile, filename, OpenFileFlags.OF_READ, IntPtr.Zero ) != 0 ) + { + this.Release(); + throw new Exception( "AVIFileOpen failed." ); + } + if ( AVIFileGetStream( this.aviFile, out this.aviStream, streamtypeVIDEO, 0 ) != 0 ) + { + this.Release(); + throw new Exception( "AVIFileGetStream failed." ); + } + var info = new AVISTREAMINFO(); + AVIStreamInfo( this.aviStream, ref info, Marshal.SizeOf( info ) ); + this.dw繝ャ繝シ繝 = info.dwRate; + this.dw繧ケ繧ア繝シ繝ォ = info.dwScale; + this.n繝輔Ξ繝シ繝蟷 = info.rcFrame.right - info.rcFrame.left; + this.n繝輔Ξ繝シ繝鬮倥& = info.rcFrame.bottom - info.rcFrame.top; + try + { + this.frame = AVIStreamGetFrameOpen( this.aviStream, 0 ); + } + catch + { + this.Release(); + throw new Exception( "AVIStreamGetFrameOpen failed." ); + } + } + + + // 繝。繧ス繝繝 + + public static void t蛻晄悄蛹() + { + AVIFileInit(); + } + public static void t邨ゆコ() + { + AVIFileExit(); + } + + public Bitmap GetFrame( int no ) + { + if( this.aviStream == IntPtr.Zero ) + throw new InvalidOperationException(); + + return BitmapUtil.ToBitmap( AVIStreamGetFrame( this.frame, no ) ); + } + public int GetFrameNoFromTime( int time ) + { + return (int) ( time * ( ( (double) this.dw繝ャ繝シ繝 ) / ( 1000.0 * this.dw繧ケ繧ア繝シ繝ォ ) ) ); + } + public IntPtr GetFramePtr( int no ) + { + if( this.aviStream == IntPtr.Zero ) + throw new InvalidOperationException(); + + return AVIStreamGetFrame( this.frame, no ); + } + public int GetMaxFrameCount() + { + if( this.aviStream == IntPtr.Zero ) + throw new InvalidOperationException(); + + return AVIStreamLength( this.aviStream ); + } + + public unsafe void tBitmap24ToGraphicsStreamR5G6B5( BitmapUtil.BITMAPINFOHEADER* pBITMAPINFOHEADER, DataStream gs, int nWidth, int nHeight ) + { + int nBmpWidth = pBITMAPINFOHEADER->biWidth繝薙ャ繝医槭ャ繝励ョ蟷dot; + int nBmpHeight = pBITMAPINFOHEADER->biHeight繝薙ャ繝医槭ャ繝励ョ鬮倥&dot; + int nBmpLineByte = ( nBmpWidth * 3 ) + ( ( 4 - ( ( nBmpWidth * 3 ) % 4 ) ) % 4 ); + + ushort* pTexture = (ushort*) gs.DataPointer.ToPointer(); + byte* pBitmap = (byte*) ( pBITMAPINFOHEADER + 1 ); + + for( int i = 0; i < nBmpHeight; i++ ) + { + if( i >= nHeight ) + break; + + for( int j = 0; j < nBmpWidth; j++ ) + { + if( j >= nWidth ) + break; + + ushort B = (ushort) ( ( *( ( pBitmap + ( ( ( nBmpHeight - i ) - 1 ) * nBmpLineByte ) ) + ( j * 3 ) + 0 ) >> 3 ) & 0x1f ); + ushort G = (ushort) ( ( *( ( pBitmap + ( ( ( nBmpHeight - i ) - 1 ) * nBmpLineByte ) ) + ( j * 3 ) + 1 ) >> 2 ) & 0x3f ); + ushort R = (ushort) ( ( *( ( pBitmap + ( ( ( nBmpHeight - i ) - 1 ) * nBmpLineByte ) ) + ( j * 3 ) + 2 ) >> 3 ) & 0x1f ); + *( pTexture + ( i * nWidth ) + j ) = (ushort) ( ( R << 11 ) | ( G << 5 ) | B ); + } + } + } + public unsafe void tBitmap24ToGraphicsStreamX8R8G8B8( BitmapUtil.BITMAPINFOHEADER* pBITMAPINFOHEADER, DataStream ds, int nWidth, int nHeight ) + { + int nBmpWidth = pBITMAPINFOHEADER->biWidth繝薙ャ繝医槭ャ繝励ョ蟷dot; + int nBmpHeight = pBITMAPINFOHEADER->biHeight繝薙ャ繝医槭ャ繝励ョ鬮倥&dot; + int nBmpLineByte = ( nBmpWidth * 3 ) + ( ( 4 - ( ( nBmpWidth * 3 ) % 4 ) ) % 4 ); + + uint* pTexture = (uint*) ds.DataPointer.ToPointer(); + byte* pBitmap = (byte*) ( pBITMAPINFOHEADER + 1 ); + + for( int i = 0; i < nBmpHeight; i++ ) + { + if( i >= nHeight ) + break; + + for( int j = 0; j < nBmpWidth; j++ ) + { + if( j >= nWidth ) + break; + + uint B = *( ( pBitmap + ( ( ( nBmpHeight - i ) - 1 ) * nBmpLineByte ) ) + ( j * 3 ) + 0 ); + uint G = *( ( pBitmap + ( ( ( nBmpHeight - i ) - 1 ) * nBmpLineByte ) ) + ( j * 3 ) + 1 ); + uint R = *( ( pBitmap + ( ( ( nBmpHeight - i ) - 1 ) * nBmpLineByte ) ) + ( j * 3 ) + 2 ); + *( pTexture + ( i * nWidth ) + j ) = ( R << 16 ) | ( G << 8 ) | B; + } + } + } + + #region [ Dispose-Finalize 繝代ち繝シ繝ウ螳溯」 ] + //----------------- + public void Dispose() + { + this.Dispose( true ); + GC.SuppressFinalize( this ); // 2011.8.19 from: 蠢倥l縺ヲ縺溘 + } + protected void Dispose( bool disposeManagedObjects ) + { + if( this.bDispose螳御コ貂医∩ ) + return; + + if( disposeManagedObjects ) + { + // (A) Managed 繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ + } + + // (B) Unamanaged 繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ + + if( this.frame != IntPtr.Zero ) + AVIStreamGetFrameClose( this.frame ); + + this.Release(); + this.bDispose螳御コ貂医∩ = true; + } + ~CAvi() + { + this.Dispose( false ); + } + //----------------- + #endregion + + + // 縺昴ョ莉 + + #region [ Win32 AVI髢「騾」髢「謨ー繧、繝ウ繝昴シ繝 ] + //----------------- + internal enum OpenFileFlags : uint + { + OF_CANCEL = 0x800, + OF_CREATE = 0x1000, + OF_DELETE = 0x200, + OF_EXIST = 0x4000, + OF_PARSE = 0x100, + OF_PROMPT = 0x2000, + OF_READ = 0, + OF_READWRITE = 2, + OF_REOPEN = 0x8000, + OF_SHARE_COMPAT = 0, + OF_SHARE_DENY_NONE = 0x40, + OF_SHARE_DENY_READ = 0x30, + OF_SHARE_DENY_WRITE = 0x20, + OF_SHARE_EXCLUSIVE = 0x10, + OF_VERIFY = 0x400, + OF_WRITE = 1 + } + + [StructLayout( LayoutKind.Sequential, Pack = 1 )] + internal struct AVISTREAMINFO + { + public uint fccType; + public uint fccHandler; + public uint dwFlags; + public uint dwCaps; + public ushort wPriority; + public ushort wLanguage; + public uint dwScale; + public uint dwRate; + public uint dwStart; + public uint dwLength; + public uint dwInitialFrames; + public uint dwSuggestedBufferSize; + public uint dwQuality; + public uint dwSampleSize; + public CAvi.RECT rcFrame; + public uint dwEditCount; + public uint dwFormatChangeCount; + [MarshalAs( UnmanagedType.ByValArray, SizeConst = 0x40 )] + public ushort[] szName; + } + + [StructLayout( LayoutKind.Sequential, Pack = 1 )] + internal struct RECT + { + public uint left; + public uint top; + public uint right; + public uint bottom; + } + + [DllImport( "AVIFIL32" )] + private static extern void AVIFileExit(); + [DllImport( "AVIFIL32" )] + private static extern uint AVIFileGetStream( IntPtr pfile, out IntPtr ppavi, uint fccType, int lParam ); + [DllImport( "AVIFIL32" )] + private static extern void AVIFileInit(); + [DllImport( "AVIFIL32" )] + private static extern uint AVIFileOpen( out IntPtr ppfile, string szFile, OpenFileFlags mode, IntPtr pclsidHandler ); + [DllImport( "AVIFIL32" )] + private static extern int AVIFileRelease( IntPtr pfile ); + [DllImport( "AVIFIL32" )] + private static extern IntPtr AVIStreamGetFrame( IntPtr pgf, int lPos ); + [DllImport( "AVIFIL32" )] + private static extern uint AVIStreamGetFrameClose( IntPtr pget ); + [DllImport( "AVIFIL32" )] + private static extern IntPtr AVIStreamGetFrameOpen( IntPtr pavi, int lpbiWanted ); + [DllImport( "AVIFIL32" )] + private static extern int AVIStreamInfo( IntPtr pavi, ref AVISTREAMINFO psi, int lSize ); + [DllImport( "AVIFIL32" )] + private static extern int AVIStreamLength( IntPtr pavi ); + [DllImport( "AVIFIL32" )] + private static extern int AVIStreamRelease( IntPtr pavi ); + //----------------- + #endregion + + #region [ private ] + //----------------- + private IntPtr aviFile = IntPtr.Zero; + private const string AVIFILE32 = "AVIFIL32"; + private const int AVIGETFRAMEF_BESTDISPLAYFMT = 1; + private IntPtr aviStream = IntPtr.Zero; + private bool bDispose螳御コ貂医∩; + private IntPtr frame = IntPtr.Zero; + private static readonly uint streamtypeAUDIO = mmioFOURCC( 'a', 'u', 'd', 's' ); + private static readonly uint streamtypeMIDI = mmioFOURCC( 'm', 'i', 'd', 's' ); + private static readonly uint streamtypeTEXT = mmioFOURCC( 't', 'x', 't', 's' ); + private static readonly uint streamtypeVIDEO = mmioFOURCC( 'v', 'i', 'd', 's' ); + + private static uint mmioFOURCC( char c0, char c1, char c2, char c3 ) + { + return ( (uint) c3 << 0x18 ) | ( (uint) c2 << 0x10 ) | ( (uint) c1 << 0x08 ) | (uint) c0; + } + private void Release() + { + if( this.aviStream != IntPtr.Zero ) + { + AVIStreamRelease( this.aviStream ); + this.aviStream = IntPtr.Zero; + } + if( this.aviFile != IntPtr.Zero ) + { + AVIFileRelease( this.aviFile ); + this.aviFile = IntPtr.Zero; + } + } + //----------------- + #endregion + } +} diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTaskBar.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTaskBar.cs new file mode 100644 index 00000000..05d6732a --- /dev/null +++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTaskBar.cs @@ -0,0 +1,145 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.Windows.Forms; +using System.Runtime.InteropServices; + +namespace FDK +{ + // referenced from http://dalmore.blog7.fc2.com/blog-entry-34.html + + public static class CTaskBar + { + public static void ShowTaskBar( bool bShowTaskBar ) + { + Int32 hWnd1 = FindWindow( "Shell_TrayWnd", null ); + if( hWnd1 != 0 ) + { //繧ソ繧ケ繧ッ繝舌シ縺ョ陦ィ遉コ + if ( bShowTaskBar ) + { + ShowWindow( hWnd1, TASKBAR_SHOW ); //// 繧ソ繧ケ繧ッ繝舌シ繧貞クク縺ォ陦ィ遉コ + } + else + { + ShowWindow( hWnd1, TASKBAR_HIDE ); + } + APPBARDATA pData = new APPBARDATA(); + pData.cbSize = Marshal.SizeOf( pData ); + pData.hWnd = (IntPtr)hWnd1; + pData.lParam = (int)ABMsg.ABM_NEW; //REMOVE縺ォ縺吶k縺ィ繧ェ繝シ繝医ワ繧、繝峨↓縺ェ繧 + //繧ソ繧ケ繧ッ繝舌シ縺ォ繝。繝繧サ繝シ繧ク騾∽ソ。 + SHAppBarMessage( ABMsg.ABM_SETSTATE, ref pData ); + } + + Int32 hWnd2 = FindWindow( "Button", "繧ケ繧ソ繝シ繝" ); + if ( hWnd2 != 0 ) + { //繧ソ繧ケ繧ッ繝舌シ縺ョ陦ィ遉コ + if ( bShowTaskBar ) + { + ShowWindow( hWnd2, TASKBAR_SHOW ); //// 繧ソ繧ケ繧ッ繝舌シ繧貞クク縺ォ陦ィ遉コ + } + else + { + ShowWindow( hWnd2, TASKBAR_HIDE ); + } + APPBARDATA pData = new APPBARDATA(); + pData.cbSize = Marshal.SizeOf( pData ); + pData.hWnd = (IntPtr) hWnd2; + pData.lParam = (int) ABMsg.ABM_NEW; //REMOVE縺ォ縺吶k縺ィ繧ェ繝シ繝医ワ繧、繝峨↓縺ェ繧 + //繧ソ繧ケ繧ッ繝舌シ縺ォ繝。繝繧サ繝シ繧ク騾∽ソ。 + SHAppBarMessage( ABMsg.ABM_SETSTATE, ref pData ); + } + } + + /// + /// ABMsg 騾√kAppBar繝。繝繧サ繝シ繧ク縺ョ隴伜挨蟄撰シ井サ・荳九ョ縺縺壹l縺1縺、シ + /// _ABM_ACTIVATE---AppBar縺後い繧ッ繝繧」繝悶↓縺ェ縺」縺滉コ九r繧キ繧ケ繝繝縺ォ騾夂衍 + /// _ABM_GETAUTOHIDEBAR---繧ケ繧ッ繝ェ繝シ繝ウ縺ョ迚ケ螳壹ョ遶ッ縺ォ髢「騾」莉倥¢繧峨l縺ヲ縺繧九が繝シ繝医ワ繧、繝陰ppBar縺ョ繝上Φ繝峨Ν繧定ソ斐☆ + /// _ABM_GETSTATE---繧ソ繧ケ繧ッ繝舌シ縺後が繝シ繝医ワ繧、繝峨°蟶ク縺ォ譛蜑埼擇縺ョ縺ゥ縺。繧峨ョ蟶ク諷九↓縺ゅk縺九r霑斐☆ + /// _ABM_GETTASKBARPOS---繧ソ繧ケ繧ッ繝舌シ縺ョ菴ソ逕ィ鬆伜沺繧定ソ斐☆ + /// _ABM_NEW---譁ー縺励>AppBar繧堤匳骭イ縺励√す繧ケ繝繝縺碁夂衍縺ォ菴ソ逕ィ縺吶k繝。繝繧サ繝シ繧クID繧呈欠螳壹☆繧 + /// _ABM_QUERYPOS---AppBar縺ョ縺溘a縺ョ繧オ繧、繧コ縺ィ繧ケ繧ッ繝ェ繝シ繝ウ菴咲スョ繧定ヲ∵アゅ☆繧 + /// _ABM_REMOVE---AppBar縺ョ逋サ骭イ繧貞炎髯、縺吶k + /// _ABM_SETAUTOHIDEBAR---繧ケ繧ッ繝ェ繝シ繝ウ縺ョ遶ッ縺ォ繧ェ繝シ繝医ワ繧、繝陰ppBar繧堤匳骭イ縺セ縺溘ッ蜑企勁縺吶k + /// _ABM_SETPOS---AppBar縺ョ繧オ繧、繧コ縺ィ繧ケ繧ッ繝ェ繝シ繝ウ蠎ァ讓吶r險ュ螳壹☆繧 + /// _ABM_WINDOWPOSCHANGED---AppBar縺ョ菴咲スョ縺悟、画峩縺輔l縺溘%縺ィ繧偵す繧ケ繝繝縺ォ騾夂衍縺吶k + /// pDataシ TAppBarData讒矩菴難シ亥推繝輔ぅ繝シ繝ォ繝峨ッdwMessage縺ォ萓晏ュ倥☆繧具シ + /// + private enum ABMsg : int + { + ABM_NEW = 0, + ABM_REMOVE = 1, + ABM_QUERYPOS = 2, + ABM_SETPOS = 3, + ABM_GETSTATE = 4, + ABM_GETTASKBARPOS = 5, + ABM_ACTIVATE = 6, + ABM_GETAUTOHIDEBAR = 7, + ABM_SETAUTOHIDEBAR = 8, + ABM_WINDOWPOSCHANGED = 9, + ABM_SETSTATE = 10 + } + + /// + /// APPBARDATA SHAppBarMessage髢「謨ー縺ォ縺ヲ菴ソ逕ィ縺輔l繧帰ppBar縺ォ髢「縺吶k讒矩菴薙 + /// cbSize.....SizeOf(TAppBarData) + /// hWnd.....AppBar縺ョ繝上Φ繝峨Ν + /// uCallbackMessage.....莉サ諢上ョ繝。繝繧サ繝シ繧クIDシhWnd縺ョAppBar縺ォ繝。繝繧サ繝シ繧ク繧帝夂衍縺吶k髫幢シABM_NEW繝。繝繧サ繝シ繧ク繧帝√k髫幢シ峨↓菴ソ逕ィシ + /// uEdge.....繧ケ繧ッ繝ェ繝シ繝ウ縺ョ遶ッ繧呈欠螳壹☆繧九ヵ繝ゥ繧ーシABM_GETAUTOHIDEBAR縲、BM_QUERYPOS縲、BM_SETAUTOHIDEBAR縲、BM_SETPOS繝。繝繧サ繝シ繧ク繧帝√k髫帙↓菴ソ逕ィ縺励∽サ・荳九ョ縺縺壹l縺1縺、シ + /// _ABE_BOTTOM---荳九し繧、繝 + /// _ABE_LEFT--- 蟾ヲ繧オ繧、繝 + /// _ABE_RIGHT---蜿ウ繧オ繧、繝 + /// _ABE_TOP---荳翫し繧、繝 + /// rc.....AppBar繧繧ソ繧ケ繧ッ繝舌シ縺ョ繧ケ繧ッ繝ェ繝シ繝ウ蠎ァ讓吶〒縺ョ陦ィ遉コ鬆伜沺シABM_GETTASKBARPOS縲、BM_QUERYPOS縲、BM_SETPOS繝。繝繧サ繝シ繧ク繧帝√k髫帙↓菴ソ逕ィ縺吶kシ + /// lParam.....繝。繝繧サ繝シ繧ク萓晏ュ倥ョ繝代Λ繝。繝シ繧ソシABM_SETAUTOHIDEBAR繝。繝繧サ繝シ繧ク縺ィ蜈ア縺ォ菴ソ逕ィ縺輔l繧具シ + /// + [StructLayout( LayoutKind.Sequential )] + private struct APPBARDATA + { + public int cbSize; + public IntPtr hWnd; + public uint uCallbackMessage; + public ABEdge uEdge; + public RECT rc; + public int lParam; + } + /// + /// ABEdge + /// + private enum ABEdge : int + { + ABE_LEFT = 0, + ABE_TOP = 1, + ABE_RIGHT = 2, + ABE_BOTTOM = 3 + } + /// + /// RECT + /// + [StructLayout( LayoutKind.Sequential )] + private struct RECT + { + public int left; + public int top; + public int right; + public int bottom; + } + /// + /// SHAppBarMessage + /// + /// + /// + /// + [DllImport( "shell32.dll", CallingConvention = CallingConvention.StdCall )] + private static extern int SHAppBarMessage( ABMsg dwMessage, ref APPBARDATA pData ); + + [DllImport("user32.dll", EntryPoint = "ShowWindow")] + private static extern int ShowWindow(Int32 hWnd, int nCmdShow); + private const int TASKBAR_HIDE = 0; + private const int TASKBAR_SHOW = 5; + + [DllImport( "user32.dll", EntryPoint = "FindWindow" )] + private static extern Int32 FindWindow( String lpClassName, String lpWindowName ); + } +} diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTexture.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTexture.cs new file mode 100644 index 00000000..7975124a --- /dev/null +++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTexture.cs @@ -0,0 +1,1240 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Drawing.Imaging; +using System.IO; +using System.Diagnostics; +using SlimDX; +using SlimDX.Direct3D9; + +using Device = SampleFramework.DeviceCache; + +namespace FDK +{ + public class CTexture : IDisposable + { + // 繝励Ο繝代ユ繧」 + public bool b蜉邂怜粋謌 + { + get; + set; + } + public bool b荵礼ョ怜粋謌 + { + get; + set; + } + public bool b貂帷ョ怜粋謌 + { + get; + set; + } + public bool b繧ケ繧ッ繝ェ繝シ繝ウ蜷域 + { + get; + set; + } + public float fZ霆ク荳ュ蠢蝗櫁サ「 + { + get; + set; + } + public int Opacity + { + get + { + return this._opacity; + } + set + { + if (value < 0) + { + this._opacity = 0; + } + else if (value > 0xff) + { + this._opacity = 0xff; + } + else + { + this._opacity = value; + } + } + } + public Size sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ + { + get; + private set; + } + public Size sz逕サ蜒上し繧、繧コ + { + get; + protected set; + } + public Texture texture + { + get; + private set; + } + public Format Format + { + get; + protected set; + } + public Vector3 vc諡。螟ァ邵ョ蟆丞咲紫; + + // 逕サ髱「縺悟、峨o繧九◆縺ウ莉・荳九ョ繝励Ο繝代ユ繧」繧定ィュ螳壹@豐サ縺吶%縺ィ縲 + + public static Size sz隲也炊逕サ髱「 = Size.Empty; + public static Size sz迚ゥ逅逕サ髱「 = Size.Empty; + public static Rectangle rc迚ゥ逅逕サ髱「謠冗判鬆伜沺 = Rectangle.Empty; + /// + /// 隲也炊逕サ髱「繧1縺ィ縺吶k蝣エ蜷医ョ迚ゥ逅逕サ髱「縺ョ蛟咲紫縲 + /// 隲也炊蛟、テ礼判髱「豈皮紫シ晉黄逅蛟、縲 + /// + public static float f逕サ髱「豈皮紫 = 1.0f; + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CTexture() + { + this.sz逕サ蜒上し繧、繧コ = new Size(0, 0); + this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ = new Size(0, 0); + this._opacity = 0xff; + this.texture = null; + this.cvPositionColoredVertexies = null; + this.b蜉邂怜粋謌 = false; + this.fZ霆ク荳ュ蠢蝗櫁サ「 = 0f; + this.vc諡。螟ァ邵ョ蟆丞咲紫 = new Vector3(1f, 1f, 1f); + // this._txData = null; + } + + /// + /// 謖螳壹&繧後◆繝薙ャ繝医槭ャ繝励が繝悶ず繧ァ繧ッ繝医°繧 Managed 繝繧ッ繧ケ繝√Ε繧剃ス懈舌☆繧九 + /// 繝繧ッ繧ケ繝√Ε縺ョ繧オ繧、繧コ縺ッ縲。ITMAP逕サ蜒上ョ繧オ繧、繧コ莉・荳翫√°縺、縲.3D9繝繝舌う繧ケ縺ァ逕滓仙庄閭ス縺ェ譛蟆上ョ繧オ繧、繧コ縺ォ閾ェ蜍慕噪縺ォ隱ソ遽縺輔l繧九 + /// 縺昴ョ髫帙√ユ繧ッ繧ケ繝√Ε縺ョ隱ソ遽蠕後ョ繧オ繧、繧コ縺ォ縺ゅo縺帙◆逕サ蜒上ョ諡。螟ァ邵ョ蟆上ッ陦後o縺ェ縺縲 + /// 縺昴ョ莉悶√Α繝繝励槭ャ繝玲焚縺ッ 1縲ゞsage 縺ッ None縲 ̄ool 縺ッ Managed縲√う繝。繝シ繧ク繝輔ぅ繝ォ繧ソ縺ッ Point縲√Α繝繝励槭ャ繝励ヵ繧」繝ォ繧ソ縺ッ + /// None縲√き繝ゥ繝シ繧ュ繝シ縺ッ 0xFFFFFFFFシ亥ョ悟ィ縺ェ繧矩サ偵r騾城℃シ峨↓縺ェ繧九 + /// + /// Direct3D9 繝繝舌う繧ケ縲 + /// 菴懈仙縺ョ繝薙ャ繝医槭ャ繝励 + /// 繝繧ッ繧ケ繝√Ε縺ョ繝輔か繝シ繝槭ャ繝医 + /// 繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲 + public CTexture(Device device, Bitmap bitmap, Format format) + : this() + { + try + { + this.Format = format; + this.sz逕サ蜒上し繧、繧コ = new Size(bitmap.Width, bitmap.Height); + this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ = this.t謖螳壹&繧後◆繧オ繧、繧コ繧定カ縺医↑縺譛驕ゥ縺ェ繝繧ッ繧ケ繝√Ε繧オ繧、繧コ繧定ソ斐☆(device, this.sz逕サ蜒上し繧、繧コ); + this.rc蜈ィ逕サ蜒 = new Rectangle(0, 0, this.sz逕サ蜒上し繧、繧コ.Width, this.sz逕サ蜒上し繧、繧コ.Height); + + using (var stream = new MemoryStream()) + { + bitmap.Save(stream, ImageFormat.Bmp); + stream.Seek(0L, SeekOrigin.Begin); + int colorKey = unchecked((int)0xFF000000); + this.texture = Texture.FromStream(device.UnderlyingDevice, stream, this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height, 1, Usage.None, format, poolvar, Filter.Point, Filter.None, colorKey); + } + } + catch (Exception e) + { + this.Dispose(); + throw new CTextureCreateFailedException("繝薙ャ繝医槭ャ繝励°繧峨ョ繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲", e); + } + } + + /// + /// 遨コ縺ョ Managed 繝繧ッ繧ケ繝√Ε繧剃ス懈舌☆繧九 + /// 繝繧ッ繧ケ繝√Ε縺ョ繧オ繧、繧コ縺ッ縲∵欠螳壹&繧後◆蟶梧悍繧オ繧、繧コ莉・荳翫√°縺、縲.3D9繝繝舌う繧ケ縺ァ逕滓仙庄閭ス縺ェ譛蟆上ョ繧オ繧、繧コ縺ォ閾ェ蜍慕噪縺ォ隱ソ遽縺輔l繧九 + /// 縺昴ョ髫帙√ユ繧ッ繧ケ繝√Ε縺ョ隱ソ遽蠕後ョ繧オ繧、繧コ縺ォ縺ゅo縺帙◆逕サ蜒上ョ諡。螟ァ邵ョ蟆上ッ陦後o縺ェ縺縲 + /// 繝繧ッ繧ケ繝√Ε縺ョ繝繧ッ繧サ繝ォ繝繝シ繧ソ縺ッ譛ェ蛻晄悄蛹悶ゑシ医♀縺昴i縺上ざ繝溘ョ繝シ繧ソ縺悟・縺」縺溘∪縺セ縲ゑシ + /// 縺昴ョ莉悶√Α繝繝励槭ャ繝玲焚縺ッ 1縲ゞsage 縺ッ None縲√う繝。繝シ繧ク繝輔ぅ繝ォ繧ソ縺ッ Point縲√Α繝繝励槭ャ繝励ヵ繧」繝ォ繧ソ縺ッ None縲 + /// 繧ォ繝ゥ繝シ繧ュ繝シ縺ッ 0x00000000シ磯城℃縺励↑縺シ峨↓縺ェ繧九 + /// + /// Direct3D9 繝繝舌う繧ケ縲 + /// 繝繧ッ繧ケ繝√Ε縺ョ蟷シ亥ク梧悍蛟、シ峨 + /// 繝繧ッ繧ケ繝√Ε縺ョ鬮倥&シ亥ク梧悍蛟、シ峨 + /// 繝繧ッ繧ケ繝√Ε縺ョ繝輔か繝シ繝槭ャ繝医 + /// 繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲 + public CTexture(Device device, int n蟷, int n鬮倥&, Format format) + : this(device, n蟷, n鬮倥&, format, Pool.Managed) + { + } + + /// + /// 謖螳壹&繧後◆逕サ蜒上ヵ繧。繧、繝ォ縺九i Managed 繝繧ッ繧ケ繝√Ε繧剃ス懈舌☆繧九 + /// 蛻ゥ逕ィ蜿ッ閭ス縺ェ逕サ蜒丞ス「蠑上ッ縲。MP, JPG, PNG, TGA, DDS, PPM, DIB, HDR, PFM 縺ョ縺縺壹l縺九 + /// + /// Direct3D9 繝繝舌う繧ケ縲 + /// 逕サ蜒上ヵ繧。繧、繝ォ蜷阪 + /// 繝繧ッ繧ケ繝√Ε縺ョ繝輔か繝シ繝槭ャ繝医 + /// 逕サ蜒上ョ鮟抵シ0xFFFFFFFFシ峨r騾城℃縺輔○繧九↑繧 true縲 + /// 繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲 + public CTexture(Device device, string str繝輔ぃ繧、繝ォ蜷, Format format, bool b鮟偵r騾城℃縺吶k) + : this(device, str繝輔ぃ繧、繝ォ蜷, format, b鮟偵r騾城℃縺吶k, Pool.Managed) + { + } + public CTexture(Device device, byte[] txData, Format format, bool b鮟偵r騾城℃縺吶k) + : this(device, txData, format, b鮟偵r騾城℃縺吶k, Pool.Managed) + { + } + public CTexture(Device device, Bitmap bitmap, Format format, bool b鮟偵r騾城℃縺吶k) + : this(device, bitmap, format, b鮟偵r騾城℃縺吶k, Pool.Managed) + { + } + + /// + /// 遨コ縺ョ繝繧ッ繧ケ繝√Ε繧剃ス懈舌☆繧九 + /// 繝繧ッ繧ケ繝√Ε縺ョ繧オ繧、繧コ縺ッ縲∵欠螳壹&繧後◆蟶梧悍繧オ繧、繧コ莉・荳翫√°縺、縲.3D9繝繝舌う繧ケ縺ァ逕滓仙庄閭ス縺ェ譛蟆上ョ繧オ繧、繧コ縺ォ閾ェ蜍慕噪縺ォ隱ソ遽縺輔l繧九 + /// 縺昴ョ髫帙√ユ繧ッ繧ケ繝√Ε縺ョ隱ソ遽蠕後ョ繧オ繧、繧コ縺ォ縺ゅo縺帙◆逕サ蜒上ョ諡。螟ァ邵ョ蟆上ッ陦後o縺ェ縺縲 + /// 繝繧ッ繧ケ繝√Ε縺ョ繝繧ッ繧サ繝ォ繝繝シ繧ソ縺ッ譛ェ蛻晄悄蛹悶ゑシ医♀縺昴i縺上ざ繝溘ョ繝シ繧ソ縺悟・縺」縺溘∪縺セ縲ゑシ + /// 縺昴ョ莉悶√Α繝繝励槭ャ繝玲焚縺ッ 1縲ゞsage 縺ッ None縲√う繝。繝シ繧ク繝輔ぅ繝ォ繧ソ縺ッ Point縲√Α繝繝励槭ャ繝励ヵ繧」繝ォ繧ソ縺ッ None縲 + /// 繧ォ繝ゥ繝シ繧ュ繝シ縺ッ 0x00000000シ磯城℃縺励↑縺シ峨↓縺ェ繧九 + /// + /// Direct3D9 繝繝舌う繧ケ縲 + /// 繝繧ッ繧ケ繝√Ε縺ョ蟷シ亥ク梧悍蛟、シ峨 + /// 繝繧ッ繧ケ繝√Ε縺ョ鬮倥&シ亥ク梧悍蛟、シ峨 + /// 繝繧ッ繧ケ繝√Ε縺ョ繝輔か繝シ繝槭ャ繝医 + /// 繝繧ッ繧ケ繝√Ε縺ョ邂。逅譁ケ豕輔 + /// 繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲 + public CTexture(Device device, int n蟷, int n鬮倥&, Format format, Pool pool) + : this(device, n蟷, n鬮倥&, format, pool, Usage.None) + { + } + + public CTexture(Device device, int n蟷, int n鬮倥&, Format format, Pool pool, Usage usage) + : this() + { + try + { + this.Format = format; + this.sz逕サ蜒上し繧、繧コ = new Size(n蟷, n鬮倥&); + this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ = this.t謖螳壹&繧後◆繧オ繧、繧コ繧定カ縺医↑縺譛驕ゥ縺ェ繝繧ッ繧ケ繝√Ε繧オ繧、繧コ繧定ソ斐☆(device, this.sz逕サ蜒上し繧、繧コ); + this.rc蜈ィ逕サ蜒 = new Rectangle(0, 0, this.sz逕サ蜒上し繧、繧コ.Width, this.sz逕サ蜒上し繧、繧コ.Height); + + using (var bitmap = new Bitmap(1, 1)) + { + using (var graphics = Graphics.FromImage(bitmap)) + { + graphics.FillRectangle(Brushes.Black, 0, 0, 1, 1); + } + using (var stream = new MemoryStream()) + { + bitmap.Save(stream, ImageFormat.Bmp); + stream.Seek(0L, SeekOrigin.Begin); +#if TEST_Direct3D9Ex + pool = poolvar; +#endif + // 荳ュ縺ァ譖エ縺ォ繝。繝「繝ェ隱ュ縺ソ霎シ縺ソ縺礼峩縺励※縺縺ヲ辟。鬧縺ェ縺ョ縺ァ縲ヾtream繧剃スソ縺縺ョ縺ッ豁「繧√◆縺縺ィ縺薙m + this.texture = Texture.FromStream(device.UnderlyingDevice, stream, n蟷, n鬮倥&, 1, usage, format, pool, Filter.Point, Filter.None, 0); + } + } + } + catch + { + this.Dispose(); + throw new CTextureCreateFailedException(string.Format("繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲\n({0}x{1}, {2})", n蟷, n鬮倥&, format)); + } + } + + /// + /// 逕サ蜒上ヵ繧。繧、繝ォ縺九i繝繧ッ繧ケ繝√Ε繧堤函謌舌☆繧九 + /// 蛻ゥ逕ィ蜿ッ閭ス縺ェ逕サ蜒丞ス「蠑上ッ縲。MP, JPG, PNG, TGA, DDS, PPM, DIB, HDR, PFM 縺ョ縺縺壹l縺九 + /// 繝繧ッ繧ケ繝√Ε縺ョ繧オ繧、繧コ縺ッ縲∫判蜒上ョ繧オ繧、繧コ莉・荳翫√°縺、縲.3D9繝繝舌う繧ケ縺ァ逕滓仙庄閭ス縺ェ譛蟆上ョ繧オ繧、繧コ縺ォ閾ェ蜍慕噪縺ォ隱ソ遽縺輔l繧九 + /// 縺昴ョ髫帙√ユ繧ッ繧ケ繝√Ε縺ョ隱ソ遽蠕後ョ繧オ繧、繧コ縺ォ縺ゅo縺帙◆逕サ蜒上ョ諡。螟ァ邵ョ蟆上ッ陦後o縺ェ縺縲 + /// 縺昴ョ莉悶√Α繝繝励槭ャ繝玲焚縺ッ 1縲ゞsage 縺ッ None縲√う繝。繝シ繧ク繝輔ぅ繝ォ繧ソ縺ッ Point縲√Α繝繝励槭ャ繝励ヵ繧」繝ォ繧ソ縺ッ None 縺ォ縺ェ繧九 + /// + /// Direct3D9 繝繝舌う繧ケ縲 + /// 逕サ蜒上ヵ繧。繧、繝ォ蜷阪 + /// 繝繧ッ繧ケ繝√Ε縺ョ繝輔か繝シ繝槭ャ繝医 + /// 逕サ蜒上ョ鮟抵シ0xFFFFFFFFシ峨r騾城℃縺輔○繧九↑繧 true縲 + /// 繝繧ッ繧ケ繝√Ε縺ョ邂。逅譁ケ豕輔 + /// 繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲 + public CTexture(Device device, string str繝輔ぃ繧、繝ォ蜷, Format format, bool b鮟偵r騾城℃縺吶k, Pool pool) + : this() + { + MakeTexture(device, str繝輔ぃ繧、繝ォ蜷, format, b鮟偵r騾城℃縺吶k, pool); + } + public void MakeTexture(Device device, string str繝輔ぃ繧、繝ォ蜷, Format format, bool b鮟偵r騾城℃縺吶k, Pool pool) + { + if (!File.Exists(str繝輔ぃ繧、繝ォ蜷)) // #27122 2012.1.13 from: ImageInformation 縺ァ縺ッ FileNotFound 萓句、悶ッ霑斐▲縺ヲ縺薙↑縺縺ョ縺ァ縲√%縺薙〒閾ェ蛻縺ァ繝√ぉ繝繧ッ縺吶k縲ゅo縺九j繧縺吶>繝ュ繧ー縺ョ縺溘a縺ォ縲 + throw new FileNotFoundException(string.Format("繝輔ぃ繧、繝ォ縺悟ュ伜惠縺励∪縺帙s縲\n[{0}]", str繝輔ぃ繧、繝ォ蜷)); + + Byte[] _txData = File.ReadAllBytes(str繝輔ぃ繧、繝ォ蜷); + MakeTexture(device, _txData, format, b鮟偵r騾城℃縺吶k, pool); + } + + public CTexture(Device device, byte[] txData, Format format, bool b鮟偵r騾城℃縺吶k, Pool pool) + : this() + { + MakeTexture(device, txData, format, b鮟偵r騾城℃縺吶k, pool); + } + public void MakeTexture(Device device, byte[] txData, Format format, bool b鮟偵r騾城℃縺吶k, Pool pool) + { + try + { + var information = ImageInformation.FromMemory(txData); + this.Format = format; + this.sz逕サ蜒上し繧、繧コ = new Size(information.Width, information.Height); + this.rc蜈ィ逕サ蜒 = new Rectangle(0, 0, this.sz逕サ蜒上し繧、繧コ.Width, this.sz逕サ蜒上し繧、繧コ.Height); + int colorKey = (b鮟偵r騾城℃縺吶k) ? unchecked((int)0xFF000000) : 0; + this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ = this.t謖螳壹&繧後◆繧オ繧、繧コ繧定カ縺医↑縺譛驕ゥ縺ェ繝繧ッ繧ケ繝√Ε繧オ繧、繧コ繧定ソ斐☆(device, this.sz逕サ蜒上し繧、繧コ); +#if TEST_Direct3D9Ex + pool = poolvar; +#endif + // lock ( lockobj ) + // { + //Trace.TraceInformation( "CTexture() start: " ); + this.texture = Texture.FromMemory(device.UnderlyingDevice, txData, this.sz逕サ蜒上し繧、繧コ.Width, this.sz逕サ蜒上し繧、繧コ.Height, 1, Usage.None, format, pool, Filter.Point, Filter.None, colorKey); + //Trace.TraceInformation( "CTexture() end: " ); + // } + } + catch + { + this.Dispose(); + // throw new CTextureCreateFailedException( string.Format( "繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲\n{0}", str繝輔ぃ繧、繝ォ蜷 ) ); + throw new CTextureCreateFailedException(string.Format("繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲\n")); + } + } + + public CTexture(Device device, Bitmap bitmap, Format format, bool b鮟偵r騾城℃縺吶k, Pool pool) + : this() + { + MakeTexture(device, bitmap, format, b鮟偵r騾城℃縺吶k, pool); + } + public void MakeTexture(Device device, Bitmap bitmap, Format format, bool b鮟偵r騾城℃縺吶k, Pool pool) + { + try + { + this.Format = format; + this.sz逕サ蜒上し繧、繧コ = new Size(bitmap.Width, bitmap.Height); + this.rc蜈ィ逕サ蜒 = new Rectangle(0, 0, this.sz逕サ蜒上し繧、繧コ.Width, this.sz逕サ蜒上し繧、繧コ.Height); + int colorKey = (b鮟偵r騾城℃縺吶k) ? unchecked((int)0xFF000000) : 0; + this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ = this.t謖螳壹&繧後◆繧オ繧、繧コ繧定カ縺医↑縺譛驕ゥ縺ェ繝繧ッ繧ケ繝√Ε繧オ繧、繧コ繧定ソ斐☆(device, this.sz逕サ蜒上し繧、繧コ); +#if TEST_Direct3D9Ex + pool = poolvar; +#endif + //Trace.TraceInformation( "CTExture() start: " ); + unsafe // Bitmap縺ョ蜀驛ィ繝繝シ繧ソ(a8r8g8b8)繧定ェ蜑阪〒繧エ繝ェ繧エ繝ェ繧ウ繝斐シ縺吶k + { + int tw = +#if TEST_Direct3D9Ex + 288; // 32縺ョ蛟肴焚縺ォ縺吶k(繧ー繝ゥ繝輔↓繧医▲縺ヲ縺ッ2縺ョ縺ケ縺堺ケ励↓縺励↑縺縺ィ繝繝。縺九b) +#else + this.sz逕サ蜒上し繧、繧コ.Width; +#endif +#if TEST_Direct3D9Ex + this.texture = new Texture( device, tw, this.sz逕サ蜒上し繧、繧コ.Height, 1, Usage.Dynamic, format, Pool.Default ); +#else + this.texture = new Texture(device.UnderlyingDevice, this.sz逕サ蜒上し繧、繧コ.Width, this.sz逕サ蜒上し繧、繧コ.Height, 1, Usage.None, format, pool); +#endif + BitmapData srcBufData = bitmap.LockBits(new Rectangle(0, 0, this.sz逕サ蜒上し繧、繧コ.Width, this.sz逕サ蜒上し繧、繧コ.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); + DataRectangle destDataRectangle = texture.LockRectangle(0, LockFlags.Discard); // None +#if TEST_Direct3D9Ex + byte[] filldata = null; + if ( tw > this.sz逕サ蜒上し繧、繧コ.Width ) + { + filldata = new byte[ (tw - this.sz逕サ蜒上し繧、繧コ.Width) * 4 ]; + } + for ( int y = 0; y < this.sz逕サ蜒上し繧、繧コ.Height; y++ ) + { + IntPtr src_scan0 = (IntPtr) ( (Int64) srcBufData.Scan0 + y * srcBufData.Stride ); + destDataRectangle.Data.WriteRange( src_scan0, this.sz逕サ蜒上し繧、繧コ.Width * 4 ); + if ( tw > this.sz逕サ蜒上し繧、繧コ.Width ) + { + destDataRectangle.Data.WriteRange( filldata ); + } + } +#else + IntPtr src_scan0 = (IntPtr)((Int64)srcBufData.Scan0); + destDataRectangle.Data.WriteRange(src_scan0, this.sz逕サ蜒上し繧、繧コ.Width * 4 * this.sz逕サ蜒上し繧、繧コ.Height); +#endif + texture.UnlockRectangle(0); + bitmap.UnlockBits(srcBufData); + } + //Trace.TraceInformation( "CTExture() End: " ); + } + catch + { + this.Dispose(); + // throw new CTextureCreateFailedException( string.Format( "繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲\n{0}", str繝輔ぃ繧、繝ォ蜷 ) ); + throw new CTextureCreateFailedException(string.Format("繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲\n")); + } + } + // 繝。繧ス繝繝 + + // 2016.11.10 kairera0467 諡。蠑オ + // Rectangle繧剃スソ縺蝣エ蜷医∝コァ讓呵ェソ謨エ縺ョ縺溘a縺ォ繝繧ッ繧ケ繝√Ε繧オ繧、繧コ縺ョ蛟、繧偵◎縺ョ縺セ縺セ菴ソ縺縺ィ縺セ縺壹>縺薙→縺ォ縺ェ繧九◆繧√ヽectragle縺九i蟷繧貞叙蠕励@縺ヲ隱ソ謨エ繧偵☆繧九 + public void t2D荳ュ蠢蝓コ貅匁緒逕サ(Device device, int x, int y) + { + this.t2D謠冗判(device, x - (this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2), y - (this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height / 2), 1f, this.rc蜈ィ逕サ蜒); + } + public void t2D荳ュ蠢蝓コ貅匁緒逕サ(Device device, int x, int y, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺) + { + this.t2D謠冗判(device, x - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width / 2), y - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height / 2), 1f, rc逕サ蜒丞縺ョ謠冗判鬆伜沺); + } + public void t2D荳ュ蠢蝓コ貅匁緒逕サ(Device device, float x, float y) + { + this.t2D謠冗判(device, (int)x - (this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2), (int)y - (this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height / 2), 1f, this.rc蜈ィ逕サ蜒); + } + public void t2D荳ュ蠢蝓コ貅匁緒逕サ(Device device, float x, float y, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺) + { + this.t2D謠冗判(device, (int)x - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width / 2), (int)y - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height / 2), 1.0f, rc逕サ蜒丞縺ョ謠冗判鬆伜沺); + } + public void t2D荳ュ蠢蝓コ貅匁緒逕サ(Device device, float x, float y, float depth, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺) + { + this.t2D謠冗判(device, (int)x - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width / 2), (int)y - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height / 2), depth, rc逕サ蜒丞縺ョ謠冗判鬆伜沺); + } + + // 荳九r蝓コ貅悶↓縺励※謠冗判縺吶k(諡。螟ァ邇閠諷ョ)繝。繧ス繝繝峨r霑ス蜉縲 (AioiLight) + public void t2D諡。螟ァ邇閠諷ョ荳句渕貅匁緒逕サ(Device device, int x, int y) + { + this.t2D謠冗判(device, x, y - (sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), 1f, this.rc蜈ィ逕サ蜒); + } + public void t2D諡。螟ァ邇閠諷ョ荳句渕貅匁緒逕サ(Device device, int x, int y, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺) + { + this.t2D謠冗判(device, x, y - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), 1f, rc逕サ蜒丞縺ョ謠冗判鬆伜沺); + } + public void t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(Device device, int x, int y) + { + this.t2D謠冗判(device, x - (this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y - (sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), 1f, this.rc蜈ィ逕サ蜒); + } + public void t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(Device device, float x, float y) + { + this.t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(device, (int)x, (int)y); + } + + public void t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(Device device, int x, int y, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺) + { + this.t2D謠冗判(device, x - ((rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width / 2)), y - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), 1f, rc逕サ蜒丞縺ョ謠冗判鬆伜沺); + } + public void t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(Device device, float x, float y, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺) + { + this.t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(device, (int)x, (int)y, rc逕サ蜒丞縺ョ謠冗判鬆伜沺); + } + public void t2D荳倶クュ螟ョ蝓コ貅匁緒逕サ(Device device, int x, int y) + { + this.t2D謠冗判(device, x - (this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2), y - (sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height), this.rc蜈ィ逕サ蜒); + } + public void t2D荳倶クュ螟ョ蝓コ貅匁緒逕サ(Device device, int x, int y, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺) + { + this.t2D謠冗判(device, x - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width / 2), y - (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height), rc逕サ蜒丞縺ョ謠冗判鬆伜沺); + //this.t2D謠冗判(devicek x, y, rc逕サ蜒丞縺ョ謠冗判鬆伜沺; + } + + + public void t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(Device device, int x, int y) + { + this.t2D謠冗判(device, x - (this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y - (sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), 1f, this.rc蜈ィ逕サ蜒); + } + public void t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(Device device, int x, int y, RectangleF rc) + { + this.t2D謠冗判(device, x - (rc.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y - (rc.Height / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), 1f, rc); + } + public void t2D諡。螟ァ邇閠諷ョ荳贋クュ螟ョ蝓コ貅匁緒逕サ(Device device, int x, int y, RectangleF rc) + { + this.t2D謠冗判(device, x - (rc.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y, 1f, rc); + } + public void t2D諡。螟ァ邇閠諷ョ荳贋クュ螟ョ蝓コ貅匁緒逕サ(Device device, int x, int y) + { + this.t2D謠冗判(device, x - (rc蜈ィ逕サ蜒.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y, 1f, rc蜈ィ逕サ蜒); + } + public void t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(Device device, float x, float y) + { + this.t2D謠冗判(device, x - (this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y - (sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), 1f, this.rc蜈ィ逕サ蜒); + } + public void t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(Device device, float x, float y, RectangleF rc) + { + this.t2D謠冗判(device, x - (rc.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y - (rc.Height / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), 1f, rc); + } + public void t2D諡。螟ァ邇閠諷ョ謠冗判(Device device, RefPnt refpnt, float x, float y) + { + this.t2D諡。螟ァ邇閠諷ョ謠冗判(device, refpnt, x, y, rc蜈ィ逕サ蜒); + } + public void t2D諡。螟ァ邇閠諷ョ謠冗判(Device device, RefPnt refpnt, float x, float y, Rectangle rect) + { + this.t2D諡。螟ァ邇閠諷ョ謠冗判(device, refpnt, x, y, 1f, rect); + } + public void t2D諡。螟ァ邇閠諷ョ謠冗判(Device device, RefPnt refpnt, float x, float y, float depth, Rectangle rect) + { + switch (refpnt) + { + case RefPnt.UpLeft: + this.t2D謠冗判(device, x, y, depth, rect); + break; + case RefPnt.Up: + this.t2D謠冗判(device, x - (rect.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y, depth, rect); + break; + case RefPnt.UpRight: + this.t2D謠冗判(device, x - rect.Width * this.vc諡。螟ァ邵ョ蟆丞咲紫.X, y, depth, rect); + break; + case RefPnt.Left: + this.t2D謠冗判(device, x, y - (rect.Height / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), depth, rect); + break; + case RefPnt.Center: + this.t2D謠冗判(device, x - (rect.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y - (rect.Height / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), depth, rect); + break; + case RefPnt.Right: + this.t2D謠冗判(device, x - rect.Width * this.vc諡。螟ァ邵ョ蟆丞咲紫.X, y - (rect.Height / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y), depth, rect); + break; + case RefPnt.DownLeft: + this.t2D謠冗判(device, x, y - rect.Height * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y, depth, rect); + break; + case RefPnt.Down: + this.t2D謠冗判(device, x - (rect.Width / 2 * this.vc諡。螟ァ邵ョ蟆丞咲紫.X), y - rect.Height * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y, depth, rect); + break; + case RefPnt.DownRight: + this.t2D謠冗判(device, x - rect.Width * this.vc諡。螟ァ邵ョ蟆丞咲紫.X, y - rect.Height * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y, depth, rect); + break; + default: + break; + } + + } + + public enum RefPnt + { + UpLeft, + Up, + UpRight, + Left, + Center, + Right, + DownLeft, + Down, + DownRight, + } + + /// + /// 繝繧ッ繧ケ繝√Ε繧 2D 逕サ蜒上→隕九↑縺励※謠冗判縺吶k縲 + /// + /// Direct3D9 繝繝舌う繧ケ縲 + /// 謠冗判菴咲スョシ医ユ繧ッ繧ケ繝√Ε縺ョ蟾ヲ荳贋ス咲スョ縺ョ X 蠎ァ讓兌dot]シ峨 + /// 謠冗判菴咲スョシ医ユ繧ッ繧ケ繝√Ε縺ョ蟾ヲ荳贋ス咲スョ縺ョ Y 蠎ァ讓兌dot]シ峨 + public void t2D謠冗判(Device device, int x, int y) + { + this.t2D謠冗判(device, x, y, 1f, this.rc蜈ィ逕サ蜒); + } + public void t2D謠冗判(Device device, int x, int y, RectangleF rc逕サ蜒丞縺ョ謠冗判鬆伜沺) + { + this.t2D謠冗判(device, x, y, 1f, rc逕サ蜒丞縺ョ謠冗判鬆伜沺); + } + public void t2D謠冗判(Device device, float x, float y) + { + this.t2D謠冗判(device, (int)x, (int)y, 1f, this.rc蜈ィ逕サ蜒); + } + public void t2D謠冗判(Device device, float x, float y, RectangleF rc逕サ蜒丞縺ョ謠冗判鬆伜沺) + { + this.t2D謠冗判(device, (int)x, (int)y, 1f, rc逕サ蜒丞縺ョ謠冗判鬆伜沺); + } + public void t2D謠冗判(Device device, float x, float y, float depth, RectangleF rc逕サ蜒丞縺ョ謠冗判鬆伜沺) + { + if (this.texture == null) + return; + + this.t繝ャ繝ウ繝繝ェ繝ウ繧ー繧ケ繝繝シ繝医ョ險ュ螳(device); + + if (this.fZ霆ク荳ュ蠢蝗櫁サ「 == 0f) + { + #region [ (A) 蝗櫁サ「縺ェ縺 ] + //----------------- + float f陬懈ュ」蛟、X = -0.5f; // -0.5 縺ッ蠎ァ讓吶→繝斐け繧サ繝ォ縺ョ隱、蟾ョ繧貞精蜿弱☆繧九◆繧√ョ蠎ァ讓呵」懈ュ」蛟、縲(MSDN蜿らァ) + float f陬懈ュ」蛟、Y = -0.5f; // + float w = rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width; + float h = rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height; + float f蟾ヲU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Left) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width); + float f蜿ウU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Right) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width); + float f荳碍蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Top) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + float f荳儀蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Bottom) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + this.color4.Alpha = ((float)this._opacity) / 255f; + int color = this.color4.ToArgb(); + + if (this.cvTransformedColoredVertexies == null) + this.cvTransformedColoredVertexies = new TransformedColoredTexturedVertex[4]; + + // #27122 2012.1.13 from: 莉・荳九√槭ロ繝シ繧ク繝峨が繝悶ず繧ァ繧ッ繝茨シ茨シ昴ぎ繝吶シ繧クシ峨ョ驥冗肇繧呈椛縺医k縺溘a縲]ew 縺ッ菴ソ繧上★縲√Γ繝ウ繝舌↓蛟、繧抵シ代▽縺壹▽逶エ謗・荳頑嶌縺阪☆繧九 + + this.cvTransformedColoredVertexies[0].Position.X = x + f陬懈ュ」蛟、X; + this.cvTransformedColoredVertexies[0].Position.Y = y + f陬懈ュ」蛟、Y; + this.cvTransformedColoredVertexies[0].Position.Z = depth; + this.cvTransformedColoredVertexies[0].Position.W = 1.0f; + this.cvTransformedColoredVertexies[0].Color = color; + this.cvTransformedColoredVertexies[0].TextureCoordinates.X = f蟾ヲU蛟、; + this.cvTransformedColoredVertexies[0].TextureCoordinates.Y = f荳碍蛟、; + + this.cvTransformedColoredVertexies[1].Position.X = (x + (w * this.vc諡。螟ァ邵ョ蟆丞咲紫.X)) + f陬懈ュ」蛟、X; + this.cvTransformedColoredVertexies[1].Position.Y = y + f陬懈ュ」蛟、Y; + this.cvTransformedColoredVertexies[1].Position.Z = depth; + this.cvTransformedColoredVertexies[1].Position.W = 1.0f; + this.cvTransformedColoredVertexies[1].Color = color; + this.cvTransformedColoredVertexies[1].TextureCoordinates.X = f蜿ウU蛟、; + this.cvTransformedColoredVertexies[1].TextureCoordinates.Y = f荳碍蛟、; + + this.cvTransformedColoredVertexies[2].Position.X = x + f陬懈ュ」蛟、X; + this.cvTransformedColoredVertexies[2].Position.Y = (y + (h * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y)) + f陬懈ュ」蛟、Y; + this.cvTransformedColoredVertexies[2].Position.Z = depth; + this.cvTransformedColoredVertexies[2].Position.W = 1.0f; + this.cvTransformedColoredVertexies[2].Color = color; + this.cvTransformedColoredVertexies[2].TextureCoordinates.X = f蟾ヲU蛟、; + this.cvTransformedColoredVertexies[2].TextureCoordinates.Y = f荳儀蛟、; + + this.cvTransformedColoredVertexies[3].Position.X = (x + (w * this.vc諡。螟ァ邵ョ蟆丞咲紫.X)) + f陬懈ュ」蛟、X; + this.cvTransformedColoredVertexies[3].Position.Y = (y + (h * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y)) + f陬懈ュ」蛟、Y; + this.cvTransformedColoredVertexies[3].Position.Z = depth; + this.cvTransformedColoredVertexies[3].Position.W = 1.0f; + this.cvTransformedColoredVertexies[3].Color = color; + this.cvTransformedColoredVertexies[3].TextureCoordinates.X = f蜿ウU蛟、; + this.cvTransformedColoredVertexies[3].TextureCoordinates.Y = f荳儀蛟、; + + device.SetTexture(0, this.texture); + device.VertexFormat = TransformedColoredTexturedVertex.Format; + device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 0, 2, in this.cvTransformedColoredVertexies); + //----------------- + #endregion + } + else + { + #region [ (B) 蝗櫁サ「縺ゅj ] + //----------------- + float f陬懈ュ」蛟、X = ((rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width % 2) == 0) ? -0.5f : 0f; // -0.5 縺ッ蠎ァ讓吶→繝斐け繧サ繝ォ縺ョ隱、蟾ョ繧貞精蜿弱☆繧九◆繧√ョ蠎ァ讓呵」懈ュ」蛟、縲(MSDN蜿らァ) + float f陬懈ュ」蛟、Y = ((rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height % 2) == 0) ? -0.5f : 0f; // 3Dシ亥屓霆「縺吶kシ峨↑繧芽」懈ュ」縺ッ縺繧峨↑縺縲 + float f荳ュ螟ョX = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width) / 2f; + float f荳ュ螟ョY = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height) / 2f; + float f蟾ヲU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Left) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width); + float f蜿ウU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Right) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width); + float f荳碍蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Top) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + float f荳儀蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Bottom) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + this.color4.Alpha = ((float)this._opacity) / 255f; + int color = this.color4.ToArgb(); + + if (this.cvPositionColoredVertexies == null) + this.cvPositionColoredVertexies = new PositionColoredTexturedVertex[4]; + + // #27122 2012.1.13 from: 莉・荳九√槭ロ繝シ繧ク繝峨が繝悶ず繧ァ繧ッ繝茨シ茨シ昴ぎ繝吶シ繧クシ峨ョ驥冗肇繧呈椛縺医k縺溘a縲]ew 縺ッ菴ソ繧上★縲√Γ繝ウ繝舌↓蛟、繧抵シ代▽縺壹▽逶エ謗・荳頑嶌縺阪☆繧九 + + this.cvPositionColoredVertexies[0].Position.X = -f荳ュ螟ョX + f陬懈ュ」蛟、X; + this.cvPositionColoredVertexies[0].Position.Y = f荳ュ螟ョY + f陬懈ュ」蛟、Y; + this.cvPositionColoredVertexies[0].Position.Z = depth; + this.cvPositionColoredVertexies[0].Color = color; + this.cvPositionColoredVertexies[0].TextureCoordinates.X = f蟾ヲU蛟、; + this.cvPositionColoredVertexies[0].TextureCoordinates.Y = f荳碍蛟、; + + this.cvPositionColoredVertexies[1].Position.X = f荳ュ螟ョX + f陬懈ュ」蛟、X; + this.cvPositionColoredVertexies[1].Position.Y = f荳ュ螟ョY + f陬懈ュ」蛟、Y; + this.cvPositionColoredVertexies[1].Position.Z = depth; + this.cvPositionColoredVertexies[1].Color = color; + this.cvPositionColoredVertexies[1].TextureCoordinates.X = f蜿ウU蛟、; + this.cvPositionColoredVertexies[1].TextureCoordinates.Y = f荳碍蛟、; + + this.cvPositionColoredVertexies[2].Position.X = -f荳ュ螟ョX + f陬懈ュ」蛟、X; + this.cvPositionColoredVertexies[2].Position.Y = -f荳ュ螟ョY + f陬懈ュ」蛟、Y; + this.cvPositionColoredVertexies[2].Position.Z = depth; + this.cvPositionColoredVertexies[2].Color = color; + this.cvPositionColoredVertexies[2].TextureCoordinates.X = f蟾ヲU蛟、; + this.cvPositionColoredVertexies[2].TextureCoordinates.Y = f荳儀蛟、; + + this.cvPositionColoredVertexies[3].Position.X = f荳ュ螟ョX + f陬懈ュ」蛟、X; + this.cvPositionColoredVertexies[3].Position.Y = -f荳ュ螟ョY + f陬懈ュ」蛟、Y; + this.cvPositionColoredVertexies[3].Position.Z = depth; + this.cvPositionColoredVertexies[3].Color = color; + this.cvPositionColoredVertexies[3].TextureCoordinates.X = f蜿ウU蛟、; + this.cvPositionColoredVertexies[3].TextureCoordinates.Y = f荳儀蛟、; + + float n謠冗判鬆伜沺蜀X = x + (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width / 2.0f); + float n謠冗判鬆伜沺蜀Y = y + (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height / 2.0f); + var vc3遘サ蜍暮 = new Vector3(n謠冗判鬆伜沺蜀X - (((float)device.Viewport.Width) / 2f), -(n謠冗判鬆伜沺蜀Y - (((float)device.Viewport.Height) / 2f)), 0f); + + var matrix = Matrix.Identity * Matrix.Scaling(this.vc諡。螟ァ邵ョ蟆丞咲紫); + matrix *= Matrix.RotationZ(this.fZ霆ク荳ュ蠢蝗櫁サ「); + matrix *= Matrix.Translation(vc3遘サ蜍暮); + device.SetTransform(TransformState.World, matrix); + + device.SetTexture(0, this.texture); + device.VertexFormat = PositionColoredTexturedVertex.Format; + device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, in this.cvPositionColoredVertexies); + //----------------- + #endregion + } + } + public void t2D謠冗判(Device device, int x, int y, float depth, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺) + { + if (this.texture == null) + return; + + this.t繝ャ繝ウ繝繝ェ繝ウ繧ー繧ケ繝繝シ繝医ョ險ュ螳(device); + + if (this.fZ霆ク荳ュ蠢蝗櫁サ「 == 0f) + { + #region [ (A) 蝗櫁サ「縺ェ縺 ] + //----------------- + float f陬懈ュ」蛟、X = -0.5f; // -0.5 縺ッ蠎ァ讓吶→繝斐け繧サ繝ォ縺ョ隱、蟾ョ繧貞精蜿弱☆繧九◆繧√ョ蠎ァ讓呵」懈ュ」蛟、縲(MSDN蜿らァ) + float f陬懈ュ」蛟、Y = -0.5f; // + float w = rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width; + float h = rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height; + float f蟾ヲU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Left) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width); + float f蜿ウU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Right) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width); + float f荳碍蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Top) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + float f荳儀蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Bottom) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + this.color4.Alpha = ((float)this._opacity) / 255f; + int color = this.color4.ToArgb(); + + if (this.cvTransformedColoredVertexies == null) + this.cvTransformedColoredVertexies = new TransformedColoredTexturedVertex[4]; + + // #27122 2012.1.13 from: 莉・荳九√槭ロ繝シ繧ク繝峨が繝悶ず繧ァ繧ッ繝茨シ茨シ昴ぎ繝吶シ繧クシ峨ョ驥冗肇繧呈椛縺医k縺溘a縲]ew 縺ッ菴ソ繧上★縲√Γ繝ウ繝舌↓蛟、繧抵シ代▽縺壹▽逶エ謗・荳頑嶌縺阪☆繧九 + + this.cvTransformedColoredVertexies[0].Position.X = x + f陬懈ュ」蛟、X; + this.cvTransformedColoredVertexies[0].Position.Y = y + f陬懈ュ」蛟、Y; + this.cvTransformedColoredVertexies[0].Position.Z = depth; + this.cvTransformedColoredVertexies[0].Position.W = 1.0f; + this.cvTransformedColoredVertexies[0].Color = color; + this.cvTransformedColoredVertexies[0].TextureCoordinates.X = f蟾ヲU蛟、; + this.cvTransformedColoredVertexies[0].TextureCoordinates.Y = f荳碍蛟、; + + this.cvTransformedColoredVertexies[1].Position.X = (x + (w * this.vc諡。螟ァ邵ョ蟆丞咲紫.X)) + f陬懈ュ」蛟、X; + this.cvTransformedColoredVertexies[1].Position.Y = y + f陬懈ュ」蛟、Y; + this.cvTransformedColoredVertexies[1].Position.Z = depth; + this.cvTransformedColoredVertexies[1].Position.W = 1.0f; + this.cvTransformedColoredVertexies[1].Color = color; + this.cvTransformedColoredVertexies[1].TextureCoordinates.X = f蜿ウU蛟、; + this.cvTransformedColoredVertexies[1].TextureCoordinates.Y = f荳碍蛟、; + + this.cvTransformedColoredVertexies[2].Position.X = x + f陬懈ュ」蛟、X; + this.cvTransformedColoredVertexies[2].Position.Y = (y + (h * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y)) + f陬懈ュ」蛟、Y; + this.cvTransformedColoredVertexies[2].Position.Z = depth; + this.cvTransformedColoredVertexies[2].Position.W = 1.0f; + this.cvTransformedColoredVertexies[2].Color = color; + this.cvTransformedColoredVertexies[2].TextureCoordinates.X = f蟾ヲU蛟、; + this.cvTransformedColoredVertexies[2].TextureCoordinates.Y = f荳儀蛟、; + + this.cvTransformedColoredVertexies[3].Position.X = (x + (w * this.vc諡。螟ァ邵ョ蟆丞咲紫.X)) + f陬懈ュ」蛟、X; + this.cvTransformedColoredVertexies[3].Position.Y = (y + (h * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y)) + f陬懈ュ」蛟、Y; + this.cvTransformedColoredVertexies[3].Position.Z = depth; + this.cvTransformedColoredVertexies[3].Position.W = 1.0f; + this.cvTransformedColoredVertexies[3].Color = color; + this.cvTransformedColoredVertexies[3].TextureCoordinates.X = f蜿ウU蛟、; + this.cvTransformedColoredVertexies[3].TextureCoordinates.Y = f荳儀蛟、; + + device.SetTexture(0, this.texture); + device.VertexFormat = TransformedColoredTexturedVertex.Format; + device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 0, 2, in this.cvTransformedColoredVertexies); + //----------------- + #endregion + } + else + { + #region [ (B) 蝗櫁サ「縺ゅj ] + //----------------- + float f陬懈ュ」蛟、X = ((rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width % 2) == 0) ? -0.5f : 0f; // -0.5 縺ッ蠎ァ讓吶→繝斐け繧サ繝ォ縺ョ隱、蟾ョ繧貞精蜿弱☆繧九◆繧√ョ蠎ァ讓呵」懈ュ」蛟、縲(MSDN蜿らァ) + float f陬懈ュ」蛟、Y = ((rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height % 2) == 0) ? -0.5f : 0f; // 3Dシ亥屓霆「縺吶kシ峨↑繧芽」懈ュ」縺ッ縺繧峨↑縺縲 + float f荳ュ螟ョX = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width) / 2f; + float f荳ュ螟ョY = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height) / 2f; + float f蟾ヲU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Left) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width); + float f蜿ウU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Right) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width); + float f荳碍蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Top) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + float f荳儀蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Bottom) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + this.color4.Alpha = ((float)this._opacity) / 255f; + int color = this.color4.ToArgb(); + + if (this.cvPositionColoredVertexies == null) + this.cvPositionColoredVertexies = new PositionColoredTexturedVertex[4]; + + // #27122 2012.1.13 from: 莉・荳九√槭ロ繝シ繧ク繝峨が繝悶ず繧ァ繧ッ繝茨シ茨シ昴ぎ繝吶シ繧クシ峨ョ驥冗肇繧呈椛縺医k縺溘a縲]ew 縺ッ菴ソ繧上★縲√Γ繝ウ繝舌↓蛟、繧抵シ代▽縺壹▽逶エ謗・荳頑嶌縺阪☆繧九 + + this.cvPositionColoredVertexies[0].Position.X = -f荳ュ螟ョX + f陬懈ュ」蛟、X; + this.cvPositionColoredVertexies[0].Position.Y = f荳ュ螟ョY + f陬懈ュ」蛟、Y; + this.cvPositionColoredVertexies[0].Position.Z = depth; + this.cvPositionColoredVertexies[0].Color = color; + this.cvPositionColoredVertexies[0].TextureCoordinates.X = f蟾ヲU蛟、; + this.cvPositionColoredVertexies[0].TextureCoordinates.Y = f荳碍蛟、; + + this.cvPositionColoredVertexies[1].Position.X = f荳ュ螟ョX + f陬懈ュ」蛟、X; + this.cvPositionColoredVertexies[1].Position.Y = f荳ュ螟ョY + f陬懈ュ」蛟、Y; + this.cvPositionColoredVertexies[1].Position.Z = depth; + this.cvPositionColoredVertexies[1].Color = color; + this.cvPositionColoredVertexies[1].TextureCoordinates.X = f蜿ウU蛟、; + this.cvPositionColoredVertexies[1].TextureCoordinates.Y = f荳碍蛟、; + + this.cvPositionColoredVertexies[2].Position.X = -f荳ュ螟ョX + f陬懈ュ」蛟、X; + this.cvPositionColoredVertexies[2].Position.Y = -f荳ュ螟ョY + f陬懈ュ」蛟、Y; + this.cvPositionColoredVertexies[2].Position.Z = depth; + this.cvPositionColoredVertexies[2].Color = color; + this.cvPositionColoredVertexies[2].TextureCoordinates.X = f蟾ヲU蛟、; + this.cvPositionColoredVertexies[2].TextureCoordinates.Y = f荳儀蛟、; + + this.cvPositionColoredVertexies[3].Position.X = f荳ュ螟ョX + f陬懈ュ」蛟、X; + this.cvPositionColoredVertexies[3].Position.Y = -f荳ュ螟ョY + f陬懈ュ」蛟、Y; + this.cvPositionColoredVertexies[3].Position.Z = depth; + this.cvPositionColoredVertexies[3].Color = color; + this.cvPositionColoredVertexies[3].TextureCoordinates.X = f蜿ウU蛟、; + this.cvPositionColoredVertexies[3].TextureCoordinates.Y = f荳儀蛟、; + + int n謠冗判鬆伜沺蜀X = x + (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width / 2); + int n謠冗判鬆伜沺蜀Y = y + (rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height / 2); + var vc3遘サ蜍暮 = new Vector3(n謠冗判鬆伜沺蜀X - (((float)device.Viewport.Width) / 2f), -(n謠冗判鬆伜沺蜀Y - (((float)device.Viewport.Height) / 2f)), 0f); + + var matrix = Matrix.Identity * Matrix.Scaling(this.vc諡。螟ァ邵ョ蟆丞咲紫); + matrix *= Matrix.RotationZ(this.fZ霆ク荳ュ蠢蝗櫁サ「); + matrix *= Matrix.Translation(vc3遘サ蜍暮); + device.SetTransform(TransformState.World, matrix); + + device.SetTexture(0, this.texture); + device.VertexFormat = PositionColoredTexturedVertex.Format; + device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, in this.cvPositionColoredVertexies); + //----------------- + #endregion + } + } + public void t2D荳贋ク句渚霆「謠冗判(Device device, int x, int y) + { + this.t2D荳贋ク句渚霆「謠冗判(device, x, y, 1f, this.rc蜈ィ逕サ蜒); + } + public void t2D荳贋ク句渚霆「謠冗判(Device device, int x, int y, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺) + { + this.t2D荳贋ク句渚霆「謠冗判(device, x, y, 1f, rc逕サ蜒丞縺ョ謠冗判鬆伜沺); + } + public void t2D蟾ヲ蜿ウ蜿崎サ「謠冗判(Device device, int x, int y) + { + this.t2D蟾ヲ蜿ウ蜿崎サ「謠冗判(device, x, y, 1f, this.rc蜈ィ逕サ蜒); + } + public void t2D蟾ヲ蜿ウ蜿崎サ「謠冗判(Device device, float x, float y) + { + this.t2D蟾ヲ蜿ウ蜿崎サ「謠冗判(device, x, y, 1f, this.rc蜈ィ逕サ蜒); + } + public void t2D蟾ヲ蜿ウ蜿崎サ「謠冗判(Device device, int x, int y, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺) + { + this.t2D蟾ヲ蜿ウ蜿崎サ「謠冗判(device, x, y, 1f, rc逕サ蜒丞縺ョ謠冗判鬆伜沺); + } + public void t2D蟾ヲ蜿ウ蜿崎サ「謠冗判(Device device, float x, float y, float depth, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺) + { + if (this.texture == null) + throw new InvalidOperationException("繝繧ッ繧ケ繝√Ε縺ッ逕滓舌&繧後※縺縺セ縺帙s縲"); + + this.t繝ャ繝ウ繝繝ェ繝ウ繧ー繧ケ繝繝シ繝医ョ險ュ螳(device); + + float fx = x * CTexture.f逕サ髱「豈皮紫 + CTexture.rc迚ゥ逅逕サ髱「謠冗判鬆伜沺.X - 0.5f; // -0.5 縺ッ蠎ァ讓吶→繝斐け繧サ繝ォ縺ョ隱、蟾ョ繧貞精蜿弱☆繧九◆繧√ョ蠎ァ讓呵」懈ュ」蛟、縲(MSDN蜿らァ) + float fy = y * CTexture.f逕サ髱「豈皮紫 + CTexture.rc迚ゥ逅逕サ髱「謠冗判鬆伜沺.Y - 0.5f; // + float w = rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width * this.vc諡。螟ァ邵ョ蟆丞咲紫.X * CTexture.f逕サ髱「豈皮紫; + float h = rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y * CTexture.f逕サ髱「豈皮紫; + float f蟾ヲU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Left) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width); + float f蜿ウU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Right) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width); + float f荳碍蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Top) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + float f荳儀蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Bottom) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + this.color4.Alpha = ((float)this._opacity) / 255f; + int color = this.color4.ToArgb(); + + + if (this.cvTransformedColoredVertexies == null) + this.cvTransformedColoredVertexies = new TransformedColoredTexturedVertex[4]; + + // 莉・荳九√槭ロ繝シ繧ク繝峨が繝悶ず繧ァ繧ッ繝医ョ驥冗肇繧呈椛縺医k縺溘a new 縺ッ菴ソ繧上↑縺縲 + + this.cvTransformedColoredVertexies[0].TextureCoordinates.X = f蜿ウU蛟、; // 蟾ヲ荳 竊 蟾ヲ荳 + this.cvTransformedColoredVertexies[0].TextureCoordinates.Y = f荳碍蛟、; + this.cvTransformedColoredVertexies[0].Position.X = fx; + this.cvTransformedColoredVertexies[0].Position.Y = fy; + this.cvTransformedColoredVertexies[0].Position.Z = depth; + this.cvTransformedColoredVertexies[0].Position.W = 1.0f; + this.cvTransformedColoredVertexies[0].Color = color; + + this.cvTransformedColoredVertexies[1].TextureCoordinates.X = f蟾ヲU蛟、; // 蜿ウ荳 竊 蜿ウ荳 + this.cvTransformedColoredVertexies[1].TextureCoordinates.Y = f荳碍蛟、; + this.cvTransformedColoredVertexies[1].Position.X = fx + w; + this.cvTransformedColoredVertexies[1].Position.Y = fy; + this.cvTransformedColoredVertexies[1].Position.Z = depth; + this.cvTransformedColoredVertexies[1].Position.W = 1.0f; + this.cvTransformedColoredVertexies[1].Color = color; + + this.cvTransformedColoredVertexies[2].TextureCoordinates.X = f蜿ウU蛟、; // 蟾ヲ荳 竊 蟾ヲ荳 + this.cvTransformedColoredVertexies[2].TextureCoordinates.Y = f荳儀蛟、; + this.cvTransformedColoredVertexies[2].Position.X = fx; + this.cvTransformedColoredVertexies[2].Position.Y = fy + h; + this.cvTransformedColoredVertexies[2].Position.Z = depth; + this.cvTransformedColoredVertexies[2].Position.W = 1.0f; + this.cvTransformedColoredVertexies[2].Color = color; + + this.cvTransformedColoredVertexies[3].TextureCoordinates.X = f蟾ヲU蛟、; // 蜿ウ荳 竊 蜿ウ荳 + this.cvTransformedColoredVertexies[3].TextureCoordinates.Y = f荳儀蛟、; + this.cvTransformedColoredVertexies[3].Position.X = fx + w; + this.cvTransformedColoredVertexies[3].Position.Y = fy + h; + this.cvTransformedColoredVertexies[3].Position.Z = depth; + this.cvTransformedColoredVertexies[3].Position.W = 1.0f; + this.cvTransformedColoredVertexies[3].Color = color; + + device.SetTexture(0, this.texture); + device.VertexFormat = TransformedColoredTexturedVertex.Format; + device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, this.cvTransformedColoredVertexies); + } + public void t2D荳贋ク句渚霆「謠冗判(Device device, int x, int y, float depth, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺) + { + if (this.texture == null) + throw new InvalidOperationException("繝繧ッ繧ケ繝√Ε縺ッ逕滓舌&繧後※縺縺セ縺帙s縲"); + + this.t繝ャ繝ウ繝繝ェ繝ウ繧ー繧ケ繝繝シ繝医ョ險ュ螳(device); + + float fx = x * CTexture.f逕サ髱「豈皮紫 + CTexture.rc迚ゥ逅逕サ髱「謠冗判鬆伜沺.X - 0.5f; // -0.5 縺ッ蠎ァ讓吶→繝斐け繧サ繝ォ縺ョ隱、蟾ョ繧貞精蜿弱☆繧九◆繧√ョ蠎ァ讓呵」懈ュ」蛟、縲(MSDN蜿らァ) + float fy = y * CTexture.f逕サ髱「豈皮紫 + CTexture.rc迚ゥ逅逕サ髱「謠冗判鬆伜沺.Y - 0.5f; // + float w = rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width * this.vc諡。螟ァ邵ョ蟆丞咲紫.X * CTexture.f逕サ髱「豈皮紫; + float h = rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height * this.vc諡。螟ァ邵ョ蟆丞咲紫.Y * CTexture.f逕サ髱「豈皮紫; + float f蟾ヲU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Left) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width); + float f蜿ウU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Right) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width); + float f荳碍蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Top) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + float f荳儀蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Bottom) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + this.color4.Alpha = ((float)this._opacity) / 255f; + int color = this.color4.ToArgb(); + + if (this.cvTransformedColoredVertexies == null) + this.cvTransformedColoredVertexies = new TransformedColoredTexturedVertex[4]; + + // 莉・荳九√槭ロ繝シ繧ク繝峨が繝悶ず繧ァ繧ッ繝医ョ驥冗肇繧呈椛縺医k縺溘a new 縺ッ菴ソ繧上↑縺縲 + + this.cvTransformedColoredVertexies[0].TextureCoordinates.X = f蟾ヲU蛟、; // 蟾ヲ荳 竊 蟾ヲ荳 + this.cvTransformedColoredVertexies[0].TextureCoordinates.Y = f荳儀蛟、; + this.cvTransformedColoredVertexies[0].Position.X = fx; + this.cvTransformedColoredVertexies[0].Position.Y = fy; + this.cvTransformedColoredVertexies[0].Position.Z = depth; + this.cvTransformedColoredVertexies[0].Position.W = 1.0f; + this.cvTransformedColoredVertexies[0].Color = color; + + this.cvTransformedColoredVertexies[1].TextureCoordinates.X = f蜿ウU蛟、; // 蜿ウ荳 竊 蜿ウ荳 + this.cvTransformedColoredVertexies[1].TextureCoordinates.Y = f荳儀蛟、; + this.cvTransformedColoredVertexies[1].Position.X = fx + w; + this.cvTransformedColoredVertexies[1].Position.Y = fy; + this.cvTransformedColoredVertexies[1].Position.Z = depth; + this.cvTransformedColoredVertexies[1].Position.W = 1.0f; + this.cvTransformedColoredVertexies[1].Color = color; + + this.cvTransformedColoredVertexies[2].TextureCoordinates.X = f蟾ヲU蛟、; // 蟾ヲ荳 竊 蟾ヲ荳 + this.cvTransformedColoredVertexies[2].TextureCoordinates.Y = f荳碍蛟、; + this.cvTransformedColoredVertexies[2].Position.X = fx; + this.cvTransformedColoredVertexies[2].Position.Y = fy + h; + this.cvTransformedColoredVertexies[2].Position.Z = depth; + this.cvTransformedColoredVertexies[2].Position.W = 1.0f; + this.cvTransformedColoredVertexies[2].Color = color; + + this.cvTransformedColoredVertexies[3].TextureCoordinates.X = f蜿ウU蛟、; // 蜿ウ荳 竊 蜿ウ荳 + this.cvTransformedColoredVertexies[3].TextureCoordinates.Y = f荳碍蛟、; + this.cvTransformedColoredVertexies[3].Position.X = fx + w; + this.cvTransformedColoredVertexies[3].Position.Y = fy + h; + this.cvTransformedColoredVertexies[3].Position.Z = depth; + this.cvTransformedColoredVertexies[3].Position.W = 1.0f; + this.cvTransformedColoredVertexies[3].Color = color; + + device.SetTexture(0, this.texture); + device.VertexFormat = TransformedColoredTexturedVertex.Format; + device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, in this.cvTransformedColoredVertexies); + } + public void t2D荳贋ク句渚霆「謠冗判(Device device, Point pt) + { + this.t2D荳贋ク句渚霆「謠冗判(device, pt.X, pt.Y, 1f, this.rc蜈ィ逕サ蜒); + } + public void t2D荳贋ク句渚霆「謠冗判(Device device, Point pt, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺) + { + this.t2D荳贋ク句渚霆「謠冗判(device, pt.X, pt.Y, 1f, rc逕サ蜒丞縺ョ謠冗判鬆伜沺); + } + public void t2D荳贋ク句渚霆「謠冗判(Device device, Point pt, float depth, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺) + { + this.t2D荳贋ク句渚霆「謠冗判(device, pt.X, pt.Y, depth, rc逕サ蜒丞縺ョ謠冗判鬆伜沺); + } + + public static Vector3 t隲也炊逕サ髱「蠎ァ讓吶r繝ッ繝シ繝ォ繝牙コァ讓吶∈螟画鋤縺吶k(int x, int y) + { + return CTexture.t隲也炊逕サ髱「蠎ァ讓吶r繝ッ繝シ繝ォ繝牙コァ讓吶∈螟画鋤縺吶k(new Vector3((float)x, (float)y, 0f)); + } + public static Vector3 t隲也炊逕サ髱「蠎ァ讓吶r繝ッ繝シ繝ォ繝牙コァ讓吶∈螟画鋤縺吶k(float x, float y) + { + return CTexture.t隲也炊逕サ髱「蠎ァ讓吶r繝ッ繝シ繝ォ繝牙コァ讓吶∈螟画鋤縺吶k(new Vector3(x, y, 0f)); + } + public static Vector3 t隲也炊逕サ髱「蠎ァ讓吶r繝ッ繝シ繝ォ繝牙コァ讓吶∈螟画鋤縺吶k(Point pt隲也炊逕サ髱「蠎ァ讓) + { + return CTexture.t隲也炊逕サ髱「蠎ァ讓吶r繝ッ繝シ繝ォ繝牙コァ讓吶∈螟画鋤縺吶k(new Vector3(pt隲也炊逕サ髱「蠎ァ讓.X, pt隲也炊逕サ髱「蠎ァ讓.Y, 0.0f)); + } + public static Vector3 t隲也炊逕サ髱「蠎ァ讓吶r繝ッ繝シ繝ォ繝牙コァ讓吶∈螟画鋤縺吶k(Vector2 v2隲也炊逕サ髱「蠎ァ讓) + { + return CTexture.t隲也炊逕サ髱「蠎ァ讓吶r繝ッ繝シ繝ォ繝牙コァ讓吶∈螟画鋤縺吶k(new Vector3(v2隲也炊逕サ髱「蠎ァ讓, 0f)); + } + public static Vector3 t隲也炊逕サ髱「蠎ァ讓吶r繝ッ繝シ繝ォ繝牙コァ讓吶∈螟画鋤縺吶k(Vector3 v3隲也炊逕サ髱「蠎ァ讓) + { + return new Vector3( + (v3隲也炊逕サ髱「蠎ァ讓.X - (CTexture.sz隲也炊逕サ髱「.Width / 2.0f)) * CTexture.f逕サ髱「豈皮紫, + (-(v3隲也炊逕サ髱「蠎ァ讓.Y - (CTexture.sz隲也炊逕サ髱「.Height / 2.0f)) * CTexture.f逕サ髱「豈皮紫), + v3隲也炊逕サ髱「蠎ァ讓.Z); + } + + /// + /// 繝繧ッ繧ケ繝√Ε繧 3D 逕サ蜒上→隕九↑縺励※謠冗判縺吶k縲 + /// + public void t3D謠冗判(Device device, Matrix mat) + { + this.t3D謠冗判(device, mat, this.rc蜈ィ逕サ蜒); + } + public void t3D謠冗判(Device device, Matrix mat, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺) + { + if (this.texture == null) + return; + + float x = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Width) / 2f; + float y = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Height) / 2f; + float z = 0.0f; + float f蟾ヲU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Left) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width); + float f蜿ウU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Right) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width); + float f荳碍蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Top) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + float f荳儀蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Bottom) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + this.color4.Alpha = ((float)this._opacity) / 255f; + int color = this.color4.ToArgb(); + + if (this.cvPositionColoredVertexies == null) + this.cvPositionColoredVertexies = new PositionColoredTexturedVertex[4]; + + // #27122 2012.1.13 from: 莉・荳九√槭ロ繝シ繧ク繝峨が繝悶ず繧ァ繧ッ繝茨シ茨シ昴ぎ繝吶シ繧クシ峨ョ驥冗肇繧呈椛縺医k縺溘a縲]ew 縺ッ菴ソ繧上★縲√Γ繝ウ繝舌↓蛟、繧抵シ代▽縺壹▽逶エ謗・荳頑嶌縺阪☆繧九 + + this.cvPositionColoredVertexies[0].Position.X = -x; + this.cvPositionColoredVertexies[0].Position.Y = y; + this.cvPositionColoredVertexies[0].Position.Z = z; + this.cvPositionColoredVertexies[0].Color = color; + this.cvPositionColoredVertexies[0].TextureCoordinates.X = f蟾ヲU蛟、; + this.cvPositionColoredVertexies[0].TextureCoordinates.Y = f荳碍蛟、; + + this.cvPositionColoredVertexies[1].Position.X = x; + this.cvPositionColoredVertexies[1].Position.Y = y; + this.cvPositionColoredVertexies[1].Position.Z = z; + this.cvPositionColoredVertexies[1].Color = color; + this.cvPositionColoredVertexies[1].TextureCoordinates.X = f蜿ウU蛟、; + this.cvPositionColoredVertexies[1].TextureCoordinates.Y = f荳碍蛟、; + + this.cvPositionColoredVertexies[2].Position.X = -x; + this.cvPositionColoredVertexies[2].Position.Y = -y; + this.cvPositionColoredVertexies[2].Position.Z = z; + this.cvPositionColoredVertexies[2].Color = color; + this.cvPositionColoredVertexies[2].TextureCoordinates.X = f蟾ヲU蛟、; + this.cvPositionColoredVertexies[2].TextureCoordinates.Y = f荳儀蛟、; + + this.cvPositionColoredVertexies[3].Position.X = x; + this.cvPositionColoredVertexies[3].Position.Y = -y; + this.cvPositionColoredVertexies[3].Position.Z = z; + this.cvPositionColoredVertexies[3].Color = color; + this.cvPositionColoredVertexies[3].TextureCoordinates.X = f蜿ウU蛟、; + this.cvPositionColoredVertexies[3].TextureCoordinates.Y = f荳儀蛟、; + + this.t繝ャ繝ウ繝繝ェ繝ウ繧ー繧ケ繝繝シ繝医ョ險ュ螳(device); + + device.SetTransform(TransformState.World, mat); + device.SetTexture(0, this.texture); + device.VertexFormat = PositionColoredTexturedVertex.Format; + device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, in this.cvPositionColoredVertexies); + } + + public void t3D蟾ヲ荳雁渕貅匁緒逕サ(Device device, Matrix mat) + { + this.t3D蟾ヲ荳雁渕貅匁緒逕サ(device, mat, this.rc蜈ィ逕サ蜒); + } + /// + /// 笳玖ヲ壽嶌 + /// SlimDX.Matrix mat = SlimDX.Matrix.Identity; + /// mat *= SlimDX.Matrix.Translation( x, y, z ); + /// 縲稽at =縲阪〒縺ッ縺ェ縺上稽at *=縲阪〒縺ゅk縺薙→繧貞ソ倥l縺ェ縺縺薙→縲 + /// + public void t3D蟾ヲ荳雁渕貅匁緒逕サ(Device device, Matrix mat, Rectangle rc逕サ蜒丞縺ョ謠冗判鬆伜沺) + { + //縺ィ繧翫≠縺医★陬懈ュ」蛟、縺ェ縺ゥ縺ッ辟。縺励ゅ↓縺励※繧ゆスソ縺讖滉シ壼ー代↑縺輔◎縺縺縺ェ繝シ + if (this.texture == null) + return; + + float x = 0.0f; + float y = 0.0f; + float z = 0.0f; + float f蟾ヲU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Left) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width); + float f蜿ウU蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Right) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width); + float f荳碍蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Top) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + float f荳儀蛟、 = ((float)rc逕サ蜒丞縺ョ謠冗判鬆伜沺.Bottom) / ((float)this.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + this.color4.Alpha = ((float)this._opacity) / 255f; + int color = this.color4.ToArgb(); + + if (this.cvPositionColoredVertexies == null) + this.cvPositionColoredVertexies = new PositionColoredTexturedVertex[4]; + + // #27122 2012.1.13 from: 莉・荳九√槭ロ繝シ繧ク繝峨が繝悶ず繧ァ繧ッ繝茨シ茨シ昴ぎ繝吶シ繧クシ峨ョ驥冗肇繧呈椛縺医k縺溘a縲]ew 縺ッ菴ソ繧上★縲√Γ繝ウ繝舌↓蛟、繧抵シ代▽縺壹▽逶エ謗・荳頑嶌縺阪☆繧九 + + this.cvPositionColoredVertexies[0].Position.X = -x; + this.cvPositionColoredVertexies[0].Position.Y = y; + this.cvPositionColoredVertexies[0].Position.Z = z; + this.cvPositionColoredVertexies[0].Color = color; + this.cvPositionColoredVertexies[0].TextureCoordinates.X = f蟾ヲU蛟、; + this.cvPositionColoredVertexies[0].TextureCoordinates.Y = f荳碍蛟、; + + this.cvPositionColoredVertexies[1].Position.X = x; + this.cvPositionColoredVertexies[1].Position.Y = y; + this.cvPositionColoredVertexies[1].Position.Z = z; + this.cvPositionColoredVertexies[1].Color = color; + this.cvPositionColoredVertexies[1].TextureCoordinates.X = f蜿ウU蛟、; + this.cvPositionColoredVertexies[1].TextureCoordinates.Y = f荳碍蛟、; + + this.cvPositionColoredVertexies[2].Position.X = -x; + this.cvPositionColoredVertexies[2].Position.Y = -y; + this.cvPositionColoredVertexies[2].Position.Z = z; + this.cvPositionColoredVertexies[2].Color = color; + this.cvPositionColoredVertexies[2].TextureCoordinates.X = f蟾ヲU蛟、; + this.cvPositionColoredVertexies[2].TextureCoordinates.Y = f荳儀蛟、; + + this.cvPositionColoredVertexies[3].Position.X = x; + this.cvPositionColoredVertexies[3].Position.Y = -y; + this.cvPositionColoredVertexies[3].Position.Z = z; + this.cvPositionColoredVertexies[3].Color = color; + this.cvPositionColoredVertexies[3].TextureCoordinates.X = f蜿ウU蛟、; + this.cvPositionColoredVertexies[3].TextureCoordinates.Y = f荳儀蛟、; + + this.t繝ャ繝ウ繝繝ェ繝ウ繧ー繧ケ繝繝シ繝医ョ險ュ螳(device); + + device.SetTransform(TransformState.World, mat); + device.SetTexture(0, this.texture); + device.VertexFormat = PositionColoredTexturedVertex.Format; + device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, in this.cvPositionColoredVertexies); + } + + #region [ IDisposable 螳溯」 ] + //----------------- + public void Dispose() + { + if (!this.bDispose螳御コ貂医∩) + { + // 繝繧ッ繧ケ繝√Ε縺ョ遐エ譽 + if (this.texture != null) + { + this.texture.Dispose(); + this.texture = null; + } + + this.bDispose螳御コ貂医∩ = true; + } + } + //----------------- + #endregion + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private int _opacity; + private bool bDispose螳御コ貂医∩; + private PositionColoredTexturedVertex[] cvPositionColoredVertexies; + protected TransformedColoredTexturedVertex[] cvTransformedColoredVertexies = new TransformedColoredTexturedVertex[] + { + new TransformedColoredTexturedVertex(), + new TransformedColoredTexturedVertex(), + new TransformedColoredTexturedVertex(), + new TransformedColoredTexturedVertex(), + }; + private const Pool poolvar = // 2011.4.25 yyagi +#if TEST_Direct3D9Ex + Pool.Default; +#else + Pool.Managed; +#endif + // byte[] _txData; + static object lockobj = new object(); + + /// + /// 縺ゥ繧後°荳縺、縺梧怏蜉ケ縺ォ縺ェ繧翫∪縺吶 + /// + /// Direct3D縺ョ繝繝舌う繧ケ + private void t繝ャ繝ウ繝繝ェ繝ウ繧ー繧ケ繝繝シ繝医ョ險ュ螳(Device device) + { + if (this.b蜉邂怜粋謌) + { + device.SetRenderState(RenderState.SourceBlend, SlimDX.Direct3D9.Blend.SourceAlpha); // 5 + device.SetRenderState(RenderState.DestinationBlend, SlimDX.Direct3D9.Blend.One); // 2 + } + else if (this.b荵礼ョ怜粋謌) + { + //蜿り:http://sylphylunar.seesaa.net/article/390331341.html + //C++縺九i蠑輔▲蠑オ縺」縺ヲ縺阪◆縺ョ縺ァ縺。繧縺」縺ィ荳榊ョ峨 + device.SetRenderState(RenderState.SourceBlend, SlimDX.Direct3D9.Blend.DestinationColor); + device.SetRenderState(RenderState.DestinationBlend, SlimDX.Direct3D9.Blend.Zero); + } + else if (this.b貂帷ョ怜粋謌) + { + //蜿り:http://www3.pf-x.net/~chopper/home2/DirectX/MD20.html + device.SetRenderState(RenderState.BlendOperation, SlimDX.Direct3D9.BlendOperation.Subtract); + device.SetRenderState(RenderState.SourceBlend, SlimDX.Direct3D9.Blend.One); + device.SetRenderState(RenderState.DestinationBlend, SlimDX.Direct3D9.Blend.One); + } + else if (this.b繧ケ繧ッ繝ェ繝シ繝ウ蜷域) + { + //蜿り:http://sylphylunar.seesaa.net/article/390331341.html + //C++縺九i蠑輔▲蠑オ縺」縺ヲ縺阪◆縺ョ縺ァ縺。繧縺」縺ィ荳榊ョ峨 + device.SetRenderState(RenderState.SourceBlend, SlimDX.Direct3D9.Blend.InverseDestinationColor); + device.SetRenderState(RenderState.DestinationBlend, SlimDX.Direct3D9.Blend.One); + } + else + { + device.SetRenderState(RenderState.SourceBlend, SlimDX.Direct3D9.Blend.SourceAlpha); // 5 + device.SetRenderState(RenderState.DestinationBlend, SlimDX.Direct3D9.Blend.InverseSourceAlpha); // 6 + } + } + private Size t謖螳壹&繧後◆繧オ繧、繧コ繧定カ縺医↑縺譛驕ゥ縺ェ繝繧ッ繧ケ繝√Ε繧オ繧、繧コ繧定ソ斐☆(Device device, Size sz謖螳壹し繧、繧コ) + { + var deviceCapabilities = device.Capabilities; + var deviceCapabilitiesTextureCaps = deviceCapabilities.TextureCaps; + + bool b譚。莉カ莉倥″縺ァ繧オ繧、繧コ縺ッシ偵ョ邏ッ荵励〒縺ェ縺上※繧0K = (deviceCapabilitiesTextureCaps & TextureCaps.NonPow2Conditional) != 0; + bool b繧オ繧、繧コ縺ッシ偵ョ邏ッ荵励〒縺ェ縺代l縺ー縺ェ繧峨↑縺 = (deviceCapabilitiesTextureCaps & TextureCaps.Pow2) != 0; + bool b豁」譁ケ蠖「縺ァ縺ェ縺代l縺ー縺ェ繧峨↑縺 = (deviceCapabilitiesTextureCaps & TextureCaps.SquareOnly) != 0; + int n譛螟ァ蟷 = deviceCapabilities.MaxTextureWidth; + int n譛螟ァ鬮 = deviceCapabilities.MaxTextureHeight; + var sz繧オ繧、繧コ = new Size(sz謖螳壹し繧、繧コ.Width, sz謖螳壹し繧、繧コ.Height); + + if (b繧オ繧、繧コ縺ッシ偵ョ邏ッ荵励〒縺ェ縺代l縺ー縺ェ繧峨↑縺 && !b譚。莉カ莉倥″縺ァ繧オ繧、繧コ縺ッシ偵ョ邏ッ荵励〒縺ェ縺上※繧0K) + { + // 蟷繧抵シ偵ョ邏ッ荵励↓縺吶k + int n = 1; + do + { + n *= 2; + } + while (n <= sz謖螳壹し繧、繧コ.Width); + sz謖螳壹し繧、繧コ.Width = n; + + // 鬮倥&繧抵シ偵ョ邏ッ荵励↓縺吶k + n = 1; + do + { + n *= 2; + } + while (n <= sz謖螳壹し繧、繧コ.Height); + sz謖螳壹し繧、繧コ.Height = n; + } + + if (sz謖螳壹し繧、繧コ.Width > n譛螟ァ蟷) + sz謖螳壹し繧、繧コ.Width = n譛螟ァ蟷; + + if (sz謖螳壹し繧、繧コ.Height > n譛螟ァ鬮) + sz謖螳壹し繧、繧コ.Height = n譛螟ァ鬮; + + if (b豁」譁ケ蠖「縺ァ縺ェ縺代l縺ー縺ェ繧峨↑縺) + { + if (sz繧オ繧、繧コ.Width > sz繧オ繧、繧コ.Height) + { + sz繧オ繧、繧コ.Height = sz繧オ繧、繧コ.Width; + } + else if (sz繧オ繧、繧コ.Width < sz繧オ繧、繧コ.Height) + { + sz繧オ繧、繧コ.Width = sz繧オ繧、繧コ.Height; + } + } + + return sz繧オ繧、繧コ; + } + + + // 2012.3.21 縺輔i縺ェ繧 new 縺ョ逵∫払菴懈姶 + + protected Rectangle rc蜈ィ逕サ蜒; // 繝繧ッ繧ケ繝√Ε菴懊▲縺溘i縺ゅ→縺ッ荳榊、 + public Color4 color4 = new Color4(1f, 1f, 1f, 1f); // 繧「繝ォ繝輔ぃ莉・螟悶ッ荳榊、 + //----------------- + #endregion + } +} diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTextureAutofold.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTextureAutofold.cs new file mode 100644 index 00000000..34566f82 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTextureAutofold.cs @@ -0,0 +1,390 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Drawing.Imaging; +using System.IO; +using System.Diagnostics; +using SlimDX; +using SlimDX.Direct3D9; + +using Device = SampleFramework.DeviceCache; + +namespace FDK +{ + /// + /// 邵ヲ髟キ_讓ェ髟キ縺ョ逕サ蜒上r閾ェ蜍輔〒謚倥j縺溘◆繧薙〒繝繧ッ繧ケ繝√Ε蛹悶☆繧気Texture縲 + /// 萓九∴縺ー縲768x30 縺ョ繝繧ッ繧ケ繝√Ε繝輔ぃ繧、繝ォ縺悟・蜉帙&繧後◆繧峨 + /// 蜀驛ィ縺ァ256x90 縺ェ縺ゥ縲2縺ョ縺ケ縺堺ケ励し繧、繧コ縺ォ蜿弱a繧九h縺縲∝驛ィ縺ァ繝繧ッ繧ケ繝√Ε逕サ蜒上r閾ェ蜍慕噪縺ォ謚倥j霑斐☆縲 + /// 蠢隕√↓蠢懊§縺ヲ縲∵ュ」譁ケ蠖「繝繧ッ繧ケ繝√Ε縺ォ繧ゅ☆繧九 + /// 縺セ縺溘》2D謠冗判縺ッ縲√◎縺ョ謚倥j霑斐@繧貞刈蜻ウ縺励※螳溯。後☆繧九 + /// + public class CTextureAf : CTexture, IDisposable + { + + /// + /// 謖螳壹&繧後◆逕サ蜒上ヵ繧。繧、繝ォ縺九i Managed 繝繧ッ繧ケ繝√Ε繧剃ス懈舌☆繧九 + /// 蛻ゥ逕ィ蜿ッ閭ス縺ェ逕サ蜒丞ス「蠑上ッ縲。MP, JPG, PNG, TGA, DDS, PPM, DIB, HDR, PFM 縺ョ縺縺壹l縺九 + /// + /// Direct3D9 繝繝舌う繧ケ縲 + /// 逕サ蜒上ヵ繧。繧、繝ォ蜷阪 + /// 繝繧ッ繧ケ繝√Ε縺ョ繝輔か繝シ繝槭ャ繝医 + /// 逕サ蜒上ョ鮟抵シ0xFFFFFFFFシ峨r騾城℃縺輔○繧九↑繧 true縲 + /// 繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲 + public CTextureAf( Device device, string str繝輔ぃ繧、繝ォ蜷, Format format, bool b鮟偵r騾城℃縺吶k ) + : this( device, str繝輔ぃ繧、繝ォ蜷, format, b鮟偵r騾城℃縺吶k, Pool.Managed ) + { + } + + /// + /// 逕サ蜒上ヵ繧。繧、繝ォ縺九i繝繧ッ繧ケ繝√Ε繧堤函謌舌☆繧九 + /// 蛻ゥ逕ィ蜿ッ閭ス縺ェ逕サ蜒丞ス「蠑上ッ縲。MP, JPG, PNG, TGA, DDS, PPM, DIB, HDR, PFM 縺ョ縺縺壹l縺九 + /// 繝繧ッ繧ケ繝√Ε縺ョ繧オ繧、繧コ縺ッ縲∫判蜒上ョ繧オ繧、繧コ莉・荳翫√°縺、縲.3D9繝繝舌う繧ケ縺ァ逕滓仙庄閭ス縺ェ譛蟆上ョ繧オ繧、繧コ縺ォ閾ェ蜍慕噪縺ォ隱ソ遽縺輔l繧九 + /// 縺昴ョ髫帙√ユ繧ッ繧ケ繝√Ε縺ョ隱ソ遽蠕後ョ繧オ繧、繧コ縺ォ縺ゅo縺帙◆逕サ蜒上ョ諡。螟ァ邵ョ蟆上ッ陦後o縺ェ縺縲 + /// 縺昴ョ莉悶√Α繝繝励槭ャ繝玲焚縺ッ 1縲ゞsage 縺ッ None縲√う繝。繝シ繧ク繝輔ぅ繝ォ繧ソ縺ッ Point縲√Α繝繝励槭ャ繝励ヵ繧」繝ォ繧ソ縺ッ None 縺ォ縺ェ繧九 + /// + /// Direct3D9 繝繝舌う繧ケ縲 + /// 逕サ蜒上ヵ繧。繧、繝ォ蜷阪 + /// 繝繧ッ繧ケ繝√Ε縺ョ繝輔か繝シ繝槭ャ繝医 + /// 逕サ蜒上ョ鮟抵シ0xFFFFFFFFシ峨r騾城℃縺輔○繧九↑繧 true縲 + /// 繝繧ッ繧ケ繝√Ε縺ョ邂。逅譁ケ豕輔 + /// 繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲 + public CTextureAf( Device device, string str繝輔ぃ繧、繝ォ蜷, Format format, bool b鮟偵r騾城℃縺吶k, Pool pool ) + { + MakeTexture( device, str繝輔ぃ繧、繝ォ蜷, format, b鮟偵r騾城℃縺吶k, pool ); + } + + + + + public new void MakeTexture( Device device, string str繝輔ぃ繧、繝ォ蜷, Format format, bool b鮟偵r騾城℃縺吶k, Pool pool ) + { + if ( !File.Exists( str繝輔ぃ繧、繝ォ蜷 ) ) // #27122 2012.1.13 from: ImageInformation 縺ァ縺ッ FileNotFound 萓句、悶ッ霑斐▲縺ヲ縺薙↑縺縺ョ縺ァ縲√%縺薙〒閾ェ蛻縺ァ繝√ぉ繝繧ッ縺吶k縲ゅo縺九j繧縺吶>繝ュ繧ー縺ョ縺溘a縺ォ縲 + throw new FileNotFoundException( string.Format( "繝輔ぃ繧、繝ォ縺悟ュ伜惠縺励∪縺帙s縲\n[{0}]", str繝輔ぃ繧、繝ォ蜷 ) ); + + Byte[] _txData = File.ReadAllBytes( str繝輔ぃ繧、繝ォ蜷 ); + bool b譚。莉カ莉倥″縺ァ繧オ繧、繧コ縺ッシ偵ョ邏ッ荵励〒縺ェ縺上※繧0K = ( device.Capabilities.TextureCaps & TextureCaps.NonPow2Conditional ) != 0; + bool b繧オ繧、繧コ縺ッシ偵ョ邏ッ荵励〒縺ェ縺代l縺ー縺ェ繧峨↑縺 = ( device.Capabilities.TextureCaps & TextureCaps.Pow2 ) != 0; + bool b豁」譁ケ蠖「縺ァ縺ェ縺代l縺ー縺ェ繧峨↑縺 = ( device.Capabilities.TextureCaps & TextureCaps.SquareOnly ) != 0; + + // 縺昴b縺昴b縺薙s縺ェ譛驕ゥ蛹悶r縺励↑縺上※繧医>縺ョ縺ェ繧峨√&縺」縺輔→base縺ォ蜃ヲ逅繧貞ァ斐ュ縺ヲ邨ゆコ + if ( !b繧オ繧、繧コ縺ッシ偵ョ邏ッ荵励〒縺ェ縺代l縺ー縺ェ繧峨↑縺 && b譚。莉カ莉倥″縺ァ繧オ繧、繧コ縺ッシ偵ョ邏ッ荵励〒縺ェ縺上※繧0K ) + { + //Debug.WriteLine( Path.GetFileName( str繝輔ぃ繧、繝ォ蜷 ) + ": 譛驕ゥ蛹悶ッ荳崎ヲ√〒縺吶" ); + base.MakeTexture( device, str繝輔ぃ繧、繝ォ蜷, format, b鮟偵r騾城℃縺吶k, pool ); + return; + } + + var information = ImageInformation.FromMemory( _txData ); + int orgWidth = information.Width, orgHeight = information.Height; + int w = orgWidth, h = orgHeight, foldtimes; + + #region [ 謚倥j縺溘◆縺ソ縺ゅj縺ァ譛驕ゥ縺ェ繝繧ッ繧ケ繝√Ε繧オ繧、繧コ縺後←縺縺ェ繧九°繧堤「コ隱阪☆繧(豁」譁ケ蠖「縺ォ縺吶k縺九ッ閠諷ョ縺帙★) ] + if ( orgWidth >= orgHeight ) // 讓ェ髟キ逕サ蜒上↑繧 + { + this.b讓ェ髟キ縺ョ繝繧ッ繧ケ繝√Ε縺ァ縺ゅk = true; + if ( !GetFoldedTextureSize( ref w, ref h, out foldtimes ) ) + { +//Debug.WriteLine( Path.GetFileName( str繝輔ぃ繧、繝ォ蜷 ) + ": 譛驕ゥ蛹悶r譁ュ蠢オ縲" ); + base.MakeTexture( device, str繝輔ぃ繧、繝ォ蜷, format, b鮟偵r騾城℃縺吶k, pool ); + return; + } + } + else // 邵ヲ髟キ逕サ蜒上↑繧 + { + this.b讓ェ髟キ縺ョ繝繧ッ繧ケ繝√Ε縺ァ縺ゅk = false; + if ( !GetFoldedTextureSize( ref h, ref w, out foldtimes ) ) // 邵ヲ讓ェ蜈・繧梧崛縺医※蜻シ縺ウ蜃コ縺 + { +//Debug.WriteLine( Path.GetFileName( str繝輔ぃ繧、繝ォ蜷 ) + ": 譛驕ゥ蛹悶r譁ュ蠢オ縲" ); + base.MakeTexture( device, str繝輔ぃ繧、繝ォ蜷, format, b鮟偵r騾城℃縺吶k, pool ); + return; + } + } + #endregion + +//Debug.WriteLine( Path.GetFileName( str繝輔ぃ繧、繝ォ蜷 ) + ": texture譛驕ゥ蛹也オ先棡: width=" + w + ", height=" + h + ", 謚倥j縺溘◆縺ソ蝗樊焚=" + foldtimes ); + #region [ 謚倥j縺溘◆縺ソ繝繧ッ繧ケ繝√Ε逕サ蜒上r菴懊j縲√ユ繧ッ繧ケ繝√Ε逋サ骭イ縺吶k ] + // 繝舌う繝翫Μ(Byte驟榊)繧達itmap縺ォ螟画鋤 + MemoryStream mms = new MemoryStream( _txData ); + Bitmap bmpOrg = new Bitmap( mms ); + mms.Close(); + + Bitmap bmpNew = new Bitmap( w, h ); + Graphics g = Graphics.FromImage( bmpNew ); + + for ( int n = 0; n <= foldtimes; n++ ) + { + if ( b讓ェ髟キ縺ョ繝繧ッ繧ケ繝√Ε縺ァ縺ゅk ) + { + int x = n * w; + int currentHeight = n * orgHeight; + int currentWidth = ( n < foldtimes ) ? w : orgWidth - x; + Rectangle r = new Rectangle( x, 0, currentWidth, orgHeight ); + Bitmap bmpTmp = bmpOrg.Clone( r, bmpOrg.PixelFormat ); // 縺薙%縺後懊ヨ繝ォ繝阪ャ繧ッ縺ォ縺ェ繧九h縺縺ェ繧峨∝セ梧律unsafe繧ウ繝シ繝峨↓縺吶k縲 + g.DrawImage( bmpTmp, 0, currentHeight, currentWidth, orgHeight ); + bmpTmp.Dispose(); + } + else + { + int y = n * h; + int currentWidth = n * orgWidth; + int currentHeight = ( n < foldtimes ) ? h : orgHeight - y; + Rectangle r = new Rectangle( 0, y, orgWidth, currentHeight ); + Bitmap bmpTmp = bmpOrg.Clone( r, bmpOrg.PixelFormat ); // 縺薙%縺後懊ヨ繝ォ繝阪ャ繧ッ縺ォ縺ェ繧九h縺縺ェ繧峨∝セ梧律unsafe繧ウ繝シ繝峨↓縺吶k縲 + g.DrawImage( bmpTmp, currentWidth, 0, orgWidth, currentHeight ); + bmpTmp.Dispose(); + } + }; + if ( b鮟偵r騾城℃縺吶k ) + { + bmpNew.MakeTransparent( Color.Black ); + } + g.Dispose(); + g = null; + bmpOrg.Dispose(); + bmpOrg = null; + base.MakeTexture( device, bmpNew, format, b鮟偵r騾城℃縺吶k, pool ); + bmpNew.Dispose(); + bmpNew = null; + #endregion + + _orgWidth = orgWidth; + _orgHeight = orgHeight; + _foldtimes = foldtimes; + this.sz逕サ蜒上し繧、繧コ = new Size( orgWidth, orgHeight ); + } + + /// + /// 讓ェ髟キ逕サ蜒上r驕ゥ蛻縺ェ繧オ繧、繧コ縺ォ謚倥j縺溘◆繧薙□縺ィ縺阪ョ譛驕ゥ繝繧ッ繧ケ繝√Ε繧オ繧、繧コ繧貞セ励k縲 + /// 邵ヲ髟キ逕サ蜒上↓蟇セ縺励※縺ッ縲『idth/height繧貞・繧梧崛縺医※蜻シ縺ウ蜃コ縺吶%縺ィ縲 + /// + /// + /// + /// + /// + private bool GetFoldedTextureSize( ref int width, ref int height, out int foldtimes ) + { + int orgWidth = width, orgHeight = height; + + #region [ width縺後2縺ョ縺ケ縺堺ケ励°繧峨←繧後¥繧峨>貅「繧後※縺繧九°遒コ隱 ] + int pow = 1; + while ( orgWidth >= pow ) + { + pow *= 2; + } + pow /= 2; + #endregion + #region [ 縺セ縺壹2縺ョ縺ケ縺堺ケ励°繧峨≠縺オ繧後k蛻繧呈釜繧願ソ斐@縺ヲ縲2縺ョ縺ケ縺堺ケ励ョ豁」譁ケ蠖「繧オ繧、繧コ縺ォ蜿弱∪繧九°繧堤「コ隱 ] + foldtimes = ( orgWidth == pow ) ? 0 : 1; // 2縺ョ縺ケ縺堺ケ励°繧峨ョ貅「繧後′縺ゅl縺ー縲√∪縺壹◎縺ョ貅「繧悟縺ァ1蝗樊釜繧顔糞繧 + if ( foldtimes != 0 ) + { +//Debug.WriteLine( "pow縺。繧縺縺ゥ縺ァ縺ッ縺ェ縺縺ョ縺ァ縲∵コ「繧後≠繧翫ゅ∪縺壹ッ1蝗樊釜繧翫◆縺溘縲" ); + // 隧ヲ縺励↓縲『idth繧恥ow縺ォ蛻繧願ゥー繧√1蝗樊釜繧願ソ斐@縺ヲ縺ソ繧九 + // width>height繧堤カュ謖√@縺ヲ縺繧九↑繧峨√ユ繧ッ繧ケ繝√Ε繧オ繧、繧コ縺ッ繧医j譛驕ゥ縺ェ迥カ諷九↓縺ェ縺」縺溘→縺縺縺薙→縺ォ縺ェ繧九 + if ( pow <= orgHeight * 2 ) // 譁ーwidth > 譁ーheight繧堤カュ謖√〒縺阪↑縺上↑縺」縺溘↑繧 + { // 譛驕ゥ蛹紋ク榊庄縺ィ縺ソ縺ェ縺励|ase縺ョ蜃ヲ逅縺ォ蟋斐ュ繧 + return false; + } + } + #endregion + #region [ width > height 縺ァ縺ッ縺ェ縺上↑繧九∪縺ァ縲∵釜繧翫◆縺溘∩邯壹¢繧 ] + width = pow; + height = orgHeight * 2; // 蛻晄悄蛟、シ1蝗樊釜繧翫◆縺溘s縺迥カ諷 + do + { + width /= 2; + foldtimes = ( orgWidth / width ) + ( ( orgWidth % width > 0 ) ? 1 : 0 ) - 1; + height = orgHeight * ( foldtimes + 1 ); + } while ( width > height ); + width *= 2; + foldtimes = ( orgWidth / width ) + ( ( orgWidth % width > 0 ) ? 1 : 0 ) - 1; + height = orgHeight * ( foldtimes + 1 ); + #endregion + + return true; + } + + + + /// + /// 繝繧ッ繧ケ繝√Ε繧 2D 逕サ蜒上→隕九↑縺励※謠冗判縺吶k縲 + /// + /// Direct3D9 繝繝舌う繧ケ縲 + /// 謠冗判菴咲スョシ医ユ繧ッ繧ケ繝√Ε縺ョ蟾ヲ荳贋ス咲スョ縺ョ X 蠎ァ讓兌dot]シ峨 + /// 謠冗判菴咲スョシ医ユ繧ッ繧ケ繝√Ε縺ョ蟾ヲ荳贋ス咲スョ縺ョ Y 蠎ァ讓兌dot]シ峨 + public new void t2D謠冗判( Device device, int x, int y ) + { +#if TEST_FOLDTEXTURE + base.t2D謠冗判( device, x, y, 1f, rc蜈ィ逕サ蜒 ); +#else + for ( int n = 0; n <= _foldtimes; n++ ) + { + Rectangle r; + if ( b讓ェ髟キ縺ョ繝繧ッ繧ケ繝√Ε縺ァ縺ゅk ) + { + int currentHeight = n * _orgHeight; + r = new Rectangle( 0, currentHeight, this.rc蜈ィ逕サ蜒.Width, _orgHeight ); + base.t2D謠冗判( device, x + n * this.rc蜈ィ逕サ蜒.Width, y, 1f, r ); + } + else + { + int currentWidth = n * _orgWidth; + r = new Rectangle( currentWidth, 0, _orgWidth, this.rc蜈ィ逕サ蜒.Height ); + base.t2D謠冗判( device, x, y + n * this.rc蜈ィ逕サ蜒.Height, 1f, r ); + } + } +#endif + } + public new void t2D謠冗判( Device device, int x, int y, Rectangle rc ) + { + Rectangle r; + if ( b讓ェ髟キ縺ョ繝繧ッ繧ケ繝√Ε縺ァ縺ゅk ) + { + int beginFold = rc.X / this.rc蜈ィ逕サ蜒.Width; + int endFold = ( rc.X + rc.Width ) / rc蜈ィ逕サ蜒.Width; + for ( int i = beginFold; i <= endFold; i++ ) + { + if ( i > _foldtimes ) break; + + int newRcY = i * _orgHeight + rc.Y; + int newRcX = ( i == beginFold ) ? ( rc.X % this.rc蜈ィ逕サ蜒.Width ) : 0; + int newRcWidth = ( newRcX + rc.Width > rc蜈ィ逕サ蜒.Width ) ? rc蜈ィ逕サ蜒.Width - newRcX : rc.Width; + + r = new Rectangle( newRcX, newRcY, newRcWidth, rc.Height ); + base.t2D謠冗判( device, x, y, 1f, r ); + + int deltaX = ( i == beginFold ) ? ( i + 1 ) * rc蜈ィ逕サ蜒.Width - rc.X : rc蜈ィ逕サ蜒.Width; + int newWidth = rc.Width - deltaX; + x += deltaX; + rc.Width = newWidth; + } + } + else + { + int beginFold = rc.Y / this.rc蜈ィ逕サ蜒.Height; + int endFold = ( rc.Y + rc.Height ) / rc蜈ィ逕サ蜒.Height; + for ( int i = beginFold; i <= endFold; i++ ) + { + if ( i > _foldtimes ) break; + + int newRcX = i * _orgWidth + rc.X; + int newRcY = ( i == beginFold ) ? ( rc.Y % this.rc蜈ィ逕サ蜒.Height ) : 0; + int newRcHeight = ( newRcY + rc.Height > rc蜈ィ逕サ蜒.Height ) ? rc蜈ィ逕サ蜒.Height - newRcY : rc.Height; + + r = new Rectangle( newRcX, newRcY, rc.Width, newRcHeight ); + base.t2D謠冗判( device, x, y, 1f, r ); + + int deltaY = ( i == beginFold ) ? ( i + 1 ) * rc蜈ィ逕サ蜒.Height - rc.Y : rc蜈ィ逕サ蜒.Height; + int newHeight = rc.Height - deltaY; + y += deltaY; + rc.Height = newHeight; + } + } + + } + public new void t2D謠冗判( Device device, float x, float y ) + { + t2D謠冗判( device, (int) x, (int) y ); + } + public void t2D謠冗判( Device device, float x, float y, Rectangle rc ) + { + t2D謠冗判( device, (int) x, (int) y, rc ); + } + + /// + /// 繝繧ッ繧ケ繝√Ε繧 2D 逕サ蜒上→隕九↑縺励※謠冗判縺吶k縲 + /// + /// Direct3D9 繝繝舌う繧ケ縲 + /// 謠冗判菴咲スョシ医ユ繧ッ繧ケ繝√Ε縺ョ蟾ヲ荳贋ス咲スョ縺ョ X 蠎ァ讓兌dot]シ峨 + /// 謠冗判菴咲スョシ医ユ繧ッ繧ケ繝√Ε縺ョ蟾ヲ荳贋ス咲スョ縺ョ Y 蠎ァ讓兌dot]シ峨 + public void t3D謠冗判( Device device, Matrix mat, float x, float y ) + { +#if TEST_FOLDTEXTURE + base.t2D謠冗判( device, x, y, 1f, rc蜈ィ逕サ蜒 ); +#else + for ( int n = 0; n <= _foldtimes; n++ ) + { + Rectangle r; + if ( b讓ェ髟キ縺ョ繝繧ッ繧ケ繝√Ε縺ァ縺ゅk ) + { + int currentHeight = n * _orgHeight; + r = new Rectangle( 0, currentHeight, this.rc蜈ィ逕サ蜒.Width, _orgHeight ); + base.t3D謠冗判( device, mat ); + } + else + { + int currentWidth = n * _orgWidth; + r = new Rectangle( currentWidth, 0, _orgWidth, this.rc蜈ィ逕サ蜒.Height ); + base.t3D謠冗判( device, mat ); + } + } +#endif + } + public void t3D謠冗判( Device device, Matrix mat, float x, float y, Rectangle rc ) + { + Rectangle r; + if ( b讓ェ髟キ縺ョ繝繧ッ繧ケ繝√Ε縺ァ縺ゅk ) + { + int beginFold = rc.X / this.rc蜈ィ逕サ蜒.Width; + int endFold = ( rc.X + rc.Width ) / rc蜈ィ逕サ蜒.Width; + for ( int i = beginFold; i <= endFold; i++ ) + { + if ( i > _foldtimes ) break; + + int newRcY = i * _orgHeight + rc.Y; + int newRcX = ( i == beginFold ) ? ( rc.X % this.rc蜈ィ逕サ蜒.Width ) : 0; + int newRcWidth = ( newRcX + rc.Width > rc蜈ィ逕サ蜒.Width ) ? rc蜈ィ逕サ蜒.Width - newRcX : rc.Width; + + r = new Rectangle( newRcX, newRcY, newRcWidth, rc.Height ); + base.t3D謠冗判( device, mat, r ); + + int deltaX = ( i == beginFold ) ? ( i + 1 ) * rc蜈ィ逕サ蜒.Width - rc.X : rc蜈ィ逕サ蜒.Width; + int newWidth = rc.Width - deltaX; + x += deltaX; + rc.Width = newWidth; + } + } + else + { + int beginFold = rc.Y / this.rc蜈ィ逕サ蜒.Height; + int endFold = ( rc.Y + rc.Height ) / rc蜈ィ逕サ蜒.Height; + for ( int i = beginFold; i <= endFold; i++ ) + { + if ( i > _foldtimes ) break; + + int newRcX = i * _orgWidth + rc.X; + int newRcY = ( i == beginFold ) ? ( rc.Y % this.rc蜈ィ逕サ蜒.Height ) : 0; + int newRcHeight = ( newRcY + rc.Height > rc蜈ィ逕サ蜒.Height ) ? rc蜈ィ逕サ蜒.Height - newRcY : rc.Height; + + r = new Rectangle( newRcX, newRcY, rc.Width, newRcHeight ); + base.t3D謠冗判( device, mat, r ); + + int deltaY = ( i == beginFold ) ? ( i + 1 ) * rc蜈ィ逕サ蜒.Height - rc.Y : rc蜈ィ逕サ蜒.Height; + int newHeight = rc.Height - deltaY; + y += deltaY; + rc.Height = newHeight; + } + } + + } + + #region [ private ] + //----------------- + private bool b讓ェ髟キ縺ョ繝繧ッ繧ケ繝√Ε縺ァ縺ゅk; + + /// + /// 蜈逕サ蜒上ョWidth + /// + private int _orgWidth; + /// + /// 蜈逕サ蜒上ョHeight + /// + private int _orgHeight; + /// + /// 謚倥j縺溘◆縺ソ蝗樊焚 + /// + private int _foldtimes; + //----------------- + #endregion + } +} diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTextureCreateFailedException.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTextureCreateFailedException.cs new file mode 100644 index 00000000..1644e050 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/CTextureCreateFailedException.cs @@ -0,0 +1,29 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.Serialization; + +namespace FDK +{ + /// + /// 繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲 + /// + public class CTextureCreateFailedException : Exception + { + public CTextureCreateFailedException() + { + } + public CTextureCreateFailedException( string message ) + : base( message ) + { + } + public CTextureCreateFailedException( SerializationInfo info, StreamingContext context ) + : base( info, context ) + { + } + public CTextureCreateFailedException( string message, Exception innerException ) + : base( message, innerException ) + { + } + } +} diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/ColoredVertex.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/ColoredVertex.cs new file mode 100644 index 00000000..9bfe05d9 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/ColoredVertex.cs @@ -0,0 +1,120 @@ +サソ/* +* Copyright (c) 2007-2010 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ + +using System; +using System.Globalization; +using System.Runtime.InteropServices; + +using SlimDX; + +namespace FDK { + /// + /// Represents a vertex with a position and a color. + /// + [StructLayout(LayoutKind.Sequential)] + public struct ColoredVertex : IEquatable { + /// + /// Gets or sets the position of the vertex. + /// + public Vector3 Position { + get; + set; + } + + /// + /// Gets or sets the color of the vertex. + /// + public int Color { + get; + set; + } + + /// + /// Initializes a new instance of the struct. + /// + /// The position. + /// The color. + public ColoredVertex(Vector3 position, int color) + : this() { + Position = position; + Color = color; + } + + /// + /// Implements operator ==. + /// + /// The left. + /// The right. + /// The result of the operator. + public static bool operator ==(ColoredVertex left, ColoredVertex right) { + return left.Equals(right); + } + + /// + /// Implements operator !=. + /// + /// The left side of the operator. + /// The right side of the operator. + /// The result of the operator. + public static bool operator !=(ColoredVertex left, ColoredVertex right) { + return !(left == right); + } + + /// + /// Returns the hash code for this instance. + /// + /// + /// A 32-bit signed integer that is the hash code for this instance. + /// + public override int GetHashCode() { + return Position.GetHashCode() + Color.GetHashCode(); + } + + /// + /// Indicates whether this instance and a specified object are equal. + /// + /// Another object to compare to. + /// + /// true if and this instance are the same type and represent the same value; otherwise, false. + /// + public override bool Equals(object obj) { + if (obj == null) + return false; + + if (GetType() != obj.GetType()) + return false; + + return Equals((ColoredVertex)obj); + } + + /// + /// Indicates whether the current object is equal to another object of the same type. + /// + /// An object to compare with this object. + /// + /// true if the current object is equal to the parameter; otherwise, false. + /// + public bool Equals(ColoredVertex other) { + return (Position == other.Position && Color == other.Color); + } + } +} diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/PositionColoredTexturedVertex.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/PositionColoredTexturedVertex.cs new file mode 100644 index 00000000..ea0110cb --- /dev/null +++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/PositionColoredTexturedVertex.cs @@ -0,0 +1,73 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Globalization; +using SlimDX; +using SlimDX.Direct3D9; + +namespace FDK +{ + [StructLayout( LayoutKind.Sequential )] + public struct PositionColoredTexturedVertex : IEquatable + { + public Vector3 Position; + public int Color; + public Vector2 TextureCoordinates; + + public static int SizeInBytes + { + get + { + return Marshal.SizeOf( typeof( PositionColoredTexturedVertex ) ); + } + } + public static VertexFormat Format + { + get + { + return ( VertexFormat.Texture1 | VertexFormat.Diffuse | VertexFormat.Position ); + } + } + public PositionColoredTexturedVertex( Vector3 position, int color, Vector2 textureCoordinates ) + { + this = new PositionColoredTexturedVertex(); + this.Position = position; + this.Color = color; + this.TextureCoordinates = textureCoordinates; + } + + public static bool operator ==( PositionColoredTexturedVertex left, PositionColoredTexturedVertex right ) + { + return left.Equals( right ); + } + public static bool operator !=( PositionColoredTexturedVertex left, PositionColoredTexturedVertex right ) + { + return !( left == right ); + } + public override int GetHashCode() + { + return ( ( this.Position.GetHashCode() + this.Color.GetHashCode() ) + this.TextureCoordinates.GetHashCode() ); + } + public override bool Equals( object obj ) + { + if( obj == null ) + { + return false; + } + if( base.GetType() != obj.GetType() ) + { + return false; + } + return this.Equals( (PositionColoredTexturedVertex) obj ); + } + public bool Equals( PositionColoredTexturedVertex other ) + { + return ( ( ( this.Position == other.Position ) && ( this.Color == other.Color ) ) && ( this.TextureCoordinates == other.TextureCoordinates ) ); + } + public override string ToString() + { + return string.Format( CultureInfo.CurrentCulture, "{0} ({1}, {2})", new object[] { this.Position.ToString(), System.Drawing.Color.FromArgb( this.Color ).ToString(), this.TextureCoordinates.ToString() } ); + } + } +} diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/TexturedVertex.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/TexturedVertex.cs new file mode 100644 index 00000000..22356fdc --- /dev/null +++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/TexturedVertex.cs @@ -0,0 +1,120 @@ +サソ/* +* Copyright (c) 2007-2010 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ + +using System; +using System.Globalization; +using System.Runtime.InteropServices; + +using SlimDX; + +namespace FDK { + /// + /// Represents a vertex with a position and a texture coordinate. + /// + [StructLayout(LayoutKind.Sequential)] + public struct TexturedVertex : IEquatable { + /// + /// Gets or sets the position of the vertex. + /// + public Vector3 Position { + get; + set; + } + + /// + /// Gets or sets the texture coordinate for the vertex. + /// + public Vector2 TextureCoordinate { + get; + set; + } + + /// + /// Initializes a new instance of the struct. + /// + /// The position. + /// The color. + public TexturedVertex(Vector3 position, Vector2 textureCoordinate) + : this() { + Position = position; + TextureCoordinate = textureCoordinate; + } + + /// + /// Implements operator ==. + /// + /// The left. + /// The right. + /// The result of the operator. + public static bool operator ==(TexturedVertex left, TexturedVertex right) { + return left.Equals(right); + } + + /// + /// Implements operator !=. + /// + /// The left side of the operator. + /// The right side of the operator. + /// The result of the operator. + public static bool operator !=(TexturedVertex left, TexturedVertex right) { + return !(left == right); + } + + /// + /// Returns the hash code for this instance. + /// + /// + /// A 32-bit signed integer that is the hash code for this instance. + /// + public override int GetHashCode() { + return Position.GetHashCode() + TextureCoordinate.GetHashCode(); + } + + /// + /// Indicates whether this instance and a specified object are equal. + /// + /// Another object to compare to. + /// + /// true if and this instance are the same type and represent the same value; otherwise, false. + /// + public override bool Equals(object obj) { + if (obj == null) + return false; + + if (GetType() != obj.GetType()) + return false; + + return Equals((TexturedVertex)obj); + } + + /// + /// Indicates whether the current object is equal to another object of the same type. + /// + /// An object to compare with this object. + /// + /// true if the current object is equal to the parameter; otherwise, false. + /// + public bool Equals(TexturedVertex other) { + return (Position == other.Position && TextureCoordinate == other.TextureCoordinate); + } + } +} diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/TransformedColoredTexturedVertex.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/TransformedColoredTexturedVertex.cs new file mode 100644 index 00000000..44ad7770 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/TransformedColoredTexturedVertex.cs @@ -0,0 +1,73 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Globalization; +using SlimDX; +using SlimDX.Direct3D9; + +namespace FDK +{ + [StructLayout( LayoutKind.Sequential )] + public struct TransformedColoredTexturedVertex : IEquatable + { + public Vector4 Position; + public int Color; + public Vector2 TextureCoordinates; + + public static int SizeInBytes + { + get + { + return Marshal.SizeOf( typeof( TransformedColoredTexturedVertex ) ); + } + } + public static VertexFormat Format + { + get + { + return ( VertexFormat.Texture1 | VertexFormat.Diffuse | VertexFormat.PositionRhw ); + } + } + public TransformedColoredTexturedVertex( Vector4 position, int color, Vector2 textureCoordinates ) + { + this = new TransformedColoredTexturedVertex(); + this.Position = position; + this.Color = color; + this.TextureCoordinates = textureCoordinates; + } + + public static bool operator ==( TransformedColoredTexturedVertex left, TransformedColoredTexturedVertex right ) + { + return left.Equals( right ); + } + public static bool operator !=( TransformedColoredTexturedVertex left, TransformedColoredTexturedVertex right ) + { + return !( left == right ); + } + public override int GetHashCode() + { + return ( ( this.Position.GetHashCode() + this.Color.GetHashCode() ) + this.TextureCoordinates.GetHashCode() ); + } + public override bool Equals( object obj ) + { + if( obj == null ) + { + return false; + } + if( base.GetType() != obj.GetType() ) + { + return false; + } + return this.Equals( (TransformedColoredTexturedVertex) obj ); + } + public bool Equals( TransformedColoredTexturedVertex other ) + { + return ( ( ( this.Position == other.Position ) && ( this.Color == other.Color ) ) && ( this.TextureCoordinates == other.TextureCoordinates ) ); + } + public override string ToString() + { + return string.Format( CultureInfo.CurrentCulture, "{0} ({1}, {2})", new object[] { this.Position.ToString(), System.Drawing.Color.FromArgb( this.Color ).ToString(), this.TextureCoordinates.ToString() } ); + } + } +} diff --git a/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/TransformedColoredVertex.cs b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/TransformedColoredVertex.cs new file mode 100644 index 00000000..71bd1a7d --- /dev/null +++ b/FDK19/繧ウ繝シ繝/04.繧ー繝ゥ繝輔ぅ繝繧ッ/鬆らせ繝輔か繝シ繝槭ャ繝(Vertex)/TransformedColoredVertex.cs @@ -0,0 +1,120 @@ +サソ/* +* Copyright (c) 2007-2010 SlimDX Group +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +*/ + +using System; +using System.Globalization; +using System.Runtime.InteropServices; + +using SlimDX; + +namespace FDK { + /// + /// Represents a vertex with a pre-transformed position and a color. + /// + [StructLayout(LayoutKind.Sequential)] + public struct TransformedColoredVertex : IEquatable { + /// + /// Gets or sets the pre-transformed position of the vertex. + /// + public Vector4 Position { + get; + set; + } + + /// + /// Gets or sets the color of the vertex. + /// + public int Color { + get; + set; + } + + /// + /// Initializes a new instance of the struct. + /// + /// The position. + /// The color. + public TransformedColoredVertex(Vector4 position, int color) + : this() { + Position = position; + Color = color; + } + + /// + /// Implements operator ==. + /// + /// The left. + /// The right. + /// The result of the operator. + public static bool operator ==(TransformedColoredVertex left, TransformedColoredVertex right) { + return left.Equals(right); + } + + /// + /// Implements operator !=. + /// + /// The left side of the operator. + /// The right side of the operator. + /// The result of the operator. + public static bool operator !=(TransformedColoredVertex left, TransformedColoredVertex right) { + return !(left == right); + } + + /// + /// Returns the hash code for this instance. + /// + /// + /// A 32-bit signed integer that is the hash code for this instance. + /// + public override int GetHashCode() { + return Position.GetHashCode() + Color.GetHashCode(); + } + + /// + /// Indicates whether this instance and a specified object are equal. + /// + /// Another object to compare to. + /// + /// true if and this instance are the same type and represent the same value; otherwise, false. + /// + public override bool Equals(object obj) { + if (obj == null) + return false; + + if (GetType() != obj.GetType()) + return false; + + return Equals((TransformedColoredVertex)obj); + } + + /// + /// Indicates whether the current object is equal to another object of the same type. + /// + /// An object to compare with this object. + /// + /// true if the current object is equal to the parameter; otherwise, false. + /// + public bool Equals(TransformedColoredVertex other) { + return (Position == other.Position && Color == other.Color); + } + } +} diff --git a/FDK19/繧ウ繝シ繝/05.DirectShow/CDStoWAVFileImage.cs b/FDK19/繧ウ繝シ繝/05.DirectShow/CDStoWAVFileImage.cs new file mode 100644 index 00000000..9a1bbbab --- /dev/null +++ b/FDK19/繧ウ繝シ繝/05.DirectShow/CDStoWAVFileImage.cs @@ -0,0 +1,198 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Runtime.InteropServices; +using System.Diagnostics; +using DirectShowLib; +using SharpDX.Multimedia; + +namespace FDK +{ + public class CDStoWAVFileImage + { + /// + /// 謖螳壹&繧後◆蜍慕判繝輔ぃ繧、繝ォ縺九i髻ウ螢ー縺ョ縺ソ繧偵お繝ウ繧ウ繝シ繝峨@縲仝AV繝輔ぃ繧、繝ォ繧、繝。繝シ繧ク繧剃ス懈舌@縺ヲ霑斐☆縲 + /// + public static void t螟画鋤( string fileName, out byte[] wavFileImage ) + { + int hr = 0; + + IGraphBuilder graphBuilder = null; + + try + { + graphBuilder = (IGraphBuilder) new FilterGraph(); + + #region [ 繧ェ繝シ繝繧」繧ェ逕ィ繧オ繝ウ繝励Ν繧ー繝ゥ繝舌ョ菴懈舌→霑ス蜉縲] + //----------------- + ISampleGrabber sampleGrabber = null; + try + { + sampleGrabber = (ISampleGrabber) new SampleGrabber(); + + + // 繧オ繝ウ繝励Ν繧ー繝ゥ繝舌ョ繝。繝繧」繧「繧ソ繧、繝励ョ險ュ螳壹 + + var mediaType = new AMMediaType() { + majorType = MediaType.Audio, + subType = MediaSubType.PCM, + formatType = FormatType.WaveEx, + }; + try + { + hr = sampleGrabber.SetMediaType( mediaType ); + DsError.ThrowExceptionForHR( hr ); + } + finally + { + if( mediaType != null ) + DsUtils.FreeAMMediaType( mediaType ); + } + + + // 繧オ繝ウ繝励Ν繧ー繝ゥ繝舌ョ繝舌ャ繝輔ぃ繝ェ繝ウ繧ー繧呈怏蜉ケ縺ォ縺吶k縲 + + hr = sampleGrabber.SetBufferSamples( true ); + DsError.ThrowExceptionForHR( hr ); + + + // 繧オ繝ウ繝励Ν繧ー繝ゥ繝舌↓繧ウ繝シ繝ォ繝舌ャ繧ッ繧定ソス蜉縺吶k縲 + + sampleGrabberProc = new CSampleGrabberCallBack(); + hr = sampleGrabber.SetCallback( sampleGrabberProc, 1 ); // 1:繧ウ繝シ繝ォ繝舌ャ繧ッ縺ョ BufferCB() 繝。繧ス繝繝峨ョ譁ケ繧貞他縺ウ蜃コ縺吶 + + + // 繧オ繝ウ繝励Ν繧ー繝ゥ繝舌r繧ー繝ゥ繝輔↓霑ス蜉縺吶k縲 + + hr = graphBuilder.AddFilter( (IBaseFilter) sampleGrabber, "SampleGrabber for Audio/PCM" ); + DsError.ThrowExceptionForHR( hr ); + } + finally + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref sampleGrabber ); + } + //----------------- + #endregion + + var e = new DirectShowLib.DsROTEntry( graphBuilder ); + + // fileName 縺九i繧ー繝ゥ繝輔r閾ェ蜍慕函謌舌 + + hr = graphBuilder.RenderFile( fileName, null ); // IMediaControl.RenderFile() 縺ッ謗ィ螂ィ縺輔l縺ェ縺 + DsError.ThrowExceptionForHR( hr ); + + + // 繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ繧帝勁蜴サ縲 + + CDirectShow.t繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ繧偵げ繝ゥ繝輔°繧蛾勁蜴サ縺吶k( graphBuilder ); // 繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ繧誰ull縺ォ螟峨∴繧九h繧雁燕縺ォ螳溯。後☆繧九%縺ィ縲ゑシCDirectShow.t繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ繧誰ull繝ャ繝ウ繝繝ゥ縺ォ螟峨∴縺ヲ繝輔か繝シ繝槭ャ繝医r蜿門セ励☆繧() 縺ョ荳ュ縺ァ荳蠎ヲ蜀咲函縺吶k縺ョ縺ァ縲√◎縺ョ縺ィ縺阪↓Active繧ヲ繧」繝ウ繝峨え縺瑚。ィ遉コ縺輔l縺ヲ縺励∪縺縺溘a縲ゑシ + + + // 繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ繧 NullRenderer 縺ォ鄂ョ謠帙 + + WaveFormat wfx; + byte[] wfx諡。蠑オ鬆伜沺; + CDirectShow.t繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ繧誰ull繝ャ繝ウ繝繝ゥ縺ォ螟峨∴縺ヲ繝輔か繝シ繝槭ャ繝医r蜿門セ励☆繧( graphBuilder, out wfx, out wfx諡。蠑オ鬆伜沺 ); + + + // 蝓コ貅悶け繝ュ繝繧ッ繧 NULLシ域怙鬮倬滂シ峨↓險ュ螳壹☆繧九 + + IMediaFilter mediaFilter = graphBuilder as IMediaFilter; + mediaFilter.SetSyncSource( null ); + mediaFilter = null; + + + // 繝。繝「繝ェ繧ケ繝医Μ繝シ繝縺ォ繝繧ウ繝シ繝峨ョ繝シ繧ソ繧貞コ蜉帙☆繧九 + + sampleGrabberProc.MemoryStream = new MemoryStream(); // CDirectShow.t繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ繧誰ull繝ャ繝ウ繝繝ゥ縺ォ螟峨∴縺ヲ繝輔か繝シ繝槭ャ繝医r蜿門セ励☆繧() 縺ァ荳蠎ヲ蜀咲函縺励※縺繧九ョ縺ァ縲√せ繝医Μ繝シ繝繧偵け繝ェ繧「縺吶k縲 + var ms = sampleGrabberProc.MemoryStream; + var bw = new BinaryWriter( ms ); + bw.Write( new byte[] { 0x52, 0x49, 0x46, 0x46 } ); // 'RIFF' + bw.Write( (UInt32) 0 ); // 繝輔ぃ繧、繝ォ繧オ繧、繧コ - 8 [byte]シ帑サ翫ッ荳肴弱↑縺ョ縺ァ蠕後〒荳頑嶌縺阪☆繧九 + bw.Write( new byte[] { 0x57, 0x41, 0x56, 0x45 } ); // 'WAVE' + bw.Write( new byte[] { 0x66, 0x6D, 0x74, 0x20 } ); // 'fmt ' + bw.Write( (UInt32) ( 16 + ( ( wfx諡。蠑オ鬆伜沺.Length > 0 ) ? ( 2/*sizeof(WAVEFORMATEX.cbSize)*/ + wfx諡。蠑オ鬆伜沺.Length ) : 0 ) ) ); // fmt繝√Ε繝ウ繧ッ縺ョ繧オ繧、繧コ[byte] + bw.Write( (UInt16) wfx.Encoding); // 繝輔か繝シ繝槭ャ繝IDシ医Μ繝九いPCM縺ェ繧1シ + bw.Write( (UInt16) wfx.Channels ); // 繝√Ε繝ウ繝阪Ν謨ー + bw.Write( (UInt32) wfx.SampleRate); // 繧オ繝ウ繝励Μ繝ウ繧ー繝ャ繝シ繝 + bw.Write( (UInt32) wfx.AverageBytesPerSecond ); // 繝繝シ繧ソ騾溷コヲ + bw.Write( (UInt16) wfx.BlockAlign); // 繝悶Ο繝繧ッ繧オ繧、繧コ + bw.Write( (UInt16) wfx.BitsPerSample ); // 繧オ繝ウ繝励Ν縺ゅ◆繧翫ョ繝薙ャ繝域焚 + if( wfx諡。蠑オ鬆伜沺.Length > 0 ) + { + bw.Write( (UInt16) wfx諡。蠑オ鬆伜沺.Length ); // 諡。蠑オ鬆伜沺縺ョ繧オ繧、繧コ[byte] + bw.Write( wfx諡。蠑オ鬆伜沺 ); // 諡。蠑オ繝繝シ繧ソ + } + bw.Write( new byte[] { 0x64, 0x61, 0x74, 0x61 } ); // 'data' + int nDATA繝√Ε繝ウ繧ッ繧オ繧、繧コ菴咲スョ = (int) ms.Position; + bw.Write( (UInt32) 0 ); // data繝√Ε繝ウ繧ッ縺ョ繧オ繧、繧コ[byte]シ帑サ翫ッ荳肴弱↑縺ョ縺ァ蠕後〒荳頑嶌縺阪☆繧九 + + #region [ 蜀咲函繧帝幕蟋九@縲∫オゆコ繧貞セ縺、縲- 蜀咲函荳ュ縲《ampleGrabberProc.MemoryStream 縺ォ PCM 繝繝シ繧ソ縺瑚塘遨阪&繧後※縺縺上] + //----------------- + IMediaControl mediaControl = graphBuilder as IMediaControl; + mediaControl.Run(); // 蜀咲函髢句ァ + + IMediaEvent mediaEvent = graphBuilder as IMediaEvent; + EventCode eventCode; + hr = mediaEvent.WaitForCompletion( -1, out eventCode ); + DsError.ThrowExceptionForHR( hr ); + if( eventCode != EventCode.Complete ) + throw new Exception( "蜀咲函蠕縺。縺ォ螟ア謨励@縺セ縺励◆縲" ); + + mediaControl.Stop(); + mediaEvent = null; + mediaControl = null; + //----------------- + #endregion + + bw.Seek( 4, SeekOrigin.Begin ); + bw.Write( (UInt32) ms.Length - 8 ); // 繝輔ぃ繧、繝ォ繧オ繧、繧コ - 8 [byte] + + bw.Seek( nDATA繝√Ε繝ウ繧ッ繧オ繧、繧コ菴咲スョ, SeekOrigin.Begin ); + bw.Write( (UInt32) ms.Length - ( nDATA繝√Ε繝ウ繧ッ繧オ繧、繧コ菴咲スョ + 4 ) ); // data繝√Ε繝ウ繧ッ繧オ繧、繧コ [byte] + + + // 蜃コ蜉帙◎縺ョシ偵r菴懈舌 + + wavFileImage = ms.ToArray(); + + + // 邨ゆコ蜃ヲ逅縲 + + bw.Close(); + sampleGrabberProc.Dispose(); // ms.Close() + } + finally + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref graphBuilder ); + } + } + + #region [ private ] + //----------------- + private class CSampleGrabberCallBack : ISampleGrabberCB, IDisposable + { + public MemoryStream MemoryStream = new MemoryStream(); + + public int BufferCB( double SampleTime, IntPtr pBuffer, int BufferLen ) + { + var bytes = new byte[ BufferLen ]; + Marshal.Copy( pBuffer, bytes, 0, BufferLen ); // unmanage 竊 manage + this.MemoryStream.Write( bytes, 0, BufferLen ); // byte[] 竊 Stream + return CWin32.S_OK; + } + public int SampleCB( double SampleTime, IMediaSample pSample ) + { + throw new NotImplementedException( "螳溯」縺輔l縺ヲ縺縺セ縺帙s縲" ); + } + + public void Dispose() + { + this.MemoryStream.Close(); + } + } + private static CSampleGrabberCallBack sampleGrabberProc = null; + //----------------- + #endregion + } +} diff --git a/FDK19/繧ウ繝シ繝/05.DirectShow/CDirectShow.cs b/FDK19/繧ウ繝シ繝/05.DirectShow/CDirectShow.cs new file mode 100644 index 00000000..b7ca2f2d --- /dev/null +++ b/FDK19/繧ウ繝シ繝/05.DirectShow/CDirectShow.cs @@ -0,0 +1,1610 @@ +サソusing System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.IO; +using System.Drawing; +using System.Drawing.Imaging; +using System.Threading; +using SlimDX; +using SlimDX.Direct3D9; +using SharpDX.Multimedia; +using DirectShowLib; + +namespace FDK +{ + /// + /// DirectShow繧堤畑縺縺溘け繝ェ繝繝暦シ亥虚逕サシ矩浹螢ーシ峨r謇ア縺縲 + /// シ代▽縺ョ繧ッ繝ェ繝繝励↓縺、縺搾シ代▽縺ョ CDirectShow 繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧堤函謌舌☆繧九 + /// 蜀咲函縺ョ髢句ァ九d蛛懈ュ「縺ェ縺ゥ縺ョ謫堺ス懊ョ莉悶∽ササ諢上ョ譎らせ縺ァ繧ケ繝翫ャ繝励う繝。繝シ繧ク繧貞叙蠕励☆繧九%縺ィ縺後〒縺阪k縲 + /// + public class CDirectShow : IDisposable + { + // 繝励Ο繝代ユ繧」 + + public const uint WM_DSGRAPHNOTIFY = CWin32.WM_APP + 1; + + public enum E繧ー繝ゥ繝輔ョ迥カ諷 { 螳悟ィ蛛懈ュ「荳ュ, 蜀咲函縺ョ縺ソ蛛懈ュ「荳ュ, 蜀咲函荳ュ, 螳悟ィ蛛懈ュ「縺ク驕キ遘サ荳ュ, 蜀咲函縺ョ縺ソ蛛懈ュ「縺ク驕キ遘サ荳ュ, 蜀咲函縺ク驕キ遘サ荳ュ, 譛ェ螳 } + public E繧ー繝ゥ繝輔ョ迥カ諷 e繧ー繝ゥ繝輔ョ迥カ諷 + { + get + { + var status = E繧ー繝ゥ繝輔ョ迥カ諷.譛ェ螳; + + if( this.MediaCtrl != null ) + { + FilterState fs; + int hr = this.MediaCtrl.GetState( 0, out fs ); // 縺昴l縺ェ繧翫↓驥阪◆縺縺ョ縺ァ豕ィ諢上 + + if( hr == CWin32.E_FAIL ) + { + #region [ 螟ア謨励] + //----------------- + status = E繧ー繝ゥ繝輔ョ迥カ諷.譛ェ螳; + //----------------- + #endregion + } + else if( hr == CWin32.VFW_S_STATE_INTERMEDIATE ) + { + #region [ 驕キ遘サ荳ュ縲] + //----------------- + switch( fs ) + { + case FilterState.Running: + status = E繧ー繝ゥ繝輔ョ迥カ諷.蜀咲函縺ク驕キ遘サ荳ュ; + break; + + case FilterState.Paused: + status = E繧ー繝ゥ繝輔ョ迥カ諷.蜀咲函縺ョ縺ソ蛛懈ュ「縺ク驕キ遘サ荳ュ; + break; + + case FilterState.Stopped: + status = E繧ー繝ゥ繝輔ョ迥カ諷.螳悟ィ蛛懈ュ「縺ク驕キ遘サ荳ュ; + break; + + default: + status = E繧ー繝ゥ繝輔ョ迥カ諷.譛ェ螳; + break; + } + //----------------- + #endregion + } + else + { + #region [ 螳牙ョ夂憾諷九] + //----------------- + switch( fs ) + { + case FilterState.Running: + status = E繧ー繝ゥ繝輔ョ迥カ諷.蜀咲函荳ュ; + break; + + case FilterState.Paused: + status = E繧ー繝ゥ繝輔ョ迥カ諷.蜀咲函縺ョ縺ソ蛛懈ュ「荳ュ; + break; + + case FilterState.Stopped: + status = E繧ー繝ゥ繝輔ョ迥カ諷.螳悟ィ蛛懈ュ「荳ュ; + break; + + default: + status = E繧ー繝ゥ繝輔ョ迥カ諷.譛ェ螳; + break; + } + //----------------- + #endregion + } + } + return status; + } + } + public bool b蜀咲函荳ュ; + public bool b繝ォ繝シ繝怜咲函; + + public int n蟷px + { + get; + protected set; + } + public int n鬮倥&px + { + get; + protected set; + } + public int n繧ケ繧ュ繝」繝ウ繝ゥ繧、繝ウ蟷byte + { + get; + protected set; + } + public int n繝繝シ繧ソ繧オ繧、繧コbyte + { + get; + protected set; + } + public bool b荳贋ク句渚霆「 + { + get; + protected set; + } + + public bool b髻ウ螢ー縺ョ縺ソ + { + get; + protected set; + } + + public long n迴セ蝨ィ縺ョ繧ー繝ゥ繝輔ョ蜀咲函菴咲スョms + { + get + { + if( this.MediaSeeking == null ) + return 0; + + long current; + int hr = this.MediaSeeking.GetCurrentPosition( out current ); + DsError.ThrowExceptionForHR( hr ); + return (long) ( current / ( 1000.0 * 10.0 ) ); + } + } + /// + /// 辟。髻ウ:0ス100:蜴滄浹縲Tet 縺ョ縺ソ縲 + /// + public int n髻ウ驥 + { + get + { + return this._n髻ウ驥; + } + set + { + if( this.BasicAudio == null ) + return; + + + // 蛟、繧剃ソ晏ュ倥 + + this._n髻ウ驥 = value; + + + // 繝ェ繝九い髻ウ驥上r繝繧キ繝吶Ν髻ウ驥上↓螟画鋤縲 + + int n髻ウ驥重b = 0; + + if( value == 0 ) + { + n髻ウ驥重b = -10000; // 螳悟ィ辟。髻ウ + } + else + { + n髻ウ驥重b = (int) ( ( 20.0 * Math.Log10( ( (double) value ) / 100.0 ) ) * 100.0 ); + } + + + // 繝繧キ繝吶Ν髻ウ驥上〒繧ー繝ゥ繝輔ョ髻ウ驥上r螟画峩縲 + + this.BasicAudio.put_Volume( n髻ウ驥重b ); + } + } + /// + /// 蟾ヲ:-100ス樔クュ螟ョ:0ス100:蜿ウ縲Tet 縺ョ縺ソ縲 + /// + public int n菴咲スョ + { + set + { + if( this.BasicAudio == null ) + return; + + // 繝ェ繝九い菴咲スョ繧偵ョ繧キ繝吶Ν菴咲スョ縺ォ螟画鋤縲 + + int n菴咲スョ = Math.Min( Math.Max( value, -100 ), +100 ); + int n菴咲スョdb = 0; + + if( n菴咲スョ == 0 ) + { + n菴咲スョdb = 0; + } + else if( n菴咲スョ == -100 ) + { + n菴咲スョdb = -10000; + } + else if( n菴咲スョ == 100 ) + { + n菴咲スョdb = +10000; + } + else if( n菴咲スョ < 0 ) + { + n菴咲スョdb = (int) ( ( 20.0 * Math.Log10( ( (double) ( n菴咲スョ + 100 ) ) / 100.0 ) ) * 100.0 ); + } + else + { + n菴咲スョdb = (int) ( ( -20.0 * Math.Log10( ( (double) ( 100 - n菴咲スョ ) ) / 100.0 ) ) * 100.0 ); + } + + // 繝繧キ繝吶Ν菴咲スョ縺ァ繧ー繝ゥ繝輔ョ菴咲スョ繧貞、画峩縲 + + this.BasicAudio.put_Balance( n菴咲スョdb ); + } + } + public IMediaControl MediaCtrl; + public IMediaEventEx MediaEventEx; + public IMediaSeeking MediaSeeking; + public IBasicAudio BasicAudio; + public IGraphBuilder graphBuilder; + + /// + /// CDirectShow繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ォ蝗コ譛峨ョID縲 + /// DirectShow 繧、繝吶Φ繝医r繧ヲ繧」繝ウ繝峨え縺ォ逋コ菫。縺吶k髫帙`essageID 縺ィ縺励※ "WM_APP+繧、繝ウ繧ケ繧ソ繝ウ繧ケID" 繧堤匱菫。縺吶k縲 + /// 縺薙l縺ォ繧医j縲∝女縺大エ縺ァ繧、繝吶Φ繝育匱菫。繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧堤音螳壹☆繧九%縺ィ縺悟庄閭ス縺ォ縺ェ繧九 + /// + public int n繧、繝ウ繧ケ繧ソ繝ウ繧ケID + { + get; + protected set; + } + + + // 繝。繧ス繝繝 + + public CDirectShow() + { + } + public CDirectShow( string fileName, IntPtr hWnd, bool b繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ縺ェ縺 ) + { + // 蛻晄悄蛹悶 + + this.n蟷px = 0; + this.n鬮倥&px = 0; + this.b荳贋ク句渚霆「 = false; + this.n繧ケ繧ュ繝」繝ウ繝ゥ繧、繝ウ蟷byte = 0; + this.n繝繝シ繧ソ繧オ繧、繧コbyte = 0; + this.b髻ウ螢ー縺ョ縺ソ = false; + this.graphBuilder = null; + this.MediaCtrl = null; + this.b蜀咲函荳ュ = false; + this.b繝ォ繝シ繝怜咲函 = false; + + + // 髱咏噪繝ェ繧ケ繝医↓逋サ骭イ縺励√う繝ウ繧ケ繧ソ繝ウ繧ケID繧貞セ励k縲 + + CDirectShow.t繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧堤匳骭イ縺吶k( this ); + + + // 荳ヲ蛻怜ヲ逅貅門y縲 + + if( CDirectShow.n荳ヲ蛻怜コヲ == 0 ) // 邂怜コ縺後∪縺縺ェ繧臥ョ怜コ縺吶k縲 + CDirectShow.n荳ヲ蛻怜コヲ = Environment.ProcessorCount; // 荳ヲ蛻怜コヲシ戮PU謨ー縺ィ縺吶k縲 + + unsafe + { + this.dg繝ゥ繧、繝ウ謠冗判ARGB32 = new DG繝ゥ繧、繝ウ謠冗判[ CDirectShow.n荳ヲ蛻怜コヲ ]; + this.dg繝ゥ繧、繝ウ謠冗判XRGB32 = new DG繝ゥ繧、繝ウ謠冗判[ CDirectShow.n荳ヲ蛻怜コヲ ]; + + for( int i = 0; i < CDirectShow.n荳ヲ蛻怜コヲ; i++ ) + { + this.dg繝ゥ繧、繝ウ謠冗判ARGB32[ i ] = new DG繝ゥ繧、繝ウ謠冗判( this.t繝ゥ繧、繝ウ謠冗判ARGB32 ); + this.dg繝ゥ繧、繝ウ謠冗判XRGB32[ i ] = new DG繝ゥ繧、繝ウ謠冗判( this.t繝ゥ繧、繝ウ謠冗判XRGB32 ); + } + } + + try + { + int hr = 0; + + + // 繧ー繝ゥ繝輔ン繝ォ繝繧堤函謌舌 + + this.graphBuilder = (IGraphBuilder) new FilterGraph(); +#if DEBUG + // ROT 縺ク縺ョ逋サ骭イ縲 + this.rot = new DsROTEntry( graphBuilder ); +#endif + + + // QueryInterface縲ょュ伜惠縺励↑縺代l縺ー null縲 + + this.MediaCtrl = this.graphBuilder as IMediaControl; + this.MediaEventEx = this.graphBuilder as IMediaEventEx; + this.MediaSeeking = this.graphBuilder as IMediaSeeking; + this.BasicAudio = this.graphBuilder as IBasicAudio; + + + // IMemoryRenderer 繧偵げ繝ゥ繝輔↓謖ソ蜈・縲 + + AMMediaType mediaType = null; + + this.memoryRendererObject = new MemoryRenderer(); + this.memoryRenderer = (IMemoryRenderer) this.memoryRendererObject; + var baseFilter = (IBaseFilter) this.memoryRendererObject; + + hr = this.graphBuilder.AddFilter( baseFilter, "MemoryRenderer" ); + DsError.ThrowExceptionForHR( hr ); + + + // fileName 縺九i繧ー繝ゥ繝輔r閾ェ蜍慕函謌舌 + + hr = this.graphBuilder.RenderFile( fileName, null ); // IMediaControl.RenderFile() 縺ッ謗ィ螂ィ縺輔l縺ェ縺 + DsError.ThrowExceptionForHR( hr ); + + + // 髻ウ螢ー縺ョ縺ソシ + + { + IBaseFilter videoRenderer; + IPin videoInputPin; + IBaseFilter audioRenderer; + IPin audioInputPin; +#if MemoryRenderer + CDirectShow.t繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ縺ィ縺昴ョ蜈・蜉帙ヴ繝ウ繧呈爾縺励※霑斐☆( this.graphBuilder, out videoRenderer, out videoInputPin ); +#else + CDirectShow.SearchMMRenderers( this.graphBuilder, out videoRenderer, out videoInputPin, out audioRenderer, out audioInputPin ); +#endif + if( videoRenderer == null && audioRenderer != null ) + this.b髻ウ螢ー縺ョ縺ソ = true; + else + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref videoInputPin ); + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref videoRenderer ); + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref audioInputPin ); + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref audioRenderer ); + } + } + + + // 繧、繝。繝シ繧ク諠蝣ア繧貞叙蠕励 + + if( !this.b髻ウ螢ー縺ョ縺ソ ) + { + long n; + int m; + this.memoryRenderer.GetWidth( out n ); + this.n蟷px = (int) n; + this.memoryRenderer.GetHeight( out n ); + this.n鬮倥&px = (int) n; + this.memoryRenderer.IsBottomUp( out m ); + this.b荳贋ク句渚霆「 = ( m != 0 ); + this.memoryRenderer.GetBufferSize( out n ); + this.n繝繝シ繧ソ繧オ繧、繧コbyte = (int) n; + this.n繧ケ繧ュ繝」繝ウ繝ゥ繧、繝ウ蟷byte = (int) this.n繝繝シ繧ソ繧オ繧、繧コbyte / this.n鬮倥&px; + // C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref baseFilter ); 縺ェ繧薙°繧ュ繝」繧ケ繝亥縺ョ繧ェ繝悶ず繧ァ繧ッ繝医∪縺ァ隗」謾セ縺輔l繧九ョ縺ァ隗」謾セ遖∵ュ「縲 + } + + + // 繧ー繝ゥ繝輔r菫ョ豁」縺吶k縲 + + if( b繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ縺ェ縺 ) + { + WaveFormat dummy1; + byte[] dummy2; + CDirectShow.t繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ繧誰ull繝ャ繝ウ繝繝ゥ縺ォ螟峨∴縺ヲ繝輔か繝シ繝槭ャ繝医r蜿門セ励☆繧( this.graphBuilder, out dummy1, out dummy2 ); + } + + + // 縺昴ョ莉悶ョ蜃ヲ逅縲 + + this.t蜀咲函貅門y髢句ァ(); // 1蝗樔サ・荳 IMediaControl 繧貞他縺ウ蜃コ縺励※縺ェ縺縺ィ縲!ReferenceClock 縺ッ蜿門セ励〒縺阪↑縺縲 + this.t驕キ遘サ螳御コ縺セ縺ァ蠕縺」縺ヲ迥カ諷九r蜿門セ励☆繧(); // 螳悟ィ縺ォ Pause 縺ク驕キ遘サ縺吶k縺ョ繧貞セ縺、縲ゑシ育腸蠅萓晏ュ假シ + + + // 繧、繝吶Φ繝育畑繧ヲ繧」繝ウ繝峨え繝上Φ繝峨Ν繧定ィュ螳壹 + + this.MediaEventEx.SetNotifyWindow( hWnd, (int) WM_DSGRAPHNOTIFY, new IntPtr( this.n繧、繝ウ繧ケ繧ソ繝ウ繧ケID ) ); + } +#if !DEBUG + catch( Exception e ) + { + C蜈ア騾.t萓句、悶ョ隧ウ邏ー繧偵Ο繧ー縺ォ蜃コ蜉帙☆繧( e ); + this.Dispose(); + throw; // 萓句、也匱蜃コ縲 + } +#endif + finally + { + } + } + + public void t蜀咲函貅門y髢句ァ() + { + if( this.MediaCtrl != null ) + { + int hr = this.MediaCtrl.Pause(); // 蜀咲函貅門y繧帝幕蟋九☆繧九ゅ%縺薙〒縺ッ貅門y縺悟ョ御コ縺吶k縺セ縺ァ蠕縺溘↑縺縲 + DsError.ThrowExceptionForHR( hr ); + } + } + public void t蜀咲函髢句ァ() + { + if( this.MediaCtrl != null && --this.n蜀咲函荳譎ょ●豁「蜻シ縺ウ蜃コ縺励ョ邏ッ遨榊屓謨ー <= 0 ) + { + //this.t驕キ遘サ螳御コ縺セ縺ァ蠕縺」縺ヲ迥カ諷九r蜿門セ励☆繧(); // 蜀咲函貅門yシ医□繧阪≧シ峨′縺セ縺螳御コ縺励※縺ェ縺代l縺ー縲∝セ縺、縲 竊 諢丞、悶→驥阪>蜃ヲ逅縺ェ縺ョ縺ァ螟夜Κ縺ァ蛻、譁ュ縺励※螳溯。後☆繧九h縺螟画峩縺吶k縲(2011.8.7) + + int hr = this.MediaCtrl.Run(); // 蜀咲函髢句ァ九 + DsError.ThrowExceptionForHR( hr ); + + this.n蜀咲函荳譎ょ●豁「蜻シ縺ウ蜃コ縺励ョ邏ッ遨榊屓謨ー = 0; // 荳譎ょ●豁「蝗樊焚縺ッ縺薙%縺ァ繝ェ繧サ繝繝医&繧後k縲 + this.b蜀咲函荳ュ = true; + } + } + public void t蜀咲函荳譎ょ●豁「() + { + if( this.MediaCtrl != null && this.n蜀咲函荳譎ょ●豁「蜻シ縺ウ蜃コ縺励ョ邏ッ遨榊屓謨ー == 0 ) + { + int hr = this.MediaCtrl.Pause(); + DsError.ThrowExceptionForHR( hr ); + } + this.n蜀咲函荳譎ょ●豁「蜻シ縺ウ蜃コ縺励ョ邏ッ遨榊屓謨ー++; + this.b蜀咲函荳ュ = false; + } + public void t蜀咲函蛛懈ュ「() + { + if( this.MediaCtrl != null ) + { + int hr = this.MediaCtrl.Stop(); + DsError.ThrowExceptionForHR( hr ); + } + + // 谺。縺ク縺ョ貅門y縲 + //this.t蜀咲函菴咲スョ繧貞、画峩縺吶k( 0.0 ); 竊 繧医j邏ー縺九¥蛻カ蠕。縺吶k縺溘a縺ォ縲:DK螟夜Κ縺ァ蛻カ蠕。縺吶k繧医≧縺ォ螟画峩縲(2011.8.7) + //this.t蜀咲函貅門y髢句ァ(); + + this.n蜀咲函荳譎ょ●豁「蜻シ縺ウ蜃コ縺励ョ邏ッ遨榊屓謨ー = 0; // 蛛懈ュ「縺吶k縺ィ縲∽ク譎ょ●豁「蜻シ縺ウ蜃コ縺礼エッ遨榊屓謨ー縺ッ繝ェ繧サ繝繝医&繧後k縲 + this.b蜀咲函荳ュ = false; + } + public void t蜀咲函菴咲スョ繧貞、画峩( double db蜀咲函菴咲スョms ) + { + if( this.MediaSeeking == null ) + return; + + int hr = this.MediaSeeking.SetPositions( + DsLong.FromInt64( (long) ( db蜀咲函菴咲スョms * 1000.0 * 10.0 ) ), + AMSeekingSeekingFlags.AbsolutePositioning, + null, + AMSeekingSeekingFlags.NoPositioning ); + + DsError.ThrowExceptionForHR( hr ); + } + public void t譛蛻昴°繧牙咲函髢句ァ() + { + this.t蜀咲函菴咲スョ繧貞、画峩( 0.0 ); + this.t蜀咲函髢句ァ(); + } + public E繧ー繝ゥ繝輔ョ迥カ諷 t驕キ遘サ螳御コ縺セ縺ァ蠕縺」縺ヲ迥カ諷九r蜿門セ励☆繧() + { + var status = E繧ー繝ゥ繝輔ョ迥カ諷.譛ェ螳; + + if( this.MediaCtrl != null ) + { + FilterState fs; + int hr = this.MediaCtrl.GetState( 1000, out fs ); // 驕キ遘サ螳御コ縺セ縺ァ譛螟ァ1000ms蠕縺、縲 + } + return this.e繧ー繝ゥ繝輔ョ迥カ諷; + } + public unsafe void t迴セ譎らせ縺ォ縺翫¢繧区怙譁ー縺ョ繧ケ繝翫ャ繝励う繝。繝シ繧ク繧探exture縺ォ霆「蜀吶☆繧( CTexture texture ) + { + int hr; + + #region [ 蜀咲函縺励※縺ェ縺縺ェ繧我ス輔b縺帙★蟶ー驍縲ゑシ井ク譎ょ●豁「荳ュ縺ッOK縲ゑシ云 + //----------------- + if( !this.b蜀咲函荳ュ ) + return; + //----------------- + #endregion + #region [ 髻ウ螢ー縺ョ縺ソ縺ェ繧我ス輔b縺励↑縺縲] + //----------------- + if( this.b髻ウ螢ー縺ョ縺ソ ) + return; + //----------------- + #endregion + + DataRectangle dr = texture.texture.LockRectangle( 0, LockFlags.Discard ); + try + { + if( this.n繧ケ繧ュ繝」繝ウ繝ゥ繧、繝ウ蟷byte == dr.Pitch ) + { + #region [ (A) 繝斐ャ繝√′蜷医≧縺ョ縺ァ縲√ユ繧ッ繧ケ繝√Ε縺ォ逶エ謗・霆「騾√☆繧九] + //----------------- + hr = this.memoryRenderer.GetCurrentBuffer( dr.Data.DataPointer, this.n繝繝シ繧ソ繧オ繧、繧コbyte ); + DsError.ThrowExceptionForHR( hr ); + //----------------- + #endregion + } + else + { + this.b荳贋ク句渚霆「 = false; // 縺薙■繧峨ョ譁ケ豕輔〒縺ッ蟶ク縺ォ豁」蟶ク + + #region [ (B) 繝斐ャ繝√′蜷医o縺ェ縺縺ョ縺ァ縲√Γ繝「繝ェ縺ォ霆「騾√@縺ヲ縺九i繝繧ッ繧ケ繝√Ε縺ォ霆「騾√☆繧九] + //----------------- + + #region [ IMemoryRenderer 縺九i繝舌ャ繝輔ぃ縺ォ繧、繝。繝シ繧ク繝繝シ繧ソ繧定ェュ縺ソ霎シ繧縲] + //----------------- + if( this.ip == IntPtr.Zero ) + this.ip = Marshal.AllocCoTaskMem( this.n繝繝シ繧ソ繧オ繧、繧コbyte ); + + hr = this.memoryRenderer.GetCurrentBuffer( this.ip, this.n繝繝シ繧ソ繧オ繧、繧コbyte ); + DsError.ThrowExceptionForHR( hr ); + //----------------- + #endregion + + #region [ 繝繧ッ繧ケ繝√Ε縺ォ繧ケ繝翫ャ繝励う繝。繝シ繧ク繧定サ「騾√] + //----------------- + bool bARGB32 = true; + + switch( texture.Format ) + { + case Format.A8R8G8B8: + bARGB32 = true; + break; + + case Format.X8R8G8B8: + bARGB32 = false; + break; + + default: + return; // 譛ェ蟇セ蠢懊ョ繝輔か繝シ繝槭ャ繝医ッ辟。隕悶 + } + + // 繧ケ繝ャ繝繝峨励シ繝ォ繧剃スソ縺」縺ヲ荳ヲ蛻苓サ「騾√☆繧区コ門y縲 + + this.ptrSnap = (byte*) this.ip.ToPointer(); + var ptr = stackalloc UInt32*[ CDirectShow.n荳ヲ蛻怜コヲ ]; // stackallocシGC蟇セ雎。螟悶√Γ繧ス繝繝臥オゆコ譎ゅ↓閾ェ蜍暮幕謾セシ峨ッ縲√せ繧ソ繝繧ッ螟画焚逶ク謇九↓縺励°菴ソ縺医↑縺縲 + ptr[ 0 ] = (UInt32*) dr.Data.DataPointer.ToPointer(); // 竊 + for( int i = 1; i < CDirectShow.n荳ヲ蛻怜コヲ; i++ ) // 繧ケ繧ソ繝繧ッ螟画焚縺ァ遒コ菫昴∝晄悄蛹悶@縺ヲ窶ヲ + ptr[ i ] = ptr[ i - 1 ] + this.n蟷px; // 竊 + this.ptrTexture = ptr; // 繧ケ繧ソ繝繧ッ螟画焚繧偵け繝ゥ繧ケ繝。繝ウ繝舌↓貂。縺呻シ医%繧後↑繧碓Kシ峨 + + + // 荳ヲ蛻怜コヲ縺鯉シ代↑繧峨す繝ウ繧ー繝ォ繧ケ繝ャ繝繝峨シ剃サ・荳翫↑繧峨槭Ν繝√せ繝ャ繝繝峨〒霆「騾√☆繧九 + // 竊 CPU縺鯉シ代▽縺ョ蝣エ蜷医√o縺悶o縺悶せ繝ャ繝繝峨励シ繝ォ縺ョ繧ケ繝ャ繝繝峨〒蜃ヲ逅縺吶k縺ョ縺ッ辟。鬧縲 + + if( CDirectShow.n荳ヲ蛻怜コヲ == 1 ) + { + if( bARGB32 ) + this.t繝ゥ繧、繝ウ謠冗判ARGB32( 0 ); + else + this.t繝ゥ繧、繝ウ謠冗判XRGB32( 0 ); + } + else + { + // 霆「騾髢句ァ九 + + var ar = new IAsyncResult[ CDirectShow.n荳ヲ蛻怜コヲ ]; + for( int i = 0; i < CDirectShow.n荳ヲ蛻怜コヲ; i++ ) + { + ar[ i ] = ( bARGB32 ) ? + this.dg繝ゥ繧、繝ウ謠冗判ARGB32[ i ].BeginInvoke( i, null, null ) : + this.dg繝ゥ繧、繝ウ謠冗判XRGB32[ i ].BeginInvoke( i, null, null ); + } + + + // 霆「騾∝ョ御コ蠕縺。縲 + + for( int i = 0; i < CDirectShow.n荳ヲ蛻怜コヲ; i++ ) + { + if( bARGB32 ) + this.dg繝ゥ繧、繝ウ謠冗判ARGB32[ i ].EndInvoke( ar[ i ] ); + else + this.dg繝ゥ繧、繝ウ謠冗判XRGB32[ i ].EndInvoke( ar[ i ] ); + } + } + + this.ptrSnap = null; + this.ptrTexture = null; + //----------------- + #endregion + + //----------------- + #endregion + } + } + finally + { + texture.texture.UnlockRectangle( 0 ); + } + } + + private IntPtr ip = IntPtr.Zero; + + public static void t繧ー繝ゥ繝輔r隗」譫舌@繝繝舌ャ繧ー蜃コ蜉帙☆繧( IGraphBuilder graphBuilder ) + { + if( graphBuilder == null ) + { + Debug.WriteLine( "謖螳壹&繧後◆繧ー繝ゥ繝輔′ null 縺ァ縺吶" ); + return; + } + + int hr = 0; + + IEnumFilters eFilters; + hr = graphBuilder.EnumFilters( out eFilters ); + DsError.ThrowExceptionForHR( hr ); + { + var filters = new IBaseFilter[ 1 ]; + while( eFilters.Next( 1, filters, IntPtr.Zero ) == CWin32.S_OK ) + { + FilterInfo filterInfo; + hr = filters[ 0 ].QueryFilterInfo( out filterInfo ); + DsError.ThrowExceptionForHR( hr ); + { + Debug.WriteLine( filterInfo.achName ); // 繝輔ぅ繝ォ繧ソ蜷崎。ィ遉コ縲 + if( filterInfo.pGraph != null ) + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref filterInfo.pGraph ); + } + + IEnumPins ePins; + hr = filters[ 0 ].EnumPins( out ePins ); + DsError.ThrowExceptionForHR( hr ); + { + var pins = new IPin[ 1 ]; + while( ePins.Next( 1, pins, IntPtr.Zero ) == CWin32.S_OK ) + { + PinInfo pinInfo; + hr = pins[ 0 ].QueryPinInfo( out pinInfo ); + DsError.ThrowExceptionForHR( hr ); + { + Debug.Write( " " + pinInfo.name ); // 繝斐Φ蜷崎。ィ遉コ縲 + Debug.Write( ( pinInfo.dir == PinDirection.Input ) ? " 竊 " : " 竊 " ); + + IPin connectPin; + hr = pins[ 0 ].ConnectedTo( out connectPin ); + if( hr != CWin32.S_OK ) + Debug.WriteLine( "(譛ェ謗・邯)" ); + else + { + DsError.ThrowExceptionForHR( hr ); + + PinInfo connectPinInfo; + hr = connectPin.QueryPinInfo( out connectPinInfo ); + DsError.ThrowExceptionForHR( hr ); + { + FilterInfo connectFilterInfo; + hr = connectPinInfo.filter.QueryFilterInfo( out connectFilterInfo ); + DsError.ThrowExceptionForHR( hr ); + { + Debug.Write( "[" + connectFilterInfo.achName + "]." ); // 謗・邯壼医ヵ繧」繝ォ繧ソ蜷 + + if( connectFilterInfo.pGraph != null ) + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref connectFilterInfo.pGraph ); + } + + Debug.WriteLine( connectPinInfo.name ); // 謗・邯壼医ヴ繝ウ蜷 + if( connectPinInfo.filter != null ) + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref connectPinInfo.filter ); + DsUtils.FreePinInfo( connectPinInfo ); + } + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref connectPin ); + } + if( pinInfo.filter != null ) + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref pinInfo.filter ); + DsUtils.FreePinInfo( pinInfo ); + } + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref pins[ 0 ] ); + } + } + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref ePins ); + + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref filters[ 0 ] ); + } + } + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref eFilters ); + + Debug.Flush(); + } + public static void t繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ繧誰ull繝ャ繝ウ繝繝ゥ縺ォ螟峨∴縺ヲ繝輔か繝シ繝槭ャ繝医r蜿門セ励☆繧( IGraphBuilder graphBuilder, out WaveFormat wfx, out byte[] wfx諡。蠑オ繝繝シ繧ソ ) + { + int hr = 0; + + IBaseFilter audioRenderer = null; + IPin rendererInputPin = null; + IPin rendererConnectedOutputPin = null; + IBaseFilter nullRenderer = null; + IPin nullRendererInputPin = null; + wfx = null; + wfx諡。蠑オ繝繝シ繧ソ = new byte[ 0 ]; + + try + { + // audioRenderer 繧呈爾縺吶 + + audioRenderer = CDirectShow.t繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ繧呈爾縺励※霑斐☆( graphBuilder ); + if( audioRenderer == null ) + return; // 縺ェ縺九▲縺 + + #region [ 髻ウ驥上ぞ繝ュ縺ァ荳蠎ヲ蜀咲函縺吶k縲ゑシ医が繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ縺ョ蜈・蜉帙ヴ繝ウMediaType縺後∵磁邯壽凾縺ィ縺ッ逡ー縺ェ繧九梧ュ」縺励>繧ゅョ縲阪↓螟峨o繧句庄閭ス諤ァ縺後≠繧九◆繧√ゑシ云 + //----------------- + { + // 縺薙%縺ォ譚・縺滓凾轤ケ縺ァ縲√げ繝ゥ繝輔ョ繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ縺ッ辟。蜉ケ蛹厄シNullRenderer縺ク縺ョ鄂ョ謠帙d髯、蜴サ縺ェ縺ゥシ峨@縺ヲ縺翫¥縺薙→縲 + // 縺輔b縺ェ縺縺ィ縲ヾtopWhenReady() 譎ゅ↓荳迸ャ縺縺 Active繧ヲ繧」繝ウ繝峨え縺瑚。ィ遉コ縺輔l縺ヲ縺励∪縺縲 + + var mediaCtrl = (IMediaControl) graphBuilder; + var basicAudio = (IBasicAudio) graphBuilder; + + basicAudio.put_Volume( -10000 ); // 譛蟆城浹驥 + + + // 繧ー繝ゥ繝輔r蜀咲函縺励※縺吶$豁「繧√k縲ゑシPaused 竊 Stopped 縺ク驕キ遘サ縺吶kシ + + mediaCtrl.StopWhenReady(); + + + // 繧ー繝ゥ繝輔′ Stopped 縺ォ驕キ遘サ螳御コ縺吶k縺セ縺ァ蠕縺、縲ゑシStopWhenReady() 縺ッ繧ー繝ゥ繝輔′ Stopped 縺ォ縺ェ繧九ョ繧貞セ縺溘★縺ォ蟶ー縺」縺ヲ縺上k縲ゑシ + + FilterState fs = FilterState.Paused; + hr = CWin32.S_FALSE; + while( fs != FilterState.Stopped || hr != CWin32.S_OK ) + hr = mediaCtrl.GetState( 10, out fs ); + + + // 邨ゆコ蜃ヲ逅縲 + + basicAudio.put_Volume( 0 ); // 譛螟ァ髻ウ驥 + + basicAudio = null; + mediaCtrl = null; + } + //----------------- + #endregion + + // audioRenderer 縺ョ蜈・蜉帙ヴ繝ウ繧呈爾縺吶 + + rendererInputPin = t譛蛻昴ョ蜈・蜉帙ヴ繝ウ繧呈爾縺励※霑斐☆( audioRenderer ); + if( rendererInputPin == null ) + return; + + + // WAVE繝輔か繝シ繝槭ャ繝医r蜿門セ励@縲『fx 蠑墓焚縺ク譬シ邏阪☆繧九 + + var type = new AMMediaType(); + hr = rendererInputPin.ConnectionMediaType( type ); + DsError.ThrowExceptionForHR( hr ); + try + { + wfx = new WaveFormat(); + + #region [ type.formatPtr 縺九i wfx 縺ォ縲∵僑蠑オ鬆伜沺繧帝勁縺上ョ繝シ繧ソ繧偵さ繝斐シ縺吶k縲] + //----------------- + var wfxTemp = new WaveFormatEx(); // SlimDX.Multimedia.WaveFormat 縺ッ Marshal.PtrToStructure() 縺ァ菴ソ縺医↑縺縺ョ縺ァ縲√◎繧後′菴ソ縺医k DirectShowLib.WaveFormatEx 繧剃サ九@縺ヲ蜿門セ励☆繧九ゑシ磯擇蛟停ヲシ + Marshal.PtrToStructure( type.formatPtr, (object) wfxTemp ); + wfx = WaveFormat.CreateCustomFormat((WaveFormatEncoding)wfxTemp.wFormatTag, wfxTemp.nSamplesPerSec, wfxTemp.nChannels, wfxTemp.nAvgBytesPerSec, wfxTemp.nBlockAlign, wfxTemp.wBitsPerSample); + //----------------- + #endregion + #region [ 諡。蠑オ鬆伜沺縺悟ュ伜惠縺吶k縺ェ繧峨◎繧後r wfx諡。蠑オ繝繝シ繧ソ 縺ォ譬シ邏阪☆繧九 ] + //----------------- + int nWaveFormatEx譛ャ菴薙し繧、繧コ = 16 + 2; // sizeof( WAVEFORMAT ) + sizof( WAVEFORMATEX.cbSize ) + int n縺ッ縺ソ蜃コ縺励し繧、繧コbyte = type.formatSize - nWaveFormatEx譛ャ菴薙し繧、繧コ; + + if( n縺ッ縺ソ蜃コ縺励し繧、繧コbyte > 0 ) + { + wfx諡。蠑オ繝繝シ繧ソ = new byte[ n縺ッ縺ソ蜃コ縺励し繧、繧コbyte ]; + var hGC = GCHandle.Alloc( wfx諡。蠑オ繝繝シ繧ソ, GCHandleType.Pinned ); // 蜍輔¥縺ェ繧医シ + unsafe + { + byte* src = (byte*) type.formatPtr.ToPointer(); + byte* dst = (byte*) hGC.AddrOfPinnedObject().ToPointer(); + CWin32.CopyMemory( dst, src + nWaveFormatEx譛ャ菴薙し繧、繧コ, (uint) n縺ッ縺ソ蜃コ縺励し繧、繧コbyte ); + } + hGC.Free(); + } + //----------------- + #endregion + } + finally + { + if( type != null ) + DsUtils.FreeAMMediaType( type ); + } + + + // audioRenderer 縺ォ縺、縺ェ縺後k蜃コ蜉帙ヴ繝ウ繧呈爾縺吶 + + hr = rendererInputPin.ConnectedTo( out rendererConnectedOutputPin ); + DsError.ThrowExceptionForHR( hr ); + + + // audioRenderer 繧偵げ繝ゥ繝輔°繧牙譁ュ縺吶k縲 + + rendererInputPin.Disconnect(); + rendererConnectedOutputPin.Disconnect(); + + + // audioRenderer 繧偵げ繝ゥ繝輔°繧蛾勁蜴サ縺吶k縲 + + hr = graphBuilder.RemoveFilter( audioRenderer ); + DsError.ThrowExceptionForHR( hr ); + + + // nullRenderer 繧剃ス懈舌@縲√げ繝ゥ繝輔↓霑ス蜉縺吶k縲 + + nullRenderer = (IBaseFilter) new NullRenderer(); + hr = graphBuilder.AddFilter( nullRenderer, "Audio Null Renderer" ); + DsError.ThrowExceptionForHR( hr ); + + + // nullRenderer 縺ョ蜈・蜉帙ヴ繝ウ繧呈爾縺吶 + + hr = nullRenderer.FindPin( "In", out nullRendererInputPin ); + DsError.ThrowExceptionForHR( hr ); + + + // nullRenderer 繧偵げ繝ゥ繝輔↓謗・邯壹☆繧九 + + hr = rendererConnectedOutputPin.Connect( nullRendererInputPin, null ); + DsError.ThrowExceptionForHR( hr ); + } + finally + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref nullRendererInputPin ); + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref nullRenderer ); + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref rendererConnectedOutputPin ); + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref rendererInputPin ); + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref audioRenderer ); + } + } + public static void ConnectNullRendererFromSampleGrabber(IGraphBuilder graphBuilder, IBaseFilter sampleGrabber) + { + int hr = 0; + IBaseFilter videoRenderer = null; + IPin videoRendererInputPin = null; + IBaseFilter audioRenderer = null; + IPin audioRendererInputPin = null; + IPin connectedOutputPin = null; + IPin nullRendererInputPin = null; + IPin grabberOutputPin = null; + IPin grabberOutputConnectedPin = null; + + try + { + // videoRenderer 繧呈爾縺吶 + CDirectShow.SearchMMRenderers(graphBuilder, out videoRenderer, out videoRendererInputPin, out audioRenderer, out audioRendererInputPin); + if (videoRenderer != null && videoRendererInputPin != null) + { + // 譌「蟄倥ョ繝ャ繝ウ繝繝ゥ縺ォ縺、縺ェ縺後▲縺ヲ縺繧九ヴ繝ウ蟇セ繧貞叙蠕 + hr = videoRendererInputPin.ConnectedTo(out connectedOutputPin); + DsError.ThrowExceptionForHR(hr); + + // 縺昴l繧峨r蛻譁ュ縲ょ燕谿オ縺ョ蜃コ蜉帙ヴ繝ウ縺ィ繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ縺ョ蜈・蜉帙ヴ繝ウ繧貞譁ュ縺吶k縲ょ曙譁ケ蜷代°繧牙譁ュ縺励↑縺縺ィ繧ー繝ゥ繝輔°繧牙繧企屬縺輔l縺ェ縺縺ョ縺ァ豕ィ諢上 + hr = videoRendererInputPin.Disconnect(); + DsError.ThrowExceptionForHR(hr); + hr = connectedOutputPin.Disconnect(); + DsError.ThrowExceptionForHR(hr); + + // 繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ繧偵げ繝ゥ繝輔°繧蛾勁蜴サ縺励√レ繝ォ繝ャ繝ウ繝繝ゥ繧定ソス蜉 + hr = graphBuilder.RemoveFilter(videoRenderer); + DsError.ThrowExceptionForHR(hr); + IBaseFilter nullRenderer = new NullRenderer() as IBaseFilter; + hr = graphBuilder.AddFilter(nullRenderer, "Video Null Renderer"); + DsError.ThrowExceptionForHR(hr); + + // nullRenderer 縺ョ蜈・蜉帙ヴ繝ウ繧呈爾縺吶 + hr = nullRenderer.FindPin("In", out nullRendererInputPin); + DsError.ThrowExceptionForHR(hr); + hr = nullRendererInputPin.Disconnect(); + DsError.ThrowExceptionForHR(hr); + + // 繧ー繝ゥ繝舌ョ Out 縺ィ Null Renderer 縺ョ In 繧呈磁邯壹☆繧九 + hr = sampleGrabber.FindPin("Out", out grabberOutputPin); + DsError.ThrowExceptionForHR(hr); + hr = grabberOutputPin.ConnectedTo(out grabberOutputConnectedPin); + // grabber縺ョout縺ォ菴輔b縺、縺ェ縺後▲縺ヲ縺縺ェ縺蝣エ蜷(縺、縺セ繧翫“rabber縺ョout縺ィrenderer縺ョin縺檎峩邨舌@縺ヲ縺繧句エ蜷)縺ッ縲 + // grabber縺ョout縺ィ縲∝挨縺ョ繝輔ぅ繝ォ繧ソ縺ョin縺ョ髢薙ョ蛻譁ュ蜃ヲ逅繧定。後o縺ェ縺縲 + if (hr != CWin32.S_OK) + { + //Debug.WriteLine("grabber out: 譛ェ謗・邯:"); + } + else + { + hr = grabberOutputConnectedPin.Disconnect(); + DsError.ThrowExceptionForHR(hr); + hr = grabberOutputPin.Disconnect(); + DsError.ThrowExceptionForHR(hr); + } + hr = grabberOutputPin.Connect(nullRendererInputPin, null); + DsError.ThrowExceptionForHR(hr); + } + + if ( audioRenderer != null && audioRendererInputPin != null ) + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref connectedOutputPin); + + // 譌「蟄倥ョ繝ャ繝ウ繝繝ゥ縺ォ縺、縺ェ縺後▲縺ヲ縺繧九ヴ繝ウ蟇セ繧貞叙蠕 + hr = audioRendererInputPin.ConnectedTo(out connectedOutputPin); + DsError.ThrowExceptionForHR(hr); + + // 縺昴l繧峨r蛻譁ュ縲ょ燕谿オ縺ョ蜃コ蜉帙ヴ繝ウ縺ィ繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ縺ョ蜈・蜉帙ヴ繝ウ繧貞譁ュ縺吶k縲ょ曙譁ケ蜷代°繧牙譁ュ縺励↑縺縺ィ繧ー繝ゥ繝輔°繧牙繧企屬縺輔l縺ェ縺縺ョ縺ァ豕ィ諢上 + hr = audioRendererInputPin.Disconnect(); + DsError.ThrowExceptionForHR(hr); + hr = connectedOutputPin.Disconnect(); + DsError.ThrowExceptionForHR(hr); + + // 繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ繧偵げ繝ゥ繝輔°繧蛾勁蜴サ縺励√レ繝ォ繝ャ繝ウ繝繝ゥ繧定ソス蜉 + hr = graphBuilder.RemoveFilter(audioRenderer); + DsError.ThrowExceptionForHR(hr); + IBaseFilter nullRenderer = new NullRenderer() as IBaseFilter; + hr = graphBuilder.AddFilter(nullRenderer, "Audio Null Renderer"); + DsError.ThrowExceptionForHR(hr); + + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref nullRendererInputPin); + hr = nullRenderer.FindPin("In", out nullRendererInputPin); + DsError.ThrowExceptionForHR(hr); + hr = connectedOutputPin.Connect(nullRendererInputPin, null); + DsError.ThrowExceptionForHR(hr); + } + } + finally + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref connectedOutputPin); + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref videoRendererInputPin); + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref videoRenderer); + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref audioRenderer); + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref audioRendererInputPin); + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref nullRendererInputPin); + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref grabberOutputPin); + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref grabberOutputConnectedPin); + } + } + private static void SearchMMRenderers( IFilterGraph graph, out IBaseFilter videoRenderer, out IPin inputVPin, out IBaseFilter audioRenderer, out IPin inputAPin ) + { + int hr = 0; + string strVR繝輔ぅ繝ォ繧ソ蜷 = null; + string strVR繝斐ΦID = null; + string strAR繝輔ぅ繝ォ繧ソ蜷 = null; + string strAR繝斐ΦID = null; + + // 繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ縺ィ蜈・蜉帙ヴ繝ウ繧呈爾縺励√◎縺ョ繝輔ぅ繝ォ繧ソ蜷阪→繝斐ΦID繧呈而縺医k縲 + + IEnumFilters eFilters; + hr = graph.EnumFilters( out eFilters ); + DsError.ThrowExceptionForHR( hr ); + try + { + var filters = new IBaseFilter[ 1 ]; + while( eFilters.Next( 1, filters, IntPtr.Zero ) == CWin32.S_OK ) + { + try + { + #region [ 蜃コ蜉帙ヴ繝ウ縺後↑縺シ医Ξ繝ウ繝繝ゥ縺ァ縺ゅkシ峨%縺ィ繧堤「コ隱阪☆繧九] + //----------------- + IEnumPins ePins; + bool b蜃コ蜉帙ヴ繝ウ縺後≠繧 = false; + + hr = filters[ 0 ].EnumPins( out ePins ); + DsError.ThrowExceptionForHR( hr ); + try + { + var pins = new IPin[ 1 ]; + while( ePins.Next( 1, pins, IntPtr.Zero ) == CWin32.S_OK ) + { + try + { + if( b蜃コ蜉帙ヴ繝ウ縺後≠繧 ) + continue; + + PinDirection dir; + hr = pins[ 0 ].QueryDirection( out dir ); + DsError.ThrowExceptionForHR( hr ); + if( dir == PinDirection.Output ) + b蜃コ蜉帙ヴ繝ウ縺後≠繧 = true; + } + finally + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref pins[ 0 ] ); + } + } + } + finally + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref ePins ); + } + + if( b蜃コ蜉帙ヴ繝ウ縺後≠繧 ) + continue; // 谺。縺ョ繝輔ぅ繝ォ繧ソ縺ク + + //----------------- + #endregion + #region [ 謗・邯壻クュ縺ョ蜈・蜉帙ヴ繝ウ縺 MEDIATYPE_Video 縺ォ蟇セ蠢懊@縺ヲ縺縺溘i縲√ヵ繧」繝ォ繧ソ蜷阪→繝斐ΦID繧貞叙蠕励☆繧九] + //----------------- + hr = filters[ 0 ].EnumPins( out ePins ); + DsError.ThrowExceptionForHR( hr ); + try + { + var pins = new IPin[ 1 ]; + while( ePins.Next( 1, pins, IntPtr.Zero ) == CWin32.S_OK ) + { + try + { + if( !string.IsNullOrEmpty( strVR繝輔ぅ繝ォ繧ソ蜷 ) ) + continue; + + var mediaType = new AMMediaType(); + + #region [ 迴セ蝨ィ謗・邯壻クュ縺ョ MediaType 繧貞叙蠕励ゅ▽縺ェ縺後▲縺ヲ縺ェ縺代l縺ー谺。縺ョ繝斐Φ縺ク縲] + //----------------- + hr = pins[ 0 ].ConnectionMediaType( mediaType ); + if( hr == CWin32.VFW_E_NOT_CONNECTED ) + continue; // 縺、縺ェ縺後▲縺ヲ縺ェ縺 + DsError.ThrowExceptionForHR( hr ); + //----------------- + #endregion + + try + { + if( mediaType.majorType.Equals( MediaType.Video ) ) + { + #region [ 繝輔ぅ繝ォ繧ソ蜷榊叙蠕暦シ‐ + //----------------- + FilterInfo filterInfo; + hr = filters[ 0 ].QueryFilterInfo( out filterInfo ); + DsError.ThrowExceptionForHR( hr ); + strVR繝輔ぅ繝ォ繧ソ蜷 = filterInfo.achName; + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref filterInfo.pGraph ); + //----------------- + #endregion + #region [ 繝斐ΦID蜿門セ暦シ‐ + //----------------- + hr = pins[ 0 ].QueryId( out strVR繝斐ΦID ); + DsError.ThrowExceptionForHR( hr ); + //----------------- + #endregion + } + else if( mediaType.majorType.Equals( MediaType.Audio ) ) + { + FilterInfo filterInfo; + hr = filters[0].QueryFilterInfo(out filterInfo); + DsError.ThrowExceptionForHR(hr); + strAR繝輔ぅ繝ォ繧ソ蜷 = filterInfo.achName; + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k(ref filterInfo.pGraph); + hr = pins[0].QueryId(out strAR繝斐ΦID); + DsError.ThrowExceptionForHR(hr); + } + } + finally + { + DsUtils.FreeAMMediaType( mediaType ); + } + } + finally + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref pins[ 0 ] ); + } + } + } + finally + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref ePins ); + } + + //----------------- + #endregion + } + finally + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref filters[ 0 ] ); + } + } + } + finally + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref eFilters ); + } + + + // 謾ケ繧√※繝輔ぅ繝ォ繧ソ蜷阪→繝斐ΦID縺九i縺薙l繧峨ョ繧、繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ繧貞叙蠕励@縲∵綾繧雁、縺ィ縺励※霑斐☆縲 + + videoRenderer = null; + inputVPin = null; + audioRenderer = null; + inputAPin = null; + + if( !string.IsNullOrEmpty( strVR繝輔ぅ繝ォ繧ソ蜷 ) ) + { + hr = graph.FindFilterByName( strVR繝輔ぅ繝ォ繧ソ蜷, out videoRenderer ); + DsError.ThrowExceptionForHR( hr ); + + hr = videoRenderer.FindPin( strVR繝斐ΦID, out inputVPin ); + DsError.ThrowExceptionForHR( hr ); + } + + if( !string.IsNullOrEmpty( strAR繝輔ぅ繝ォ繧ソ蜷 ) ) + { + hr = graph.FindFilterByName(strAR繝輔ぅ繝ォ繧ソ蜷, out audioRenderer); + DsError.ThrowExceptionForHR(hr); + + hr = audioRenderer.FindPin(strAR繝斐ΦID, out inputAPin); + DsError.ThrowExceptionForHR(hr); + } + } + + public static void t繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ繧偵げ繝ゥ繝輔°繧蛾勁蜴サ縺吶k( IGraphBuilder graphBuilder ) + { + int hr = 0; + + IBaseFilter videoRenderer = null; + IPin renderInputPin = null; + IPin connectedOutputPin = null; + + try + { + // videoRenderer 繧呈爾縺吶 + + CDirectShow.t繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ縺ィ縺昴ョ蜈・蜉帙ヴ繝ウ繧呈爾縺励※霑斐☆( graphBuilder, out videoRenderer, out renderInputPin ); + if( videoRenderer == null || renderInputPin == null ) + return; // 縺ェ縺九▲縺 + + #region [ renderInputPin 縺ク謗・邯壹@縺ヲ縺繧句燕谿オ縺ョ蜃コ蜉帙ヴ繝ウ connectedOutputPin 繧呈爾縺吶 ] + //----------------- + renderInputPin.ConnectedTo( out connectedOutputPin ); + //----------------- + #endregion + + if( connectedOutputPin == null ) + return; // 縺ェ縺九▲縺 + + + // 蜑肴ョオ縺ョ蜃コ蜉帙ヴ繝ウ縺ィ繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ縺ョ蜈・蜉帙ヴ繝ウ繧貞譁ュ縺吶k縲ょ曙譁ケ蜷代°繧牙譁ュ縺励↑縺縺ィ繧ー繝ゥ繝輔°繧牙繧企屬縺輔l縺ェ縺縺ョ縺ァ豕ィ諢上 + + renderInputPin.Disconnect(); + connectedOutputPin.Disconnect(); + + + // 繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ繧偵げ繝ゥ繝輔°繧蛾勁蜴サ縲 + + graphBuilder.RemoveFilter( videoRenderer ); + } + finally + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref connectedOutputPin ); + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref renderInputPin ); + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref videoRenderer ); + } + } + + private static IPin t譛蛻昴ョ蜈・蜉帙ヴ繝ウ繧呈爾縺励※霑斐☆( IBaseFilter baseFilter ) + { + int hr = 0; + + IPin firstInputPin = null; + + IEnumPins ePins; + hr = baseFilter.EnumPins( out ePins ); + DsError.ThrowExceptionForHR( hr ); + try + { + var pins = new IPin[ 1 ]; + while( ePins.Next( 1, pins, IntPtr.Zero ) == CWin32.S_OK ) + { + PinInfo pinfo = new PinInfo() { filter = null }; + try + { + hr = pins[ 0 ].QueryPinInfo( out pinfo ); + DsError.ThrowExceptionForHR( hr ); + + if( pinfo.dir == PinDirection.Input ) + { + firstInputPin = pins[ 0 ]; + break; + } + } + finally + { + if( pinfo.filter != null ) + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref pinfo.filter ); + DsUtils.FreePinInfo( pinfo ); + + if( firstInputPin == null ) + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref pins[ 0 ] ); + } + } + } + finally + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref ePins ); + } + + return firstInputPin; + } + private static void t繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ縺ィ縺昴ョ蜈・蜉帙ヴ繝ウ繧呈爾縺励※霑斐☆( IFilterGraph graph, out IBaseFilter videoRenderer, out IPin inputPin ) + { + int hr = 0; + string str繝輔ぅ繝ォ繧ソ蜷 = null; + string str繝斐ΦID = null; + + + // 繝薙ョ繧ェ繝ャ繝ウ繝繝ゥ縺ィ蜈・蜉帙ヴ繝ウ繧呈爾縺励√◎縺ョ繝輔ぅ繝ォ繧ソ蜷阪→繝斐ΦID繧呈而縺医k縲 + + IEnumFilters eFilters; + hr = graph.EnumFilters( out eFilters ); + DsError.ThrowExceptionForHR( hr ); + try + { + var filters = new IBaseFilter[ 1 ]; + while( eFilters.Next( 1, filters, IntPtr.Zero ) == CWin32.S_OK ) + { + try + { + #region [ 蜃コ蜉帙ヴ繝ウ縺後↑縺シ医Ξ繝ウ繝繝ゥ縺ァ縺ゅkシ峨%縺ィ繧堤「コ隱阪☆繧九] + //----------------- + IEnumPins ePins; + bool b蜃コ蜉帙ヴ繝ウ縺後≠繧 = false; + + hr = filters[ 0 ].EnumPins( out ePins ); + DsError.ThrowExceptionForHR( hr ); + try + { + var pins = new IPin[ 1 ]; + while( ePins.Next( 1, pins, IntPtr.Zero ) == CWin32.S_OK ) + { + try + { + if( b蜃コ蜉帙ヴ繝ウ縺後≠繧 ) + continue; + + PinDirection dir; + hr = pins[ 0 ].QueryDirection( out dir ); + DsError.ThrowExceptionForHR( hr ); + if( dir == PinDirection.Output ) + b蜃コ蜉帙ヴ繝ウ縺後≠繧 = true; + } + finally + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref pins[ 0 ] ); + } + } + } + finally + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref ePins ); + } + + if( b蜃コ蜉帙ヴ繝ウ縺後≠繧 ) + continue; // 谺。縺ョ繝輔ぅ繝ォ繧ソ縺ク + + //----------------- + #endregion + #region [ 謗・邯壻クュ縺ョ蜈・蜉帙ヴ繝ウ縺 MEDIATYPE_Video 縺ォ蟇セ蠢懊@縺ヲ縺縺溘i縲√ヵ繧」繝ォ繧ソ蜷阪→繝斐ΦID繧貞叙蠕励☆繧九] + //----------------- + hr = filters[ 0 ].EnumPins( out ePins ); + DsError.ThrowExceptionForHR( hr ); + try + { + var pins = new IPin[ 1 ]; + while( ePins.Next( 1, pins, IntPtr.Zero ) == CWin32.S_OK ) + { + try + { + if( !string.IsNullOrEmpty( str繝輔ぅ繝ォ繧ソ蜷 ) ) + continue; + + var mediaType = new AMMediaType(); + + #region [ 迴セ蝨ィ謗・邯壻クュ縺ョ MediaType 繧貞叙蠕励ゅ▽縺ェ縺後▲縺ヲ縺ェ縺代l縺ー谺。縺ョ繝斐Φ縺ク縲] + //----------------- + hr = pins[ 0 ].ConnectionMediaType( mediaType ); + if( hr == CWin32.VFW_E_NOT_CONNECTED ) + continue; // 縺、縺ェ縺後▲縺ヲ縺ェ縺 + DsError.ThrowExceptionForHR( hr ); + //----------------- + #endregion + + try + { + if( mediaType.majorType.Equals( MediaType.Video ) ) + { + #region [ 繝輔ぅ繝ォ繧ソ蜷榊叙蠕暦シ‐ + //----------------- + FilterInfo filterInfo; + hr = filters[ 0 ].QueryFilterInfo( out filterInfo ); + DsError.ThrowExceptionForHR( hr ); + str繝輔ぅ繝ォ繧ソ蜷 = filterInfo.achName; + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref filterInfo.pGraph ); + //----------------- + #endregion + #region [ 繝斐ΦID蜿門セ暦シ‐ + //----------------- + hr = pins[ 0 ].QueryId( out str繝斐ΦID ); + DsError.ThrowExceptionForHR( hr ); + //----------------- + #endregion + + continue; // 谺。縺ョ繝斐Φ縺ク縲 + } + } + finally + { + DsUtils.FreeAMMediaType( mediaType ); + } + } + finally + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref pins[ 0 ] ); + } + } + } + finally + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref ePins ); + } + + //----------------- + #endregion + } + finally + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref filters[ 0 ] ); + } + } + } + finally + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref eFilters ); + } + + + // 謾ケ繧√※繝輔ぅ繝ォ繧ソ蜷阪→繝斐ΦID縺九i縺薙l繧峨ョ繧、繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ繧貞叙蠕励@縲∵綾繧雁、縺ィ縺励※霑斐☆縲 + + videoRenderer = null; + inputPin = null; + + if( !string.IsNullOrEmpty( str繝輔ぅ繝ォ繧ソ蜷 ) ) + { + hr = graph.FindFilterByName( str繝輔ぅ繝ォ繧ソ蜷, out videoRenderer ); + DsError.ThrowExceptionForHR( hr ); + + hr = videoRenderer.FindPin( str繝斐ΦID, out inputPin ); + DsError.ThrowExceptionForHR( hr ); + } + } + private static IBaseFilter t繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ繧呈爾縺励※霑斐☆( IFilterGraph graph ) + { + int hr = 0; + IBaseFilter audioRenderer = null; + + IEnumFilters eFilters; + hr = graph.EnumFilters( out eFilters ); + DsError.ThrowExceptionForHR( hr ); + try + { + var filters = new IBaseFilter[ 1 ]; + while( eFilters.Next( 1, filters, IntPtr.Zero ) == CWin32.S_OK ) + { + if( ( filters[ 0 ] as IAMAudioRendererStats ) != null ) + { + audioRenderer = filters[ 0 ]; + break; + } + + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref filters[ 0 ] ); + } + } + finally + { + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref eFilters ); + } + return audioRenderer; + } + + + #region [ 髱咏噪繧、繝ウ繧ケ繧ソ繝ウ繧ケ邂。逅 ] + //----------------- + public const int n繧、繝ウ繧ケ繧ソ繝ウ繧ケID縺ョ譛螟ァ謨ー = 100; + protected static Dictionary dic繧、繝ウ繧ケ繧ソ繝ウ繧ケ = new Dictionary(); // <繧、繝ウ繧ケ繧ソ繝ウ繧ケID, 縺昴ョID繧呈戟縺、繧、繝ウ繧ケ繧ソ繝ウ繧ケ> + + protected static void t繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧堤匳骭イ縺吶k( CDirectShow ds ) + { + for( int i = 1; i < CDirectShow.n繧、繝ウ繧ケ繧ソ繝ウ繧ケID縺ョ譛螟ァ謨ー; i++ ) + { + if( !CDirectShow.dic繧、繝ウ繧ケ繧ソ繝ウ繧ケ.ContainsKey( i ) ) // 遨コ縺縺ヲ縺繧狗分蜿キ繧剃スソ縺縲 + { + ds.n繧、繝ウ繧ケ繧ソ繝ウ繧ケID = i; + CDirectShow.dic繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Add( i, ds ); + break; + } + } + } + protected static void t繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧定ァ」謾セ縺吶k( int n繧、繝ウ繧ケ繧ソ繝ウ繧ケID ) + { + if( CDirectShow.dic繧、繝ウ繧ケ繧ソ繝ウ繧ケ.ContainsKey( n繧、繝ウ繧ケ繧ソ繝ウ繧ケID ) ) + CDirectShow.dic繧、繝ウ繧ケ繧ソ繝ウ繧ケ.Remove( n繧、繝ウ繧ケ繧ソ繝ウ繧ケID ); + } + //----------------- + #endregion + + #region [ Dispose-Finalize 繝代ち繝シ繝ウ螳溯」 ] + //----------------- + public virtual void Dispose() + { + this.Dispose( true ); + GC.SuppressFinalize( this ); // 縺。繧繧薙→ Dispose 縺輔l縺溘ョ縺ァ縲√ヵ繧。繧、繝翫Λ繧、繧コ荳崎ヲ√〒縺ゅk縺薙→繧 CLR 縺ォ莨昴∴繧九 + } + protected virtual void Dispose( bool bManaged繝ェ繧ス繝シ繧ケ繧りァ」謾セ縺吶k ) + { + if( bManaged繝ェ繧ス繝シ繧ケ繧りァ」謾セ縺吶k ) + { + #region [ ROT縺九i隗」謾セ縺吶k縲] + //----------------- +#if DEBUG + C蜈ア騾.tDispose縺吶k( ref this.rot ); +#endif + //----------------- + #endregion + + CDirectShow.t繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧定ァ」謾セ縺吶k( this.n繧、繝ウ繧ケ繧ソ繝ウ繧ケID ); + } + + #region [ 繧、繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ蜿らァ繧偵↑縺上@縲,OM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k縲 ] + //----------------- + if( this.ip != IntPtr.Zero ) + { + Marshal.FreeCoTaskMem( this.ip ); + this.ip = IntPtr.Zero; + } + + if( this.MediaCtrl != null ) + { + this.MediaCtrl.Stop(); + this.MediaCtrl = null; + } + + if( this.MediaEventEx != null ) + { + this.MediaEventEx.SetNotifyWindow( IntPtr.Zero, 0, IntPtr.Zero ); + this.MediaEventEx = null; + } + + if( this.MediaSeeking != null ) + this.MediaSeeking = null; + + if( this.BasicAudio != null ) + this.BasicAudio = null; + + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref this.nullRenderer ); + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref this.memoryRenderer ); + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref this.memoryRendererObject ); + C蜈ア騾.tCOM繧ェ繝悶ず繧ァ繧ッ繝医r隗」謾セ縺吶k( ref this.graphBuilder ); + //----------------- + #endregion + + C蜈ア騾.t螳悟ィ縺ェ繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ滓命縺吶k(); + } + ~CDirectShow() + { + // 繝輔ぃ繧、繝翫Λ繧、繧カ縺悟他縺ー繧後◆縺ィ縺縺縺薙→縺ッ縲.ispose() 縺輔l縺ェ縺九▲縺溘→縺縺縺薙→縲 + // 縺薙ョ蝣エ蜷医`anaged 繝ェ繧ス繝シ繧ケ縺ッ蜈医↓繝輔ぃ繧、繝翫Λ繧、繧コ縺輔l縺ヲ縺繧句庄閭ス諤ァ縺後≠繧九ョ縺ァ縲ゞnmamaed 繝ェ繧ス繝シ繧ケ縺ョ縺ソ繧定ァ」謾セ縺吶k縲 + + this.Dispose( false ); + } + //----------------- + #endregion + + #region [ protected ] + //----------------- + protected MemoryRenderer memoryRendererObject = null; + protected IMemoryRenderer memoryRenderer = null; + protected IBaseFilter nullRenderer = null; + protected int n蜀咲函荳譎ょ●豁「蜻シ縺ウ蜃コ縺励ョ邏ッ遨榊屓謨ー = 0; + //----------------- + #endregion + + #region [ private ] + //----------------- + private int _n髻ウ驥 = 100; +#if DEBUG + private DsROTEntry rot = null; +#endif + + // 蜿ッ閭ス縺ェ謨ー縺ョ繧ケ繝ャ繝繝峨r菴ソ逕ィ縺励※逕サ蜒上r霆「騾√☆繧九ょ、ァ縺阪>逕サ蜒上⊇縺ゥ譛牙柑縲ょ、壹☆縺弱k縺ィ繝励シ繝ォ蜀縺ョ繧ケ繝ャ繝繝峨′遨コ縺上∪縺ァ蠕縺溘&繧後k縺ョ縺ァ豕ィ諢上 + private static int n荳ヲ蛻怜コヲ = 0; // 0 縺ョ蝣エ蜷医∵怙蛻昴ョ逕滓先凾縺ォ荳ヲ蛻怜コヲ繧呈アコ螳壹☆繧九 + + private DG繝ゥ繧、繝ウ謠冗判[] dg繝ゥ繧、繝ウ謠冗判ARGB32; + private DG繝ゥ繧、繝ウ謠冗判[] dg繝ゥ繧、繝ウ謠冗判XRGB32; + private unsafe delegate void DG繝ゥ繧、繝ウ謠冗判( int n ); + private unsafe byte* ptrSnap = null; + private unsafe UInt32** ptrTexture = null; + + private unsafe void t繝ゥ繧、繝ウ謠冗判XRGB32( int n ) + { + // Snap 縺ッ RGB32縲ゝexture縺ッ X8R8G8B8 + + UInt32* ptrTexture = this.ptrTexture[ n ]; + for( int y = n; y < this.n鬮倥&px; y += CDirectShow.n荳ヲ蛻怜コヲ ) + { + byte* ptrPixel = ptrSnap + ( ( ( this.n鬮倥&px - y ) - 1 ) * this.n繧ケ繧ュ繝」繝ウ繝ゥ繧、繝ウ蟷byte ); + + // 繧「繝ォ繝輔ぃ辟。隕悶↑縺ョ縺ァ荳諡ャ繧ウ繝斐シ縲CopyMemory() 縺ッ閾ェ蜑阪〒繝ォ繝シ繝怜ア暮幕縺吶k繧医j繧る溘>縲 + CWin32.CopyMemory( (void*) ptrTexture, (void*) ptrPixel, (uint) ( this.n蟷px * 4 ) ); + + ptrTexture += this.n蟷px * CDirectShow.n荳ヲ蛻怜コヲ; + } + } + private unsafe void t繝ゥ繧、繝ウ謠冗判ARGB32( int n ) + { + // Snap 縺ッ RGB32縲ゝexture縺ッ A8R8G8B8 + + UInt32* ptrTexture = this.ptrTexture[ n ]; + for( int y = n; y < this.n鬮倥&px; y += CDirectShow.n荳ヲ蛻怜コヲ ) + { + UInt32* ptrPixel = (UInt32*) ( ptrSnap + ( ( ( this.n鬮倥&px - y ) - 1 ) * this.n繧ケ繧ュ繝」繝ウ繝ゥ繧、繝ウ蟷byte ) ); + + //for( int x = 0; x < this.n蟷px; x++ ) + // *( ptrTexture + x ) = 0xFF000000 | *ptrPixel++; + // 竊薙Ν繝シ繝怜ア暮幕縺ォ繧医j鬮倬溷喧縲160fps 縺ョ譖イ縺 200fps 縺セ縺ァ荳翫′縺」縺溘 + + if( this.n蟷px == 0 ) goto LEXIT; + UInt32* pt = ptrTexture; + UInt32 nAlpha = 0xFF000000; + int d = ( this.n蟷px % 32 ); + + switch( d ) + { + case 1: goto L031; + case 2: goto L030; + case 3: goto L029; + case 4: goto L028; + case 5: goto L027; + case 6: goto L026; + case 7: goto L025; + case 8: goto L024; + case 9: goto L023; + case 10: goto L022; + case 11: goto L021; + case 12: goto L020; + case 13: goto L019; + case 14: goto L018; + case 15: goto L017; + case 16: goto L016; + case 17: goto L015; + case 18: goto L014; + case 19: goto L013; + case 20: goto L012; + case 21: goto L011; + case 22: goto L010; + case 23: goto L009; + case 24: goto L008; + case 25: goto L007; + case 26: goto L006; + case 27: goto L005; + case 28: goto L004; + case 29: goto L003; + case 30: goto L002; + case 31: goto L001; + } + + L000: *pt++ = nAlpha | *ptrPixel++; + L001: *pt++ = nAlpha | *ptrPixel++; + L002: *pt++ = nAlpha | *ptrPixel++; + L003: *pt++ = nAlpha | *ptrPixel++; + L004: *pt++ = nAlpha | *ptrPixel++; + L005: *pt++ = nAlpha | *ptrPixel++; + L006: *pt++ = nAlpha | *ptrPixel++; + L007: *pt++ = nAlpha | *ptrPixel++; + L008: *pt++ = nAlpha | *ptrPixel++; + L009: *pt++ = nAlpha | *ptrPixel++; + L010: *pt++ = nAlpha | *ptrPixel++; + L011: *pt++ = nAlpha | *ptrPixel++; + L012: *pt++ = nAlpha | *ptrPixel++; + L013: *pt++ = nAlpha | *ptrPixel++; + L014: *pt++ = nAlpha | *ptrPixel++; + L015: *pt++ = nAlpha | *ptrPixel++; + L016: *pt++ = nAlpha | *ptrPixel++; + L017: *pt++ = nAlpha | *ptrPixel++; + L018: *pt++ = nAlpha | *ptrPixel++; + L019: *pt++ = nAlpha | *ptrPixel++; + L020: *pt++ = nAlpha | *ptrPixel++; + L021: *pt++ = nAlpha | *ptrPixel++; + L022: *pt++ = nAlpha | *ptrPixel++; + L023: *pt++ = nAlpha | *ptrPixel++; + L024: *pt++ = nAlpha | *ptrPixel++; + L025: *pt++ = nAlpha | *ptrPixel++; + L026: *pt++ = nAlpha | *ptrPixel++; + L027: *pt++ = nAlpha | *ptrPixel++; + L028: *pt++ = nAlpha | *ptrPixel++; + L029: *pt++ = nAlpha | *ptrPixel++; + L030: *pt++ = nAlpha | *ptrPixel++; + L031: *pt++ = nAlpha | *ptrPixel++; + if( ( pt - ptrTexture ) < this.n蟷px ) goto L000; + + LEXIT: + ptrTexture += this.n蟷px * CDirectShow.n荳ヲ蛻怜コヲ; + } + } + //----------------- + #endregion + } +} diff --git a/FDK19/繧ウ繝シ繝/05.DirectShow/MemoryRenderer.cs b/FDK19/繧ウ繝シ繝/05.DirectShow/MemoryRenderer.cs new file mode 100644 index 00000000..06b4f24d --- /dev/null +++ b/FDK19/繧ウ繝シ繝/05.DirectShow/MemoryRenderer.cs @@ -0,0 +1,36 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; + +namespace FDK +{ + using HRESULT = Int32; + using BOOL = Int32; + + [ComImport, Guid( "CE3CE3EE-5C4E-4BDC-A467-C068E1FC3DA5" )] + public class MemoryRenderer // 菴輔b邯呎価縺励※縺ッ縺ェ繧峨↑縺縲 + { + // 菴輔b險倩ソー縺励※縺ッ縺ェ繧峨↑縺縲 + // 莉」繧上j縺ォ縲`emoryRenderer 縺ョ逕滓仙セ後√く繝」繧ケ繝医〒竊薙ョ繧、繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ繧貞叙蠕励☆繧九 + } + + [ComImport, Guid( "FFAA4A1A-D63D-4688-9C66-D18CA7B99488" ), InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] + public interface IMemoryRenderer + { + [PreserveSig] + HRESULT GetWidth( out long nWidht ); + + [PreserveSig] + HRESULT GetHeight( out long nHeight ); + + [PreserveSig] + HRESULT GetBufferSize( out long nBufferSize ); + + [PreserveSig] + HRESULT GetCurrentBuffer( IntPtr pBuffer, long nBufferSize ); + + [PreserveSig] + HRESULT IsBottomUp( out BOOL bBottomUp ); + } +} diff --git a/FDK19/繧ウ繝シ繝/06.Tempo/CBeatDetect.cs b/FDK19/繧ウ繝シ繝/06.Tempo/CBeatDetect.cs new file mode 100644 index 00000000..4b3b9734 --- /dev/null +++ b/FDK19/繧ウ繝シ繝/06.Tempo/CBeatDetect.cs @@ -0,0 +1,209 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using System.Threading; +using Un4seen.Bass; +//using Un4seen.BassAsio; +//using Un4seen.BassWasapi; +//using Un4seen.Bass.AddOn.Mix; +using Un4seen.Bass.AddOn.Fx; + +namespace FDK +{ + public class CBeatDetect : IDisposable + { + public struct stBeatPos + { + public float fBeatTime; + public int n蟆冗ッ逡ェ蜿キ; + public int nGrid; + public int n蟆冗ッ蜀Grid; + public bool b辟。蜉ケ; // + public bool b繝ャ繝シ繝ウ陦ィ遉コ縺吶k; // 譛ェ菴ソ逕ィ + + public stBeatPos( float _fBeatTime, int _n蟆冗ッ逡ェ蜿キ, int _nGrid, int _n蟆冗ッ蜀Grid, bool _b辟。蜉ケ, bool _b繝ャ繝シ繝ウ陦ィ遉コ縺吶k ) + { + fBeatTime = _fBeatTime; + n蟆冗ッ逡ェ蜿キ = _n蟆冗ッ逡ェ蜿キ; + nGrid = _nGrid; + n蟆冗ッ蜀Grid = _n蟆冗ッ蜀Grid; + b辟。蜉ケ = _b辟。蜉ケ; + b繝ャ繝シ繝ウ陦ィ遉コ縺吶k= _b繝ャ繝シ繝ウ陦ィ遉コ縺吶k; + } + } + + #region [ 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ ] + public CBeatDetect() + { + Initialize(); + } + public CBeatDetect( string _filename ) + { + this.filename = _filename; + Initialize(); + } + #endregion + #region [ 蛻晄悄蛹(繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ縺九i蜻シ縺ウ蜃コ縺輔l繧) ] + private void Initialize() + { + if ( this.listBeatPositions == null ) + { + this.listBeatPositions = new List(); + } + + #region [ BASS registration ] + // BASS.NET 繝ヲ繝シ繧カ逋サ骭イシBASS繧ケ繝励Λ繝繧キ繝・縺碁撼陦ィ遉コ縺ォ縺ェ繧具シ峨 + + BassNet.Registration( "dtx2013@gmail.com", "2X9181017152222" ); + #endregion + #region [ BASS Version Check ] + // BASS 縺ョ繝舌シ繧ク繝ァ繝ウ繝√ぉ繝繧ッ縲 + int nBASSVersion = Utils.HighWord( Bass.BASS_GetVersion() ); + if ( nBASSVersion != Bass.BASSVERSION ) + throw new DllNotFoundException( string.Format( "bass.dll 縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧翫∪縺({0})縲ゅ%縺ョ繝励Ο繧ー繝ゥ繝縺ッ繝舌シ繧ク繝ァ繝ウ{1}縺ァ蜍穂ス懊@縺セ縺吶", nBASSVersion, Bass.BASSVERSION ) ); + + int nBASSFXVersion = Utils.HighWord( BassFx.BASS_FX_GetVersion() ); + if ( nBASSFXVersion != BassFx.BASSFXVERSION ) + throw new DllNotFoundException( string.Format( "bass_fx.dll 縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧翫∪縺({0})縲ゅ%縺ョ繝励Ο繧ー繝ゥ繝縺ッ繝舌シ繧ク繝ァ繝ウ{1}縺ァ蜍穂ス懊@縺セ縺吶", nBASSFXVersion, BassFx.BASSFXVERSION ) ); + #endregion + + #region [ BASS 縺ョ險ュ螳壹] + //this.bIsBASSFree = true; + //Debug.Assert( Bass.BASS_SetConfig( BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0 ), // 0:BASS繧ケ繝医Μ繝シ繝縺ョ閾ェ蜍墓峩譁ー繧定。後o縺ェ縺縲(繧オ繧ヲ繝ウ繝牙コ蜉帙@縺ェ縺縺溘a) + // string.Format( "BASS_SetConfig() 縺ォ螟ア謨励@縺セ縺励◆縲[{0}", Bass.BASS_ErrorGetCode() ) ); + #endregion + #region [ BASS 縺ョ蛻晄悄蛹悶] + int n繝繝舌う繧ケ = 0; // 0:"no sound" 窶ヲ BASS 縺九i縺ッ繝繝舌う繧ケ縺ク繧「繧ッ繧サ繧ケ縺輔○縺ェ縺縲 + int n蜻ィ豕「謨ー = 44100; // 莉ョ豎コ繧√M繝繝舌う繧ケシ遺旺繝峨Λ繧、繝撰シ峨′繝阪う繝繧」繝悶↓蟇セ蠢懊@縺ヲ縺繧句捉豕「謨ー縺ァ縺ゅl縺ー菴輔〒繧ゅ>縺シ溘h縺縺縲ゅ>縺壹l縺ォ縺励mBASSMX縺ァ閾ェ蜍慕噪縺ォ繝ェ繧オ繝ウ繝励Μ繝ウ繧ー縺輔l繧九 + if ( !Bass.BASS_Init( n繝繝舌う繧ケ, n蜻ィ豕「謨ー, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero ) ) + throw new Exception( string.Format( "BASS 縺ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲(BASS_Init)[{0}]", Bass.BASS_ErrorGetCode().ToString() ) ); + #endregion + + #region [ 謖螳壹&繧後◆繧オ繧ヲ繝ウ繝峨ヵ繧。繧、繝ォ繧達ASS縺ァ繧ェ繝シ繝励Φ縺励∝ソ隕∵怙蟆城剞縺ョ諠蝣ア繧貞叙蠕励☆繧九] + //this.hBassStream = Bass.BASS_StreamCreateFile( this.filename, 0, 0, BASSFlag.BASS_STREAM_PRESCAN | BASSFlag.BASS_STREAM_DECODE ); + this.hBassStream = Bass.BASS_StreamCreateFile( this.filename, 0, 0, BASSFlag.BASS_STREAM_DECODE ); + if ( this.hBassStream == 0 ) + throw new Exception( string.Format( "{0}: 繧オ繧ヲ繝ウ繝峨せ繝医Μ繝シ繝縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲(BASS_StreamCreateFile)[{1}]", filename, Bass.BASS_ErrorGetCode().ToString() ) ); + + this.nTotalBytes = Bass.BASS_ChannelGetLength( this.hBassStream ); + + this.nTotalSeconds = Bass.BASS_ChannelBytes2Seconds( this.hBassStream, nTotalBytes ); + if ( !Bass.BASS_ChannelGetAttribute( this.hBassStream, BASSAttribute.BASS_ATTRIB_FREQ, ref fFreq ) ) + { + string errmes = string.Format( "繧オ繧ヲ繝ウ繝峨せ繝医Μ繝シ繝縺ョ蜻ィ豕「謨ー蜿門セ励↓螟ア謨励@縺セ縺励◆縲(BASS_ChannelGetAttribute)[{0}]", Bass.BASS_ErrorGetCode().ToString() ); + Bass.BASS_Free(); + throw new Exception( errmes ); + } + #endregion + } + #endregion + + /// + /// 譖イ蜈ィ菴薙ョ繝繝ウ繝昴r蜿門セ励☆繧 + /// + /// 繝繝ウ繝晏、 + /// 繝繝ウ繝晏、縺ョ遽蝗イ縺ッ70-300 + public float GetTempo() + { + fTempo = BassFx.BASS_FX_BPM_DecodeGet( + this.hBassStream, + 0, + nTotalSeconds, + ( 300 << 16 ) + 70, // MAX BPM=320, MIN BPM=70 + //0, + BASSFXBpm.BASS_FX_BPM_DEFAULT, //BASSFXBpm.BASS_FX_BPM_MULT2, + null, + IntPtr.Zero ); + return fTempo; + } + /// + /// 譖イ縺ョ荳驛ィ蛻縺ョ繝繝ウ繝昴r蜿門セ励☆繧 + /// + /// 髢句ァ倶ス咲スョ + /// 邨ゆコ菴咲スョ + /// 繝繝ウ繝晏、 + /// 繝繝ウ繝晏、縺ョ遽蝗イ縺ッ70-300 + public float GetTempo( double startSec, double endSec ) + { + fTempo = BassFx.BASS_FX_BPM_DecodeGet( + this.hBassStream, + startSec, + endSec, + ( 300 << 16 ) + 70, // MAX BPM=320, MIN BPM=70 + //0, + BASSFXBpm.BASS_FX_BPM_DEFAULT, //BASSFXBpm.BASS_FX_BPM_MULT2, + null, + IntPtr.Zero ); + return fTempo; + } + + + /// + /// Beat縺ョ讀懷コ菴咲スョ繧鱈ist縺ァ霑斐☆ + /// + /// Beat讀懷コ菴咲スョ鄒、 + public List GetBeatPositions() + { + #region [ BeatPosition譬シ邏阪Μ繧ケ繝医ョ蛻晄悄蛹 ] + if ( this.listBeatPositions != null ) + { + this.listBeatPositions.Clear(); + } + else + { + this.listBeatPositions = new List(); + } + #endregion + + BPMBEATPROC _beatProc = new BPMBEATPROC( GetBeat_ProgressCallback ); + + bool ret = BassFx.BASS_FX_BPM_BeatDecodeGet( + this.hBassStream, + 0, + nTotalSeconds, + //0, + BASSFXBpm.BASS_FX_BPM_DEFAULT, //BASSFXBpm.BASS_FX_BPM_MULT2, + _beatProc, + IntPtr.Zero ); + + return this.listBeatPositions; + } + + private void GetBeat_ProgressCallback( int channel, double beatpos, IntPtr user ) + { + stBeatPos sbp = new stBeatPos( + (float) beatpos, + 0, + 0, + 0, + false, + true + ); + + + listBeatPositions.Add( sbp ); +// Debug.WriteLine( "Beat at: " + beatpos.ToString() ); + } + + + + + public void Dispose() // 菴ソ縺邨ゅo縺」縺溘i蠢縺咼ispose()縺吶k縺薙→縲BASS縺ョ繝ェ繧ス繝シ繧ケ繧呈升繧翫▲縺ア縺ェ縺励↓縺吶k縺ィ縲∽サ悶ョ蜀咲函縺ォ荳埼ス蜷医′逕溘§繧九◆繧√ + { + BassFx.BASS_FX_BPM_Free( this.hBassStream ); + Bass.BASS_StreamFree( this.hBassStream ); + this.hBassStream = -1; + Bass.BASS_Free(); + } + + // ============= + private string filename = ""; + private int hBassStream = -1; + private long nTotalBytes = 0; + private double nTotalSeconds = 0.0f; + private float fFreq = 0.0f; + private float fTempo; + private List listBeatPositions = null; + } +} diff --git a/README.old.md b/README.old.md new file mode 100644 index 00000000..ac769ac7 --- /dev/null +++ b/README.old.md @@ -0,0 +1,35 @@ +# TJAPlayer3-Develop-ReWrite +DTXMania繧偵>縺倥▲縺ヲtja蜀咲函繝励Ο繧ー繝ゥ繝縺ォ縺励■繧縺」縺歇TJAPlayer2fPC](https://github.com/kairera0467/TJAP2fPC)繧巽ork縺励※譛ャ螳カ鬚ィ縺ォ謾ケ騾縺励◆ +[TJAPlayer3](https://github.com/AioiLight/TJAPlayer3)繧定カ譛ャ螳カ鬚ィ縺ォ謾ケ騾縺励◆繧「繝ャ繧呈嶌縺咲峩縺励◆繧ゅョ縲 + +縺薙ョ繝励Ο繧ー繝ゥ繝繧剃スソ逕ィ縺励◆荳榊キ蜷医サ蝠城。後↓縺、縺縺ヲ縺ッ雋ャ莉サ繧定イ縺縺九ュ縺セ縺吶 + +## How 2 Build +- VisualStudio 2017 & C# 7.3 +- VC++ toolset +- SlimDX逕ィ縺ョ鄂イ蜷 + +## 繝ゥ繧、繧サ繝ウ繧ケ髢「菫 +Fork蜈繧医j蠑慕畑縲 + +> 莉・荳九ョ繝ゥ繧、繝悶Λ繝ェ繧剃スソ逕ィ縺励※縺縺セ縺吶 +> * bass +> * Bass.Net +> * DirectShowLib +> * FDK21 +> * SlimDX +> * SharpDX +> * ReadJEnc +> * xadec +> * IPA繝輔か繝ウ繝 +> * libogg +> * libvorbis +> 縲悟ョ溯。梧凾繝輔か繝ォ繝/Licenses縲阪↓蜿朱鹸縺励※縺縺セ縺吶 +> +> 縺セ縺溘√%縺ョ繝励Ο繧ー繝ゥ繝縺ッFROM豌上ョ縲轡TXMania縲阪r蜈縺ォ陬ス菴懊@縺ヲ縺縺セ縺吶 + +## 繧ッ繝ャ繧ク繝繝 +> * [TwoPointZero/TJAPlayer3](https://github.com/twopointzero/TJAPlayer3)(@twopointzero) +> * [KabanFriends/TJAPlayer3](https://github.com/KabanFriends/TJAPlayer3/tree/features)(@KabanFriends) +> * [Mr-Ojii/TJAPlayer3-f](https://github.com/Mr-Ojii/TJAPlayer3-f)(@Mr-Ojii) +> * [Akasoko/TJAPlayer3](https://github.com/Akasoko-Master/TJAPlayer3)(@AkasokoR) diff --git a/Readme.txt b/Readme.txt new file mode 100644 index 00000000..dd0e3356 --- /dev/null +++ b/Readme.txt @@ -0,0 +1,79 @@ +サソ############ +TJAPlayer3 Readme.txt +############ +蜈ャ髢区律:2018/5/5 +譖エ譁ー譌・:2018/12/21 + +== 縺ッ縺倥a縺ォ == +TJAPlayer3繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ヲ縺縺溘□縺阪√≠繧翫′縺ィ縺縺斐*縺縺セ縺吶 +縺薙ョ繧キ繝溘Η繝ャ繝シ繧ソ縺ッ縲√い繝シ繧ア繝シ繝/螳カ蠎ュ逕ィ繧イ繝シ繝縲悟、ェ鮠薙ョ驕比ココ縲阪す繝ェ繝シ繧コ縺ョ繧キ繝溘Η繝ャ繝シ繧ソ縺ァ縺吶 +縺薙ョ繧キ繝溘Η繝ャ繝シ繧ソ縺ッ縲ゝJAPlayer2 forPC縺ィ縺縺繧キ繝溘Η繝ャ繝シ繧ソ繝シ繧呈隼騾縺励◆繧ゅョ縺ァ縺吶 +螟ェ鮠薙&繧捺ャ。驛弱サTJAPlayer遲峨〒菴ソ繧上l縺ヲ縺繧.tja繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ縺ソ縲√励Ξ繧、縺吶k縺薙→縺後〒縺阪∪縺吶 +(縺吶∋縺ヲ縺ョ.tja繝輔ぃ繧、繝ォ縺瑚ェュ縺ソ霎シ繧√k繧上¢縺ァ縺ッ縺ゅj縺セ縺帙s縲ゅ∪縺溘ゝJAPlayer3蛛エ縺ァ霑ス蜉縺励◆蜻ス莉、繧ゅ≠繧翫∪縺吶) +髢狗匱騾比クュ縺ョ繧キ繝溘Η繝ャ繝シ繧ソ縺ョ縺溘a縲∽ク榊キ蜷医d繝舌げ縺後≠繧句エ蜷医′縺ゅj縺セ縺吶ゅ#莠謇ソ縺上□縺輔>縲 +(繧ゅ@荳榊キ蜷医r隕九▽縺代◆蝣エ蜷医ッ縲;itHub縺ョissue繧Уwitter縺ァ騾」邨。縺励※縺上□縺輔k縺ィ縲∝、ァ螟牙勧縺九j縺セ縺吶) + +== 菴ソ逕ィ荳翫ョ豕ィ諢 == +繝サTJAPlayer3縺ッ繧ェ繝シ繝励Φ繧ス繝シ繧ケ繧ス繝輔ヨ繧ヲ繧ァ繧「(MIT)縺ァ縺吶 +繝サ縺薙ョ繧キ繝溘Η繝ャ繝シ繧ソ繧剃スソ逕ィ縺吶k蝣エ蜷医ッ縲**蜈ィ縺ヲ閾ェ蟾ア雋ャ莉サ**縺ァ縺企。倥>縺励∪縺吶 +繝サ隱ャ譏取嶌繧縲√ラ繧ュ繝・繝。繝ウ繝医r隕九l縺ー隗」豎コ縺ァ縺阪k雉ェ蝠上′繧医¥譚・縺セ縺吶ゆココ縺ォ雉ェ蝠上☆繧句燕縺ォ縲√∪縺壹ッ閾ェ蛻縺ァ隱ソ縺ケ繧九%縺ィ繧偵@縺ヲ縺上□縺輔>縲 +繝サ繝励Ο繧ー繝ゥ繝縺ョ蛻カ菴懆(AioiLight)縺ッ縲ゝJAPlayer3譛ャ菴(AioiLight.space縺九i繝繧ヲ繝ウ繝ュ繝シ繝峨@縺溘b縺ョ)縺ィ繝繝輔か繝ォ繝医ョ繧ケ繧ュ繝ウ縲郡impleStyle縲阪ョ繧オ繝昴シ繝医ョ縺ソ陦後>縺セ縺吶 +縲縺昴ョ莉悶ョ繧ケ繧ュ繝ウ(萓:譛ャ螳カ鬚ィ繧ケ繧ュ繝ウ)繧縲ゝJAPlayer3縺ョ謾ケ騾蜩(豢セ逕溘ン繝ォ繝)縺ョ繧オ繝昴シ繝医ッ蜴溷援陦後>縺セ縺帙s縺ョ縺ァ縺比コ謇ソ縺上□縺輔>縲 +繝サ縺吶∋縺ヲ縺ョ迺ー蠅縺ァ蜍穂ス懃「コ隱阪ッ縺ァ縺阪↑縺(縺ァ縺阪k縺ッ縺壹′縺ェ縺)縺ョ縺ァ縲∝虚縺縺溘i驕九′縺縺縲∫ィ句コヲ縺ァ縺企。倥>縺励∪縺吶 +縲繝峨く繝・繝。繝ウ繝医r隱ュ繧薙〒繧りァ」豎コ縺励↑縺九▲縺溘i縲∬ォヲ繧√∪縺励g縺縲りォヲ繧√b閧晏ソ縺ァ縺吶 +繝サ蟶ク譎60fps繧剃ソ昴※縺ェ縺ПC縺ァ縺ョ蜍穂ス懊ッ譛溷セ縺ァ縺阪∪縺帙s縲 + +== 謫堺ス懈婿豕輔∵峇縺ョ霑ス蜉譁ケ豕輔∵峩譁ー諠蝣ア縺ェ縺ゥ == +https://aioilight.space/taiko/tjap3/ +繝峨く繝・繝。繝ウ繝医↓諠蝣ア縺碁寔繧√i繧後※縺繧九ョ縺ァ縲√◎繧後r縺願ェュ縺ソ縺上□縺輔>縲る囂譎よ峩譁ー縺励※縺縺セ縺吶 + +== 繝繝輔か繝ォ繝医せ繧ュ繝ウ(SimpleStyle)縺ォ縺、縺縺ヲ == +荳驛ィ逕サ蜒上ッTJAPlayer2 forPC縺ョ繝繝輔か繝ォ繝医せ繧ュ繝ウ縺九i豬∫畑縺励※縺縺セ縺吶 +繝ゥ繧、繧サ繝ウ繧ケ縺ッMIT縺ョ繧ゅ→驕狗畑縺励※縺縺セ縺吶MIT繝ゥ繧、繧サ繝ウ繧ケ繧貞宍螳医☆繧句エ蜷医∵隼螟峨驟榊ク遲碓K縺ァ縺吶 +菴懈舌ヤ繝シ繝ォ: Photoshop/After Effects + +== 蜍慕判縲驟堺ソ。遲峨〒縺ョ縺泌茜逕ィ縺ォ縺、縺縺ヲ == +TJAPlayer3繧貞虚逕サ蜈ア譛峨し繧、繝医d繝ゥ繧、繝夜堺ソ。繧オ繝シ繝薙せ縲√え繧ァ繝悶し繧、繝医d繝悶Ο繧ー遲峨〒縺泌茜逕ィ縺ォ縺ェ繧峨l繧句エ蜷医 +繝舌Φ繝繧、繝翫Β繧ウ繧ィ繝ウ繧ソ繝シ繝繧、繝ウ繝。繝ウ繝亥ャ蠑上ョ繧ゅョ縺ァ縺ェ縺縺薙→縲∽サ悶ョ螟ェ鮠薙ョ驕比ココ繧キ繝溘Η繝ャ繝シ繧ソ繝シ縺ィ豺キ蜷後@縺ェ縺繧医≧驟肴ョ繧偵♀鬘倥>縺縺溘@縺セ縺吶 +縺セ縺溘√ち繧ー讖溯ス縺ョ縺ゅk繧オ繧、繝医ョ蝣エ蜷医√卦JAPlayer3縲阪卦JAP3縲阪→縺縺」縺溘ち繧ー繧剃サ倥¢繧九%縺ィ縺ァ縲 +莉悶す繝溘Η繝ャ繝シ繧ソ縺ィ縺ョ隱、隗」繧帝亟縺舌→縺ィ繧ゅ↓縲髢「騾」蜍慕判縺ィ縺励※蜃コ繧縺吶¥縺ェ繧九Γ繝ェ繝繝医′縺ゅk縺溘a縲∵耳螂ィ縺励∪縺吶 + +== TJAPlayer3縺ョ謾ケ騾繝サ蜀埼榊ク(莠梧ャ。驟榊ク)繧定。後≧蝣エ蜷医↓縺、縺縺ヲ == +TJAPlayer3縲√ョ繝輔か繝ォ繝医せ繧ュ繝ウ縺ッMIT繝ゥ繧、繧サ繝ウ繧ケ縺ァ蛻カ菴懊&繧後※縺縺セ縺吶 +MIT繝ゥ繧、繧サ繝ウ繧ケ縺ョ繝ォ繝シ繝ォ縺ョ繧ゅ→縲∵隼騾繝サ蜀埼榊ク繧定。後≧縺薙→縺ッ閾ェ逕ア縺ァ縺吶′縲**蜈ィ縺ヲ閾ェ蟾ア雋ャ莉サ**縺ァ縺企。倥>縺励∪縺吶 +縺セ縺溘∽スソ逕ィ縺励※縺繧九Λ繧、繝悶Λ繝ェ縺ョ繝ゥ繧、繧サ繝ウ繧ケ荳翫**蠢縺**縲鍬icenses縲阪ヵ繧ゥ繝ォ繝繧貞酔譴ア縺ョ荳翫∵隼騾繝サ蜀埼榊ク繧偵♀鬘倥>縺励∪縺吶 +螟夜Κ繧ケ繧ュ繝ウ繧縲∬ュ憺擇繝代ャ繧ア繝シ繧ク繧貞酔譴ア縺吶k蝣エ蜷医ッ縲√◎繧後◇繧後ョ蛻カ菴懆縺ョ繝ォ繝シ繝ォ繧隕冗エ繧貞ョ医▲縺ヲ縺上□縺輔>縲 +縺薙l繧峨↓TJAPlayer3縺ョ繝ゥ繧、繧サ繝ウ繧ケ縺ッ驕ゥ逕ィ縺輔l縺セ縺帙s縲 + +== 繧ケ繝壹す繝」繝ォ繧オ繝ウ繧ッ繧ケ == +FROM豌/yyagi豌 - DTXMania 髢狗匱閠 +kairera0467豌 - TJAPlayer2 forPC 髢狗匱閠 +繧阪∩繧ス橸シ滓ー - 繝舌げ蝣ア蜻翫∽ク榊キ蜷亥ア蜻 +繧ウ繝シ繧キ繝シ豌 - 繝舌げ蝣ア蜻翫∽ク榊キ蜷亥ア蜻 +twopointzero豌 - 繝励Ο繧ー繝ゥ繝縺ョ譛驕ゥ蛹 + + +== 荳榊キ蜷亥ア蜻翫騾」邨。蜈医↑縺ゥ == + +=== 譌「遏・縺ョ蝠城。檎せ === +繝サ譌・譛ャ隱樒腸蠅縺ァ繧ゅ励Ο繧ー繝ゥ繝蜀驛ィ縺ァ縺ッ闍ア隱樒腸蠅縺ィ隱崎ュ倥&繧後※繧キ繧ケ繝繝繝。繝繧サ繝シ繧ク縺後⊇縺シ闍ア隱槭〒縺吶 竊歎er.1.5.6縺九i譌・譛ャ隱樒腸蠅縺ョ蝣エ蜷医ッ譌・譛ャ隱槭〒陦ィ遉コ縺輔l繧九h縺縺ォ縺ェ繧翫∪縺励◆縲 +繝サ繝繝ウ繧オ繝シ縲√Δ繝悶√Λ繝ウ繝翫シ逕サ蜒上ョ繧オ繧、繧コ縺悟、ァ縺阪>縺ィ迸ャ髢鍋噪縺ォ繧ォ繧ッ縺、縺上°繧ゅ@繧後∪縺帙s縲ゅ%繧後↓縺、縺縺ヲ縺ッ荳蠎ヲ蜀咲函縺吶k縺ィ逶エ繧翫∪縺吶や巽astRender繧丹N縺ォ縺吶l縺ー螟ァ謚オ縺ョPC縺ァ縺ッ繧ォ繧ッ縺、縺九★縺ォ蜀咲函縺輔l縺セ縺吶 +繝サ蜻ス莉、縺ィ蛟、縺ョ髢薙↓蜊願ァ偵せ繝壹シ繧ケ縺悟・縺」縺ヲ縺ェ縺縺ィ豁」蟶ク縺ォ蜀咲函縺輔l縺セ縺帙s縲(e.g. #SCROLL1.5) +繝サ荳譖イ蜀咲函蠕後ョ譖イ縺ョ繧ス繝シ繝医′縺ァ縺阪∪縺帙s縲や剃ソョ豁」縺輔l縺セ縺励◆縲 +繝サ繧繧顔峩縺玲凾縺ォ縺オ縺縺帙s縺梧カ医∴縺セ縺吶 +繝サ隴憺擇蛻蟯舌ョ荳榊キ蜷医′縺縺上▽縺区ョ九▲縺溘∪縺セ縺ァ縺吶 + +=== 雉ェ蝠上r縺吶k蜑阪↓ === +雉ェ蝠上r縺吶k蜑阪↓縲 +1.隱ソ縺ケ繧句燕縺ォ閠縺医k +2.莠コ縺ォ閨槭¥蜑阪↓隱ソ縺ケ繧 +3.驕主悉縺ォ蜷後§繧医≧縺ェ雉ェ蝠上′縺ェ縺九▲縺溘°隱ソ縺ケ繧 +4.菴ソ逕ィ縺励※縺繧九ヱ繧ス繧ウ繝ウ縺ョ迺ー蠅縲√←縺縺縺蜍穂ス懊r縺励◆繧我ク榊キ蜷医r襍キ縺薙@縺溘°縺ョ驕守ィ狗ュ峨r豺サ縺医※騾」邨。縺吶k +縺薙ョ4縺、縺ョ繝ォ繝シ繝ォ繧貞ョ医▲縺ヲ縺縺溘□縺代l縺ー蟷ク縺縺ァ縺吶ゅ←縺縺九h繧阪@縺上♀縺ュ縺後>縺励∪縺吶 + +=== 蜷騾」邨。蜈 === +荳榊キ蜷亥ア蜻翫∵眠隕乗ゥ溯ス霑ス蜉縺ョ繝ェ繧ッ繧ィ繧ケ繝育ュ峨∝、ァ豁楢ソ弱〒縺吶 +Twitter: @TJAPlayer3 +繝。繝シ繝ォ: info@aioilight.space +Discord: AioiLight#7839 +GitHub: https://github.com/AioiLight/TJAPlayer3 diff --git a/TJAPlayer3.sln b/TJAPlayer3.sln new file mode 100644 index 00000000..ca03a716 --- /dev/null +++ b/TJAPlayer3.sln @@ -0,0 +1,45 @@ +サソ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30621.155 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TJAPlayer3", "TJAPlayer3\TJAPlayer3.csproj", "{81BEC512-8074-4BD1-8A3C-AC73BC7BF846}" + ProjectSection(ProjectDependencies) = postProject + {BCD40908-F3E2-4707-BFAA-1DD99DF6357D} = {BCD40908-F3E2-4707-BFAA-1DD99DF6357D} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FDK19", "FDK19\FDK19.csproj", "{BCD40908-F3E2-4707-BFAA-1DD99DF6357D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8559AC0D-9443-4CF6-A376-B72664B2DC0B}" + ProjectSection(SolutionItems) = preProject + Readme.txt = Readme.txt + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {81BEC512-8074-4BD1-8A3C-AC73BC7BF846}.Debug|x86.ActiveCfg = Debug|x86 + {81BEC512-8074-4BD1-8A3C-AC73BC7BF846}.Debug|x86.Build.0 = Debug|x86 + {81BEC512-8074-4BD1-8A3C-AC73BC7BF846}.Release|x86.ActiveCfg = Release|x86 + {81BEC512-8074-4BD1-8A3C-AC73BC7BF846}.Release|x86.Build.0 = Release|x86 + {BCD40908-F3E2-4707-BFAA-1DD99DF6357D}.Debug|x86.ActiveCfg = Debug|x86 + {BCD40908-F3E2-4707-BFAA-1DD99DF6357D}.Debug|x86.Build.0 = Debug|x86 + {BCD40908-F3E2-4707-BFAA-1DD99DF6357D}.Release|x86.ActiveCfg = Release|x86 + {BCD40908-F3E2-4707-BFAA-1DD99DF6357D}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {20D6B8F0-EEEF-4E88-BC6A-DC1FF10E5AEA} + EndGlobalSection + GlobalSection(Performance) = preSolution + HasPerformanceSessions = true + EndGlobalSection + GlobalSection(Performance) = preSolution + HasPerformanceSessions = true + EndGlobalSection +EndGlobal diff --git a/TJAPlayer3/Animations/Animator.cs b/TJAPlayer3/Animations/Animator.cs new file mode 100644 index 00000000..995946e8 --- /dev/null +++ b/TJAPlayer3/Animations/Animator.cs @@ -0,0 +1,119 @@ +サソusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using TJAPlayer3; +using FDK; + +namespace TJAPlayer3.Animations +{ + class Animator : IAnimatable + { + public Animator(int startValue, int endValue, int tickInterval, bool isLoop) + { + Type = CounterType.Normal; + StartValue = startValue; + EndValue = endValue; + TickInterval = tickInterval; + IsLoop = isLoop; + Counter = new CCounter(); + } + public Animator(double startValue, double endValue, double tickInterval, bool isLoop) + { + Type = CounterType.Double; + StartValue = startValue; + EndValue = endValue; + TickInterval = tickInterval; + IsLoop = isLoop; + Counter = new CCounter(); + } + public void Start() + { + if (Counter == null) throw new NullReferenceException(); + switch (Type) + { + case CounterType.Normal: + Counter.t髢句ァ((int)StartValue, (int)EndValue, (int)TickInterval, TJAPlayer3.Timer); + break; + case CounterType.Double: + Counter.t髢句ァ((double)StartValue, (double)EndValue, (double)TickInterval, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + break; + default: + break; + } + } + public void Stop() + { + if (Counter == null) throw new NullReferenceException(); + Counter.t蛛懈ュ「(); + } + public void Reset() + { + if (Counter == null) throw new NullReferenceException(); + Start(); + } + + public void Tick() + { + if (Counter == null) throw new NullReferenceException(); + switch (Type) + { + case CounterType.Normal: + if (IsLoop) Counter.t騾イ陦鍬oop(); else Counter.t騾イ陦(); + if (!IsLoop && Counter.b邨ゆコ蛟、縺ォ驕斐@縺) Stop(); + break; + case CounterType.Double: + if (IsLoop) Counter.t騾イ陦鍬oopDb(); else Counter.t騾イ陦慧b(); + if (!IsLoop && Counter.b邨ゆコ蛟、縺ォ驕斐@縺) Stop(); + break; + default: + break; + } + } + + public virtual object GetAnimation() + { + throw new NotImplementedException(); + } + + + + // 繝励Ο繝代ユ繧」 + public CCounter Counter + { + get; + private set; + } + public CounterType Type + { + get; + private set; + } + public object StartValue + { + get; + private set; + } + public object EndValue + { + get; + private set; + } + public object TickInterval + { + get; + private set; + } + public bool IsLoop + { + get; + private set; + } + } + + enum CounterType + { + Normal, + Double + } +} diff --git a/TJAPlayer3/Animations/EaseIn.cs b/TJAPlayer3/Animations/EaseIn.cs new file mode 100644 index 00000000..a8031c32 --- /dev/null +++ b/TJAPlayer3/Animations/EaseIn.cs @@ -0,0 +1,38 @@ +サソusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace TJAPlayer3.Animations +{ + /// + /// 繧、繝シ繧コ繧、繝ウ繧定。後≧繧ッ繝ゥ繧ケ縲 + /// + class EaseIn : Animator + { + /// + /// 繧、繝シ繧コ繧、繝ウ繧貞晄悄蛹悶@縺セ縺吶 + /// + /// 蟋狗せ縲 + /// 邨らせ縲 + /// 繧、繝シ繧ク繝ウ繧ー縺ォ縺九¢繧区凾髢薙 + public EaseIn(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false) + { + StartPoint = startPoint; + EndPoint = endPoint; + Sa = EndPoint - StartPoint; + TimeMs = timeMs; + } + + public override object GetAnimation() + { + var persent = Counter.n迴セ蝨ィ縺ョ蛟、 / (double)TimeMs; + return ((double)Sa * persent * persent * persent) + StartPoint; + } + + private readonly int StartPoint; + private readonly int EndPoint; + private readonly int Sa; + private readonly int TimeMs; + } +} diff --git a/TJAPlayer3/Animations/EaseInOut.cs b/TJAPlayer3/Animations/EaseInOut.cs new file mode 100644 index 00000000..2b077582 --- /dev/null +++ b/TJAPlayer3/Animations/EaseInOut.cs @@ -0,0 +1,46 @@ +サソusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace TJAPlayer3.Animations +{ + /// + /// 繧、繝シ繧コ繧、繝ウ繝サ繧「繧ヲ繝医r陦後≧繧ッ繝ゥ繧ケ縲 + /// + class EaseInOut : Animator + { + /// + /// 繧、繝シ繧コ繧、繝ウ繝サ繧「繧ヲ繝医r蛻晄悄蛹悶@縺セ縺吶 + /// + /// 蟋狗せ縲 + /// 邨らせ縲 + /// 繧、繝シ繧ク繝ウ繧ー縺ォ縺九¢繧区凾髢薙 + public EaseInOut(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false) + { + StartPoint = startPoint; + EndPoint = endPoint; + Sa = EndPoint - StartPoint; + TimeMs = timeMs; + } + + public override object GetAnimation() + { + var persent = Counter.n迴セ蝨ィ縺ョ蛟、 / (double)TimeMs * 2.0; + if (persent < 1) + { + return ((double)Sa / 2.0 * persent * persent * persent) + StartPoint; + } + else + { + persent -= 2; + return ((double)Sa / 2.0 * ((persent * persent * persent) + 2)) + StartPoint; + } + } + + private readonly int StartPoint; + private readonly int EndPoint; + private readonly int Sa; + private readonly int TimeMs; + } +} diff --git a/TJAPlayer3/Animations/EaseOut.cs b/TJAPlayer3/Animations/EaseOut.cs new file mode 100644 index 00000000..3e6a03f9 --- /dev/null +++ b/TJAPlayer3/Animations/EaseOut.cs @@ -0,0 +1,39 @@ +サソusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace TJAPlayer3.Animations +{ + /// + /// 繧、繝シ繧コ繧「繧ヲ繝医r陦後≧繧ッ繝ゥ繧ケ縲 + /// + class EaseOut : Animator + { + /// + /// 繧、繝シ繧コ繧「繧ヲ繝医r蛻晄悄蛹悶@縺セ縺吶 + /// + /// 蟋狗せ縲 + /// 邨らせ縲 + /// 繧、繝シ繧ク繝ウ繧ー縺ォ縺九¢繧区凾髢薙 + public EaseOut(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false) + { + StartPoint = startPoint; + EndPoint = endPoint; + Sa = EndPoint - StartPoint; + TimeMs = timeMs; + } + + public override object GetAnimation() + { + var persent = Counter.n迴セ蝨ィ縺ョ蛟、 / (double)TimeMs; + persent -= 1; + return (double)Sa * (persent * persent * persent + 1) + StartPoint; + } + + private readonly int StartPoint; + private readonly int EndPoint; + private readonly int Sa; + private readonly int TimeMs; + } +} diff --git a/TJAPlayer3/Animations/FadeIn.cs b/TJAPlayer3/Animations/FadeIn.cs new file mode 100644 index 00000000..9e4a3521 --- /dev/null +++ b/TJAPlayer3/Animations/FadeIn.cs @@ -0,0 +1,34 @@ +サソusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace TJAPlayer3.Animations +{ + /// + /// 繝輔ぉ繝シ繝峨う繝ウ繧定。後≧繧ッ繝ゥ繧ケ縲 + /// + internal class FadeIn : Animator + { + /// + /// 繝輔ぉ繝シ繝峨う繝ウ繧貞晄悄蛹悶@縺セ縺吶 + /// + /// 繝輔ぉ繝シ繝峨う繝ウ縺ォ謗帙¢繧狗ァ呈焚(繝溘Μ遘) + public FadeIn(int timems) : base(0, timems - 1, 1, false) + { + TimeMs = timems; + } + + /// + /// 繝輔ぉ繝シ繝峨う繝ウ縺ョ荳埼乗主コヲ繧255谿オ髫弱〒霑斐@縺セ縺吶 + /// + /// 荳埼乗主コヲ縲 + public override object GetAnimation() + { + var opacity = base.Counter.n迴セ蝨ィ縺ョ蛟、 * 255 / TimeMs; + return opacity; + } + + private readonly int TimeMs; + } +} diff --git a/TJAPlayer3/Animations/FadeOut.cs b/TJAPlayer3/Animations/FadeOut.cs new file mode 100644 index 00000000..87989cf5 --- /dev/null +++ b/TJAPlayer3/Animations/FadeOut.cs @@ -0,0 +1,34 @@ +サソusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace TJAPlayer3.Animations +{ + /// + /// 繝輔ぉ繝シ繝峨い繧ヲ繝医r陦後≧繧ッ繝ゥ繧ケ縲 + /// + internal class FadeOut : Animator + { + /// + /// 繝輔ぉ繝シ繝峨い繧ヲ繝医r蛻晄悄蛹悶@縺セ縺吶 + /// + /// 繝輔ぉ繝シ繝峨い繧ヲ繝医↓謗帙¢繧狗ァ呈焚(繝溘Μ遘) + public FadeOut(int timems) : base(0, timems - 1, 1, false) + { + TimeMs = timems; + } + + /// + /// 繝輔ぉ繝シ繝峨い繧ヲ繝医ョ荳埼乗主コヲ繧255谿オ髫弱〒霑斐@縺セ縺吶 + /// + /// 荳埼乗主コヲ縲 + public override object GetAnimation() + { + var opacity = (TimeMs - base.Counter.n迴セ蝨ィ縺ョ蛟、) * 255 / TimeMs; + return opacity; + } + + private readonly int TimeMs; + } +} diff --git a/TJAPlayer3/Animations/IAnimatable.cs b/TJAPlayer3/Animations/IAnimatable.cs new file mode 100644 index 00000000..4e09befa --- /dev/null +++ b/TJAPlayer3/Animations/IAnimatable.cs @@ -0,0 +1,35 @@ +サソusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace TJAPlayer3.Animations +{ + /// + /// 繧「繝九Γ繝シ繧キ繝ァ繝ウ 繧、繝ウ繧ソ繝シ繝輔ぉ繧、繧ケ縲 + /// + interface IAnimatable + { + /// + /// 繧「繝九Γ繝シ繧キ繝ァ繝ウ繧帝幕蟋九@縺セ縺吶 + /// + void Start(); + /// + /// 繧「繝九Γ繝シ繧キ繝ァ繝ウ繧貞●豁「縺励∪縺吶 + /// + void Stop(); + /// + /// 繧「繝九Γ繝シ繧キ繝ァ繝ウ繧偵Μ繧サ繝繝医@縺セ縺吶 + /// + void Reset(); + /// + /// 繧「繝九Γ繝シ繧キ繝ァ繝ウ縺ョ騾イ陦後r陦後>縺セ縺吶 + /// + void Tick(); + /// + /// 繧「繝九Γ繝シ繧キ繝ァ繝ウ縺ョ繝代Λ繝。繝シ繧ソ繧定ソ斐@縺セ縺吶 + /// + /// 繧「繝九Γ繝シ繧キ繝ァ繝ウ縺ョ繝代Λ繝。繝シ繧ソ繧定ソ斐@縺セ縺吶 + object GetAnimation(); + } +} diff --git a/TJAPlayer3/Animations/Linear.cs b/TJAPlayer3/Animations/Linear.cs new file mode 100644 index 00000000..c6d0b6f9 --- /dev/null +++ b/TJAPlayer3/Animations/Linear.cs @@ -0,0 +1,38 @@ +サソusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace TJAPlayer3.Animations +{ + /// + /// 繝ェ繝九い遘サ蜍輔r陦後≧繧ッ繝ゥ繧ケ縲 + /// + class Linear : Animator + { + /// + /// 繝ェ繝九い遘サ蜍輔r蛻晄悄蛹悶@縺セ縺吶 + /// + /// 蟋狗せ縲 + /// 邨らせ縲 + /// 遘サ蜍輔↓縺九¢繧区凾髢薙 + public Linear(int startPoint, int endPoint, int timeMs) : base(0, timeMs, 1, false) + { + StartPoint = startPoint; + EndPoint = endPoint; + Sa = EndPoint - StartPoint; + TimeMs = timeMs; + } + + public override object GetAnimation() + { + var persent = Counter.n迴セ蝨ィ縺ョ蛟、 / (double)TimeMs; + return (Sa * persent) + StartPoint; + } + + private readonly int StartPoint; + private readonly int EndPoint; + private readonly int Sa; + private readonly int TimeMs; + } +} diff --git a/TJAPlayer3/Common/CActFlushGPU.cs b/TJAPlayer3/Common/CActFlushGPU.cs new file mode 100644 index 00000000..ee28d54b --- /dev/null +++ b/TJAPlayer3/Common/CActFlushGPU.cs @@ -0,0 +1,61 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using SlimDX.Direct3D9; +using FDK; + +namespace TJAPlayer3 +{ + /// + /// 謠冗判繝輔Ξ繝シ繝豈弱↓GPU繧偵ヵ繝ゥ繝繧キ繝・縺励※縲∵緒逕サ驕蟒カ繧帝亟縺舌 + /// DirectX9縺ョ縲^cclusion Query繧堤畑縺繧九(Flush螻樊ァ莉倥″縺ァGetData縺吶k) + /// Device Lost蟇セ遲悶ョ縺溘a縲_ueue繧辰Activitiy縺ョManaged繝ェ繧ス繝シ繧ケ縺ィ縺励※謇ア縺縲 + /// On騾イ陦梧緒逕サ()繧貞他縺ウ蜃コ縺吶%縺ィ縺ァ縲;PU繧偵ヵ繝ゥ繝繧キ繝・縺吶k縲 + /// + internal class CActFlushGPU : CActivity + { + // CActivity 螳溯」 + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if ( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + try // #xxxxx 2012.12.31 yyagi: to prepare flush, first of all, I create q queue to the GPU. + { + IDirect3DQuery9 = new Query(TJAPlayer3.app.Device.UnderlyingDevice, QueryType.Occlusion); + } + catch ( Exception e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (e5c7cd0b-f7bb-4bf1-9ad9-db27b43ff63d)" ); + } + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + IDirect3DQuery9.Dispose(); + IDirect3DQuery9 = null; + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + public override int On騾イ陦梧緒逕サ() + { + if ( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + IDirect3DQuery9.Issue( Issue.End ); + DWM.Flush(); + IDirect3DQuery9.GetData( true ); // flush GPU queue + } + return 0; + } + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private Query IDirect3DQuery9; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Common/CConfigIni.cs b/TJAPlayer3/Common/CConfigIni.cs new file mode 100644 index 00000000..57dfd006 --- /dev/null +++ b/TJAPlayer3/Common/CConfigIni.cs @@ -0,0 +1,3066 @@ +サソusing System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Text; +using System.Runtime.InteropServices; +using System.IO; +using System.Diagnostics; +using FDK; +using FDK.ExtensionMethods; + +namespace TJAPlayer3 +{ + internal class CConfigIni : INotifyPropertyChanged + { + private const int MinimumKeyboardSoundLevelIncrement = 1; + private const int MaximumKeyboardSoundLevelIncrement = 20; + private const int DefaultKeyboardSoundLevelIncrement = 5; + + // 繧ッ繝ゥ繧ケ + + #region [ CKeyAssign ] + public class CKeyAssign + { + public class CKeyAssignPad + { + public CConfigIni.CKeyAssign.STKEYASSIGN[] HH + { + get + { + return this.padHH_R; + } + set + { + this.padHH_R = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] R + { + get + { + return this.padHH_R; + } + set + { + this.padHH_R = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] SD + { + get + { + return this.padSD_G; + } + set + { + this.padSD_G = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] G + { + get + { + return this.padSD_G; + } + set + { + this.padSD_G = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] BD + { + get + { + return this.padBD_B; + } + set + { + this.padBD_B = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] B + { + get + { + return this.padBD_B; + } + set + { + this.padBD_B = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] HT + { + get + { + return this.padHT_Pick; + } + set + { + this.padHT_Pick = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] Pick + { + get + { + return this.padHT_Pick; + } + set + { + this.padHT_Pick = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] LT + { + get + { + return this.padLT_Wail; + } + set + { + this.padLT_Wail = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] Wail + { + get + { + return this.padLT_Wail; + } + set + { + this.padLT_Wail = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] FT + { + get + { + return this.padFT_Cancel; + } + set + { + this.padFT_Cancel = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] Cancel + { + get + { + return this.padFT_Cancel; + } + set + { + this.padFT_Cancel = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] CY + { + get + { + return this.padCY_Decide; + } + set + { + this.padCY_Decide = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] Decide + { + get + { + return this.padCY_Decide; + } + set + { + this.padCY_Decide = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] HHO + { + get + { + return this.padHHO; + } + set + { + this.padHHO = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] RD + { + get + { + return this.padRD; + } + set + { + this.padRD = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] LC + { + get + { + return this.padLC; + } + set + { + this.padLC = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] LP + { + get + { + return this.padLP; + } + set + { + this.padLP = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] LBD + { + get + { + return this.padLBD; + } + set + { + this.padLBD = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] Capture + { + get + { + return this.padCapture; + } + set + { + this.padCapture = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed + { + get + { + return this.padLRed; + } + set + { + this.padLRed = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed + { + get + { + return this.padRRed; + } + set + { + this.padRRed = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue + { + get + { + return this.padLBlue; + } + set + { + this.padLBlue = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue + { + get + { + return this.padRBlue; + } + set + { + this.padRBlue = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftRed2P + { + get + { + return this.padLRed2P; + } + set + { + this.padLRed2P = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightRed2P + { + get + { + return this.padRRed2P; + } + set + { + this.padRRed2P = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] LeftBlue2P + { + get + { + return this.padLBlue2P; + } + set + { + this.padLBlue2P = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] RightBlue2P + { + get + { + return this.padRBlue2P; + } + set + { + this.padRBlue2P = value; + } + } + public CConfigIni.CKeyAssign.STKEYASSIGN[] this[ int index ] + { + get + { + switch ( index ) + { + case (int) EKeyConfigPad.HH: + return this.padHH_R; + + case (int) EKeyConfigPad.SD: + return this.padSD_G; + + case (int) EKeyConfigPad.BD: + return this.padBD_B; + + case (int) EKeyConfigPad.HT: + return this.padHT_Pick; + + case (int) EKeyConfigPad.LT: + return this.padLT_Wail; + + case (int) EKeyConfigPad.FT: + return this.padFT_Cancel; + + case (int) EKeyConfigPad.CY: + return this.padCY_Decide; + + case (int) EKeyConfigPad.HHO: + return this.padHHO; + + case (int) EKeyConfigPad.RD: + return this.padRD; + + case (int) EKeyConfigPad.LC: + return this.padLC; + + case (int) EKeyConfigPad.LP: // #27029 2012.1.4 from + return this.padLP; // + + case (int) EKeyConfigPad.LBD: // #27029 2012.1.4 from + return this.padLBD; // + + case (int) EKeyConfigPad.LRed: + return this.padLRed; + + case (int) EKeyConfigPad.RRed: + return this.padRRed; + + case (int) EKeyConfigPad.LBlue: + return this.padLBlue; + + case (int) EKeyConfigPad.RBlue: + return this.padRBlue; + + case (int) EKeyConfigPad.LRed2P: + return this.padLRed2P; + + case (int) EKeyConfigPad.RRed2P: + return this.padRRed2P; + + case (int) EKeyConfigPad.LBlue2P: + return this.padLBlue2P; + + case (int) EKeyConfigPad.RBlue2P: + return this.padRBlue2P; + + case (int) EKeyConfigPad.Capture: + return this.padCapture; + } + throw new IndexOutOfRangeException(); + } + set + { + switch ( index ) + { + case (int) EKeyConfigPad.HH: + this.padHH_R = value; + return; + + case (int) EKeyConfigPad.SD: + this.padSD_G = value; + return; + + case (int) EKeyConfigPad.BD: + this.padBD_B = value; + return; + + case (int) EKeyConfigPad.Pick: + this.padHT_Pick = value; + return; + + case (int) EKeyConfigPad.LT: + this.padLT_Wail = value; + return; + + case (int) EKeyConfigPad.FT: + this.padFT_Cancel = value; + return; + + case (int) EKeyConfigPad.CY: + this.padCY_Decide = value; + return; + + case (int) EKeyConfigPad.HHO: + this.padHHO = value; + return; + + case (int) EKeyConfigPad.RD: + this.padRD = value; + return; + + case (int) EKeyConfigPad.LC: + this.padLC = value; + return; + + case (int) EKeyConfigPad.LP: + this.padLP = value; + return; + + case (int) EKeyConfigPad.LBD: + this.padLBD = value; + return; + + case (int) EKeyConfigPad.LRed: + this.padLRed = value; + return; + + case (int) EKeyConfigPad.RRed: + this.padRRed = value; + return; + + case (int) EKeyConfigPad.LBlue: + this.padLBlue = value; + return; + + case (int) EKeyConfigPad.RBlue: + this.padRBlue = value; + return; + + case (int) EKeyConfigPad.LRed2P: + this.padLRed2P = value; + return; + + case (int) EKeyConfigPad.RRed2P: + this.padRRed2P = value; + return; + + case (int) EKeyConfigPad.LBlue2P: + this.padLBlue2P = value; + return; + + case (int) EKeyConfigPad.RBlue2P: + this.padRBlue2P = value; + return; + + case (int) EKeyConfigPad.Capture: + this.padCapture = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + + #region [ private ] + //----------------- + private CConfigIni.CKeyAssign.STKEYASSIGN[] padBD_B; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padCY_Decide; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padFT_Cancel; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padHH_R; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padHHO; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padHT_Pick; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLC; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLT_Wail; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padRD; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padSD_G; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLP; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLBD; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLRed; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLBlue; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padRRed; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padRBlue; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLRed2P; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padLBlue2P; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padRRed2P; + private CConfigIni.CKeyAssign.STKEYASSIGN[] padRBlue2P; + + private CConfigIni.CKeyAssign.STKEYASSIGN[] padCapture; + //----------------- + #endregion + } + + [StructLayout( LayoutKind.Sequential )] + public struct STKEYASSIGN + { + public E蜈・蜉帙ョ繝舌う繧ケ 蜈・蜉帙ョ繝舌う繧ケ; + public int ID; + public int 繧ウ繝シ繝; + public STKEYASSIGN( E蜈・蜉帙ョ繝舌う繧ケ DeviceType, int nID, int nCode ) + { + this.蜈・蜉帙ョ繝舌う繧ケ = DeviceType; + this.ID = nID; + this.繧ウ繝シ繝 = nCode; + } + } + + public CKeyAssignPad Bass = new CKeyAssignPad(); + public CKeyAssignPad Drums = new CKeyAssignPad(); + public CKeyAssignPad Guitar = new CKeyAssignPad(); + public CKeyAssignPad Taiko = new CKeyAssignPad(); + public CKeyAssignPad System = new CKeyAssignPad(); + public CKeyAssignPad this[ int index ] + { + get + { + switch( index ) + { + case (int) EKeyConfigPart.DRUMS: + return this.Drums; + + case (int) EKeyConfigPart.GUITAR: + return this.Guitar; + + case (int) EKeyConfigPart.BASS: + return this.Bass; + + case (int) EKeyConfigPart.TAIKO: + return this.Taiko; + + case (int) EKeyConfigPart.SYSTEM: + return this.System; + } + throw new IndexOutOfRangeException(); + } + set + { + switch( index ) + { + case (int) EKeyConfigPart.DRUMS: + this.Drums = value; + return; + + case (int) EKeyConfigPart.GUITAR: + this.Guitar = value; + return; + + case (int) EKeyConfigPart.BASS: + this.Bass = value; + return; + + case (int) EKeyConfigPart.TAIKO: + this.Taiko = value; + return; + + case (int) EKeyConfigPart.SYSTEM: + this.System = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + #endregion + + // + public enum ESoundDeviceTypeForConfig + { + ACM = 0, + // DirectSound, + ASIO, + WASAPI, + Unknown=99 + } + // 繝励Ο繝代ユ繧」 + +#if false // #23625 2011.1.11 Config.ini縺九i繝繝。繝シ繧ク/蝗槫セゥ蛟、縺ョ螳壽焚螟画峩繧定。後≧蝣エ蜷医ッ縺薙%繧呈怏蜉ケ縺ォ縺吶k 087繝ェ繝ェ繝シ繧ケ縺ォ蜷医o縺帶ゥ溯ス辟。蜉ケ蛹 + //---------------------------------------- + public float[,] fGaugeFactor = new float[5,2]; + public float[] fDamageLevelFactor = new float[3]; + //---------------------------------------- +#endif + public int nBGAlpha; + public bool bAVI譛牙柑; + public bool bBGA譛牙柑; + public bool bBGM髻ウ繧堤匱螢ー縺吶k; + public STDGBVALUE bHidden; + public STDGBVALUE bLeft; + public STDGBVALUE bLight; + public bool bLogDTX隧ウ邏ー繝ュ繧ー蜃コ蜉; + public bool bLog譖イ讀懃エ「繝ュ繧ー蜃コ蜉; + public bool bLog菴懈占ァ」謾セ繝ュ繧ー蜃コ蜉; + public STDGBVALUE bReverse; + + public E蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ; + public STDGBVALUE e蛻、螳壻ス咲スョ; // #33891 2014.6.26 yyagi + public bool bScoreIni繧貞コ蜉帙☆繧; + public bool bSTAGEFAILED譛牙柑; + public STDGBVALUE bSudden; + public bool bTight; + public STDGBVALUE bGraph; // #24074 2011.01.23 add ikanick + public bool bWave蜀咲函菴咲スョ閾ェ蜍戊ェソ謨エ讖溯ス譛牙柑; + public bool b繧ケ繝医う繝繧ッ繝「繝シ繝; + public bool b繝ゥ繝ウ繝繝繧サ繝ャ繧ッ繝医〒蟄殖OX繧呈、懃エ「蟇セ雎。縺ィ縺吶k; + public bool b繝ュ繧ー蜃コ蜉; + public bool b貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k; + public bool b蝙ら峩蟶ー邱壼セ縺。繧定。後≧; + public bool b蜈ィ逕サ髱「繝「繝シ繝; + public int n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョX; // #30675 2013.02.04 ikanick add + public int n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョY; + public int n繧ヲ繧、繝ウ繝峨えwidth; // #23510 2010.10.31 yyagi add + public int n繧ヲ繧、繝ウ繝峨えheight; // #23510 2010.10.31 yyagi add + public Dictionary dicJoystick; + public E繝繝シ繧ッ繝「繝シ繝 eDark; + public STDGBVALUE eRandom; + public E繝繝。繝シ繧ク繝ャ繝吶Ν e繝繝。繝シ繧ク繝ャ繝吶Ν; + public CKeyAssign KeyAssign; + public int n髱槭ヵ繧ゥ繝シ繧ォ繧ケ譎ゅせ繝ェ繝シ繝洋s; // #23568 2010.11.04 ikanick add + public int n繝輔Ξ繝シ繝豈弱せ繝ェ繝シ繝洋s; // #xxxxx 2011.11.27 yyagi add + public int n貍泌・城溷コヲ; + public bool b貍泌・城溷コヲ縺御ク蛟埼溘〒縺ゅk縺ィ縺堺サ・螟夜浹螢ー繧貞咲函縺励↑縺; + public int n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ髻ウ縺碁ウエ繧九∪縺ァ縺ョ繧ヲ繧ァ繧、繝ms; + public int n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ逕サ蜒上′陦ィ遉コ髢句ァ九&繧後k縺セ縺ァ縺ョ繧ヲ繧ァ繧、繝ms; + + private bool _applyLoudnessMetadata; + + public bool ApplyLoudnessMetadata + { + get => _applyLoudnessMetadata; + set => SetProperty(ref _applyLoudnessMetadata, value, nameof(ApplyLoudnessMetadata)); + } + + private double _targetLoudness; + + public double TargetLoudness + { + get => _targetLoudness; + set => SetProperty(ref _targetLoudness, value, nameof(TargetLoudness)); + } + + private bool _applySongVol; + + public bool ApplySongVol + { + get => _applySongVol; + set => SetProperty(ref _applySongVol, value, nameof(ApplySongVol)); + } + + private int _soundEffectLevel; + + public int SoundEffectLevel + { + get => _soundEffectLevel; + set => SetProperty(ref _soundEffectLevel, value, nameof(SoundEffectLevel)); + } + + private int _voiceLevel; + + public int VoiceLevel + { + get => _voiceLevel; + set => SetProperty(ref _voiceLevel, value, nameof(VoiceLevel)); + } + + private int _songPreviewLevel; + + public int SongPreviewLevel + { + get => _songPreviewLevel; + set => SetProperty(ref _songPreviewLevel, value, nameof(SongPlaybackLevel)); + } + + private int _songPlaybackLevel; + + public int SongPlaybackLevel + { + get => _songPlaybackLevel; + set => SetProperty(ref _songPlaybackLevel, value, nameof(SongPlaybackLevel)); + } + + private int _keyboardSoundLevelIncrement; + + public int KeyboardSoundLevelIncrement + { + get => _keyboardSoundLevelIncrement; + set => SetProperty( + ref _keyboardSoundLevelIncrement, + value.Clamp(MinimumKeyboardSoundLevelIncrement, MaximumKeyboardSoundLevelIncrement), + nameof(KeyboardSoundLevelIncrement)); + } + + public STDGBVALUE n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚; + public STDGBVALUE n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ; + public string strDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ; + public string str譖イ繝繝シ繧ソ讀懃エ「繝代せ; + public string FontName; + public string BoxFontName; + public bool bBranchGuide; + public int nScoreMode; + public int nDefaultCourse; //2017.01.30 DD 繝繝輔か繝ォ繝医〒繧ォ繝シ繧ス繝ォ繧偵≠繧上○繧矩屮譏灘コヲ + + + public int nPlayerCount; //2017.08.18 kairera0467 繝槭Ν繝√励Ξ繧、蟇セ蠢 + public bool b螟ェ鮠薙ヱ繝シ繝AutoPlay; + public bool b螟ェ鮠薙ヱ繝シ繝AutoPlay2P; //2017.08.16 kairera0467 繝槭Ν繝√励Ξ繧、蟇セ蠢 + public bool bAuto蜈育函縺ョ騾」謇; + public bool b螟ァ髻ウ隨ヲ蛻、螳; + public int n荳。謇句愛螳壹ョ蠕縺。譎る俣; + public int nBranchAnime; + + public bool bJudgeCountDisplay; + + public bool bEnableCountdownTimer; + + // 蜷逕サ蜒上ョ陦ィ遉コ繝サ髱櫁。ィ遉コ險ュ螳 + public bool ShowChara; + public bool ShowDancer; + public bool ShowRunner; + public bool ShowFooter; + public bool ShowMob; + public bool ShowPuchiChara; // 繝ェ繧カ繝シ繝 + // + + public EScrollMode eScrollMode = EScrollMode.Normal; + public bool b繧ケ繧ッ繝ュ繝シ繝ォ繝「繝シ繝峨r荳頑嶌縺 = false; + + public bool bHispeedRandom; + public E繧ケ繝繝ォ繧ケ繝「繝シ繝 eSTEALTH; + public bool bNoInfo; + + public int nDefaultSongSort; + + public EGame eGameMode; + public int TokkunSkipMeasures; + public int TokkunMashInterval; + public bool bSuperHard = false; + public bool bTokkunMode = false; + public bool bJust; + + public bool bEndingAnime = false; // 2017.01.27 DD 縲後∪縺滄♀繧薙〒縺ュ縲咲判髱「縺ョ譛牙柑/辟。蜉ケ繧ェ繝励す繝ァ繝ウ霑ス蜉 + + + public STDGBVALUE 蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ; +// public int n繝上う繝上ャ繝亥繧頑昏縺ヲ荳矩剞Velocity; +// public int n蛻繧頑昏縺ヲ荳矩剞Velocity; // #23857 2010.12.12 yyagi VelocityMin + public int nInputAdjustTimeMs; + public STDGBVALUE nJudgeLinePosOffset; // #31602 2013.6.23 yyagi 蛻、螳壹Λ繧、繝ウ陦ィ遉コ菴咲スョ縺ョ繧ェ繝輔そ繝繝 + public bool bIsAutoResultCapture; // #25399 2011.6.9 yyagi 繝ェ繧カ繝ォ繝育判蜒剰ェ蜍穂ソ晏ュ俶ゥ溯ス縺ョON/OFF蛻カ蠕。 + public int nPoliphonicSounds; // #28228 2012.5.1 yyagi 繝ャ繝シ繝ウ豈弱ョ譛螟ァ蜷梧凾逋コ髻ウ謨ー + public bool b繝舌ャ繝輔ぃ蜈・蜉帙r陦後≧; + public bool bIsEnabledSystemMenu; // #28200 2012.5.1 yyagi System Menu縺ョ菴ソ逕ィ蜿ッ蜷ヲ蛻譖ソ + public string strSystemSkinSubfolderFullName; // #28195 2012.5.2 yyagi Skin蛻譖ソ逕ィ System/莉・荳九ョ繧オ繝悶ヵ繧ゥ繝ォ繝蜷 + public bool bConfigIni縺後↑縺縺汽TXMania縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧 + { + get + { + return ( !this.bConfigIni縺悟ュ伜惠縺励※縺繧 || !TJAPlayer3.VERSION.Equals( this.strDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ ) ); + } + } + public bool bEnter縺後く繝シ蜑イ繧雁ス薙※縺ョ縺ゥ縺薙↓繧ゆスソ逕ィ縺輔l縺ヲ縺縺ェ縺 + { + get + { + for( int i = 0; i <= (int)EKeyConfigPart.SYSTEM; i++ ) + { + for( int j = 0; j <= (int)EKeyConfigPad.Capture; j++ ) + { + for( int k = 0; k < 0x10; k++ ) + { + if( ( this.KeyAssign[ i ][ j ][ k ].蜈・蜉帙ョ繝舌う繧ケ == E蜈・蜉帙ョ繝舌う繧ケ.繧ュ繝シ繝懊シ繝 ) && ( this.KeyAssign[ i ][ j ][ k ].繧ウ繝シ繝 == (int)SlimDXKeys.Key.Return ) ) + { + return false; + } + } + } + } + return true; + } + } + public bool b繧ヲ繧」繝ウ繝峨え繝「繝シ繝 + { + get + { + return !this.b蜈ィ逕サ髱「繝「繝シ繝; + } + set + { + this.b蜈ィ逕サ髱「繝「繝シ繝 = !value; + } + } + public bool b貍泌・乗ュ蝣ア繧定。ィ遉コ縺励↑縺 + { + get + { + return !this.b貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k; + } + set + { + this.b貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k = !value; + } + } + public int n閭梧勹縺ョ騾城℃蠎ヲ + { + get + { + return this.nBGAlpha; + } + set + { + if( value < 0 ) + { + this.nBGAlpha = 0; + } + else if( value > 0xff ) + { + this.nBGAlpha = 0xff; + } + else + { + this.nBGAlpha = value; + } + } + } + public int nRisky; // #23559 2011.6.20 yyagi Risky縺ァ縺ョ谿九Α繧ケ謨ー縲0縺ァ髢牙コ + public bool bIsAllowedDoubleClickFullscreen; // #26752 2011.11.27 yyagi 繝繝悶Ν繧ッ繝ェ繝繧ッ縺励※繧ゅヵ繝ォ繧ケ繧ッ繝ェ繝シ繝ウ縺ォ遘サ陦後@縺ェ縺 + public STAUTOPLAY bAutoPlay; + public int nSoundDeviceType; // #24820 2012.12.23 yyagi 蜃コ蜉帙し繧ヲ繝ウ繝峨ョ繝舌う繧ケ(0=ACM(縺ォ縺励◆縺縺瑚ィュ險医′縺阪▽縺昴≧縺ェ繧吋irectShow), 1=ASIO, 2=WASAPI) + public int nWASAPIBufferSizeMs; // #24820 2013.1.15 yyagi WASAPI縺ョ繝舌ャ繝輔ぃ繧オ繧、繧コ +// public int nASIOBufferSizeMs; // #24820 2012.12.28 yyagi ASIO縺ョ繝舌ャ繝輔ぃ繧オ繧、繧コ + public int nASIODevice; // #24820 2013.1.17 yyagi ASIO繝繝舌う繧ケ + public bool bUseOSTimer; // #33689 2014.6.6 yyagi 貍泌・上ち繧、繝槭シ縺ョ遞ョ鬘 + public bool bDynamicBassMixerManagement; // #24820 + public bool bTimeStretch; // #23664 2013.2.24 yyagi 繝斐ャ繝∝、画峩辟。縺励〒蜀咲函騾溷コヲ繧貞、画峩縺吶k縺九←縺縺 + public STDGBVALUE eInvisible; // #32072 2013.9.20 yyagi 繝√ャ繝励r髱櫁。ィ遉コ縺ォ縺吶k + public int nDisplayTimesMs, nFadeoutTimeMs; + + public STDGBVALUE nViewerScrollSpeed; + public bool bViewerVSyncWait; + public bool bViewerShowDebugStatus; + public bool bViewerTimeStretch; + public bool bViewerDrums譛牙柑, bViewerGuitar譛牙柑; + //public bool bNoMP3Streaming; // 2014.4.14 yyagi; mp3縺ョ繧キ繝シ繧ッ菴咲スョ縺後♀縺九@縺上↑繧句エ蜷医ッ縲√%繧後rtrue縺ォ縺吶k縺薙→縺ァ縲『av縺ォ繝繧ウ繝シ繝峨@縺ヲ縺九i繧ェ繝ウ繝。繝「繝ェ蜀咲函縺吶k + public int nMasterVolume; + public bool ShinuchiMode; // 逵滓遠繝「繝シ繝 + public bool FastRender; // 莠句燕逕サ蜒乗緒逕サ繝「繝シ繝 + public int MusicPreTimeMs; // 髻ウ貅仙咲函蜑阪ョ蠕讖滓凾髢杜s + /// + /// Discord縺ョRitch Presence縺ォ蜀咲函荳ュ縺ョ.tja繝輔ぃ繧、繝ォ縺ョ諠蝣ア繧帝∽ソ。縺吶k縺九←縺縺九 + /// + public bool SendDiscordPlayingInformation; +#if false + [StructLayout( LayoutKind.Sequential )] + public struct STAUTOPLAY // C螳壽焚縺ョE繝ャ繝シ繝ウ縺ィindex繧剃ク閾エ縺輔○繧九%縺ィ + { + public bool LC; // 0 + public bool HH; // 1 + public bool SD; // 2 + public bool BD; // 3 + public bool HT; // 4 + public bool LT; // 5 + public bool FT; // 6 + public bool CY; // 7 + public bool RD; // 8 + public bool Guitar; // 9 (not used) + public bool Bass; // 10 (not used) + public bool GtR; // 11 + public bool GtG; // 12 + public bool GtB; // 13 + public bool GtPick; // 14 + public bool GtW; // 15 + public bool BsR; // 16 + public bool BsG; // 17 + public bool BsB; // 18 + public bool BsPick; // 19 + public bool BsW; // 20 + public bool this[ int index ] + { + get + { + switch ( index ) + { + case (int) E繝ャ繝シ繝ウ.LC: + return this.LC; + case (int) E繝ャ繝シ繝ウ.HH: + return this.HH; + case (int) E繝ャ繝シ繝ウ.SD: + return this.SD; + case (int) E繝ャ繝シ繝ウ.BD: + return this.BD; + case (int) E繝ャ繝シ繝ウ.HT: + return this.HT; + case (int) E繝ャ繝シ繝ウ.LT: + return this.LT; + case (int) E繝ャ繝シ繝ウ.FT: + return this.FT; + case (int) E繝ャ繝シ繝ウ.CY: + return this.CY; + case (int) E繝ャ繝シ繝ウ.RD: + return this.RD; + case (int) E繝ャ繝シ繝ウ.Guitar: + return this.Guitar; + case (int) E繝ャ繝シ繝ウ.Bass: + return this.Bass; + case (int) E繝ャ繝シ繝ウ.GtR: + return this.GtR; + case (int) E繝ャ繝シ繝ウ.GtG: + return this.GtG; + case (int) E繝ャ繝シ繝ウ.GtB: + return this.GtB; + case (int) E繝ャ繝シ繝ウ.GtPick: + return this.GtPick; + case (int) E繝ャ繝シ繝ウ.GtW: + return this.GtW; + case (int) E繝ャ繝シ繝ウ.BsR: + return this.BsR; + case (int) E繝ャ繝シ繝ウ.BsG: + return this.BsG; + case (int) E繝ャ繝シ繝ウ.BsB: + return this.BsB; + case (int) E繝ャ繝シ繝ウ.BsPick: + return this.BsPick; + case (int) E繝ャ繝シ繝ウ.BsW: + return this.BsW; + } + throw new IndexOutOfRangeException(); + } + set + { + switch ( index ) + { + case (int) E繝ャ繝シ繝ウ.LC: + this.LC = value; + return; + case (int) E繝ャ繝シ繝ウ.HH: + this.HH = value; + return; + case (int) E繝ャ繝シ繝ウ.SD: + this.SD = value; + return; + case (int) E繝ャ繝シ繝ウ.BD: + this.BD = value; + return; + case (int) E繝ャ繝シ繝ウ.HT: + this.HT = value; + return; + case (int) E繝ャ繝シ繝ウ.LT: + this.LT = value; + return; + case (int) E繝ャ繝シ繝ウ.FT: + this.FT = value; + return; + case (int) E繝ャ繝シ繝ウ.CY: + this.CY = value; + return; + case (int) E繝ャ繝シ繝ウ.RD: + this.RD = value; + return; + case (int) E繝ャ繝シ繝ウ.Guitar: + this.Guitar = value; + return; + case (int) E繝ャ繝シ繝ウ.Bass: + this.Bass = value; + return; + case (int) E繝ャ繝シ繝ウ.GtR: + this.GtR = value; + return; + case (int) E繝ャ繝シ繝ウ.GtG: + this.GtG = value; + return; + case (int) E繝ャ繝シ繝ウ.GtB: + this.GtB = value; + return; + case (int) E繝ャ繝シ繝ウ.GtPick: + this.GtPick = value; + return; + case (int) E繝ャ繝シ繝ウ.GtW: + this.GtW = value; + return; + case (int) E繝ャ繝シ繝ウ.BsR: + this.BsR = value; + return; + case (int) E繝ャ繝シ繝ウ.BsG: + this.BsG = value; + return; + case (int) E繝ャ繝シ繝ウ.BsB: + this.BsB = value; + return; + case (int) E繝ャ繝シ繝ウ.BsPick: + this.BsPick = value; + return; + case (int) E繝ャ繝シ繝ウ.BsW: + this.BsW = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } +#endif + #region [ STRANGE ] + public STRANGE n繝偵ャ繝育ッ蝗イms; + [StructLayout( LayoutKind.Sequential )] + public struct STRANGE + { + public int Perfect; + public int Great; + public int Good; + public int Poor; + public int this[ int index ] + { + get + { + switch( index ) + { + case 0: + return this.Perfect; + + case 1: + return this.Great; + + case 2: + return this.Good; + + case 3: + return this.Poor; + } + throw new IndexOutOfRangeException(); + } + set + { + switch( index ) + { + case 0: + this.Perfect = value; + return; + + case 1: + this.Great = value; + return; + + case 2: + this.Good = value; + return; + + case 3: + this.Poor = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + #endregion + #region [ STLANEVALUE ] + public STLANEVALUE nVelocityMin; + [StructLayout( LayoutKind.Sequential )] + public struct STLANEVALUE + { + public int LC; + public int HH; + public int SD; + public int BD; + public int HT; + public int LT; + public int FT; + public int CY; + public int RD; + public int LP; + public int LBD; + public int Guitar; + public int Bass; + public int this[ int index ] + { + get + { + switch( index ) + { + case 0: + return this.LC; + + case 1: + return this.HH; + + case 2: + return this.SD; + + case 3: + return this.BD; + + case 4: + return this.HT; + + case 5: + return this.LT; + + case 6: + return this.FT; + + case 7: + return this.CY; + + case 8: + return this.RD; + + case 9: + return this.LP; + + case 10: + return this.LBD; + + case 11: + return this.Guitar; + + case 12: + return this.Bass; + } + throw new IndexOutOfRangeException(); + } + set + { + switch( index ) + { + case 0: + this.LC = value; + return; + + case 1: + this.HH = value; + return; + + case 2: + this.SD = value; + return; + + case 3: + this.BD = value; + return; + + case 4: + this.HT = value; + return; + + case 5: + this.LT = value; + return; + + case 6: + this.FT = value; + return; + + case 7: + this.CY = value; + return; + + case 8: + this.RD = value; + return; + + case 9: + this.LP = value; + return; + + case 10: + this.LBD = value; + return; + + case 11: + this.Guitar = value; + return; + + case 12: + this.Bass = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + #endregion + + + #region[Ver.K霑ス蜉繧ェ繝励す繝ァ繝ウ] + //-------------------------- + //繧イ繝シ繝蜀縺ョ繧ェ繝励す繝ァ繝ウ縺ォ蜉縺医※縲 + //繧キ繧ケ繝繝蜻ィ繧翫ョ繧ェ繝励す繝ァ繝ウ繧ゅ%縺ョ繝悶Ο繝繧ッ縺ァ險倩ソー縺励※縺繧九 + #region[Display] + //-------------------------- + public EClipDispType eClipDispType; + #endregion + + #region[Position] + public E繝ャ繝シ繝ウ繧ソ繧、繝 eLaneType; + public E繝溘Λ繝シ eMirror; + + #endregion + #region[System] + public bool bDirectShowMode; + #endregion + + //-------------------------- + #endregion + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CConfigIni() + { +#if false // #23625 2011.1.11 Config.ini縺九i繝繝。繝シ繧ク/蝗槫セゥ蛟、縺ョ螳壽焚螟画峩繧定。後≧蝣エ蜷医ッ縺薙%繧呈怏蜉ケ縺ォ縺吶k 087繝ェ繝ェ繝シ繧ケ縺ォ蜷医o縺帶ゥ溯ス辟。蜉ケ蛹 + //---------------------------------------- + this.fGaugeFactor[0,0] = 0.004f; + this.fGaugeFactor[0,1] = 0.006f; + this.fGaugeFactor[1,0] = 0.002f; + this.fGaugeFactor[1,1] = 0.003f; + this.fGaugeFactor[2,0] = 0.000f; + this.fGaugeFactor[2,1] = 0.000f; + this.fGaugeFactor[3,0] = -0.020f; + this.fGaugeFactor[3,1] = -0.030f; + this.fGaugeFactor[4,0] = -0.050f; + this.fGaugeFactor[4,1] = -0.050f; + + this.fDamageLevelFactor[0] = 0.5f; + this.fDamageLevelFactor[1] = 1.0f; + this.fDamageLevelFactor[2] = 1.5f; + //---------------------------------------- +#endif + this.strDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ = "Unknown"; + this.str譖イ繝繝シ繧ソ讀懃エ「繝代せ = @".\"; + this.b蜈ィ逕サ髱「繝「繝シ繝 = false; + this.b蝙ら峩蟶ー邱壼セ縺。繧定。後≧ = true; + this.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョX = 0; // #30675 2013.02.04 ikanick add + this.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョY = 0; + this.n繧ヲ繧、繝ウ繝峨えwidth = SampleFramework.GameWindowSize.Width; // #23510 2010.10.31 yyagi add + this.n繧ヲ繧、繝ウ繝峨えheight = SampleFramework.GameWindowSize.Height; // + this.n繝輔Ξ繝シ繝豈弱せ繝ェ繝シ繝洋s = -1; // #xxxxx 2011.11.27 yyagi add + this.n髱槭ヵ繧ゥ繝シ繧ォ繧ケ譎ゅせ繝ェ繝シ繝洋s = 1; // #23568 2010.11.04 ikanick add + this._bGuitar譛牙柑 = true; + this._bDrums譛牙柑 = true; + this.nBGAlpha = 100; + this.e繝繝。繝シ繧ク繝ャ繝吶Ν = E繝繝。繝シ繧ク繝ャ繝吶Ν.譎ョ騾; + this.bSTAGEFAILED譛牙柑 = true; + this.bAVI譛牙柑 = false; + this.bBGA譛牙柑 = true; + this.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ髻ウ縺碁ウエ繧九∪縺ァ縺ョ繧ヲ繧ァ繧、繝ms = 1000; + this.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ逕サ蜒上′陦ィ遉コ髢句ァ九&繧後k縺セ縺ァ縺ョ繧ヲ繧ァ繧、繝ms = 100; + //this.bWave蜀咲函菴咲スョ閾ェ蜍戊ェソ謨エ讖溯ス譛牙柑 = true; + this.bWave蜀咲函菴咲スョ閾ェ蜍戊ェソ謨エ讖溯ス譛牙柑 = false; + this.bBGM髻ウ繧堤匱螢ー縺吶k = true; + this.bScoreIni繧貞コ蜉帙☆繧 = true; + this.b繝ゥ繝ウ繝繝繧サ繝ャ繧ッ繝医〒蟄殖OX繧呈、懃エ「蟇セ雎。縺ィ縺吶k = true; + this.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚 = new STDGBVALUE(); + this.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚.Drums = 10; + this.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚.Guitar = 10; + this.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚.Bass = 10; + this.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚.Taiko = 10; + this.FontName = "MS UI Gothic"; + this.BoxFontName = "MS UI Gothic"; + this.ApplyLoudnessMetadata = true; + this.bEnableCountdownTimer = true; + + // 2018-08-28 twopointzero: + // There exists a particular large, well-known, well-curated, and + // regularly-updated collection of content for use with Taiko no + // Tatsujin simulators. A statistical analysis was performed on the + // the integrated loudness and true peak loudness of the thousands + // of songs within this collection as of late August 2018. + // + // The analysis allows us to select a target loudness which + // results in the smallest total amount of loudness adjustment + // applied to the songs of that collection. The selected target + // loudness should result in the least-noticeable average + // adjustment for the most users, assuming their collection is + // similar to the exemplar. + // + // The target loudness which achieves this is -7.4 LUFS. + this.TargetLoudness = -7.4; + + this.ApplySongVol = false; + this.SoundEffectLevel = CSound.DefaultSoundEffectLevel; + this.VoiceLevel = CSound.DefaultVoiceLevel; + this.SongPreviewLevel = CSound.DefaultSongPlaybackLevel; + this.SongPlaybackLevel = CSound.DefaultSongPlaybackLevel; + this.KeyboardSoundLevelIncrement = DefaultKeyboardSoundLevelIncrement; + this.b繝ュ繧ー蜃コ蜉 = true; + this.bSudden = new STDGBVALUE(); + this.bHidden = new STDGBVALUE(); + this.bReverse = new STDGBVALUE(); + this.eRandom = new STDGBVALUE(); + this.bLight = new STDGBVALUE(); + this.bLeft = new STDGBVALUE(); + this.e蛻、螳壻ス咲スョ = new STDGBVALUE(); // #33891 2014.6.26 yyagi + this.蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ = new STDGBVALUE(); + this.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ = new STDGBVALUE(); + this.nInputAdjustTimeMs = 0; + this.nJudgeLinePosOffset = new STDGBVALUE(); // #31602 2013.6.23 yyagi + this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ = E蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ.Chip繧医j荳; + for ( int i = 0; i < 3; i++ ) + { + this.bSudden[ i ] = false; + this.bHidden[ i ] = false; + this.bReverse[ i ] = false; + this.eRandom[ i ] = E繝ゥ繝ウ繝繝繝「繝シ繝.OFF; + this.bLight[ i ] = false; + this.bLeft[ i ] = false; + this.蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ[ i ] = E蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ.繝ャ繝シ繝ウ荳; + this.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ i ] = 9; + this.nJudgeLinePosOffset[ i ] = 0; + this.eInvisible[ i ] = EInvisible.OFF; + this.nViewerScrollSpeed[ i ] = 1; + this.e蛻、螳壻ス咲スョ[ i ] = E蛻、螳壻ス咲スョ.讓呎コ; + //this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ[ i ] = E蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ.Chip繧医j荳; + } + this.n貍泌・城溷コヲ = 20; + this.b貍泌・城溷コヲ縺御ク蛟埼溘〒縺ゅk縺ィ縺堺サ・螟夜浹螢ー繧貞咲函縺励↑縺 = false; + #region [ AutoPlay ] + this.bAutoPlay = new STAUTOPLAY(); + + this.b螟ェ鮠薙ヱ繝シ繝AutoPlay = true; + this.b螟ェ鮠薙ヱ繝シ繝AutoPlay2P = true; + this.bAuto蜈育函縺ョ騾」謇 = true; + #endregion + this.n繝偵ャ繝育ッ蝗イms = new STRANGE(); + this.n繝偵ャ繝育ッ蝗イms.Perfect = 30; + this.n繝偵ャ繝育ッ蝗イms.Great = -1; //菴ソ逕ィ縺励∪縺帙s縲 + this.n繝偵ャ繝育ッ蝗イms.Good = 100; + this.n繝偵ャ繝育ッ蝗イms.Poor = 130; + this.ConfigIni繝輔ぃ繧、繝ォ蜷 = ""; + this.dicJoystick = new Dictionary( 10 ); + this.t繝繝輔か繝ォ繝医ョ繧ュ繝シ繧「繧オ繧、繝ウ縺ォ險ュ螳壹☆繧(); + #region [ velocityMin ] + this.nVelocityMin.LC = 0; // #23857 2011.1.31 yyagi VelocityMin + this.nVelocityMin.HH = 20; + this.nVelocityMin.SD = 0; + this.nVelocityMin.BD = 0; + this.nVelocityMin.HT = 0; + this.nVelocityMin.LT = 0; + this.nVelocityMin.FT = 0; + this.nVelocityMin.CY = 0; + this.nVelocityMin.RD = 0; + this.nVelocityMin.LP = 0; + this.nVelocityMin.LBD = 0; + #endregion + this.nRisky = 0; // #23539 2011.7.26 yyagi RISKY繝「繝シ繝 + this.bIsAutoResultCapture = false; // #25399 2011.6.9 yyagi 繝ェ繧カ繝ォ繝育判蜒剰ェ蜍穂ソ晏ュ俶ゥ溯スON/OFF + + this.b繝舌ャ繝輔ぃ蜈・蜉帙r陦後≧ = true; + this.bIsAllowedDoubleClickFullscreen = true; // #26752 2011.11.26 繝繝悶Ν繧ッ繝ェ繝繧ッ縺ァ縺ョ繝輔Ν繧ケ繧ッ繝ェ繝シ繝ウ繝「繝シ繝臥ァサ陦後r險ア蜿ッ + this.nPoliphonicSounds = 4; // #28228 2012.5.1 yyagi 繝ャ繝シ繝ウ豈弱ョ譛螟ァ蜷梧凾逋コ髻ウ謨ー + // #24820 2013.1.15 yyagi 蛻晄悄蛟、繧4縺九i2縺ォ螟画峩縲BASS.net菴ソ逕ィ譎ゅョ雋闕キ霆ス貂帙ョ縺溘a縲 + // #24820 2013.1.17 yyagi 蛻晄悄蛟、繧4縺ォ謌サ縺励◆縲ょ虚逧縺ェ繝溘く繧オ繝シ蛻カ蠕。縺後≧縺セ縺丞虚菴懊@縺ヲ縺繧九◆繧√ + this.bIsEnabledSystemMenu = true; // #28200 2012.5.1 yyagi System Menu縺ョ蛻ゥ逕ィ蜿ッ蜷ヲ蛻譖ソ(菴ソ逕ィ蜿ッ) + this.strSystemSkinSubfolderFullName = ""; // #28195 2012.5.2 yyagi 菴ソ逕ィ荳ュ縺ョSkin繧オ繝悶ヵ繧ゥ繝ォ繝蜷 + this.bTight = false; // #29500 2012.9.11 kairera0467 TIGHT繝「繝シ繝 + #region [ WASAPI/ASIO ] + this.nSoundDeviceType = FDK.COS.bIsVistaOrLater ? + (int) ESoundDeviceTypeForConfig.WASAPI : (int) ESoundDeviceTypeForConfig.ACM; // #24820 2012.12.23 yyagi 蛻晄悄蛟、縺ッACM | #31927 2013.8.25 yyagi OS縺ォ繧医j蛻晄悄蛟、螟画峩 + this.nWASAPIBufferSizeMs = 50; // #24820 2013.1.15 yyagi 蛻晄悄蛟、縺ッ50(0縺ァ閾ェ蜍戊ィュ螳) + this.nASIODevice = 0; // #24820 2013.1.17 yyagi +// this.nASIOBufferSizeMs = 0; // #24820 2012.12.25 yyagi 蛻晄悄蛟、縺ッ0(閾ェ蜍戊ィュ螳) + #endregion + this.bUseOSTimer = false;; // #33689 2014.6.6 yyagi 蛻晄悄蛟、縺ッfalse (FDK縺ョ繧ソ繧、繝槭シ縲ゑシヲシイシッシュ豌剰譯医ョ迢ャ閾ェ繧ソ繧、繝槭シ) + this.bDynamicBassMixerManagement = true; // + this.bTimeStretch = false; // #23664 2013.2.24 yyagi 蛻晄悄蛟、縺ッfalse (蜀咲函騾溷コヲ螟画峩繧偵√ヴ繝繝∝、画峩縺ォ縺ヲ陦後≧) + this.nDisplayTimesMs = 3000; // #32072 2013.10.24 yyagi Semi-Invisible縺ァ縺ョ縲√メ繝繝怜崎。ィ遉コ譛滄俣 + this.nFadeoutTimeMs = 2000; // #32072 2013.10.24 yyagi Semi-Invisible縺ァ縺ョ縲√メ繝繝励ヵ繧ァ繝シ繝峨い繧ヲ繝域凾髢 + + bViewerVSyncWait = true; + bViewerShowDebugStatus = true; + bViewerTimeStretch = false; + bViewerDrums譛牙柑 = true; + bViewerGuitar譛牙柑 = true; + + + + this.bBranchGuide = false; + this.nScoreMode = 2; + this.nDefaultCourse = 3; + this.nBranchAnime = 1; + + this.b螟ァ髻ウ隨ヲ蛻、螳 = false; + this.n荳。謇句愛螳壹ョ蠕縺。譎る俣 = 50; + + this.bJudgeCountDisplay = false; + + ShowChara = true; + ShowDancer = true; + ShowRunner = true; + ShowFooter = true; + ShowMob = true; + ShowPuchiChara = true; + + this.eSTEALTH = E繧ケ繝繝ォ繧ケ繝「繝シ繝.OFF; + this.bNoInfo = false; + + //this.bNoMP3Streaming = false; + this.nMasterVolume = 100; // #33700 2014.4.26 yyagi 繝槭せ繧ソ繝シ繝懊Μ繝・繝シ繝縺ョ險ュ螳(WASAPI/ASIO逕ィ) + this.bHispeedRandom = false; + this.nDefaultSongSort = 2; + this.eGameMode = EGame.OFF; + this.TokkunMashInterval = 750; + this.bEndingAnime = false; + this.nPlayerCount = 1; //2017.08.18 kairera0467 繝槭Ν繝√励Ξ繧、蟇セ蠢 + ShinuchiMode = false; + FastRender = true; + MusicPreTimeMs = 1000; // 荳遘 + SendDiscordPlayingInformation = true; + #region[ Ver.K霑ス蜉 ] + this.eLaneType = E繝ャ繝シ繝ウ繧ソ繧、繝.TypeA; + this.bDirectShowMode = false; + #endregion + } + public CConfigIni( string ini繝輔ぃ繧、繝ォ蜷 ) + : this() + { + this.t繝輔ぃ繧、繝ォ縺九i隱ュ縺ソ霎シ縺ソ( ini繝輔ぃ繧、繝ォ蜷 ); + } + + + // 繝。繧ス繝繝 + + public void t謖螳壹@縺溷・蜉帙′譌「縺ォ繧「繧オ繧、繝ウ貂医∩縺ァ縺ゅk蝣エ蜷医ッ縺昴l繧貞ィ蜑企勁縺吶k( E蜈・蜉帙ョ繝舌う繧ケ DeviceType, int nID, int nCode ) + { + for( int i = 0; i <= (int)EKeyConfigPart.SYSTEM; i++ ) + { + for( int j = 0; j <= (int)EKeyConfigPad.Capture; j++ ) + { + for( int k = 0; k < 0x10; k++ ) + { + if( ( ( this.KeyAssign[ i ][ j ][ k ].蜈・蜉帙ョ繝舌う繧ケ == DeviceType ) && ( this.KeyAssign[ i ][ j ][ k ].ID == nID ) ) && ( this.KeyAssign[ i ][ j ][ k ].繧ウ繝シ繝 == nCode ) ) + { + for( int m = k; m < 15; m++ ) + { + this.KeyAssign[ i ][ j ][ m ] = this.KeyAssign[ i ][ j ][ m + 1 ]; + } + this.KeyAssign[ i ][ j ][ 15 ].蜈・蜉帙ョ繝舌う繧ケ = E蜈・蜉帙ョ繝舌う繧ケ.荳肴; + this.KeyAssign[ i ][ j ][ 15 ].ID = 0; + this.KeyAssign[ i ][ j ][ 15 ].繧ウ繝シ繝 = 0; + k--; + } + } + } + } + } + public void t譖ク縺榊コ縺( string ini繝輔ぃ繧、繝ォ蜷 ) + { + StreamWriter sw = new StreamWriter( ini繝輔ぃ繧、繝ォ蜷, false, Encoding.GetEncoding( "Shift_JIS" ) ); + sw.WriteLine( ";-------------------" ); + + #region [ System ] + sw.WriteLine( "[System]" ); + sw.WriteLine(); + +#if false // #23625 2011.1.11 Config.ini縺九i繝繝。繝シ繧ク/蝗槫セゥ蛟、縺ョ螳壽焚螟画峩繧定。後≧蝣エ蜷医ッ縺薙%繧呈怏蜉ケ縺ォ縺吶k 087繝ェ繝ェ繝シ繧ケ縺ォ蜷医o縺帶ゥ溯ス辟。蜉ケ蛹 + //------------------------------ + sw.WriteLine("; 繝ゥ繧、繝輔ご繝シ繧ク縺ョ繝代Λ繝。繝シ繧ソ隱ソ謨エ(隱ソ謨エ螳御コ蠕悟炎髯、莠亥ョ)"); + sw.WriteLine("; GaugeFactorD: 繝峨Λ繝縺ョPerfect, Great,... 縺ョ蝗槫セゥ驥(繝ゥ繧、繝筆AX繧1.0縺ィ縺励◆縺ィ縺阪ョ蛟、繧呈欠螳)"); + sw.WriteLine("; GaugeFactorG: Gt/Bs縺ョPerfect, Great,... 縺ョ蝗槫セゥ驥(繝ゥ繧、繝筆AX繧1.0縺ィ縺励◆縺ィ縺阪ョ蛟、繧呈欠螳)"); + sw.WriteLine("; DamageFactorD: DamageLevel縺郡mall, Normal, Large縺ョ譎ゅ↓蟇セ縺吶k繝繝。繝シ繧ク菫よ焚"); + sw.WriteLine("GaugeFactorD={0}, {1}, {2}, {3}, {4}", this.fGaugeFactor[0, 0], this.fGaugeFactor[1, 0], this.fGaugeFactor[2, 0], this.fGaugeFactor[3, 0], this.fGaugeFactor[4, 0]); + sw.WriteLine("GaugeFactorG={0}, {1}, {2}, {3}, {4}", this.fGaugeFactor[0, 1], this.fGaugeFactor[1, 1], this.fGaugeFactor[2, 1], this.fGaugeFactor[3, 1], this.fGaugeFactor[4, 1]); + sw.WriteLine("DamageFactor={0}, {1}, {2}", this.fDamageLevelFactor[0], this.fDamageLevelFactor[1], fDamageLevelFactor[2]); + sw.WriteLine(); + //------------------------------ +#endif + #region [ Version ] + sw.WriteLine( "; 繝ェ繝ェ繝シ繧ケ繝舌シ繧ク繝ァ繝ウ" ); + sw.WriteLine( "; Release Version." ); + sw.WriteLine( "Version={0}", TJAPlayer3.VERSION ); + sw.WriteLine(); + #endregion + #region [ TJAPath ] + sw.WriteLine( "; 隴憺擇繝輔ぃ繧、繝ォ縺梧シ邏阪&繧後※縺繧九ヵ繧ゥ繝ォ繝縺ク縺ョ繝代せ縲" ); + sw.WriteLine( @"; 繧サ繝溘さ繝ュ繝ウ(;)縺ァ蛹コ蛻繧九%縺ィ縺ォ繧医j隍謨ー縺ョ繝代せ繧呈欠螳壹〒縺阪∪縺吶ゑシ井セ: d:\tja\;e:\tja2\シ" ); + sw.WriteLine( "; Pathes for TJA data." ); + sw.WriteLine( @"; You can specify many pathes separated with semicolon(;). (e.g. d:\tja\;e:\tja2\)" ); + sw.WriteLine( "TJAPath={0}", this.str譖イ繝繝シ繧ソ讀懃エ「繝代せ ); + sw.WriteLine(); + #endregion + #region [ 繧ケ繧ュ繝ウ髢「騾」 ] + #region [ Skin繝代せ縺ョ邨カ蟇セ繝代せ竊堤嶌蟇セ繝代せ螟画鋤 ] + Uri uriRoot = new Uri( System.IO.Path.Combine( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝, "System" + System.IO.Path.DirectorySeparatorChar ) ); + if ( strSystemSkinSubfolderFullName != null && strSystemSkinSubfolderFullName.Length == 0 ) + { + // Config.ini縺檎ゥコ縺ョ迥カ諷九〒DTXMania繧歎iewer縺ィ縺励※襍キ蜍廟邨ゆコ縺吶k縺ィ縲《trSystemSkinSubfolderFullName 縺檎ゥコ縺ョ迥カ諷九〒縺薙%縺ォ譚・繧九 + // 竊 蛻晄悄蛟、縺ィ縺励※ Default/ 繧定ィュ螳壹☆繧九 + strSystemSkinSubfolderFullName = System.IO.Path.Combine( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝, "System" + System.IO.Path.DirectorySeparatorChar + "Default" + System.IO.Path.DirectorySeparatorChar ); + } + Uri uriPath = new Uri( System.IO.Path.Combine( this.strSystemSkinSubfolderFullName, "." + System.IO.Path.DirectorySeparatorChar ) ); + string relPath = uriRoot.MakeRelativeUri( uriPath ).ToString(); // 逶ク蟇セ繝代せ繧貞叙蠕 + relPath = System.Web.HttpUtility.UrlDecode( relPath ); // 繝繧ウ繝シ繝峨☆繧 + relPath = relPath.Replace( '/', System.IO.Path.DirectorySeparatorChar ); // 蛹コ蛻繧頑枚蟄励′\縺ァ縺ッ縺ェ縺/縺ェ縺ョ縺ァ鄂ョ謠帙☆繧 + #endregion + sw.WriteLine( "; 菴ソ逕ィ縺吶kSkin縺ョ繝輔か繝ォ繝蜷阪" ); + sw.WriteLine( "; 萓九∴縺ー System\\Default\\Graphics\\... 縺ェ縺ゥ縺ョ蝣エ蜷医ッ縲ヾkinPath=.\\Default\\ 繧呈欠螳壹@縺セ縺吶" ); + sw.WriteLine( "; Skin folder path." ); + sw.WriteLine( "; e.g. System\\Default\\Graphics\\... -> Set SkinPath=.\\Default\\" ); + sw.WriteLine( "SkinPath={0}", relPath ); + sw.WriteLine(); + sw.WriteLine("; 莠句燕逕サ蜒乗緒逕サ讖溯ス繧剃スソ縺縺九←縺縺九(0: OFF, 1: ON)"); + sw.WriteLine("; Use pre-textures render."); + sw.WriteLine("{0}={1}", nameof(FastRender), FastRender ? 1 : 0); + sw.WriteLine(); + #endregion + #region [ Window髢「騾」 ] + sw.WriteLine( "; 逕サ髱「繝「繝シ繝(0:繧ヲ繧」繝ウ繝峨え, 1:蜈ィ逕サ髱「)" ); + sw.WriteLine( "; Screen mode. (0:Window, 1:Fullscreen)" ); + sw.WriteLine( "FullScreen={0}", this.b蜈ィ逕サ髱「繝「繝シ繝 ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine("; 繧ヲ繧、繝ウ繝峨え繝「繝シ繝画凾縺ョ逕サ髱「蟷"); // #23510 2010.10.31 yyagi add + sw.WriteLine("; A width size in the window mode."); // + sw.WriteLine("WindowWidth={0}", this.n繧ヲ繧、繝ウ繝峨えwidth); // + sw.WriteLine(); // + sw.WriteLine("; 繧ヲ繧、繝ウ繝峨え繝「繝シ繝画凾縺ョ逕サ髱「鬮倥&"); // + sw.WriteLine("; A height size in the window mode."); // + sw.WriteLine("WindowHeight={0}", this.n繧ヲ繧、繝ウ繝峨えheight); // + sw.WriteLine(); // + sw.WriteLine( "; 繧ヲ繧」繝ウ繝峨え繝「繝シ繝画凾縺ョ菴咲スョX" ); // #30675 2013.02.04 ikanick add + sw.WriteLine( "; X position in the window mode." ); // + sw.WriteLine( "WindowX={0}", this.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョX ); // + sw.WriteLine(); // + sw.WriteLine( "; 繧ヲ繧」繝ウ繝峨え繝「繝シ繝画凾縺ョ菴咲スョY" ); // + sw.WriteLine( "; Y position in the window mode." ); // + sw.WriteLine( "WindowY={0}", this.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョY ); // + sw.WriteLine(); // + + sw.WriteLine( "; 繧ヲ繧、繝ウ繝峨え繧偵ム繝悶Ν繧ッ繝ェ繝繧ッ縺励◆譎ゅ↓繝輔Ν繧ケ繧ッ繝ェ繝シ繝ウ縺ォ遘サ陦後☆繧九°(0:遘サ陦後@縺ェ縺,1:遘サ陦後☆繧)" ); // #26752 2011.11.27 yyagi + sw.WriteLine( "; Whether double click to go full screen mode or not.(0:No, 1:Yes)" ); // + sw.WriteLine( "DoubleClickFullScreen={0}", this.bIsAllowedDoubleClickFullscreen? 1 : 0); // + sw.WriteLine(); // + sw.WriteLine( "; ALT+SPACE縺ョ繝。繝九Η繝シ陦ィ遉コ繧呈椛蛻カ縺吶k縺九←縺縺(0:謚大宛縺吶k 1:謚大宛縺励↑縺)" ); // #28200 2012.5.1 yyagi + sw.WriteLine( "; Whether ALT+SPACE menu would be masked or not.(0=masked 1=not masked)" ); // + sw.WriteLine( "EnableSystemMenu={0}", this.bIsEnabledSystemMenu? 1 : 0 ); // + sw.WriteLine(); // + sw.WriteLine( "; 髱槭ヵ繧ゥ繝シ繧ォ繧ケ譎ゅョsleep蛟、[ms]" ); // #23568 2011.11.04 ikanick add + sw.WriteLine( "; A sleep time[ms] while the window is inactive." ); // + sw.WriteLine( "BackSleep={0}", this.n髱槭ヵ繧ゥ繝シ繧ォ繧ケ譎ゅせ繝ェ繝シ繝洋s ); // 縺昴ョ縺セ縺セ蠑慕畑シ郁協隨托シ + sw.WriteLine(); // + #endregion + #region [ 繝輔か繝ウ繝 ] + sw.WriteLine("; 繝輔か繝ウ繝医Ξ繝ウ繝繝ェ繝ウ繧ー縺ォ菴ソ逕ィ縺吶k繝輔か繝ウ繝亥錐"); + sw.WriteLine("; Font name used for font rendering."); + sw.WriteLine("FontName={0}", this.FontName); + sw.WriteLine(); + sw.WriteLine("; Box縺ョ隱ャ譏取枚縺ョ繝輔か繝ウ繝医Ξ繝ウ繝繝ェ繝ウ繧ー縺ォ菴ソ逕ィ縺吶k繝輔か繝ウ繝亥錐"); + sw.WriteLine("; Font name used for font rendering."); + sw.WriteLine("BoxFontName={0}", this.BoxFontName); + sw.WriteLine(); + #endregion + #region [ 繝輔Ξ繝シ繝蜃ヲ逅髢「騾」(VSync, 繝輔Ξ繝シ繝豈弱ョsleep) ] + sw.WriteLine("; 蝙ら峩蟶ー邱壼酔譛(0:OFF,1:ON)"); + sw.WriteLine( "VSyncWait={0}", this.b蝙ら峩蟶ー邱壼セ縺。繧定。後≧ ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine( "; 繝輔Ξ繝シ繝豈弱ョsleep蛟、[ms] (-1縺ァ繧ケ繝ェ繝シ繝礼┌縺, 0莉・荳翫〒豈弱ヵ繝ャ繝シ繝繧ケ繝ェ繝シ繝励ょ虚逕サ繧ュ繝」繝励メ繝」遲峨〒豢サ逕ィ荳九&縺)" ); // #xxxxx 2011.11.27 yyagi add + sw.WriteLine( "; A sleep time[ms] per frame." ); // + sw.WriteLine( "SleepTimePerFrame={0}", this.n繝輔Ξ繝シ繝豈弱せ繝ェ繝シ繝洋s ); // + sw.WriteLine(); // + #endregion + + #region [ WASAPI/ASIO髢「騾」 ] + sw.WriteLine( "; 繧オ繧ヲ繝ウ繝牙コ蜉帶婿蠑(0=ACM(縺」縺ヲ莉翫ッ縺セ縺DirectSound縺ァ縺吶′), 1=ASIO, 2=WASAPI)" ); + sw.WriteLine( "; WASAPI縺ッVista莉・髯阪ョOS縺ァ菴ソ逕ィ蜿ッ閭ス縲よ耳螂ィ譁ケ蠑上ッWASAPI縲" ); + sw.WriteLine( "; 縺ェ縺翫仝ASAPI縺御スソ逕ィ荳榊庄縺ェ繧陰SIO繧偵、SIO縺御スソ逕ィ荳榊庄縺ェ繧陰CM繧剃スソ逕ィ縺励∪縺吶" ); + sw.WriteLine( "; Sound device type(0=ACM, 1=ASIO, 2=WASAPI)" ); + sw.WriteLine( "; WASAPI can use on Vista or later OSs." ); + sw.WriteLine( "; If WASAPI is not available, DTXMania try to use ASIO. If ASIO can't be used, ACM is used." ); + sw.WriteLine( "SoundDeviceType={0}", (int) this.nSoundDeviceType ); + sw.WriteLine(); + + sw.WriteLine( "; WASAPI菴ソ逕ィ譎ゅョ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ繧オ繧、繧コ" ); + sw.WriteLine( "; (0=繝繝舌う繧ケ縺ォ險ュ螳壹&繧後※縺繧句、繧剃スソ逕ィ, 1ス9999=繝舌ャ繝輔ぃ繧オ繧、繧コ(蜊倅ス:ms)縺ョ謇句虚謖螳" ); + sw.WriteLine( "; WASAPI Sound Buffer Size." ); + sw.WriteLine( "; (0=Use system default buffer size, 1-9999=specify the buffer size(ms) by yourself)" ); + sw.WriteLine( "WASAPIBufferSizeMs={0}", (int) this.nWASAPIBufferSizeMs ); + sw.WriteLine(); + + sw.WriteLine( "; ASIO菴ソ逕ィ譎ゅョ繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ" ); + sw.WriteLine( "; 蟄伜惠縺励↑縺繝繝舌う繧ケ繧呈欠螳壹☆繧九→縲.TXMania縺瑚オキ蜍輔@縺ェ縺縺薙→縺後≠繧翫∪縺吶" ); + sw.WriteLine( "; Sound device used by ASIO." ); + sw.WriteLine( "; Don't specify unconnected device, as the DTXMania may not bootup." ); + string[] asiodev = CEnumerateAllAsioDevices.GetAllASIODevices(); + for ( int i = 0; i < asiodev.Length; i++ ) + { + sw.WriteLine( "; {0}: {1}", i, asiodev[ i ] ); + } + sw.WriteLine( "ASIODevice={0}", (int) this.nASIODevice ); + sw.WriteLine(); + + //sw.WriteLine( "; ASIO菴ソ逕ィ譎ゅョ繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ繧オ繧、繧コ" ); + //sw.WriteLine( "; (0=繝繝舌う繧ケ縺ォ險ュ螳壹&繧後※縺繧句、繧剃スソ逕ィ, 1ス9999=繝舌ャ繝輔ぃ繧オ繧、繧コ(蜊倅ス:ms)縺ョ謇句虚謖螳" ); + //sw.WriteLine( "; ASIO Sound Buffer Size." ); + //sw.WriteLine( "; (0=Use the value specified to the device, 1-9999=specify the buffer size(ms) by yourself)" ); + //sw.WriteLine( "ASIOBufferSizeMs={0}", (int) this.nASIOBufferSizeMs ); + //sw.WriteLine(); + + //sw.WriteLine( "; Bass.Mix縺ョ蛻カ蠕。繧貞虚逧縺ォ陦後≧縺句凄縺九" ); + //sw.WriteLine( "; ON縺ォ縺吶k縺ィ縲√ぐ繧ソ繝シ譖イ縺ェ縺ゥ繝√ャ繝鈴浹縺ョ螟壹>譖イ繧ょ咲函縺ァ縺阪∪縺吶′縲∫判髱「縺悟ー代@縺後◆縺、縺阪∪縺吶" ); + //sw.WriteLine( "; (0=陦後o縺ェ縺, 1=陦後≧)" ); + //sw.WriteLine( "DynamicBassMixerManagement={0}", this.bDynamicBassMixerManagement ? 1 : 0 ); + //sw.WriteLine(); + + sw.WriteLine( "; WASAPI/ASIO譎ゅ↓菴ソ逕ィ縺吶k貍泌・上ち繧、繝槭シ縺ョ遞ョ鬘" ); + sw.WriteLine( "; Playback timer used for WASAPI/ASIO" ); + sw.WriteLine( "; (0=FDK Timer, 1=System Timer)" ); + sw.WriteLine( "SoundTimerType={0}", this.bUseOSTimer ? 1 : 0 ); + sw.WriteLine(); + + //sw.WriteLine( "; 蜈ィ菴薙懊Μ繝・繝シ繝縺ョ險ュ螳" ); + //sw.WriteLine( "; (0=辟。髻ウ ス 100=譛螟ァ縲8ASAPI/ASIO譎ゅョ縺ソ譛牙柑)" ); + //sw.WriteLine( "; Master volume settings" ); + //sw.WriteLine( "; (0=Silent - 100=Max)" ); + //sw.WriteLine( "MasterVolume={0}", this.nMasterVolume ); + //sw.WriteLine(); + + #endregion + sw.WriteLine( "; 閭梧勹逕サ蜒上ョ蜊企乗主牡蜷(0:騾乗趣ス255:荳埼乗)" ); + sw.WriteLine( "; Transparency for background image in playing screen.(0:tranaparent - 255:no transparent)" ); + sw.WriteLine( "BGAlpha={0}", this.nBGAlpha ); + sw.WriteLine(); + sw.WriteLine( "; 繧イ繝シ繧ク繧シ繝ュ縺ァSTAGE FAILED (0:OFF, 1:ON)" ); + sw.WriteLine( "StageFailed={0}", this.bSTAGEFAILED譛牙柑 ? 1 : 0 ); + sw.WriteLine(); + #region [ AVI/BGA ] + sw.WriteLine( "; AVI縺ョ陦ィ遉コ(0:OFF, 1:ON)" ); + sw.WriteLine( "AVI={0}", this.bAVI譛牙柑 ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine( "; BGA縺ョ陦ィ遉コ(0:OFF, 1:ON)" ); + sw.WriteLine( "BGA={0}", this.bBGA譛牙柑 ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine( "; 蜍慕判陦ィ遉コ繝「繝シ繝( 0:陦ィ遉コ縺励↑縺, 1:閭梧勹縺ョ縺ソ, 2:遯楢。ィ遉コ縺ョ縺ソ, 3:荳。譁ケ)" ); + sw.WriteLine( "ClipDispType={0}", (int) this.eClipDispType ); + sw.WriteLine(); + #endregion + #region [ 繝励Ξ繝薙Η繝シ髻ウ ] + sw.WriteLine( "; 譖イ驕ク謚槭°繧峨励Ξ繝薙Η繝シ髻ウ縺ョ蜀咲函縺セ縺ァ縺ョ繧ヲ繧ァ繧、繝[ms]" ); + sw.WriteLine( "PreviewSoundWait={0}", this.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ髻ウ縺碁ウエ繧九∪縺ァ縺ョ繧ヲ繧ァ繧、繝ms ); + sw.WriteLine(); + sw.WriteLine( "; 譖イ驕ク謚槭°繧峨励Ξ繝薙Η繝シ逕サ蜒剰。ィ遉コ縺セ縺ァ縺ョ繧ヲ繧ァ繧、繝[ms]" ); + sw.WriteLine( "PreviewImageWait={0}", this.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ逕サ蜒上′陦ィ遉コ髢句ァ九&繧後k縺セ縺ァ縺ョ繧ヲ繧ァ繧、繝ms ); + sw.WriteLine(); + #endregion + //sw.WriteLine( "; Wave縺ョ蜀咲函菴咲スョ閾ェ蜍戊」懈ュ」(0:OFF, 1:ON)" ); + //sw.WriteLine( "AdjustWaves={0}", this.bWave蜀咲函菴咲スョ閾ェ蜍戊ェソ謨エ讖溯ス譛牙柑 ? 1 : 0 ); + #region [ BGM/繝峨Λ繝繝偵ャ繝磯浹縺ョ蜀咲函 ] + sw.WriteLine( "; BGM 縺ョ蜀咲函(0:OFF, 1:ON)" ); + sw.WriteLine( "BGMSound={0}", this.bBGM髻ウ繧堤匱螢ー縺吶k ? 1 : 0 ); + sw.WriteLine(); + #endregion + sw.WriteLine( "; 貍泌・剰ィ倬鹸シ茨ス.score.iniシ峨ョ蜃コ蜉 (0:OFF, 1:ON)" ); + sw.WriteLine( "SaveScoreIni={0}", this.bScoreIni繧貞コ蜉帙☆繧 ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine("; 譛蟆剰。ィ遉コ繧ウ繝ウ繝懈焚"); + sw.WriteLine("MinComboDrums={0}", this.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚.Drums); + sw.WriteLine(); + sw.WriteLine( "; RANDOM SELECT 縺ァ蟄殖OX繧呈、懃エ「蟇セ雎。縺ォ蜷ォ繧√k (0:OFF, 1:ON)" ); + sw.WriteLine( "RandomFromSubBox={0}", this.b繝ゥ繝ウ繝繝繧サ繝ャ繧ッ繝医〒蟄殖OX繧呈、懃エ「蟇セ雎。縺ィ縺吶k ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine( "; 貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k (0:OFF, 1:ON)" ); + sw.WriteLine( "; Showing playing info on the playing screen. (0:OFF, 1:ON)" ); + sw.WriteLine( "ShowDebugStatus={0}", this.b貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine("; BS1770GAIN 縺ォ繧医k繝ゥ繧ヲ繝峨ロ繧ケ繝。繝シ繧ソ縺ョ貂ャ驥上r驕ゥ逕ィ縺吶k (0:OFF, 1:ON)"); + sw.WriteLine( "; Apply BS1770GAIN loudness metadata (0:OFF, 1:ON)" ); + sw.WriteLine( "{0}={1}", nameof(ApplyLoudnessMetadata), this.ApplyLoudnessMetadata ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine( $"; BS1770GAIN 縺ォ繧医k繝ゥ繧ヲ繝峨ロ繧ケ繝。繝シ繧ソ縺ョ逶ョ讓吝、 (0). ({CSound.MinimumLufs}-{CSound.MaximumLufs})" ); + sw.WriteLine( $"; Loudness Target in dB (decibels) relative to full scale (0). ({CSound.MinimumLufs}-{CSound.MaximumLufs})" ); + sw.WriteLine( "{0}={1}", nameof(TargetLoudness), TargetLoudness ); + sw.WriteLine(); + sw.WriteLine("; .tja繝輔ぃ繧、繝ォ縺ョSONGVOL繝倥ャ繝繧帝浹貅舌ョ髻ウ驥上↓驕ゥ逕ィ縺吶k (0:OFF, 1:ON)"); + sw.WriteLine( "; Apply SONGVOL (0:OFF, 1:ON)" ); + sw.WriteLine( "{0}={1}", nameof(ApplySongVol), this.ApplySongVol ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine( $"; 蜉ケ譫憺浹縺ョ髻ウ驥 ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)" ); + sw.WriteLine( $"; Sound effect level ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)" ); + sw.WriteLine( "{0}={1}", nameof(SoundEffectLevel), SoundEffectLevel ); + sw.WriteLine(); + sw.WriteLine( $"; 蜷繝懊う繧ケ縲√さ繝ウ繝懊懊う繧ケ縺ョ髻ウ驥 ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)" ); + sw.WriteLine( $"; Voice level ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)" ); + sw.WriteLine( "{0}={1}", nameof(VoiceLevel), VoiceLevel ); + sw.WriteLine(); + sw.WriteLine( $"; 繧イ繝シ繝荳ュ縺ョ髻ウ貅舌ョ髻ウ驥 ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)" ); + sw.WriteLine( $"; Song playback level ({CSound.MinimumGroupLevel}-{CSound.MaximumGroupLevel}%)" ); + sw.WriteLine( "{0}={1}", nameof(SongPlaybackLevel), SongPlaybackLevel ); + sw.WriteLine(); + sw.WriteLine( $"; 繧ュ繝シ繝懊シ繝峨↓繧医k髻ウ驥丞、画峩縺ョ蠅怜刈驥上∵ク帛ー鷹 ({MinimumKeyboardSoundLevelIncrement}-{MaximumKeyboardSoundLevelIncrement})" ); + sw.WriteLine( $"; Keyboard sound level increment ({MinimumKeyboardSoundLevelIncrement}-{MaximumKeyboardSoundLevelIncrement})" ); + sw.WriteLine( "{0}={1}", nameof(KeyboardSoundLevelIncrement), KeyboardSoundLevelIncrement ); + sw.WriteLine($"; 髻ウ貅仙咲函蜑阪ョ遨コ逋ス譎る俣 (ms)"); + sw.WriteLine($"; Blank time before music source to play. (ms)"); + sw.WriteLine("{0}={1}", nameof(MusicPreTimeMs), MusicPreTimeMs); + sw.WriteLine(); + sw.WriteLine( "; 繧ケ繝医う繝繧ッ繝「繝シ繝(0:OFF, 1:ON)" ); + sw.WriteLine( "; Stoic mode. (0:OFF, 1:ON)" ); + sw.WriteLine( "StoicMode={0}", this.b繧ケ繝医う繝繧ッ繝「繝シ繝 ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine( "; 繝舌ャ繝輔ぃ蜈・蜉帙Δ繝シ繝(0:OFF, 1:ON)" ); + sw.WriteLine( "; Using Buffered input (0:OFF, 1:ON)" ); + sw.WriteLine( "BufferedInput={0}", this.b繝舌ャ繝輔ぃ蜈・蜉帙r陦後≧ ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine( "; 繝ェ繧カ繝ォ繝育判蜒剰ェ蜍穂ソ晏ュ俶ゥ溯ス(0:OFF, 1:ON)" ); // #25399 2011.6.9 yyagi + sw.WriteLine( "; Set \"1\" if you'd like to save result screen image automatically"); // + sw.WriteLine( "; when you get hiscore/hiskill."); // + sw.WriteLine( "AutoResultCapture={0}", this.bIsAutoResultCapture? 1 : 0 ); // + sw.WriteLine(); + sw.WriteLine("; Discord縺ォ蜀咲函荳ュ縺ョ隴憺擇諠蝣ア繧帝∽ソ。縺吶k(0:OFF, 1:ON)"); // #25399 2011.6.9 yyagi + sw.WriteLine("; Share Playing .tja file infomation on Discord."); // + sw.WriteLine("{0}={1}", nameof(SendDiscordPlayingInformation), SendDiscordPlayingInformation ? 1 : 0); // + sw.WriteLine(); + sw.WriteLine( "; 蜀咲函騾溷コヲ螟画峩繧偵√ヴ繝繝∝、画峩縺ァ陦後≧縺九←縺縺(0:繝斐ャ繝∝、画峩, 1:繧ソ繧、繝繧ケ繝医Ξ繝繝" ); // #23664 2013.2.24 yyagi + sw.WriteLine( "; (WASAPI/ASIO菴ソ逕ィ譎ゅョ縺ソ譛牙柑) " ); + sw.WriteLine( "; Set \"0\" if you'd like to use pitch shift with PlaySpeed." ); // + sw.WriteLine( "; Set \"1\" for time stretch." ); // + sw.WriteLine( "; (Only available when you're using using WASAPI or ASIO)" ); // + sw.WriteLine( "TimeStretch={0}", this.bTimeStretch ? 1 : 0 ); // + sw.WriteLine(); + //sw.WriteLine( "; WASAPI/ASIO菴ソ逕ィ譎ゅ↓縲`P3繧偵せ繝医Μ繝シ繝蜀咲函縺吶k縺九←縺縺(0:繧ケ繝医Μ繝シ繝蜀咲函縺吶k, 1:縺励↑縺)" ); // + //sw.WriteLine( "; (mp3縺ョ繧キ繝シ繧ッ縺後♀縺九@縺上↑繧句エ蜷医ッ縲√%繧後r1縺ォ縺励※縺上□縺輔>) " ); // + //sw.WriteLine( "; Set \"0\" if you'd like to use mp3 streaming playback on WASAPI/ASIO." ); // + //sw.WriteLine( "; Set \"1\" not to use streaming playback for mp3." ); // + //sw.WriteLine( "; (If you feel illegal seek with mp3, please set it to 1.)" ); // + //sw.WriteLine( "NoMP3Streaming={0}", this.bNoMP3Streaming ? 1 : 0 ); // + //sw.WriteLine(); + sw.WriteLine( "; 蜍慕判蜀咲函縺ォDirectShow繧剃スソ逕ィ縺吶k(0:OFF, 1:ON)" ); + sw.WriteLine( "; 蜍慕判蜀咲函縺ォDirectShow繧剃スソ縺縺薙→縺ォ繧医▲縺ヲ縲∝咲函譎ゅョ雋諡繧定サス貂帙〒縺阪∪縺吶"); + sw.WriteLine( "; 縺溘□縺嶺スソ逕ィ譎ゅ↓縺ッ繧サ繝繝医い繝繝励′蠢隕√↓縺ェ繧九ョ縺ァ縺疲ウィ諢上¥縺縺輔>縲"); + sw.WriteLine( "DirectShowMode={0}", this.bDirectShowMode ? 1 : 0 ); + sw.WriteLine(); + + #region [ Adjust ] + sw.WriteLine( "; 蛻、螳壹ち繧、繝溘Φ繧ー隱ソ謨エ(-99ス99)[ms]" ); + sw.WriteLine("; Revision value to adjust judgment timing."); // + sw.WriteLine("InputAdjustTime={0}", this.nInputAdjustTimeMs); // + sw.WriteLine(); + + sw.WriteLine( "; 蛻、螳壹Λ繧、繝ウ縺ョ陦ィ遉コ菴咲スョ隱ソ謨エ(繝峨Λ繝, 繧ョ繧ソ繝シ, 繝吶シ繧ケ)(-99ス99)[px]" ); // #31602 2013.6.23 yyagi 蛻、螳壹Λ繧、繝ウ縺ョ陦ィ遉コ菴咲スョ繧ェ繝輔そ繝繝 + sw.WriteLine( "; Offset value to adjust displaying judgement line for the drums, guitar and bass." ); // + sw.WriteLine( "JudgeLinePosOffsetDrums={0}", this.nJudgeLinePosOffset.Drums ); // + sw.WriteLine(); + #endregion + sw.WriteLine( "; 縲後∪縺滄♀繧薙〒縺ュ縲咲判髱「(0:OFF, 1:ON)" ); + sw.WriteLine( "EndingAnime={0}", this.bEndingAnime ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine( ";-------------------" ); + #endregion + + #region [ AutoPlay ] + sw.WriteLine("[AutoPlay]"); + sw.WriteLine(); + sw.WriteLine("; 閾ェ蜍墓シ泌・(0:OFF, 1:ON)"); + sw.WriteLine("Taiko={0}", this.b螟ェ鮠薙ヱ繝シ繝AutoPlay ? 1 : 0); + sw.WriteLine("Taiko2P={0}", this.b螟ェ鮠薙ヱ繝シ繝AutoPlay2P ? 1 : 0); + sw.WriteLine("TaikoAutoRoll={0}", this.bAuto蜈育函縺ョ騾」謇 ? 1 : 0); + sw.WriteLine(); + sw.WriteLine(";-------------------"); + #endregion + + #region [ HitRange ] + sw.WriteLine("[HitRange]"); + sw.WriteLine(); + sw.WriteLine("; Perfectス霸oor 縺ィ縺ソ縺ェ縺輔l繧狗ッ蝗イ[ms]"); + sw.WriteLine("Perfect={0}", this.n繝偵ャ繝育ッ蝗イms.Perfect); + sw.WriteLine("Good={0}", this.n繝偵ャ繝育ッ蝗イms.Good); + sw.WriteLine("Poor={0}", this.n繝偵ャ繝育ッ蝗イms.Poor); + sw.WriteLine(); + sw.WriteLine(";-------------------"); + #endregion + + #region [ Log ] + sw.WriteLine( "[Log]" ); + sw.WriteLine(); + sw.WriteLine( "; Log蜃コ蜉(0:OFF, 1:ON)" ); + sw.WriteLine( "OutputLog={0}", this.b繝ュ繧ー蜃コ蜉 ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine( "; 譖イ繝繝シ繧ソ讀懃エ「縺ォ髢「縺吶kLog蜃コ蜉(0:OFF, 1:ON)" ); + sw.WriteLine( "TraceSongSearch={0}", this.bLog譖イ讀懃エ「繝ュ繧ー蜃コ蜉 ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine( "; 逕サ蜒上d繧オ繧ヲ繝ウ繝峨ョ菴懈神隗」謾セ縺ォ髢「縺吶kLog蜃コ蜉(0:OFF, 1:ON)" ); + sw.WriteLine( "TraceCreatedDisposed={0}", this.bLog菴懈占ァ」謾セ繝ュ繧ー蜃コ蜉 ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine( "; DTX隱ュ縺ソ霎シ縺ソ隧ウ邏ー縺ォ髢「縺吶kLog蜃コ蜉(0:OFF, 1:ON)" ); + sw.WriteLine( "TraceDTXDetails={0}", this.bLogDTX隧ウ邏ー繝ュ繧ー蜃コ蜉 ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine( ";-------------------" ); + #endregion + + #region [ PlayOption ] + sw.WriteLine( "[PlayOption]" ); + sw.WriteLine(); + sw.WriteLine("; 蜷逕サ蜒上ョ陦ィ遉コ險ュ螳"); + sw.WriteLine("; 繧ュ繝」繝ゥ繧ッ繧ソ繝シ逕サ蜒上r陦ィ遉コ縺吶k (0:OFF, 1:ON)"); + sw.WriteLine("ShowChara={0}", ShowChara ? 1 : 0); + sw.WriteLine("; 繝繝ウ繧オ繝シ逕サ蜒上r陦ィ遉コ縺吶k (0:OFF, 1:ON)"); + sw.WriteLine("ShowDancer={0}", ShowDancer ? 1 : 0); + sw.WriteLine("; 繝ゥ繝ウ繝翫シ逕サ蜒上r陦ィ遉コ縺吶k (0:OFF, 1:ON)"); + sw.WriteLine("ShowRunner={0}", ShowRunner ? 1 : 0); + sw.WriteLine("; 繝「繝也判蜒上r陦ィ遉コ縺吶k (0:OFF, 1:ON)"); + sw.WriteLine("ShowMob={0}", ShowMob ? 1 : 0); + sw.WriteLine("; 繝輔ャ繧ソ繝シ逕サ蜒 (0:OFF, 1:ON)"); + sw.WriteLine("ShowFooter={0}", ShowFooter ? 1 : 0); + sw.WriteLine("; 縺キ縺。繧ュ繝」繝ゥ逕サ蜒 (0:OFF, 1:ON)"); + sw.WriteLine("ShowPuchiChara={0}", ShowPuchiChara ? 1 : 0); + sw.WriteLine(); + sw.WriteLine( "; DARK繝「繝シ繝(0:OFF, 1:HALF, 2:FULL)" ); + sw.WriteLine( "Dark={0}", (int) this.eDark ); + sw.WriteLine(); + sw.WriteLine(); + sw.WriteLine("; 驕ク譖イ逕サ髱「縺ァ縺ョ繧ソ繧、繝槭シ繧呈怏蜉ケ縺ォ縺吶k縺九←縺縺(0:辟。蜉ケ,1:譛牙柑)"); + sw.WriteLine("; Enable countdown in songselect.(0:No, 1:Yes)"); + sw.WriteLine("EnableCountDownTimer={0}", this.bEnableCountdownTimer ? 1 : 0); + sw.WriteLine(); + #region [ SUDDEN ] + sw.WriteLine( "; 繝峨Λ繝SUDDEN繝「繝シ繝(0:OFF, 1:ON)" ); + sw.WriteLine( "DrumsSudden={0}", this.bSudden.Drums ? 1 : 0 ); + sw.WriteLine(); + #endregion + #region [ HIDDEN ] + sw.WriteLine( "; 繝峨Λ繝HIDDEN繝「繝シ繝(0:OFF, 1:ON)" ); + sw.WriteLine( "DrumsHidden={0}", this.bHidden.Drums ? 1 : 0 ); + sw.WriteLine(); + #endregion + #region [ Invisible ] + sw.WriteLine( "; 繝峨Λ繝繝√ャ繝鈴撼陦ィ遉コ繝「繝シ繝 (0:OFF, 1=SEMI, 2:FULL)" ); + sw.WriteLine( "; Drums chip invisible mode" ); + sw.WriteLine( "DrumsInvisible={0}", (int) this.eInvisible.Drums ); + sw.WriteLine(); + //sw.WriteLine( "; Semi-Invisible縺ァMiss縺」縺滓凾縺ョ繝√ャ繝怜崎。ィ遉コ譎る俣(ms)" ); + //sw.WriteLine( "InvisibleDisplayTimeMs={0}", (int) this.nDisplayTimesMs ); + //sw.WriteLine(); + //sw.WriteLine( "; Semi-Invisible縺ァMiss縺」縺ヲ繝√ャ繝怜崎。ィ遉コ譎る俣邨ゆコ蠕後ョ繝輔ぉ繝シ繝峨い繧ヲ繝域凾髢(ms)" ); + //sw.WriteLine( "InvisibleFadeoutTimeMs={0}", (int) this.nFadeoutTimeMs ); + //sw.WriteLine(); + #endregion + sw.WriteLine( "; 繝峨Λ繝REVERSE繝「繝シ繝(0:OFF, 1:ON)" ); + sw.WriteLine( "DrumsReverse={0}", this.bReverse.Drums ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine( "; RISKY繝「繝シ繝(0:OFF, 1-10)" ); // #23559 2011.6.23 yyagi + sw.WriteLine( "; RISKY mode. 0=OFF, 1-10 is the times of misses to be Failed." ); // + sw.WriteLine( "Risky={0}", this.nRisky ); // + sw.WriteLine(); + sw.WriteLine( "; TIGHT繝「繝シ繝(0:OFF, 1:ON)" ); // #29500 2012.9.11 kairera0467 + sw.WriteLine( "; TIGHT mode. 0=OFF, 1=ON " ); + sw.WriteLine( "DrumsTight={0}", this.bTight ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine("; 繝峨Λ繝隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ(0:x0.1, 9:x1.0, 14:x1.5,窶ヲ,1999:x200.0)"); + sw.WriteLine( "DrumsScrollSpeed={0}", this.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums ); + sw.WriteLine(); + sw.WriteLine( "; 貍泌・城溷コヲ(5ス40)(竊遅5/20ス栞40/20)" ); + sw.WriteLine( "PlaySpeed={0}", this.n貍泌・城溷コヲ ); + sw.WriteLine(); + + sw.WriteLine("; 貍泌・城溷コヲ縺御ク蛟埼溘〒縺ゅk縺ィ縺阪ョ縺ソBGM繧貞咲函縺吶k(0:OFF, 1:ON)"); + sw.WriteLine("PlaySpeedNotEqualOneNoSound={0}", this.b貍泌・城溷コヲ縺御ク蛟埼溘〒縺ゅk縺ィ縺堺サ・螟夜浹螢ー繧貞咲函縺励↑縺 ? 1 : 0); + sw.WriteLine(); + sw.WriteLine("; 繝繝輔か繝ォ繝医〒驕ク謚槭&繧後k髮」譏灘コヲ"); + sw.WriteLine("DefaultCourse={0}", this.nDefaultCourse); + sw.WriteLine(); + sw.WriteLine( "; 隴憺擇蛻蟯舌ョ繧ャ繧、繝芽。ィ遉コ(0:OFF, 1:ON)" ); + sw.WriteLine( "BranchGuide={0}", this.bGraph.Drums ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine( "; 繧ケ繧ウ繧「險育ョ玲婿豕(0:譌ァ驟咲せ, 1:譌ァ遲蝉ス馴咲せ, 2:譁ー驟咲せ)" ); + sw.WriteLine( "ScoreMode={0}", this.nScoreMode ); + sw.WriteLine(); + sw.WriteLine("; 逵滓遠繝「繝シ繝 (0:OFF, 1:ON)"); + sw.WriteLine("; Fixed score mode (0:OFF, 1:ON)"); + sw.WriteLine("{0}={1}", nameof(ShinuchiMode), ShinuchiMode ? 1 : 0); + //sw.WriteLine( "; 1繝弱シ繝縺斐→縺ョ繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ繧偵Λ繝ウ繝繝縺ァ螟画峩縺励∪縺吶(0:OFF, 1:ON)" ); + //sw.WriteLine( "HispeedRandom={0}", this.bHispeedRandom ? 1 : 0 ); + //sw.WriteLine(); + sw.WriteLine( "; 螟ァ髻ウ隨ヲ縺ョ荳。謇句・蜉帛セ讖滓凾髢(ms)" ); + sw.WriteLine( "BigNotesWaitTime={0}", this.n荳。謇句愛螳壹ョ蠕縺。譎る俣 ); + sw.WriteLine(); + sw.WriteLine( "; 螟ァ髻ウ隨ヲ縺ョ荳。謇句愛螳(0:OFF, 1:ON)" ); + sw.WriteLine( "BigNotesJudge={0}", this.b螟ァ髻ウ隨ヲ蛻、螳 ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine( "; NoInfo(0:OFF, 1:ON)" ); + sw.WriteLine( "NoInfo={0}", this.bNoInfo ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine( "; 隴憺擇蛻蟯舌ョ繧「繝九Γ繝シ繧キ繝ァ繝ウ(0:7ス14, 1:15)" ); + sw.WriteLine( "BranchAnime={0}", this.nBranchAnime ); + sw.WriteLine(); + sw.WriteLine( "; 繝繝輔か繝ォ繝医ョ譖イ繧ス繝シ繝(0:邨カ蟇セ繝代せ鬆, 1:繧ク繝」繝ウ繝ォ蜷阪た繝シ繝OLD, 2:繧ク繝」繝ウ繝ォ蜷阪た繝シ繝NEW )" ); + sw.WriteLine( "0:Path, 1:GenreName(AC8ス暸C14), 2GenreName(AC15ス)" ); + sw.WriteLine( "DefaultSongSort={0}", this.nDefaultSongSort ); + sw.WriteLine(); + sw.WriteLine( "; RANDOM繝「繝シ繝(0:OFF, 1:Random, 2:Mirorr 3:SuperRandom, 4:HyperRandom)" ); + sw.WriteLine( "TaikoRandom={0}", (int) this.eRandom.Taiko ); + sw.WriteLine(); + sw.WriteLine( "; STEALTH繝「繝シ繝(0:OFF, 1:繝峨Ο繝ウ, 2:繧ケ繝繝ォ繧ケ)" ); + sw.WriteLine( "TaikoStealth={0}", (int) this.eSTEALTH ); + sw.WriteLine(); + sw.WriteLine( "; 繧イ繝シ繝(0:OFF, 1:螳瑚オー!蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ!, 2:螳瑚オー!蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ!(豼霎) )" ); + sw.WriteLine( "GameMode={0}", (int) this.eGameMode ); + sw.WriteLine(); + sw.WriteLine(); + sw.WriteLine("; 迚ケ險薙Δ繝シ繝画凾縺ォPgUp/PgDn縺ァ菴募ー冗ッ鬟帙ー縺吶°"); + sw.WriteLine("TokkunSkipMeasures={0}", this.TokkunSkipMeasures); + sw.WriteLine(); + sw.WriteLine("; 迚ケ險薙Δ繝シ繝画凾縺ォ繧ク繝」繝ウ繝励昴う繝ウ繝医↓鬟帙ー縺吶◆繧√ョ譎る俣(ms)"); + sw.WriteLine("; 謖螳嗄s莉・蜀縺ォ5蝗樒ク√r蜿ゥ縺阪∪縺励g縺"); + sw.WriteLine("{1}={0}", this.TokkunMashInterval, nameof(this.TokkunMashInterval)); + sw.WriteLine(); + sw.WriteLine( "; JUST(0:OFF, 1:ON)" ); + sw.WriteLine( "Just={0}", this.bJust ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine( "; 蛻、螳壽焚縺ョ陦ィ遉コ(0:OFF, 1:ON)" ); + sw.WriteLine( "JudgeCountDisplay={0}", this.bJudgeCountDisplay ? 1 : 0 ); + sw.WriteLine(); + sw.WriteLine( "; 繝励Ξ繧、莠コ謨ー" ); + sw.WriteLine( "PlayerCount={0}", this.nPlayerCount ); + sw.WriteLine(); + //sw.WriteLine( "; 驕ク譖イ逕サ髱「縺ョ蛻晄悄驕ク謚樣屮譏灘コヲ(繝吶シ繧ソ迚)" ); + //sw.WriteLine( "DifficultPriority={0}", this.bJudgeCountDisplay ? 1 : 0 ); + //sw.WriteLine(); + + sw.WriteLine( ";-------------------" ); + #endregion + #region [ GUID ] + sw.WriteLine( "[GUID]" ); + sw.WriteLine(); + foreach( KeyValuePair pair in this.dicJoystick ) + { + sw.WriteLine( "JoystickID={0},{1}", pair.Key, pair.Value ); + } + #endregion + #region [ DrumsKeyAssign ] + sw.WriteLine(); + sw.WriteLine( ";-------------------" ); + sw.WriteLine( "; 繧ュ繝シ繧「繧オ繧、繝ウ" ); + sw.WriteLine( "; 鬆縲逶ョシ哮eyboard 竊 'K'シ'0'シ九く繝シ繧ウ繝シ繝(10騾イ謨ー)" ); + sw.WriteLine( "; Mouse 竊 'N'シ'0'シ九懊ち繝ウ逡ェ蜿キ(0ス7)" ); + sw.WriteLine( "; MIDI In 竊 'M'シ九ョ繝舌う繧ケ逡ェ蜿キ1譯(0ス9,Aス杙)シ九ヮ繝シ繝育分蜿キ(10騾イ謨ー)" ); + sw.WriteLine( "; Joystick 竊 'J'シ九ョ繝舌う繧ケ逡ェ蜿キ1譯(0ス9,Aス杙)シ 0 ...... シク貂帛ー(蟾ヲ)繝懊ち繝ウ" ); + sw.WriteLine( "; 1 ...... シク蠅怜刈(蜿ウ)繝懊ち繝ウ" ); + sw.WriteLine( "; 2 ...... シケ貂帛ー(荳)繝懊ち繝ウ" ); + sw.WriteLine( "; 3 ...... シケ蠅怜刈(荳)繝懊ち繝ウ" ); + sw.WriteLine( "; 4 ...... シコ貂帛ー(蜑)繝懊ち繝ウ" ); + sw.WriteLine( "; 5 ...... シコ蠅怜刈(蠕)繝懊ち繝ウ" ); + sw.WriteLine( "; 6ス133.. 繝懊ち繝ウ1ス128" ); + sw.WriteLine( "; 縺薙l繧峨ョ鬆逶ョ繧 16 蛟九∪縺ァ謖螳壼庄閭ス(',' 縺ァ蛹コ蛻縺」縺ヲ險倩ソーシ峨" ); + sw.WriteLine( ";" ); + sw.WriteLine( "; 陦ィ險倅セ具シ唏H=K044,M042,J16" ); + sw.WriteLine( "; 竊 HiHat 繧 Keyboard 縺ョ 44 ('Z'), MidiIn#0 縺ョ 42, JoyPad#1 縺ョ 6(繝懊ち繝ウ1) 縺ォ蜑イ蠖薙※" ); + sw.WriteLine( ";" ); + sw.WriteLine( "; 窶サJoystick 縺ョ繝繝舌う繧ケ逡ェ蜿キ縺ィ繝繝舌う繧ケ縺ィ縺ョ髢「菫ゅッ [GUID] 繧サ繧ッ繧キ繝ァ繝ウ縺ォ險倥@縺ヲ縺ゅk繧ゅョ縺梧怏蜉ケ縲" ); + sw.WriteLine( ";" ); + sw.WriteLine(); + sw.WriteLine( "[DrumsKeyAssign]" ); + sw.WriteLine(); + sw.Write( "LeftRed=" ); + this.t繧ュ繝シ縺ョ譖ク縺榊コ縺( sw, this.KeyAssign.Drums.LeftRed ); + sw.WriteLine(); + sw.Write( "RightRed=" ); + this.t繧ュ繝シ縺ョ譖ク縺榊コ縺( sw, this.KeyAssign.Drums.RightRed ); + sw.WriteLine(); + sw.Write( "LeftBlue=" ); // #27029 2012.1.4 from + this.t繧ュ繝シ縺ョ譖ク縺榊コ縺( sw, this.KeyAssign.Drums.LeftBlue ); // + sw.WriteLine(); // + sw.Write( "RightBlue=" ); // #27029 2012.1.4 from + this.t繧ュ繝シ縺ョ譖ク縺榊コ縺( sw, this.KeyAssign.Drums.RightBlue ); // + sw.WriteLine(); + sw.Write( "LeftRed2P=" ); + this.t繧ュ繝シ縺ョ譖ク縺榊コ縺( sw, this.KeyAssign.Drums.LeftRed2P ); + sw.WriteLine(); + sw.Write( "RightRed2P=" ); + this.t繧ュ繝シ縺ョ譖ク縺榊コ縺( sw, this.KeyAssign.Drums.RightRed2P ); + sw.WriteLine(); + sw.Write( "LeftBlue2P=" ); // #27029 2012.1.4 from + this.t繧ュ繝シ縺ョ譖ク縺榊コ縺( sw, this.KeyAssign.Drums.LeftBlue2P ); // + sw.WriteLine(); // + sw.Write( "RightBlue2P=" ); // #27029 2012.1.4 from + this.t繧ュ繝シ縺ョ譖ク縺榊コ縺( sw, this.KeyAssign.Drums.RightBlue2P ); // + sw.WriteLine(); + sw.WriteLine(); + #endregion + #region [ SystemkeyAssign ] + sw.WriteLine( "[SystemKeyAssign]" ); + sw.WriteLine(); + sw.Write( "Capture=" ); + this.t繧ュ繝シ縺ョ譖ク縺榊コ縺( sw, this.KeyAssign.System.Capture ); + sw.WriteLine(); + sw.WriteLine(); + #endregion + + sw.Close(); + } + public void t繝輔ぃ繧、繝ォ縺九i隱ュ縺ソ霎シ縺ソ( string ini繝輔ぃ繧、繝ォ蜷 ) + { + this.ConfigIni繝輔ぃ繧、繝ォ蜷 = ini繝輔ぃ繧、繝ォ蜷; + this.bConfigIni縺悟ュ伜惠縺励※縺繧 = File.Exists( this.ConfigIni繝輔ぃ繧、繝ォ蜷 ); + if( this.bConfigIni縺悟ュ伜惠縺励※縺繧 ) + { + string str; + this.t繧ュ繝シ繧「繧オ繧、繝ウ繧貞ィ驛ィ繧ッ繝ェ繧「縺吶k(); + using ( StreamReader reader = new StreamReader( this.ConfigIni繝輔ぃ繧、繝ォ蜷, Encoding.GetEncoding( "Shift_JIS" ) ) ) + { + str = reader.ReadToEnd(); + } + t譁蟄怜励°繧芽ェュ縺ソ霎シ縺ソ( str ); + CDTXVersion version = new CDTXVersion( this.strDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ ); + //if( version.n謨エ謨ー驛ィ <= 69 ) + //{ + // this.t繝繝輔か繝ォ繝医ョ繧ュ繝シ繧「繧オ繧、繝ウ縺ォ險ュ螳壹☆繧(); + //} + } + } + + private void t譁蟄怜励°繧芽ェュ縺ソ霎シ縺ソ( string strAllSettings ) // 2011.4.13 yyagi; refactored to make initial KeyConfig easier. + { + E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・ unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.Unknown; + string[] delimiter = { "\n" }; + string[] strSingleLine = strAllSettings.Split( delimiter, StringSplitOptions.RemoveEmptyEntries ); + foreach ( string s in strSingleLine ) + { + string str = s.Replace( '\t', ' ' ).TrimStart( new char[] { '\t', ' ' } ); + if ( ( str.Length != 0 ) && ( str[ 0 ] != ';' ) ) + { + try + { + string str3; + string str4; + if ( str[ 0 ] == '[' ) + { + #region [ 繧サ繧ッ繧キ繝ァ繝ウ縺ョ螟画峩 ] + //----------------------------- + StringBuilder builder = new StringBuilder( 0x20 ); + int num = 1; + while ( ( num < str.Length ) && ( str[ num ] != ']' ) ) + { + builder.Append( str[ num++ ] ); + } + string str2 = builder.ToString(); + if ( str2.Equals( "System" ) ) + { + unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.System; + } + else if (str2.Equals("AutoPlay")) + { + unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.AutoPlay; + } + else if (str2.Equals("HitRange")) + { + unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.HitRange; + } + else if ( str2.Equals( "Log" ) ) + { + unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.Log; + } + else if ( str2.Equals( "PlayOption" ) ) + { + unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.PlayOption; + } + else if ( str2.Equals( "ViewerOption" ) ) + { + unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.ViewerOption; + } + else if ( str2.Equals( "GUID" ) ) + { + unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.GUID; + } + else if ( str2.Equals( "DrumsKeyAssign" ) ) + { + unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.DrumsKeyAssign; + } + else if ( str2.Equals( "SystemKeyAssign" ) ) + { + unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.SystemKeyAssign; + } + else if( str2.Equals( "Temp" ) ) + { + unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.Temp; + } + else + { + unknown = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.Unknown; + } + //----------------------------- + #endregion + } + else + { + string[] strArray = str.Split( new char[] { '=' } ); + if( strArray.Length == 2 ) + { + str3 = strArray[ 0 ].Trim(); + str4 = strArray[ 1 ].Trim(); + switch( unknown ) + { + #region [ [System] ] + //----------------------------- + case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.System: + { +#if false // #23625 2011.1.11 Config.ini縺九i繝繝。繝シ繧ク/蝗槫セゥ蛟、縺ョ螳壽焚螟画峩繧定。後≧蝣エ蜷医ッ縺薙%繧呈怏蜉ケ縺ォ縺吶k 087繝ェ繝ェ繝シ繧ケ縺ォ蜷医o縺帶ゥ溯ス辟。蜉ケ蛹 + //---------------------------------------- + if (str3.Equals("GaugeFactorD")) + { + int p = 0; + string[] splittedFactor = str4.Split(','); + foreach (string s in splittedFactor) { + this.fGaugeFactor[p++, 0] = Convert.ToSingle(s); + } + } else + if (str3.Equals("GaugeFactorG")) + { + int p = 0; + string[] splittedFactor = str4.Split(','); + foreach (string s in splittedFactor) + { + this.fGaugeFactor[p++, 1] = Convert.ToSingle(s); + } + } + else + if (str3.Equals("DamageFactor")) + { + int p = 0; + string[] splittedFactor = str4.Split(','); + foreach (string s in splittedFactor) + { + this.fDamageLevelFactor[p++] = Convert.ToSingle(s); + } + } + else + //---------------------------------------- +#endif + #region [ Version ] + if ( str3.Equals( "Version" ) ) + { + this.strDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ = str4; + } + #endregion + #region [ TJAPath ] + else if( str3.Equals( "TJAPath" ) ) + { + this.str譖イ繝繝シ繧ソ讀懃エ「繝代せ = str4; + } + #endregion + #region [ skin髢「菫 ] + else if ( str3.Equals( "SkinPath" ) ) + { + string absSkinPath = str4; + if ( !System.IO.Path.IsPathRooted( str4 ) ) + { + absSkinPath = System.IO.Path.Combine( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝, "System" ); + absSkinPath = System.IO.Path.Combine( absSkinPath, str4 ); + Uri u = new Uri( absSkinPath ); + absSkinPath = u.AbsolutePath.ToString(); // str4蜀縺ォ逶ク蟇セ繝代せ縺後≠繧句エ蜷医↓蛯吶∴繧 + absSkinPath = System.Web.HttpUtility.UrlDecode( absSkinPath ); // 繝繧ウ繝シ繝峨☆繧 + absSkinPath = absSkinPath.Replace( '/', System.IO.Path.DirectorySeparatorChar ); // 蛹コ蛻繧頑枚蟄励′\縺ァ縺ッ縺ェ縺/縺ェ縺ョ縺ァ鄂ョ謠帙☆繧 + } + if ( absSkinPath[ absSkinPath.Length - 1 ] != System.IO.Path.DirectorySeparatorChar ) // 繝輔か繝ォ繝蜷肴忰蟆セ縺ォ\繧貞ソ縺壹▽縺代※縲,Skin蛛エ縺ィ陦ィ險倥r邨ア荳縺吶k + { + absSkinPath += System.IO.Path.DirectorySeparatorChar; + } + this.strSystemSkinSubfolderFullName = absSkinPath; + } + else if (str3.Equals(nameof(FastRender))) + { + FastRender = C螟画鋤.bONorOFF(str4[0]); + } + #endregion + #region [ Window髢「菫 ] + else if (str3.Equals("FullScreen")) + { + this.b蜈ィ逕サ髱「繝「繝シ繝 = C螟画鋤.bONorOFF(str4[0]); + } + else if ( str3.Equals( "WindowX" ) ) // #30675 2013.02.04 ikanick add + { + this.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョX = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( + str4, 0, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width - 1 , this.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョX ); + } + else if ( str3.Equals( "WindowY" ) ) // #30675 2013.02.04 ikanick add + { + this.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョY = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( + str4, 0, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height - 1 , this.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョY ); + } + else if ( str3.Equals( "WindowWidth" ) ) // #23510 2010.10.31 yyagi add + { + this.n繧ヲ繧、繝ウ繝峨えwidth = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 1, 65535, this.n繧ヲ繧、繝ウ繝峨えwidth ); + if( this.n繧ヲ繧、繝ウ繝峨えwidth <= 0 ) + { + this.n繧ヲ繧、繝ウ繝峨えwidth = SampleFramework.GameWindowSize.Width; + } + } + else if( str3.Equals( "WindowHeight" ) ) // #23510 2010.10.31 yyagi add + { + this.n繧ヲ繧、繝ウ繝峨えheight = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 1, 65535, this.n繧ヲ繧、繝ウ繝峨えheight ); + if( this.n繧ヲ繧、繝ウ繝峨えheight <= 0 ) + { + this.n繧ヲ繧、繝ウ繝峨えheight = SampleFramework.GameWindowSize.Height; + } + } + else if ( str3.Equals( "DoubleClickFullScreen" ) ) // #26752 2011.11.27 yyagi + { + this.bIsAllowedDoubleClickFullscreen = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if ( str3.Equals( "EnableSystemMenu" ) ) // #28200 2012.5.1 yyagi + { + this.bIsEnabledSystemMenu = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if ( str3.Equals( "BackSleep" ) ) // #23568 2010.11.04 ikanick add + { + this.n髱槭ヵ繧ゥ繝シ繧ォ繧ケ譎ゅせ繝ェ繝シ繝洋s = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ縺。繧繧薙→荳ク繧√※霑斐☆( str4, 0, 50, this.n髱槭ヵ繧ゥ繝シ繧ォ繧ケ譎ゅせ繝ェ繝シ繝洋s ); + } + #endregion + + #region [ WASAPI/ASIO髢「菫 ] + else if ( str3.Equals( "SoundDeviceType" ) ) + { + this.nSoundDeviceType = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, this.nSoundDeviceType ); + } + else if ( str3.Equals( "WASAPIBufferSizeMs" ) ) + { + this.nWASAPIBufferSizeMs = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 9999, this.nWASAPIBufferSizeMs ); + } + else if ( str3.Equals( "ASIODevice" ) ) + { + string[] asiodev = CEnumerateAllAsioDevices.GetAllASIODevices(); + this.nASIODevice = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, asiodev.Length - 1, this.nASIODevice ); + } + //else if ( str3.Equals( "ASIOBufferSizeMs" ) ) + //{ + // this.nASIOBufferSizeMs = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 9999, this.nASIOBufferSizeMs ); + //} + //else if ( str3.Equals( "DynamicBassMixerManagement" ) ) + //{ + // this.bDynamicBassMixerManagement = C螟画鋤.bONorOFF( str4[ 0 ] ); + //} + else if ( str3.Equals( "SoundTimerType" ) ) // #33689 2014.6.6 yyagi + { + this.bUseOSTimer = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + //else if ( str3.Equals( "MasterVolume" ) ) + //{ + // this.nMasterVolume = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 100, this.nMasterVolume ); + //} + #endregion + + #region [ 繝輔か繝ウ繝 ] + else if (str3.Equals("FontName")) + { + this.FontName = str4; + } + else if (str3.Equals("BoxFontName")) + { + this.BoxFontName = str4; + } + #endregion + + else if ( str3.Equals( "VSyncWait" ) ) + { + this.b蝙ら峩蟶ー邱壼セ縺。繧定。後≧ = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if( str3.Equals( "SleepTimePerFrame" ) ) // #23568 2011.11.27 yyagi + { + this.n繝輔Ξ繝シ繝豈弱せ繝ェ繝シ繝洋s = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ縺。繧繧薙→荳ク繧√※霑斐☆( str4, -1, 50, this.n繝輔Ξ繝シ繝豈弱せ繝ェ繝シ繝洋s ); + } + else if( str3.Equals( "BGAlpha" ) ) + { + this.n閭梧勹縺ョ騾城℃蠎ヲ = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 0xff, this.n閭梧勹縺ョ騾城℃蠎ヲ ); + } + else if( str3.Equals( "DamageLevel" ) ) + { + this.e繝繝。繝シ繧ク繝ャ繝吶Ν = (E繝繝。繝シ繧ク繝ャ繝吶Ν) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, (int) this.e繝繝。繝シ繧ク繝ャ繝吶Ν ); + } + else if ( str3.Equals( "StageFailed" ) ) + { + this.bSTAGEFAILED譛牙柑 = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + #region [ AVI/BGA ] + else if( str3.Equals( "AVI" ) ) + { + this.bAVI譛牙柑 = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if( str3.Equals( "BGA" ) ) + { + this.bBGA譛牙柑 = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if( str3.Equals( "ClipDispType" ) ) + { + this.eClipDispType = (EClipDispType)C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 3, (int) this.eClipDispType ); + } + #endregion + #region [ 繝励Ξ繝薙Η繝シ髻ウ ] + else if( str3.Equals( "PreviewSoundWait" ) ) + { + this.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ髻ウ縺碁ウエ繧九∪縺ァ縺ョ繧ヲ繧ァ繧、繝ms = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 0x5f5e0ff, this.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ髻ウ縺碁ウエ繧九∪縺ァ縺ョ繧ヲ繧ァ繧、繝ms ); + } + else if( str3.Equals( "PreviewImageWait" ) ) + { + this.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ逕サ蜒上′陦ィ遉コ髢句ァ九&繧後k縺セ縺ァ縺ョ繧ヲ繧ァ繧、繝ms = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 0x5f5e0ff, this.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ逕サ蜒上′陦ィ遉コ髢句ァ九&繧後k縺セ縺ァ縺ョ繧ヲ繧ァ繧、繝ms ); + } + #endregion + //else if( str3.Equals( "AdjustWaves" ) ) + //{ + // this.bWave蜀咲函菴咲スョ閾ェ蜍戊ェソ謨エ讖溯ス譛牙柑 = C螟画鋤.bONorOFF( str4[ 0 ] ); + //} + #region [ BGM/繝峨Λ繝縺ョ繝偵ャ繝磯浹 ] + else if( str3.Equals( "BGMSound" ) ) + { + this.bBGM髻ウ繧堤匱螢ー縺吶k = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + #endregion + else if( str3.Equals( "SaveScoreIni" ) ) + { + this.bScoreIni繧貞コ蜉帙☆繧 = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if( str3.Equals( "RandomFromSubBox" ) ) + { + this.b繝ゥ繝ウ繝繝繧サ繝ャ繧ッ繝医〒蟄殖OX繧呈、懃エ「蟇セ雎。縺ィ縺吶k = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + #region [ 繧ウ繝ウ繝懈焚 ] + else if( str3.Equals( "MinComboDrums" ) ) + { + this.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚.Drums = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 1, 0x1869f, this.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚.Drums ); + } + #endregion + else if( str3.Equals( "ShowDebugStatus" ) ) + { + this.b貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if( str3.Equals( nameof(ApplyLoudnessMetadata) ) ) + { + this.ApplyLoudnessMetadata = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if( str3.Equals( nameof(TargetLoudness) ) ) + { + this.TargetLoudness = C螟画鋤.db蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, CSound.MinimumLufs.ToDouble(), CSound.MaximumLufs.ToDouble(), this.TargetLoudness ); + } + else if( str3.Equals( nameof(ApplySongVol) ) ) + { + this.ApplySongVol = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if( str3.Equals( nameof(SoundEffectLevel) ) ) + { + this.SoundEffectLevel = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, this.SoundEffectLevel ); + } + else if( str3.Equals( nameof(VoiceLevel) ) ) + { + this.VoiceLevel = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, this.VoiceLevel ); + } + else if( str3.Equals( nameof(SongPreviewLevel) ) ) + { + this.SongPreviewLevel = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, this.SongPreviewLevel ); + } + else if( str3.Equals( nameof(KeyboardSoundLevelIncrement) ) ) + { + this.KeyboardSoundLevelIncrement = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, MinimumKeyboardSoundLevelIncrement, MaximumKeyboardSoundLevelIncrement, this.KeyboardSoundLevelIncrement ); + } + else if( str3.Equals(nameof(MusicPreTimeMs))) + { + MusicPreTimeMs = int.Parse(str4); + } + else if( str3.Equals( "StoicMode" ) ) + { + this.b繧ケ繝医う繝繧ッ繝「繝シ繝 = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if ( str3.Equals( "JudgeDispPriority" ) ) + { + this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ = (E蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 1, (int) this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ ); + } + else if ( str3.Equals( "AutoResultCapture" ) ) // #25399 2011.6.9 yyagi + { + this.bIsAutoResultCapture = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if (str3.Equals(nameof(SendDiscordPlayingInformation))) + { + SendDiscordPlayingInformation = C螟画鋤.bONorOFF(str4[0]); + } + else if ( str3.Equals( "TimeStretch" ) ) // #23664 2013.2.24 yyagi + { + this.bTimeStretch = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + #region [ AdjustTime ] + else if( str3.Equals( "InputAdjustTime" ) ) + { + this.nInputAdjustTimeMs = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, -99, 99, this.nInputAdjustTimeMs ); + } + else if ( str3.Equals( "JudgeLinePosOffsetDrums" ) ) // #31602 2013.6.23 yyagi + { + this.nJudgeLinePosOffset.Drums = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, -99, 99, this.nJudgeLinePosOffset.Drums ); + } + else if ( str3.Equals( "JudgeLinePosOffsetGuitar" ) ) // #31602 2013.6.23 yyagi + { + this.nJudgeLinePosOffset.Guitar = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, -99, 99, this.nJudgeLinePosOffset.Guitar ); + } + else if ( str3.Equals( "JudgeLinePosOffsetBass" ) ) // #31602 2013.6.23 yyagi + { + this.nJudgeLinePosOffset.Bass = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, -99, 99, this.nJudgeLinePosOffset.Bass ); + } + else if ( str3.Equals( "JudgeLinePosModeGuitar" ) ) // #33891 2014.6.26 yyagi + { + this.e蛻、螳壻ス咲スョ.Guitar = (E蛻、螳壻ス咲スョ) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, (int) this.e蛻、螳壻ス咲スョ.Guitar ); + } + else if ( str3.Equals( "JudgeLinePosModeBass" ) ) // #33891 2014.6.26 yyagi + { + this.e蛻、螳壻ス咲スョ.Bass = (E蛻、螳壻ス咲スョ) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, (int) this.e蛻、螳壻ス咲スョ.Bass ); + } + #endregion + else if( str3.Equals( "BufferedInput" ) ) + { + this.b繝舌ャ繝輔ぃ蜈・蜉帙r陦後≧ = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if ( str3.Equals( "PolyphonicSounds" ) ) // #28228 2012.5.1 yyagi + { + this.nPoliphonicSounds = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 1, 8, this.nPoliphonicSounds ); + } + #region [ VelocityMin ] + else if ( str3.Equals( "LCVelocityMin" ) ) // #23857 2010.12.12 yyagi + { + this.nVelocityMin.LC = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 127, this.nVelocityMin.LC ); + } + else if( str3.Equals( "HHVelocityMin" ) ) + { + this.nVelocityMin.HH = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 127, this.nVelocityMin.HH ); + } + else if( str3.Equals( "SDVelocityMin" ) ) // #23857 2011.1.31 yyagi + { + this.nVelocityMin.SD = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 127, this.nVelocityMin.SD ); + } + else if( str3.Equals( "BDVelocityMin" ) ) // #23857 2011.1.31 yyagi + { + this.nVelocityMin.BD = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 127, this.nVelocityMin.BD ); + } + else if( str3.Equals( "HTVelocityMin" ) ) // #23857 2011.1.31 yyagi + { + this.nVelocityMin.HT = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 127, this.nVelocityMin.HT ); + } + else if( str3.Equals( "LTVelocityMin" ) ) // #23857 2011.1.31 yyagi + { + this.nVelocityMin.LT = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 127, this.nVelocityMin.LT ); + } + else if( str3.Equals( "FTVelocityMin" ) ) // #23857 2011.1.31 yyagi + { + this.nVelocityMin.FT = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 127, this.nVelocityMin.FT ); + } + else if( str3.Equals( "CYVelocityMin" ) ) // #23857 2011.1.31 yyagi + { + this.nVelocityMin.CY = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 127, this.nVelocityMin.CY ); + } + else if( str3.Equals( "RDVelocityMin" ) ) // #23857 2011.1.31 yyagi + { + this.nVelocityMin.RD = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 127, this.nVelocityMin.RD ); + } + #endregion + //else if ( str3.Equals( "NoMP3Streaming" ) ) + //{ + // this.bNoMP3Streaming = C螟画鋤.bONorOFF( str4[ 0 ] ); + //} + #region[ Ver.K霑ス蜉 ] + else if ( str3.Equals( "DirectShowMode" ) ) // #28228 2012.5.1 yyagi + { + this.bDirectShowMode = C螟画鋤.bONorOFF( str4[ 0 ] ); ; + } + #endregion + else if( str3.Equals( "EndingAnime" ) ) + { + this.bEndingAnime = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + + continue; + } + //----------------------------- + #endregion + + #region [ [AutoPlay] ] + //----------------------------- + case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.AutoPlay: + if (str3.Equals("Taiko")) + { + this.b螟ェ鮠薙ヱ繝シ繝AutoPlay = C螟画鋤.bONorOFF(str4[0]); + } + else if (str3.Equals("Taiko2P")) + { + this.b螟ェ鮠薙ヱ繝シ繝AutoPlay2P = C螟画鋤.bONorOFF(str4[0]); + } + else if (str3.Equals("TaikoAutoRoll")) + { + this.bAuto蜈育函縺ョ騾」謇 = C螟画鋤.bONorOFF(str4[0]); + } + continue; + //----------------------------- + #endregion + + #region [ [HitRange] ] + //----------------------------- + case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.HitRange: + if (str3.Equals("Perfect")) + { + this.n繝偵ャ繝育ッ蝗イms.Perfect = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆(str4, 0, 0x3e7, this.n繝偵ャ繝育ッ蝗イms.Perfect); + } + else if (str3.Equals("Great")) + { + this.n繝偵ャ繝育ッ蝗イms.Great = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆(str4, 0, 0x3e7, this.n繝偵ャ繝育ッ蝗イms.Great); + } + else if (str3.Equals("Good")) + { + this.n繝偵ャ繝育ッ蝗イms.Good = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆(str4, 0, 0x3e7, this.n繝偵ャ繝育ッ蝗イms.Good); + } + else if (str3.Equals("Poor")) + { + this.n繝偵ャ繝育ッ蝗イms.Poor = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆(str4, 0, 0x3e7, this.n繝偵ャ繝育ッ蝗イms.Poor); + } + continue; + //----------------------------- + #endregion + + + + #region [ [Log] ] + //----------------------------- + case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.Log: + { + if( str3.Equals( "OutputLog" ) ) + { + this.b繝ュ繧ー蜃コ蜉 = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if( str3.Equals( "TraceCreatedDisposed" ) ) + { + this.bLog菴懈占ァ」謾セ繝ュ繧ー蜃コ蜉 = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if( str3.Equals( "TraceDTXDetails" ) ) + { + this.bLogDTX隧ウ邏ー繝ュ繧ー蜃コ蜉 = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if( str3.Equals( "TraceSongSearch" ) ) + { + this.bLog譖イ讀懃エ「繝ュ繧ー蜃コ蜉 = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + continue; + } + //----------------------------- + #endregion + + #region [ [PlayOption] ] + //----------------------------- + case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.PlayOption: + { + if (str3.Equals("ShowChara")) + { + ShowChara = C螟画鋤.bONorOFF(str4[0]); + } + else if( str3.Equals("ShowDancer")) + { + ShowDancer = C螟画鋤.bONorOFF(str4[0]); + } + else if (str3.Equals("ShowRunner")) + { + ShowRunner = C螟画鋤.bONorOFF(str4[0]); + } + else if (str3.Equals("ShowMob")) + { + ShowMob = C螟画鋤.bONorOFF(str4[0]); + } + else if (str3.Equals("ShowFooter")) + { + ShowFooter = C螟画鋤.bONorOFF(str4[0]); + } + else if (str3.Equals("ShowPuchiChara")) + { + ShowPuchiChara = C螟画鋤.bONorOFF(str4[0]); + } + else if( str3.Equals( "Dark" ) ) + { + this.eDark = (E繝繝シ繧ッ繝「繝シ繝) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, (int) this.eDark ); + } + else if( str3.Equals( "ScrollMode" ) ) + { + this.eScrollMode = ( EScrollMode )C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, 0 ); + } + else if (str3.Equals("EnableCountDownTimer")) + { + this.bEnableCountdownTimer = C螟画鋤.bONorOFF(str4[0]); + } + #region [ Sudden ] + else if( str3.Equals( "DrumsSudden" ) ) + { + this.bSudden.Drums = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + #endregion + #region [ Hidden ] + else if( str3.Equals( "DrumsHidden" ) ) + { + this.bHidden.Drums = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + #endregion + #region [ Invisible ] + else if ( str3.Equals( "DrumsInvisible" ) ) + { + this.eInvisible.Drums = (EInvisible) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, (int) this.eInvisible.Drums ); + } + //else if ( str3.Equals( "InvisibleDisplayTimeMs" ) ) + //{ + // this.nDisplayTimesMs = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 9999999, (int) this.nDisplayTimesMs ); + //} + //else if ( str3.Equals( "InvisibleFadeoutTimeMs" ) ) + //{ + // this.nFadeoutTimeMs = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 9999999, (int) this.nFadeoutTimeMs ); + //} + #endregion + else if ( str3.Equals( "DrumsReverse" ) ) + { + this.bReverse.Drums = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if( str3.Equals( "DrumsPosition" ) ) + { + this.蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ.Drums = (E蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, (int) this.蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ.Drums ); + } + else if( str3.Equals( "DrumsScrollSpeed" ) ) + { + this.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 0x7cf, this.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums ); + } + else if( str3.Equals( "PlaySpeed" ) ) + { + this.n貍泌・城溷コヲ = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 5, 400, this.n貍泌・城溷コヲ ); + } + else if (str3.Equals("PlaySpeedNotEqualOneNoSound")) + { + this.b貍泌・城溷コヲ縺御ク蛟埼溘〒縺ゅk縺ィ縺堺サ・螟夜浹螢ー繧貞咲函縺励↑縺 = C螟画鋤.bONorOFF(str4[0]); + } + //else if ( str3.Equals( "JudgeDispPriorityDrums" ) ) + //{ + // this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ.Drums = (E蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 1, (int) this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ.Drums ); + //} + //else if ( str3.Equals( "JudgeDispPriorityGuitar" ) ) + //{ + // this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ.Guitar = (E蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 1, (int) this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ.Guitar ); + //} + //else if ( str3.Equals( "JudgeDispPriorityBass" ) ) + //{ + // this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ.Bass = (E蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 1, (int) this.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ.Bass ); + //} + else if ( str3.Equals( "Risky" ) ) // #23559 2011.6.23 yyagi + { + this.nRisky = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 10, this.nRisky ); + } + else if ( str3.Equals( "DrumsTight" ) ) + { + this.bTight = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if ( str3.Equals( "BranchGuide" ) ) + { + this.bBranchGuide = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if ( str3.Equals( "DefaultCourse" ) ) //2017.01.30 DD + { + this.nDefaultCourse = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 4, this.nDefaultCourse ); + } + else if ( str3.Equals( "ScoreMode" ) ) + { + this.nScoreMode = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 3, this.nScoreMode ); + } + else if ( str3.Equals( "HispeedRandom" ) ) + { + this.bHispeedRandom = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if ( str3.Equals( "BigNotesWaitTime" ) ) + { + this.n荳。謇句愛螳壹ョ蠕縺。譎る俣 = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 1, 100, this.n荳。謇句愛螳壹ョ蠕縺。譎る俣 ); + } + else if ( str3.Equals( "BigNotesJudge" ) ) + { + this.b螟ァ髻ウ隨ヲ蛻、螳 = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if ( str3.Equals( "BranchAnime" ) ) + { + this.nBranchAnime = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 1, this.nBranchAnime ); + } + else if ( str3.Equals( "NoInfo" ) ) + { + this.bNoInfo = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if ( str3.Equals( "DefaultSongSort" ) ) + { + this.nDefaultSongSort = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, this.nDefaultSongSort ); + } + else if( str3.Equals( "TaikoRandom" ) ) + { + this.eRandom.Taiko = (E繝ゥ繝ウ繝繝繝「繝シ繝) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 4, (int) this.eRandom.Taiko ); + } + else if( str3.Equals( "TaikoStealth" ) ) + { + this.eSTEALTH = (E繧ケ繝繝ォ繧ケ繝「繝シ繝) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 3, (int) this.eSTEALTH ); + } + else if( str3.Equals( "GameMode" ) ) + { + this.eGameMode = (EGame) C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 2, (int) this.eGameMode ); + } + else if (str3.Equals("TokkunSkipMeasures")) + { + this.TokkunSkipMeasures = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆(str4, 0, 9999, this.TokkunSkipMeasures); + } + else if (str3.Equals(nameof(TokkunMashInterval))) + { + this.TokkunMashInterval = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆(str4, 0, 9999, this.TokkunMashInterval); + } + else if( str3.Equals( "JudgeCountDisplay" ) ) + { + this.bJudgeCountDisplay = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if( str3.Equals( "Just" ) ) + { + this.bJust = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if( str3.Equals( "PlayerCount" ) ) + { + this.nPlayerCount = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 1, 2, this.nPlayerCount ); + } + else if(str3.Equals(nameof(ShinuchiMode))) + { + ShinuchiMode = C螟画鋤.bONorOFF(str4[0]); + } + continue; + } + //----------------------------- + #endregion + + #region [ [ViewerOption] ] + //----------------------------- + case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.ViewerOption: + { + if ( str3.Equals( "ViewerDrumsScrollSpeed" ) ) + { + this.nViewerScrollSpeed.Drums = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 1999, this.nViewerScrollSpeed.Drums ); + } + else if ( str3.Equals( "ViewerGuitarScrollSpeed" ) ) + { + this.nViewerScrollSpeed.Guitar = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 1999, this.nViewerScrollSpeed.Guitar ); + } + else if ( str3.Equals( "ViewerBassScrollSpeed" ) ) + { + this.nViewerScrollSpeed.Bass = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( str4, 0, 1999, this.nViewerScrollSpeed.Bass ); + } + else if ( str3.Equals( "ViewerVSyncWait" ) ) + { + this.bViewerVSyncWait = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if ( str3.Equals( "ViewerShowDebugStatus" ) ) + { + this.bViewerShowDebugStatus = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if ( str3.Equals( "ViewerTimeStretch" ) ) + { + this.bViewerTimeStretch = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if ( str3.Equals( "ViewerGuitar" ) ) + { + this.bViewerGuitar譛牙柑 = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + else if ( str3.Equals( "ViewerDrums" ) ) + { + this.bViewerDrums譛牙柑 = C螟画鋤.bONorOFF( str4[ 0 ] ); + } + continue; + } + //----------------------------- + #endregion + + #region [ [GUID] ] + //----------------------------- + case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.GUID: + if( str3.Equals( "JoystickID" ) ) + { + this.tJoystickID縺ョ蜿門セ( str4 ); + } + continue; + //----------------------------- + #endregion + + #region [ [DrumsKeyAssign] ] + //----------------------------- + case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.DrumsKeyAssign: + { + if( str3.Equals( "LeftRed" ) ) + { + this.t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( str4, this.KeyAssign.Drums.LeftRed ); + } + else if( str3.Equals( "RightRed" ) ) + { + this.t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( str4, this.KeyAssign.Drums.RightRed ); + } + else if( str3.Equals( "LeftBlue" ) ) // #27029 2012.1.4 from + { // + this.t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( str4, this.KeyAssign.Drums.LeftBlue ); // + } // + else if( str3.Equals( "RightBlue" ) ) // #27029 2012.1.4 from + { // + this.t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( str4, this.KeyAssign.Drums.RightBlue ); // + } + + else if( str3.Equals( "LeftRed2P" ) ) + { + this.t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( str4, this.KeyAssign.Drums.LeftRed2P ); + } + else if( str3.Equals( "RightRed2P" ) ) + { + this.t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( str4, this.KeyAssign.Drums.RightRed2P ); + } + else if( str3.Equals( "LeftBlue2P" ) ) // #27029 2012.1.4 from + { // + this.t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( str4, this.KeyAssign.Drums.LeftBlue2P ); // + } // + else if( str3.Equals( "RightBlue2P" ) ) // #27029 2012.1.4 from + { // + this.t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( str4, this.KeyAssign.Drums.RightBlue2P ); // + } + + continue; + } + //----------------------------- + #endregion + + #region [ [SystemKeyAssign] ] + //----------------------------- + case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.SystemKeyAssign: + if( str3.Equals( "Capture" ) ) + { + this.t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( str4, this.KeyAssign.System.Capture ); + } + continue; + //----------------------------- + #endregion + } + } + } + continue; + } + catch ( Exception exception ) + { + Trace.TraceError( exception.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (93c4c5cd-4996-4e8c-a82f-a179ff590b44)" ); + continue; + } + } + } + } + + /// + /// 繧ョ繧ソ繝シ縺ィ繝吶シ繧ケ縺ョ繧ュ繝シ繧「繧オ繧、繝ウ蜈・繧梧崛縺 + /// + //public void SwapGuitarBassKeyAssign() // #24063 2011.1.16 yyagi + //{ + // for ( int j = 0; j <= (int)EKeyConfigPad.Capture; j++ ) + // { + // CKeyAssign.STKEYASSIGN t; //= new CConfigIni.CKeyAssign.STKEYASSIGN(); + // for ( int k = 0; k < 16; k++ ) + // { + // t = this.KeyAssign[ (int)EKeyConfigPart.GUITAR ][ j ][ k ]; + // this.KeyAssign[ (int)EKeyConfigPart.GUITAR ][ j ][ k ] = this.KeyAssign[ (int)EKeyConfigPart.BASS ][ j ][ k ]; + // this.KeyAssign[ (int)EKeyConfigPart.BASS ][ j ][ k ] = t; + // } + // } + // this.bIsSwappedGuitarBass = !bIsSwappedGuitarBass; + //} + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private enum E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・ + { + Unknown, + System, + Log, + PlayOption, + ViewerOption, + AutoPlay, + HitRange, + GUID, + DrumsKeyAssign, + SystemKeyAssign, + Temp, + } + + private bool _bDrums譛牙柑; + private bool _bGuitar譛牙柑; + private bool bConfigIni縺悟ュ伜惠縺励※縺繧; + private string ConfigIni繝輔ぃ繧、繝ォ蜷; + + private void tJoystickID縺ョ蜿門セ( string str繧ュ繝シ險倩ソー ) + { + string[] strArray = str繧ュ繝シ險倩ソー.Split( new char[] { ',' } ); + if( strArray.Length >= 2 ) + { + int result = 0; + if( ( int.TryParse( strArray[ 0 ], out result ) && ( result >= 0 ) ) && ( result <= 9 ) ) + { + if( this.dicJoystick.ContainsKey( result ) ) + { + this.dicJoystick.Remove( result ); + } + this.dicJoystick.Add( result, strArray[ 1 ] ); + } + } + } + private void t繧ュ繝シ繧「繧オ繧、繝ウ繧貞ィ驛ィ繧ッ繝ェ繧「縺吶k() + { + this.KeyAssign = new CKeyAssign(); + for( int i = 0; i <= (int)EKeyConfigPart.SYSTEM; i++ ) + { + for( int j = 0; j <= (int)EKeyConfigPad.Capture; j++ ) + { + this.KeyAssign[ i ][ j ] = new CKeyAssign.STKEYASSIGN[ 16 ]; + for( int k = 0; k < 16; k++ ) + { + this.KeyAssign[ i ][ j ][ k ] = new CKeyAssign.STKEYASSIGN( E蜈・蜉帙ョ繝舌う繧ケ.荳肴, 0, 0 ); + } + } + } + } + private void t繧ュ繝シ縺ョ譖ク縺榊コ縺( StreamWriter sw, CKeyAssign.STKEYASSIGN[] assign ) + { + bool flag = true; + for( int i = 0; i < 0x10; i++ ) + { + if( assign[ i ].蜈・蜉帙ョ繝舌う繧ケ == E蜈・蜉帙ョ繝舌う繧ケ.荳肴 ) + { + continue; + } + if( !flag ) + { + sw.Write( ',' ); + } + flag = false; + switch( assign[ i ].蜈・蜉帙ョ繝舌う繧ケ ) + { + case E蜈・蜉帙ョ繝舌う繧ケ.繧ュ繝シ繝懊シ繝: + sw.Write( 'K' ); + break; + + case E蜈・蜉帙ョ繝舌う繧ケ.MIDI蜈・蜉: + sw.Write( 'M' ); + break; + + case E蜈・蜉帙ョ繝舌う繧ケ.繧ク繝ァ繧、繝代ャ繝: + sw.Write( 'J' ); + break; + + case E蜈・蜉帙ョ繝舌う繧ケ.繝槭え繧ケ: + sw.Write( 'N' ); + break; + } + sw.Write( "{0}{1}", "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".Substring( assign[ i ].ID, 1 ), assign[ i ].繧ウ繝シ繝 ); // #24166 2011.1.15 yyagi: to support ID > 10, change 2nd character from Decimal to 36-numeral system. (e.g. J1023 -> JA23) + } + } + private void t繧ュ繝シ縺ョ隱ュ縺ソ蜃コ縺励→險ュ螳( string str繧ュ繝シ險倩ソー, CKeyAssign.STKEYASSIGN[] assign ) + { + string[] strArray = str繧ュ繝シ險倩ソー.Split( new char[] { ',' } ); + for( int i = 0; ( i < strArray.Length ) && ( i < 0x10 ); i++ ) + { + E蜈・蜉帙ョ繝舌う繧ケ e蜈・蜉帙ョ繝舌う繧ケ; + int id; + int code; + string str = strArray[ i ].Trim().ToUpper(); + if ( str.Length >= 3 ) + { + e蜈・蜉帙ョ繝舌う繧ケ = E蜈・蜉帙ョ繝舌う繧ケ.荳肴; + switch ( str[ 0 ] ) + { + case 'J': + e蜈・蜉帙ョ繝舌う繧ケ = E蜈・蜉帙ョ繝舌う繧ケ.繧ク繝ァ繧、繝代ャ繝; + break; + + case 'K': + e蜈・蜉帙ョ繝舌う繧ケ = E蜈・蜉帙ョ繝舌う繧ケ.繧ュ繝シ繝懊シ繝; + break; + + case 'L': + continue; + + case 'M': + e蜈・蜉帙ョ繝舌う繧ケ = E蜈・蜉帙ョ繝舌う繧ケ.MIDI蜈・蜉; + break; + + case 'N': + e蜈・蜉帙ョ繝舌う繧ケ = E蜈・蜉帙ョ繝舌う繧ケ.繝槭え繧ケ; + break; + } + } + else + { + continue; + } + id = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".IndexOf( str[ 1 ] ); // #24166 2011.1.15 yyagi: to support ID > 10, change 2nd character from Decimal to 36-numeral system. (e.g. J1023 -> JA23) + if( ( ( id >= 0 ) && int.TryParse( str.Substring( 2 ), out code ) ) && ( ( code >= 0 ) && ( code <= 0xff ) ) ) + { + this.t謖螳壹@縺溷・蜉帙′譌「縺ォ繧「繧オ繧、繝ウ貂医∩縺ァ縺ゅk蝣エ蜷医ッ縺昴l繧貞ィ蜑企勁縺吶k( e蜈・蜉帙ョ繝舌う繧ケ, id, code ); + assign[ i ].蜈・蜉帙ョ繝舌う繧ケ = e蜈・蜉帙ョ繝舌う繧ケ; + assign[ i ].ID = id; + assign[ i ].繧ウ繝シ繝 = code; + } + } + } + private void t繝繝輔か繝ォ繝医ョ繧ュ繝シ繧「繧オ繧、繝ウ縺ォ險ュ螳壹☆繧() + { + this.t繧ュ繝シ繧「繧オ繧、繝ウ繧貞ィ驛ィ繧ッ繝ェ繧「縺吶k(); + + string strDefaultKeyAssign = @" +[DrumsKeyAssign] +LeftRed=K015 +RightRed=K019 +LeftBlue=K013 +RightBlue=K020 +LeftRed2P=K011 +RightRed2P=K023 +LeftBlue2P=K012 +RightBlue2P=K047 + +[SystemKeyAssign] +Capture=K065 +"; + t譁蟄怜励°繧芽ェュ縺ソ霎シ縺ソ( strDefaultKeyAssign ); + } + //----------------- + #endregion + + + public event PropertyChangedEventHandler PropertyChanged; + + private bool SetProperty(ref T storage, T value, string propertyName = null) + { + if (Equals(storage, value)) + { + return false; + } + + storage = value; + OnPropertyChanged(propertyName); + return true; + } + + private void OnPropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } +} diff --git a/TJAPlayer3/Common/CDTXVersion.cs b/TJAPlayer3/Common/CDTXVersion.cs new file mode 100644 index 00000000..a83090ce --- /dev/null +++ b/TJAPlayer3/Common/CDTXVersion.cs @@ -0,0 +1,210 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; + +namespace TJAPlayer3 +{ + /// + /// DTXMania 縺ョ繝舌シ繧ク繝ァ繝ウ縲 + /// 萓1シ"078b" 竊 謨エ謨ー驛ィ=078, 蟆乗焚驛ィ=2000000 ('闍ア蟄'+'yymmdd') + /// 萓2シ"078a(100124)" 竊 謨エ謨ー驛ィ=078, 蟆乗焚驛ィ=1100124 ('闍ア蟄'+'yymmdd') + /// + public class CDTXVersion + { + // 繝励Ο繝代ユ繧」 + + /// + /// 繝舌シ繧ク繝ァ繝ウ縺梧悴遏・縺ョ縺ィ縺阪↓ true 縺ォ縺ェ繧九 + /// + public bool Unknown + { + get; + private set; + } + + /// + /// DTXMania 縺ョ繝舌シ繧ク繝ァ繝ウ縺ョ謨エ謨ー驛ィ繧定。ィ縺吶 + /// 萓1シ"078b" 竊 謨エ謨ー驛ィ=078 + /// 萓2シ"078a(100124)" 竊 謨エ謨ー驛ィ=078 + /// + public int n謨エ謨ー驛ィ; + + /// + /// DTXMania 縺ョ繝舌シ繧ク繝ァ繝ウ縺ョ蟆乗焚驛ィ繧定。ィ縺吶 + /// 蟆乗焚驛ィ縺ッ縲'闍ア蟄(0ス26) * 1000000 + 譌・莉(yymmdd)' 縺ョ蠑上〒陦ィ縺輔l繧区紛謨ー縲 + /// 萓1シ"078b" 竊 蟆乗焚驛ィ=2000000 + /// 萓2シ"078a(100124)" 竊 蟆乗焚驛ィ=1100124 + /// + public int n蟆乗焚驛ィ; + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CDTXVersion() + { + this.n謨エ謨ー驛ィ = 0; + this.n蟆乗焚驛ィ = 0; + this.Unknown = true; + } + public CDTXVersion( int n謨エ謨ー驛ィ ) + { + this.n謨エ謨ー驛ィ = n謨エ謨ー驛ィ; + this.n蟆乗焚驛ィ = 0; + this.Unknown = false; + } + public CDTXVersion( string Version ) + { + this.n謨エ謨ー驛ィ = 0; + this.n蟆乗焚驛ィ = 0; + this.Unknown = true; + + if( Version.ToLower().Equals( "unknown" ) ) + { + this.Unknown = true; + } + else + { + int num = 0; + int length = Version.Length; + if( ( num < length ) && char.IsDigit( Version[ num ] ) ) + { + // 謨エ謨ー驛ィ縲蜿門セ + while( ( num < length ) && char.IsDigit( Version[ num ] ) ) + { + this.n謨エ謨ー驛ィ = ( this.n謨エ謨ー驛ィ * 10 ) + CDTXVersion.DIG10.IndexOf( Version[ num++ ] ); + } + + // 蟆乗焚驛ィ(1)闍ア蟄鈴Κ蛻縲蜿門セ + while( ( num < length ) && ( ( Version[ num ] == ' ' ) || ( Version[ num ] == '(' ) ) ) + { + num++; + } + if( ( num < length ) && ( CDTXVersion.DIG36.IndexOf( Version[ num ] ) >= 10 ) ) + { + this.n蟆乗焚驛ィ = CDTXVersion.DIG36.IndexOf( Version[ num++ ] ) - 10; + if( this.n蟆乗焚驛ィ >= 0x1a ) + { + this.n蟆乗焚驛ィ -= 0x1a; + } + this.n蟆乗焚驛ィ++; + } + + // 蟆乗焚驛ィ(2)譌・莉倬Κ蛻(yymmdd)縲蜿門セ + while( ( num < length ) && ( ( Version[ num ] == ' ' ) || ( Version[ num ] == '(' ) ) ) + { + num++; + } + for( int i = 0; i < 6; i++ ) + { + this.n蟆乗焚驛ィ *= 10; + if( ( num < length ) && char.IsDigit( Version[ num ] ) ) + { + this.n蟆乗焚驛ィ += CDTXVersion.DIG10.IndexOf( Version[ num ] ); + } + num++; + } + this.Unknown = false; + } + else + { + this.Unknown = true; + } + } + } + public CDTXVersion( int n謨エ謨ー驛ィ, int n蟆乗焚驛ィ ) + { + this.n謨エ謨ー驛ィ = n謨エ謨ー驛ィ; + this.n蟆乗焚驛ィ = n蟆乗焚驛ィ; + this.Unknown = false; + } + + + // 繝。繧ス繝繝 + + public string toString() + { + var result = new StringBuilder( 32 ); + + // 謨エ謨ー驛ィ + result.Append( this.n謨エ謨ー驛ィ.ToString( "000" ) ); + + // 闍ア蟄鈴Κ蛻シ医≠繧後ーシ + if( this.n蟆乗焚驛ィ >= 1000000 ) + { + int n闍ア蟄 = Math.Min( this.n蟆乗焚驛ィ / 1000000, 26 ); // 1ス26 + result.Append( CDTXVersion.DIG36[ 10 + ( n闍ア蟄 - 1 ) ] ); + } + + // 譌・莉倬Κ蛻シ医≠繧後ーシ + int n譌・莉 = this.n蟆乗焚驛ィ % 1000000; + if( n譌・莉 > 0 ) + { + result.Append( '(' ); + result.Append( n譌・莉.ToString( "000000" ) ); + result.Append( ')' ); + } + + return result.ToString(); + } + + public static bool operator ==( CDTXVersion x, CDTXVersion y ) + { + return ( ( ( x.n謨エ謨ー驛ィ == y.n謨エ謨ー驛ィ ) && ( x.n蟆乗焚驛ィ == y.n蟆乗焚驛ィ ) ) && ( x.Unknown == y.Unknown ) ); + } + public static bool operator >( CDTXVersion x, CDTXVersion y ) + { + return ( ( x.n謨エ謨ー驛ィ > y.n謨エ謨ー驛ィ ) || ( ( x.n謨エ謨ー驛ィ == y.n謨エ謨ー驛ィ ) && ( x.n蟆乗焚驛ィ > y.n蟆乗焚驛ィ ) ) ); + } + public static bool operator >=( CDTXVersion x, CDTXVersion y ) + { + return ( ( x.n謨エ謨ー驛ィ > y.n謨エ謨ー驛ィ ) || ( ( x.n謨エ謨ー驛ィ == y.n謨エ謨ー驛ィ ) && ( x.n蟆乗焚驛ィ >= y.n蟆乗焚驛ィ ) ) ); + } + public static bool operator !=( CDTXVersion x, CDTXVersion y ) + { + if( ( x.n謨エ謨ー驛ィ == y.n謨エ謨ー驛ィ ) && ( x.n蟆乗焚驛ィ == y.n蟆乗焚驛ィ ) ) + { + return ( x.Unknown != y.Unknown ); + } + return true; + } + public static bool operator <( CDTXVersion x, CDTXVersion y ) + { + return ( ( x.n謨エ謨ー驛ィ < y.n謨エ謨ー驛ィ ) || ( ( x.n謨エ謨ー驛ィ == y.n謨エ謨ー驛ィ ) && ( x.n蟆乗焚驛ィ < y.n蟆乗焚驛ィ ) ) ); + } + public static bool operator <=( CDTXVersion x, CDTXVersion y ) + { + return ( ( x.n謨エ謨ー驛ィ < y.n謨エ謨ー驛ィ ) || ( ( x.n謨エ謨ー驛ィ == y.n謨エ謨ー驛ィ ) && ( x.n蟆乗焚驛ィ <= y.n蟆乗焚驛ィ ) ) ); + } + public override bool Equals(object obj) // 2011.1.3 yyagi: warning繧堤┌縺上☆縺溘a縺ォ霑ス蜉 + { + if (obj == null) + { + return false; + } + if (this.GetType() != obj.GetType()) + { + return false; + } + CDTXVersion objCDTXVersion = (CDTXVersion)obj; + if (!int.Equals(this.n謨エ謨ー驛ィ, objCDTXVersion.n謨エ謨ー驛ィ) || !int.Equals(this.n蟆乗焚驛ィ, objCDTXVersion.n蟆乗焚驛ィ)) + { + return false; + } + return true; + } + public override int GetHashCode() // 2011.1.3 yyagi: warning繧堤┌縺上☆縺溘a縺ォ霑ス蜉 + { + string v = this.toString(); + return v.GetHashCode(); + } + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private const string DIG36 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + private const string DIG10 = "0123456789"; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Common/CPad.cs b/TJAPlayer3/Common/CPad.cs new file mode 100644 index 00000000..32243313 --- /dev/null +++ b/TJAPlayer3/Common/CPad.cs @@ -0,0 +1,225 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using FDK; + +namespace TJAPlayer3 +{ + public class CPad + { + // 繝励Ο繝代ユ繧」 + + internal STHIT st讀懃衍縺励◆繝繝舌う繧ケ; + [StructLayout( LayoutKind.Sequential )] + internal struct STHIT + { + public bool Keyboard; + public bool MIDIIN; + public bool Joypad; + public bool Mouse; + public void Clear() + { + this.Keyboard = false; + this.MIDIIN = false; + this.Joypad = false; + this.Mouse = false; + } + } + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + internal CPad( CConfigIni configIni, CInput邂。逅 mgrInput ) + { + this.rConfigIni = configIni; + this.rInput邂。逅 = mgrInput; + this.st讀懃衍縺励◆繝繝舌う繧ケ.Clear(); + } + + + // 繝。繧ス繝繝 + + public List GetEvents( E讌ス蝎ィ繝代シ繝 part, E繝代ャ繝 pad ) + { + CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = this.rConfigIni.KeyAssign[ (int) part ][ (int) pad ]; + List list = new List(); + + // 縺吶∋縺ヲ縺ョ蜈・蜉帙ョ繝舌う繧ケ縺ォ縺、縺縺ヲ窶ヲ + foreach( IInputDevice device in this.rInput邂。逅.list蜈・蜉帙ョ繝舌う繧ケ ) + { + if( ( device.list蜈・蜉帙う繝吶Φ繝 != null ) && ( device.list蜈・蜉帙う繝吶Φ繝.Count != 0 ) ) + { + foreach( STInputEvent event2 in device.list蜈・蜉帙う繝吶Φ繝 ) + { + for( int i = 0; i < stkeyassignArray.Length; i++ ) + { + switch( stkeyassignArray[ i ].蜈・蜉帙ョ繝舌う繧ケ ) + { + case E蜈・蜉帙ョ繝舌う繧ケ.繧ュ繝シ繝懊シ繝: + if( ( device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Keyboard ) && ( event2.nKey == stkeyassignArray[ i ].繧ウ繝シ繝 ) ) + { + list.Add( event2 ); + this.st讀懃衍縺励◆繝繝舌う繧ケ.Keyboard = true; + } + break; + + case E蜈・蜉帙ョ繝舌う繧ケ.MIDI蜈・蜉: + if( ( ( device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.MidiIn ) && ( device.ID == stkeyassignArray[ i ].ID ) ) && ( event2.nKey == stkeyassignArray[ i ].繧ウ繝シ繝 ) ) + { + list.Add( event2 ); + this.st讀懃衍縺励◆繝繝舌う繧ケ.MIDIIN = true; + } + break; + + case E蜈・蜉帙ョ繝舌う繧ケ.繧ク繝ァ繧、繝代ャ繝: + if( ( ( device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Joystick ) && ( device.ID == stkeyassignArray[ i ].ID ) ) && ( event2.nKey == stkeyassignArray[ i ].繧ウ繝シ繝 ) ) + { + list.Add( event2 ); + this.st讀懃衍縺励◆繝繝舌う繧ケ.Joypad = true; + } + break; + + case E蜈・蜉帙ョ繝舌う繧ケ.繝槭え繧ケ: + if( ( device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Mouse ) && ( event2.nKey == stkeyassignArray[ i ].繧ウ繝シ繝 ) ) + { + list.Add( event2 ); + this.st讀懃衍縺励◆繝繝舌う繧ケ.Mouse = true; + } + break; + } + } + } + continue; + } + } + return list; + } + public bool b謚シ縺輔l縺( E讌ス蝎ィ繝代シ繝 part, E繝代ャ繝 pad ) + { + if( part != E讌ス蝎ィ繝代シ繝.UNKNOWN ) + { + + CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = this.rConfigIni.KeyAssign[ (int) part ][ (int) pad ]; + for( int i = 0; i < stkeyassignArray.Length; i++ ) + { + switch( stkeyassignArray[ i ].蜈・蜉帙ョ繝舌う繧ケ ) + { + case E蜈・蜉帙ョ繝舌う繧ケ.繧ュ繝シ繝懊シ繝: + if( !this.rInput邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺( stkeyassignArray[ i ].繧ウ繝シ繝 ) ) + break; + + this.st讀懃衍縺励◆繝繝舌う繧ケ.Keyboard = true; + return true; + + case E蜈・蜉帙ョ繝舌う繧ケ.MIDI蜈・蜉: + { + IInputDevice device2 = this.rInput邂。逅.MidiIn( stkeyassignArray[ i ].ID ); + if( ( device2 == null ) || !device2.b繧ュ繝シ縺梧款縺輔l縺( stkeyassignArray[ i ].繧ウ繝シ繝 ) ) + break; + + this.st讀懃衍縺励◆繝繝舌う繧ケ.MIDIIN = true; + return true; + } + case E蜈・蜉帙ョ繝舌う繧ケ.繧ク繝ァ繧、繝代ャ繝: + { + if( !this.rConfigIni.dicJoystick.ContainsKey( stkeyassignArray[ i ].ID ) ) + break; + + IInputDevice device = this.rInput邂。逅.Joystick( stkeyassignArray[ i ].ID ); + if( ( device == null ) || !device.b繧ュ繝シ縺梧款縺輔l縺( stkeyassignArray[ i ].繧ウ繝シ繝 ) ) + break; + + this.st讀懃衍縺励◆繝繝舌う繧ケ.Joypad = true; + return true; + } + case E蜈・蜉帙ョ繝舌う繧ケ.繝槭え繧ケ: + if( !this.rInput邂。逅.Mouse.b繧ュ繝シ縺梧款縺輔l縺( stkeyassignArray[ i ].繧ウ繝シ繝 ) ) + break; + + this.st讀懃衍縺励◆繝繝舌う繧ケ.Mouse = true; + return true; + } + } + } + return false; + } + public bool b謚シ縺輔l縺櫂GB( E繝代ャ繝 pad ) + { + if( !this.b謚シ縺輔l縺( E讌ス蝎ィ繝代シ繝.DRUMS, pad ) && !this.b謚シ縺輔l縺( E讌ス蝎ィ繝代シ繝.GUITAR, pad ) ) + { + return this.b謚シ縺輔l縺( E讌ス蝎ィ繝代シ繝.BASS, pad ); + } + return true; + } + public bool b謚シ縺輔l縺檬B( E繝代ャ繝 pad ) + { + if( !this.b謚シ縺輔l縺( E讌ス蝎ィ繝代シ繝.GUITAR, pad ) ) + { + return this.b謚シ縺輔l縺( E讌ス蝎ィ繝代シ繝.BASS, pad ); + } + return true; + } + public bool b謚シ縺輔l縺ヲ縺繧( E讌ス蝎ィ繝代シ繝 part, E繝代ャ繝 pad ) + { + if( part != E讌ス蝎ィ繝代シ繝.UNKNOWN ) + { + CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = this.rConfigIni.KeyAssign[ (int) part ][ (int) pad ]; + for( int i = 0; i < stkeyassignArray.Length; i++ ) + { + switch( stkeyassignArray[ i ].蜈・蜉帙ョ繝舌う繧ケ ) + { + case E蜈・蜉帙ョ繝舌う繧ケ.繧ュ繝シ繝懊シ繝: + if( !this.rInput邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( stkeyassignArray[ i ].繧ウ繝シ繝 ) ) + { + break; + } + this.st讀懃衍縺励◆繝繝舌う繧ケ.Keyboard = true; + return true; + + case E蜈・蜉帙ョ繝舌う繧ケ.繧ク繝ァ繧、繝代ャ繝: + { + if( !this.rConfigIni.dicJoystick.ContainsKey( stkeyassignArray[ i ].ID ) ) + { + break; + } + IInputDevice device = this.rInput邂。逅.Joystick( stkeyassignArray[ i ].ID ); + if( ( device == null ) || !device.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( stkeyassignArray[ i ].繧ウ繝シ繝 ) ) + { + break; + } + this.st讀懃衍縺励◆繝繝舌う繧ケ.Joypad = true; + return true; + } + case E蜈・蜉帙ョ繝舌う繧ケ.繝槭え繧ケ: + if( !this.rInput邂。逅.Mouse.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( stkeyassignArray[ i ].繧ウ繝シ繝 ) ) + { + break; + } + this.st讀懃衍縺励◆繝繝舌う繧ケ.Mouse = true; + return true; + } + } + } + return false; + } + public bool b謚シ縺輔l縺ヲ縺繧季B( E繝代ャ繝 pad ) + { + if( !this.b謚シ縺輔l縺ヲ縺繧( E讌ス蝎ィ繝代シ繝.GUITAR, pad ) ) + { + return this.b謚シ縺輔l縺ヲ縺繧( E讌ス蝎ィ繝代シ繝.BASS, pad ); + } + return true; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private CConfigIni rConfigIni; + private CInput邂。逅 rInput邂。逅; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Common/CPrivateFastFont.cs b/TJAPlayer3/Common/CPrivateFastFont.cs new file mode 100644 index 00000000..4d8edb67 --- /dev/null +++ b/TJAPlayer3/Common/CPrivateFastFont.cs @@ -0,0 +1,427 @@ +サソusing System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Diagnostics; + +namespace TJAPlayer3 +{ + /// + /// 鬮倬滓緒逕サ迚医ョCPrivateFont繧ッ繝ゥ繧ケ縲 + /// 縺ィ縺縺」縺ヲ繧ゅ∽ク蠎ヲ繝ャ繝ウ繝繝ェ繝ウ繧ー縺励◆邨先棡繧偵く繝」繝繧キ繝・縺励※菴ソ縺縺セ繧上@縺ヲ縺繧九□縺代 + /// + public class CPrivateFastFont : CPrivateFont + { + /// + /// 繧ュ繝」繝繧キ繝・螳ケ驥 + /// + private const int MAXCACHESIZE = 128; + + private struct FontCache + { + // public Font font; + public int edgePt; + public string drawstr; + public DrawMode drawmode; + public Color fontColor; + public Color edgeColor; + public Color gradationTopColor; + public Color gradationBottomColor; + public Bitmap bmp; + public Rectangle rectStrings; + public Point ptOrigin; + } + private List listFontCache; + + + #region [ 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ ] + public CPrivateFastFont(FontFamily fontfamily, int pt, FontStyle style) + { + Initialize(null, fontfamily, pt, style); + } + public CPrivateFastFont(FontFamily fontfamily, int pt) + { + Initialize(null, fontfamily, pt, FontStyle.Regular); + } + public CPrivateFastFont(string fontpath, int pt, FontStyle style) + { + Initialize(fontpath, null, pt, style); + } + public CPrivateFastFont(string fontpath, int pt) + { + Initialize(fontpath, null, pt, FontStyle.Regular); + } + public CPrivateFastFont() + { + throw new ArgumentException("CPrivateFastFont: 蠑墓焚縺後≠繧九さ繝ウ繧ケ繝医Λ繧ッ繧ソ繧剃スソ逕ィ縺励※縺上□縺輔>縲"); + } + #endregion + #region [ 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ縺九i蜻シ縺ー繧後k蛻晄悄蛹門ヲ逅 ] + protected new void Initialize(string fontpath, FontFamily fontfamily, int pt, FontStyle style) + { + this.bDispose螳御コ貂医∩_CPrivateFastFont = false; + this.listFontCache = new List(); + base.Initialize(fontpath, fontfamily, pt, style); + } + #endregion + + + #region [ DrawPrivateFont縺ョ繧ェ繝シ繝舌シ繝ュ繝シ繝臥セ、 ] + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆ + /// + /// 謠冗判譁蟄怜 + /// 謠冗判濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + public new Bitmap DrawPrivateFont(string drawstr, Color fontColor) + { + return DrawPrivateFont(drawstr, DrawMode.Normal, fontColor, Color.White, Color.White, Color.White); + } + + public new Bitmap DrawPrivateFont(string drawstr, Color fontColor, Color edgeColor, int edgePt) + { + return DrawPrivateFont_E(drawstr, DrawMode.Edge, fontColor, edgeColor, Color.White, Color.White, edgePt); + } + + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆ + /// + /// 謠冗判譁蟄怜 + /// 謠冗判濶イ + /// 邵∝叙濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + public new Bitmap DrawPrivateFont(string drawstr, Color fontColor, Color edgeColor) + { + return DrawPrivateFont(drawstr, DrawMode.Edge, fontColor, edgeColor, Color.White, Color.White); + } + + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆ + /// + /// 謠冗判譁蟄怜 + /// 謠冗判濶イ + /// 邵∝叙濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + public Bitmap DrawPrivateFont(string drawstr, Color fontColor, Color edgeColor, DrawMode dMode) + { + return DrawPrivateFont(drawstr, dMode, fontColor, edgeColor, Color.White, Color.White); + } + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆ + /// + /// 謠冗判譁蟄怜 + /// 謠冗判濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + //public new Bitmap DrawPrivateFont( string drawstr, Color fontColor, Color gradationTopColor, Color gradataionBottomColor ) + //{ + // return DrawPrivateFont( drawstr, DrawMode.Gradation, fontColor, Color.White, gradationTopColor, gradataionBottomColor ); + //} + + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆ + /// + /// 謠冗判譁蟄怜 + /// 謠冗判濶イ + /// 邵∝叙濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + public new Bitmap DrawPrivateFont(string drawstr, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradataionBottomColor) + { + return DrawPrivateFont(drawstr, DrawMode.Edge | DrawMode.Gradation, fontColor, edgeColor, gradationTopColor, gradataionBottomColor); + } + + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆ + /// + /// 謠冗判譁蟄怜 + /// 謠冗判濶イ + /// 邵∝叙濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + public Bitmap DrawPrivateFont(string drawstr, Color fontColor, Color edgeColor, bool bVertical) + { + return DrawPrivateFont_V(drawstr, fontColor, edgeColor, bVertical); + } + +#if 縺薙■繧峨ッ菴ソ繧上↑縺 // (Bitmap縺ァ縺ッ縺ェ縺上,Texture繧定ソ斐☆迚) + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆ + /// + /// 謠冗判譁蟄怜 + /// 謠冗判濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + public CTexture DrawPrivateFont( string drawstr, Color fontColor ) + { + Bitmap bmp = DrawPrivateFont( drawstr, DrawMode.Normal, fontColor, Color.White, Color.White, Color.White ); + return CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmp, false ); + } + + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆ + /// + /// 謠冗判譁蟄怜 + /// 謠冗判濶イ + /// 邵∝叙濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + public CTexture DrawPrivateFont( string drawstr, Color fontColor, Color edgeColor ) + { + Bitmap bmp = DrawPrivateFont( drawstr, DrawMode.Edge, fontColor, edgeColor, Color.White, Color.White ); + return CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmp, false ); + } + + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆ + /// + /// 謠冗判譁蟄怜 + /// 謠冗判濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + //public CTexture DrawPrivateFont( string drawstr, Color fontColor, Color gradationTopColor, Color gradataionBottomColor ) + //{ + // Bitmap bmp = DrawPrivateFont( drawstr, DrawMode.Gradation, fontColor, Color.White, gradationTopColor, gradataionBottomColor ); + // return CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmp, false ); + //} + + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆ + /// + /// 謠冗判譁蟄怜 + /// 謠冗判濶イ + /// 邵∝叙濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + public CTexture DrawPrivateFont( string drawstr, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradataionBottomColor ) + { + Bitmap bmp = DrawPrivateFont( drawstr, DrawMode.Edge | DrawMode.Gradation, fontColor, edgeColor, gradationTopColor, gradataionBottomColor ); + return CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmp, false ); + } +#endif + #endregion + + protected new Bitmap DrawPrivateFont_E(string drawstr, DrawMode drawmode, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradationBottomColor, int edgePt) + { + #region [ 莉・蜑阪Ξ繝ウ繝繝ェ繝ウ繧ー縺励◆縺薙→縺ョ縺ゅk譁蟄怜/繝輔か繝ウ繝医°? (繧ュ繝」繝繧キ繝・縺ォ繝偵ャ繝医☆繧九°?) ] + int index = listFontCache.FindIndex( + delegate (FontCache fontcache) + { + return ( + drawstr == fontcache.drawstr && + drawmode == fontcache.drawmode && + fontColor == fontcache.fontColor && + edgeColor == fontcache.edgeColor && + gradationTopColor == fontcache.gradationTopColor && + gradationBottomColor == fontcache.gradationBottomColor && + edgePt == fontcache.edgePt + // _font == fontcache.font + ); + } + ); + #endregion + if (index < 0) + { + // 繧ュ繝」繝繧キ繝・縺ォ繝偵ャ繝医○縺壹 + #region [ 繝ャ繝ウ繝繝ェ繝ウ繧ー縺励※縲√く繝」繝繧キ繝・縺ォ逋サ骭イ ] + FontCache fc = new FontCache(); + fc.bmp = base.DrawPrivateFont_E(drawstr, drawmode, fontColor, edgeColor, gradationTopColor, gradationBottomColor, edgePt); + fc.drawstr = drawstr; + fc.drawmode = drawmode; + fc.fontColor = fontColor; + fc.edgeColor = edgeColor; + fc.gradationTopColor = gradationTopColor; + fc.gradationBottomColor = gradationBottomColor; + fc.edgePt = edgePt; + fc.rectStrings = RectStrings; + fc.ptOrigin = PtOrigin; + listFontCache.Add(fc); + Debug.WriteLine(drawstr + ": Cache縺ォ繝偵ャ繝医○縺壹(cachesize=" + listFontCache.Count + ")"); + #endregion + #region [ 繧ゅ@繧ュ繝」繝繧キ繝・縺後≠縺オ繧後◆繧峨∵怙繧ょ商縺繧ュ繝」繝繧キ繝・繧堤エ譽縺吶k ] + if (listFontCache.Count > MAXCACHESIZE) + { + Debug.WriteLine("Cache貅「繧後" + listFontCache[0].drawstr + " 繧定ァ」謾セ縺励∪縺吶"); + if (listFontCache[0].bmp != null) + { + listFontCache[0].bmp.Dispose(); + } + listFontCache.RemoveAt(0); + } + #endregion + + // 蜻シ縺ウ蜃コ縺怜縺ョDispose()縺ァ繧ュ繝」繝繧キ繝・繧Dispose()縺輔l縺ェ縺繧医≧縺ォ縲,lone()縺ァ霑斐☆縲 + return (Bitmap)listFontCache[listFontCache.Count - 1].bmp.Clone(); + } + else + { + Debug.WriteLine(drawstr + ": Cache縺ォ繝偵ャ繝!! index=" + index); + #region [ 繧ュ繝」繝繧キ繝・縺ォ繝偵ャ繝医ゅΞ繝ウ繝繝ェ繝ウ繧ー縺ッ陦後o縺壹√く繝」繝繧キ繝・蜀縺ョ繝繝シ繧ソ繧定ソ斐@縺ヲ邨ゆコ縲] + RectStrings = listFontCache[index].rectStrings; + PtOrigin = listFontCache[index].ptOrigin; + // 蜻シ縺ウ蜃コ縺怜縺ョDispose()縺ァ繧ュ繝」繝繧キ繝・繧Dispose()縺輔l縺ェ縺繧医≧縺ォ縲,lone()縺ァ霑斐☆縲 + return (Bitmap)listFontCache[index].bmp.Clone(); + #endregion + } + } + + protected new Bitmap DrawPrivateFont(string drawstr, DrawMode drawmode, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradationBottomColor) + { + #region [ 莉・蜑阪Ξ繝ウ繝繝ェ繝ウ繧ー縺励◆縺薙→縺ョ縺ゅk譁蟄怜/繝輔か繝ウ繝医°? (繧ュ繝」繝繧キ繝・縺ォ繝偵ャ繝医☆繧九°?) ] + int index = listFontCache.FindIndex( + delegate (FontCache fontcache) + { + return ( + drawstr == fontcache.drawstr && + drawmode == fontcache.drawmode && + fontColor == fontcache.fontColor && + edgeColor == fontcache.edgeColor && + gradationTopColor == fontcache.gradationTopColor && + gradationBottomColor == fontcache.gradationBottomColor + // _font == fontcache.font + ); + } + ); + #endregion + if (index < 0) + { + // 繧ュ繝」繝繧キ繝・縺ォ繝偵ャ繝医○縺壹 + #region [ 繝ャ繝ウ繝繝ェ繝ウ繧ー縺励※縲√く繝」繝繧キ繝・縺ォ逋サ骭イ ] + FontCache fc = new FontCache(); + fc.bmp = base.DrawPrivateFont(drawstr, drawmode, fontColor, edgeColor, gradationTopColor, gradationBottomColor); + fc.drawstr = drawstr; + fc.drawmode = drawmode; + fc.fontColor = fontColor; + fc.edgeColor = edgeColor; + fc.gradationTopColor = gradationTopColor; + fc.gradationBottomColor = gradationBottomColor; + fc.rectStrings = RectStrings; + fc.ptOrigin = PtOrigin; + listFontCache.Add(fc); + Debug.WriteLine(drawstr + ": Cache縺ォ繝偵ャ繝医○縺壹(cachesize=" + listFontCache.Count + ")"); + #endregion + #region [ 繧ゅ@繧ュ繝」繝繧キ繝・縺後≠縺オ繧後◆繧峨∵怙繧ょ商縺繧ュ繝」繝繧キ繝・繧堤エ譽縺吶k ] + if (listFontCache.Count > MAXCACHESIZE) + { + Debug.WriteLine("Cache貅「繧後" + listFontCache[0].drawstr + " 繧定ァ」謾セ縺励∪縺吶"); + if (listFontCache[0].bmp != null) + { + listFontCache[0].bmp.Dispose(); + } + listFontCache.RemoveAt(0); + } + #endregion + + // 蜻シ縺ウ蜃コ縺怜縺ョDispose()縺ァ繧ュ繝」繝繧キ繝・繧Dispose()縺輔l縺ェ縺繧医≧縺ォ縲,lone()縺ァ霑斐☆縲 + return (Bitmap)listFontCache[listFontCache.Count - 1].bmp.Clone(); + } + else + { + Debug.WriteLine(drawstr + ": Cache縺ォ繝偵ャ繝!! index=" + index); + #region [ 繧ュ繝」繝繧キ繝・縺ォ繝偵ャ繝医ゅΞ繝ウ繝繝ェ繝ウ繧ー縺ッ陦後o縺壹√く繝」繝繧キ繝・蜀縺ョ繝繝シ繧ソ繧定ソ斐@縺ヲ邨ゆコ縲] + RectStrings = listFontCache[index].rectStrings; + PtOrigin = listFontCache[index].ptOrigin; + // 蜻シ縺ウ蜃コ縺怜縺ョDispose()縺ァ繧ュ繝」繝繧キ繝・繧Dispose()縺輔l縺ェ縺繧医≧縺ォ縲,lone()縺ァ霑斐☆縲 + return (Bitmap)listFontCache[index].bmp.Clone(); + #endregion + } + } + + protected new Bitmap DrawPrivateFont_V(string drawstr, Color fontColor, Color edgeColor, bool bVertical) + { + #region [ 莉・蜑阪Ξ繝ウ繝繝ェ繝ウ繧ー縺励◆縺薙→縺ョ縺ゅk譁蟄怜/繝輔か繝ウ繝医°? (繧ュ繝」繝繧キ繝・縺ォ繝偵ャ繝医☆繧九°?) ] + int index = listFontCache.FindIndex( + delegate (FontCache fontcache) + { + return ( + drawstr == fontcache.drawstr && + fontColor == fontcache.fontColor && + edgeColor == fontcache.edgeColor && + bVertical == true + // _font == fontcache.font + ); + } + ); + #endregion + if (index < 0) + { + // 繧ュ繝」繝繧キ繝・縺ォ繝偵ャ繝医○縺壹 + #region [ 繝ャ繝ウ繝繝ェ繝ウ繧ー縺励※縲√く繝」繝繧キ繝・縺ォ逋サ骭イ ] + FontCache fc = new FontCache(); + fc.bmp = base.DrawPrivateFont_V(drawstr, fontColor, edgeColor, true); + fc.drawstr = drawstr; + fc.fontColor = fontColor; + fc.edgeColor = edgeColor; + fc.rectStrings = RectStrings; + fc.ptOrigin = PtOrigin; + listFontCache.Add(fc); + Debug.WriteLine(drawstr + ": Cache縺ォ繝偵ャ繝医○縺壹(cachesize=" + listFontCache.Count + ")"); + #endregion + #region [ 繧ゅ@繧ュ繝」繝繧キ繝・縺後≠縺オ繧後◆繧峨∵怙繧ょ商縺繧ュ繝」繝繧キ繝・繧堤エ譽縺吶k ] + if (listFontCache.Count > MAXCACHESIZE) + { + Debug.WriteLine("Cache貅「繧後" + listFontCache[0].drawstr + " 繧定ァ」謾セ縺励∪縺吶"); + if (listFontCache[0].bmp != null) + { + listFontCache[0].bmp.Dispose(); + } + listFontCache.RemoveAt(0); + } + #endregion + + // 蜻シ縺ウ蜃コ縺怜縺ョDispose()縺ァ繧ュ繝」繝繧キ繝・繧Dispose()縺輔l縺ェ縺繧医≧縺ォ縲,lone()縺ァ霑斐☆縲 + return (Bitmap)listFontCache[listFontCache.Count - 1].bmp.Clone(); + } + else + { + Debug.WriteLine(drawstr + ": Cache縺ォ繝偵ャ繝!! index=" + index); + #region [ 繧ュ繝」繝繧キ繝・縺ォ繝偵ャ繝医ゅΞ繝ウ繝繝ェ繝ウ繧ー縺ッ陦後o縺壹√く繝」繝繧キ繝・蜀縺ョ繝繝シ繧ソ繧定ソ斐@縺ヲ邨ゆコ縲] + RectStrings = listFontCache[index].rectStrings; + PtOrigin = listFontCache[index].ptOrigin; + // 蜻シ縺ウ蜃コ縺怜縺ョDispose()縺ァ繧ュ繝」繝繧キ繝・繧Dispose()縺輔l縺ェ縺繧医≧縺ォ縲,lone()縺ァ霑斐☆縲 + return (Bitmap)listFontCache[index].bmp.Clone(); + #endregion + } + } + + #region [ IDisposable 螳溯」 ] + //----------------- + public new void Dispose() + { + if (!this.bDispose螳御コ貂医∩_CPrivateFastFont) + { + if (listFontCache != null) + { + //Debug.WriteLine( "Disposing CPrivateFastFont()" ); + #region [ 繧ュ繝」繝繧キ繝・縺励※縺繧狗判蜒上r遐エ譽縺吶k ] + foreach (FontCache bc in listFontCache) + + { + if (bc.bmp != null) + { + bc.bmp.Dispose(); + } + } + #endregion + listFontCache.Clear(); + listFontCache = null; + } + this.bDispose螳御コ貂医∩_CPrivateFastFont = true; + } + base.Dispose(); + } + //----------------- + #endregion + + #region [ private ] + //----------------- + protected bool bDispose螳御コ貂医∩_CPrivateFastFont; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Common/CPrivateFont.cs b/TJAPlayer3/Common/CPrivateFont.cs new file mode 100644 index 00000000..c154eee3 --- /dev/null +++ b/TJAPlayer3/Common/CPrivateFont.cs @@ -0,0 +1,1121 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Runtime.InteropServices; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Diagnostics; +using SlimDX; +using FDK; +using System.Linq; + +namespace TJAPlayer3 +{ + /// + /// 繝励Λ繧、繝吶シ繝医ヵ繧ゥ繝ウ繝医〒縺ョ謠冗判繧呈桶縺繧ッ繝ゥ繧ケ縲 + /// + /// 繝輔か繝ウ繝医ヵ繧。繧、繝ォ縺瑚ヲ九▽縺九i縺ェ縺譎ゅ↓萓句、也匱逕 + /// 繧ケ繧ソ繧、繝ォ謖螳壻ク肴ュ」譎ゅ↓萓句、也匱逕 + /// + /// 邁。蜊倥↑菴ソ縺譁ケ + /// CPrivateFont prvFont = new CPrivateFont( CSkin.Path( @"Graphics\fonts\mplus-1p-bold.ttf" ), 36 ); // 繝励Λ繧、繝吶シ繝医ヵ繧ゥ繝ウ繝 + /// 縺ィ縺 + /// CPrivateFont prvFont = new CPrivateFont( new FontFamily("MS UI Gothic"), 36, FontStyle.Bold ); // 繧キ繧ケ繝繝繝輔か繝ウ繝 + /// 縺ィ縺九@縺滉ク翫〒縲 + /// Bitmap bmp = prvFont.DrawPrivateFont( "ABCDE", Color.White, Color.Black ); // 繝輔か繝ウ繝郁牡シ晉區縲∫ク√ョ濶イシ晞サ偵ョ萓九らク√ョ濶イ縺ッ逵∫払蜿ッ閭ス + /// 縺ィ縺 + /// Bitmap bmp = prvFont.DrawPrivateFont( "ABCDE", Color.White, Color.Black, Color.Yellow, Color.OrangeRed ); // 荳贋ク九げ繝ゥ繝繝シ繧キ繝ァ繝ウ(Yellow竊丹rangeRed) + /// 縺ィ縺九@縺ヲ縲 + /// CTexture ctBmp = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmp, false ); + /// ctBMP.t2D謠冗判( ス橸ス橸ス ); + /// 縺ァ陦ィ遉コ縺励※縺上□縺輔>縲 + /// + /// 豕ィ諢冗せ + /// 莉サ諢上ョ繝輔か繝ウ繝医〒縺ョ繝ャ繝ウ繝繝ェ繝ウ繧ー縺ッ邨先ァ玖イ闕キ縺悟、ァ縺阪>縺ョ縺ァ縲√↑繧九∋ス九↑繧画緒逕サ繝輔Ξ繝シ繝豈弱↓繝輔か繝ウ繝医r蜀阪Ξ繝ウ繝繝ェ繝ウ繧ー縺吶k繧医≧縺ェ縺薙→縺ッ縺帙★縲 + /// 荳譌ヲ繝ャ繝ウ繝繝ェ繝ウ繧ー縺励◆繧ゅョ繧呈緒逕サ縺ォ菴ソ縺蝗槭☆繧医≧縺ォ縺励※縺上□縺輔>縲 + /// 縺セ縺溘髟キ縺譁蟄怜励r荳弱∴繧九→縲∬ソ斐&繧後kBitmap繧よィェ髟キ縺ォ縺ェ繧翫∪縺吶ゅ%縺ョ讓ェ髟キ逕サ蜒上r縺昴ョ縺セ縺セ繝繧ッ繧ケ繝√Ε縺ィ縺励※菴ソ縺縺ィ縲 + /// 蜿、縺ПC縺ァ蝠城。後r逋コ逕溘&縺帙d縺吶>縺ァ縺吶ゅ%繧後r蝗樣∩縺吶k縺ォ縺ッ縲∽ク譌ヲBitmap縺ィ縺励※蜿門セ励@縺溘ョ縺。縲256pix繧512pix縺ァ蛻蜑イ縺励※ + /// 繝繧ッ繧ケ繝√Ε縺ォ螳夂セゥ縺吶k繧医≧縺ォ縺励※縺上□縺輔>縲 + /// + + #region In諡。蠑オ蟄 + public static class StringExtensions + { + public static bool In(this string str, params string[] param) + { + return param.Contains(str); + } + } + #endregion + + public class CPrivateFont : IDisposable + { + #region [ 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ ] + public CPrivateFont( FontFamily fontfamily, int pt, FontStyle style ) + { + Initialize( null, fontfamily, pt, style ); + } + public CPrivateFont( FontFamily fontfamily, int pt ) + { + Initialize( null, fontfamily, pt, FontStyle.Regular ); + } + public CPrivateFont( string fontpath, int pt, FontStyle style ) + { + Initialize( fontpath, null, pt, style ); + } + public CPrivateFont( string fontpath, int pt ) + { + Initialize( fontpath, null, pt, FontStyle.Regular ); + } + public CPrivateFont() + { + //throw new ArgumentException("CPrivateFont: 蠑墓焚縺後≠繧九さ繝ウ繧ケ繝医Λ繧ッ繧ソ繧剃スソ逕ィ縺励※縺上□縺輔>縲"); + } + #endregion + + protected void Initialize( string fontpath, FontFamily fontfamily, int pt, FontStyle style ) + { + this._pfc = null; + this._fontfamily = null; + this._font = null; + this._pt = pt; + this._rectStrings = new Rectangle(0, 0, 0, 0); + this._ptOrigin = new Point(0, 0); + this.bDispose螳御コ貂医∩ = false; + + if (fontfamily != null) + { + this._fontfamily = fontfamily; + } + else + { + try + { + this._pfc = new System.Drawing.Text.PrivateFontCollection(); //PrivateFontCollection繧ェ繝悶ず繧ァ繧ッ繝医r菴懈舌☆繧 + this._pfc.AddFontFile(fontpath); //PrivateFontCollection縺ォ繝輔か繝ウ繝医r霑ス蜉縺吶k + _fontfamily = _pfc.Families[0]; + } + catch (System.IO.FileNotFoundException) + { + Trace.TraceWarning("繝励Λ繧、繝吶シ繝医ヵ繧ゥ繝ウ繝医ョ霑ス蜉縺ォ螟ア謨励@縺セ縺励◆({0})縲ゆサ」繧上j縺ォMS UI Gothic縺ョ菴ソ逕ィ繧定ゥヲ縺ソ縺セ縺吶", fontpath); + //throw new FileNotFoundException( "繝励Λ繧、繝吶シ繝医ヵ繧ゥ繝ウ繝医ョ霑ス蜉縺ォ螟ア謨励@縺セ縺励◆縲({0})", Path.GetFileName( fontpath ) ); + //return; + _fontfamily = null; + } + + //foreach ( FontFamily ff in _pfc.Families ) + //{ + // Debug.WriteLine( "fontname=" + ff.Name ); + // if ( ff.Name == Path.GetFileNameWithoutExtension( fontpath ) ) + // { + // _fontfamily = ff; + // break; + // } + //} + //if ( _fontfamily == null ) + //{ + // Trace.TraceError( "繝励Λ繧、繝吶シ繝医ヵ繧ゥ繝ウ繝医ョ霑ス蜉蠕後∵、懃エ「縺ォ螟ア謨励@縺セ縺励◆縲({0})", fontpath ); + // return; + //} + } + + // 謖螳壹&繧後◆繝輔か繝ウ繝医せ繧ソ繧、繝ォ縺碁←逕ィ縺ァ縺阪↑縺蝣エ蜷医ッ縲√ヵ繧ゥ繝ウ繝亥縺ァ螳夂セゥ縺輔l縺ヲ縺繧九せ繧ソ繧、繝ォ縺九i蛟呵」懊r驕ク繧薙〒菴ソ逕ィ縺吶k + // 菴輔b繧ケ繧ソ繧、繝ォ縺御スソ縺医↑縺繧医≧縺ェ繝輔か繝ウ繝医↑繧峨∽セ句、悶r蜃コ縺吶 + if (_fontfamily != null) + { + if (!_fontfamily.IsStyleAvailable(style)) + { + FontStyle[] FS = { FontStyle.Regular, FontStyle.Bold, FontStyle.Italic, FontStyle.Underline, FontStyle.Strikeout }; + style = FontStyle.Regular | FontStyle.Bold | FontStyle.Italic | FontStyle.Underline | FontStyle.Strikeout; // null髱櫁ィア螳ケ蝙九↑縺ョ縺ァ縲∽サ」繧上j縺ォ蜈ィ逶帙rNG繝ッ繝シ繝峨↓險ュ螳 + foreach (FontStyle ff in FS) + { + if (this._fontfamily.IsStyleAvailable(ff)) + { + style = ff; + Trace.TraceWarning("繝輔か繝ウ繝{0}縺ク縺ョ繧ケ繧ソ繧、繝ォ謖螳壹r縲+1}縺ォ螟画峩縺励∪縺励◆縲", Path.GetFileName(fontpath), style.ToString()); + break; + } + } + if (style == (FontStyle.Regular | FontStyle.Bold | FontStyle.Italic | FontStyle.Underline | FontStyle.Strikeout)) + { + Trace.TraceWarning("繝輔か繝ウ繝{0}縺ッ驕ゥ蛻縺ェ繧ケ繧ソ繧、繝ォ{1}繧帝∈謚槭〒縺阪∪縺帙s縺ァ縺励◆縲", Path.GetFileName(fontpath), style.ToString()); + } + } + //this._font = new Font(this._fontfamily, pt, style); //PrivateFontCollection縺ョ蜈磯ュ縺ョ繝輔か繝ウ繝医ョFont繧ェ繝悶ず繧ァ繧ッ繝医r菴懈舌☆繧 + float emSize = pt * 96.0f / 72.0f; + this._font = new Font(this._fontfamily, emSize, style, GraphicsUnit.Pixel); //PrivateFontCollection縺ョ蜈磯ュ縺ョ繝輔か繝ウ繝医ョFont繧ェ繝悶ず繧ァ繧ッ繝医r菴懈舌☆繧 + //HighDPI蟇セ蠢懊ョ縺溘a縲}x繧オ繧、繧コ縺ァ謖螳 + } + else + // 繝輔か繝ウ繝医ヵ繧。繧、繝ォ縺瑚ヲ九▽縺九i縺ェ縺九▲縺溷エ蜷 (MS PGothic繧剃サ」繧上j縺ォ謖螳壹☆繧) + { + float emSize = pt * 96.0f / 72.0f; + this._font = new Font("MS UI Gothic", emSize, style, GraphicsUnit.Pixel); //MS PGothic縺ョFont繧ェ繝悶ず繧ァ繧ッ繝医r菴懈舌☆繧 + FontFamily[] ffs = new System.Drawing.Text.InstalledFontCollection().Families; + int lcid = System.Globalization.CultureInfo.GetCultureInfo("en-us").LCID; + foreach (FontFamily ff in ffs) + { + // Trace.WriteLine( lcid ) ); + if (ff.GetName(lcid) == "MS UI Gothic") + { + this._fontfamily = ff; + Trace.TraceInformation("MS UI Gothic繧剃サ」繧上j縺ォ謖螳壹@縺セ縺励◆縲"); + return; + } + } + throw new FileNotFoundException("繝励Λ繧、繝吶シ繝医ヵ繧ゥ繝ウ繝医ョ霑ス蜉縺ォ螟ア謨励@縲`S UI Gothic縺ァ縺ョ莉」譖ソ蜃ヲ逅縺ォ繧ょ、ア謨励@縺セ縺励◆縲({0})", Path.GetFileName(fontpath)); + } + } + + [Flags] + public enum DrawMode + { + Normal, + Edge, + Gradation, + Vertical + } + + #region [ DrawPrivateFont縺ョ繧ェ繝シ繝舌シ繝ュ繝シ繝臥セ、 ] + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆ + /// + /// 謠冗判譁蟄怜 + /// 謠冗判濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + public Bitmap DrawPrivateFont( string drawstr, Color fontColor ) + { + return DrawPrivateFont( drawstr, DrawMode.Normal, fontColor, Color.White, Color.White, Color.White ); + } + + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆ + /// + /// 謠冗判譁蟄怜 + /// 謠冗判濶イ + /// 邵∝叙濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + public Bitmap DrawPrivateFont( string drawstr, Color fontColor, Color edgeColor ) + { + return DrawPrivateFont( drawstr, DrawMode.Edge, fontColor, edgeColor, Color.White, Color.White ); + } + + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆ + /// + /// 謠冗判譁蟄怜 + /// 謠冗判濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + //public Bitmap DrawPrivateFont( string drawstr, Color fontColor, Color gradationTopColor, Color gradataionBottomColor ) + //{ + // return DrawPrivateFont( drawstr, DrawMode.Gradation, fontColor, Color.White, gradationTopColor, gradataionBottomColor ); + //} + + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆ + /// + /// 謠冗判譁蟄怜 + /// 謠冗判濶イ + /// 邵∝叙濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + public Bitmap DrawPrivateFont( string drawstr, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradataionBottomColor ) + { + return DrawPrivateFont( drawstr, DrawMode.Edge | DrawMode.Gradation, fontColor, edgeColor, gradationTopColor, gradataionBottomColor ); + } + +#if 縺薙■繧峨ッ菴ソ繧上↑縺 // (Bitmap縺ァ縺ッ縺ェ縺上,Texture繧定ソ斐☆迚) + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆ + /// + /// 謠冗判譁蟄怜 + /// 謠冗判濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + public CTexture DrawPrivateFont( string drawstr, Color fontColor ) + { + Bitmap bmp = DrawPrivateFont( drawstr, DrawMode.Normal, fontColor, Color.White, Color.White, Color.White ); + return CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmp, false ); + } + + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆ + /// + /// 謠冗判譁蟄怜 + /// 謠冗判濶イ + /// 邵∝叙濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + public CTexture DrawPrivateFont( string drawstr, Color fontColor, Color edgeColor ) + { + Bitmap bmp = DrawPrivateFont( drawstr, DrawMode.Edge, fontColor, edgeColor, Color.White, Color.White ); + return CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmp, false ); + } + + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆ + /// + /// 謠冗判譁蟄怜 + /// 謠冗判濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + //public CTexture DrawPrivateFont( string drawstr, Color fontColor, Color gradationTopColor, Color gradataionBottomColor ) + //{ + // Bitmap bmp = DrawPrivateFont( drawstr, DrawMode.Gradation, fontColor, Color.White, gradationTopColor, gradataionBottomColor ); + // return CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmp, false ); + //} + + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆ + /// + /// 謠冗判譁蟄怜 + /// 謠冗判濶イ + /// 邵∝叙濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + public CTexture DrawPrivateFont( string drawstr, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradataionBottomColor ) + { + Bitmap bmp = DrawPrivateFont( drawstr, DrawMode.Edge | DrawMode.Gradation, fontColor, edgeColor, gradationTopColor, gradataionBottomColor ); + return CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmp, false ); + } +#endif + #endregion + + protected Bitmap DrawPrivateFont_E(string drawstr, DrawMode drawmode, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradationBottomColor, int edgePt) + { + if (this._fontfamily == null || drawstr == null || drawstr == "") + { + // null繧定ソ斐☆縺ィ縲√◎縺ョ蠕恵mp竊稚exture蜃ヲ逅繧縲》exture縺ョ繧オ繧、繧コ繧定ヲ九※__縺ョ蜃ヲ逅縺ァ蜈ィ驛ィ萓句、悶′逋コ逕溘☆繧九%縺ィ縺ォ縺ェ繧九 + // 縺昴l縺ッ髱槫クク縺ォ髱「蛟偵↑縺ョ縺ァ縲∵怙蟆城剞縺ョbitmap繧定ソ斐@縺ヲ縺励∪縺縲 + // 縺セ縺壹ッ縺薙ョ莉墓ァ倥〒騾イ繧√∪縺吶′縲∝撫鬘梧怏繧後ー(荳贋ス榊エ縺九i繧ィ繝ゥ繝シ讀懷コ縺悟ソ隕√〒縺ゅl縺ー)萓句、悶r蜃コ縺励◆繧翫お繝ゥ繝シ迥カ諷九〒縺ゅk繝励Ο繝代ユ繧」繧貞ョ夂セゥ縺吶k縺ェ繧頑、懆ィ弱@縺セ縺吶 + if (drawstr != "") + { + Trace.TraceWarning("DrawPrivateFont()縺ョ蜈・蜉帑ク肴ュ」縲よ怙蟆丞、縺ョbitmap繧定ソ斐@縺セ縺吶"); + } + _rectStrings = new Rectangle(0, 0, 0, 0); + _ptOrigin = new Point(0, 0); + return new Bitmap(1, 1); + } + bool bEdge = ((drawmode & DrawMode.Edge) == DrawMode.Edge); + bool bGradation = ((drawmode & DrawMode.Gradation) == DrawMode.Gradation); + + // 邵∝叙繧翫ョ邵√ョ繧オ繧、繧コ縺ッ縲√→繧翫≠縺医★繝輔か繝ウ繝医ョ螟ァ縺阪&縺ョ1/4縺ィ縺吶k + //int nEdgePt = (bEdge)? _pt / 4 : 0; + //int nEdgePt = (bEdge) ? (_pt / 3) : 0; // 邵∝叙繧翫′蟆代↑縺吶℃繧九→縺縺諢剰ヲ九′螟壹°縺」縺溘◆繧∝、画峩縲 (AioiLight) + int nEdgePt = (bEdge) ? (10 * _pt / edgePt) : 0; //SkinConfig縺ォ縺ヲ險ュ螳壼庄閭ス縺ォ(rhimm) + + // 謠冗判繧オ繧、繧コ繧呈クャ螳壹☆繧 + Size stringSize = System.Windows.Forms.TextRenderer.MeasureText(drawstr, this._font, new Size(int.MaxValue, int.MaxValue), + System.Windows.Forms.TextFormatFlags.NoPrefix | + System.Windows.Forms.TextFormatFlags.NoPadding + ); + stringSize.Width += 10; //2015.04.01 kairera0467 ROTTERDAM NATION縺ョ謠冗判繧オ繧、繧コ縺後≧縺セ縺上>縺九s縺ョ縺ァ縲 + stringSize.Height += 5; + + //蜿門セ励@縺滓緒逕サ繧オ繧、繧コ繧貞渕縺ォ縲∵緒逕サ蜈医ョbitmap繧剃ス懈舌☆繧 + Bitmap bmp = new Bitmap(stringSize.Width + nEdgePt * 2, stringSize.Height + nEdgePt * 3); + bmp.MakeTransparent(); + Graphics g = Graphics.FromImage(bmp); + g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + + StringFormat sf = new StringFormat(); + sf.LineAlignment = StringAlignment.Far; // 逕サ髱「荳矩Κシ亥桙逶エ譁ケ蜷台ス咲スョシ + sf.Alignment = StringAlignment.Center; // 逕サ髱「荳ュ螟ョシ域ーエ蟷ウ譁ケ蜷台ス咲スョシ + sf.FormatFlags = StringFormatFlags.NoWrap; // 縺ゥ繧薙↑縺ォ髟キ縺上※蜊倩ェ槭ョ蛹コ蛻繧翫′濶ッ縺上※繧よ隼陦後@縺ェ縺 (AioiLight) + sf.Trimming = StringTrimming.None; // 縺ゥ繧薙↑縺ォ髟キ縺上※繧ゅヨ繝ェ繝溘Φ繧ー縺励↑縺 (AioiLight) + // 繝ャ繧、繧「繧ヲ繝域棧 + Rectangle r = new Rectangle(0, 0, stringSize.Width + nEdgePt * 2 + (TJAPlayer3.Skin.Text_Correction_X * stringSize.Width / 100), stringSize.Height + nEdgePt * 2 + (TJAPlayer3.Skin.Text_Correction_Y * stringSize.Height / 100)); + + if (bEdge) // 邵∝叙繧頑怏繧翫ョ謠冗判 + { + // DrawPath縺ァ縲√昴う繝ウ繝医し繧、繧コ繧剃スソ縺」縺ヲ謠冗判縺吶k縺溘a縺ォ縲.PI繧剃スソ縺」縺ヲ蜊倅ス榊、画鋤縺吶k + // (縺薙l繧偵@縺ェ縺縺ィ縲∝腰菴阪′驕輔≧縺溘a縺ォ縲∝ー上&繧√↓謠冗判縺輔l縺ヲ縺励∪縺) + float sizeInPixels = _font.SizeInPoints * g.DpiY / 72; // 1 inch = 72 points + + System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath(); + gp.AddString(drawstr, this._fontfamily, (int)this._font.Style, sizeInPixels, r, sf); + + // 邵∝叙繧翫r謠冗判縺吶k + Pen p = new Pen(edgeColor, nEdgePt); + p.LineJoin = System.Drawing.Drawing2D.LineJoin.Round; + g.DrawPath(p, gp); + + // 蝪励j縺、縺カ縺 + Brush br; + if (bGradation) + { + br = new LinearGradientBrush(r, gradationTopColor, gradationBottomColor, LinearGradientMode.Vertical); + } + else + { + br = new SolidBrush(fontColor); + } + g.FillPath(br, gp); + + if (br != null) br.Dispose(); br = null; + if (p != null) p.Dispose(); p = null; + if (gp != null) gp.Dispose(); gp = null; + } + else + { + // 邵∝叙繧翫↑縺励ョ謠冗判 + System.Windows.Forms.TextRenderer.DrawText(g, drawstr, _font, new Point(0, 0), fontColor); + } + + _rectStrings = new Rectangle(0, 0, stringSize.Width, stringSize.Height); + _ptOrigin = new Point(nEdgePt * 2, nEdgePt * 2); + + + #region [ 繝ェ繧ス繝シ繧ケ繧定ァ」謾セ縺吶k ] + if (sf != null) sf.Dispose(); sf = null; + if (g != null) g.Dispose(); g = null; + #endregion + + return bmp; + } + + + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆(繝。繧、繝ウ蜃ヲ逅) + /// + /// 謠冗判縺輔l縺滄伜沺 + /// 謠冗判譁蟄怜 + /// 謠冗判譁蟄怜 + /// 謠冗判繝「繝シ繝 + /// 謠冗判濶イ + /// 邵∝叙濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + protected Bitmap DrawPrivateFont(string drawstr, DrawMode drawmode, Color fontColor, Color edgeColor, Color gradationTopColor, Color gradationBottomColor) + { + int Interval = 5; + + if (this._fontfamily == null || drawstr == null || drawstr == "" || drawstr == " " || drawstr == "縲") + { + // null繧定ソ斐☆縺ィ縲√◎縺ョ蠕恵mp竊稚exture蜃ヲ逅繧縲》exture縺ョ繧オ繧、繧コ繧定ヲ九※__縺ョ蜃ヲ逅縺ァ蜈ィ驛ィ萓句、悶′逋コ逕溘☆繧九%縺ィ縺ォ縺ェ繧九 + // 縺昴l縺ッ髱槫クク縺ォ髱「蛟偵↑縺ョ縺ァ縲∵怙蟆城剞縺ョbitmap繧定ソ斐@縺ヲ縺励∪縺縲 + // 縺セ縺壹ッ縺薙ョ莉墓ァ倥〒騾イ繧√∪縺吶′縲∝撫鬘梧怏繧後ー(荳贋ス榊エ縺九i繧ィ繝ゥ繝シ讀懷コ縺悟ソ隕√〒縺ゅl縺ー)萓句、悶r蜃コ縺励◆繧翫お繝ゥ繝シ迥カ諷九〒縺ゅk繝励Ο繝代ユ繧」繧貞ョ夂セゥ縺吶k縺ェ繧頑、懆ィ弱@縺セ縺吶 + if (drawstr != "") + { + Trace.TraceWarning("DrawPrivateFont()縺ョ蜈・蜉帑ク肴ュ」縲よ怙蟆丞、縺ョbitmap繧定ソ斐@縺セ縺吶"); + } + _rectStrings = new Rectangle(0, 0, 0, 0); + _ptOrigin = new Point(0, 0); + return new Bitmap(1, 1); + } + bool bEdge = ((drawmode & DrawMode.Edge) == DrawMode.Edge); + bool bGradation = ((drawmode & DrawMode.Gradation) == DrawMode.Gradation); + + // 邵∝叙繧翫ョ邵√ョ繧オ繧、繧コ縺ッ縲√→繧翫≠縺医★繝輔か繝ウ繝医ョ螟ァ縺阪&縺ョ1/4縺ィ縺吶k + //int nEdgePt = (bEdge)? _pt / 4 : 0; + //int nEdgePt = (bEdge) ? (_pt / 3) : 0; // 邵∝叙繧翫′蟆代↑縺吶℃繧九→縺縺諢剰ヲ九′螟壹°縺」縺溘◆繧∝、画峩縲 (AioiLight) + int nEdgePt = (bEdge) ? (10 * _pt / TJAPlayer3.Skin.Font_Edge_Ratio) : 0; //SkinConfig縺ォ縺ヲ險ュ螳壼庄閭ス縺ォ(rhimm) + + // 謠冗判繧オ繧、繧コ繧呈クャ螳壹☆繧 + Size stringSize = System.Windows.Forms.TextRenderer.MeasureText(drawstr, this._font, new Size(int.MaxValue, int.MaxValue), + System.Windows.Forms.TextFormatFlags.NoPrefix | + System.Windows.Forms.TextFormatFlags.NoPadding + ); + stringSize.Width += 10; //2015.04.01 kairera0467 ROTTERDAM NATION縺ョ謠冗判繧オ繧、繧コ縺後≧縺セ縺上>縺九s縺ョ縺ァ縲 + stringSize.Height += 5; + + //蜿門セ励@縺滓緒逕サ繧オ繧、繧コ繧貞渕縺ォ縲∵緒逕サ蜈医ョbitmap繧剃ス懈舌☆繧 + Bitmap bmp = new Bitmap(stringSize.Width + nEdgePt * 2, stringSize.Height + nEdgePt * 2); + bmp.MakeTransparent(); + Graphics g = Graphics.FromImage(bmp); + g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + + StringFormat sf = new StringFormat(); + sf.LineAlignment = StringAlignment.Far; // 逕サ髱「荳矩Κシ亥桙逶エ譁ケ蜷台ス咲スョシ + sf.Alignment = StringAlignment.Center; // 逕サ髱「荳ュ螟ョシ域ーエ蟷ウ譁ケ蜷台ス咲スョシ + sf.FormatFlags = StringFormatFlags.NoWrap; // 縺ゥ繧薙↑縺ォ髟キ縺上※蜊倩ェ槭ョ蛹コ蛻繧翫′濶ッ縺上※繧よ隼陦後@縺ェ縺 (AioiLight) + sf.Trimming = StringTrimming.None; // 縺ゥ繧薙↑縺ォ髟キ縺上※繧ゅヨ繝ェ繝溘Φ繧ー縺励↑縺 (AioiLight) + // 繝ャ繧、繧「繧ヲ繝域棧 + Rectangle r = new Rectangle(0, 0, stringSize.Width + nEdgePt * 2 + (TJAPlayer3.Skin.Text_Correction_X * stringSize.Width / 100), stringSize.Height + nEdgePt * 2 + (TJAPlayer3.Skin.Text_Correction_Y * stringSize.Height / 100)); + + if (bEdge) // 邵∝叙繧頑怏繧翫ョ謠冗判 + { + // DrawPath縺ァ縲√昴う繝ウ繝医し繧、繧コ繧剃スソ縺」縺ヲ謠冗判縺吶k縺溘a縺ォ縲.PI繧剃スソ縺」縺ヲ蜊倅ス榊、画鋤縺吶k + // (縺薙l繧偵@縺ェ縺縺ィ縲∝腰菴阪′驕輔≧縺溘a縺ォ縲∝ー上&繧√↓謠冗判縺輔l縺ヲ縺励∪縺) + float sizeInPixels = _font.SizeInPoints * g.DpiY / 72; // 1 inch = 72 points + + System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath(); + gp.AddString(drawstr, this._fontfamily, (int)this._font.Style, sizeInPixels, r, sf); + + // 邵∝叙繧翫r謠冗判縺吶k + Pen p = new Pen(edgeColor, nEdgePt); + p.LineJoin = System.Drawing.Drawing2D.LineJoin.Round; + g.DrawPath(p, gp); + + // 蝪励j縺、縺カ縺 + Brush br; + if (bGradation) + { + br = new LinearGradientBrush(r, gradationTopColor, gradationBottomColor, LinearGradientMode.Vertical); + } + else + { + br = new SolidBrush(fontColor); + } + g.FillPath(br, gp); + + if (br != null) br.Dispose(); br = null; + if (p != null) p.Dispose(); p = null; + if (gp != null) gp.Dispose(); gp = null; + } + else + { + // 邵∝叙繧翫↑縺励ョ謠冗判 + System.Windows.Forms.TextRenderer.DrawText(g, drawstr, _font, new Point(0, 0), fontColor); + } + +#if debug陦ィ遉コ + g.DrawRectangle( new Pen( Color.White, 1 ), new Rectangle( 1, 1, stringSize.Width-1, stringSize.Height-1 ) ); + g.DrawRectangle( new Pen( Color.Green, 1 ), new Rectangle( 0, 0, bmp.Width - 1, bmp.Height - 1 ) ); +#endif + _rectStrings = new Rectangle(0, 0, stringSize.Width, stringSize.Height); + _ptOrigin = new Point(nEdgePt * 2, nEdgePt * 2); + + + #region [ 繝ェ繧ス繝シ繧ケ繧定ァ」謾セ縺吶k ] + if (sf != null) sf.Dispose(); sf = null; + if (g != null) g.Dispose(); g = null; + #endregion + + return bmp; + } + + /// + /// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆(繝。繧、繝ウ蜃ヲ逅) + /// + /// 謠冗判縺輔l縺滄伜沺 + /// 謠冗判譁蟄怜 + /// 謠冗判譁蟄怜 + /// 謠冗判繝「繝シ繝 + /// 謠冗判濶イ + /// 邵∝叙濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ + /// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ + /// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + protected Bitmap DrawPrivateFont_V( string drawstr, Color fontColor, Color edgeColor, bool bVertical ) + { + if ( this._fontfamily == null || drawstr == null || drawstr == "" ) + { + // null繧定ソ斐☆縺ィ縲√◎縺ョ蠕恵mp竊稚exture蜃ヲ逅繧縲》exture縺ョ繧オ繧、繧コ繧定ヲ九※__縺ョ蜃ヲ逅縺ァ蜈ィ驛ィ萓句、悶′逋コ逕溘☆繧九%縺ィ縺ォ縺ェ繧九 + // 縺昴l縺ッ髱槫クク縺ォ髱「蛟偵↑縺ョ縺ァ縲∵怙蟆城剞縺ョbitmap繧定ソ斐@縺ヲ縺励∪縺縲 + // 縺セ縺壹ッ縺薙ョ莉墓ァ倥〒騾イ繧√∪縺吶′縲∝撫鬘梧怏繧後ー(荳贋ス榊エ縺九i繧ィ繝ゥ繝シ讀懷コ縺悟ソ隕√〒縺ゅl縺ー)萓句、悶r蜃コ縺励◆繧翫お繝ゥ繝シ迥カ諷九〒縺ゅk繝励Ο繝代ユ繧」繧貞ョ夂セゥ縺吶k縺ェ繧頑、懆ィ弱@縺セ縺吶 + if ( drawstr != "" ) + { + Trace.TraceWarning( "DrawPrivateFont()縺ョ蜈・蜉帑ク肴ュ」縲よ怙蟆丞、縺ョbitmap繧定ソ斐@縺セ縺吶" ); + } + _rectStrings = new Rectangle( 0, 0, 0, 0 ); + _ptOrigin = new Point( 0, 0 ); + return new Bitmap(1, 1); + } + + //StreamWriter stream = stream = new StreamWriter("Test.txt", false); + + //try + //{ + // stream = new StreamWriter("Test.txt", false); + //} + //catch (Exception ex) + //{ + // stream.Close(); + // stream = new StreamWriter("Test.txt", false); + //} + + string[] strName = new string[ drawstr.Length ]; + for( int i = 0; i < drawstr.Length; i++ ) strName[i] = drawstr.Substring(i, 1); + + #region[ 繧ュ繝」繝ウ繝舌せ縺ョ螟ァ縺阪&莠域クャ ] + //螟ァ縺阪&繧定ィ育ョ励@縺ヲ縺縺上 + int nHeight = 0; + for( int i = 0; i < strName.Length; i++ ) + { + Size strSize = System.Windows.Forms.TextRenderer.MeasureText( strName[ i ], this._font, new Size( int.MaxValue, int.MaxValue ), + System.Windows.Forms.TextFormatFlags.NoPrefix | + System.Windows.Forms.TextFormatFlags.NoPadding ); + + //stringformat縺ッ譛蛻昴↓繧縺」縺ヲ縺縺ヲ繧ゅ>縺縺繧阪≧縲 + StringFormat sFormat = new StringFormat(); + sFormat.LineAlignment = StringAlignment.Center; // 逕サ髱「荳矩Κシ亥桙逶エ譁ケ蜷台ス咲スョシ + sFormat.Alignment = StringAlignment.Center; // 逕サ髱「荳ュ螟ョシ域ーエ蟷ウ譁ケ蜷台ス咲スョシ + + + //縺ァ縺阪k縺縺第ュ」遒コ縺ェ蛟、繧定ィ育ョ励@縺ヲ縺翫″縺溘>...! + Bitmap bmpDummy = new Bitmap( 150, 150 ); //縺ィ繧翫≠縺医★150 + Graphics gCal = Graphics.FromImage( bmpDummy ); + Rectangle rect豁」遒コ縺ェ繧オ繧、繧コ = this.MeasureStringPrecisely( gCal, strName[ i ], this._font, strSize, sFormat ); + int n菴咏區繧オ繧、繧コ = strSize.Height - rect豁」遒コ縺ェ繧オ繧、繧コ.Height; + + Rectangle rect = new Rectangle( 0, -n菴咏區繧オ繧、繧コ + 2, 46, ( strSize.Height + 16 )); + + if( strName[ i ] == "繝シ" || strName[ i ] == "-" || strName[ i ] == "ス" || strName[ i ] == "<" || strName[ i ] == ">" || strName[ i ] == "(" || strName[ i ] == ")" || strName[ i ] == "縲" || strName[ i ] == "縲" || strName[ i ] == "[" || strName[ i ] == "]" ) + { + nHeight += ( rect豁」遒コ縺ェ繧オ繧、繧コ.Width ) + 4; + } + else if( strName[ i ] == "_" ){ nHeight += ( rect豁」遒コ縺ェ繧オ繧、繧コ.Height ) + 6; } + else if( strName[ i ] == " " ) + { nHeight += ( 12 ); } + else { nHeight += ( rect豁」遒コ縺ェ繧オ繧、繧コ.Height ) + 10; } + + //蠢オ縺ョ縺溘a隗」謾セ + bmpDummy.Dispose(); + gCal.Dispose(); + + //stream.WriteLine( "譁蟄励ョ螟ァ縺阪&{0},螟ァ縺阪&蜷郁ィ{1}", ( rect豁」遒コ縺ェ繧オ繧、繧コ.Height ) + 6, nHeight ); + + } + #endregion + + Bitmap bmpCambus = new Bitmap( 46, nHeight ); + Graphics Gcambus = Graphics.FromImage( bmpCambus ); + + //繧ュ繝」繝ウ繝舌せ菴懈絶1譁蟄励★縺、菴懈舌@縺ヲ繧ュ繝」繝ウ繝舌せ縺ォ謠冗判縺ィ縺縺蠖「縺後h縺輔◎縺縺九↑? + int nNowPos = 0; + int nAdded = 0; + int nEdge陬懈ュ」X = 0; + int nEdge陬懈ュ」Y = 0; + if (this._pt < 18) + nAdded = nAdded - 2; + + for (int i = 0; i < strName.Length; i++) + { + Size strSize = System.Windows.Forms.TextRenderer.MeasureText(strName[i], this._font, new Size(int.MaxValue, int.MaxValue), + System.Windows.Forms.TextFormatFlags.NoPrefix | + System.Windows.Forms.TextFormatFlags.NoPadding); + + //stringformat縺ッ譛蛻昴↓繧縺」縺ヲ縺縺ヲ繧ゅ>縺縺繧阪≧縲 + StringFormat sFormat = new StringFormat(); + sFormat.LineAlignment = StringAlignment.Center; // 逕サ髱「荳矩Κシ亥桙逶エ譁ケ蜷台ス咲スョシ + sFormat.Alignment = StringAlignment.Near; // 逕サ髱「荳ュ螟ョシ域ーエ蟷ウ譁ケ蜷台ス咲スョシ + + //縺ァ縺阪k縺縺第ュ」遒コ縺ェ蛟、繧定ィ育ョ励@縺ヲ縺翫″縺溘>...! + Bitmap bmpDummy = new Bitmap(150, 150); //縺ィ繧翫≠縺医★150 + Graphics gCal = Graphics.FromImage(bmpDummy); + Rectangle rect豁」遒コ縺ェ繧オ繧、繧コ = this.MeasureStringPrecisely(gCal, strName[i], this._font, strSize, sFormat); + int n菴咏區繧オ繧、繧コ = strSize.Height - rect豁」遒コ縺ェ繧オ繧、繧コ.Height; + + //Bitmap bmpV = new Bitmap( 36, ( strSize.Height + 12 ) - 6 ); + + Bitmap bmpV = new Bitmap((rect豁」遒コ縺ェ繧オ繧、繧コ.Width + 12) + nAdded, (rect豁」遒コ縺ェ繧オ繧、繧コ.Height) + 12); + + bmpV.MakeTransparent(); + Graphics gV = Graphics.FromImage(bmpV); + gV.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + + + if (strName[i].In(TJAPlayer3.Skin.SongSelect_CorrectionX_Chara)) + { + nEdge陬懈ュ」X = TJAPlayer3.Skin.SongSelect_CorrectionX_Chara_Value; + } + else + { + nEdge陬懈ュ」X = 0; + } + if (strName[i].In(TJAPlayer3.Skin.SongSelect_CorrectionY_Chara)) + { + nEdge陬懈ュ」Y = TJAPlayer3.Skin.SongSelect_CorrectionY_Chara_Value; + } + else + { + nEdge陬懈ュ」Y = 0; + } + //X蠎ァ讓吶〆蠎ァ讓吶◎繧後◇繧後↓縺、縺縺ヲ縲ヾkinConfig蜀縺ァ繧コ繝ャ繧堤峩縺励◆縺譁蟄励r , 縺ァ蛹コ蛻縺」縺ヲ蛻玲嫌縺励※縲 + //陬懈ュ」蛟、繧定ィ伜・縺吶k縺薙→縺ァ縲∫音螳壹ョ縺昴l繧峨ョ譁蟄励↓縺、縺縺ヲ荳諡ャ縺ァ蠎ァ讓吶r縺壹i縺吶 + //迴セ譎らせ縺ァ縺ッ陬懈ュ」蛟、繧湛,Y蜷蠎ァ讓吶↓縺、縺縺ヲ1蛟九★縺、縺励°蜿悶l縺ェ縺シ郁、謨ー蟇セ1シ峨ョ縺ァ縲 + //譁蟄励r蛻玲嫌縺励※縲∝酔縺俶焚縺縺代◎繧後◇繧後ョ譁蟄励ョ陬懈ュ」蛟、繧定ィ伜・縺ァ縺阪k繧医≧縺ェ譫邨繧偵▽縺上j縺溘>縲ゑシ20181205 rhimmシ + + Rectangle rect = new Rectangle(-3 - nAdded + (nEdge陬懈ュ」X * _pt / 100), -rect豁」遒コ縺ェ繧オ繧、繧コ.Y - 2 + (nEdge陬懈ュ」Y * _pt / 100), (strSize.Width + 12), (strSize.Height + 12)); + //Rectangle rect = new Rectangle( 0, -rect豁」遒コ縺ェ繧オ繧、繧コ.Y - 2, 36, rect豁」遒コ縺ェ繧オ繧、繧コ.Height + 10); + + // DrawPath縺ァ縲√昴う繝ウ繝医し繧、繧コ繧剃スソ縺」縺ヲ謠冗判縺吶k縺溘a縺ォ縲.PI繧剃スソ縺」縺ヲ蜊倅ス榊、画鋤縺吶k + // (縺薙l繧偵@縺ェ縺縺ィ縲∝腰菴阪′驕輔≧縺溘a縺ォ縲∝ー上&繧√↓謠冗判縺輔l縺ヲ縺励∪縺) + float sizeInPixels = _font.SizeInPoints * gV.DpiY / 72; // 1 inch = 72 points + + System.Drawing.Drawing2D.GraphicsPath gpV = new System.Drawing.Drawing2D.GraphicsPath(); + gpV.AddString(strName[i], this._fontfamily, (int)this._font.Style, sizeInPixels, rect, sFormat); + + // 邵∝叙繧翫r謠冗判縺吶k + //int nEdgePt = (_pt / 3); // 邵∝叙繧翫r繝輔か繝ウ繝医し繧、繧コ蝓コ貅悶↓螟画峩 + int nEdgePt = (10 * _pt / TJAPlayer3.Skin.Font_Edge_Ratio_Vertical); // SkinConfig縺ォ縺ヲ險ュ螳壼庄閭ス縺ォ(rhimm) + Pen pV = new Pen(edgeColor, nEdgePt); + pV.LineJoin = System.Drawing.Drawing2D.LineJoin.Round; + gV.DrawPath(pV, gpV); + + // 蝪励j縺、縺カ縺 + Brush brV; + { + brV = new SolidBrush(fontColor); + } + gV.FillPath(brV, gpV); + + if (brV != null) brV.Dispose(); brV = null; + if (pV != null) pV.Dispose(); pV = null; + if (gpV != null) gpV.Dispose(); gpV = null; + if (gV != null) gV.Dispose(); gV = null; + + int n陬懈ュ」 = 0; + int nY陬懈ュ」 = 0; + + if (strName[i] == "繝シ" || strName[i] == "-" || strName[i] == "ス") + { + bmpV.RotateFlip(RotateFlipType.Rotate90FlipNone); + n陬懈ュ」 = 2; + if (this._pt < 20) + n陬懈ュ」 = 0; + //nNowPos = nNowPos - 2; + } + else if (strName[i] == "<" || strName[i] == ">" || strName[i] == "(" || strName[i] == ")" || strName[i] == "[" || strName[i] == "]" || strName[i] == "縲" || strName[i] == "シ" || strName[i] == "縲") + { + bmpV.RotateFlip(RotateFlipType.Rotate90FlipNone); + n陬懈ュ」 = 2; + if (this._pt < 20) + { + n陬懈ュ」 = 0; + //nNowPos = nNowPos - 4; + } + } + else if (strName[i] == "縲" || strName[i] == "シ" || strName[i] == "縲") + { + bmpV.RotateFlip(RotateFlipType.Rotate90FlipNone); + n陬懈ュ」 = 2; + if (this._pt < 20) + { + n陬懈ュ」 = 2; + //nNowPos = nNowPos; + } + } + else if (strName[i] == "繝サ") + { + n陬懈ュ」 = -8; + if (this._pt < 20) + { + n陬懈ュ」 = -8; + //nNowPos = nNowPos; + } + } + else if (strName[i] == ".") + { + n陬懈ュ」 = 8; + if (this._pt < 20) + { + n陬懈ュ」 = 8; + //nNowPos = nNowPos; + } + } + else if (strName[i].In(TJAPlayer3.Skin.SongSelect_Rotate_Chara)) + { + bmpV.RotateFlip(RotateFlipType.Rotate90FlipNone); + } + //蛟句挨縺ョ譁蟄励↓髢「縺励※縲√き繝ウ繝槭〒蛹コ蛻縺」縺ヲSkinConfig縺ォ險伜・縺励◆繧ゅョ繧貞屓霆「縺輔○繧(20181205 rhimm) + + + //else if( strName[ i ] == "_" ) + // nNowPos = nNowPos + 20; + else if( strName[ i ] == " " ) + nNowPos = nNowPos + 10; + + + //bmpV.Save( "String" + i.ToString() + ".png" ); + + + if( i == 0 ) + { + nNowPos = 4; + } + Gcambus.DrawImage( bmpV, (bmpCambus.Width / 2) - (bmpV.Width / 2) + n陬懈ュ」, nNowPos + nY陬懈ュ」 ); + nNowPos += bmpV.Size.Height - 6; + + if( bmpV != null ) bmpV.Dispose(); bmpV = null; + if( gCal != null ) gCal.Dispose(); gCal = null; + + //bmpCambus.Save( "test.png" ); + //if( this._pt < 20 ) + // bmpCambus.Save( "test_S.png" ); + + _rectStrings = new Rectangle( 0, 0, strSize.Width, strSize.Height ); + _ptOrigin = new Point( 6 * 2, 6 * 2 ); + + + //stream.WriteLine( "鮟堤┌縺励し繧、繧コ{0},菴咏區{1},鮟偵≠繧贋コ域クャ繧オ繧、繧コ{2},繝昶代ず竊怒3}",rect豁」遒コ縺ェ繧オ繧、繧コ.Height, n菴咏區繧オ繧、繧コ, rect豁」遒コ縺ェ繧オ繧、繧コ.Height + 8, nNowPos ); + + } + //stream.Close(); + + if( Gcambus != null ) Gcambus.Dispose(); + + //return bmp; + return bmpCambus; + } + + ///// + ///// 譁蟄怜励r謠冗判縺励◆繝繧ッ繧ケ繝√Ε繧定ソ斐☆(繝。繧、繝ウ蜃ヲ逅) + ///// + ///// 謠冗判縺輔l縺滄伜沺 + ///// 謠冗判譁蟄怜 + ///// 謠冗判譁蟄怜 + ///// 謠冗判繝「繝シ繝 + ///// 謠冗判濶イ + ///// 邵∝叙濶イ + ///// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳雁エ縺ョ濶イ + ///// 繧ー繝ゥ繝繝シ繧キ繝ァ繝ウ 荳句エ縺ョ濶イ + ///// 謠冗判貂医ユ繧ッ繧ケ繝√Ε + //protected Bitmap DrawPrivateFont_V( string drawstr, Color fontColor, Color edgeColor, bool bVertical ) + //{ + // if ( this._fontfamily == null || drawstr == null || drawstr == "" ) + // { + // // null繧定ソ斐☆縺ィ縲√◎縺ョ蠕恵mp竊稚exture蜃ヲ逅繧縲》exture縺ョ繧オ繧、繧コ繧定ヲ九※__縺ョ蜃ヲ逅縺ァ蜈ィ驛ィ萓句、悶′逋コ逕溘☆繧九%縺ィ縺ォ縺ェ繧九 + // // 縺昴l縺ッ髱槫クク縺ォ髱「蛟偵↑縺ョ縺ァ縲∵怙蟆城剞縺ョbitmap繧定ソ斐@縺ヲ縺励∪縺縲 + // // 縺セ縺壹ッ縺薙ョ莉墓ァ倥〒騾イ繧√∪縺吶′縲∝撫鬘梧怏繧後ー(荳贋ス榊エ縺九i繧ィ繝ゥ繝シ讀懷コ縺悟ソ隕√〒縺ゅl縺ー)萓句、悶r蜃コ縺励◆繧翫お繝ゥ繝シ迥カ諷九〒縺ゅk繝励Ο繝代ユ繧」繧貞ョ夂セゥ縺吶k縺ェ繧頑、懆ィ弱@縺セ縺吶 + // if ( drawstr != "" ) + // { + // Trace.TraceWarning( "DrawPrivateFont()縺ョ蜈・蜉帑ク肴ュ」縲よ怙蟆丞、縺ョbitmap繧定ソ斐@縺セ縺吶" ); + // } + // _rectStrings = new Rectangle( 0, 0, 0, 0 ); + // _ptOrigin = new Point( 0, 0 ); + // return new Bitmap(1, 1); + // } + + // //StreamWriter stream = stream = new StreamWriter("Test.txt", false); + + // //try + // //{ + // // stream = new StreamWriter("Test.txt", false); + // //} + // //catch (Exception ex) + // //{ + // // stream.Close(); + // // stream = new StreamWriter("Test.txt", false); + // //} + + // string[] strName = new string[] { "辟シ","閧","螳","鬟", "X", "G", "t", "e", "s", "t" }; + // strName = new string[ drawstr.Length ]; + // for( int i = 0; i < drawstr.Length; i++ ) strName[i] = drawstr.Substring(i, 1); + + + // Bitmap bmpCambus = new Bitmap( 48, ( drawstr.Length * 31 ) ); + // Graphics Gcambus = Graphics.FromImage( bmpCambus ); + + // //繧ュ繝」繝ウ繝舌せ菴懈絶1譁蟄励★縺、菴懈舌@縺ヲ繧ュ繝」繝ウ繝舌せ縺ォ謠冗判縺ィ縺縺蠖「縺後h縺輔◎縺縺九↑? + + // int nStartPos = 0; + // int nNowPos = 0; + + // //for繝ォ繝シ繝励〒1譁蟄励★縺、bitmap菴懈? + // for( int i = 0; i < strName.Length; i++ ) + // { + // Size strSize = System.Windows.Forms.TextRenderer.MeasureText( strName[ i ], this._font, new Size( int.MaxValue, int.MaxValue ), + // System.Windows.Forms.TextFormatFlags.NoPrefix | + // System.Windows.Forms.TextFormatFlags.NoPadding ); + + // //Bitmap bmpV = new Bitmap( strSize.Width + 12, ( strSize.Height + 12 ) - 6 ); + // Bitmap bmpV = new Bitmap( 36, ( strSize.Height + 12 ) - 6 ); + // bmpV.MakeTransparent(); + // Graphics gV = Graphics.FromImage( bmpV ); + // gV.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + + // StringFormat sFormat = new StringFormat(); + // sFormat.LineAlignment = StringAlignment.Center; // 逕サ髱「荳矩Κシ亥桙逶エ譁ケ蜷台ス咲スョシ + // sFormat.Alignment = StringAlignment.Center; // 逕サ髱「荳ュ螟ョシ域ーエ蟷ウ譁ケ蜷台ス咲スョシ + + + // //Rectangle rect = new Rectangle( 0, 0, strSize.Width + 12, ( strSize.Height + 12 )); + // Rectangle rect = new Rectangle( 0, 0, 36, ( strSize.Height + 12 )); + + // // DrawPath縺ァ縲√昴う繝ウ繝医し繧、繧コ繧剃スソ縺」縺ヲ謠冗判縺吶k縺溘a縺ォ縲.PI繧剃スソ縺」縺ヲ蜊倅ス榊、画鋤縺吶k + // // (縺薙l繧偵@縺ェ縺縺ィ縲∝腰菴阪′驕輔≧縺溘a縺ォ縲∝ー上&繧√↓謠冗判縺輔l縺ヲ縺励∪縺) + // float sizeInPixels = _font.SizeInPoints * gV.DpiY / 72; // 1 inch = 72 points + + // System.Drawing.Drawing2D.GraphicsPath gpV = new System.Drawing.Drawing2D.GraphicsPath(); + // gpV.AddString( strName[ i ], this._fontfamily, (int) this._font.Style, sizeInPixels, rect, sFormat ); + + + // Rectangle rect豁」遒コ縺ェ繧オ繧、繧コ = this.MeasureStringPrecisely( gV, strName[ i ], this._font, strSize, sFormat ); + + // // 邵∝叙繧翫r謠冗判縺吶k + // Pen pV = new Pen( edgeColor, 6 ); + // pV.LineJoin = System.Drawing.Drawing2D.LineJoin.Round; + // gV.DrawPath( pV, gpV ); + + // // 蝪励j縺、縺カ縺 + // Brush brV; + // { + // brV = new SolidBrush( fontColor ); + // } + // gV.FillPath( brV, gpV ); + + // if ( brV != null ) brV.Dispose(); brV = null; + // if ( pV != null ) pV.Dispose(); pV = null; + // if ( gpV != null ) gpV.Dispose(); gpV = null; + + // int n陬懈ュ」 = 0; + + // //bmpV.Save( "String" + i.ToString() + ".png" ); + // if( strName[ i ] == "繝シ" || strName[ i ] == "-" || strName[ i ] == "ス") + // { + // bmpV.RotateFlip( RotateFlipType.Rotate90FlipNone ); + // nNowPos = nNowPos + 20; + // n陬懈ュ」 = 2; + // } + // else if( strName[ i ] == "<" || strName[ i ] == ">" || strName[ i ] == "(" || strName[ i ] == ")" ) + // { + // bmpV.RotateFlip( RotateFlipType.Rotate90FlipNone ); + // nNowPos = nNowPos + 8; + // n陬懈ュ」 = 2; + // } + // else if( strName[ i ] == "_" ) + // nNowPos = nNowPos + 20; + // else if( strName[ i ] == " " ) + // nNowPos = nNowPos + 10; + + // int n菴咏區繧オ繧、繧コ = strSize.Height - rect豁」遒コ縺ェ繧オ繧、繧コ.Height; + // if( i == 0 ) + // { + // nStartPos = -n菴咏區繧オ繧、繧コ + 2; + // nNowPos = -n菴咏區繧オ繧、繧コ + 2; + // Gcambus.DrawImage( bmpV, ( bmpCambus.Size.Width - bmpV.Size.Width ) + n陬懈ュ」, nStartPos ); + // //nNowPos += ( rect豁」遒コ縺ェ繧オ繧、繧コ.Height + 6 ); + // } + // else + // { + // nNowPos += ( strSize.Height - n菴咏區繧オ繧、繧コ ) + 4; + // Gcambus.DrawImage( bmpV, ( bmpCambus.Size.Width - bmpV.Size.Width ) + n陬懈ュ」, nNowPos ); + // } + + // if ( bmpV != null ) bmpV.Dispose(); + + // //bmpCambus.Save( "test.png" ); + + // _rectStrings = new Rectangle( 0, 0, strSize.Width, strSize.Height ); + // _ptOrigin = new Point( 6 * 2, 6 * 2 ); + + + // //stream.WriteLine( "鮟堤┌縺励し繧、繧コ{0},菴咏區{1},鮟偵≠繧贋コ域クャ繧オ繧、繧コ{2},繝昶代ず竊怒3}",rect豁」遒コ縺ェ繧オ繧、繧コ.Height, n菴咏區繧オ繧、繧コ, rect豁」遒コ縺ェ繧オ繧、繧コ.Height + 6, nNowPos ); + + // } + // //stream.Close(); + + // //return bmp; + // return bmpCambus; + //} + + + //------------------------------------------------ + //菴ソ逕ィ:http://dobon.net/vb/dotnet/graphics/measurestring.html + + /// + /// Graphics.DrawString縺ァ譁蟄怜励r謠冗判縺励◆譎ゅョ螟ァ縺阪&縺ィ菴咲スョ繧呈ュ」遒コ縺ォ險域クャ縺吶k + /// + /// 譁蟄怜励r謠冗判縺吶kGraphics + /// 謠冗判縺吶k譁蟄怜 + /// 謠冗判縺ォ菴ソ逕ィ縺吶k繝輔か繝ウ繝 + /// 縺薙l莉・荳雁、ァ縺阪>縺薙→縺ッ縺ェ縺縺ィ縺縺繧オ繧、繧コ縲 + /// 縺ァ縺阪k縺縺大ー上&縺上☆繧九%縺ィ縲 + /// 謠冗判縺ォ菴ソ逕ィ縺吶kStringFormat + /// 譁蟄怜励′謠冗判縺輔l繧狗ッ蝗イ縲 + /// 隕九▽縺九i縺ェ縺九▲縺滓凾縺ッ縲ヽectangle.Empty縲 + public Rectangle MeasureStringPrecisely(Graphics g, + string text, Font font, Size proposedSize, StringFormat stringFormat) + { + //隗」蜒丞コヲ繧貞シ輔″邯吶>縺ァ縲。itmap繧剃ス懈舌☆繧 + Bitmap bmp = new Bitmap(proposedSize.Width, proposedSize.Height, g); + //Bitmap縺ョGraphics繧剃ス懈舌☆繧 + Graphics bmpGraphics = Graphics.FromImage(bmp); + //Graphics縺ョ繝励Ο繝代ユ繧」繧貞シ輔″邯吶$ + bmpGraphics.TextRenderingHint = g.TextRenderingHint; + bmpGraphics.TextContrast = g.TextContrast; + bmpGraphics.PixelOffsetMode = g.PixelOffsetMode; + //譁蟄怜励ョ謠上°繧後※縺縺ェ縺驛ィ蛻縺ョ濶イ繧貞叙蠕励☆繧 + Color backColor = bmp.GetPixel(0, 0); + //螳滄圀縺ォBitmap縺ォ譁蟄怜励r謠冗判縺吶k + bmpGraphics.DrawString(text, font, Brushes.Black, + new RectangleF(0f, 0f, proposedSize.Width, proposedSize.Height), + stringFormat); + bmpGraphics.Dispose(); + //譁蟄怜励′謠冗判縺輔l縺ヲ縺繧狗ッ蝗イ繧定ィ域クャ縺吶k + Rectangle resultRect = MeasureForegroundArea(bmp, backColor); + bmp.Dispose(); + + return resultRect; + } + + /// + /// 謖螳壹&繧後◆Bitmap縺ァ縲|ackColor莉・螟悶ョ濶イ縺御スソ繧上l縺ヲ縺繧狗ッ蝗イ繧定ィ域クャ縺吶k + /// + private Rectangle MeasureForegroundArea(Bitmap bmp, Color backColor) + { + int backColorArgb = backColor.ToArgb(); + int maxWidth = bmp.Width; + int maxHeight = bmp.Height; + + //蟾ヲ蛛エ縺ョ遨コ逋ス驛ィ蛻繧定ィ域クャ縺吶k + int leftPosition = -1; + for (int x = 0; x < maxWidth; x++) + { + for (int y = 0; y < maxHeight; y++) + { + //驕輔≧濶イ繧定ヲ九▽縺代◆縺ィ縺阪ッ縲∽ス咲スョ繧呈アコ螳壹☆繧 + if (bmp.GetPixel(x, y).ToArgb() != backColorArgb) + { + leftPosition = x; + break; + } + } + if (0 <= leftPosition) + { + break; + } + } + //驕輔≧濶イ縺瑚ヲ九▽縺九i縺ェ縺九▲縺滓凾 + if (leftPosition < 0) + { + return Rectangle.Empty; + } + + //蜿ウ蛛エ縺ョ遨コ逋ス驛ィ蛻繧定ィ域クャ縺吶k + int rightPosition = -1; + for (int x = maxWidth - 1; leftPosition < x; x--) + { + for (int y = 0; y < maxHeight; y++) + { + if (bmp.GetPixel(x, y).ToArgb() != backColorArgb) + { + rightPosition = x; + break; + } + } + if (0 <= rightPosition) + { + break; + } + } + if (rightPosition < 0) + { + rightPosition = leftPosition; + } + + //荳翫ョ遨コ逋ス驛ィ蛻繧定ィ域クャ縺吶k + int topPosition = -1; + for (int y = 0; y < maxHeight; y++) + { + for (int x = leftPosition; x <= rightPosition; x++) + { + if (bmp.GetPixel(x, y).ToArgb() != backColorArgb) + { + topPosition = y; + break; + } + } + if (0 <= topPosition) + { + break; + } + } + if (topPosition < 0) + { + return Rectangle.Empty; + } + + //荳九ョ遨コ逋ス驛ィ蛻繧定ィ域クャ縺吶k + int bottomPosition = -1; + for (int y = maxHeight - 1; topPosition < y; y--) + { + for (int x = leftPosition; x <= rightPosition; x++) + { + if (bmp.GetPixel(x, y).ToArgb() != backColorArgb) + { + bottomPosition = y; + break; + } + } + if (0 <= bottomPosition) + { + break; + } + } + if (bottomPosition < 0) + { + bottomPosition = topPosition; + } + + //邨先棡繧定ソ斐☆ + return new Rectangle(leftPosition, topPosition, + rightPosition - leftPosition, bottomPosition - topPosition); + } + + private Rectangle MeasureForegroundArea(Bitmap bmp) + { + return MeasureForegroundArea(bmp, bmp.GetPixel(0, 0)); + } + + //------------------------------------------------ + + /// + /// 譛蠕後↓DrawPrivateFont()縺励◆譁蟄怜励ョ謠冗判鬆伜沺繧貞叙蠕励@縺セ縺吶 + /// + public Rectangle RectStrings + { + get + { + return _rectStrings; + } + protected set + { + _rectStrings = value; + } + } + public Point PtOrigin + { + get + { + return _ptOrigin; + } + protected set + { + _ptOrigin = value; + } + } + + #region [ IDisposable 螳溯」 ] + //----------------- + public void Dispose() + { + if (!this.bDispose螳御コ貂医∩) + { + if (this._font != null) + { + this._font.Dispose(); + this._font = null; + } + if (this._pfc != null) + { + this._pfc.Dispose(); + this._pfc = null; + } + + this.bDispose螳御コ貂医∩ = true; + } + } + //----------------- + #endregion + #region [ private ] + //----------------- + protected bool bDispose螳御コ貂医∩; + protected Font _font; + + private System.Drawing.Text.PrivateFontCollection _pfc; + private FontFamily _fontfamily; + private int _pt; + private Rectangle _rectStrings; + private Point _ptOrigin; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Common/CSkin.cs b/TJAPlayer3/Common/CSkin.cs new file mode 100644 index 00000000..a3844a9b --- /dev/null +++ b/TJAPlayer3/Common/CSkin.cs @@ -0,0 +1,2921 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Diagnostics; +using FDK; +using System.Drawing; +using System.Linq; + +namespace TJAPlayer3 +{ + // 繧ー繝ュ繝シ繝舌Ν螳壽焚 + + public enum E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 + { + BGM繧ェ繝励す繝ァ繝ウ逕サ髱「 = 0, + BGM繧ウ繝ウ繝輔ぅ繧ー逕サ髱「, + BGM襍キ蜍慕判髱「, + BGM驕ク譖イ逕サ髱「, + SOUND繧ケ繝繝シ繧ク螟ア謨鈴浹, + SOUND繧ォ繝シ繧ス繝ォ遘サ蜍暮浹, + SOUND繧イ繝シ繝髢句ァ矩浹, + SOUND繧イ繝シ繝邨ゆコ髻ウ, + SOUND繧ケ繝繝シ繧ク繧ッ繝ェ繧「髻ウ, + SOUND繧ソ繧、繝医Ν髻ウ, + SOUND繝輔Ν繧ウ繝ウ繝憺浹, + SOUND豁灘」ー髻ウ, + SOUND譖イ隱ュ霎シ髢句ァ矩浹, + SOUND豎コ螳夐浹, + SOUND蜿匁カ磯浹, + SOUND螟画峩髻ウ, + //SOUND襍、, + //SOUND髱, + SOUND鬚ィ闊ケ, + SOUND譖イ豎コ螳夐浹, + SOUND謌千クセ逋コ陦ィ, + SOUND迚ケ險灘咲函, + SOUND迚ケ險灘●豁「, + sound迚ケ險薙ず繝」繝ウ繝励昴う繝ウ繝, + sound迚ケ險薙せ繧ュ繝繝鈴浹, + SOUND迚ケ險薙せ繧ッ繝ュ繝シ繝ォ, + Count // 繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝臥キ乗焚縺ョ險育ョ礼畑 + } + + internal class CSkin : IDisposable + { + // 繧ッ繝ゥ繧ケ + + public class C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 : IDisposable + { + // static 繝輔ぅ繝シ繝ォ繝 + + public static CSkin.C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 r譛蠕後↓蜀咲函縺励◆謗剃サ悶す繧ケ繝繝繧オ繧ヲ繝ウ繝; + + private readonly ESoundGroup _soundGroup; + + // 繝輔ぅ繝シ繝ォ繝峨√励Ο繝代ユ繧」 + + public bool bPlayed; + public bool bCompact蟇セ雎。; + public bool b繝ォ繝シ繝; + public bool b隱ュ縺ソ霎シ縺ソ譛ェ隧ヲ陦; + public bool b隱ュ縺ソ霎シ縺ソ謌仙粥; + public bool b謗剃サ; + public string str繝輔ぃ繧、繝ォ蜷 = ""; + public bool b蜀咲函荳ュ + { + get + { + if (this.rSound[1 - this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ] == null) + return false; + + return this.rSound[1 - this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ].b蜀咲函荳ュ; + } + } + public int n菴咲スョ_迴セ蝨ィ縺ョ繧オ繧ヲ繝ウ繝 + { + get + { + CSound sound = this.rSound[1 - this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ]; + if (sound == null) + return 0; + + return sound.n菴咲スョ; + } + set + { + CSound sound = this.rSound[1 - this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ]; + if (sound != null) + sound.n菴咲スョ = value; + } + } + public int n菴咲スョ_谺。縺ォ魑エ繧九し繧ヲ繝ウ繝 + { + get + { + CSound sound = this.rSound[this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ]; + if (sound == null) + return 0; + + return sound.n菴咲スョ; + } + set + { + CSound sound = this.rSound[this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ]; + if (sound != null) + sound.n菴咲スョ = value; + } + } + public int nAutomationLevel_迴セ蝨ィ縺ョ繧オ繧ヲ繝ウ繝 + { + get + { + CSound sound = this.rSound[1 - this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ]; + if (sound == null) + return 0; + + return sound.AutomationLevel; + } + set + { + CSound sound = this.rSound[1 - this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ]; + if (sound != null) + { + sound.AutomationLevel = value; + } + } + } + public int n髟キ縺廟迴セ蝨ィ縺ョ繧オ繧ヲ繝ウ繝 + { + get + { + CSound sound = this.rSound[1 - this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ]; + if (sound == null) + { + return 0; + } + return sound.n邱乗シ泌・乗凾髢杜s; + } + } + public int n髟キ縺廟谺。縺ォ魑エ繧九し繧ヲ繝ウ繝 + { + get + { + CSound sound = this.rSound[this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ]; + if (sound == null) + { + return 0; + } + return sound.n邱乗シ泌・乗凾髢杜s; + } + } + + + /// + /// 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + /// + /// + /// + /// + /// + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(string str繝輔ぃ繧、繝ォ蜷, bool b繝ォ繝シ繝, bool b謗剃サ, bool bCompact蟇セ雎。, ESoundGroup soundGroup) + { + this.str繝輔ぃ繧、繝ォ蜷 = str繝輔ぃ繧、繝ォ蜷; + this.b繝ォ繝シ繝 = b繝ォ繝シ繝; + this.b謗剃サ = b謗剃サ; + this.bCompact蟇セ雎。 = bCompact蟇セ雎。; + _soundGroup = soundGroup; + this.b隱ュ縺ソ霎シ縺ソ譛ェ隧ヲ陦 = true; + this.bPlayed = false; + } + + + // 繝。繧ス繝繝 + + public void t隱ュ縺ソ霎シ縺ソ() + { + this.b隱ュ縺ソ霎シ縺ソ譛ェ隧ヲ陦 = false; + this.b隱ュ縺ソ霎シ縺ソ謌仙粥 = false; + if (string.IsNullOrEmpty(this.str繝輔ぃ繧、繝ォ蜷)) + throw new InvalidOperationException("繝輔ぃ繧、繝ォ蜷阪′辟。蜉ケ縺ァ縺吶"); + + if (!File.Exists(CSkin.Path(this.str繝輔ぃ繧、繝ォ蜷))) + { + Trace.TraceWarning($"繝輔ぃ繧、繝ォ縺悟ュ伜惠縺励∪縺帙s縲: {this.str繝輔ぃ繧、繝ォ蜷閤"); + return; + } + //// for( int i = 0; i < 2; i++ ) // #27790 2012.3.10 yyagi 2蝗櫁ェュ縺ソ蜃コ縺励r縲1蝗櫁ェュ縺ソ縺縺暦シ1蝗槭Γ繝「繝ェ繧ウ繝斐シ縺ォ螟画峩 + //// { + // try + // { + // this.rSound[ 0 ] = CDTXMania.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧( CSkin.Path( this.str繝輔ぃ繧、繝ォ蜷 ) ); + // } + // catch + // { + // this.rSound[ 0 ] = null; + // throw; + // } + // if ( this.rSound[ 0 ] == null ) // #28243 2012.5.3 yyagi "this.rSound[ 0 ].b繧ケ繝医Μ繝シ繝蜀咲函縺吶k"譎ゅbClone縺吶k繧医≧縺ォ縺励〉Sound[1]縺系ull縺ォ縺ェ繧峨↑縺繧医≧菫ョ豁」竊池Sound[1]縺ョ蜀咲函豁」蟶ク蛹 + // { + // this.rSound[ 1 ] = null; + // } + // else + // { + // this.rSound[ 1 ] = ( CSound ) this.rSound[ 0 ].Clone(); // #27790 2012.3.10 yyagi add: to accelerate loading chip sounds + // CDTXMania.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逋サ骭イ縺吶k( this.rSound[ 1 ] ); // #28243 2012.5.3 yyagi add (逋サ骭イ貍上l縺ォ繧医j繧ケ繝医Μ繝シ繝蜀咲函蜃ヲ逅縺檎匱逕溘@縺ヲ縺縺ェ縺九▲縺) + // } + + //// } + + for (int i = 0; i < 2; i++) // 荳譌ヲClone繧呈ュ「繧√※ASIO蟇セ蠢懊↓蟆ょソオ + { + try + { + this.rSound[i] = TJAPlayer3.Sound邂。逅?.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧(CSkin.Path(this.str繝輔ぃ繧、繝ォ蜷), _soundGroup); + } + catch + { + this.rSound[i] = null; + throw; + } + } + this.b隱ュ縺ソ霎シ縺ソ謌仙粥 = true; + } + public void t蜀咲函縺吶k() + { + if (this.b隱ュ縺ソ霎シ縺ソ譛ェ隧ヲ陦) + { + try + { + t隱ュ縺ソ霎シ縺ソ(); + } + catch (Exception e) + { + Trace.TraceError(e.ToString()); + Trace.TraceError("萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (17668977-4686-4aa7-b3f0-e0b9a44975b8)"); + this.b隱ュ縺ソ霎シ縺ソ譛ェ隧ヲ陦 = false; + } + } + if (this.b謗剃サ) + { + if (r譛蠕後↓蜀咲函縺励◆謗剃サ悶す繧ケ繝繝繧オ繧ヲ繝ウ繝 != null) + r譛蠕後↓蜀咲函縺励◆謗剃サ悶す繧ケ繝繝繧オ繧ヲ繝ウ繝.t蛛懈ュ「縺吶k(); + + r譛蠕後↓蜀咲函縺励◆謗剃サ悶す繧ケ繝繝繧オ繧ヲ繝ウ繝 = this; + } + CSound sound = this.rSound[this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ]; + if (sound != null) + sound.t蜀咲函繧帝幕蟋九☆繧(this.b繝ォ繝シ繝); + + this.bPlayed = true; + this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ = 1 - this.n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ; + } + public void t蛛懈ュ「縺吶k() + { + this.bPlayed = false; + if (this.rSound[0] != null) + this.rSound[0].t蜀咲函繧貞●豁「縺吶k(); + + if (this.rSound[1] != null) + this.rSound[1].t蜀咲函繧貞●豁「縺吶k(); + + if (r譛蠕後↓蜀咲函縺励◆謗剃サ悶す繧ケ繝繝繧オ繧ヲ繝ウ繝 == this) + r譛蠕後↓蜀咲函縺励◆謗剃サ悶す繧ケ繝繝繧オ繧ヲ繝ウ繝 = null; + } + + public void tRemoveMixer() + { + if (TJAPlayer3.Sound邂。逅.GetCurrentSoundDeviceType() != "DirectShow") + { + for (int i = 0; i < 2; i++) + { + if (this.rSound[i] != null) + { + TJAPlayer3.Sound邂。逅.RemoveMixer(this.rSound[i]); + } + } + } + } + + #region [ IDisposable 螳溯」 ] + //----------------- + public void Dispose() + { + if (!this.bDisposed貂医∩) + { + for (int i = 0; i < 2; i++) + { + if (this.rSound[i] != null) + { + TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r遐エ譽縺吶k(this.rSound[i]); + this.rSound[i] = null; + } + } + this.b隱ュ縺ソ霎シ縺ソ謌仙粥 = false; + this.bDisposed貂医∩ = true; + } + } + //----------------- + #endregion + + #region [ private ] + //----------------- + private bool bDisposed貂医∩; + private int n谺。縺ォ魑エ繧九し繧ヲ繝ウ繝臥分蜿キ; + private CSound[] rSound = new CSound[2]; + //----------------- + #endregion + } + + + // 繝励Ο繝代ユ繧」 + + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm繧ェ繝励す繝ァ繝ウ逕サ髱「 = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm繧ウ繝ウ繝輔ぅ繧ー逕サ髱「 = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm襍キ蜍慕判髱「 = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundSTAGEFAILED髻ウ = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound繧ォ繝シ繧ス繝ォ遘サ蜍暮浹 = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound繧イ繝シ繝髢句ァ矩浹 = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound繧イ繝シ繝邨ゆコ髻ウ = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound繧ケ繝繝シ繧ク繧ッ繝ェ繧「髻ウ = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound繝輔Ν繧ウ繝ウ繝憺浹 = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound豁灘」ー髻ウ = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound譖イ隱ュ霎シ髢句ァ矩浹 = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound豎コ螳夐浹 = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound蜿匁カ磯浹 = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound螟画峩髻ウ = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundSongSelectChara = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundSkip = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundEntry = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundError = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundsanka = null; + //add + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound譖イ豎コ螳夐浹 = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm繝ェ繧カ繝ォ繝医う繝ウ髻ウ = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm繝ェ繧カ繝ォ繝磯浹 = null; + + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm繧ソ繧、繝医Ν = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm繧ソ繧、繝医Ν繧、繝ウ = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm驕ク譖イ逕サ髱「 = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm驕ク譖イ逕サ髱「繧、繝ウ = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm繝ェ繧カ繝ォ繝 = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 bgm繝ェ繧カ繝ォ繝医う繝ウ = null; + + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 SoundBanapas = null; + + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound迚ケ險灘咲函髻ウ = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound迚ケ險灘●豁「髻ウ = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound迚ケ險薙ず繝」繝ウ繝励昴う繝ウ繝 = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound迚ケ險薙せ繧ュ繝繝鈴浹 = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound迚ケ險薙せ繧ッ繝ュ繝シ繝ォ髻ウ = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundPon = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundGauge = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundScoreDon = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundChallengeVoice = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundDanSelectStart = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundDanSongSelectCheck = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundDanSelectBGM = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundDanSongSelect = null; + + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundCrownIn = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundRankIn = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundDonClear = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundDonFailed = null; + + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundSelectAnnounce = null; + + //public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundRed = null; + //public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundBlue = null; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 soundBalloon = null; + + + public readonly int n繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝画焚 = (int)E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.Count; + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 this[E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound] + { + get + { + switch (sound) + { + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND繧ォ繝シ繧ス繝ォ遘サ蜍暮浹: + return this.sound繧ォ繝シ繧ス繝ォ遘サ蜍暮浹; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND豎コ螳夐浹: + return this.sound豎コ螳夐浹; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND螟画峩髻ウ: + return this.sound螟画峩髻ウ; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND蜿匁カ磯浹: + return this.sound蜿匁カ磯浹; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND豁灘」ー髻ウ: + return this.sound豁灘」ー髻ウ; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND繧ケ繝繝シ繧ク螟ア謨鈴浹: + return this.soundSTAGEFAILED髻ウ; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND繧イ繝シ繝髢句ァ矩浹: + return this.sound繧イ繝シ繝髢句ァ矩浹; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND繧イ繝シ繝邨ゆコ髻ウ: + return this.sound繧イ繝シ繝邨ゆコ髻ウ; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND繧ケ繝繝シ繧ク繧ッ繝ェ繧「髻ウ: + return this.sound繧ケ繝繝シ繧ク繧ッ繝ェ繧「髻ウ; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND繝輔Ν繧ウ繝ウ繝憺浹: + return this.sound繝輔Ν繧ウ繝ウ繝憺浹; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND譖イ隱ュ霎シ髢句ァ矩浹: + return this.sound譖イ隱ュ霎シ髢句ァ矩浹; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND繧ソ繧、繝医Ν髻ウ: + return this.bgm繧ソ繧、繝医Ν; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.BGM襍キ蜍慕判髱「: + return this.bgm襍キ蜍慕判髱「; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.BGM繧ェ繝励す繝ァ繝ウ逕サ髱「: + return this.bgm繧ェ繝励す繝ァ繝ウ逕サ髱「; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.BGM繧ウ繝ウ繝輔ぅ繧ー逕サ髱「: + return this.bgm繧ウ繝ウ繝輔ぅ繧ー逕サ髱「; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.BGM驕ク譖イ逕サ髱「: + return this.bgm驕ク譖イ逕サ髱「; + + //case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND襍、: + // return this.soundRed; + + //case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND髱: + // return this.soundBlue; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND鬚ィ闊ケ: + return this.soundBalloon; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND譖イ豎コ螳夐浹: + return this.sound譖イ豎コ螳夐浹; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND謌千クセ逋コ陦ィ: + return this.bgm繝ェ繧カ繝ォ繝医う繝ウ髻ウ; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND迚ケ險灘咲函: + return this.sound迚ケ險灘咲函髻ウ; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND迚ケ險灘●豁「: + return this.sound迚ケ險灘●豁「髻ウ; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.sound迚ケ險薙ず繝」繝ウ繝励昴う繝ウ繝: + return this.sound迚ケ險薙ず繝」繝ウ繝励昴う繝ウ繝; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.sound迚ケ險薙せ繧ュ繝繝鈴浹: + return this.sound迚ケ險薙せ繧ュ繝繝鈴浹; + + case E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.SOUND迚ケ險薙せ繧ッ繝ュ繝シ繝ォ: + return this.sound迚ケ險薙せ繧ッ繝ュ繝シ繝ォ髻ウ; + + } + throw new IndexOutOfRangeException(); + } + } + public C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 this[int index] + { + get + { + switch (index) + { + case 0: + return this.sound繧ォ繝シ繧ス繝ォ遘サ蜍暮浹; + + case 1: + return this.sound豎コ螳夐浹; + + case 2: + return this.sound螟画峩髻ウ; + + case 3: + return this.sound蜿匁カ磯浹; + + case 4: + return this.sound豁灘」ー髻ウ; + + case 5: + return this.soundSTAGEFAILED髻ウ; + + case 6: + return this.sound繧イ繝シ繝髢句ァ矩浹; + + case 7: + return this.sound繧イ繝シ繝邨ゆコ髻ウ; + + case 8: + return this.sound繧ケ繝繝シ繧ク繧ッ繝ェ繧「髻ウ; + + case 9: + return this.sound繝輔Ν繧ウ繝ウ繝憺浹; + + case 10: + return this.sound譖イ隱ュ霎シ髢句ァ矩浹; + + case 11: + return this.bgm繧ソ繧、繝医Ν; + + case 12: + return this.bgm襍キ蜍慕判髱「; + + case 13: + return this.bgm繧ェ繝励す繝ァ繝ウ逕サ髱「; + + case 14: + return this.bgm繧ウ繝ウ繝輔ぅ繧ー逕サ髱「; + + case 15: + return this.bgm驕ク譖イ逕サ髱「; + + case 16: + return this.soundBalloon; + + case 17: + return this.sound譖イ豎コ螳夐浹; + + case 18: + return this.bgm繝ェ繧カ繝ォ繝医う繝ウ髻ウ; + + case 19: + return this.sound迚ケ險灘咲函髻ウ; + + case 20: + return this.sound迚ケ險灘●豁「髻ウ; + + case 21: + return this.sound迚ケ險薙せ繧ッ繝ュ繝シ繝ォ髻ウ; + + case 22: + return this.sound迚ケ險薙ず繝」繝ウ繝励昴う繝ウ繝; + + case 23: + return this.sound迚ケ險薙せ繧ュ繝繝鈴浹; + } + throw new IndexOutOfRangeException(); + } + } + + + // 繧ケ繧ュ繝ウ縺ョ蛻繧頑崛縺医↓縺、縺縺ヲ___ + // + // _繧ケ繧ュ繝ウ縺ョ遞ョ鬘槭ッ螟ァ縺阪¥蛻縺代※2遞ョ鬘槭4ystem繧ケ繧ュ繝ウ縺ィboxdef繧ケ繧ュ繝ウ縲 + // 縲蜑崎縺ッSystem/繝輔か繝ォ繝縺ォ繝ヲ繝シ繧カ繝シ縺瑚ェ繧峨う繝ウ繧ケ繝医シ繝ォ縺励※縺翫¥繧ケ繧ュ繝ウ縲 + // 縲蠕瑚縺ッbox.def縺ァ謖螳壹☆繧九∵峇繝繝シ繧ソ蛻カ菴懆縺梧署遉コ縺吶k繧ケ繧ュ繝ウ縲 + // + // _Config逕サ髱「縺ァ縲2遞ョ縺ョ繧ケ繧ュ繝ウ繧貞玄蛻・辟。縺丞クク譎ゆスソ逕ィ縺吶k繧医≧險ュ螳壹☆繧九%縺ィ縺後〒縺阪k縲 + // _box.def縺ョ#SKINPATH 險ュ螳壹↓繧医j縲|oxdef繧ケ繧ュ繝ウ繧剃ク譎ら噪縺ォ菴ソ逕ィ縺吶k繧医≧險ュ螳壹☆繧九 + // 縲(box.def縺ョ蜉ケ譫懊ョ蜿翫ー縺ェ縺莉悶ョmuxic box縺ァ縺ッ縲∝ス楢ゥイboxdef繧ケ繧ュ繝ウ縺ョ譛牙柑諤ァ縺檎┌縺上↑繧) + // + // 縺薙l繧貞ョ溽樟縺吶k縺溘a縺ォ___ + // _System繧ケ繧ュ繝ウ縺ョ險ュ螳壽ュ蝣ア縺ィ縲|oxdef繧ケ繧ュ繝ウ縺ョ險ュ螳壽ュ蝣ア縺ッ縲∝髮「縺励※謖√▽縲 + // 縲(strSystemス橸ス 縺ィ縲《trBoxDefス橸ス橸ス) + // _Config逕サ髱「縺九i縺ッ蜑崎縺ョ縺ソ譖ク縺肴鋤縺医〒縺阪k繧医≧縺ォ縺励 + // 縲驕ク譖イ逕サ髱「縺九i縺ッ蠕瑚縺ョ縺ソ譖ク縺肴鋤縺医〒縺阪k繧医≧縺ォ縺吶k縲(SetCurrent...()) + // _隱ュ縺ソ蜃コ縺励ッ荳。閠縺九i陦後∴繧九h縺縺ォ縺吶k縺ィ蜈ア縺ォ + // 縲驕ク譖イ逕サ髱「逕ィ縺ォ莠檎ィョ縺ョ諠蝣ア繧貞玄蛻・縺励↑縺隱ュ縺ソ蜃コ縺玲婿豕輔b謠蝉セ帙☆繧(GetCurrent...) + + private object lockBoxDefSkin; + public static bool bUseBoxDefSkin = true; // box.def縺九i縺ョ繧ケ繧ュ繝ウ螟画峩繧定ィア螳ケ縺吶k縺句凄縺 + + public string strSystemSkinRoot = null; + public string[] strSystemSkinSubfolders = null; // List縺縺ィignoreCase縺ェ讀懃エ「縺碁擇蛟偵↑縺ョ縺ァ縲驟榊励↓騾縺偵k :-) + private string[] _strBoxDefSkinSubfolders = null; + public string[] strBoxDefSkinSubfolders + { + get + { + lock (lockBoxDefSkin) + { + return _strBoxDefSkinSubfolders; + } + } + set + { + lock (lockBoxDefSkin) + { + _strBoxDefSkinSubfolders = value; + } + } + } // 蛻・繧ケ繝ャ繝繝峨°繧峨b譖ク縺崎セシ縺ソ繧「繧ッ繧サ繧ケ縺輔l繧九◆繧√√せ繝ャ繝繝峨そ繝シ繝輔↑繧「繧ッ繧サ繧ケ豕輔r謠蝉セ + + private static string strSystemSkinSubfolderFullName; // Config逕サ髱「縺ァ險ュ螳壹&繧後◆繧ケ繧ュ繝ウ + private static string strBoxDefSkinSubfolderFullName = ""; // box.def縺ァ謖螳壹&繧後※縺繧九せ繧ュ繝ウ + + /// + /// 繧ケ繧ュ繝ウ繝代せ蜷阪r繝輔Ν繝代せ縺ァ蜿門セ励☆繧 + /// + /// 繝ヲ繝シ繧カ繝シ險ュ螳夂畑縺ェ繧液rue, box.def縺九i縺ョ險ュ螳壹↑繧映alse + /// + public string GetCurrentSkinSubfolderFullName(bool bFromUserConfig) + { + if (!bUseBoxDefSkin || bFromUserConfig == true || strBoxDefSkinSubfolderFullName == "") + { + return strSystemSkinSubfolderFullName; + } + else + { + return strBoxDefSkinSubfolderFullName; + } + } + /// + /// 繧ケ繧ュ繝ウ繝代せ蜷阪r繝輔Ν繝代せ縺ァ險ュ螳壹☆繧 + /// + /// 繧ケ繧ュ繝ウ繝代せ蜷 + /// 繝ヲ繝シ繧カ繝シ險ュ螳夂畑縺ェ繧液rue, box.def縺九i縺ョ險ュ螳壹↑繧映alse + public void SetCurrentSkinSubfolderFullName(string value, bool bFromUserConfig) + { + if (bFromUserConfig) + { + strSystemSkinSubfolderFullName = value; + } + else + { + strBoxDefSkinSubfolderFullName = value; + } + } + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + public CSkin(string _strSkinSubfolderFullName, bool _bUseBoxDefSkin) + { + lockBoxDefSkin = new object(); + strSystemSkinSubfolderFullName = _strSkinSubfolderFullName; + bUseBoxDefSkin = _bUseBoxDefSkin; + InitializeSkinPathRoot(); + ReloadSkinPaths(); + PrepareReloadSkin(); + } + public CSkin() + { + lockBoxDefSkin = new object(); + InitializeSkinPathRoot(); + bUseBoxDefSkin = true; + ReloadSkinPaths(); + PrepareReloadSkin(); + } + private string InitializeSkinPathRoot() + { + strSystemSkinRoot = System.IO.Path.Combine(TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝, "System" + System.IO.Path.DirectorySeparatorChar); + return strSystemSkinRoot; + } + + /// + /// Skin(Sounds)繧貞崎ェュ霎シ縺吶k貅門y繧偵☆繧(蜀咲函蛛懈ュ「,Dispose,繝輔ぃ繧、繝ォ蜷榊崎ィュ螳)縲 + /// 縺ゅi縺九§繧《trSkinSubfolder繧帝←蛻縺ォ險ュ螳壹@縺ヲ縺翫¥縺薙→縲 + /// 縺昴ョ蠕後ヽeloadSkinPaths()繧貞ョ溯。後@縲《trSkinSubfolder縺ョ豁」蠖捺ァ繧堤「コ隱阪@縺滉ク翫〒縲∵悽繝。繧ス繝繝峨r蜻シ縺ウ蜃コ縺吶%縺ィ縲 + /// 譛ャ繝。繧ス繝繝牙他縺ウ蜃コ縺怜セ後↓縲ヽeloadSkin()繧貞ョ溯。後☆繧九%縺ィ縺ァ縲√す繧ケ繝繝繧オ繧ヲ繝ウ繝峨r隱ュ縺ソ霎シ縺ソ逶エ縺吶 + /// ReloadSkin()縺ョ蜀螳ケ縺ッ譛ャ繝。繧ス繝繝牙縺ォ蜷ォ繧√↑縺縺薙→縲りオキ蜍墓凾縺ッReloadSkin()逶ク蠖薙ョ蜃ヲ逅繧辰EnumSongs縺ァ陦後▲縺ヲ縺繧九◆繧√ + /// + public void PrepareReloadSkin() + { + Trace.TraceInformation("SkinPath險ュ螳: {0}", + (strBoxDefSkinSubfolderFullName == "") ? + strSystemSkinSubfolderFullName : + strBoxDefSkinSubfolderFullName + ); + + for (int i = 0; i < n繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝画焚; i++) + { + if (this[i] != null && this[i].b隱ュ縺ソ霎シ縺ソ謌仙粥) + { + this[i].t蛛懈ュ「縺吶k(); + this[i].Dispose(); + } + } + + this.sound繧ォ繝シ繧ス繝ォ遘サ蜍暮浹 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Move.ogg", false, false, false, ESoundGroup.SoundEffect); + this.sound豎コ螳夐浹 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Decide.ogg", false, false, false, ESoundGroup.SoundEffect); + this.sound螟画峩髻ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Change.ogg", false, false, false, ESoundGroup.SoundEffect); + this.sound蜿匁カ磯浹 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Cancel.ogg", false, false, true, ESoundGroup.SoundEffect); + this.sound豁灘」ー髻ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Audience.ogg", false, false, true, ESoundGroup.SoundEffect); + this.soundSTAGEFAILED髻ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Stage failed.ogg", false, true, true, ESoundGroup.Voice); + this.sound繧イ繝シ繝髢句ァ矩浹 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Game start.ogg", false, false, false, ESoundGroup.Voice); + this.sound繧イ繝シ繝邨ゆコ髻ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Game end.ogg", false, true, false, ESoundGroup.Voice); + this.sound繧ケ繝繝シ繧ク繧ッ繝ェ繧「髻ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Stage clear.ogg", false, true, true, ESoundGroup.Voice); + this.sound繝輔Ν繧ウ繝ウ繝憺浹 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Full combo.ogg", false, false, true, ESoundGroup.Voice); + this.sound譖イ隱ュ霎シ髢句ァ矩浹 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Now loading.ogg", false, true, true, ESoundGroup.Unknown); + this.bgm襍キ蜍慕判髱「 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Setup BGM.ogg", true, true, false, ESoundGroup.SongPlayback); + this.bgm繧ェ繝励す繝ァ繝ウ逕サ髱「 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Option BGM.ogg", true, true, false, ESoundGroup.SongPlayback); + this.bgm繧ウ繝ウ繝輔ぅ繧ー逕サ髱「 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Config BGM.ogg", true, true, false, ESoundGroup.SongPlayback); + this.bgm驕ク譖イ逕サ髱「 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Select BGM.ogg", true, true, false, ESoundGroup.SongPlayback); + this.soundSongSelectChara = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\SongSelect Chara.ogg", false, false, false, ESoundGroup.SongPlayback); + this.soundSkip = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Skip.ogg", false, false, false, ESoundGroup.SoundEffect); + this.SoundBanapas = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Banapas.ogg", false, false, false, ESoundGroup.SoundEffect); + this.soundEntry = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Entry.ogg", true, false, false, ESoundGroup.Voice); + this.soundError = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Error.ogg", false, false, false, ESoundGroup.SoundEffect); + this.soundsanka = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\sanka.ogg", false, false, false, ESoundGroup.Voice); + + //this.soundRed = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝( @"Sounds\dong.ogg", false, false, true, ESoundType.SoundEffect ); + //this.soundBlue = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝( @"Sounds\ka.ogg", false, false, true, ESoundType.SoundEffect ); + this.soundBalloon = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\balloon.ogg", false, false, true, ESoundGroup.SoundEffect); + this.sound譖イ豎コ螳夐浹 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\SongDecide.ogg", false, false, true, ESoundGroup.Voice); + + this.bgm繧ソ繧、繝医Ν繧、繝ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\BGM\Title_Start.ogg", false, false, true, ESoundGroup.SongPlayback); + this.bgm繧ソ繧、繝医Ν = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\BGM\Title.ogg", true, false, true, ESoundGroup.SongPlayback); + this.bgm驕ク譖イ逕サ髱「繧、繝ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\BGM\SongSelect_Start.ogg", false, false, true, ESoundGroup.SongPlayback); + this.bgm驕ク譖イ逕サ髱「 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\BGM\SongSelect.ogg", true, false, true, ESoundGroup.SongPlayback); + this.bgm繝ェ繧カ繝ォ繝医う繝ウ髻ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\BGM\Result_In.ogg", false, false, true, ESoundGroup.SongPlayback); + this.bgm繝ェ繧カ繝ォ繝磯浹 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\BGM\Result.ogg", true, false, true, ESoundGroup.SongPlayback); + + + this.soundCrownIn = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\ResultScreen\CrownIn.ogg", false, false, false, ESoundGroup.SoundEffect); + this.soundRankIn = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\ResultScreen\RankIn.ogg", false, false, false, ESoundGroup.SoundEffect); + this.soundDonClear = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\ResultScreen\Donchan_Clear.ogg", false, false,true, ESoundGroup.Voice); + this.soundDonFailed = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\ResultScreen\Donchan_Miss.ogg", false, false, true, ESoundGroup.Voice); + + this.soundSelectAnnounce = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\DiffSelect.ogg", false, false, true, ESoundGroup.Voice); + this.sound迚ケ險灘咲函髻ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Resume.ogg", false, false,false, ESoundGroup.SoundEffect); + this.sound迚ケ險灘●豁「髻ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Pause.ogg", false, false, false, ESoundGroup.SoundEffect); + this.sound迚ケ險薙せ繧ッ繝ュ繝シ繝ォ髻ウ = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Scroll.ogg", false, false, false, ESoundGroup.SoundEffect); + this.sound迚ケ險薙ず繝」繝ウ繝励昴う繝ウ繝 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Jump Point.ogg", false, false, false, ESoundGroup.SoundEffect); + this.sound迚ケ險薙せ繧ュ繝繝鈴浹 = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Traning Skip.ogg", false, false, false, ESoundGroup.SoundEffect); + this.soundPon = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Pon.ogg", false, false, false, ESoundGroup.SoundEffect); + this.soundGauge = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Gauge.ogg", false, false, false, ESoundGroup.SoundEffect); + this.soundScoreDon = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\ScoreDon.ogg", false, false, false, ESoundGroup.SoundEffect); + this.soundChallengeVoice = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Dan\ChallengeVoice.wav", false, false, false, ESoundGroup.SoundEffect); + this.soundDanSelectStart = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Dan\DanSelectStart.wav", false, false, false, ESoundGroup.SoundEffect); + this.soundDanSongSelectCheck = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Dan\DanSongSelectCheck.wav", false, false, false, ESoundGroup.SoundEffect); + this.soundDanSelectBGM = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Dan\DanSelectBGM.wav", true, false, false, ESoundGroup.SongPlayback); + this.soundDanSongSelect = new C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝(@"Sounds\Dan\DanSongSelect.wav", false, false, false, ESoundGroup.SoundEffect); + ReloadSkin(); + tReadSkinConfig(); + } + + public void ReloadSkin() + { + for (int i = 0; i < n繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝画焚; i++) + { + if (!this[i].b謗剃サ) // BGM邉サ莉・螟悶ョ縺ソ隱ュ縺ソ霎シ繧縲(BGM邉サ縺ッ蠢隕√↓縺ェ縺」縺溘→縺阪↓隱ュ縺ソ霎シ繧) + { + C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 = this[i]; + if (!TJAPlayer3.b繧ウ繝ウ繝代け繝医Δ繝シ繝 || c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.bCompact蟇セ雎。) + { + try + { + c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.t隱ュ縺ソ霎シ縺ソ(); + Trace.TraceInformation("繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨r隱ュ縺ソ霎シ縺ソ縺セ縺励◆縲({0})", c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.str繝輔ぃ繧、繝ォ蜷); + } + catch (FileNotFoundException e) + { + Trace.TraceWarning(e.ToString()); + Trace.TraceWarning("繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨′蟄伜惠縺励∪縺帙s縲({0})", c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.str繝輔ぃ繧、繝ォ蜷); + } + catch (Exception e) + { + Trace.TraceWarning(e.ToString()); + Trace.TraceWarning("繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨ョ隱ュ縺ソ霎シ縺ソ縺ォ螟ア謨励@縺セ縺励◆縲({0})", c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.str繝輔ぃ繧、繝ォ蜷); + } + } + } + } + } + + + /// + /// Skin縺ョ荳隕ァ繧貞榊叙蠕励☆繧九 + /// System/*****/Graphics (繧Тounds/) 縺ィ縺縺繝輔か繝ォ繝讒区舌r諠ウ螳壹@縺ヲ縺繧九 + /// 繧ゅ@蜀榊叙蠕励ョ邨先棡縲∫樟蝨ィ菴ソ逕ィ荳ュ縺ョSkin縺ョ繝代せ(strSystemSkinSubfloderFullName)縺梧カ医∴縺ヲ縺縺溷エ蜷医ッ縲 + /// 莉・荳九ョ蜆ェ蜈磯菴阪〒蟄伜惠遒コ隱阪ョ荳郭trSystemSkinSubfolderFullName繧貞崎ィュ螳壹☆繧九 + /// 1. System/Default/ + /// 2. System/*****/ 縺ァ譛蛻昴↓enumerate縺輔l縺溘b縺ョ + /// 3. System/ (蠕捺擂莠呈鋤) + /// + public void ReloadSkinPaths() + { + #region [ 縺セ縺 System/*** 繧弾numerate縺吶k ] + string[] tempSkinSubfolders = System.IO.Directory.GetDirectories(strSystemSkinRoot, "*"); + strSystemSkinSubfolders = new string[tempSkinSubfolders.Length]; + int size = 0; + for (int i = 0; i < tempSkinSubfolders.Length; i++) + { + #region [ 讀懷コ縺励◆繝輔か繝ォ繝縺後せ繧ュ繝ウ繝輔か繝ォ繝縺九←縺縺狗「コ隱阪☆繧犠 + if (!bIsValid(tempSkinSubfolders[i])) + continue; + #endregion + #region [ 繧ケ繧ュ繝ウ繝輔か繝ォ繝縺ィ遒コ隱阪〒縺阪◆繧ゅョ繧偵《trSkinSubfolders縺ォ蜈・繧後k ] + // 繝輔か繝ォ繝蜷肴忰蟆セ縺ォ蠢縺喀繧偵▽縺代※縺翫¥縺薙→縲ゅ&繧ゅ↑縺縺ィConfig隱ュ縺ソ蜃コ縺怜エ(蠢縺喀繧偵▽縺代k)縺ィ繝槭ャ繝√〒縺阪↑縺 + if (tempSkinSubfolders[i][tempSkinSubfolders[i].Length - 1] != System.IO.Path.DirectorySeparatorChar) + { + tempSkinSubfolders[i] += System.IO.Path.DirectorySeparatorChar; + } + strSystemSkinSubfolders[size] = tempSkinSubfolders[i]; + Trace.TraceInformation("SkinPath讀懷コ: {0}", strSystemSkinSubfolders[size]); + size++; + #endregion + } + Trace.TraceInformation("SkinPath蜈・蜉: {0}", strSystemSkinSubfolderFullName); + Array.Resize(ref strSystemSkinSubfolders, size); + Array.Sort(strSystemSkinSubfolders); // BinarySearch螳溯。悟燕縺ォSort縺悟ソ隕 + #endregion + + #region [ 迴セ蝨ィ縺ョSkin繝代せ縺恵ox.def繧ケ繧ュ繝ウ繧辰ONFIG謖螳壹@縺ヲ縺縺溷エ蜷医ョ縺溘a縺ォ縲∵怙蛻昴↓縺薙l縺梧怏蜉ケ縺九メ繧ァ繝繧ッ縺吶k縲よ怏蜉ケ縺ェ繧峨%繧後r菴ソ縺縲 ] + if (bIsValid(strSystemSkinSubfolderFullName) && + Array.BinarySearch(strSystemSkinSubfolders, strSystemSkinSubfolderFullName, + StringComparer.InvariantCultureIgnoreCase) < 0) + { + strBoxDefSkinSubfolders = new string[1] { strSystemSkinSubfolderFullName }; + return; + } + #endregion + + #region [ 谺。縺ォ縲∫樟蝨ィ縺ョSkin繝代せ縺悟ュ伜惠縺吶k縺玖ェソ縺ケ繧九ゅ≠繧後ー邨ゆコ縲] + if (Array.BinarySearch(strSystemSkinSubfolders, strSystemSkinSubfolderFullName, + StringComparer.InvariantCultureIgnoreCase) >= 0) + return; + #endregion + #region [ 繧ォ繝ャ繝ウ繝医ョSkin繝代せ縺梧カ域サ縺励※縺繧九ョ縺ァ縲∽サ・荳九〒蜀崎ィュ螳壹☆繧九] + /// 莉・荳九ョ蜆ェ蜈磯菴阪〒迴セ蝨ィ菴ソ逕ィ荳ュ縺ョSkin繝代せ繧貞崎ィュ螳壹☆繧九 + /// 1. System/Default/ + /// 2. System/*****/ 縺ァ譛蛻昴↓enumerate縺輔l縺溘b縺ョ + /// 3. System/ (蠕捺擂莠呈鋤) + #region [ System/Default/ 縺後≠繧九↑繧峨√◎縺薙↓繧ォ繝ャ繝ウ繝Skin繝代せ繧定ィュ螳壹☆繧犠 + string tempSkinPath_default = System.IO.Path.Combine(strSystemSkinRoot, "Default" + System.IO.Path.DirectorySeparatorChar); + if (Array.BinarySearch(strSystemSkinSubfolders, tempSkinPath_default, + StringComparer.InvariantCultureIgnoreCase) >= 0) + { + strSystemSkinSubfolderFullName = tempSkinPath_default; + return; + } + #endregion + #region [ System/SkinFiles.*****/ 縺ァ譛蛻昴↓enumerate縺輔l縺溘b縺ョ繧偵√き繝ャ繝ウ繝Skin繝代せ縺ォ蜀崎ィュ螳壹☆繧 ] + if (strSystemSkinSubfolders.Length > 0) + { + strSystemSkinSubfolderFullName = strSystemSkinSubfolders[0]; + return; + } + #endregion + #region [ System/ 縺ォ縲√き繝ャ繝ウ繝Skin繝代せ繧貞崎ィュ螳壹☆繧九] + strSystemSkinSubfolderFullName = strSystemSkinRoot; + strSystemSkinSubfolders = new string[1] { strSystemSkinSubfolderFullName }; + #endregion + #endregion + } + + // 繝。繧ス繝繝 + + public static string Path(string str繝輔ぃ繧、繝ォ縺ョ逶ク蟇セ繝代せ) + { + if (strBoxDefSkinSubfolderFullName == "" || !bUseBoxDefSkin) + { + return System.IO.Path.Combine(strSystemSkinSubfolderFullName, str繝輔ぃ繧、繝ォ縺ョ逶ク蟇セ繝代せ); + } + else + { + return System.IO.Path.Combine(strBoxDefSkinSubfolderFullName, str繝輔ぃ繧、繝ォ縺ョ逶ク蟇セ繝代せ); + } + } + + /// + /// 繝輔Ν繝代せ蜷阪r荳弱∴繧九→縲√せ繧ュ繝ウ蜷阪→縺励※縲√ョ繧」繝ャ繧ッ繝医Μ蜷肴忰蟆セ縺ョ隕∫エ繧定ソ斐☆ + /// 萓: C:\foo\bar\ 縺ェ繧峨|ar繧定ソ斐☆ + /// + /// 繧ケ繧ュ繝ウ縺梧シ邏阪&繧後◆繝代せ蜷(繝輔Ν繝代せ) + /// 繧ケ繧ュ繝ウ蜷 + public static string GetSkinName(string skinPathFullName) + { + if (skinPathFullName != null) + { + if (skinPathFullName == "") // 縲恵ox.def縺ァ譛ェ螳夂セゥ縲咲畑 + skinPathFullName = strSystemSkinSubfolderFullName; + string[] tmp = skinPathFullName.Split(System.IO.Path.DirectorySeparatorChar); + return tmp[tmp.Length - 2]; // 繝繧」繝ャ繧ッ繝医Μ蜷阪ョ譛蠕後°繧2逡ェ逶ョ縺ョ隕∫エ縺後せ繧ュ繝ウ蜷(譛蠕後ョ隕∫エ縺ッnull縲ょピtring縺ョ譛ォ蟆セ縺圭縺ェ縺ョ縺ァ縲) + } + return null; + } + public static string[] GetSkinName(string[] skinPathFullNames) + { + string[] ret = new string[skinPathFullNames.Length]; + for (int i = 0; i < skinPathFullNames.Length; i++) + { + ret[i] = GetSkinName(skinPathFullNames[i]); + } + return ret; + } + + + public string GetSkinSubfolderFullNameFromSkinName(string skinName) + { + foreach (string s in strSystemSkinSubfolders) + { + if (GetSkinName(s) == skinName) + return s; + } + foreach (string b in strBoxDefSkinSubfolders) + { + if (GetSkinName(b) == skinName) + return b; + } + return null; + } + + /// + /// 繧ケ繧ュ繝ウ繝代せ蜷阪′螯・蠖薙°縺ゥ縺縺 + /// (繧ソ繧、繝医Ν逕サ蜒上↓繧「繧ッ繧サ繧ケ縺ァ縺阪k縺九←縺縺九〒蛻、螳壹☆繧) + /// + /// 螯・蠖捺ァ繧堤「コ隱阪☆繧九せ繧ュ繝ウ繝代せ(繝輔Ν繝代せ) + /// 螯・蠖薙↑繧液rue + public bool bIsValid(string skinPathFullName) + { + string filePathTitle; + filePathTitle = System.IO.Path.Combine(skinPathFullName, @"Graphics\1_Title\Background.png"); + return (File.Exists(filePathTitle)); + } + + + public void tRemoveMixerAll() + { + for (int i = 0; i < n繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝画焚; i++) + { + if (this[i] != null && this[i].b隱ュ縺ソ霎シ縺ソ謌仙粥) + { + this[i].t蛛懈ュ「縺吶k(); + this[i].tRemoveMixer(); + } + } + + } + + /// + /// 螟画焚縺ョ蛻晄悄蛹 + /// + public void tSkinConfigInit() + { + this.eDiffDispMode = E髮」譏灘コヲ陦ィ遉コ繧ソ繧、繝.mtaiko縺ォ逕サ蜒上〒陦ィ遉コ; + this.b迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク謨ー繧定。ィ遉コ縺励↑縺 = false; + } + + public void tReadSkinConfig() + { + var str = ""; + LoadSkinConfigFromFile(Path(@"SkinConfig.ini"), ref str); + this.t譁蟄怜励°繧芽ェュ縺ソ霎シ縺ソ(str); + + void LoadSkinConfigFromFile(string path, ref string work) + { + if (!File.Exists(Path(path))) return; + using (var streamReader = new StreamReader(Path(path), Encoding.GetEncoding("Shift_JIS"))) + { + while (streamReader.Peek() > -1) // 荳陦後★縺、隱ュ縺ソ霎シ繧縲 + { + var nowLine = streamReader.ReadLine(); + if (nowLine.StartsWith("#include")) + { + // #include hogehoge.ini縺ォ縺カ縺。蠖薙◆縺」縺 + var includePath = nowLine.Substring("#include ".Length).Trim(); + LoadSkinConfigFromFile(includePath, ref work); // 蜀榊クー逧縺ォ隱ュ縺ソ霎シ繧 + } + else + { + work += nowLine + Environment.NewLine; + } + } + } + } + } + + private void t譁蟄怜励°繧芽ェュ縺ソ霎シ縺ソ(string strAllSettings) // 2011.4.13 yyagi; refactored to make initial KeyConfig easier. + { + string[] delimiter = { "\n" }; + string[] strSingleLine = strAllSettings.Split(delimiter, StringSplitOptions.RemoveEmptyEntries); + foreach (string s in strSingleLine) + { + string str = s.Replace('\t', ' ').TrimStart(new char[] { '\t', ' ' }); + if ((str.Length != 0) && (str[0] != ';')) + { + try + { + string strCommand; + string strParam; + string[] strArray = str.Split(new char[] { '=' }); + if (strArray.Length == 2) + { + strCommand = strArray[0].Trim(); + strParam = strArray[1].Trim(); + + #region 繧ケ繧ュ繝ウ險ュ螳 + + void ParseInt32(Action setValue) + { + if (int.TryParse(strParam, out var unparsedValue)) + { + setValue(unparsedValue); + } + else + { + Trace.TraceWarning($"SkinConfig縺ョ蛟、 {strCommand} 縺ッ謨エ謨ー蛟、縺ァ縺ゅk蠢隕√′縺ゅj縺セ縺吶ら樟蝨ィ縺ョ蛟、: {strParam}"); + } + } + + if (strCommand == "Name") + { + this.Skin_Name = strParam; + } + else if (strCommand == "Version") + { + this.Skin_Version = strParam; + } + else if (strCommand == "Creator") + { + this.Skin_Creator = strParam; + } + #endregion + + #region 閭梧勹(繧ケ繧ッ繝ュ繝シ繝ォ) + else if (strCommand == "Background_Scroll_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + this.Background_Scroll_Y[i] = int.Parse(strSplit[i]); + } + } + #endregion + + #region[ 貍泌・ ] + //----------------------------- + else if (strCommand == "ScrollFieldP1Y") + { + this.nScrollFieldY[0] = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, 192); + } + else if (strCommand == "ScrollFieldP2Y") + { + this.nScrollFieldY[1] = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, 192); + } + else if (strCommand == "SENotesP1Y") + { + this.nSENotesY[0] = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, this.nSENotesY[0]); + } + else if (strCommand == "SENotesP2Y") + { + this.nSENotesY[1] = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, this.nSENotesY[1]); + } + else if (strCommand == "JudgePointP1Y") + { + this.nJudgePointY[0] = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, this.nJudgePointY[0]); + } + else if (strCommand == "JudgePointP2Y") + { + this.nJudgePointY[1] = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, this.nJudgePointY[1]); + } + + else if (strCommand == "DiffDispMode") + { + this.eDiffDispMode = (E髮」譏灘コヲ陦ィ遉コ繧ソ繧、繝)C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆(strParam, 0, 2, (int)this.eDiffDispMode); + } + else if (strCommand == "NowStageDisp") + { + this.b迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク謨ー繧定。ィ遉コ縺励↑縺 = C螟画鋤.bONorOFF(strParam[0]); + } + + //----------------------------- + #endregion + #region[ 謌千クセ逋コ陦ィ ] + //----------------------------- + else if (strCommand == "ResultPanelP1X") + { + this.nResultPanelP1X = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, 515); + } + else if (strCommand == "ResultPanelP1Y") + { + this.nResultPanelP1Y = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, 75); + } + else if (strCommand == "ResultPanelP2X") + { + this.nResultPanelP2X = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, 515); + } + else if (strCommand == "ResultPanelP2Y") + { + this.nResultPanelP2Y = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, 75); + } + else if (strCommand == "ResultScoreP1X") + { + this.nResultScoreP1X = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, 582); + } + else if (strCommand == "ResultScoreP1Y") + { + this.nResultScoreP1Y = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆(strParam, 252); + } + //----------------------------- + #endregion + #region[ 縺昴ョ莉 ] + #endregion + + #region 譁ー繝サSkinConfig + #region Config + else if (strCommand == nameof(Config_ItemText_Correction_X)) + { + Config_ItemText_Correction_X = int.Parse(strParam); + } + else if (strCommand == nameof(Config_ItemText_Correction_Y)) + { + Config_ItemText_Correction_Y = int.Parse(strParam); + } + #endregion + #region SongSelect + else if (strCommand == "SongSelect_Overall_Y") + { + if (int.Parse(strParam) != 0) + { + SongSelect_Overall_Y = int.Parse(strParam); + } + } + else if (strCommand == "SongSelect_BoxExplanation_X") + { + SongSelect_BoxExplanation_X = int.Parse(strParam); + } + else if (strCommand == "SongSelect_BoxExplanation_Y") + { + SongSelect_BoxExplanation_Y = int.Parse(strParam); + } + else if (strCommand == "SongSelect_Title_X") + { + SongSelect_Title_X = int.Parse(strParam); + } + else if (strCommand == "SongSelect_Title_Y") + { + SongSelect_Title_Y = int.Parse(strParam); + } + else if (strCommand == "SongSelect_BoxExplanation_Interval") + { + SongSelect_BoxExplanation_Interval = int.Parse(strParam); + } + else if (strCommand == "SongSelect_GenreName") + { + SongSelect_GenreName = this.strString繧帝榊励↓逶エ縺(strParam); + } + else if (strCommand == "SongSelect_NamePlate_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + SongSelect_NamePlate_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "SongSelect_NamePlate_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + SongSelect_NamePlate_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "SongSelect_Auto_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + SongSelect_Auto_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "SongSelect_Auto_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + SongSelect_Auto_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "SongSelect_ForeColor_JPOP") + { + SongSelect_ForeColor_JPOP = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == "SongSelect_ForeColor_Anime") + { + SongSelect_ForeColor_Anime = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == "SongSelect_ForeColor_VOCALOID") + { + SongSelect_ForeColor_VOCALOID = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == "SongSelect_ForeColor_Children") + { + SongSelect_ForeColor_Children = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == "SongSelect_ForeColor_Variety") + { + SongSelect_ForeColor_Variety = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == "SongSelect_ForeColor_Classic") + { + SongSelect_ForeColor_Classic = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == "SongSelect_ForeColor_GameMusic") + { + SongSelect_ForeColor_GameMusic = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == nameof(SongSelect_ForeColor_Namco)) + { + SongSelect_ForeColor_GameMusic = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == "SongSelect_BackColor_JPOP") + { + SongSelect_BackColor_JPOP = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == "SongSelect_BackColor_Anime") + { + SongSelect_BackColor_Anime = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == "SongSelect_BackColor_VOCALOID") + { + SongSelect_BackColor_VOCALOID = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == "SongSelect_BackColor_Children") + { + SongSelect_BackColor_Children = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == "SongSelect_BackColor_Variety") + { + SongSelect_BackColor_Variety = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == "SongSelect_BackColor_Classic") + { + SongSelect_BackColor_Classic = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == "SongSelect_BackColor_GameMusic") + { + SongSelect_BackColor_GameMusic = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == nameof(SongSelect_BackColor_Namco)) + { + SongSelect_BackColor_Namco = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == nameof(SongSelect_CorrectionX_Chara)) + { + SongSelect_CorrectionX_Chara = strParam.Split(',').ToArray(); + } + else if (strCommand == nameof(SongSelect_CorrectionY_Chara)) + { + SongSelect_CorrectionY_Chara = strParam.Split(',').ToArray(); + } + else if (strCommand == nameof(SongSelect_CorrectionX_Chara_Value)) + { + SongSelect_CorrectionX_Chara_Value = int.Parse(strParam); + } + else if (strCommand == nameof(SongSelect_CorrectionY_Chara_Value)) + { + SongSelect_CorrectionY_Chara_Value = int.Parse(strParam); + } + else if (strCommand == nameof(SongSelect_Rotate_Chara)) + { + SongSelect_Rotate_Chara = strParam.Split(',').ToArray(); + } + #endregion + #region SongLoading + else if (strCommand == nameof(SongLoading_Plate_X)) + { + SongLoading_Plate_X = int.Parse(strParam); + } + else if (strCommand == nameof(SongLoading_Plate_Y)) + { + SongLoading_Plate_Y = int.Parse(strParam); + } + else if (strCommand == nameof(SongLoading_Title_X)) + { + SongLoading_Title_X = int.Parse(strParam); + } + else if (strCommand == nameof(SongLoading_Title_Y)) + { + SongLoading_Title_Y = int.Parse(strParam); + } + else if (strCommand == nameof(SongLoading_SubTitle_X)) + { + SongLoading_SubTitle_X = int.Parse(strParam); + } + else if (strCommand == nameof(SongLoading_SubTitle_Y)) + { + SongLoading_SubTitle_Y = int.Parse(strParam); + } + else if (strCommand == nameof(SongLoading_Title_FontSize)) + { + if (int.Parse(strParam) > 0) + SongLoading_Title_FontSize = int.Parse(strParam); + } + else if (strCommand == nameof(SongLoading_SubTitle_FontSize)) + { + if (int.Parse(strParam) > 0) + SongLoading_SubTitle_FontSize = int.Parse(strParam); + } + else if (strCommand == nameof(SongLoading_Plate_ReferencePoint)) + { + SongLoading_Plate_ReferencePoint = (ReferencePoint)int.Parse(strParam); + } + else if (strCommand == nameof(SongLoading_Title_ReferencePoint)) + { + SongLoading_Title_ReferencePoint = (ReferencePoint)int.Parse(strParam); + } + else if (strCommand == nameof(SongLoading_SubTitle_ReferencePoint)) + { + SongLoading_SubTitle_ReferencePoint = (ReferencePoint)int.Parse(strParam); + } + + else if (strCommand == nameof(SongLoading_Title_ForeColor)) + { + SongLoading_Title_ForeColor = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == nameof(SongLoading_Title_BackColor)) + { + SongLoading_Title_BackColor = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == nameof(SongLoading_SubTitle_ForeColor)) + { + SongLoading_SubTitle_ForeColor = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == nameof(SongLoading_SubTitle_BackColor)) + { + SongLoading_SubTitle_BackColor = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == nameof(SongLoading_Plate_ScreenBlend)) + { + SongLoading_Plate_ScreenBlend = C螟画鋤.bONorOFF(strParam[0]); + } + #endregion + #region Game + else if (strCommand == "Game_Notes_Anime") + { + Game_Notes_Anime = C螟画鋤.bONorOFF(strParam[0]); + } + else if (strCommand == "Game_StageText") + { + Game_StageText = strParam; + } + else if (strCommand == nameof(Game_RollColorMode)) + { + Game_RollColorMode = (RollColorMode)int.Parse(strParam); + } + else if (strCommand == nameof(Game_JudgeFrame_AddBlend)) + { + Game_JudgeFrame_AddBlend = C螟画鋤.bONorOFF(strParam[0]); + } + + #region CourseSymbol + else if (strCommand == "Game_CourseSymbol_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_CourseSymbol_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_CourseSymbol_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_CourseSymbol_Y[i] = int.Parse(strSplit[i]); + } + } + #endregion + #region PanelFont + else if (strCommand == nameof(Game_MusicName_X)) + { + Game_MusicName_X = int.Parse(strParam); + } + else if (strCommand == nameof(Game_MusicName_Y)) + { + Game_MusicName_Y = int.Parse(strParam); + } + else if (strCommand == nameof(Game_MusicName_FontSize)) + { + if (int.Parse(strParam) > 0) + Game_MusicName_FontSize = int.Parse(strParam); + } + else if (strCommand == nameof(Game_MusicName_ReferencePoint)) + { + Game_MusicName_ReferencePoint = (ReferencePoint)int.Parse(strParam); + } + else if (strCommand == nameof(Game_Genre_X)) + { + Game_Genre_X = int.Parse(strParam); + } + else if (strCommand == nameof(Game_Genre_Y)) + { + Game_Genre_Y = int.Parse(strParam); + } + else if (strCommand == nameof(Game_Lyric_X)) + { + Game_Lyric_X = int.Parse(strParam); + } + else if (strCommand == nameof(Game_Lyric_Y)) + { + Game_Lyric_Y = int.Parse(strParam); + } + else if (strCommand == nameof(Game_Lyric_FontName)) + { + Game_Lyric_FontName = strParam; + } + else if (strCommand == nameof(Game_Lyric_FontSize)) + { + if (int.Parse(strParam) > 0) + Game_Lyric_FontSize = int.Parse(strParam); + } + else if (strCommand == nameof(Game_Lyric_ReferencePoint)) + { + Game_Lyric_ReferencePoint = (ReferencePoint)int.Parse(strParam); + } + + else if (strCommand == nameof(Game_MusicName_ForeColor)) + { + Game_MusicName_ForeColor = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == nameof(Game_StageText_ForeColor)) + { + Game_StageText_ForeColor = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == nameof(Game_Lyric_ForeColor)) + { + Game_Lyric_ForeColor = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == nameof(Game_MusicName_BackColor)) + { + Game_MusicName_BackColor = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == nameof(Game_StageText_BackColor)) + { + Game_StageText_BackColor = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == nameof(Game_Lyric_BackColor)) + { + Game_Lyric_BackColor = ColorTranslator.FromHtml(strParam); + } + #endregion + #region Chara + else if (strCommand == "Game_Chara_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Chara_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Chara_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Chara_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Chara_Balloon_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Chara_Balloon_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Chara_Balloon_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Chara_Balloon_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == nameof(Game_Chara_Balloon_Timer)) + { + if (int.Parse(strParam) > 0) + Game_Chara_Balloon_Timer = int.Parse(strParam); + } + else if (strCommand == nameof(Game_Chara_Balloon_Delay)) + { + if (int.Parse(strParam) > 0) + Game_Chara_Balloon_Delay = int.Parse(strParam); + } + else if (strCommand == nameof(Game_Chara_Balloon_FadeOut)) + { + if (int.Parse(strParam) > 0) + Game_Chara_Balloon_FadeOut = int.Parse(strParam); + } + // 繝代ち繝シ繝ウ謨ー縺ョ險ュ螳壹ッTextureLoader.cs縺ァ蜿肴丐縺輔l縺セ縺吶 + else if (strCommand == "Game_Chara_Motion_Normal") + { + Game_Chara_Motion_Normal = strParam; + } + else if (strCommand == "Game_Chara_Motion_Clear") + { + Game_Chara_Motion_Clear = strParam; + } + else if (strCommand == "Game_Chara_Motion_GoGo") + { + Game_Chara_Motion_GoGo = strParam; + } + else if (strCommand == "Game_Chara_Beat_Normal") + { + ParseInt32(value => Game_Chara_Beat_Normal = value); + } + else if (strCommand == "Game_Chara_Beat_Clear") + { + ParseInt32(value => Game_Chara_Beat_Clear = value); + } + else if (strCommand == "Game_Chara_Beat_GoGo") + { + ParseInt32(value => Game_Chara_Beat_GoGo = value); + } + #endregion + #region Dancer + else if (strCommand == "Game_Dancer_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) + { + Game_Dancer_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Dancer_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) + { + Game_Dancer_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Dancer_Motion") + { + Game_Dancer_Motion = strParam; + } + // Game_Dancer_Ptn縺ッTextrueLoader.cs縺ァ蜿肴丐縺輔l縺セ縺吶 + else if (strCommand == "Game_Dancer_Beat") + { + ParseInt32(value => Game_Dancer_Beat = value); + } + else if (strCommand == "Game_Dancer_Gauge") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 5; i++) + { + Game_Dancer_Gauge[i] = int.Parse(strSplit[i]); + } + } + #endregion + #region Mob + else if (strCommand == "Game_Mob_Beat") + { + ParseInt32(value => Game_Mob_Beat = value); + } + else if (strCommand == "Game_Mob_Ptn_Beat") + { + ParseInt32(value => Game_Mob_Ptn_Beat = value); + } + #endregion + #region Score + else if (strCommand == "Game_Score_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + this.Game_Score_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Score_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + this.Game_Score_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Score_Add_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + this.Game_Score_Add_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Score_Add_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + this.Game_Score_Add_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Score_AddBonus_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + this.Game_Score_AddBonus_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Score_AddBonus_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + this.Game_Score_AddBonus_Y[i] = int.Parse(strSplit[i]); + } + } + + else if (strCommand == "Game_Score_Padding") + { + ParseInt32(value => Game_Score_Padding = value); + } + else if (strCommand == "Game_Score_Size") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Score_Size[i] = int.Parse(strSplit[i]); + } + } + #endregion + #region Taiko + else if (strCommand == "Game_Taiko_NamePlate_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Taiko_NamePlate_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Taiko_NamePlate_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Taiko_NamePlate_Y[i] = int.Parse(strSplit[i]); + } + } + + else if (strCommand == "Game_Taiko_PlayerNumber_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Taiko_PlayerNumber_X[i] = int.Parse(strSplit[i]); + } + } + + else if (strCommand == "Game_Taiko_PlayerNumber_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Taiko_PlayerNumber_Y[i] = int.Parse(strSplit[i]); + } + } + + else if (strCommand == "Game_Taiko_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Taiko_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Taiko_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Taiko_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Taiko_Combo_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Taiko_Combo_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Taiko_Combo_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Taiko_Combo_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Taiko_Combo_Ex_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Taiko_Combo_Ex_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Taiko_Combo_Ex_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Taiko_Combo_Ex_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Taiko_Combo_Ex4_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Taiko_Combo_Ex4_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Taiko_Combo_Ex4_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Taiko_Combo_Ex4_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Taiko_Combo_Padding") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) + { + Game_Taiko_Combo_Padding[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Taiko_Combo_Size") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Taiko_Combo_Size[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Taiko_Combo_Size_Ex") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Taiko_Combo_Size_Ex[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Taiko_Combo_Scale") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 3; i++) + { + Game_Taiko_Combo_Scale[i] = float.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Taiko_Combo_Text_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Taiko_Combo_Text_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Taiko_Combo_Text_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Taiko_Combo_Text_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Taiko_Combo_Text_Size") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Taiko_Combo_Text_Size[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == nameof(Game_Taiko_Combo_Ex_IsJumping)) + { + Game_Taiko_Combo_Ex_IsJumping = C螟画鋤.bONorOFF(strParam[0]); + } + #endregion + #region Gauge + else if (strCommand == "Game_Gauge_Rainbow_Timer") + { + if (int.Parse(strParam) != 0) + { + Game_Gauge_Rainbow_Timer = int.Parse(strParam); + } + } + #endregion + #region Balloon + else if (strCommand == "Game_Balloon_Combo_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Balloon_Combo_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Balloon_Combo_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Balloon_Combo_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Balloon_Combo_Number_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Balloon_Combo_Number_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Balloon_Combo_Number_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Balloon_Combo_Number_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Balloon_Combo_Number_Ex_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Balloon_Combo_Number_Ex_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Balloon_Combo_Number_Ex_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Balloon_Combo_Number_Ex_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Balloon_Combo_Text_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Balloon_Combo_Text_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Balloon_Combo_Text_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Balloon_Combo_Text_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Balloon_Combo_Text_Ex_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Balloon_Combo_Text_Ex_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Balloon_Combo_Text_Ex_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Balloon_Combo_Text_Ex_Y[i] = int.Parse(strSplit[i]); + } + } + + + else if (strCommand == "Game_Balloon_Balloon_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + this.Game_Balloon_Balloon_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Balloon_Balloon_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + this.Game_Balloon_Balloon_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Balloon_Balloon_Frame_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + this.Game_Balloon_Balloon_Frame_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Balloon_Balloon_Frame_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + this.Game_Balloon_Balloon_Frame_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Balloon_Balloon_Number_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + this.Game_Balloon_Balloon_Number_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Balloon_Balloon_Number_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + this.Game_Balloon_Balloon_Number_Y[i] = int.Parse(strSplit[i]); + } + } + + else if (strCommand == "Game_Balloon_Roll_Frame_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Balloon_Roll_Frame_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Balloon_Roll_Frame_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Balloon_Roll_Frame_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Balloon_Roll_Number_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Balloon_Roll_Number_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Balloon_Roll_Number_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Balloon_Roll_Number_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Balloon_Number_Size") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Balloon_Number_Size[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Balloon_Number_Padding") + { + ParseInt32(value => Game_Balloon_Number_Padding = value); + } + else if (strCommand == "Game_Balloon_Roll_Number_Scale") + { + ParseInt32(value => Game_Balloon_Roll_Number_Scale = value); + } + else if (strCommand == "Game_Balloon_Balloon_Number_Scale") + { + ParseInt32(value => Game_Balloon_Balloon_Number_Scale = value); + } + + #endregion + #region Effects + else if (strCommand == nameof(Game_Effect_Roll_StartPoint_X)) + { + Game_Effect_Roll_StartPoint_X = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_Roll_StartPoint_Y)) + { + Game_Effect_Roll_StartPoint_Y = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_Roll_StartPoint_1P_X)) + { + Game_Effect_Roll_StartPoint_1P_X = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_Roll_StartPoint_1P_Y)) + { + Game_Effect_Roll_StartPoint_1P_Y = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_Roll_StartPoint_2P_X)) + { + Game_Effect_Roll_StartPoint_2P_X = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_Roll_StartPoint_2P_Y)) + { + Game_Effect_Roll_StartPoint_2P_Y = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_Roll_Speed_X)) + { + Game_Effect_Roll_Speed_X = strParam.Split(',').Select(float.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_Roll_Speed_Y)) + { + Game_Effect_Roll_Speed_Y = strParam.Split(',').Select(float.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_Roll_Speed_1P_X)) + { + Game_Effect_Roll_Speed_1P_X = strParam.Split(',').Select(float.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_Roll_Speed_1P_Y)) + { + Game_Effect_Roll_Speed_1P_Y = strParam.Split(',').Select(float.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_Roll_Speed_2P_X)) + { + Game_Effect_Roll_Speed_2P_X = strParam.Split(',').Select(float.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_Roll_Speed_2P_Y)) + { + Game_Effect_Roll_Speed_2P_Y = strParam.Split(',').Select(float.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_NotesFlash)) + { + Game_Effect_NotesFlash = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_NotesFlash_Timer)) + { + Game_Effect_NotesFlash_Timer = int.Parse(strParam); + } + else if (strCommand == nameof(Game_Effect_GoGoSplash)) + { + Game_Effect_GoGoSplash = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_GoGoSplash_X)) + { + Game_Effect_GoGoSplash_X = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_GoGoSplash_Y)) + { + Game_Effect_GoGoSplash_Y = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_GoGoSplash_Rotate)) + { + Game_Effect_GoGoSplash_Rotate = C螟画鋤.bONorOFF(strParam[0]); + } + else if (strCommand == nameof(Game_Effect_GoGoSplash_Timer)) + { + Game_Effect_GoGoSplash_Timer = int.Parse(strParam); + } + else if (strCommand == nameof(Game_Effect_FlyingNotes_StartPoint_X)) + { + Game_Effect_FlyingNotes_StartPoint_X = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_FlyingNotes_StartPoint_Y)) + { + Game_Effect_FlyingNotes_StartPoint_Y = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_FlyingNotes_EndPoint_X)) + { + Game_Effect_FlyingNotes_EndPoint_X = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_FlyingNotes_EndPoint_Y)) + { + Game_Effect_FlyingNotes_EndPoint_Y = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_FlyingNotes_Sine)) + { + Game_Effect_FlyingNotes_Sine = int.Parse(strParam); + } + else if (strCommand == nameof(Game_Effect_FlyingNotes_IsUsingEasing)) + { + Game_Effect_FlyingNotes_IsUsingEasing = C螟画鋤.bONorOFF(strParam[0]); + } + else if (strCommand == nameof(Game_Effect_FlyingNotes_Timer)) + { + Game_Effect_FlyingNotes_Timer = int.Parse(strParam); + } + else if (strCommand == nameof(Game_Effect_FireWorks)) + { + Game_Effect_FireWorks = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Effect_FireWorks_Timer)) + { + Game_Effect_FireWorks_Timer = int.Parse(strParam); + } + else if (strCommand == nameof(Game_Effect_Rainbow_Timer)) + { + Game_Effect_Rainbow_Timer = int.Parse(strParam); + } + else if (strCommand == nameof(Game_Effect_HitExplosion_AddBlend)) + { + Game_Effect_HitExplosion_AddBlend = C螟画鋤.bONorOFF(strParam[0]); + } + else if (strCommand == nameof(Game_Effect_HitExplosionBig_AddBlend)) + { + Game_Effect_HitExplosionBig_AddBlend = C螟画鋤.bONorOFF(strParam[0]); + } + else if (strCommand == nameof(Game_Effect_FireWorks_AddBlend)) + { + Game_Effect_FireWorks_AddBlend = C螟画鋤.bONorOFF(strParam[0]); + } + else if (strCommand == nameof(Game_Effect_Fire_AddBlend)) + { + Game_Effect_Fire_AddBlend = C螟画鋤.bONorOFF(strParam[0]); + } + else if (strCommand == nameof(Game_Effect_GoGoSplash_AddBlend)) + { + Game_Effect_GoGoSplash_AddBlend = C螟画鋤.bONorOFF(strParam[0]); + } + else if (strCommand == nameof(Game_Effect_FireWorks_Timing)) + { + Game_Effect_FireWorks_Timing = int.Parse(strParam); + } + #endregion + #region Runner + else if (strCommand == "Game_Runner_Size") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Runner_Size[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Runner_Ptn") + { + ParseInt32(value => Game_Runner_Ptn = value); + } + else if (strCommand == "Game_Runner_Type") + { + ParseInt32(value => Game_Runner_Type = value); + } + else if (strCommand == "Game_Runner_StartPoint_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Runner_StartPoint_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Runner_StartPoint_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Game_Runner_StartPoint_Y[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Game_Runner_Timer") + { + if (int.Parse(strParam) != 0) + { + Game_Runner_Timer = int.Parse(strParam); + } + } + #endregion + #region Dan_C + else if (strCommand == nameof(Game_DanC_Title_ForeColor)) + { + Game_DanC_Title_ForeColor = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == nameof(Game_DanC_Title_BackColor)) + { + Game_DanC_Title_BackColor = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == nameof(Game_DanC_SubTitle_ForeColor)) + { + Game_DanC_SubTitle_ForeColor = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == nameof(Game_DanC_SubTitle_BackColor)) + { + Game_DanC_SubTitle_BackColor = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == nameof(Game_DanC_X)) + { + Game_DanC_X = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_DanC_Y)) + { + Game_DanC_Y = strParam.Split(',').Select(int.Parse).ToArray(); + } + + else if (strCommand == nameof(Game_DanC_Size)) + { + Game_DanC_Size = strParam.Split(',').Select(int.Parse).ToArray(); + } + + else if (strCommand == nameof(Game_DanC_Padding)) + { + ParseInt32(value => Game_DanC_Padding = value); + } + + else if (strCommand == nameof(Game_DanC_Offset)) + { + Game_DanC_Offset = strParam.Split(',').Select(int.Parse).ToArray(); + } + + else if (strCommand == nameof(Game_DanC_Number_Size)) + { + Game_DanC_Number_Size = strParam.Split(',').Select(int.Parse).ToArray(); + } + + else if (strCommand == nameof(Game_DanC_Number_Padding)) + { + ParseInt32(value => Game_DanC_Number_Padding = value); + } + + else if (strCommand == nameof(Game_DanC_Number_Small_Scale)) + { + Game_DanC_Number_Small_Scale = float.Parse(strParam); + } + + else if (strCommand == nameof(Game_DanC_Number_Small_Padding)) + { + ParseInt32(value => Game_DanC_Number_Small_Padding = value); + } + + else if (strCommand == nameof(Game_DanC_Number_XY)) + { + Game_DanC_Number_XY = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_DanC_Number_Small_Number_Offset)) + { + Game_DanC_Number_Small_Number_Offset = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_DanC_ExamType_Size)) + { + Game_DanC_ExamType_Size = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_DanC_ExamRange_Size)) + { + Game_DanC_ExamRange_Size = strParam.Split(',').Select(int.Parse).ToArray(); + } + + else if (strCommand == nameof(Game_DanC_ExamRange_Padding)) + { + ParseInt32(value => Game_DanC_ExamRange_Padding = value); + } + + else if (strCommand == nameof(Game_DanC_Percent_Hit_Score_Padding)) + { + Game_DanC_Percent_Hit_Score_Padding = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_DanC_ExamUnit_Size)) + { + Game_DanC_ExamUnit_Size = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_DanC_Exam_Offset)) + { + Game_DanC_Exam_Offset = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_DanC_Dan_Plate)) + { + Game_DanC_Dan_Plate = strParam.Split(',').Select(int.Parse).ToArray(); + } + + #endregion + #region PuchiChara + else if (strCommand == nameof(Game_PuchiChara_X)) + { + Game_PuchiChara_X = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_PuchiChara_Y)) + { + Game_PuchiChara_Y = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_PuchiChara_BalloonX)) + { + Game_PuchiChara_BalloonX = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_PuchiChara_BalloonY)) + { + Game_PuchiChara_BalloonY = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_PuchiChara_Scale)) + { + Game_PuchiChara_Scale = strParam.Split(',').Select(float.Parse).ToArray(); + } + else if (strCommand == nameof(Game_PuchiChara)) + { + Game_PuchiChara = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_PuchiChara_Sine)) + { + ParseInt32(value => Game_PuchiChara_Sine = value); + } + else if (strCommand == nameof(Game_PuchiChara_Timer)) + { + ParseInt32(value => Game_PuchiChara_Timer = value); + } + else if (strCommand == nameof(Game_PuchiChara_SineTimer)) + { + Game_PuchiChara_SineTimer = double.Parse(strParam); + } + #endregion + #region Training + else if (strCommand == nameof(Game_Training_ScrollTime)) + { + Game_Training_ScrollTime = int.Parse(strParam); + } + else if (strCommand == nameof(Game_Training_ProgressBar_XY)) + { + Game_Training_ProgressBar_XY = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Training_GoGoPoint_Y)) + { + Game_Training_GoGoPoint_Y = int.Parse(strParam); + } + else if (strCommand == nameof(Game_Training_JumpPoint_Y)) + { + Game_Training_JumpPoint_Y = int.Parse(strParam); + } + else if (strCommand == nameof(Game_Training_MaxMeasureCount_XY)) + { + Game_Training_MaxMeasureCount_XY = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Training_CurrentMeasureCount_XY)) + { + Game_Training_CurrentMeasureCount_XY = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Training_SpeedDisplay_XY)) + { + Game_Training_CurrentMeasureCount_XY = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Game_Training_SmallNumber_Width)) + { + Game_Training_SmallNumber_Width = int.Parse(strParam); + } + else if (strCommand == nameof(Game_Training_BigNumber_Width)) + { + Game_Training_BigNumber_Width = int.Parse(strParam); + } + #endregion + + #endregion + #region Result + else if (strCommand == nameof(Result_MusicName_X)) + { + Result_MusicName_X = int.Parse(strParam); + } + else if (strCommand == nameof(Result_MusicName_Y)) + { + Result_MusicName_Y = int.Parse(strParam); + } + else if (strCommand == nameof(Result_MusicName_FontSize)) + { + if (int.Parse(strParam) > 0) + Result_MusicName_FontSize = int.Parse(strParam); + } + else if (strCommand == nameof(Result_MusicName_ReferencePoint)) + { + Result_MusicName_ReferencePoint = (ReferencePoint)int.Parse(strParam); + } + else if (strCommand == nameof(Result_StageText_X)) + { + Result_StageText_X = int.Parse(strParam); + } + else if (strCommand == nameof(Result_StageText_Y)) + { + Result_StageText_Y = int.Parse(strParam); + } + else if (strCommand == nameof(Result_StageText_FontSize)) + { + if (int.Parse(strParam) > 0) + Result_StageText_FontSize = int.Parse(strParam); + } + else if (strCommand == nameof(Result_StageText_ReferencePoint)) + { + Result_StageText_ReferencePoint = (ReferencePoint)int.Parse(strParam); + } + + else if (strCommand == nameof(Result_MusicName_ForeColor)) + { + Result_MusicName_ForeColor = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == nameof(Result_StageText_ForeColor)) + { + Result_StageText_ForeColor = ColorTranslator.FromHtml(strParam); + } + //else if (strCommand == nameof(Result_StageText_ForeColor_Red)) + //{ + // Result_StageText_ForeColor_Red = ColorTranslator.FromHtml(strParam); + //} + else if (strCommand == nameof(Result_MusicName_BackColor)) + { + Result_MusicName_BackColor = ColorTranslator.FromHtml(strParam); + } + else if (strCommand == nameof(Result_StageText_BackColor)) + { + Result_StageText_BackColor = ColorTranslator.FromHtml(strParam); + } + //else if (strCommand == nameof(Result_StageText_BackColor_Red)) + //{ + // Result_StageText_BackColor_Red = ColorTranslator.FromHtml(strParam); + //} + + else if (strCommand == "Result_NamePlate_X") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Result_NamePlate_X[i] = int.Parse(strSplit[i]); + } + } + else if (strCommand == "Result_NamePlate_Y") + { + string[] strSplit = strParam.Split(','); + for (int i = 0; i < 2; i++) + { + Result_NamePlate_Y[i] = int.Parse(strSplit[i]); + } + } + + else if (strCommand == nameof(Result_Dan)) + { + Result_Dan = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Result_Dan_XY)) + { + Result_Dan_XY = strParam.Split(',').Select(int.Parse).ToArray(); + } + else if (strCommand == nameof(Result_Dan_Plate_XY)) + { + Result_Dan_Plate_XY = strParam.Split(',').Select(int.Parse).ToArray(); + } + + #endregion + #region Font + else if (strCommand == nameof(Font_Edge_Ratio)) //Config逕サ髱「繧邁。譏薙Γ繝九Η繝シ縺ョ繝輔か繝ウ繝医↓縺、縺縺ヲ(rhimm) + { + if (int.Parse(strParam) > 0) + Font_Edge_Ratio = int.Parse(strParam); + } + else if (strCommand == nameof(Font_Edge_Ratio_Vertical)) //TITLE繧ТUBTITLE縺ェ縺ゥ縲∫クヲ縺ォ譖ク縺九l繧九%縺ィ縺ョ縺ゅk繝輔か繝ウ繝医↓縺、縺縺ヲ(rhimm) + { + if (int.Parse(strParam) > 0) + Font_Edge_Ratio_Vertical = int.Parse(strParam); + } + else if (strCommand == nameof(Text_Correction_X)) + { + Text_Correction_X = int.Parse(strParam); + } + else if (strCommand == nameof(Text_Correction_Y)) + { + Text_Correction_Y = int.Parse(strParam); + } + #endregion + #endregion + } + continue; + } + catch (Exception exception) + { + Trace.TraceError(exception.ToString()); + Trace.TraceError("萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (6a32cc37-1527-412e-968a-512c1f0135cd)"); + continue; + } + } + } + } + + private void t蠎ァ讓吶ョ霑ス蠕楢ィュ螳() + { + // + if (bFieldBgPointOverride == true) + { + + } + } + + #region [ IDisposable 螳溯」 ] + //----------------- + public void Dispose() + { + if (!this.bDisposed貂医∩) + { + for (int i = 0; i < this.n繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝画焚; i++) + this[i].Dispose(); + + this.bDisposed貂医∩ = true; + } + } + //----------------- + #endregion + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private bool bDisposed貂医∩; + //----------------- + #endregion + + #region 閭梧勹(繧ケ繧ッ繝ュ繝シ繝ォ) + public int[] Background_Scroll_Y = new int[] { 0, 536 }; + #endregion + + + #region[ 蠎ァ讓 ] + //2017.08.11 kairera0467 DP螳溽畑蛹悶↓蜷代¢縺ヲint驟榊励↓螟画峩 + + //繝輔ぅ繝シ繝ォ繝我ス咲スョ縲X縺ッ蛻、螳壽棧驛ィ蛻縺ョ菴咲スョ縲Y縺ッ繝輔ぅ繝シ繝ォ繝峨ョ譛荳企Κ縺ョ蠎ァ讓吶 + //迴セ譎らせ縺ァ縺ッ繝弱シ繝逕サ蜒上ヾenotes逕サ蜒上∝愛螳壽棧縺碁」蜍輔☆繧九 + //X縺ッ荳ュ螟ョ蝓コ貅匁緒逕サ縲〆縺ッ蟾ヲ荳雁渕貅匁緒逕サ + public int[] nScrollFieldX = new int[] { 414, 414 }; + public int[] nScrollFieldY = new int[] { 192, 368 }; + + //荳ュ蠢蠎ァ讓呎欠螳 + public int[] nJudgePointX = new int[] { 413, 413, 413, 413 }; + public int[] nJudgePointY = new int[] { 256, 433, 0, 0 }; + + //繝輔ぅ繝シ繝ォ繝芽レ譎ッ逕サ蜒 + //ScrollField蠎ァ讓吶∈縺ョ霑ス蠕楢ィュ螳壹′蜿ッ閭ス縲 + //蛻蟯占レ譎ッ縲√ざ繝シ繧エ繝シ閭梧勹縺碁」蜍輔☆繧九(蜈ィ縺ヲ蜷後§螟ァ縺阪&縲∽ス咲スョ縺ァ菴懈舌☆繧九%縺ィ縲) + //蟾ヲ荳雁渕貅匁緒逕サ + public bool bFieldBgPointOverride = false; + public int[] nScrollFieldBGX = new int[] { 333, 333, 333, 333 }; + public int[] nScrollFieldBGY = new int[] { 192, 368, 0, 0 }; + + //SEnotes + //髻ウ隨ヲ蠎ァ讓吶↓蜉邂 + public int[] nSENotesY = new int[] { 131, 131 }; + + //蜈峨k螟ェ鮠馴Κ蛻 + public int nMtaikoBackgroundX = 0; + public int nMtaikoBackgroundY = 184; + public int nMtaikoFieldX = 0; + public int nMtaikoFieldY = 184; + public int nMtaikoMainX = 0; + public int nMtaikoMainY = 0; + + //繧ウ繝ウ繝 + public int[] nComboNumberX = new int[] { 0, 0, 0, 0 }; + public int[] nComboNumberY = new int[] { 212, 388, 0, 0 }; + public int[] nComboNumberTextY = new int[] { 271, 447, 0, 0 }; + public int[] nComboNumberTextLargeY = new int[] { 270, 446, 0, 0 }; + public float fComboNumberSpacing = 0; + public float fComboNumberSpacing_l = 0; + + public E髮」譏灘コヲ陦ィ遉コ繧ソ繧、繝 eDiffDispMode; + public bool b迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク謨ー繧定。ィ遉コ縺励↑縺; + + //繝ェ繧カ繝ォ繝育判髱「 + //迴セ蝨ィ縺ョ繝繝輔か繝ォ繝亥、縺ッ繝繝溘シ縺ァ縺吶 + public int nResultPanelP1X = 0; + public int nResultPanelP1Y = 0; + public int nResultPanelP2X = 515; + public int nResultPanelP2Y = 75; + public int nResultScoreP1X = 295; + public int nResultScoreP1Y = 212; + public int nResultJudge1_P1X = 495; + public int nResultJudge1_P1Y = 182; + public int nResultJudge2_P1X = 968; + public int nResultJudge2_P1Y = 174; + + public int nResultNumberP1X = 490; + public int nResultNumberP2X = 875; + + public int nResultNumberY = 188; + public int nResultNumberYPadding = 42; + + public int nResultGaugeBaseP1X = 56; + public int nResultGaugeBaseP1Y = 141; + public int nResultGaugeBaseP2X = 555; + public int nResultGaugeBaseP2Y = 122; + public int nResultGaugeBodyP1X = 559; + public int nResultGaugeBodyP1Y = 125; + #endregion + + public string[] strString繧帝榊励↓逶エ縺(string str) + { + string[] strArray = str.Split(','); + return strArray; + } + + public enum RollColorMode + { + None, // PS4, Switch縺ェ縺ゥ + All, // 譌ァ遲蝉ス(譌ァ菴懷性繧) + WithoutStart // 譁ー遲蝉ス + } + public enum ReferencePoint //繝繧ッ繧ケ繝√Ε謠冗判縺ョ蝓コ貅也せ繧貞、画峩蜿ッ閭ス縺ォ縺吶k縺溘a縺ョ蛟、(rhimm) + { + Center, + Left, + Right + } + + #region 譁ー繝サSkinConfig + #region General + public string Skin_Name = "Unknown"; + public string Skin_Version = "Unknown"; + public string Skin_Creator = "Unknown"; + #endregion + #region Config + public int Config_ItemText_Correction_X = 0; + public int Config_ItemText_Correction_Y = 0; + #endregion + #region SongSelect + public int SongSelect_Overall_Y = 123; + public int SongSelect_BoxExplanation_X = 0; + public int SongSelect_BoxExplanation_Y = 0; + public int SongSelect_BoxExplanation_Interval = 30; + public int SongSelect_Title_X = 0; + public int SongSelect_Title_Y = 0; + public string[] SongSelect_GenreName = { "繝昴ャ繝励せ", "繧「繝九Γ", "繧イ繝シ繝繝舌Λ繧ィ繝繧」", "繝翫Β繧ウ繧ェ繝ェ繧ク繝翫Ν", "繧ッ繝ゥ繧キ繝繧ッ", "繝舌Λ繧ィ繝繧」", "繧ュ繝繧コ", "繝懊シ繧ォ繝ュ繧、繝", "譛霑鷹♀繧薙□譖イ"}; + public int[] SongSelect_NamePlate_X = new int[] { 36, 1020 }; + public int[] SongSelect_NamePlate_Y = new int[] { 615, 615 }; + public int[] SongSelect_Auto_X = new int[] { 60, 950 }; + public int[] SongSelect_Auto_Y = new int[] { 650, 650 }; + public Color SongSelect_ForeColor_JPOP = ColorTranslator.FromHtml("#FFFFFF"); + public Color SongSelect_ForeColor_Anime = ColorTranslator.FromHtml("#FFFFFF"); + public Color SongSelect_ForeColor_VOCALOID = ColorTranslator.FromHtml("#FFFFFF"); + public Color SongSelect_ForeColor_Children = ColorTranslator.FromHtml("#FFFFFF"); + public Color SongSelect_ForeColor_Variety = ColorTranslator.FromHtml("#FFFFFF"); + public Color SongSelect_ForeColor_Classic = ColorTranslator.FromHtml("#FFFFFF"); + public Color SongSelect_ForeColor_GameMusic = ColorTranslator.FromHtml("#FFFFFF"); + public Color SongSelect_ForeColor_Namco = ColorTranslator.FromHtml("#FFFFFF"); + public Color SongSelect_BackColor_JPOP = ColorTranslator.FromHtml("#01455B"); + public Color SongSelect_BackColor_Anime = ColorTranslator.FromHtml("#99001F"); + public Color SongSelect_BackColor_VOCALOID = ColorTranslator.FromHtml("#5B6278"); + public Color SongSelect_BackColor_Children = ColorTranslator.FromHtml("#9D3800"); + public Color SongSelect_BackColor_Variety = ColorTranslator.FromHtml("#366600"); + public Color SongSelect_BackColor_Classic = ColorTranslator.FromHtml("#875600"); + public Color SongSelect_BackColor_GameMusic = ColorTranslator.FromHtml("#412080"); + public Color SongSelect_BackColor_Namco = ColorTranslator.FromHtml("#980E00"); + public int SongSelect_Bar_Genre_Count, + SongSelect_Genre_Background_Count, + SongSelect_Box_Chara_Count, + SongSelect_Difficulty_Background_Count; + public string[] SongSelect_CorrectionX_Chara = { "縺薙%縺ォX蠎ァ讓吶r陬懈ュ」縺励◆縺譁蟄励r繧ォ繝ウ繝槭〒蛹コ蛻縺」縺ヲ險伜・" }; + public string[] SongSelect_CorrectionY_Chara = { "縺薙%縺ォY蠎ァ讓吶r陬懈ュ」縺励◆縺譁蟄励r繧ォ繝ウ繝槭〒蛹コ蛻縺」縺ヲ險伜・" }; + public int SongSelect_CorrectionX_Chara_Value = 0; + public int SongSelect_CorrectionY_Chara_Value = 0; + public string[] SongSelect_Rotate_Chara = { "縺薙%縺ォ90邃蝗櫁サ「縺輔○縺溘>譁蟄励r繧ォ繝ウ繝槭〒蛹コ蛻縺」縺ヲ險伜・" }; + + #endregion + #region SongLoading + public int SongLoading_Plate_X = 640; + public int SongLoading_Plate_Y = 360; + public int SongLoading_Title_X = 640; + public int SongLoading_Title_Y = 280; + public int SongLoading_SubTitle_X = 640; + public int SongLoading_SubTitle_Y = 325; + public int SongLoading_Title_FontSize = 31; + public int SongLoading_SubTitle_FontSize = 20; + public ReferencePoint SongLoading_Plate_ReferencePoint = ReferencePoint.Center; + public ReferencePoint SongLoading_Title_ReferencePoint = ReferencePoint.Center; + public ReferencePoint SongLoading_SubTitle_ReferencePoint = ReferencePoint.Center; + public Color SongLoading_Title_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); + public Color SongLoading_Title_BackColor = ColorTranslator.FromHtml("#000000"); + public Color SongLoading_SubTitle_ForeColor = ColorTranslator.FromHtml("#000000"); + public Color SongLoading_SubTitle_BackColor = ColorTranslator.FromHtml("#00000000"); + public bool SongLoading_Plate_ScreenBlend = false; + + #endregion + #region Game + public bool Game_Notes_Anime = false; + public string Game_StageText = "1譖イ逶ョ"; + public RollColorMode Game_RollColorMode = RollColorMode.All; + public bool Game_JudgeFrame_AddBlend = true; + #region Chara + public int[] Game_Chara_X = new int[] { 0, 0 }; + public int[] Game_Chara_Y = new int[] { 0, 537 }; + public int[] Game_Chara_Balloon_X = new int[] { 240, 240, 0, 0 }; + public int[] Game_Chara_Balloon_Y = new int[] { 0, 297, 0, 0 }; + public int Game_Chara_Ptn_Normal, + Game_Chara_Ptn_GoGo, + Game_Chara_Ptn_Clear, + Game_Chara_Ptn_10combo, + Game_Chara_Ptn_10combo_Max, + Game_Chara_Ptn_GoGoStart, + Game_Chara_Ptn_GoGoStart_Max, + Game_Chara_Ptn_ClearIn, + Game_Chara_Ptn_SoulIn, + Game_Chara_Ptn_Balloon_Breaking, + Game_Chara_Ptn_Balloon_Broke, + Game_Chara_Ptn_Balloon_Miss; + public string Game_Chara_Motion_Normal, + Game_Chara_Motion_Clear, + Game_Chara_Motion_GoGo = "0"; + public int Game_Chara_Beat_Normal = 1; + public int Game_Chara_Beat_Clear = 2; + public int Game_Chara_Beat_GoGo = 2; + public int Game_Chara_Balloon_Timer = 28; + public int Game_Chara_Balloon_Delay = 500; + public int Game_Chara_Balloon_FadeOut = 84; + #endregion + #region Dancer + public int[] Game_Dancer_X = new int[] { 640, 430, 856, 215, 1070 }; + public int[] Game_Dancer_Y = new int[] { 500, 500, 500, 500, 500 }; + public string Game_Dancer_Motion = "0"; + public int Game_Dancer_Ptn = 0; + public int Game_Dancer_Beat = 8; + public int[] Game_Dancer_Gauge = new int[] { 0, 0, 0, 40, 80 }; + #endregion + #region Mob + public int Game_Mob_Ptn = 1; + public int Game_Mob_Beat, + Game_Mob_Ptn_Beat = 1; + #endregion + #region CourseSymbol + public int[] Game_CourseSymbol_X = new int[] { 64, 64 }; + public int[] Game_CourseSymbol_Y = new int[] { 232, 582 }; + #endregion + #region PanelFont + public int Game_MusicName_X = 1160; + public int Game_MusicName_Y = 24; + public int Game_MusicName_FontSize = 27; + public ReferencePoint Game_MusicName_ReferencePoint = ReferencePoint.Center; + public int Game_Genre_X = 1015; + public int Game_Genre_Y = 70; + public int Game_Lyric_X = 640; + public int Game_Lyric_Y = 630; + public string Game_Lyric_FontName = "MS UI Gothic"; + public int Game_Lyric_FontSize = 38; + public ReferencePoint Game_Lyric_ReferencePoint = ReferencePoint.Center; + + public Color Game_MusicName_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); + public Color Game_StageText_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); + public Color Game_Lyric_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); + public Color Game_MusicName_BackColor = ColorTranslator.FromHtml("#000000"); + public Color Game_StageText_BackColor = ColorTranslator.FromHtml("#000000"); + public Color Game_Lyric_BackColor = ColorTranslator.FromHtml("#0000FF"); + + #endregion + #region Score + public int[] Game_Score_X = new int[] { 20, 20, 0, 0 }; + public int[] Game_Score_Y = new int[] { 226, 530, 0, 0 }; + public int[] Game_Score_Add_X = new int[] { 20, 20, 0, 0 }; + public int[] Game_Score_Add_Y = new int[] { 186, 570, 0, 0 }; + public int[] Game_Score_AddBonus_X = new int[] { 20, 20, 0, 0 }; + public int[] Game_Score_AddBonus_Y = new int[] { 136, 626, 0, 0 }; + public int Game_Score_Padding = 20; + public int[] Game_Score_Size = new int[] { 24, 40 }; + #endregion + #region Taiko + public int[] Game_Taiko_NamePlate_X = new int[] { 0, 0 }; + public int[] Game_Taiko_NamePlate_Y = new int[] { 300, 380 }; + public int[] Game_Taiko_PlayerNumber_X = new int[] { 4, 4 }; + public int[] Game_Taiko_PlayerNumber_Y = new int[] { 233, 435 }; + public int[] Game_Taiko_X = new int[] { 190, 190 }; + public int[] Game_Taiko_Y = new int[] { 190, 368 }; + public int[] Game_Taiko_Combo_X = new int[] { 267, 267 }; + public int[] Game_Taiko_Combo_Y = new int[] { 272, 447 }; + public int[] Game_Taiko_Combo_Ex_X = new int[] { 267, 267 }; + public int[] Game_Taiko_Combo_Ex_Y = new int[] { 274, 451 }; + public int[] Game_Taiko_Combo_Ex4_X = new int[] { 267, 267 }; + public int[] Game_Taiko_Combo_Ex4_Y = new int[] { 269, 447 }; + public int[] Game_Taiko_Combo_Padding = new int[] { 34, 34, 30 }; + public int[] Game_Taiko_Combo_Size = new int[] { 40, 48 }; + public int[] Game_Taiko_Combo_Size_Ex = new int[] { 40, 48 }; + public float[] Game_Taiko_Combo_Scale = new float[] { 1.0f, 1.0f, 0.9f }; + public int[] Game_Taiko_Combo_Text_X = new int[] { 268, 268 }; + public int[] Game_Taiko_Combo_Text_Y = new int[] { 298, 475 }; + public int[] Game_Taiko_Combo_Text_Size = new int[] { 100, 50 }; + public bool Game_Taiko_Combo_Ex_IsJumping = true; + #endregion + #region Gauge + public int Game_Gauge_Rainbow_Ptn; + public int Game_Gauge_Dan_Rainbow_Ptn; + public int Game_Gauge_Rainbow_Timer = 50; + #endregion + #region Balloon + public int[] Game_Balloon_Combo_X = new int[] { 253, 253 }; + public int[] Game_Balloon_Combo_Y = new int[] { -11, 538 }; + public int[] Game_Balloon_Combo_Number_X = new int[] { 257, 257 }; + public int[] Game_Balloon_Combo_Number_Y = new int[] { 54, 603 }; + public int[] Game_Balloon_Combo_Number_Ex_X = new int[] { 297, 297 }; + public int[] Game_Balloon_Combo_Number_Ex_Y = new int[] { 54, 603 }; + public int[] Game_Balloon_Combo_Text_X = new int[] { 440, 440 }; + public int[] Game_Balloon_Combo_Text_Y = new int[] { 85, 634 }; + public int[] Game_Balloon_Combo_Text_Ex_X = new int[] { 440, 440 }; + public int[] Game_Balloon_Combo_Text_Ex_Y = new int[] { 85, 594 }; + + public int[] Game_Balloon_Balloon_X = new int[] { 382, 382 }; + public int[] Game_Balloon_Balloon_Y = new int[] { 115, 290 }; + public int[] Game_Balloon_Balloon_Frame_X = new int[] { 382, 382 }; + public int[] Game_Balloon_Balloon_Frame_Y = new int[] { 80, 260 }; + public int[] Game_Balloon_Balloon_Number_X = new int[] { 486, 486 }; + public int[] Game_Balloon_Balloon_Number_Y = new int[] { 187, 373 }; + public int[] Game_Balloon_Roll_Frame_X = new int[] { 218, 218 }; + public int[] Game_Balloon_Roll_Frame_Y = new int[] { -3, 514 }; + public int[] Game_Balloon_Roll_Number_X = new int[] { 376, 376 }; + public int[] Game_Balloon_Roll_Number_Y = new int[] { 122, 633 }; + public int[] Game_Balloon_Number_Size = new int[] { 63, 75 }; + public int Game_Balloon_Number_Padding = 55; + public float Game_Balloon_Roll_Number_Scale = 1.000f; + public float Game_Balloon_Balloon_Number_Scale = 0.879f; + #endregion + #region Effects + public int[] Game_Effect_Roll_StartPoint_X = new int[] { 56, -10, 200, 345, 100, 451, 600, 260, -30, 534, 156, 363 }; + public int[] Game_Effect_Roll_StartPoint_Y = new int[] { 720 }; + public int[] Game_Effect_Roll_StartPoint_1P_X = new int[] { 56, -10, 200, 345, 100, 451, 600, 260, -30, 534, 156, 363 }; + public int[] Game_Effect_Roll_StartPoint_1P_Y = new int[] { 240 }; + public int[] Game_Effect_Roll_StartPoint_2P_X = new int[] { 56, -10, 200, 345, 100, 451, 600, 260, -30, 534, 156, 363 }; + public int[] Game_Effect_Roll_StartPoint_2P_Y = new int[] { 360 }; + public float[] Game_Effect_Roll_Speed_X = new float[] { 0.6f }; + public float[] Game_Effect_Roll_Speed_Y = new float[] { -0.6f }; + public float[] Game_Effect_Roll_Speed_1P_X = new float[] { 0.6f }; + public float[] Game_Effect_Roll_Speed_1P_Y = new float[] { -0.6f }; + public float[] Game_Effect_Roll_Speed_2P_X = new float[] { 0.6f }; + public float[] Game_Effect_Roll_Speed_2P_Y = new float[] { 0.6f }; + public int Game_Effect_Roll_Ptn; + public int[] Game_Effect_NotesFlash = new int[] { 180, 180, 16 }; // Width, Height, Ptn + public int Game_Effect_NotesFlash_Timer = 20; + public int[] Game_Effect_GoGoSplash = new int[] { 300, 400, 30 }; + public int[] Game_Effect_GoGoSplash_X = new int[] { 120, 300, 520, 760, 980, 1160 }; + public int[] Game_Effect_GoGoSplash_Y = new int[] { 740, 730, 720, 720, 730, 740 }; + public bool Game_Effect_GoGoSplash_Rotate = true; + public int Game_Effect_GoGoSplash_Timer = 18; + // super-flying-notes AioiLight + public int[] Game_Effect_FlyingNotes_StartPoint_X = new int[] { 414, 414 }; + public int[] Game_Effect_FlyingNotes_StartPoint_Y = new int[] { 260, 434 }; + public int[] Game_Effect_FlyingNotes_EndPoint_X = new int[] { 1222, 1222 }; // 1P, 2P + public int[] Game_Effect_FlyingNotes_EndPoint_Y = new int[] { 164, 554 }; + + public int Game_Effect_FlyingNotes_Sine = 220; + public bool Game_Effect_FlyingNotes_IsUsingEasing = true; + public int Game_Effect_FlyingNotes_Timer = 4; + public int[] Game_Effect_FireWorks = new int[] { 180, 180, 30 }; + public int Game_Effect_FireWorks_Timer = 5; + public int Game_Effect_Rainbow_Timer = 8; + + public bool Game_Effect_HitExplosion_AddBlend = true; + public bool Game_Effect_HitExplosionBig_AddBlend = true; + public bool Game_Effect_FireWorks_AddBlend = true; + public bool Game_Effect_Fire_AddBlend = true; + public bool Game_Effect_GoGoSplash_AddBlend = true; + public int Game_Effect_FireWorks_Timing = 8; + #endregion + #region Runner + public int[] Game_Runner_Size = new int[] { 60, 125 }; + public int Game_Runner_Ptn = 48; + public int Game_Runner_Type = 4; + public int[] Game_Runner_StartPoint_X = new int[] { 175, 175 }; + public int[] Game_Runner_StartPoint_Y = new int[] { 40, 560 }; + public int Game_Runner_Timer = 16; + #endregion + #region PuchiChara + public int[] Game_PuchiChara_X = new int[] { 100, 100 }; + public int[] Game_PuchiChara_Y = new int[] { 140, 600 }; + public int[] Game_PuchiChara_BalloonX = new int[] { 300, 300 }; + public int[] Game_PuchiChara_BalloonY = new int[] { 240, 500 }; + public float[] Game_PuchiChara_Scale = new float[] { 0.7f, 1.0f }; // 騾壼クク譎ゅ 縺オ縺縺帙s騾」謇捺凾 + public int[] Game_PuchiChara = new int[] { 180, 180, 2 }; // Width, Height, Ptn + public int Game_PuchiChara_Sine = 20; + public int Game_PuchiChara_Timer = 4800; + public double Game_PuchiChara_SineTimer = 2; + #endregion + #region Dan-C + public Color Game_DanC_Title_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); + public Color Game_DanC_Title_BackColor = ColorTranslator.FromHtml("#000000"); + public Color Game_DanC_SubTitle_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); + public Color Game_DanC_SubTitle_BackColor = ColorTranslator.FromHtml("#000000"); + + public int[] Game_DanC_Size = new int[] { 1006, 92 }; + public int[] Game_DanC_Number_Size = new int[] { 48, 58 }; + public int[] Game_DanC_Small_Number_Size = new int[] { 24, 29 }; + public int[] Game_DanC_MiniNumber_Size = new int[] { 23, 28 }; + public int[] Game_DanC_ExamType_Size = new int[] { 247, 28 }; + public int[] Game_DanC_ExamRange_Size = new int[] { 54, 30 }; + public int[] Game_DanC_ExamUnit_Size = new int[] { 30, 36 }; + + public int[] Game_DanC_Offset = new int[] { 259, 27 }; + public int[] Game_DanC_Number_Small_Number_Offset = new int[] { 285, 38 }; + public int[] Game_DanC_Exam_Offset = new int[] { 222, 27 }; + + public int[] Game_DanC_X = new int[] { 807, 70, 70, 70 }; // 329, 437 + public int[] Game_DanC_Y = new int[] { 116, 292, 292, 292 }; // { 116, 190, 236, 292 }; + public int[] Game_DanC_Number_XY = new int[] { 214, 67 }; + public int[] Game_DanC_Dan_Plate = new int[] { 149, 416 }; + + public int Game_DanC_Padding = 9; + public int Game_DanC_Number_Padding = 35; + public int Game_DanC_Number_Small_Padding = 41; + public int Game_DanC_ExamRange_Padding = 49; + public int[] Game_DanC_Percent_Hit_Score_Padding = new int[] { 20, 20, 20 }; + + public float Game_DanC_Number_Small_Scale = 0.92f; + public float Game_DanC_Exam_Number_Scale = 0.47f; + + #endregion + #region Training + public int Game_Training_ScrollTime = 350; + public int[] Game_Training_ProgressBar_XY = { 333, 378 }; + public int Game_Training_GoGoPoint_Y = 396; + public int Game_Training_JumpPoint_Y = 375; + public int[] Game_Training_MaxMeasureCount_XY = { 284, 377 }; + public int[] Game_Training_CurrentMeasureCount_XY = { 254, 370 }; + public int[] Game_Training_SpeedDisplay_XY = { 110, 370 }; + public int Game_Training_SmallNumber_Width = 17; + public int Game_Training_BigNumber_Width = 20; + #endregion + + #endregion + #region Result + public int Result_MusicName_X = 640; + public int Result_MusicName_Y = 30; + public int Result_MusicName_FontSize = 25; + public ReferencePoint Result_MusicName_ReferencePoint = ReferencePoint.Center; + public int Result_StageText_X = 230; + public int Result_StageText_Y = 6; + public int Result_StageText_FontSize = 30; + public ReferencePoint Result_StageText_ReferencePoint = ReferencePoint.Left; + + public Color Result_MusicName_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); + public Color Result_StageText_ForeColor = ColorTranslator.FromHtml("#FFFFFF"); + //public Color Result_StageText_ForeColor_Red = ColorTranslator.FromHtml("#FFFFFF"); + public Color Result_MusicName_BackColor = ColorTranslator.FromHtml("#000000"); + public Color Result_StageText_BackColor = ColorTranslator.FromHtml("#000000"); + //public Color Result_StageText_BackColor_Red = ColorTranslator.FromHtml("#FF0000"); + + public int[] Result_NamePlate_X = new int[] { 6, 260 }; + public int[] Result_NamePlate_Y = new int[] { 611, 611 }; + + public int[] Result_Dan = new int[] { 500, 500 }; + public int[] Result_Dan_XY = new int[] { 100, 0 }; + public int[] Result_Dan_Plate_XY = new int[] { 149, 416 }; + #endregion + #region Font + public int Font_Edge_Ratio = 30; + public int Font_Edge_Ratio_Vertical = 30; + public int Text_Correction_X = 0; + public int Text_Correction_Y = 0; + #endregion + #endregion + } +} \ No newline at end of file diff --git a/TJAPlayer3/Common/CVeirticalSongNameFont.cs b/TJAPlayer3/Common/CVeirticalSongNameFont.cs new file mode 100644 index 00000000..ef110efb --- /dev/null +++ b/TJAPlayer3/Common/CVeirticalSongNameFont.cs @@ -0,0 +1,35 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Runtime.InteropServices; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Diagnostics; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + public class CVerticalSongNameFont + { + //蠢隕√↑蛟、 + //_繧ソ繧、繝医Ν + //_繧オ繝悶ち繧、繝医Ν(縺ィ繧翫≠縺医★譛蛻昴ッ辟。縺励〒騾イ繧√k) + //_ + //_ + //_ + + + + + + + + #region [ private ] + //----------------- + private const string str蝗櫁サ「縺輔○繧区枚蟄 = "縲後搾ス橸シ茨シ峨シ-~シ坂樞()縲翫宮}<>縲弱充]窶ヲ"; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Common/ConfigIniToSongGainControllerBinder.cs b/TJAPlayer3/Common/ConfigIniToSongGainControllerBinder.cs new file mode 100644 index 00000000..2e2e604f --- /dev/null +++ b/TJAPlayer3/Common/ConfigIniToSongGainControllerBinder.cs @@ -0,0 +1,38 @@ +サソusing FDK; + +namespace TJAPlayer3 +{ + /// + /// The ConfigIniToSongGainControllerBinder allows for SONGVOL and/or other + /// properties related to the Gain levels applied to song preview and + /// playback, to be applied conditionally based on settings flowing from + /// ConfigIni. This binder class allows that to take place without either + /// ConfigIni or SongGainController having awareness of one another. + /// See those classes properties, methods, and events for more details. + /// + internal static class ConfigIniToSongGainControllerBinder + { + internal static void Bind(CConfigIni configIni, SongGainController songGainController) + { + songGainController.ApplyLoudnessMetadata = configIni.ApplyLoudnessMetadata; + songGainController.TargetLoudness = new Lufs(configIni.TargetLoudness); + songGainController.ApplySongVol = configIni.ApplySongVol; + + configIni.PropertyChanged += (sender, args) => + { + switch (args.PropertyName) + { + case nameof(CConfigIni.ApplyLoudnessMetadata): + songGainController.ApplyLoudnessMetadata = configIni.ApplyLoudnessMetadata; + break; + case nameof(CConfigIni.TargetLoudness): + songGainController.TargetLoudness = new Lufs(configIni.TargetLoudness); + break; + case nameof(CConfigIni.ApplySongVol): + songGainController.ApplySongVol = configIni.ApplySongVol; + break; + } + }; + } + } +} \ No newline at end of file diff --git a/TJAPlayer3/Common/ConfigIniToSoundGroupLevelControllerBinder.cs b/TJAPlayer3/Common/ConfigIniToSoundGroupLevelControllerBinder.cs new file mode 100644 index 00000000..2ebca6be --- /dev/null +++ b/TJAPlayer3/Common/ConfigIniToSoundGroupLevelControllerBinder.cs @@ -0,0 +1,67 @@ +サソusing System; +using FDK; + +namespace TJAPlayer3 +{ + /// + /// The ConfigIniToSoundGroupLevelControllerBinder allows for updated sound + /// group level values, and keyboard sound level adjustment increment + /// values, to flow between CConfigIni and the SoundGroupLevelController + /// without either of those two classes being aware of one another. + /// See those classes properties, methods, and events for more details. + /// + internal static class ConfigIniToSoundGroupLevelControllerBinder + { + internal static void Bind(CConfigIni configIni, SoundGroupLevelController soundGroupLevelController) + { + soundGroupLevelController.SetLevel(ESoundGroup.SoundEffect, configIni.SoundEffectLevel); + soundGroupLevelController.SetLevel(ESoundGroup.Voice, configIni.VoiceLevel); + soundGroupLevelController.SetLevel(ESoundGroup.SongPreview, configIni.SongPlaybackLevel); + soundGroupLevelController.SetLevel(ESoundGroup.SongPlayback, configIni.SongPlaybackLevel); + soundGroupLevelController.SetKeyboardSoundLevelIncrement(configIni.KeyboardSoundLevelIncrement); + + configIni.PropertyChanged += (sender, args) => + { + switch (args.PropertyName) + { + case nameof(CConfigIni.SoundEffectLevel): + soundGroupLevelController.SetLevel(ESoundGroup.SoundEffect, configIni.SoundEffectLevel); + break; + case nameof(CConfigIni.VoiceLevel): + soundGroupLevelController.SetLevel(ESoundGroup.Voice, configIni.VoiceLevel); + break; + case nameof(CConfigIni.SongPreviewLevel): + soundGroupLevelController.SetLevel(ESoundGroup.SongPreview, configIni.SongPlaybackLevel); + break; + case nameof(CConfigIni.SongPlaybackLevel): + soundGroupLevelController.SetLevel(ESoundGroup.SongPlayback, configIni.SongPlaybackLevel); + break; + case nameof(CConfigIni.KeyboardSoundLevelIncrement): + soundGroupLevelController.SetKeyboardSoundLevelIncrement(configIni.KeyboardSoundLevelIncrement); + break; + } + }; + + soundGroupLevelController.LevelChanged += (sender, args) => + { + switch (args.SoundGroup) + { + case ESoundGroup.SoundEffect: + configIni.SoundEffectLevel = args.Level; + break; + case ESoundGroup.Voice: + configIni.VoiceLevel = args.Level; + break; + case ESoundGroup.SongPreview: + configIni.SongPlaybackLevel = args.Level; + break; + case ESoundGroup.SongPlayback: + configIni.SongPlaybackLevel = args.Level; + break; + default: + throw new ArgumentOutOfRangeException(); + } + }; + } + } +} diff --git a/TJAPlayer3/Common/ConfigManager.cs b/TJAPlayer3/Common/ConfigManager.cs new file mode 100644 index 00000000..5200e802 --- /dev/null +++ b/TJAPlayer3/Common/ConfigManager.cs @@ -0,0 +1,56 @@ +サソusing System.Text; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Serialization; + +namespace TJAPlayer3 +{ + /// + /// 險ュ螳壹ヵ繧。繧、繝ォ蜈・蜃コ蜉帙け繝ゥ繧ケ縲 + /// + public static class ConfigManager + { + private static readonly JsonSerializerSettings Settings = + new JsonSerializerSettings() + { + ObjectCreationHandling = ObjectCreationHandling.Auto, + DefaultValueHandling = DefaultValueHandling.Include, + ContractResolver = new CamelCasePropertyNamesContractResolver(), + Converters = new StringEnumConverter[] { new StringEnumConverter() } + }; + + /// + /// 險ュ螳壹ヵ繧。繧、繝ォ縺ョ隱ュ縺ソ霎シ縺ソ繧定。後>縺セ縺吶ゅヵ繧。繧、繝ォ縺悟ュ伜惠縺励↑縺九▲縺溷エ蜷医√◎縺ョ繧ッ繝ゥ繧ケ縺ョ譁ー隕上う繝ウ繧ケ繧ソ繝ウ繧ケ繧定ソ斐@縺セ縺吶 + /// + /// 繧キ繝ェ繧「繝ゥ繧、繧コ縺励◆繧ッ繝ゥ繧ケ縲 + /// 繝輔ぃ繧、繝ォ蜷阪 + /// 繝繧キ繝ェ繧「繝ゥ繧、繧コ邨先棡縲 + public static T GetConfig(string filePath) where T : new() + { + var json = ""; + if (!System.IO.File.Exists(filePath)) + { + // 繝輔ぃ繧、繝ォ縺悟ュ伜惠縺励↑縺縺ョ縺ァ + SaveConfig(new T(), filePath); + } + using (var stream = new System.IO.StreamReader(filePath, Encoding.UTF8)) + { + json = stream.ReadToEnd(); + } + return JsonConvert.DeserializeObject(json, Settings); + } + + /// + /// 險ュ螳壹ヵ繧。繧、繝ォ縺ョ譖ク縺崎セシ縺ソ繧定。後>縺セ縺吶 + /// + /// 繧キ繝ェ繧「繝ゥ繧、繧コ縺吶k繧、繝ウ繧ケ繧ソ繝ウ繧ケ縲 + /// 繝輔ぃ繧、繝ォ蜷阪 + public static void SaveConfig(object obj, string filePath) + { + using (var stream = new System.IO.StreamWriter(filePath, false, Encoding.UTF8)) + { + stream.Write(JsonConvert.SerializeObject(obj, Formatting.Indented, Settings)); + } + } + } +} diff --git a/TJAPlayer3/Common/C螳壽焚.cs b/TJAPlayer3/Common/C螳壽焚.cs new file mode 100644 index 00000000..5b5aa8e5 --- /dev/null +++ b/TJAPlayer3/Common/C螳壽焚.cs @@ -0,0 +1,774 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; + +namespace TJAPlayer3 +{ + + /// + /// 髮」譏灘コヲ縲 + /// + public enum Difficulty + { + Easy, + Normal, + Hard, + Oni, + Edit, + Tower, + Dan, + Total + } + + public enum EScrollMode + { + Normal, + BMSCROLL, + HBSCROLL + } + public enum E繧ク繝」繝ウ繝ォ + { + None = 0, + JPOP = 1, + 繧イ繝シ繝 = 2, + 繝翫Β繧ウ = 3, + 繧ッ繝ゥ繧キ繝繧ッ = 4, + 繝舌Λ繧ィ繝繧」 = 5, + 縺ゥ縺繧医≧ = 6, + 繝懊シ繧ォ繝ュ繧、繝 = 7, + 繧「繝九Γ = 8 + } + public enum EGame + { + OFF = 0, + 螳瑚オー蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ = 1, + 螳瑚オー蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ豼霎 = 2 + } + public enum E髮」譏灘コヲ陦ィ遉コ繧ソ繧、繝 + { + OFF = 0, + n譖イ逶ョ縺ォ陦ィ遉コ = 1, + mtaiko縺ォ逕サ蜒上〒陦ィ遉コ = 2, + } + public enum E繝繝シ繧ッ繝「繝シ繝 + { + OFF, + HALF, + FULL + } + public enum EWindowMovieMode + { + OFF = 0, + 蟾ヲ荳 = 1, + 荳ュ螟ョ荳 = 2 + } + public enum E繝繝。繝シ繧ク繝ャ繝吶Ν + { + 蟆代↑縺 = 0, + 譎ョ騾 = 1, + 螟ァ縺阪> = 2 + } + public enum E繝代ャ繝 // 貍泌・冗畑縺ョenum縲ゅ%縺薙r菫ョ豁」縺吶k縺ィ縺阪ッ縲∵ャ。縺ォ蜃コ縺ヲ縺上k EKeyConfigPad 縺ィ E繝代ャ繝宇lag 繧ゅそ繝繝医〒菫ョ豁」縺吶k縺薙→縲 + { + HH = 0, + R = 0, + SD = 1, + G = 1, + BD = 2, + B = 2, + HT = 3, + Pick = 3, + LT = 4, + Wail = 4, + FT = 5, + Cancel = 5, + CY = 6, + Decide = 6, + HHO = 7, + RD = 8, + LC = 9, + LP = 10, // #27029 2012.1.4 from + LBD = 11, + LRed = 12, + RRed = 13, + LBlue = 14, + RBlue = 15, + LRed2P = 16, + RRed2P = 17, + LBlue2P = 18, + RBlue2P = 19, + MAX, // 髢逡ェ逕ィ縺ィ縺励※螳夂セゥ + UNKNOWN = 99 + } + public enum EKeyConfigPad // #24609 繧ュ繝シ繧ウ繝ウ繝輔ぅ繧ー縺ァ菴ソ縺enum縲Dapture隕∫エ縺ゅj縲 + { + HH = E繝代ャ繝.HH, + R = E繝代ャ繝.R, + SD = E繝代ャ繝.SD, + G = E繝代ャ繝.G, + BD = E繝代ャ繝.BD, + B = E繝代ャ繝.B, + HT = E繝代ャ繝.HT, + Pick = E繝代ャ繝.Pick, + LT = E繝代ャ繝.LT, + Wail = E繝代ャ繝.Wail, + FT = E繝代ャ繝.FT, + Cancel = E繝代ャ繝.Cancel, + CY = E繝代ャ繝.CY, + Decide = E繝代ャ繝.Decide, + HHO = E繝代ャ繝.HHO, + RD = E繝代ャ繝.RD, + LC = E繝代ャ繝.LC, + LP = E繝代ャ繝.LP, // #27029 2012.1.4 from + LBD = E繝代ャ繝.LBD, + LRed = E繝代ャ繝.LRed, + RRed = E繝代ャ繝.RRed, + LBlue = E繝代ャ繝.LBlue, + RBlue = E繝代ャ繝.RBlue, + LRed2P = E繝代ャ繝.LRed2P, + RRed2P = E繝代ャ繝.RRed2P, + LBlue2P = E繝代ャ繝.LBlue2P, + RBlue2P = E繝代ャ繝.RBlue2P, + Capture, + UNKNOWN = E繝代ャ繝.UNKNOWN + } + [Flags] + public enum E繝代ャ繝宇lag // #24063 2011.1.16 yyagi 繧ウ繝槭Φ繝牙・蜉帷畑 繝代ャ繝牙・蜉帙ョ繝輔Λ繧ー蛹 + { + None = 0, + HH = 1, + R = 1, + SD = 2, + G = 2, + B = 4, + BD = 4, + HT = 8, + Pick = 8, + LT = 16, + Wail = 16, + FT = 32, + Cancel = 32, + CY = 64, + Decide = 128, + HHO = 128, + RD = 256, + LC = 512, + LP = 1024, // #27029 + LBD = 2048, + LRed = 0, + RRed = 1, + LBlue = 2, + RBlue = 4, + LRed2P = 8, + RRed2P = 16, + LBlue2P = 32, + RBlue2P = 64, + UNKNOWN = 4096 + } + public enum E繝ゥ繝ウ繝繝繝「繝シ繝 + { + OFF, + RANDOM, + MIRROR, + SUPERRANDOM, + HYPERRANDOM + } + public enum E讌ス蝎ィ繝代シ繝 // 縺薙%繧剃ソョ豁」縺吶k縺ィ縺阪ッ縲√そ繝繝医〒谺。縺ョ EKeyConfigPart 繧ゆソョ豁」縺吶k縺薙→縲 + { + DRUMS = 0, + GUITAR = 1, + BASS = 2, + TAIKO = 3, + UNKNOWN = 99 + } + public enum EKeyConfigPart // : E讌ス蝎ィ繝代シ繝 + { + DRUMS = E讌ス蝎ィ繝代シ繝.DRUMS, + GUITAR = E讌ス蝎ィ繝代シ繝.GUITAR, + BASS = E讌ス蝎ィ繝代シ繝.BASS, + TAIKO = E讌ス蝎ィ繝代シ繝.TAIKO, + SYSTEM, + UNKNOWN = E讌ス蝎ィ繝代シ繝.UNKNOWN + } + + public enum E謇薙■蛻縺第凾縺ョ蜀咲函縺ョ蜆ェ蜈磯菴 + { + Chip縺訓ad繧医j蜆ェ蜈, + Pad縺靴hip繧医j蜆ェ蜈 + } + internal enum E蜈・蜉帙ョ繝舌う繧ケ + { + 繧ュ繝シ繝懊シ繝 = 0, + MIDI蜈・蜉 = 1, + 繧ク繝ァ繧、繝代ャ繝 = 2, + 繝槭え繧ケ = 3, + 荳肴 = -1 + } + public enum E蛻、螳 + { + Perfect = 0, + Great = 1, + Good = 2, + Poor = 3, + Miss = 4, + Bad = 5, + Auto + } + internal enum E蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ + { + 陦ィ遉コOFF, + 繝ャ繝シ繝ウ荳, + 蛻、螳壹Λ繧、繝ウ荳, + 繧ウ繝ウ繝應ク + } + internal enum E蛻、螳壻ス咲スョ + { + 讓呎コ = 0, + Lower, + MAX + } + internal enum E蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ + { + Chip繧医j荳, + Chip繧医j荳 + } + internal enum EAVI遞ョ蛻・ + { + Unknown, + AVI, + AVIPAN + } + internal enum EBGA遞ョ蛻・ + { + Unknown, + BMP, + BMPTEX, + BGA, + BGAPAN + } + internal enum EFIFO繝「繝シ繝 + { + 繝輔ぉ繝シ繝峨う繝ウ, + 繝輔ぉ繝シ繝峨い繧ヲ繝 + } + internal enum E繝ャ繝シ繝ウ + { + LC = 0, + HH, + SD, + BD, + HT, + LT, + FT, + CY, + LP, + RD, // 蟆譚・縺ョ迢ャ遶九Ξ繝シ繝ウ蛹/迢ャ遶帰UTO險ュ螳壹r隕玖カ翫@縺ヲ霑ス蜉 + LBD = 10, + Guitar, // AUTO繝ャ繝シ繝ウ蛻、螳壹r螳ケ譏薙↓縺吶k縺溘a縲∽セソ螳應ク雁ョ夂セゥ縺励※縺翫¥(譛ェ菴ソ逕ィ) + Bass, // (譛ェ菴ソ逕ィ) + GtR, + GtG, + GtB, + GtPick, + GtW, + BsR, + BsG, + BsB, + BsPick, + BsW, + MAX, // 隕∫エ謨ー蜿門セ励ョ縺溘a縺ョ螳夂セゥ ("BGM"縺ッ菴ソ繧上↑縺蜑肴署縺ァ) + BGM + } + internal enum E繝ャ繝シ繝ウ謨ー + { + 迚ゥ逅 = 8, // LC, HH, SD, BD, HT, LT, FT, CY + 隲也炊 = 10, // LC, HO, HC, SD, BD, HT, LT, FT, RC, RD + DTXG迚ゥ逅 = 10, // LC, HH, LP, SD, BD, HT, LT, FT, CY, RD + DTXG隲也炊 = 12 // LC, HO, HC, LP, LB, SD, BD, HT, LT, FT, CY, RD + } + internal enum E繝ュ繧ー蜃コ蜉 + { + OFF, + ON騾壼クク, + ON隧ウ邏ー縺ゅj + } + internal enum E貍泌・冗判髱「縺ョ謌サ繧雁、 + { + 邯咏カ, + 貍泌・丈クュ譁ュ, + 繧ケ繝繝シ繧ク螟ア謨, + 繧ケ繝繝シ繧ク繧ッ繝ェ繧「, + 蜀崎ェュ霎シ_蜀肴シ泌・, + 蜀肴シ泌・ + } + internal enum E譖イ隱ュ霎シ逕サ髱「縺ョ謌サ繧雁、 + { + 邯咏カ = 0, + 隱ュ霎シ螳御コ, + 隱ュ霎シ荳ュ豁「 + } + + public enum ENoteState + { + none, + wait, + perfect, + grade, + bad + } + + public enum E騾」謇鉄tate + { + none, + roll, + rollB, + balloon, + potato + } + + public enum E繧ケ繝繝ォ繧ケ繝「繝シ繝 + { + OFF = 0, + DORON = 1, + STEALTH = 2 + } + + /// + /// 騾乗弱メ繝繝励ョ遞ョ鬘 + /// + public enum EInvisible + { + OFF, // 繝√ャ繝励r騾乗主喧縺励↑縺 + SEMI, // Poor/Miss譎ゅ□縺代∽ク譎ら噪縺ォ騾乗手ァ」髯、縺吶k + FULL // 繝√ャ繝励r蟶ク縺ォ騾乗主喧縺吶k + } + + /// + /// Drum/Guitar/Bass 縺ョ蛟、繧呈桶縺豎守畑縺ョ讒矩菴薙 + /// + /// 蛟、縺ョ蝙九 + [Serializable] + [StructLayout( LayoutKind.Sequential )] + public struct STDGBVALUE // index縺ッE讌ス蝎ィ繝代シ繝医→荳閾エ縺輔○繧九%縺ィ + { + public T Drums; + public T Guitar; + public T Bass; + public T Taiko; + public T Unknown; + public T this[ int index ] + { + get + { + switch( index ) + { + case (int) E讌ス蝎ィ繝代シ繝.DRUMS: + return this.Drums; + + case (int) E讌ス蝎ィ繝代シ繝.GUITAR: + return this.Guitar; + + case (int) E讌ス蝎ィ繝代シ繝.BASS: + return this.Bass; + + case (int) E讌ス蝎ィ繝代シ繝.TAIKO: + return this.Taiko; + + case (int) E讌ス蝎ィ繝代シ繝.UNKNOWN: + return this.Unknown; + } + throw new IndexOutOfRangeException(); + } + set + { + switch( index ) + { + case (int) E讌ス蝎ィ繝代シ繝.DRUMS: + this.Drums = value; + return; + + case (int) E讌ス蝎ィ繝代シ繝.GUITAR: + this.Guitar = value; + return; + + case (int) E讌ス蝎ィ繝代シ繝.BASS: + this.Bass = value; + return; + + case (int) E讌ス蝎ィ繝代シ繝.TAIKO: + this.Taiko = value; + return; + + case (int) E讌ス蝎ィ繝代シ繝.UNKNOWN: + this.Unknown = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + + /// + /// 繝ャ繝シ繝ウ縺ョ蛟、繧呈桶縺豎守畑縺ョ讒矩菴薙ょ玲嫌蝙"E繝峨Λ繝繝ャ繝シ繝ウ"縺ォ貅匁侠縲 + /// + /// 蛟、縺ョ蝙九 + [StructLayout( LayoutKind.Sequential )] + public struct STLANEVALUE + { + public T LC; + public T HH; + public T SD; + public T LP; + public T LBD; + public T BD; + public T HT; + public T LT; + public T FT; + public T CY; + public T RD; + public T Guitar; + public T Bass; + public T GtR; + public T GtG; + public T GtB; + public T GtPick; + public T GtW; + public T BsR; + public T BsG; + public T BsB; + public T BsPick; + public T BsW; + public T BGM; + + public T this[ int index ] + { + get + { + switch ( index ) + { + case (int) E繝ャ繝シ繝ウ.LC: + return this.LC; + case (int) E繝ャ繝シ繝ウ.HH: + return this.HH; + case (int) E繝ャ繝シ繝ウ.SD: + return this.SD; + case (int) E繝ャ繝シ繝ウ.LP: + return this.LP; + case (int) E繝ャ繝シ繝ウ.LBD: + return this.LBD; + case (int) E繝ャ繝シ繝ウ.BD: + return this.BD; + case (int) E繝ャ繝シ繝ウ.HT: + return this.HT; + case (int) E繝ャ繝シ繝ウ.LT: + return this.LT; + case (int) E繝ャ繝シ繝ウ.FT: + return this.FT; + case (int) E繝ャ繝シ繝ウ.CY: + return this.CY; + case (int) E繝ャ繝シ繝ウ.RD: + return this.RD; + case (int) E繝ャ繝シ繝ウ.Guitar: + return this.Guitar; + case (int) E繝ャ繝シ繝ウ.Bass: + return this.Bass; + case (int) E繝ャ繝シ繝ウ.GtR: + return this.GtR; + case (int) E繝ャ繝シ繝ウ.GtG: + return this.GtG; + case (int) E繝ャ繝シ繝ウ.GtB: + return this.GtB; + case (int) E繝ャ繝シ繝ウ.GtPick: + return this.GtPick; + case (int) E繝ャ繝シ繝ウ.GtW: + return this.GtW; + case (int) E繝ャ繝シ繝ウ.BsR: + return this.BsR; + case (int) E繝ャ繝シ繝ウ.BsG: + return this.BsG; + case (int) E繝ャ繝シ繝ウ.BsB: + return this.BsB; + case (int) E繝ャ繝シ繝ウ.BsPick: + return this.BsPick; + case (int) E繝ャ繝シ繝ウ.BsW: + return this.BsW; + } + throw new IndexOutOfRangeException(); + } + set + { + switch ( index ) + { + case (int) E繝ャ繝シ繝ウ.LC: + this.LC = value; + return; + case (int) E繝ャ繝シ繝ウ.HH: + this.HH = value; + return; + case (int) E繝ャ繝シ繝ウ.SD: + this.SD = value; + return; + case (int) E繝ャ繝シ繝ウ.LP: + this.LP = value; + return; + case (int) E繝ャ繝シ繝ウ.LBD: + this.LBD = value; + return; + case (int) E繝ャ繝シ繝ウ.BD: + this.BD = value; + return; + case (int) E繝ャ繝シ繝ウ.HT: + this.HT = value; + return; + case (int) E繝ャ繝シ繝ウ.LT: + this.LT = value; + return; + case (int) E繝ャ繝シ繝ウ.FT: + this.FT = value; + return; + case (int) E繝ャ繝シ繝ウ.CY: + this.CY = value; + return; + case (int) E繝ャ繝シ繝ウ.RD: + this.RD = value; + return; + case (int) E繝ャ繝シ繝ウ.Guitar: + this.Guitar = value; + return; + case (int) E繝ャ繝シ繝ウ.Bass: + this.Bass = value; + return; + case (int) E繝ャ繝シ繝ウ.GtR: + this.GtR = value; + return; + case (int) E繝ャ繝シ繝ウ.GtG: + this.GtG = value; + return; + case (int) E繝ャ繝シ繝ウ.GtB: + this.GtB = value; + return; + case (int) E繝ャ繝シ繝ウ.GtPick: + this.GtPick = value; + return; + case (int) E繝ャ繝シ繝ウ.GtW: + this.GtW = value; + return; + case (int) E繝ャ繝シ繝ウ.BsR: + this.BsR = value; + return; + case (int) E繝ャ繝シ繝ウ.BsG: + this.BsG = value; + return; + case (int) E繝ャ繝シ繝ウ.BsB: + this.BsB = value; + return; + case (int) E繝ャ繝シ繝ウ.BsPick: + this.BsPick = value; + return; + case (int) E繝ャ繝シ繝ウ.BsW: + this.BsW = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + + + [StructLayout( LayoutKind.Sequential )] + public struct STAUTOPLAY // E繝ャ繝シ繝ウ縺ィindex繧剃ク閾エ縺輔○繧九%縺ィ + { + public bool LC; // 0 + public bool HH; // 1 + public bool SD; // 2 + public bool BD; // 3 + public bool HT; // 4 + public bool LT; // 5 + public bool FT; // 6 + public bool CY; // 7 + public bool LP; + public bool RD; // 8 + public bool LBD; + public bool Guitar; // 9 (not used) + public bool Bass; // 10 (not used) + public bool GtR; // 11 + public bool GtG; // 12 + public bool GtB; // 13 + public bool GtPick; // 14 + public bool GtW; // 15 + public bool BsR; // 16 + public bool BsG; // 17 + public bool BsB; // 18 + public bool BsPick; // 19 + public bool BsW; // 20 + public bool this[ int index ] + { + get + { + switch ( index ) + { + case (int) E繝ャ繝シ繝ウ.LC: + return this.LC; + case (int) E繝ャ繝シ繝ウ.HH: + return this.HH; + case (int) E繝ャ繝シ繝ウ.SD: + return this.SD; + case (int) E繝ャ繝シ繝ウ.BD: + return this.BD; + case (int) E繝ャ繝シ繝ウ.HT: + return this.HT; + case (int) E繝ャ繝シ繝ウ.LT: + return this.LT; + case (int) E繝ャ繝シ繝ウ.FT: + return this.FT; + case (int) E繝ャ繝シ繝ウ.CY: + return this.CY; + case (int) E繝ャ繝シ繝ウ.LP: + return this.LP; + case (int) E繝ャ繝シ繝ウ.RD: + return this.RD; + case (int) E繝ャ繝シ繝ウ.LBD: + return this.LBD; + case (int) E繝ャ繝シ繝ウ.Guitar: + if ( !this.GtR ) return false; + if ( !this.GtG ) return false; + if ( !this.GtB ) return false; + if ( !this.GtPick ) return false; + if ( !this.GtW ) return false; + return true; + case (int) E繝ャ繝シ繝ウ.Bass: + if ( !this.BsR ) return false; + if ( !this.BsG ) return false; + if ( !this.BsB) return false; + if ( !this.BsPick ) return false; + if ( !this.BsW ) return false; + return true; + case (int) E繝ャ繝シ繝ウ.GtR: + return this.GtR; + case (int) E繝ャ繝シ繝ウ.GtG: + return this.GtG; + case (int) E繝ャ繝シ繝ウ.GtB: + return this.GtB; + case (int) E繝ャ繝シ繝ウ.GtPick: + return this.GtPick; + case (int) E繝ャ繝シ繝ウ.GtW: + return this.GtW; + case (int) E繝ャ繝シ繝ウ.BsR: + return this.BsR; + case (int) E繝ャ繝シ繝ウ.BsG: + return this.BsG; + case (int) E繝ャ繝シ繝ウ.BsB: + return this.BsB; + case (int) E繝ャ繝シ繝ウ.BsPick: + return this.BsPick; + case (int) E繝ャ繝シ繝ウ.BsW: + return this.BsW; + } + throw new IndexOutOfRangeException(); + } + set + { + switch ( index ) + { + case (int) E繝ャ繝シ繝ウ.LC: + this.LC = value; + return; + case (int) E繝ャ繝シ繝ウ.HH: + this.HH = value; + return; + case (int) E繝ャ繝シ繝ウ.SD: + this.SD = value; + return; + case (int) E繝ャ繝シ繝ウ.BD: + this.BD = value; + return; + case (int) E繝ャ繝シ繝ウ.HT: + this.HT = value; + return; + case (int) E繝ャ繝シ繝ウ.LT: + this.LT = value; + return; + case (int) E繝ャ繝シ繝ウ.FT: + this.FT = value; + return; + case (int) E繝ャ繝シ繝ウ.CY: + this.CY = value; + return; + case (int) E繝ャ繝シ繝ウ.LP: + this.LP = value; + return; + case (int) E繝ャ繝シ繝ウ.RD: + this.RD = value; + return; + case (int) E繝ャ繝シ繝ウ.LBD: + this.LBD = value; + return; + case (int) E繝ャ繝シ繝ウ.Guitar: + this.GtR = this.GtG = this.GtB = this.GtPick = this.GtW = value; + return; + case (int) E繝ャ繝シ繝ウ.Bass: + this.BsR = this.BsG = this.BsB = this.BsPick = this.BsW = value; + return; + case (int) E繝ャ繝シ繝ウ.GtR: + this.GtR = value; + return; + case (int) E繝ャ繝シ繝ウ.GtG: + this.GtG = value; + return; + case (int) E繝ャ繝シ繝ウ.GtB: + this.GtB = value; + return; + case (int) E繝ャ繝シ繝ウ.GtPick: + this.GtPick = value; + return; + case (int) E繝ャ繝シ繝ウ.GtW: + this.GtW = value; + return; + case (int) E繝ャ繝シ繝ウ.BsR: + this.BsR = value; + return; + case (int) E繝ャ繝シ繝ウ.BsG: + this.BsG = value; + return; + case (int) E繝ャ繝シ繝ウ.BsB: + this.BsB = value; + return; + case (int) E繝ャ繝シ繝ウ.BsPick: + this.BsPick = value; + return; + case (int) E繝ャ繝シ繝ウ.BsW: + this.BsW = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + + #region[Ver.K霑ス蜉] + public enum E繝ャ繝シ繝ウ繧ソ繧、繝 + { + TypeA, + TypeB, + TypeC, + TypeD + } + public enum E繝溘Λ繝シ + { + TypeA, + TypeB + } + public enum EClipDispType + { + 閭梧勹縺ョ縺ソ = 1, + 繧ヲ繧」繝ウ繝峨え縺ョ縺ソ = 2, + 荳。譁ケ = 3, + OFF = 0 + } + #endregion + + internal class C螳壽焚 + { + } +} diff --git a/TJAPlayer3/Common/C譁蟄励さ繝ウ繧ス繝シ繝ォ.cs b/TJAPlayer3/Common/C譁蟄励さ繝ウ繧ス繝シ繝ォ.cs new file mode 100644 index 00000000..262ee656 --- /dev/null +++ b/TJAPlayer3/Common/C譁蟄励さ繝ウ繧ス繝シ繝ォ.cs @@ -0,0 +1,128 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using FDK; + +namespace TJAPlayer3 +{ + internal class C譁蟄励さ繝ウ繧ス繝シ繝ォ : CActivity + { + // 螳壽焚 + + public enum E繝輔か繝ウ繝育ィョ蛻・ + { + 逋ス, + 襍、, + 轣ー, + 逋ス邏ー, + 襍、邏ー, + 轣ー邏ー + } + public enum E驟咲スョ + { + 蟾ヲ隧ー, + 荳ュ螟ョ, + 蜿ウ隧ー + } + + + // 繝。繧ス繝繝 + + public void tPrint( int x, int y, E繝輔か繝ウ繝育ィョ蛻・ font, string str闍ア謨ー蟄玲枚蟄怜 ) + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 && !string.IsNullOrEmpty( str闍ア謨ー蟄玲枚蟄怜 ) ) + { + int BOL = x; + for( int i = 0; i < str闍ア謨ー蟄玲枚蟄怜.Length; i++ ) + { + char ch = str闍ア謨ー蟄玲枚蟄怜夕 i ]; + if( ch == '\n' ) + { + x = BOL; + y += nFontHeight; + } + else + { + int index = str陦ィ險伜庄閭ス譁蟄.IndexOf( ch ); + if( index < 0 ) + { + x += nFontWidth; + } + else + { + if( this.tx繝輔か繝ウ繝8x16[ (int) ( (int) font / (int) E繝輔か繝ウ繝育ィョ蛻・.逋ス邏ー ) ] != null ) + { + this.tx繝輔か繝ウ繝8x16[ (int) ( (int) font / (int) E繝輔か繝ウ繝育ィョ蛻・.逋ス邏ー ) ].t2D謠冗判( TJAPlayer3.app.Device, x, y, this.rc譁蟄励ョ遏ゥ蠖「鬆伜沺[ (int) ( (int) font % (int) E繝輔か繝ウ繝育ィョ蛻・.逋ス邏ー ), index ] ); + } + x += nFontWidth; + } + } + } + } + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + this.rc譁蟄励ョ遏ゥ蠖「鬆伜沺 = new Rectangle[3, str陦ィ險伜庄閭ス譁蟄.Length ]; + for( int i = 0; i < 3; i++ ) + { + for (int j = 0; j < str陦ィ險伜庄閭ス譁蟄.Length; j++) + { + const int regionX = 128, regionY = 16; + this.rc譁蟄励ョ遏ゥ蠖「鬆伜沺[ i, j ].X = ( ( i / 2 ) * regionX ) + ( ( j % regionY ) * nFontWidth ); + this.rc譁蟄励ョ遏ゥ蠖「鬆伜沺[ i, j ].Y = ( ( i % 2 ) * regionX ) + ( ( j / regionY ) * nFontHeight ); + this.rc譁蟄励ョ遏ゥ蠖「鬆伜沺[ i, j ].Width = nFontWidth; + this.rc譁蟄励ョ遏ゥ蠖「鬆伜沺[ i, j ].Height = nFontHeight; + } + } + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + if( this.rc譁蟄励ョ遏ゥ蠖「鬆伜沺 != null ) + this.rc譁蟄励ョ遏ゥ蠖「鬆伜沺 = null; + + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + this.tx繝輔か繝ウ繝8x16[ 0 ] = TJAPlayer3.Tx.TxC(@"Console_Font.png"); + this.tx繝輔か繝ウ繝8x16[ 1 ] = TJAPlayer3.Tx.TxC(@"Console_Font_Small.png"); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + for( int i = 0; i < 2; i++ ) + { + if( this.tx繝輔か繝ウ繝8x16[ i ] != null ) + { + this.tx繝輔か繝ウ繝8x16[ i ].Dispose(); + this.tx繝輔か繝ウ繝8x16[ i ] = null; + } + } + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private Rectangle[,] rc譁蟄励ョ遏ゥ蠖「鬆伜沺; + private const string str陦ィ險伜庄閭ス譁蟄 = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ "; + private const int nFontWidth = 8, nFontHeight = 16; + private CTexture[] tx繝輔か繝ウ繝8x16 = new CTexture[ 2 ]; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Common/Discord.cs b/TJAPlayer3/Common/Discord.cs new file mode 100644 index 00000000..d806ba8c --- /dev/null +++ b/TJAPlayer3/Common/Discord.cs @@ -0,0 +1,180 @@ +サソusing System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Text; + +namespace TJAPlayer3 +{ + public static class DiscordRpc + { + [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Auto)] + public delegate void ReadyCallback(); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Auto)] + public delegate void DisconnectedCallback(int errorCode, string message); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Auto)] + public delegate void ErrorCallback(int errorCode, string message); + + public struct EventHandlers + { + public ReadyCallback readyCallback; + public DisconnectedCallback disconnectedCallback; + public ErrorCallback errorCallback; + } + + [Serializable, StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + public struct RichPresence + { + public IntPtr state; + public IntPtr details; + public long startTimestamp; + public long endTimestamp; + public IntPtr largeImageKey; + public IntPtr largeImageText; + public IntPtr smallImageKey; + public IntPtr smallImageText; + public IntPtr partyId; + public int partySize; + public int partyMax; + public IntPtr matchSecret; + public IntPtr joinSecret; + public IntPtr spectateSecret; + public bool instance; + } + + [DllImport("discord-rpc", EntryPoint = "Discord_Initialize", CallingConvention = CallingConvention.Cdecl)] + public static extern void Initialize(string applicationId, ref EventHandlers handlers, bool autoRegister, string optionalSteamId); + + [DllImport("discord-rpc", EntryPoint = "Discord_Shutdown", CallingConvention = CallingConvention.Cdecl)] + public static extern void Shutdown(); + + [DllImport("discord-rpc", EntryPoint = "Discord_RunCallbacks", CallingConvention = CallingConvention.Cdecl)] + public static extern void RunCallbacks(); + + [DllImport("discord-rpc", EntryPoint = "Discord_UpdatePresence", CallingConvention = CallingConvention.Cdecl)] + public static extern void UpdatePresence(ref RichPresence presence); + + [DllImport("discord-rpc", EntryPoint = "Discord_ClearPresence", CallingConvention = CallingConvention.Cdecl)] + public static extern void ClearPresence(); + + [DllImport("discord-rpc", EntryPoint = "Discord_UpdateHandlers", CallingConvention = CallingConvention.Cdecl)] + public static extern void UpdateHandlers(ref EventHandlers handlers); + } + + public static class Discord + { + + private static readonly List _buffers = new List(10); + + /// + /// Discord Rich Presence縺ョ蛻晄悄蛹悶r縺励∪縺吶 + /// + /// Discord API縺ョ繧ッ繝ゥ繧、繧「繝ウ繝ID縲 + public static void Initialize(string clientId) + { + var handlers = new DiscordRpc.EventHandlers(); + handlers.readyCallback = ReadyCallback; + handlers.disconnectedCallback += DisconnectedCallback; + handlers.errorCallback += ErrorCallback; + + DiscordRpc.Initialize(clientId, ref handlers, true, null); + + } + + /// + /// Discord Rich Presence縺ョ譖エ譁ー繧偵@縺セ縺吶 + /// + /// 迴セ蝨ィ縺ョ隱ャ譏弱 + /// 迴セ蝨ィ縺ョ迥カ諷九 + /// 髢句ァ区凾髢(Unix譎る俣) + /// 邨ゆコ譎る俣(Unix譎る俣) + /// 蟆上&縺ェ繧「繧、繧ウ繝ウ逕ィ繧ュ繝シ縲 + /// 蟆上&縺ェ繧「繧、繧ウ繝ウ縺ョ繝繝シ繝ォ繝√ャ繝励↓陦ィ遉コ縺吶k繝繧ュ繧ケ繝医 + public static void UpdatePresence(string details, string state, long startTimeStamp = 0, long endTimeStamp = 0, string smallImageKey = null, string smallImageText = null) + { + var presence = new DiscordRpc.RichPresence(); + presence.details = StrToPtr(details); + presence.state = StrToPtr(state); + + if (startTimeStamp != 0) presence.startTimestamp = startTimeStamp; + if (endTimeStamp != 0) presence.endTimestamp = endTimeStamp; + presence.largeImageKey = StrToPtr("rewrite"); + presence.largeImageText = StrToPtr("Ver." + TJAPlayer3.VERSION); + if (!string.IsNullOrEmpty(smallImageKey)) presence.smallImageKey = StrToPtr(smallImageKey); + if (!string.IsNullOrEmpty(smallImageText)) presence.smallImageText = StrToPtr(smallImageText); + + DiscordRpc.UpdatePresence(ref presence); + FreeMem(); + } + + /// + /// Discord Rich Presence縺ョ繧キ繝」繝繝医ム繧ヲ繝ウ繧定。後>縺セ縺吶 + /// 邨ゆコ譎ゅ↓蠢縺壼他縺ウ蜃コ縺吝ソ隕√′縺ゅj縺セ縺吶 + /// + public static void Shutdown() + { + DiscordRpc.Shutdown(); + Trace.TraceInformation("[Discord] Shutdowned."); + } + + private static void ReadyCallback() + { + Trace.TraceInformation("[Discord] Ready."); + } + + /// + /// Discord縺ィ縺ョ謗・邯壹′蛻譁ュ縺輔l縺溷エ蜷亥他縺ウ蜃コ縺輔l縺セ縺吶 + /// + /// 繧ィ繝ゥ繝シ繧ウ繝シ繝峨 + /// 繧ィ繝ゥ繝シ繝。繝繧サ繝シ繧ク縲 + private static void DisconnectedCallback(int errorCode, string message) + { + Trace.TraceInformation("[Discord] Disconnected."); + } + + /// + /// Discord縺ィ縺ョ謗・邯壹〒繧ィ繝ゥ繝シ縺檎匱逕溘@縺溷エ蜷亥他縺ウ蜃コ縺輔l縺セ縺吶 + /// + /// 繧ィ繝ゥ繝シ繧ウ繝シ繝峨 + /// 繧ィ繝ゥ繝シ繝。繝繧サ繝シ繧ク縲 + private static void ErrorCallback(int errorCode, string message) + { + Trace.TraceInformation("[Discord] Error occured: {0} {1}", errorCode, message); + } + + // string蝙九ョ譁蟄怜励r繝昴う繝ウ繧ソ縺ァ蜿らァ縺輔○繧九h縺縺ォ縺吶k縺溘a縺ョ繝。繧ス繝繝峨 + private static IntPtr StrToPtr(string input) + { + if (string.IsNullOrEmpty(input)) return IntPtr.Zero; + var convbytecnt = Encoding.UTF8.GetByteCount(input); + var buffer = Marshal.AllocHGlobal(convbytecnt + 1); + for (int i = 0; i < convbytecnt + 1; i++) + { + Marshal.WriteByte(buffer, i, 0); + } + _buffers.Add(buffer); + Marshal.Copy(Encoding.UTF8.GetBytes(input), 0, buffer, convbytecnt); + return buffer; + } + + internal static void FreeMem() + { + for (var i = _buffers.Count - 1; i >= 0; i--) + { + Marshal.FreeHGlobal(_buffers[i]); + _buffers.RemoveAt(i); + } + } + + /// + /// 迴セ蝨ィ縺ョUnix譎る俣繧値ong蝙九〒霑斐@縺セ縺吶 + /// + /// Unix譎る俣縲 + public static long GetUnixTime() + { + return (long)(DateTime.UtcNow - new DateTime(1970, 1, 1)).Ticks / 10000000; + } + } +} diff --git a/TJAPlayer3/Common/Easing.cs b/TJAPlayer3/Common/Easing.cs new file mode 100644 index 00000000..dc863fea --- /dev/null +++ b/TJAPlayer3/Common/Easing.cs @@ -0,0 +1,117 @@ +サソusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using TJAPlayer3; +using FDK; + +namespace TJAPlayer3 +{ + class Easing + { + public int EaseIn(CCounter counter, int startPoint, int endPoint, CalcType type) + { + StartPoint = startPoint; + EndPoint = endPoint; + Sa = EndPoint - StartPoint; + TimeMs = (int)counter.n邨ゆコ蛟、; + Type = type; + CounterValue = counter.n迴セ蝨ィ縺ョ蛟、; + + switch (Type) + { + case CalcType.Quadratic: //Quadratic + CounterValue /= TimeMs; + Value = Sa * CounterValue * CounterValue + StartPoint; + break; + case CalcType.Cubic: //Cubic + CounterValue /= TimeMs; + Value = Sa * CounterValue * CounterValue * CounterValue + StartPoint; + break; + case CalcType.Quartic: //Quartic + CounterValue /= TimeMs; + Value = Sa * CounterValue * CounterValue * CounterValue * CounterValue + StartPoint; + break; + case CalcType.Quintic: //Quintic + CounterValue /= TimeMs; + Value = Sa * CounterValue * CounterValue * CounterValue * CounterValue * CounterValue + StartPoint; + break; + case CalcType.Sinusoidal: //Sinusoidal + Value = -Sa * Math.Cos(CounterValue / TimeMs * (Math.PI / 2)) + Sa + StartPoint; + break; + case CalcType.Exponential: //Exponential + Value = Sa * Math.Pow(2, 10 * (CounterValue / TimeMs - 1)) + StartPoint; + break; + case CalcType.Circular: //Circular + CounterValue /= TimeMs; + Value = -Sa * (Math.Sqrt(1 - CounterValue * CounterValue) - 1) + StartPoint; + break; + } + + return (int)Value; + } + public int EaseOut(CCounter counter, int startPoint, int endPoint, CalcType type) + { + StartPoint = startPoint; + EndPoint = endPoint; + Sa = EndPoint - StartPoint; + TimeMs = (int)counter.n邨ゆコ蛟、; + Type = type; + CounterValue = counter.n迴セ蝨ィ縺ョ蛟、; + + switch (Type) + { + case CalcType.Quadratic: //Quadratic + CounterValue /= TimeMs; + Value = -Sa * CounterValue * (CounterValue - 2) + StartPoint; + break; + case CalcType.Cubic: //Cubic + CounterValue /= TimeMs; + CounterValue--; + Value = Sa * (CounterValue * CounterValue * CounterValue + 1) + StartPoint; + break; + case CalcType.Quartic: //Quartic + CounterValue /= TimeMs; + CounterValue--; + Value = -Sa * (CounterValue * CounterValue * CounterValue * CounterValue - 1) + StartPoint; + break; + case CalcType.Quintic: //Quintic + CounterValue /= TimeMs; + CounterValue--; + Value = Sa * (CounterValue * CounterValue * CounterValue * CounterValue * CounterValue + 1) + StartPoint; + break; + case CalcType.Sinusoidal: //Sinusoidal + Value = Sa * Math.Sin(CounterValue / TimeMs * (Math.PI / 2)) + StartPoint; + break; + case CalcType.Exponential: //Exponential + Value = Sa * (-Math.Pow(2, -10 * CounterValue / TimeMs) + 1) + StartPoint; + break; + case CalcType.Circular: //Circular + CounterValue /= TimeMs; + CounterValue--; + Value = Sa * Math.Sqrt(1 - CounterValue * CounterValue) + StartPoint; + break; + } + + return (int)Value; + } + + private int StartPoint; + private int EndPoint; + private int Sa; + private int TimeMs; + private CalcType Type; + private double CounterValue; + private double Value; + public enum CalcType + { + Quadratic, + Cubic, + Quartic, + Quintic, + Sinusoidal, + Exponential, + Circular + } + } +} \ No newline at end of file diff --git a/TJAPlayer3/Common/KeyboardSoundGroupLevelControlHandler.cs b/TJAPlayer3/Common/KeyboardSoundGroupLevelControlHandler.cs new file mode 100644 index 00000000..10c24063 --- /dev/null +++ b/TJAPlayer3/Common/KeyboardSoundGroupLevelControlHandler.cs @@ -0,0 +1,63 @@ +サソusing FDK; + +namespace TJAPlayer3 +{ + /// + /// KeyboardSoundGroupLevelControlHandler is called by the song selection + /// and song play stages when handling keyboard input. By delegating to + /// this class they are able to support a centrally-managed and consistent + /// set of keyboard shortcuts for dynamically adjusting four sound group + /// levels: + /// - sound effect level, via Ctrl and either of the Minus or Equals keys + /// - voice level, via Shift and either of the Minus or Equals keys + /// - song preview and song playback level, via the Minus or Equals key + /// + /// When the sound group levels are adjusted in this manner, the + /// SoundGroupLevelController (and handlers bound to its events) ensure + /// that both the sound object group levels are updated and the application + /// configuration is updated. See ConfigIniToSoundGroupLevelControllerBinder + /// for more details on the latter. + /// + internal static class KeyboardSoundGroupLevelControlHandler + { + internal static void Handle( + IInputDevice keyboard, + SoundGroupLevelController soundGroupLevelController, + CSkin skin, + bool isSongPreview) + { + var isAdjustmentPositive = keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.RightBracket); + if (!(isAdjustmentPositive || keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.LeftBracket))) + { + return; + } + + ESoundGroup soundGroup; + CSkin.C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 = null; + + if (keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧((int)SlimDXKeys.Key.LeftControl) || + keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧((int)SlimDXKeys.Key.RightControl)) + { + soundGroup = ESoundGroup.SoundEffect; + 繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 = skin.sound豎コ螳夐浹; + } + else if (keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧((int)SlimDXKeys.Key.LeftShift) || + keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧((int)SlimDXKeys.Key.RightShift)) + { + soundGroup = ESoundGroup.Voice; + 繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 = skin.sound繧イ繝シ繝髢句ァ矩浹; + } + else if (isSongPreview) + { + soundGroup = ESoundGroup.SongPlayback; + } + else + { + soundGroup = ESoundGroup.SongPlayback; + } + + soundGroupLevelController.AdjustLevel(soundGroup, isAdjustmentPositive); + 繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝?.t蜀咲函縺吶k(); + } + } +} diff --git a/TJAPlayer3/Common/NamePlateConfig.cs b/TJAPlayer3/Common/NamePlateConfig.cs new file mode 100644 index 00000000..bd26bf80 --- /dev/null +++ b/TJAPlayer3/Common/NamePlateConfig.cs @@ -0,0 +1,35 @@ +サソusing System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace TJAPlayer3 +{ + class NamePlateConfig + { + public void tNamePlateConfig() + { + if (!File.Exists("NamePlate.json")) + ConfigManager.SaveConfig(data, "NamePlate.json"); + + data = ConfigManager.GetConfig(@"NamePlate.json"); + } + + public class Data + { + public string[] Name = { "縺ゥ繧薙■繧繧", "縺九▲縺。繧繧" }; + public string[] Title = { "縺ゥ繧薙■繧繧薙〒縺吶hシ", "縺九▲縺。繧繧薙〒縺吶hシ" }; + public string[] Dan = { "驕比ココ", "驕比ココ" }; + + public bool[] DanGold = { false, true }; + + public int[] DanType = { 1, 2 }; + public int[] TitleType = { 1, 2 }; + } + + public Data data = new Data(); + } +} diff --git a/TJAPlayer3/Common/Program.cs b/TJAPlayer3/Common/Program.cs new file mode 100644 index 00000000..34237244 --- /dev/null +++ b/TJAPlayer3/Common/Program.cs @@ -0,0 +1,244 @@ +サソusing System; +using System.Collections.Generic; +using System.Globalization; +using System.Text; +using System.Runtime.InteropServices; +using System.Threading; +using System.Diagnostics; +using System.Windows.Forms; +using System.IO; +using FDK; +using System.Reflection; + +namespace TJAPlayer3 +{ + internal class Program + { + #region [ 莠碁崎オキ蜍輔メ繧ァ繝繧ッ縲.LL蟄伜惠繝√ぉ繝繧ッ ] + //----------------------------- + private static Mutex mutex莠碁崎オキ蜍暮亟豁「逕ィ; + + private static bool tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( string strDll蜷, string str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜曜p, string str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜容n, bool bLoadDllCheck ) + { + string str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜 = ( CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ja" ) ? + str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜曜p : str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜容n; + if ( bLoadDllCheck ) + { + IntPtr hModule = LoadLibrary( strDll蜷 ); // 螳滄圀縺ォLoadDll()縺励※繝√ぉ繝繧ッ縺吶k + if ( hModule == IntPtr.Zero ) + { + MessageBox.Show( str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜, "DTXMania runtime error", MessageBoxButtons.OK, MessageBoxIcon.Hand ); + return false; + } + FreeLibrary( hModule ); + } + else + { // 蜊倡エ斐↓繝輔ぃ繧、繝ォ縺ョ蟄伜惠譛臥┌繧偵メ繧ァ繝繧ッ縺吶k縺縺 (繝励Ο繧ク繧ァ繧ッ繝医〒縲悟盾辣ァ縲阪@縺ヲ縺縺溘j縲√い繝ウ繝槭ロ繝シ繧ク繝峨↑DLL縺梧囓鮟吶Μ繝ウ繧ッ縺輔l繧九b縺ョ縺ッ縺薙■繧) + string path = Path.Combine( System.IO.Directory.GetCurrentDirectory(), strDll蜷 ); + if ( !File.Exists( path ) ) + { + MessageBox.Show( str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜, "DTXMania runtime error", MessageBoxButtons.OK, MessageBoxIcon.Hand ); + return false; + } + } + return true; + } + private static bool tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( string strDll蜷, string str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜曜p, string str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜容n ) + { + return true; + //return tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( strDll蜷, str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜曜p, str蟄伜惠縺励↑縺縺ィ縺阪↓陦ィ遉コ縺吶k繧ィ繝ゥ繝シ譁蟄怜容n, false ); + } + + #region [DllImport] + [DllImport( "kernel32", CharSet = CharSet.Unicode, SetLastError = true )] + internal static extern void FreeLibrary( IntPtr hModule ); + + [DllImport( "kernel32", CharSet = CharSet.Unicode, SetLastError = true )] + internal static extern IntPtr LoadLibrary( string lpFileName ); + #endregion + //----------------------------- + #endregion + + [STAThread] + static void Main() + { + mutex莠碁崎オキ蜍暮亟豁「逕ィ = new Mutex( false, "DTXManiaMutex" ); + + if ( mutex莠碁崎オキ蜍暮亟豁「逕ィ.WaitOne( 0, false ) ) + { + string newLine = Environment.NewLine; + bool bDLLnotfound = false; + + Trace.WriteLine( "Current Directory: " + Environment.CurrentDirectory ); + Trace.WriteLine( "EXE縺ョ縺ゅk繝輔か繝ォ繝: " + Path.GetDirectoryName( Application.ExecutablePath ) ); + + Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; + + + #region [DLL縺ョ蟄伜惠繝√ぉ繝繧ッ] + if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\SlimDX" + TJAPlayer3.SLIMDXDLL + ".dll", + "SlimDX" + TJAPlayer3.SLIMDXDLL + ".dll 縺セ縺溘ッ縺昴ョ萓晏ュ倥☆繧掬ll縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲", + "SlimDX" + TJAPlayer3.SLIMDXDLL + ".dll, or its depended DLL, is not found." + newLine + "Please download DTXMania again." + ) ) bDLLnotfound = true; + if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\FDK.dll", + "FDK.dll 縺セ縺溘ッ縺昴ョ萓晏ュ倥☆繧掬ll縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲", + "FDK.dll, or its depended DLL, is not found." + newLine + "Please download DTXMania again." + ) ) bDLLnotfound = true; + if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\xadec.dll", + "xadec.dll 縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲", + "xadec.dll is not found." + newLine + "Please download DTXMania again." + ) ) bDLLnotfound = true; + if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\SoundDecoder.dll", + "SoundDecoder.dll 縺セ縺溘ッ縺昴ョ萓晏ュ倥☆繧掬ll縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲", + "SoundDecoder.dll, or its depended DLL, is not found." + newLine + "Please download DTXMania again." + ) ) bDLLnotfound = true; + if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( TJAPlayer3.D3DXDLL, + TJAPlayer3.D3DXDLL + " 縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DirectX Redist 繝輔か繝ォ繝縺ョ DXSETUP.exe 繧貞ョ溯。後@縲" + newLine + "蠢隕√↑ DirectX 繝ゥ繝ウ繧ソ繧、繝繧偵う繝ウ繧ケ繝医シ繝ォ縺励※縺上□縺輔>縲", + TJAPlayer3.D3DXDLL + " is not found." + newLine + "Please execute DXSETUP.exe in \"DirectX Redist\" folder, to install DirectX runtimes required for DTXMania.", + true + ) ) bDLLnotfound = true; + if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\bass.dll", + "bass.dll 縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲", + "baas.dll is not found." + newLine + "Please download DTXMania again." + ) ) bDLLnotfound = true; + if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\Bass.Net.dll", + "Bass.Net.dll 縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲", + "Bass.Net.dll is not found." + newLine + "Please download DTXMania again." + ) ) bDLLnotfound = true; + if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\bassmix.dll", + "bassmix.dll 繧定ェュ縺ソ霎シ繧√∪縺帙s縲Cassmix.dll 縺 bass.dll 縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲", + "bassmix.dll is not loaded. bassmix.dll or bass.dll must not exist." + newLine + "Please download DTXMania again." + ) ) bDLLnotfound = true; + if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\bassasio.dll", + "bassasio.dll 繧定ェュ縺ソ霎シ繧√∪縺帙s縲Cassasio.dll 縺 bass.dll 縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲", + "bassasio.dll is not loaded. bassasio.dll or bass.dll must not exist." + newLine + "Please download DTXMania again." + ) ) bDLLnotfound = true; + if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\basswasapi.dll", + "basswasapi.dll 繧定ェュ縺ソ霎シ繧√∪縺帙s縲Casswasapi.dll 縺 bass.dll 縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲", + "basswasapi.dll is not loaded. basswasapi.dll or bass.dll must not exist." + newLine + "Please download DTXMania again." + ) ) bDLLnotfound = true; + if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\bass_fx.dll", + "bass_fx.dll 繧定ェュ縺ソ霎シ繧√∪縺帙s縲Cass_fx.dll 縺 bass.dll 縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲", + "bass_fx.dll is not loaded. bass_fx.dll or bass.dll must not exist." + newLine + "Please download DTXMania again." + ) ) bDLLnotfound = true; + if ( !tDLL縺ョ蟄伜惠繝√ぉ繝繧ッ( "dll\\DirectShowLib-2005.dll", + "DirectShowLib-2005.dll 縺悟ュ伜惠縺励∪縺帙s縲" + newLine + "DTXMania繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ェ縺翫@縺ヲ縺上□縺輔>縲", + "DirectShowLib-2005.dll is not found." + newLine + "Please download DTXMania again." + ) ) bDLLnotfound = true; + #endregion + if ( !bDLLnotfound ) + { +#if DEBUG && TEST_ENGLISH + Thread.CurrentThread.CurrentCulture = new CultureInfo( "en-US" ); +#endif + + DWM.EnableComposition( false ); // Disable AeroGrass temporally + + // BEGIN #23670 2010.11.13 from: 繧ュ繝」繝繝√&繧後↑縺萓句、悶ッ謾セ蜃コ縺帙★縺ォ縲√Ο繧ー縺ォ隧ウ邏ー繧貞コ蜉帙☆繧九 + // BEGIM #24606 2011.03.08 from: DEBUG 譎ゅッ萓句、也匱逕溽ョ謇繧堤峩謗・繝繝舌ャ繧ー縺ァ縺阪k繧医≧縺ォ縺吶k縺溘a縲∽セ句、悶r繧ュ繝」繝繝√@縺ェ縺繧医≧縺ォ縺吶k縲 +#if !DEBUG + try +#endif + { + using ( var mania = new TJAPlayer3() ) + mania.Run(); + + Trace.WriteLine( "" ); + Trace.WriteLine( "驕翫s縺ァ縺上l縺ヲ縺ゅj縺後→縺シ" ); + } +#if !DEBUG + catch( Exception e ) + { + Trace.WriteLine( "" ); + Trace.Write( e.ToString() ); + Trace.WriteLine( "" ); + Trace.WriteLine( "繧ィ繝ゥ繝シ縺繧エ繝。繝ウシシ域カ" ); + AssemblyName asmApp = Assembly.GetExecutingAssembly().GetName(); + MessageBox.Show( "繧ィ繝ゥ繝シ縺檎匱逕溘@縺セ縺励◆縲\n" + + e.ToString(), asmApp.Name + " Ver." + asmApp.Version.ToString().Substring(0, asmApp.Version.ToString().Length - 2) + " Error", MessageBoxButtons.OK, MessageBoxIcon.Error ); // #23670 2011.2.28 yyagi to show error dialog + } +#endif + // END #24606 2011.03.08 from + // END #23670 2010.11.13 from + + if ( Trace.Listeners.Count > 1 ) + Trace.Listeners.RemoveAt( 1 ); + } + + // BEGIN #24615 2011.03.09 from: Mutex.WaitOne() 縺 true 繧定ソ斐@縺溷エ蜷医ッ縲`utex 縺ョ繝ェ繝ェ繝シ繧ケ縺悟ソ隕√〒縺ゅk縲 + + mutex莠碁崎オキ蜍暮亟豁「逕ィ.ReleaseMutex(); + mutex莠碁崎オキ蜍暮亟豁「逕ィ = null; + + // END #24615 2011.03.09 from + } + else // DTXMania縺梧里縺ォ襍キ蜍穂クュ + { + + // 竊 蠑墓焚縺0蛟九ョ譎ゅッ縺昴ョ縺セ縺セ邨ゆコ + // 1蛟( 繧ウ繝ウ繝代け繝医Δ繝シ繝 or DTXV -S) 縺2蛟 (DTXV -Nxxx 繝輔ぃ繧、繝ォ蜷)縺ョ縺ィ縺阪ッ縲√◎縺ョ繝励Ο繧サ繧ケ縺ォ繧ウ繝槭Φ繝峨Λ繧、繝ウ繧剃クク縲謚輔£縺ヲ邨ゆコ縺吶k + + for ( int i = 0; i < 5; i++ ) // 讀懃エ「邨先棡縺ョ繝上Φ繝峨Ν縺兄ero縺ォ縺ェ繧九%縺ィ縺後≠繧九ョ縺ァ縲200ms髢馴囈縺ァ5蝗槭Μ繝医Λ繧、縺吶k + { + #region [ 譌「縺ォ襍キ蜍穂クュ縺ョDTXMania繝励Ο繧サ繧ケ繧呈、懃エ「縺吶k縲] + // 縺薙ョ繧繧頑婿縺縺ィ縲ヾhowInTaskbar=false縺ァ繧ソ繧ケ繧ッ繝舌シ縺ォ陦ィ遉コ縺輔l縺ェ縺繝代ち繝シ繝ウ縺ョ譎ゅ↓讀懃エ「縺ォ螟ア謨励☆繧九h縺縺縺 + // DTXMania縺ァ縺昴ョ繝代ち繝シ繝ウ縺ッ縺ェ縺シ溘ョ縺ァ縺薙ョ縺セ縺セ縺縺上 + // FindWindow繧剃スソ縺医ー縺薙ョ繝代ち繝シ繝ウ縺ォ繧ょッセ蠢懊〒縺阪k縺後,#縺ァ繝薙Ν繝峨☆繧九い繝励Μ縺ッ繧ヲ繧、繝ウ繝峨え繧ッ繝ゥ繧ケ蜷阪r閾ェ蜑肴欠螳壹〒縺阪↑縺縺ョ縺ァ縲√%繧後ッ菴ソ繧上↑縺縲 + + Process current = Process.GetCurrentProcess(); + Process[] running = Process.GetProcessesByName( current.ProcessName ); + Process target = null; + //IntPtr hWnd = FindWindow( null, "DTXMania .NET style release " + CDTXMania.VERSION ); + + foreach ( Process p in running ) + { + if ( p.Id != current.Id ) // 繝励Ο繧サ繧ケ蜷阪ッ蜷後§縺ァ縺九▽縲√励Ο繧サ繧ケID縺瑚ェ蛻閾ェ霄ォ縺ィ縺ッ逡ー縺ェ繧九b縺ョ繧呈爾縺 + { + if ( p.MainModule.FileName == current.MainModule.FileName && p.MainWindowHandle != IntPtr.Zero ) + { + target = p; + break; + } + } + } + #endregion + + #region [ 襍キ蜍穂クュ縺ョDTXMania縺後>繧後ー縲√◎縺ョ繝励Ο繧サ繧ケ縺ォ繧ウ繝槭Φ繝峨Λ繧、繝ウ繧呈兜縺偵k ] + if ( target != null ) + { + string[] commandLineArgs = Environment.GetCommandLineArgs(); + if ( commandLineArgs != null && commandLineArgs.Length > 1 ) + { + string arg = null; + for ( int j = 1; j < commandLineArgs.Length; j++ ) + { + if ( j == 1 ) + { + arg += commandLineArgs[ j ]; + } + else + { + arg += " " + "\"" + commandLineArgs[ j ] + "\""; + } + } + +//Trace.TraceInformation( "Message=" + arg + ", len(w/o null)=" + arg.Length ); + + if ( arg != null ) + { + FDK.CSendMessage.sendmessage( target.MainWindowHandle, current.MainWindowHandle, arg ); + } + } + break; + } + #endregion + else + { + Trace.TraceInformation( "繝。繝繧サ繝シ繧ク騾∽ソ。蜈医ョ繝励Ο繧サ繧ケ縺瑚ヲ九▽縺九i縺壹5蝗槭Μ繝医Λ繧、縺励∪縺吶" ); + Thread.Sleep( 200 ); + } + } + } + } + } +} diff --git a/TJAPlayer3/Common/TJAPlayer3.cs b/TJAPlayer3/Common/TJAPlayer3.cs new file mode 100644 index 00000000..628cbefd --- /dev/null +++ b/TJAPlayer3/Common/TJAPlayer3.cs @@ -0,0 +1,2990 @@ +サソusing System; +using System.Collections.Generic; +using System.Globalization; +using System.Text; +using System.Windows.Forms; +using System.Drawing; +using System.Diagnostics; +using System.IO; +using System.Threading; +using System.Net.NetworkInformation; +using System.Runtime.Serialization.Formatters.Binary; +using SlimDX; +using SlimDX.Direct3D9; +using FDK; +using SampleFramework; +using System.Reflection; +using System.Threading.Tasks; +using System.Linq; + +namespace TJAPlayer3 +{ + internal class TJAPlayer3 : Game + { + // 繝励Ο繝代ユ繧」 + #region [ properties ] + public static readonly string VERSION = Assembly.GetExecutingAssembly().GetName().Version.ToString().Substring(0, Assembly.GetExecutingAssembly().GetName().Version.ToString().Length - 2); + public static readonly string AppDisplayThreePartVersion = GetAppDisplayThreePartVersion(); + public static readonly string AppNumericThreePartVersion = GetAppNumericThreePartVersion(); + + private static string GetAppDisplayThreePartVersion() + { + return $"v{GetAppNumericThreePartVersion()}"; + } + + private static string GetAppNumericThreePartVersion() + { + var version = Assembly.GetExecutingAssembly().GetName().Version; + + return $"{version.Major}.{version.Minor}.{version.Build}"; + } + + public static readonly string AppInformationalVersion = + Assembly + .GetExecutingAssembly() + .GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false) + .Cast() + .FirstOrDefault() + ?.InformationalVersion + ?? $"{GetAppDisplayThreePartVersion()} (unknown informational version)"; + public static readonly string SLIMDXDLL = "c_net20x86_Jun2010"; + public static readonly string D3DXDLL = "d3dx9_43.dll"; // June 2010 + //public static readonly string D3DXDLL = "d3dx9_42.dll"; // February 2010 + //public static readonly string D3DXDLL = "d3dx9_41.dll"; // March 2009 + + public static TJAPlayer3 app + { + get; + private set; + } + public static C譁蟄励さ繝ウ繧ス繝シ繝ォ act譁蟄励さ繝ウ繧ス繝シ繝ォ + { + get; + private set; + } + public static bool b繧ウ繝ウ繝代け繝医Δ繝シ繝 + { + get; + private set; + } + public static CConfigIni ConfigIni + { + get; + private set; + } + public static CDTX DTX + { + get + { + return dtx[ 0 ]; + } + set + { + if( ( dtx[ 0 ] != null ) && ( app != null ) ) + { + dtx[ 0 ].On髱樊エサ諤ァ蛹(); + app.list繝医ャ繝励Ξ繝吶ΝActivities.Remove( dtx[ 0 ] ); + } + dtx[ 0 ] = value; + if( ( dtx[ 0 ] != null ) && ( app != null ) ) + { + app.list繝医ャ繝励Ξ繝吶ΝActivities.Add( dtx[ 0 ] ); + } + } + } + public static CDTX DTX_2P + { + get + { + return dtx[ 1 ]; + } + set + { + if( ( dtx[ 1 ] != null ) && ( app != null ) ) + { + dtx[ 1 ].On髱樊エサ諤ァ蛹(); + app.list繝医ャ繝励Ξ繝吶ΝActivities.Remove( dtx[ 1 ] ); + } + dtx[ 1 ] = value; + if( ( dtx[ 1 ] != null ) && ( app != null ) ) + { + app.list繝医ャ繝励Ξ繝吶ΝActivities.Add( dtx[ 1 ] ); + } + } + } + + public static bool IsPerformingCalibration; + + public static CFPS FPS + { + get; + private set; + } + public static CInput邂。逅 Input邂。逅 + { + get; + private set; + } + #region [ 蜈・蜉帷ッ蝗イms ] + public static int nPerfect遽蝗イms + { + get + { + if( stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ != null ) + { + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 = stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.r隕ェ繝弱シ繝; + if( ( ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝 != null ) && ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) ) && ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nPerfect遽蝗イms >= 0 ) ) + { + return c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nPerfect遽蝗イms; + } + } + return ConfigIni.n繝偵ャ繝育ッ蝗イms.Perfect; + } + } + public static int nGreat遽蝗イms + { + get + { + if( stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ != null ) + { + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 = stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.r隕ェ繝弱シ繝; + if( ( ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝 != null ) && ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) ) && ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nGreat遽蝗イms >= 0 ) ) + { + return c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nGreat遽蝗イms; + } + } + return ConfigIni.n繝偵ャ繝育ッ蝗イms.Great; + } + } + public static int nGood遽蝗イms + { + get + { + if( stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ != null ) + { + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 = stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.r隕ェ繝弱シ繝; + if( ( ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝 != null ) && ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) ) && ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nGood遽蝗イms >= 0 ) ) + { + return c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nGood遽蝗イms; + } + } + return ConfigIni.n繝偵ャ繝育ッ蝗イms.Good; + } + } + public static int nPoor遽蝗イms + { + get + { + if( stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ != null ) + { + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 = stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.r隕ェ繝弱シ繝; + if( ( ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝 != null ) && ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) ) && ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nPoor遽蝗イms >= 0 ) ) + { + return c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nPoor遽蝗イms; + } + } + return ConfigIni.n繝偵ャ繝育ッ蝗イms.Poor; + } + } + #endregion + public static CPad Pad + { + get; + private set; + } + public static Random Random + { + get; + private set; + } + public static CSkin Skin + { + get; + private set; + } + public static CSongs邂。逅 Songs邂。逅 + { + get; + set; // 2012.1.26 yyagi private隗」髯、 CStage襍キ蜍輔〒縺ョdesirialize隱ュ縺ソ霎シ縺ソ縺ョ縺溘a + } + public static CEnumSongs EnumSongs + { + get; + private set; + } + public static CActEnumSongs actEnumSongs + { + get; + private set; + } + public static CActScanningLoudness actScanningLoudness + { + get; + private set; + } + public static CActFlushGPU actFlushGPU + { + get; + private set; + } + + public static CSound邂。逅 Sound邂。逅 + { + get; + private set; + } + + public static SongGainController SongGainController + { + get; + private set; + } + + public static SoundGroupLevelController SoundGroupLevelController + { + get; + private set; + } + + public static CNamePlate NamePlate + { + get; + private set; + } + + public static NamePlateConfig NamePlateConfig + { + get; + private set; + } + + public static CStage襍キ蜍 stage襍キ蜍 + { + get; + private set; + } + public static CStage繧ソ繧、繝医Ν stage繧ソ繧、繝医Ν + { + get; + private set; + } +// public static CStage繧ェ繝励す繝ァ繝ウ stage繧ェ繝励す繝ァ繝ウ +// { +// get; +// private set; +// } + public static CStage繧ウ繝ウ繝輔ぅ繧ー stage繧ウ繝ウ繝輔ぅ繧ー + { + get; + private set; + } + public static CStage驕ク譖イ stage驕ク譖イ + { + get; + private set; + } + public static CStage谿オ菴埼∈謚 stage谿オ菴埼∈謚 + { + get; + private set; + } + public static CStage譖イ隱ュ縺ソ霎シ縺ソ stage譖イ隱ュ縺ソ霎シ縺ソ + { + get; + private set; + } + public static CStage貍泌・上ラ繝ゥ繝逕サ髱「 stage貍泌・上ラ繝ゥ繝逕サ髱「 + { + get; + private set; + } + public static CStage邨先棡 stage邨先棡 + { + get; + private set; + } + public static CStageChangeSkin stageChangeSkin + { + get; + private set; + } + public static CStage邨ゆコ stage邨ゆコ + { + get; + private set; + } + public static CStage r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = null; + public static CStage r逶エ蜑阪ョ繧ケ繝繝シ繧ク = null; + public static string strEXE縺ョ縺ゅk繝輔か繝ォ繝 + { + get; + private set; + } + public static string str繧ウ繝ウ繝代け繝医Δ繝シ繝峨ヵ繧。繧、繝ォ + { + get; + private set; + } + public static CTimer Timer + { + get; + private set; + } + public static Format TextureFormat = Format.A8R8G8B8; + internal static IPluginActivity act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ = null; + public bool bApplicationActive + { + get; + private set; + } + public bool b谺。縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蝙ら峩蟶ー邱壼酔譛溷繧頑崛縺医r陦後≧ + { + get; + set; + } + public bool b谺。縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蜈ィ逕サ髱「_繧ヲ繧」繝ウ繝峨え蛻繧頑崛縺医r陦後≧ + { + get; + set; + } + public DeviceCache Device + { + get { return base.GraphicsDeviceManager.Direct3D9.Device; } + } + public CPluginHost PluginHost + { + get; + private set; + } + public List list繝励Λ繧ー繧、繝ウ = new List(); + public struct STPlugin + { + public IPluginActivity plugin; + public string str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝; + public string str繧「繧サ繝ウ繝悶Μ邁。譏灘錐; + public Version Version; + } + private static Size currentClientSize // #23510 2010.10.27 add yyagi to keep current window size + { + get; + set; + } + // public static CTimer ct; + public IntPtr WindowHandle // 2012.10.24 yyagi; to add ASIO support + { + get { return base.Window.Handle; } + } + public static CDTXVmode DTXVmode // #28821 2014.1.23 yyagi + { + get; + set; + } + + #endregion + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public TJAPlayer3() + { + TJAPlayer3.app = this; + this.t襍キ蜍募ヲ逅(); + } + + + // 繝。繧ス繝繝 + + public void t蜈ィ逕サ髱「_繧ヲ繧」繝ウ繝峨え繝「繝シ繝牙繧頑崛縺() + { +#if WindowedFullscreen + if ( ConfigIni != null ) +#else + DeviceSettings settings = base.GraphicsDeviceManager.CurrentSettings.Clone(); + if ( ( ConfigIni != null ) && ( ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝 != settings.Windowed ) ) +#endif + { +#if !WindowedFullscreen + settings.Windowed = ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝; +#endif + if ( ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝 == false ) // #23510 2010.10.27 yyagi: backup current window size before going fullscreen mode + { + currentClientSize = this.Window.ClientSize; + ConfigIni.n繧ヲ繧、繝ウ繝峨えwidth = this.Window.ClientSize.Width; + ConfigIni.n繧ヲ繧、繝ウ繝峨えheight = this.Window.ClientSize.Height; +// FDK.CTaskBar.ShowTaskBar( false ); + } +#if !WindowedFullscreen + base.GraphicsDeviceManager.ChangeDevice( settings ); +#endif + if ( ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝 == true ) // #23510 2010.10.27 yyagi: to resume window size from backuped value + { +#if WindowedFullscreen + // #30666 2013.2.2 yyagi Don't use Fullscreen mode becasue NVIDIA GeForce is + // tend to delay drawing on Fullscreen mode. So DTXMania uses Maximized window + // in spite of using fullscreen mode. + app.Window.WindowState = FormWindowState.Normal; + app.Window.FormBorderStyle = FormBorderStyle.Sizable; + app.Window.WindowState = FormWindowState.Normal; +#endif + base.Window.ClientSize = + new Size( currentClientSize.Width, currentClientSize.Height ); + base.Window.Icon = Properties.Resources.tjap3; +// FDK.CTaskBar.ShowTaskBar( true ); + } +#if WindowedFullscreen + else + { + app.Window.WindowState = FormWindowState.Normal; + app.Window.FormBorderStyle = FormBorderStyle.None; + app.Window.WindowState = FormWindowState.Maximized; + } + if ( ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝 ) + { + if ( !this.b繝槭え繧ケ繧ォ繝シ繧ス繝ォ陦ィ遉コ荳ュ ) + { + Cursor.Show(); + this.b繝槭え繧ケ繧ォ繝シ繧ス繝ォ陦ィ遉コ荳ュ = true; + } + } + else if ( this.b繝槭え繧ケ繧ォ繝シ繧ス繝ォ陦ィ遉コ荳ュ ) + { + Cursor.Hide(); + this.b繝槭え繧ケ繧ォ繝シ繧ス繝ォ陦ィ遉コ荳ュ = false; + } +#endif + } + } + + #region [ #24609 繝ェ繧カ繝ォ繝育判蜒上rpng縺ァ菫晏ュ倥☆繧 ] // #24609 2011.3.14 yyagi; to save result screen in case BestRank or HiSkill. + /// + /// 繝ェ繧カ繝ォ繝育判蜒上ョ繧ュ繝」繝励メ繝」縺ィ菫晏ュ倥 + /// + /// 菫晏ュ倥☆繧九ヵ繧。繧、繝ォ蜷(繝輔Ν繝代せ) + public bool SaveResultScreen( string strFullPath ) + { + string strSavePath = Path.GetDirectoryName( strFullPath ); + if ( !Directory.Exists( strSavePath ) ) + { + try + { + Directory.CreateDirectory( strSavePath ); + } + catch + { + Trace.TraceError(ToString()); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (0bfe6bff-2a56-4df4-9333-2df26d9b765b)" ); + return false; + } + } + + // http://www.gamedev.net/topic/594369-dx9slimdxati-incorrect-saving-surface-to-file/ + using ( Surface pSurface = TJAPlayer3.app.Device.GetRenderTarget( 0 ) ) + { + Surface.ToFile( pSurface, strFullPath, ImageFileFormat.Png ); + } + return true; + } + #endregion + + // Game 螳溯」 + + protected override void Initialize() + { +// new GCBeep(); + //sw.Start(); + //swlist1 = new List( 8192 ); + //swlist2 = new List( 8192 ); + //swlist3 = new List( 8192 ); + //swlist4 = new List( 8192 ); + //swlist5 = new List( 8192 ); + if ( this.list繝医ャ繝励Ξ繝吶ΝActivities != null ) + { + foreach( CActivity activity in this.list繝医ャ繝励Ξ繝吶ΝActivities ) + activity.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + + foreach( STPlugin st in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( st.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + st.plugin.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } +#if GPUFlushAfterPresent + FrameEnd += dtxmania_FrameEnd; +#endif + } +#if GPUFlushAfterPresent + void dtxmania_FrameEnd( object sender, EventArgs e ) // GraphicsDeviceManager.game_FrameEnd()蠕後↓螳溯。後&繧後k + { // 竊 Present()逶エ蠕後↓GPU繧巽lush縺吶k + // 竊 逕サ髱「縺ョ繧ォ繧ッ繝繧ュ縺碁サ逋コ縺励◆縺溘a縲√%縺薙〒縺ョFlush縺ッ陦後o縺ェ縺 + actFlushGPU.On騾イ陦梧緒逕サ(); // Flush GPU + } +#endif + protected override void LoadContent() + { + if ( ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝 ) + { + if( !this.b繝槭え繧ケ繧ォ繝シ繧ス繝ォ陦ィ遉コ荳ュ ) + { + Cursor.Show(); + this.b繝槭え繧ケ繧ォ繝シ繧ス繝ォ陦ィ遉コ荳ュ = true; + } + } + else if( this.b繝槭え繧ケ繧ォ繝シ繧ス繝ォ陦ィ遉コ荳ュ ) + { + Cursor.Hide(); + this.b繝槭え繧ケ繧ォ繝シ繧ス繝ォ陦ィ遉コ荳ュ = false; + } + 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))); + this.Device.SetTransform(TransformState.Projection, Matrix.PerspectiveFovLH(C螟画鋤.DegreeToRadian((float)60f), ((float)this.Device.Viewport.Width) / ((float)this.Device.Viewport.Height), -100f, 100f)); + this.Device.SetRenderState(RenderState.Lighting, false); + this.Device.SetRenderState( RenderState.ZEnable, false ); + this.Device.SetRenderState( RenderState.AntialiasedLineEnable, false ); + this.Device.SetRenderState( RenderState.AlphaTestEnable, true ); + this.Device.SetRenderState( RenderState.AlphaRef, 10 ); + + this.Device.SetRenderState( RenderState.MultisampleAntialias, true ); + this.Device.SetSamplerState( 0, SamplerState.MinFilter, TextureFilter.Linear ); + this.Device.SetSamplerState( 0, SamplerState.MagFilter, TextureFilter.Linear ); + + this.Device.SetRenderState( RenderState.AlphaFunc, Compare.Greater ); + this.Device.SetRenderState( RenderState.AlphaBlendEnable, true ); + this.Device.SetRenderState( RenderState.SourceBlend, Blend.SourceAlpha ); + this.Device.SetRenderState( RenderState.DestinationBlend, Blend.InverseSourceAlpha ); + this.Device.SetTextureStageState( 0, TextureStage.AlphaOperation, TextureOperation.Modulate ); + this.Device.SetTextureStageState( 0, TextureStage.AlphaArg1, 2 ); + this.Device.SetTextureStageState( 0, TextureStage.AlphaArg2, 1 ); + + if( this.list繝医ャ繝励Ξ繝吶ΝActivities != null ) + { + foreach( CActivity activity in this.list繝医ャ繝励Ξ繝吶ΝActivities ) + activity.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + + foreach( STPlugin st in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( st.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + st.plugin.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + } + protected override void UnloadContent() + { + if( this.list繝医ャ繝励Ξ繝吶ΝActivities != null ) + { + foreach( CActivity activity in this.list繝医ャ繝励Ξ繝吶ΝActivities ) + activity.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + foreach( STPlugin st in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( st.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + st.plugin.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + } + protected override void OnExiting( EventArgs e ) + { + CPowerManagement.tEnableMonitorSuspend(); // 繧ケ繝ェ繝シ繝玲椛豁「迥カ諷九r隗」髯、 + this.t邨ゆコ蜃ヲ逅(); + base.OnExiting( e ); + } + protected override void Update( GameTime gameTime ) + { + } + protected override void Draw( GameTime gameTime ) + { + Sound邂。逅?.t蜀咲函荳ュ縺ョ蜃ヲ逅繧偵☆繧(); + Timer?.t譖エ譁ー(); + CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝?.t譖エ譁ー(); + Input邂。逅?.t繝昴シ繝ェ繝ウ繧ー( this.bApplicationActive, TJAPlayer3.ConfigIni.b繝舌ャ繝輔ぃ蜈・蜉帙r陦後≧ ); + FPS?.t繧ォ繧ヲ繝ウ繧ソ譖エ譁ー(); + + if( this.Device == null ) + return; + + if ( this.bApplicationActive ) // DTXMania譛ャ菴楢オキ蜍穂クュ縺ョ譛ャ菴/繝「繝九ち縺ョ逵髮サ蜉帙Δ繝シ繝臥ァサ陦後r謚第ュ「 + CPowerManagement.tDisableMonitorSuspend(); + + // #xxxxx 2013.4.8 yyagi; sleep縺ョ謖ソ蜈・菴咲スョ繧偵・ndScneneス霸resent髢薙°繧峨。eginScene蜑阪↓遘サ蜍輔よ緒逕サ驕蟒カ繧貞ー上&縺上☆繧九◆繧√ + #region [ 繧ケ繝ェ繝シ繝 ] + if ( ConfigIni.n繝輔Ξ繝シ繝豈弱せ繝ェ繝シ繝洋s >= 0 ) // #xxxxx 2011.11.27 yyagi + { + Thread.Sleep( ConfigIni.n繝輔Ξ繝シ繝豈弱せ繝ェ繝シ繝洋s ); + } + #endregion + + #region [ DTXCreator縺九i縺ョ謖遉コ ] + if ( this.Window.IsReceivedMessage ) // 繧ヲ繧、繝ウ繝峨え繝。繝繧サ繝シ繧ク縺ァ縲 + { + string strMes = this.Window.strMessage; + this.Window.IsReceivedMessage = false; + + if ( strMes != null ) + { + DTXVmode.ParseArguments( strMes ); + + if ( DTXVmode.Enabled ) + { + b繧ウ繝ウ繝代け繝医Δ繝シ繝 = true; + str繧ウ繝ウ繝代け繝医Δ繝シ繝峨ヵ繧。繧、繝ォ = DTXVmode.filename; + if ( DTXVmode.Command == CDTXVmode.ECommand.Preview ) + { + // preview sound縺ョ蜀咲函 + string strPreviewFilename = DTXVmode.previewFilename; +//Trace.TraceInformation( "Preview Filename=" + DTXVmode.previewFilename ); + try + { + if ( this.previewSound != null ) + { + this.previewSound.t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺吶k(); + this.previewSound.Dispose(); + this.previewSound = null; + } + this.previewSound = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧( strPreviewFilename, ESoundGroup.SongPlayback ); + + // 2018-08-23 twopointzero: DTXVmode previewVolume will always set + // Gain since in this mode it should override the application of + // SONGVOL or any other Gain source regardless of configuration. + this.previewSound.SetGain(DTXVmode.previewVolume); + + this.previewSound.n菴咲スョ = DTXVmode.previewPan; + this.previewSound.t蜀咲函繧帝幕蟋九☆繧(); + Trace.TraceInformation( "DTXC縺九i縺ョ謖遉コ縺ァ縲√し繧ヲ繝ウ繝峨r逕滓舌@縺セ縺励◆縲({0})", strPreviewFilename ); + } + catch + { + Trace.TraceError(ToString()); + Trace.TraceError( "DTXC縺九i縺ョ謖遉コ縺ァ縺ョ縲√し繧ヲ繝ウ繝峨ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲({0})", strPreviewFilename ); + if ( this.previewSound != null ) + { + this.previewSound.Dispose(); + } + this.previewSound = null; + } + } + } + } + } + #endregion + + this.Device.BeginScene(); + this.Device.Clear( ClearFlags.ZBuffer | ClearFlags.Target, Color.Black, 1f, 0 ); + + if( r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク != null ) + { + this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 = ( r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク != null ) ? r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On騾イ陦梧緒逕サ() : 0; + + #region [ 繝励Λ繧ー繧、繝ウ縺ョ騾イ陦梧緒逕サ ] + //--------------------- + foreach( STPlugin sp in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( sp.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + + if( TJAPlayer3.act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ == null || TJAPlayer3.act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ == sp.plugin ) + sp.plugin.On騾イ陦梧緒逕サ(TJAPlayer3.Pad, TJAPlayer3.Input邂。逅.Keyboard ); + else + sp.plugin.On騾イ陦梧緒逕サ( null, null ); + + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + //--------------------- + #endregion + + + CScoreIni scoreIni = null; + + if ( Control.IsKeyLocked( Keys.CapsLock ) ) // #30925 2013.3.11 yyagi; capslock=ON譎ゅッ縲・numSongs縺励↑縺繧医≧縺ォ縺励※縲∬オキ蜍戊イ闕キ縺ィASIO縺ョ髻ウ蛻繧後ョ髢「菫ゅr遒コ隱阪☆繧 + { // 竊 songs.db遲峨ョ譖ク縺崎セシ縺ソ譎ゅ□縺ィ髻ウ蛻繧後☆繧九▲縺ス縺 + actEnumSongs.On髱樊エサ諤ァ蛹(); + EnumSongs.SongListEnumCompletelyDone(); + TJAPlayer3.stage驕ク譖イ.bIsEnumeratingSongs = false; + } + #region [ 譖イ讀懃エ「繧ケ繝ャ繝繝峨ョ襍キ蜍/邨ゆコ ] // 縺薙%縺ォ"Enumerating Songs..."陦ィ遉コ繧帝寔邏 + if ( !TJAPlayer3.b繧ウ繝ウ繝代け繝医Δ繝シ繝 ) + { + actEnumSongs.On騾イ陦梧緒逕サ(); // "Enumerating Songs..."繧「繧、繧ウ繝ウ縺ョ謠冗判 + } + switch ( r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID ) + { + case CStage.E繧ケ繝繝シ繧ク.繧ソ繧、繝医Ν: + case CStage.E繧ケ繝繝シ繧ク.繧ウ繝ウ繝輔ぅ繧ー: + case CStage.E繧ケ繝繝シ繧ク.驕ク譖イ: + case CStage.E繧ケ繝繝シ繧ク.譖イ隱ュ縺ソ霎シ縺ソ: + if ( EnumSongs != null ) + { + #region [ (迚ケ螳壽擅莉カ譎) 譖イ讀懃エ「繧ケ繝ャ繝繝峨ョ襍キ蜍廟髢句ァ ] + if ( r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID == CStage.E繧ケ繝繝シ繧ク.繧ソ繧、繝医Ν && + r逶エ蜑阪ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID == CStage.E繧ケ繝繝シ繧ク.襍キ蜍 && + this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 == (int) CStage繧ソ繧、繝医Ν.E謌サ繧雁、.邯咏カ && + !EnumSongs.IsSongListEnumStarted ) + { + actEnumSongs.On豢サ諤ァ蛹(); + TJAPlayer3.stage驕ク譖イ.bIsEnumeratingSongs = true; + EnumSongs.Init(); // 蜿門セ励@縺滓峇謨ー繧偵∵眠繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ォ繧ゆク弱∴繧 + EnumSongs.StartEnumFromDisk(); // 譖イ讀懃エ「繧ケ繝ャ繝繝峨ョ襍キ蜍廟髢句ァ + } + #endregion + + #region [ 譖イ讀懃エ「縺ョ荳ュ譁ュ縺ィ蜀埼幕 ] + if ( r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID == CStage.E繧ケ繝繝シ繧ク.驕ク譖イ && !EnumSongs.IsSongListEnumCompletelyDone ) + { + switch ( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 ) + { + case 0: // 菴輔b縺ェ縺 + //if ( CDTXMania.stage驕ク譖イ.bIsEnumeratingSongs ) + if ( !TJAPlayer3.stage驕ク譖イ.bIsPlayingPremovie ) + { + EnumSongs.Resume(); // #27060 2012.2.6 yyagi 荳ュ豁「縺励※縺縺溘ヰ繝繧ッ繧ー繝ゥ繝ウ繝画峇讀懃エ「繧貞埼幕 + EnumSongs.IsSlowdown = false; + } + else + { + // EnumSongs.Suspend(); // #27060 2012.3.2 yyagi #PREMOVIE蜀咲函荳ュ縺ッ譖イ讀懃エ「繧剃ス朱溷喧 + EnumSongs.IsSlowdown = true; + } + actEnumSongs.On豢サ諤ァ蛹(); + break; + + case 2: // 譖イ豎コ螳 + EnumSongs.Suspend(); // #27060 繝舌ャ繧ッ繧ー繝ゥ繧ヲ繝ウ繝峨ョ譖イ讀懃エ「繧剃ク譎ょ●豁「 + actEnumSongs.On髱樊エサ諤ァ蛹(); + break; + } + } + #endregion + + #region [ 譖イ謗「邏「荳ュ譁ュ蠕縺。蠕讖 ] + if ( r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID == CStage.E繧ケ繝繝シ繧ク.譖イ隱ュ縺ソ霎シ縺ソ && !EnumSongs.IsSongListEnumCompletelyDone && + EnumSongs.thDTXFileEnumerate != null ) // #28700 2012.6.12 yyagi; at Compact mode, enumerating thread does not exist. + { + EnumSongs.WaitUntilSuspended(); // 蠢オ縺ョ縺溘a縲∵峇讀懃エ「縺御ク譎ゆクュ譁ュ縺輔l繧九∪縺ァ蠕讖 + } + #endregion + + #region [ 譖イ讀懃エ「縺悟ョ御コ縺励◆繧峨∝ョ滄圀縺ョ譖イ繝ェ繧ケ繝医↓蜿肴丐縺吶k ] + // CStage驕ク譖イ.On豢サ諤ァ蛹() 縺ォ蝗槭@縺滓婿縺後>縺縺九↑シ + if ( EnumSongs.IsSongListEnumerated ) + { + actEnumSongs.On髱樊エサ諤ァ蛹(); + TJAPlayer3.stage驕ク譖イ.bIsEnumeratingSongs = false; + + bool bRemakeSongTitleBar = ( r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID == CStage.E繧ケ繝繝シ繧ク.驕ク譖イ ) ? true : false; + TJAPlayer3.stage驕ク譖イ.Refresh( EnumSongs.Songs邂。逅, bRemakeSongTitleBar ); + EnumSongs.SongListEnumCompletelyDone(); + } + #endregion + } + break; + } + #endregion + + switch ( r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID ) + { + case CStage.E繧ケ繝繝シ繧ク.菴輔b縺励↑縺: + break; + + case CStage.E繧ケ繝繝シ繧ク.襍キ蜍: + #region [ *** ] + //----------------------------- + if( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 != 0 ) + { + if( !b繧ウ繝ウ繝代け繝医Δ繝シ繝 ) + { + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + Trace.TraceInformation( "----------------------" ); + Trace.TraceInformation( "笆 繧ソ繧、繝医Ν" ); + stage繧ソ繧、繝医Ν.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage繧ソ繧、繝医Ν; + } + else + { + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + Trace.TraceInformation( "----------------------" ); + Trace.TraceInformation( "笆 譖イ隱ュ縺ソ霎シ縺ソ" ); + stage譖イ隱ュ縺ソ霎シ縺ソ.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage譖イ隱ュ縺ソ霎シ縺ソ; + } + foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + pg.plugin.On繧ケ繝繝シ繧ク螟画峩(); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + + this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧(); + } + //----------------------------- + #endregion + break; + + case CStage.E繧ケ繝繝シ繧ク.繧ソ繧、繝医Ν: + #region [ *** ] + //----------------------------- + switch( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 ) + { + case (int)CStage繧ソ繧、繝医Ν.E謌サ繧雁、.GAMESTART: + #region [ 驕ク譖イ蜃ヲ逅縺ク ] + //----------------------------- + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + Trace.TraceInformation( "----------------------" ); + Trace.TraceInformation( "笆 驕ク譖イ" ); + stage驕ク譖イ.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage驕ク譖イ; + //----------------------------- + #endregion + break; + + case (int)CStage繧ソ繧、繝医Ν.E謌サ繧雁、.DANGAMESTART: + #region [ 谿オ菴埼∈謚槫ヲ逅縺ク ] + //----------------------------- + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + Trace.TraceInformation( "----------------------" ); + Trace.TraceInformation( "笆 谿オ菴埼∈謚" ); + stage谿オ菴埼∈謚.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage谿オ菴埼∈謚; + //----------------------------- + #endregion + break; + + #region [ OPTION: 蟒豁「貂 ] +// case 2: // #24525 OPTION縺ィCONFIG縺ョ邨ア蜷医↓莨エ縺縲^PTION縺ッ蟒豁「 +// #region [ *** ] +// //----------------------------- +// r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); +// Trace.TraceInformation( "----------------------" ); +// Trace.TraceInformation( "笆 繧ェ繝励す繝ァ繝ウ" ); +// stage繧ェ繝励す繝ァ繝ウ.On豢サ諤ァ蛹(); +// r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; +// r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage繧ェ繝励す繝ァ繝ウ; +// //----------------------------- +// #endregion + // break; + #endregion + + case (int)CStage繧ソ繧、繝医Ν.E謌サ繧雁、.CONFIG: + #region [ *** ] + //----------------------------- + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + Trace.TraceInformation( "----------------------" ); + Trace.TraceInformation( "笆 繧ウ繝ウ繝輔ぅ繧ー" ); + stage繧ウ繝ウ繝輔ぅ繧ー.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage繧ウ繝ウ繝輔ぅ繧ー; + //----------------------------- + #endregion + break; + + case (int)CStage繧ソ繧、繝医Ν.E謌サ繧雁、.EXIT: + #region [ *** ] + //----------------------------- + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + Trace.TraceInformation( "----------------------" ); + Trace.TraceInformation( "笆 邨ゆコ" ); + stage邨ゆコ.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage邨ゆコ; + //----------------------------- + #endregion + break; + } + + foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + pg.plugin.On繧ケ繝繝シ繧ク螟画峩(); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + + //this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧(); // #31980 2013.9.3 yyagi 繧ソ繧、繝医Ν逕サ髱「縺ァ縺縺代∵ッ弱ヵ繝ャ繝シ繝GC繧貞ョ溯。後@縺ヲ驥阪¥縺ェ縺」縺ヲ縺縺溷撫鬘後ョ菫ョ豁」 + //----------------------------- + #endregion + break; + + case CStage.E繧ケ繝繝シ繧ク.繧ウ繝ウ繝輔ぅ繧ー: + #region [ *** ] + //----------------------------- + if( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 != 0 ) + { + switch( r逶エ蜑阪ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID ) + { + case CStage.E繧ケ繝繝シ繧ク.繧ソ繧、繝医Ν: + #region [ *** ] + //----------------------------- + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + Trace.TraceInformation( "----------------------" ); + Trace.TraceInformation( "笆 繧ソ繧、繝医Ν" ); + stage繧ソ繧、繝医Ν.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage繧ソ繧、繝医Ν; + + foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + pg.plugin.On繧ケ繝繝シ繧ク螟画峩(); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + + this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧(); + break; + //----------------------------- + #endregion + + case CStage.E繧ケ繝繝シ繧ク.驕ク譖イ: + #region [ *** ] + //----------------------------- + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + Trace.TraceInformation( "----------------------" ); + Trace.TraceInformation( "笆 驕ク譖イ" ); + stage驕ク譖イ.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage驕ク譖イ; + + foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + pg.plugin.On繧ケ繝繝シ繧ク螟画峩(); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + + this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧(); + break; + //----------------------------- + #endregion + } + } + //----------------------------- + #endregion + break; + + case CStage.E繧ケ繝繝シ繧ク.驕ク譖イ: + #region [ *** ] + //----------------------------- + switch( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 ) + { + case (int) CStage驕ク譖イ.E謌サ繧雁、.繧ソ繧、繝医Ν縺ォ謌サ繧: + #region [ *** ] + //----------------------------- + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + Trace.TraceInformation( "----------------------" ); + Trace.TraceInformation( "笆 繧ソ繧、繝医Ν" ); + stage繧ソ繧、繝医Ν.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage繧ソ繧、繝医Ν; + + Skin.bgm驕ク譖イ逕サ髱「繧、繝ウ.t蛛懈ュ「縺吶k(); + Skin.bgm驕ク譖イ逕サ髱「.t蛛懈ュ「縺吶k(); + foreach ( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + pg.plugin.On繧ケ繝繝シ繧ク螟画峩(); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + + this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧(); + break; + //----------------------------- + #endregion + + case (int) CStage驕ク譖イ.E謌サ繧雁、.驕ク譖イ縺励◆: + #region [ *** ] + //----------------------------- + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + Trace.TraceInformation( "----------------------" ); + Trace.TraceInformation( "笆 譖イ隱ュ縺ソ霎シ縺ソ" ); + stage譖イ隱ュ縺ソ霎シ縺ソ.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage譖イ隱ュ縺ソ霎シ縺ソ; + + Skin.bgm驕ク譖イ逕サ髱「繧、繝ウ.t蛛懈ュ「縺吶k(); + Skin.bgm驕ク譖イ逕サ髱「.t蛛懈ュ「縺吶k(); + foreach ( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + pg.plugin.On繧ケ繝繝シ繧ク螟画峩(); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + + this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧(); + break; + //----------------------------- + #endregion + +// case (int) CStage驕ク譖イ.E謌サ繧雁、.繧ェ繝励す繝ァ繝ウ蜻シ縺ウ蜃コ縺: + #region [ *** ] +// //----------------------------- +// r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); +// Trace.TraceInformation( "----------------------" ); +// Trace.TraceInformation( "笆 繧ェ繝励す繝ァ繝ウ" ); +// stage繧ェ繝励す繝ァ繝ウ.On豢サ諤ァ蛹(); +// r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; +// r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage繧ェ繝励す繝ァ繝ウ; +// +// foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ ) +// { +// Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); +// pg.plugin.On繧ケ繝繝シ繧ク螟画峩(); +// Directory.SetCurrentDirectory( CDTXMania.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); +// } +// +// this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧(); +// break; +// //----------------------------- + #endregion + + case (int) CStage驕ク譖イ.E謌サ繧雁、.繧ウ繝ウ繝輔ぅ繧ー蜻シ縺ウ蜃コ縺: + #region [ *** ] + //----------------------------- + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + Trace.TraceInformation( "----------------------" ); + Trace.TraceInformation( "笆 繧ウ繝ウ繝輔ぅ繧ー" ); + stage繧ウ繝ウ繝輔ぅ繧ー.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage繧ウ繝ウ繝輔ぅ繧ー; + + foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + pg.plugin.On繧ケ繝繝シ繧ク螟画峩(); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + + this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧(); + break; + //----------------------------- + #endregion + + case (int) CStage驕ク譖イ.E謌サ繧雁、.繧ケ繧ュ繝ウ螟画峩: + + #region [ *** ] + //----------------------------- + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + Trace.TraceInformation( "----------------------" ); + Trace.TraceInformation( "笆 繧ケ繧ュ繝ウ蛻繧頑崛縺" ); + stageChangeSkin.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stageChangeSkin; + break; + //----------------------------- + #endregion + } + //----------------------------- + #endregion + break; + + case CStage.E繧ケ繝繝シ繧ク.谿オ菴埼∈謚: + #region [ *** ] + switch (this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、) + { + case (int)CStage驕ク譖イ.E謌サ繧雁、.繧ソ繧、繝医Ν縺ォ謌サ繧: + #region [ *** ] + //----------------------------- + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("笆 繧ソ繧、繝医Ν"); + stage繧ソ繧、繝医Ν.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage繧ソ繧、繝医Ν; + + Skin.bgm驕ク譖イ逕サ髱「繧、繝ウ.t蛛懈ュ「縺吶k(); + Skin.bgm驕ク譖イ逕サ髱「.t蛛懈ュ「縺吶k(); + foreach (STPlugin pg in this.list繝励Λ繧ー繧、繝ウ) + { + Directory.SetCurrentDirectory(pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝); + pg.plugin.On繧ケ繝繝シ繧ク螟画峩(); + Directory.SetCurrentDirectory(TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝); + } + + this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧(); + break; + //----------------------------- + #endregion + + case (int)CStage驕ク譖イ.E謌サ繧雁、.驕ク譖イ縺励◆: + #region [ *** ] + //----------------------------- + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("笆 譖イ隱ュ縺ソ霎シ縺ソ"); + stage譖イ隱ュ縺ソ霎シ縺ソ.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage譖イ隱ュ縺ソ霎シ縺ソ; + + foreach (STPlugin pg in this.list繝励Λ繧ー繧、繝ウ) + { + Directory.SetCurrentDirectory(pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝); + pg.plugin.On繧ケ繝繝シ繧ク螟画峩(); + Directory.SetCurrentDirectory(TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝); + } + + this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧(); + break; + //----------------------------- + #endregion + } + #endregion + break; + + case CStage.E繧ケ繝繝シ繧ク.譖イ隱ュ縺ソ霎シ縺ソ: + #region [ *** ] + //----------------------------- + DTXVmode.Refreshed = false; // 譖イ縺ョ繝ェ繝ュ繝シ繝我クュ縺ォ逋コ逕溘@縺溷阪Μ繝ュ繝シ繝峨ッ縲∫┌隕悶☆繧九 + if( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 != 0 ) + { + TJAPlayer3.Pad.st讀懃衍縺励◆繝繝舌う繧ケ.Clear(); // 蜈・蜉帙ョ繝舌う繧ケ繝輔Λ繧ー繧ッ繝ェ繧「(2010.9.11) + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + #region [ ESC謚シ荳区凾縺ッ縲∵峇縺ョ隱ュ縺ソ霎シ縺ソ繧剃クュ豁「縺励※驕ク譖イ逕サ髱「縺ォ謌サ繧 ] + if ( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 == (int) E譖イ隱ュ霎シ逕サ髱「縺ョ謌サ繧雁、.隱ュ霎シ荳ュ豁「 ) + { + //DTX.t蜈ィ繝√ャ繝励ョ蜀咲函蛛懈ュ「(); + if( DTX != null ) + DTX.On髱樊エサ諤ァ蛹(); + if (stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan) + { + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("笆 谿オ菴埼∈謚"); + stage谿オ菴埼∈謚.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage谿オ菴埼∈謚; + } + else + { + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("笆 驕ク譖イ"); + stage驕ク譖イ.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage驕ク譖イ; + } + foreach ( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + pg.plugin.On繧ケ繝繝シ繧ク螟画峩(); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + break; + } + #endregion + + Trace.TraceInformation( "----------------------" ); + Trace.TraceInformation( "笆 貍泌・擾シ医ラ繝ゥ繝逕サ髱「シ" ); +#if false // #23625 2011.1.11 Config.ini縺九i繝繝。繝シ繧ク/蝗槫セゥ蛟、縺ョ螳壽焚螟画峩繧定。後≧蝣エ蜷医ッ縺薙%繧呈怏蜉ケ縺ォ縺吶k 087繝ェ繝ェ繝シ繧ケ縺ォ蜷医o縺帶ゥ溯ス辟。蜉ケ蛹 +for (int i = 0; i < 5; i++) +{ + for (int j = 0; j < 2; j++) + { + stage貍泌・上ラ繝ゥ繝逕サ髱「.fDamageGaugeDelta[i, j] = ConfigIni.fGaugeFactor[i, j]; + } +} +for (int i = 0; i < 3; i++) { + stage貍泌・上ラ繝ゥ繝逕サ髱「.fDamageLevelFactor[i] = ConfigIni.fDamageLevelFactor[i]; +} +#endif + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage貍泌・上ラ繝ゥ繝逕サ髱「; + foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + pg.plugin.On繧ケ繝繝シ繧ク螟画峩(); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + + this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧(); + } + //----------------------------- + #endregion + break; + + case CStage.E繧ケ繝繝シ繧ク.貍泌・: + #region [ *** ] + //----------------------------- + //long n1 = FDK.CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms; + //long n2 = FDK.CSound邂。逅.SoundDevice.n邨碁℃譎る俣ms; + //long n3 = FDK.CSound邂。逅.SoundDevice.tm繧キ繧ケ繝繝繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms; + //long n4 = FDK.CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾; + //long n5 = FDK.CSound邂。逅.SoundDevice.n邨碁℃譎る俣繧呈峩譁ー縺励◆繧キ繧ケ繝繝譎ょ綾ms; + + //swlist1.Add( Convert.ToInt32(n1) ); + //swlist2.Add( Convert.ToInt32(n2) ); + //swlist3.Add( Convert.ToInt32( n3 ) ); + //swlist4.Add( Convert.ToInt32( n4 ) ); + //swlist5.Add( Convert.ToInt32( n5 ) ); + + #region [ DTXV繝「繝シ繝我クュ縺ォDTXCreator縺九i謖遉コ繧貞女縺代◆蝣エ蜷医ョ蜃ヲ逅 ] + if ( DTXVmode.Enabled && DTXVmode.Refreshed ) + { + DTXVmode.Refreshed = false; + + if ( DTXVmode.Command == CDTXVmode.ECommand.Stop ) + { + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.t蛛懈ュ「(); + if ( previewSound != null ) + { + this.previewSound.t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺吶k(); + this.previewSound.Dispose(); + this.previewSound = null; + } + //{ + // int lastd = 0; + // int f = 0; + // for ( int i = 0; i < swlist1.Count; i++ ) + // { + // int d1 = swlist1[ i ]; + // int d2 = swlist2[ i ]; + // int d3 = swlist3[ i ]; + // int d4 = swlist4[ i ]; + // int d5 = swlist5[ i ]; + + // int dif = d1 - lastd; + // string s = ""; + // if ( 16 <= dif && dif <= 17 ) + // { + // } + // else + // { + // s = "笘"; + // } + // 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 ); + // lastd = d1; + // f++; + // } + // swlist1.Clear(); + // swlist2.Clear(); + // swlist3.Clear(); + // swlist4.Clear(); + // swlist5.Clear(); + + //} + } + else if ( DTXVmode.Command == CDTXVmode.ECommand.Play ) + { + if ( DTXVmode.NeedReload ) + { + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.t蜀崎ェュ霎シ(); + + TJAPlayer3.ConfigIni.bTimeStretch = DTXVmode.TimeStretch; + CSound邂。逅.bIsTimeStretch = DTXVmode.TimeStretch; + if ( TJAPlayer3.ConfigIni.b蝙ら峩蟶ー邱壼セ縺。繧定。後≧ != DTXVmode.VSyncWait ) + { + TJAPlayer3.ConfigIni.b蝙ら峩蟶ー邱壼セ縺。繧定。後≧ = DTXVmode.VSyncWait; + TJAPlayer3.app.b谺。縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蝙ら峩蟶ー邱壼酔譛溷繧頑崛縺医r陦後≧ = true; + } + } + else + { + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.t貍泌・丈ス咲スョ縺ョ螟画峩( TJAPlayer3.DTXVmode.nStartBar, 0 ); + } + } + } + #endregion + + switch( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 ) + { + case (int) E貍泌・冗判髱「縺ョ謌サ繧雁、.蜀崎ェュ霎シ_蜀肴シ泌・: + #region [ DTX繝輔ぃ繧、繝ォ繧貞崎ェュ縺ソ霎シ縺ソ縺励※縲∝肴シ泌・ ] + DTX.t蜈ィ繝√ャ繝励ョ蜀咲函蛛懈ュ「(); + DTX.On髱樊エサ諤ァ蛹(); + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + stage譖イ隱ュ縺ソ霎シ縺ソ.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage譖イ隱ュ縺ソ霎シ縺ソ; + this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧(); + break; + #endregion + + //case (int) E貍泌・冗判髱「縺ョ謌サ繧雁、.蜀肴シ泌・: + #region [ 蜀崎ェュ縺ソ霎シ縺ソ辟。縺励〒縲∝肴シ泌・ ] + #endregion + // break; + + case (int) E貍泌・冗判髱「縺ョ謌サ繧雁、.邯咏カ: + break; + + case (int) E貍泌・冗判髱「縺ョ謌サ繧雁、.貍泌・丈クュ譁ュ: + #region [ 貍泌・上く繝」繝ウ繧サ繝ォ ] + //----------------------------- + scoreIni = this.tScoreIni縺クBGMAdjust縺ィHistory縺ィPlayCount繧呈峩譁ー( "Play canceled" ); + + #region [ 繝励Λ繧ー繧、繝ウ On貍泌・上く繝」繝ウ繧サ繝ォ() 縺ョ蜻シ縺ウ蜃コ縺 ] + //--------------------- + foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + pg.plugin.On貍泌・上く繝」繝ウ繧サ繝ォ( scoreIni ); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + //--------------------- + #endregion + + DTX.t蜈ィ繝√ャ繝励ョ蜀咲函蛛懈ュ「(); + DTX.On髱樊エサ諤ァ蛹(); + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + if( b繧ウ繝ウ繝代け繝医Δ繝シ繝 ) + { + base.Window.Close(); + } + else + { + if(stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan) + { + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("笆 谿オ菴埼∈謚"); + stage谿オ菴埼∈謚.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage谿オ菴埼∈謚; + } + else + { + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("笆 驕ク譖イ"); + stage驕ク譖イ.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage驕ク譖イ; + } + + #region [ 繝励Λ繧ー繧、繝ウ On繧ケ繝繝シ繧ク螟画峩() 縺ョ蜻シ縺ウ蜃コ縺 ] + //--------------------- + foreach ( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + pg.plugin.On繧ケ繝繝シ繧ク螟画峩(); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + //--------------------- + #endregion + + this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧(); + } + this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧(); + break; + //----------------------------- + #endregion + + case (int) E貍泌・冗判髱「縺ョ謌サ繧雁、.繧ケ繝繝シ繧ク螟ア謨: + #region [ 貍泌・丞、ア謨(StageFailed) ] + //----------------------------- + scoreIni = this.tScoreIni縺クBGMAdjust縺ィHistory縺ィPlayCount繧呈峩譁ー( "Stage failed" ); + + #region [ 繝励Λ繧ー繧、繝ウ On貍泌・丞、ア謨() 縺ョ蜻シ縺ウ蜃コ縺 ] + //--------------------- + foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + pg.plugin.On貍泌・丞、ア謨( scoreIni ); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + //--------------------- + #endregion + + DTX.t蜈ィ繝√ャ繝励ョ蜀咲函蛛懈ュ「(); + DTX.On髱樊エサ諤ァ蛹(); + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + if( b繧ウ繝ウ繝代け繝医Δ繝シ繝 ) + { + base.Window.Close(); + } + else + { + Trace.TraceInformation( "----------------------" ); + Trace.TraceInformation( "笆 驕ク譖イ" ); + stage驕ク譖イ.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage驕ク譖イ; + + #region [ 繝励Λ繧ー繧、繝ウ On繧ケ繝繝シ繧ク螟画峩() 縺ョ蜻シ縺ウ蜃コ縺 ] + //--------------------- + foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + pg.plugin.On繧ケ繝繝シ繧ク螟画峩(); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + //--------------------- + #endregion + + this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧(); + } + break; + //----------------------------- + #endregion + + case (int) E貍泌・冗判髱「縺ョ謌サ繧雁、.繧ケ繝繝シ繧ク繧ッ繝ェ繧「: + #region [ 貍泌・上け繝ェ繧「 ] + //----------------------------- + CScoreIni.C貍泌・剰ィ倬鹸 c貍泌・剰ィ倬鹸_Drums; + stage貍泌・上ラ繝ゥ繝逕サ髱「.t貍泌・冗オ先棡繧呈シ邏阪☆繧( out c貍泌・剰ィ倬鹸_Drums ); + + double ps = 0.0, gs = 0.0; + if ( !c貍泌・剰ィ倬鹸_Drums.b蜈ィAUTO縺ァ縺ゅk && c貍泌・剰ィ倬鹸_Drums.n蜈ィ繝√ャ繝玲焚 > 0) { + ps = c貍泌・剰ィ倬鹸_Drums.db貍泌・丞梛繧ケ繧ュ繝ォ蛟、; + gs = c貍泌・剰ィ倬鹸_Drums.db繧イ繝シ繝蝙九せ繧ュ繝ォ蛟、; + } + string str = "Cleared"; + switch( CScoreIni.t邱丞粋繝ゥ繝ウ繧ッ蛟、繧定ィ育ョ励@縺ヲ霑斐☆( c貍泌・剰ィ倬鹸_Drums, null, null ) ) + { + case (int)CScoreIni.ERANK.SS: + str = string.Format( "Cleared (SS: {0:F2})", ps ); + break; + + case (int) CScoreIni.ERANK.S: + str = string.Format( "Cleared (S: {0:F2})", ps ); + break; + + case (int) CScoreIni.ERANK.A: + str = string.Format( "Cleared (A: {0:F2})", ps ); + break; + + case (int) CScoreIni.ERANK.B: + str = string.Format( "Cleared (B: {0:F2})", ps ); + break; + + case (int) CScoreIni.ERANK.C: + str = string.Format( "Cleared (C: {0:F2})", ps ); + break; + + case (int) CScoreIni.ERANK.D: + str = string.Format( "Cleared (D: {0:F2})", ps ); + break; + + case (int) CScoreIni.ERANK.E: + str = string.Format( "Cleared (E: {0:F2})", ps ); + break; + + case (int)CScoreIni.ERANK.UNKNOWN: // #23534 2010.10.28 yyagi add: 貍泌・上メ繝繝励′0蛟九ョ縺ィ縺 + str = "Cleared (No chips)"; + break; + } + + scoreIni = this.tScoreIni縺クBGMAdjust縺ィHistory縺ィPlayCount繧呈峩譁ー( str ); + + #region [ 繝励Λ繧ー繧、繝ウ On貍泌・上け繝ェ繧「() 縺ョ蜻シ縺ウ蜃コ縺 ] + //--------------------- + foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + pg.plugin.On貍泌・上け繝ェ繧「( scoreIni ); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + //--------------------- + #endregion + + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + Trace.TraceInformation( "----------------------" ); + Trace.TraceInformation( "笆 邨先棡" ); + stage邨先棡.st貍泌・剰ィ倬鹸.Drums = c貍泌・剰ィ倬鹸_Drums; + stage邨先棡.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage邨先棡; + + #region [ 繝励Λ繧ー繧、繝ウ On繧ケ繝繝シ繧ク螟画峩() 縺ョ蜻シ縺ウ蜃コ縺 ] + //--------------------- + foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + pg.plugin.On繧ケ繝繝シ繧ク螟画峩(); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + //--------------------- + #endregion + + break; + //----------------------------- + #endregion + } + //----------------------------- + #endregion + break; + + case CStage.E繧ケ繝繝シ繧ク.邨先棡: + #region [ *** ] + //----------------------------- + if( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 != 0 ) + { + //DTX.t蜈ィ繝√ャ繝励ョ蜀咲函荳譎ょ●豁「(); + DTX.t蜈ィ繝√ャ繝励ョ蜀咲函蛛懈ュ「縺ィ繝溘く繧オ繝シ縺九i縺ョ蜑企勁(); + DTX.On髱樊エサ諤ァ蛹(); + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧(); + if ( !b繧ウ繝ウ繝代け繝医Δ繝シ繝 ) + { + if (stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan) + { + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("笆 谿オ菴埼∈謚"); + stage谿オ菴埼∈謚.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage谿オ菴埼∈謚; + } + else + { + Trace.TraceInformation("----------------------"); + Trace.TraceInformation("笆 驕ク譖イ"); + stage驕ク譖イ.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage驕ク譖イ; + } + stage驕ク譖イ.NowSong++; + + foreach( STPlugin pg in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( pg.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + pg.plugin.On繧ケ繝繝シ繧ク螟画峩(); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + + this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧(); + } + else + { + base.Window.Close(); + } + } + //----------------------------- + #endregion + break; + + case CStage.E繧ケ繝繝シ繧ク.ChangeSkin: + #region [ *** ] + //----------------------------- + if ( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 != 0 ) + { + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + Trace.TraceInformation( "----------------------" ); + Trace.TraceInformation( "笆 驕ク譖イ" ); + stage驕ク譖イ.On豢サ諤ァ蛹(); + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク; + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage驕ク譖イ; + this.t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧(); + } + //----------------------------- + #endregion + break; + + case CStage.E繧ケ繝繝シ繧ク.邨ゆコ: + #region [ *** ] + //----------------------------- + if( this.n騾イ陦梧緒逕サ縺ョ謌サ繧雁、 != 0 ) + { + base.Exit(); + } + //----------------------------- + #endregion + break; + } + + actScanningLoudness.On騾イ陦梧緒逕サ(); + + if (r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク != null && r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID != CStage.E繧ケ繝繝シ繧ク.襍キ蜍 && TJAPlayer3.Tx.Network_Connection != null) + { + if (Math.Abs(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms - this.蜑榊屓縺ョ繧キ繧ケ繝繝譎ょ綾ms) > 10000) + { + this.蜑榊屓縺ョ繧キ繧ケ繝繝譎ょ綾ms = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms; + Task.Factory.StartNew(() => + { + //IPv4 8.8.8.8縺ォPing繧帝∽ソ。縺吶k(timeout 5000ms) + PingReply reply = new Ping().Send("8.8.8.8", 5000); + this.b繝阪ャ繝医Ρ繝シ繧ッ縺ォ謗・邯壻クュ = reply.Status == IPStatus.Success; + }); + } + TJAPlayer3.Tx.Network_Connection.t2D謠冗判(app.Device, GameWindowSize.Width - (TJAPlayer3.Tx.Network_Connection.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2), GameWindowSize.Height - TJAPlayer3.Tx.Network_Connection.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height, new Rectangle((TJAPlayer3.Tx.Network_Connection.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2) * (this.b繝阪ャ繝医Ρ繝シ繧ッ縺ォ謗・邯壻クュ ? 0 : 1), 0, TJAPlayer3.Tx.Network_Connection.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Tx.Network_Connection.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + } + // 繧ェ繝シ繝舌Ξ繧、繧呈緒逕サ縺吶k(繝繧ッ繧ケ繝√Ε縺ョ逕滓舌&繧後※縺縺ェ縺襍キ蜍輔せ繝繝シ繧ク縺ッ萓句、 + if (r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク != null && r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID != CStage.E繧ケ繝繝シ繧ク.襍キ蜍 && TJAPlayer3.Tx.Overlay != null) + { + TJAPlayer3.Tx.Overlay.t2D謠冗判(app.Device, 0, 0); + } + } + this.Device.EndScene(); // Present()縺ッ game.cs縺ョOnFrameEnd()縺ォ逋サ骭イ縺輔l縺溘;raphicsDeviceManager.game_FrameEnd() 蜀縺ァ螳溯。後&繧後k縺ョ縺ァ荳崎ヲ + // (縺、縺セ繧翫 ̄resent()縺ッ縲.raw()螳御コ蠕後↓螳溯。後&繧後k) +#if !GPUFlushAfterPresent + actFlushGPU?.On騾イ陦梧緒逕サ(); // Flush GPU // EndScene()ス霸resent()髢 (縺、縺セ繧碍Sync蜑) 縺ァFlush螳溯。 +#endif + if ( Sound邂。逅?.GetCurrentSoundDeviceType() != "DirectSound" ) + { + Sound邂。逅?.t蜀咲函荳ュ縺ョ蜃ヲ逅繧偵☆繧(); // 繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ縺ョ譖エ譁ー; 逕サ髱「謠冗判縺ィ蜷梧悄縺輔○繧九%縺ィ縺ァ縲√せ繧ッ繝ュ繝シ繝ォ繧偵せ繝繝シ繧コ縺ォ縺吶k + } + + + #region [ 蜈ィ逕サ髱「_繧ヲ繧、繝ウ繝峨え蛻繧頑崛縺 ] + if ( this.b谺。縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蜈ィ逕サ髱「_繧ヲ繧」繝ウ繝峨え蛻繧頑崛縺医r陦後≧ ) + { + ConfigIni.b蜈ィ逕サ髱「繝「繝シ繝 = !ConfigIni.b蜈ィ逕サ髱「繝「繝シ繝; + app.t蜈ィ逕サ髱「_繧ヲ繧」繝ウ繝峨え繝「繝シ繝牙繧頑崛縺(); + this.b谺。縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蜈ィ逕サ髱「_繧ヲ繧」繝ウ繝峨え蛻繧頑崛縺医r陦後≧ = false; + } + #endregion + #region [ 蝙ら峩蝓コ邱壼酔譛溷繧頑崛縺 ] + if ( this.b谺。縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蝙ら峩蟶ー邱壼酔譛溷繧頑崛縺医r陦後≧ ) + { + bool bIsMaximized = this.Window.IsMaximized; // #23510 2010.11.3 yyagi: to backup current window mode before changing VSyncWait + currentClientSize = this.Window.ClientSize; // #23510 2010.11.3 yyagi: to backup current window size before changing VSyncWait + DeviceSettings currentSettings = app.GraphicsDeviceManager.CurrentSettings; + currentSettings.EnableVSync = ConfigIni.b蝙ら峩蟶ー邱壼セ縺。繧定。後≧; + app.GraphicsDeviceManager.ChangeDevice( currentSettings ); + this.b谺。縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蝙ら峩蟶ー邱壼酔譛溷繧頑崛縺医r陦後≧ = false; + base.Window.ClientSize = new Size(currentClientSize.Width, currentClientSize.Height); // #23510 2010.11.3 yyagi: to resume window size after changing VSyncWait + if (bIsMaximized) + { + this.Window.WindowState = FormWindowState.Maximized; // #23510 2010.11.3 yyagi: to resume window mode after changing VSyncWait + } + } + #endregion + } + + // 縺昴ョ莉 + + #region [ 豎守畑繝倥Ν繝代シ ] + //----------------- + public static CTexture t繝繧ッ繧ケ繝√Ε縺ョ逕滓( string fileName ) + { + return t繝繧ッ繧ケ繝√Ε縺ョ逕滓( fileName, false ); + } + public static CTexture t繝繧ッ繧ケ繝√Ε縺ョ逕滓( string fileName, bool b鮟偵r騾城℃縺吶k ) + { + if ( app == null ) + { + return null; + } + try + { + return new CTexture( app.Device, fileName, TextureFormat, b鮟偵r騾城℃縺吶k ); + } + catch ( CTextureCreateFailedException e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲({0})", fileName ); + return null; + } + catch ( FileNotFoundException ) + { + Trace.TraceWarning( "繝繧ッ繧ケ繝√Ε繝輔ぃ繧、繝ォ縺瑚ヲ九▽縺九j縺セ縺帙s縺ァ縺励◆縲({0})", fileName ); + return null; + } + } + public static void t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref CTexture tx ) + { + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k( ref tx ); + } + public static void t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref CTextureAf tx ) + { + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k( ref tx ); + } + public static CTexture t繝繧ッ繧ケ繝√Ε縺ョ逕滓( byte[] txData ) + { + return t繝繧ッ繧ケ繝√Ε縺ョ逕滓( txData, false ); + } + public static CTexture t繝繧ッ繧ケ繝√Ε縺ョ逕滓( byte[] txData, bool b鮟偵r騾城℃縺吶k ) + { + if ( app == null ) + { + return null; + } + try + { + return new CTexture( app.Device, txData, TextureFormat, b鮟偵r騾城℃縺吶k ); + } + catch ( CTextureCreateFailedException e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲(txData)" ); + return null; + } + } + public static CTexture t繝繧ッ繧ケ繝√Ε縺ョ逕滓( Bitmap bitmap ) + { + return t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bitmap, false ); + } + public static CTexture t繝繧ッ繧ケ繝√Ε縺ョ逕滓( Bitmap bitmap, bool b鮟偵r騾城℃縺吶k ) + { + if ( app == null ) + { + return null; + } + if (bitmap == null) + { + Trace.TraceError("繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲(bitmap==null)"); + return null; + } + try + { + return new CTexture( app.Device, bitmap, TextureFormat, b鮟偵r騾城℃縺吶k ); + } + catch ( CTextureCreateFailedException e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲(txData)" ); + return null; + } + } + + public static CTextureAf t繝繧ッ繧ケ繝√Ε縺ョ逕滓植f( string fileName ) + { + return t繝繧ッ繧ケ繝√Ε縺ョ逕滓植f( fileName, false ); + } + public static CTextureAf t繝繧ッ繧ケ繝√Ε縺ョ逕滓植f( string fileName, bool b鮟偵r騾城℃縺吶k ) + { + if ( app == null ) + { + return null; + } + try + { + return new CTextureAf( app.Device, fileName, TextureFormat, b鮟偵r騾城℃縺吶k ); + } + catch ( CTextureCreateFailedException e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲({0})", fileName ); + return null; + } + catch ( FileNotFoundException e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "繝繧ッ繧ケ繝√Ε繝輔ぃ繧、繝ォ縺瑚ヲ九▽縺九j縺セ縺帙s縺ァ縺励◆縲({0})", fileName ); + return null; + } + } + public static CDirectShow t螟ア謨励@縺ヲ繧ゅせ繧ュ繝繝怜庄閭ス縺ェDirectShow繧堤函謌舌☆繧(string fileName, IntPtr hWnd, bool b繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ縺ェ縺) + { + CDirectShow ds = null; + if( File.Exists( fileName ) ) + { + try + { + ds = new CDirectShow(fileName, hWnd, b繧ェ繝シ繝繧」繧ェ繝ャ繝ウ繝繝ゥ縺ェ縺); + } + catch (FileNotFoundException e) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError("蜍慕判繝輔ぃ繧、繝ォ縺瑚ヲ九▽縺九j縺セ縺帙s縺ァ縺励◆縲({0})", fileName); + ds = null; // Dispose 縺ッ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ蜀縺ァ螳滓命貂医∩ + } + catch (Exception e) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError("DirectShow 縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲[{0}]", fileName); + ds = null; // Dispose 縺ッ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ蜀縺ァ螳滓命貂医∩ + } + } + else + { + Trace.TraceError("蜍慕判繝輔ぃ繧、繝ォ縺瑚ヲ九▽縺九j縺セ縺帙s縺ァ縺励◆縲({0})", fileName); + return null; + } + + return ds; + } + + /// 繝励Ο繝代ユ繧」縲√う繝ウ繝繧ッ繧オ縺ォ縺ッ ref 縺ッ菴ソ逕ィ縺ァ縺阪↑縺縺ョ縺ァ豕ィ諢上 + public static void t螳牙ィ縺ォDispose縺吶k(ref T obj) + { + if (obj == null) + return; + + var d = obj as IDisposable; + + if (d != null) + d.Dispose(); + + obj = default(T); + } + + public static void t螳牙ィ縺ォDispose縺吶k(ref T[] array) where T : class, IDisposable //2020.08.01 Mr-Ojii twopointzero豌上ョ繧ス繝シ繧ケ繧ウ繝シ繝峨r繧ゅ→縺ォ霑ス蜉 + { + if (array == null) + { + return; + } + + for (var i = 0; i < array.Length; i++) + { + array[i]?.Dispose(); + array[i] = null; + } + } + + /// + /// 縺昴ョ繝輔か繝ォ繝縺ョ騾」逡ェ逕サ蜒上ョ譛螟ァ蛟、繧定ソ斐☆縲 + /// + public static int t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(string 繝繧」繝ャ繧ッ繝医Μ蜷, string 繝励Ξ繝輔ぅ繝繧ッ繧ケ = "", string 諡。蠑オ蟄 = ".png") + { + int num = 0; + while(File.Exists(繝繧」繝ャ繧ッ繝医Μ蜷 + 繝励Ξ繝輔ぅ繝繧ッ繧ケ + num + 諡。蠑オ蟄)) + { + num++; + } + return num; + } + + /// + /// 譖イ蜷阪ユ繧ッ繧ケ繝√Ε縺ョ邵ョ蟆丞咲紫繧定ソ斐☆縲 + /// + /// 譖イ蜷阪ユ繧ッ繧ケ繝√Ε縲 + /// 遲牙阪〒陦ィ遉コ縺吶k繝斐け繧サ繝ォ謨ー縺ョ譛螟ァ蛟、(繝繝輔か繝ォ繝亥、:645) + /// 譖イ蜷阪ユ繧ッ繧ケ繝√Ε縺ョ邵ョ蟆丞咲紫縲ゅ◎縺ョ繝繧ッ繧ケ繝√Ε縺系ull縺ェ繧峨ー荳蛟(1f)繧定ソ斐☆縲 + public static float GetSongNameXScaling(ref CTexture cTexture, int samePixel = 660) + { + if (cTexture == null) return 1f; + float scalingRate = (float)samePixel / (float)cTexture.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + if (cTexture.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width <= samePixel) + scalingRate = 1.0f; + return scalingRate; + } + + /// + /// 髮」譏灘コヲ繧定。ィ縺呎焚蟄励r蛻玲嫌菴薙↓螟画鋤縺励∪縺吶 + /// + /// 髮」譏灘コヲ繧定。ィ縺呎焚蟄励 + /// Difficulty 蛻玲嫌菴 + public static Difficulty DifficultyNumberToEnum(int number) + { + switch (number) + { + case 0: + return Difficulty.Easy; + case 1: + return Difficulty.Normal; + case 2: + return Difficulty.Hard; + case 3: + return Difficulty.Oni; + case 4: + return Difficulty.Edit; + case 5: + return Difficulty.Tower; + case 6: + return Difficulty.Dan; + default: + throw new IndexOutOfRangeException(); + } + } + + //----------------- + #endregion + + #region [ private ] + //----------------- + private bool b繝槭え繧ケ繧ォ繝シ繧ス繝ォ陦ィ遉コ荳ュ = true; + private bool b邨ゆコ蜃ヲ逅螳御コ貂医∩; + private bool b繝阪ャ繝医Ρ繝シ繧ッ縺ォ謗・邯壻クュ = false; + private long 蜑榊屓縺ョ繧キ繧ケ繝繝譎ょ綾ms = long.MinValue; + private static CDTX[] dtx = new CDTX[ 4 ]; + + public static TextureLoader Tx = new TextureLoader(); + + private List list繝医ャ繝励Ξ繝吶ΝActivities; + private int n騾イ陦梧緒逕サ縺ョ謌サ繧雁、; + private MouseButtons mb = System.Windows.Forms.MouseButtons.Left; + private string strWindowTitle + { + get + { + if ( DTXVmode.Enabled ) + { + return "DTXViewer release " + VERSION; + } + else + { + return "TJAPlayer3 feat.DTXMania"; + } + } + } + private CSound previewSound; + public static long StartupTime + { + get; + private set; + } + + private void t襍キ蜍募ヲ逅() + { + #region [ strEXE縺ョ縺ゅk繝輔か繝ォ繝繧呈アコ螳壹☆繧 ] + //----------------- +// BEGIN #23629 2010.11.13 from: 繝繝舌ャ繧ー譎ゅッ Application.ExecutablePath 縺 ($SolutionDir)/bin/x86/Debug/ 縺ェ縺ゥ縺ォ縺ェ繧 System/ 縺ョ隱ュ縺ソ霎シ縺ソ縺ォ螟ア謨励☆繧九ョ縺ァ縲√き繝ャ繝ウ繝医ョ繧」繝ャ繧ッ繝医Μ繧呈治逕ィ縺吶k縲ゑシ医励Ο繧ク繧ァ繧ッ繝医ョ繝励Ο繝代ユ繧」竊偵ョ繝舌ャ繧ー竊剃ス懈・ュ繝繧」繝ャ繧ッ繝医Μ縺梧怏蜉ケ縺ォ縺ェ繧具シ +#if DEBUG + strEXE縺ョ縺ゅk繝輔か繝ォ繝 = Environment.CurrentDirectory + @"\"; +#else + strEXE縺ョ縺ゅk繝輔か繝ォ繝 = Path.GetDirectoryName( Application.ExecutablePath ) + @"\"; // #23629 2010.11.9 yyagi: set correct pathname where DTXManiaGR.exe is. +#endif + // END #23629 2010.11.13 from + //----------------- + #endregion + + #region [ Config.ini 縺ョ隱ュ霎シ縺ソ ] + //--------------------- + NamePlateConfig = new NamePlateConfig(); + NamePlateConfig.tNamePlateConfig(); + ConfigIni = new CConfigIni(); + string path = strEXE縺ョ縺ゅk繝輔か繝ォ繝 + "Config.ini"; + if( File.Exists( path ) ) + { + try + { + ConfigIni.t繝輔ぃ繧、繝ォ縺九i隱ュ縺ソ霎シ縺ソ( path ); + } + catch (Exception e) + { + //ConfigIni = new CConfigIni(); // 蟄伜惠縺励※縺ェ縺代l縺ー譁ー隕冗函謌 + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (b8d93255-bbe4-4ca3-8264-7ee5175b19f3)" ); + } + } + this.Window.EnableSystemMenu = TJAPlayer3.ConfigIni.bIsEnabledSystemMenu; // #28200 2011.5.1 yyagi + // 2012.8.22 Config.ini縺檎┌縺縺ィ縺阪↓蛻晄悄蛟、縺碁←逕ィ縺輔l繧九h縺縲√%縺ョ險ュ螳夊。後rif繝悶Ο繝繧ッ螟悶↓遘サ蜍 + + //--------------------- + #endregion + #region [ 繝ュ繧ー蜃コ蜉幃幕蟋 ] + //--------------------- + Trace.AutoFlush = true; + if( ConfigIni.b繝ュ繧ー蜃コ蜉 ) + { + try + { + Trace.Listeners.Add( new CTraceLogListener( new StreamWriter( System.IO.Path.Combine( strEXE縺ョ縺ゅk繝輔か繝ォ繝, "TJAPlayer3.log" ), false, Encoding.GetEncoding( "Shift_JIS" ) ) ) ); + } + catch ( System.UnauthorizedAccessException ) // #24481 2011.2.20 yyagi + { + int c = (CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ja")? 0 : 1; + string[] mes_writeErr = { + "DTXManiaLog.txt縺ク縺ョ譖ク縺崎セシ縺ソ縺後〒縺阪∪縺帙s縺ァ縺励◆縲よ嶌縺崎セシ縺ソ縺ァ縺阪k繧医≧縺ォ縺励※縺九i縲∝榊コヲ襍キ蜍輔@縺ヲ縺上□縺輔>縲", + "Failed to write DTXManiaLog.txt. Please set it writable and try again." + }; + MessageBox.Show( mes_writeErr[c], "DTXMania boot error", MessageBoxButtons.OK, MessageBoxIcon.Error ); + Environment.Exit(1); + } + } + Trace.WriteLine(""); + Trace.WriteLine( "DTXMania powered by YAMAHA Silent Session Drums" ); + Trace.WriteLine( string.Format( "Release: {0}", VERSION ) ); + Trace.WriteLine( "" ); + Trace.TraceInformation( "----------------------" ); + Trace.TraceInformation( "笆 繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ蛻晄悄蛹" ); + Trace.TraceInformation( "OS Version: " + Environment.OSVersion ); + Trace.TraceInformation( "ProcessorCount: " + Environment.ProcessorCount.ToString() ); + Trace.TraceInformation( "CLR Version: " + Environment.Version.ToString() ); + //--------------------- + #endregion + #region [ DTXVmode繧ッ繝ゥ繧ケ 縺ョ蛻晄悄蛹 ] + //--------------------- + //Trace.TraceInformation( "DTXV繝「繝シ繝峨ョ蛻晄悄蛹悶r陦後>縺セ縺吶" ); + //Trace.Indent(); + try + { + DTXVmode = new CDTXVmode(); + DTXVmode.Enabled = false; + //Trace.TraceInformation( "DTXV繝「繝シ繝峨ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" ); + } + finally + { + //Trace.Unindent(); + } + //--------------------- + #endregion + + + #region [ 繧ヲ繧」繝ウ繝峨え蛻晄悄蛹 ] + //--------------------- + base.Window.StartPosition = FormStartPosition.Manual; // #30675 2013.02.04 ikanick add + base.Window.Location = new Point( ConfigIni.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョX, ConfigIni.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョY ); // #30675 2013.02.04 ikanick add + + + base.Window.Text = ""; + + base.Window.StartPosition = FormStartPosition.Manual; // #30675 2013.02.04 ikanick add + base.Window.Location = new Point(ConfigIni.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョX, ConfigIni.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョY); // #30675 2013.02.04 ikanick add + + base.Window.ClientSize = new Size(ConfigIni.n繧ヲ繧、繝ウ繝峨えwidth, ConfigIni.n繧ヲ繧、繝ウ繝峨えheight); // #34510 yyagi 2010.10.31 to change window size got from Config.ini +#if !WindowedFullscreen + if (!ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝) // #23510 2010.11.02 yyagi: add; to recover window size in case bootup with fullscreen mode + { // #30666 2013.02.02 yyagi: currentClientSize should be always made +#endif + currentClientSize = new Size( ConfigIni.n繧ヲ繧、繝ウ繝峨えwidth, ConfigIni.n繧ヲ繧、繝ウ繝峨えheight ); +#if !WindowedFullscreen + } +#endif + base.Window.MaximizeBox = true; // #23510 2010.11.04 yyagi: to support maximizing window + base.Window.FormBorderStyle = FormBorderStyle.Sizable; // #23510 2010.10.27 yyagi: changed from FixedDialog to Sizable, to support window resize + // #30666 2013.02.02 yyagi: moved the code to t蜈ィ逕サ髱「_繧ヲ繧、繝ウ繝峨え繝「繝シ繝牙繧頑崛縺() + base.Window.ShowIcon = true; + base.Window.Icon = global::TJAPlayer3.Properties.Resources.tjap3; + base.Window.KeyDown += new KeyEventHandler( this.Window_KeyDown ); + base.Window.MouseUp +=new MouseEventHandler( this.Window_MouseUp); + base.Window.MouseDoubleClick += new MouseEventHandler(this.Window_MouseDoubleClick); // #23510 2010.11.13 yyagi: to go fullscreen mode + base.Window.ResizeEnd += new EventHandler(this.Window_ResizeEnd); // #23510 2010.11.20 yyagi: to set resized window size in Config.ini + base.Window.ApplicationActivated += new EventHandler(this.Window_ApplicationActivated); + base.Window.ApplicationDeactivated += new EventHandler( this.Window_ApplicationDeactivated ); + //--------------------- + #endregion + #region [ Direct3D9Ex繧剃スソ縺縺九←縺縺句愛螳 ] + #endregion + #region [ Direct3D9 繝繝舌う繧ケ縺ョ逕滓 ] + //--------------------- + DeviceSettings settings = new DeviceSettings(); +#if WindowedFullscreen + settings.Windowed = true; // #30666 2013.2.2 yyagi: Fullscreenmode is "Maximized window" mode +#else + settings.Windowed = ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝; +#endif + settings.BackBufferWidth = SampleFramework.GameWindowSize.Width; + settings.BackBufferHeight = SampleFramework.GameWindowSize.Height; +// settings.BackBufferCount = 3; + settings.EnableVSync = ConfigIni.b蝙ら峩蟶ー邱壼セ縺。繧定。後≧; +// settings.BackBufferFormat = Format.A8R8G8B8; +// settings.MultisampleType = MultisampleType.FourSamples; +// settings.MultisampleQuality = 4; +// settings.MultisampleType = MultisampleType.None; +// settings.MultisampleQuality = 0; + + try + { + base.GraphicsDeviceManager.ChangeDevice(settings); + } + catch (DeviceCreationException e) + { + Trace.TraceError(e.ToString()); + MessageBox.Show(e.ToString(), "DTXMania failed to boot: DirectX9 Initialize Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + Environment.Exit(-1); + } + + base.IsFixedTimeStep = false; +// base.TargetElapsedTime = TimeSpan.FromTicks( 10000000 / 75 ); + base.Window.ClientSize = new Size(ConfigIni.n繧ヲ繧、繝ウ繝峨えwidth, ConfigIni.n繧ヲ繧、繝ウ繝峨えheight); // #23510 2010.10.31 yyagi: to recover window size. width and height are able to get from Config.ini. + base.InactiveSleepTime = TimeSpan.FromMilliseconds((float)(ConfigIni.n髱槭ヵ繧ゥ繝シ繧ォ繧ケ譎ゅせ繝ェ繝シ繝洋s)); // #23568 2010.11.3 yyagi: to support valiable sleep value when !IsActive + // #23568 2010.11.4 ikanick changed ( 1 -> ConfigIni ) +#if WindowedFullscreen + this.t蜈ィ逕サ髱「_繧ヲ繧」繝ウ繝峨え繝「繝シ繝牙繧頑崛縺(); // #30666 2013.2.2 yyagi: finalize settings for "Maximized window mode" +#endif + actFlushGPU = new CActFlushGPU(); + //--------------------- + #endregion + + DTX = null; + + #region [ Skin 縺ョ蛻晄悄蛹 ] + //--------------------- + Trace.TraceInformation( "繧ケ繧ュ繝ウ縺ョ蛻晄悄蛹悶r陦後>縺セ縺吶" ); + Trace.Indent(); + try + { + Skin = new CSkin( TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName, false); + TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName = TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName( true ); // 譌ァ謖螳壹ョSkin繝輔か繝ォ繝縺梧カ域サ縺励※縺縺溷エ蜷医↓蛯吶∴繧 + Trace.TraceInformation( "繧ケ繧ュ繝ウ縺ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" ); + } + catch (Exception e) + { + Trace.TraceInformation( "繧ケ繧ュ繝ウ縺ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲" ); + throw; + } + finally + { + Trace.Unindent(); + } + //--------------------- + #endregion + //----------- + #region [ Timer 縺ョ蛻晄悄蛹 ] + //--------------------- + Trace.TraceInformation( "繧ソ繧、繝槭ョ蛻晄悄蛹悶r陦後>縺セ縺吶" ); + Trace.Indent(); + try + { + Timer = new CTimer( CTimer.E遞ョ蛻・.MultiMedia ); + Trace.TraceInformation( "繧ソ繧、繝槭ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + //--------------------- + #endregion + //----------- + + #region [ FPS 繧ォ繧ヲ繝ウ繧ソ縺ョ蛻晄悄蛹 ] + //--------------------- + Trace.TraceInformation( "FPS繧ォ繧ヲ繝ウ繧ソ縺ョ蛻晄悄蛹悶r陦後>縺セ縺吶" ); + Trace.Indent(); + try + { + FPS = new CFPS(); + Trace.TraceInformation( "FPS繧ォ繧ヲ繝ウ繧ソ繧堤函謌舌@縺セ縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + //--------------------- + #endregion + #region [ act譁蟄励さ繝ウ繧ス繝シ繝ォ縺ョ蛻晄悄蛹 ] + //--------------------- + Trace.TraceInformation( "譁蟄励さ繝ウ繧ス繝シ繝ォ縺ョ蛻晄悄蛹悶r陦後>縺セ縺吶" ); + Trace.Indent(); + try + { + act譁蟄励さ繝ウ繧ス繝シ繝ォ = new C譁蟄励さ繝ウ繧ス繝シ繝ォ(); + Trace.TraceInformation( "譁蟄励さ繝ウ繧ス繝シ繝ォ繧堤函謌舌@縺セ縺励◆縲" ); + act譁蟄励さ繝ウ繧ス繝シ繝ォ.On豢サ諤ァ蛹(); + Trace.TraceInformation( "譁蟄励さ繝ウ繧ス繝シ繝ォ繧呈エサ諤ァ蛹悶@縺セ縺励◆縲" ); + Trace.TraceInformation( "譁蟄励さ繝ウ繧ス繝シ繝ォ縺ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" ); + } + catch( Exception exception ) + { + Trace.TraceError( exception.ToString() ); + Trace.TraceError( "譁蟄励さ繝ウ繧ス繝シ繝ォ縺ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + //--------------------- + #endregion + #region [ Input邂。逅 縺ョ蛻晄悄蛹 ] + //--------------------- + Trace.TraceInformation( "DirectInput, MIDI蜈・蜉帙ョ蛻晄悄蛹悶r陦後>縺セ縺吶" ); + Trace.Indent(); + try + { + bool bUseMIDIIn = !DTXVmode.Enabled; + Input邂。逅 = new CInput邂。逅( base.Window.Handle, bUseMIDIIn ); + foreach( IInputDevice device in Input邂。逅.list蜈・蜉帙ョ繝舌う繧ケ ) + { + if( ( device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Joystick ) && !ConfigIni.dicJoystick.ContainsValue( device.GUID ) ) + { + int key = 0; + while( ConfigIni.dicJoystick.ContainsKey( key ) ) + { + key++; + } + ConfigIni.dicJoystick.Add( key, device.GUID ); + } + } + foreach( IInputDevice device2 in Input邂。逅.list蜈・蜉帙ョ繝舌う繧ケ ) + { + if( device2.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Joystick ) + { + foreach( KeyValuePair pair in ConfigIni.dicJoystick ) + { + if( device2.GUID.Equals( pair.Value ) ) + { + ( (CInputJoystick) device2 ).SetID( pair.Key ); + break; + } + } + continue; + } + } + Trace.TraceInformation( "DirectInput 縺ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" ); + } + catch( Exception exception2 ) + { + Trace.TraceError( "DirectInput, MIDI蜈・蜉帙ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲" ); + throw; + } + finally + { + Trace.Unindent(); + } + //--------------------- + #endregion + #region [ Pad 縺ョ蛻晄悄蛹 ] + //--------------------- + Trace.TraceInformation( "繝代ャ繝峨ョ蛻晄悄蛹悶r陦後>縺セ縺吶" ); + Trace.Indent(); + try + { + Pad = new CPad( ConfigIni, Input邂。逅 ); + Trace.TraceInformation( "繝代ャ繝峨ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" ); + } + catch( Exception exception3 ) + { + Trace.TraceError( exception3.ToString() ); + Trace.TraceError( "繝代ャ繝峨ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + //--------------------- + #endregion + #region [ Sound邂。逅 縺ョ蛻晄悄蛹 ] + //--------------------- + Trace.TraceInformation( "繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ョ蛻晄悄蛹悶r陦後>縺セ縺吶" ); + Trace.Indent(); + try + { + ESoundDeviceType soundDeviceType; + switch ( TJAPlayer3.ConfigIni.nSoundDeviceType ) + { + case 0: + soundDeviceType = ESoundDeviceType.DirectSound; + break; + case 1: + soundDeviceType = ESoundDeviceType.ASIO; + break; + case 2: + soundDeviceType = ESoundDeviceType.ExclusiveWASAPI; + break; + default: + soundDeviceType = ESoundDeviceType.Unknown; + break; + } + Sound邂。逅 = new CSound邂。逅(base.Window.Handle, + soundDeviceType, + TJAPlayer3.ConfigIni.nWASAPIBufferSizeMs, + // CDTXMania.ConfigIni.nASIOBufferSizeMs, + 0, + TJAPlayer3.ConfigIni.nASIODevice, + TJAPlayer3.ConfigIni.bUseOSTimer + ); + //Sound邂。逅 = FDK.CSound邂。逅.Instance; + //Sound邂。逅.t蛻晄悄蛹( soundDeviceType, 0, 0, CDTXMania.ConfigIni.nASIODevice, base.Window.Handle ); + + + Trace.TraceInformation("Initializing loudness scanning, song gain control, and sound group level control..."); + Trace.Indent(); + try + { + actScanningLoudness = new CActScanningLoudness(); + actScanningLoudness.On豢サ諤ァ蛹(); + LoudnessMetadataScanner.ScanningStateChanged += + (_, args) => actScanningLoudness.bIsActivelyScanning = args.IsActivelyScanning; + LoudnessMetadataScanner.StartBackgroundScanning(); + + SongGainController = new SongGainController(); + ConfigIniToSongGainControllerBinder.Bind(ConfigIni, SongGainController); + + SoundGroupLevelController = new SoundGroupLevelController(CSound.list繧、繝ウ繧ケ繧ソ繝ウ繧ケ); + ConfigIniToSoundGroupLevelControllerBinder.Bind(ConfigIni, SoundGroupLevelController); + } + finally + { + Trace.Unindent(); + Trace.TraceInformation("Initialized loudness scanning, song gain control, and sound group level control."); + } + + ShowWindowTitleWithSoundType(); + FDK.CSound邂。逅.bIsTimeStretch = TJAPlayer3.ConfigIni.bTimeStretch; + Sound邂。逅.nMasterVolume = TJAPlayer3.ConfigIni.nMasterVolume; + //FDK.CSound邂。逅.bIsMP3DecodeByWindowsCodec = CDTXMania.ConfigIni.bNoMP3Streaming; + Trace.TraceInformation( "繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" ); + } + catch (Exception e) + { + throw new NullReferenceException("繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺後イ縺ィ縺、繧よ怏蜉ケ縺ォ縺ェ縺」縺ヲ縺縺ェ縺縺溘a縲√し繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ョ蛻晄悄蛹悶′縺ァ縺阪∪縺帙s縺ァ縺励◆縲", e); + } + finally + { + Trace.Unindent(); + } + //--------------------- + #endregion + #region [ Songs邂。逅 縺ョ蛻晄悄蛹 ] + //--------------------- + Trace.TraceInformation( "譖イ繝ェ繧ケ繝医ョ蛻晄悄蛹悶r陦後>縺セ縺吶" ); + Trace.Indent(); + try + { + Songs邂。逅 = new CSongs邂。逅(); +// Songs邂。逅_陬剰ェュ = new CSongs邂。逅(); + EnumSongs = new CEnumSongs(); + actEnumSongs = new CActEnumSongs(); + Trace.TraceInformation( "譖イ繝ェ繧ケ繝医ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" ); + } + catch( Exception e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "譖イ繝ェ繧ケ繝医ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + //--------------------- + #endregion + #region [ CAvi 縺ョ蛻晄悄蛹 ] + //--------------------- + CAvi.t蛻晄悄蛹(); + //--------------------- + #endregion + #region [ Random 縺ョ蛻晄悄蛹 ] + //--------------------- + Random = new Random( (int) Timer.n繧キ繧ケ繝繝譎ょ綾 ); + //--------------------- + #endregion + #region [ 繧ケ繝繝シ繧ク縺ョ蛻晄悄蛹 ] + //--------------------- + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = null; + r逶エ蜑阪ョ繧ケ繝繝シ繧ク = null; + stage襍キ蜍 = new CStage襍キ蜍(); + stage繧ソ繧、繝医Ν = new CStage繧ソ繧、繝医Ν(); +// stage繧ェ繝励す繝ァ繝ウ = new CStage繧ェ繝励す繝ァ繝ウ(); + stage繧ウ繝ウ繝輔ぅ繧ー = new CStage繧ウ繝ウ繝輔ぅ繧ー(); + stage驕ク譖イ = new CStage驕ク譖イ(); + stage谿オ菴埼∈謚 = new CStage谿オ菴埼∈謚(); + stage譖イ隱ュ縺ソ霎シ縺ソ = new CStage譖イ隱ュ縺ソ霎シ縺ソ(); + stage貍泌・上ラ繝ゥ繝逕サ髱「 = new CStage貍泌・上ラ繝ゥ繝逕サ髱「(); + stage邨先棡 = new CStage邨先棡(); + stageChangeSkin = new CStageChangeSkin(); + stage邨ゆコ = new CStage邨ゆコ(); + NamePlate = new CNamePlate(); + this.list繝医ャ繝励Ξ繝吶ΝActivities = new List(); + this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( actEnumSongs ); + this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( act譁蟄励さ繝ウ繧ス繝シ繝ォ ); + this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage襍キ蜍 ); + this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage繧ソ繧、繝医Ν ); +// this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage繧ェ繝励す繝ァ繝ウ ); + this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage繧ウ繝ウ繝輔ぅ繧ー ); + this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage驕ク譖イ ); + this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage谿オ菴埼∈謚 ); + this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage譖イ隱ュ縺ソ霎シ縺ソ ); + this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage貍泌・上ラ繝ゥ繝逕サ髱「 ); + this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage邨先棡 ); + this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stageChangeSkin ); + this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( stage邨ゆコ ); + this.list繝医ャ繝励Ξ繝吶ΝActivities.Add( actFlushGPU ); + //--------------------- + #endregion + #region [ 繝励Λ繧ー繧、繝ウ縺ョ讀懃エ「縺ィ逕滓 ] + //--------------------- + PluginHost = new CPluginHost(); + + Trace.TraceInformation( "繝励Λ繧ー繧、繝ウ縺ョ讀懃エ「縺ィ逕滓舌r陦後>縺セ縺吶" ); + Trace.Indent(); + try + { + this.t繝励Λ繧ー繧、繝ウ讀懃エ「縺ィ逕滓(); + Trace.TraceInformation( "繝励Λ繧ー繧、繝ウ縺ョ讀懃エ「縺ィ逕滓舌r螳御コ縺励∪縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + //--------------------- + #endregion + #region [ 繝励Λ繧ー繧、繝ウ縺ョ蛻晄悄蛹 ] + //--------------------- + if( this.list繝励Λ繧ー繧、繝ウ != null && this.list繝励Λ繧ー繧、繝ウ.Count > 0 ) + { + Trace.TraceInformation( "繝励Λ繧ー繧、繝ウ縺ョ蛻晄悄蛹悶r陦後>縺セ縺吶" ); + Trace.Indent(); + try + { + foreach( STPlugin st in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( st.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + st.plugin.On蛻晄悄蛹( this.PluginHost ); + st.plugin.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + st.plugin.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + Trace.TraceInformation( "縺吶∋縺ヲ縺ョ繝励Λ繧ー繧、繝ウ縺ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" ); + } + catch + { + Trace.TraceError( "繝励Λ繧ー繧、繝ウ縺ョ縺ゥ繧後°縺ョ蛻晄悄蛹悶↓螟ア謨励@縺セ縺励◆縲" ); + throw; + } + finally + { + Trace.Unindent(); + } + } + + //--------------------- + #endregion + + #region Discord縺ョ蜃ヲ逅 + Discord.Initialize("784989629728161813"); + StartupTime = Discord.GetUnixTime(); + Discord.UpdatePresence("", Properties.Discord.Stage_StartUp, StartupTime); + #endregion + + + Trace.TraceInformation( "繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ蛻晄悄蛹悶r螳御コ縺励∪縺励◆縲" ); + + + #region [ 譛蛻昴ョ繧ケ繝繝シ繧ク縺ョ襍キ蜍 ] + //--------------------- + Trace.TraceInformation( "----------------------" ); + Trace.TraceInformation( "笆 襍キ蜍" ); + + if ( TJAPlayer3.b繧ウ繝ウ繝代け繝医Δ繝シ繝 ) + { + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage譖イ隱ュ縺ソ霎シ縺ソ; + } + else + { + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク = stage襍キ蜍; + } + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On豢サ諤ァ蛹(); + + //--------------------- + #endregion + } + + public void ShowWindowTitleWithSoundType() + { + string delay = ""; + if ( Sound邂。逅.GetCurrentSoundDeviceType() != "DirectSound" ) + { + delay = "(" + Sound邂。逅.GetSoundDelay() + "ms)"; + } + AssemblyName asmApp = Assembly.GetExecutingAssembly().GetName(); + base.Window.Text = asmApp.Name + " Ver." + VERSION + " (" + Sound邂。逅.GetCurrentSoundDeviceType() + delay + ")"; + } + + private void t邨ゆコ蜃ヲ逅() + { + if( !this.b邨ゆコ蜃ヲ逅螳御コ貂医∩ ) + { + Trace.TraceInformation( "----------------------" ); + Trace.TraceInformation( "笆 繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ邨ゆコ" ); + #region [ 譖イ讀懃エ「縺ョ邨ゆコ蜃ヲ逅 ] + //--------------------- + if ( actEnumSongs != null ) + { + Trace.TraceInformation( "譖イ讀懃エ「act縺ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶" ); + Trace.Indent(); + try + { + actEnumSongs.On髱樊エサ諤ァ蛹(); + actEnumSongs= null; + Trace.TraceInformation( "譖イ讀懃エ「act縺ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" ); + } + catch ( Exception e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "譖イ讀懃エ「act縺ョ邨ゆコ蜃ヲ逅縺ォ螟ア謨励@縺セ縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + } + //--------------------- + #endregion + #region [ 迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク縺ョ邨ゆコ蜃ヲ逅 ] + //--------------------- + if( TJAPlayer3.r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク != null && TJAPlayer3.r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.b豢サ諤ァ蛹悶@縺ヲ繧 ) // #25398 2011.06.07 MODIFY FROM + { + Trace.TraceInformation( "迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク繧堤オゆコ縺励∪縺吶" ); + Trace.Indent(); + try + { + r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.On髱樊エサ諤ァ蛹(); + Trace.TraceInformation( "迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク縺ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + } + //--------------------- + #endregion + #region [ 繝励Λ繧ー繧、繝ウ縺ョ邨ゆコ蜃ヲ逅 ] + //--------------------- + if (this.list繝励Λ繧ー繧、繝ウ != null && this.list繝励Λ繧ー繧、繝ウ.Count > 0) + { + Trace.TraceInformation( "縺吶∋縺ヲ縺ョ繝励Λ繧ー繧、繝ウ繧堤オゆコ縺励∪縺吶" ); + Trace.Indent(); + try + { + foreach( STPlugin st in this.list繝励Λ繧ー繧、繝ウ ) + { + Directory.SetCurrentDirectory( st.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 ); + st.plugin.OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + st.plugin.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + st.plugin.On邨ゆコ(); + Directory.SetCurrentDirectory( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 ); + } + PluginHost = null; + Trace.TraceInformation( "縺吶∋縺ヲ縺ョ繝励Λ繧ー繧、繝ウ縺ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + } + //--------------------- + #endregion + #region Discord縺ョ蜃ヲ逅 + Discord.Shutdown(); + #endregion + #region [ 譖イ繝ェ繧ケ繝医ョ邨ゆコ蜃ヲ逅 ] + //--------------------- + if (Songs邂。逅 != null) + { + Trace.TraceInformation( "譖イ繝ェ繧ケ繝医ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶" ); + Trace.Indent(); + try + { + Songs邂。逅 = null; + Trace.TraceInformation( "譖イ繝ェ繧ケ繝医ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" ); + } + catch( Exception exception ) + { + Trace.TraceError( exception.ToString() ); + Trace.TraceError( "譖イ繝ェ繧ケ繝医ョ邨ゆコ蜃ヲ逅縺ォ螟ア謨励@縺セ縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + } + CAvi.t邨ゆコ(); + //--------------------- + #endregion + #region TextureLoader縺ョ蜃ヲ逅 + Tx.DisposeTexture(); + #endregion + #region [ 繧ケ繧ュ繝ウ縺ョ邨ゆコ蜃ヲ逅 ] + //--------------------- + if (Skin != null) + { + Trace.TraceInformation( "繧ケ繧ュ繝ウ縺ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶" ); + Trace.Indent(); + try + { + Skin.Dispose(); + Skin = null; + Trace.TraceInformation( "繧ケ繧ュ繝ウ縺ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" ); + } + catch( Exception exception2 ) + { + Trace.TraceError( exception2.ToString() ); + Trace.TraceError( "繧ケ繧ュ繝ウ縺ョ邨ゆコ蜃ヲ逅縺ォ螟ア謨励@縺セ縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + } + //--------------------- + #endregion + #region [ DirectSound縺ョ邨ゆコ蜃ヲ逅 ] + //--------------------- + if (Sound邂。逅 != null) + { + Trace.TraceInformation( "DirectSound 縺ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶" ); + Trace.Indent(); + try + { + Sound邂。逅.Dispose(); + Sound邂。逅 = null; + Trace.TraceInformation( "DirectSound 縺ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" ); + } + catch( Exception exception3 ) + { + Trace.TraceError( exception3.ToString() ); + Trace.TraceError( "DirectSound 縺ョ邨ゆコ蜃ヲ逅縺ォ螟ア謨励@縺セ縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + } + //--------------------- + #endregion + #region [ 繝代ャ繝峨ョ邨ゆコ蜃ヲ逅 ] + //--------------------- + if (Pad != null) + { + Trace.TraceInformation( "繝代ャ繝峨ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶" ); + Trace.Indent(); + try + { + Pad = null; + Trace.TraceInformation( "繝代ャ繝峨ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" ); + } + catch( Exception exception4 ) + { + Trace.TraceError( exception4.ToString() ); + Trace.TraceError( "繝代ャ繝峨ョ邨ゆコ蜃ヲ逅縺ォ螟ア謨励@縺セ縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + } + //--------------------- + #endregion + #region [ DirectInput, MIDI蜈・蜉帙ョ邨ゆコ蜃ヲ逅 ] + //--------------------- + if (Input邂。逅 != null) + { + Trace.TraceInformation( "DirectInput, MIDI蜈・蜉帙ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶" ); + Trace.Indent(); + try + { + Input邂。逅.Dispose(); + Input邂。逅 = null; + Trace.TraceInformation( "DirectInput, MIDI蜈・蜉帙ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" ); + } + catch( Exception exception5 ) + { + Trace.TraceError( exception5.ToString() ); + Trace.TraceError( "DirectInput, MIDI蜈・蜉帙ョ邨ゆコ蜃ヲ逅縺ォ螟ア謨励@縺セ縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + } + //--------------------- + #endregion + #region [ 譁蟄励さ繝ウ繧ス繝シ繝ォ縺ョ邨ゆコ蜃ヲ逅 ] + //--------------------- + if (act譁蟄励さ繝ウ繧ス繝シ繝ォ != null) + { + Trace.TraceInformation( "譁蟄励さ繝ウ繧ス繝シ繝ォ縺ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶" ); + Trace.Indent(); + try + { + act譁蟄励さ繝ウ繧ス繝シ繝ォ.On髱樊エサ諤ァ蛹(); + act譁蟄励さ繝ウ繧ス繝シ繝ォ = null; + Trace.TraceInformation( "譁蟄励さ繝ウ繧ス繝シ繝ォ縺ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" ); + } + catch( Exception exception6 ) + { + Trace.TraceError( exception6.ToString() ); + Trace.TraceError( "譁蟄励さ繝ウ繧ス繝シ繝ォ縺ョ邨ゆコ蜃ヲ逅縺ォ螟ア謨励@縺セ縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + } + //--------------------- + #endregion + #region [ FPS繧ォ繧ヲ繝ウ繧ソ縺ョ邨ゆコ蜃ヲ逅 ] + //--------------------- + Trace.TraceInformation("FPS繧ォ繧ヲ繝ウ繧ソ縺ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶"); + Trace.Indent(); + try + { + if( FPS != null ) + { + FPS = null; + } + Trace.TraceInformation( "FPS繧ォ繧ヲ繝ウ繧ソ縺ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + //--------------------- + #endregion + #region [ 繧ソ繧、繝槭ョ邨ゆコ蜃ヲ逅 ] + //--------------------- + Trace.TraceInformation("繧ソ繧、繝槭ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶"); + Trace.Indent(); + try + { + if( Timer != null ) + { + Timer.Dispose(); + Timer = null; + Trace.TraceInformation( "繧ソ繧、繝槭ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" ); + } + else + { + Trace.TraceInformation( "繧ソ繧、繝槭ッ菴ソ逕ィ縺輔l縺ヲ縺縺セ縺帙s縲" ); + } + } + finally + { + Trace.Unindent(); + } + //--------------------- + #endregion + #region [ Config.ini縺ョ蜃コ蜉 ] + //--------------------- + Trace.TraceInformation("Config.ini 繧貞コ蜉帙@縺セ縺吶"); +// if ( ConfigIni.bIsSwappedGuitarBass ) // #24063 2011.1.16 yyagi 繧ョ繧ソ繝シ繝吶シ繧ケ縺後せ繝ッ繝繝励@縺ヲ縺繧九→縺阪ッ蜈縺ォ謌サ縺 + string str = strEXE縺ョ縺ゅk繝輔か繝ォ繝 + "Config.ini"; + Trace.Indent(); + try + { + if ( DTXVmode.Enabled ) + { + DTXVmode.tUpdateConfigIni(); + Trace.TraceInformation( "DTXV繝「繝シ繝峨ョ險ュ螳壽ュ蝣ア繧偵,onfig.ini縺ォ菫晏ュ倥@縺セ縺励◆縲" ); + } + else + { + ConfigIni.t譖ク縺榊コ縺( str ); + Trace.TraceInformation( "菫晏ュ倥@縺セ縺励◆縲({0})", str ); + } + } + catch( Exception e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "Config.ini 縺ョ蜃コ蜉帙↓螟ア謨励@縺セ縺励◆縲({0})", str ); + } + finally + { + Trace.Unindent(); + } + + Trace.TraceInformation("Deinitializing loudness scanning, song gain control, and sound group level control..."); + Trace.Indent(); + try + { + SoundGroupLevelController = null; + SongGainController = null; + LoudnessMetadataScanner.StopBackgroundScanning(joinImmediately: true); + actScanningLoudness.On髱樊エサ諤ァ蛹(); + actScanningLoudness = null; + } + finally + { + Trace.Unindent(); + Trace.TraceInformation("Deinitialized loudness scanning, song gain control, and sound group level control."); + } + + ConfigIni = null; + + //--------------------- + #endregion + #region [ DTXVmode縺ョ邨ゆコ蜃ヲ逅 ] + //--------------------- + //Trace.TraceInformation( "DTXV繝「繝シ繝峨ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶" ); + //Trace.Indent(); + try + { + if ( DTXVmode != null ) + { + DTXVmode = null; + //Trace.TraceInformation( "DTXV繝「繝シ繝峨ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" ); + } + else + { + //Trace.TraceInformation( "DTXV繝「繝シ繝峨ッ菴ソ逕ィ縺輔l縺ヲ縺縺セ縺帙s縲" ); + } + } + finally + { + //Trace.Unindent(); + } + //--------------------- + #endregion + #region [ DirectX縺ョ邨ゆコ蜃ヲ逅 ] + base.GraphicsDeviceManager.Dispose(); + #endregion + Trace.TraceInformation( "繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ョ邨ゆコ蜃ヲ逅繧貞ョ御コ縺励∪縺励◆縲" ); + + + this.b邨ゆコ蜃ヲ逅螳御コ貂医∩ = true; + } + } + private CScoreIni tScoreIni縺クBGMAdjust縺ィHistory縺ィPlayCount繧呈峩譁ー(string str譁ー繝偵せ繝医Μ陦) + { + bool bIsUpdatedDrums, bIsUpdatedGuitar, bIsUpdatedBass; + string strFilename = DTX.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ + ".score.ini"; + CScoreIni ini = new CScoreIni( strFilename ); + if( !File.Exists( strFilename ) ) + { + ini.st繝輔ぃ繧、繝ォ.Title = DTX.TITLE; + ini.st繝輔ぃ繧、繝ォ.Name = DTX.str繝輔ぃ繧、繝ォ蜷; + ini.st繝輔ぃ繧、繝ォ.Hash = CScoreIni.t繝輔ぃ繧、繝ォ縺ョMD5繧呈アゅa縺ヲ霑斐☆( DTX.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ ); + for( int i = 0; i < 6; i++ ) + { + ini.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].nPerfect縺ォ縺ェ繧狗ッ蝗イms = nPerfect遽蝗イms; + ini.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].nGreat縺ォ縺ェ繧狗ッ蝗イms = nGreat遽蝗イms; + ini.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].nGood縺ォ縺ェ繧狗ッ蝗イms = nGood遽蝗イms; + ini.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].nPoor縺ォ縺ェ繧狗ッ蝗イms = nPoor遽蝗イms; + } + } + ini.st繝輔ぃ繧、繝ォ.BGMAdjust = DTX.nBGMAdjust; + CScoreIni.t譖エ譁ー譚。莉カ繧貞叙蠕励☆繧( out bIsUpdatedDrums, out bIsUpdatedGuitar, out bIsUpdatedBass ); + if( bIsUpdatedDrums || bIsUpdatedGuitar || bIsUpdatedBass ) + { + if( bIsUpdatedDrums ) + { + ini.st繝輔ぃ繧、繝ォ.PlayCountDrums++; + } + if( bIsUpdatedGuitar ) + { + ini.st繝輔ぃ繧、繝ォ.PlayCountGuitar++; + } + if( bIsUpdatedBass ) + { + ini.st繝輔ぃ繧、繝ォ.PlayCountBass++; + } + ini.t繝偵せ繝医Μ繧定ソス蜉縺吶k( str譁ー繝偵せ繝医Μ陦 ); + if( !b繧ウ繝ウ繝代け繝医Δ繝シ繝 ) + { + stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞屓謨ー.Drums = ini.st繝輔ぃ繧、繝ォ.PlayCountDrums; + stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞屓謨ー.Guitar = ini.st繝輔ぃ繧、繝ォ.PlayCountGuitar; + stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞屓謨ー.Bass = ini.st繝輔ぃ繧、繝ォ.PlayCountBass; + for( int j = 0; j < ini.st繝輔ぃ繧、繝ォ.History.Length; j++ ) + { + stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞ア・豁エ[ j ] = ini.st繝輔ぃ繧、繝ォ.History[ j ]; + } + } + } + if( ConfigIni.bScoreIni繧貞コ蜉帙☆繧 ) + { + ini.t譖ク縺榊コ縺( strFilename ); + } + + return ini; + } + private void t繧ャ繝吶シ繧ク繧ウ繝ャ繧ッ繧キ繝ァ繝ウ繧貞ョ溯。後☆繧() + { + GC.Collect(GC.MaxGeneration); + GC.WaitForPendingFinalizers(); + GC.Collect(GC.MaxGeneration); + } + private void t繝励Λ繧ー繧、繝ウ讀懃エ「縺ィ逕滓() + { + this.list繝励Λ繧ー繧、繝ウ = new List(); + + string strIPluginActivity縺ョ蜷榊燕 = typeof( IPluginActivity ).FullName; + string str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝繝代せ = strEXE縺ョ縺ゅk繝輔か繝ォ繝 + "Plugins\\"; + + this.t謖螳壹ヵ繧ゥ繝ォ繝蜀縺ァ縺ョ繝励Λ繧ー繧、繝ウ讀懃エ「縺ィ逕滓( str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝繝代せ, strIPluginActivity縺ョ蜷榊燕 ); + + if( this.list繝励Λ繧ー繧、繝ウ.Count > 0 ) + Trace.TraceInformation( this.list繝励Λ繧ー繧、繝ウ.Count + " 蛟九ョ繝励Λ繧ー繧、繝ウ繧定ェュ縺ソ霎シ縺ソ縺セ縺励◆縲" ); + } + + public void RefleshSkin() + { + Trace.TraceInformation("繧ケ繧ュ繝ウ螟画峩:" + TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName(false)); + + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.On髱樊エサ諤ァ蛹(); + + TJAPlayer3.Skin.Dispose(); + TJAPlayer3.Skin = null; + TJAPlayer3.Skin = new CSkin(TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName, false); + + + TJAPlayer3.Tx.DisposeTexture(); + TJAPlayer3.Tx.LoadTexture(); + + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.On豢サ諤ァ蛹(); + } + #region [ Window繧、繝吶Φ繝亥ヲ逅 ] + private void t謖螳壹ヵ繧ゥ繝ォ繝蜀縺ァ縺ョ繝励Λ繧ー繧、繝ウ讀懃エ「縺ィ逕滓( string str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝繝代せ, string str繝励Λ繧ー繧、繝ウ蝙句錐 ) + { + // 謖螳壹&繧後◆繝代せ縺悟ュ伜惠縺励↑縺縺ィ繧ィ繝ゥ繝シ + if( !Directory.Exists( str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝繝代せ ) ) + { + Trace.TraceWarning( "繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝縺悟ュ伜惠縺励∪縺帙s縲(" + str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝繝代せ + ")" ); + return; + } + + // (1) 縺吶∋縺ヲ縺ョ *.dll 縺ォ縺、縺縺ヲ窶ヲ + string[] strDLLs = System.IO.Directory.GetFiles( str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝繝代せ, "*.dll" ); + foreach( string dllName in strDLLs ) + { + try + { + // (1-1) dll 繧偵い繧サ繝ウ繝悶Μ縺ィ縺励※隱ュ縺ソ霎シ繧縲 + System.Reflection.Assembly asm = System.Reflection.Assembly.LoadFrom( dllName ); + + // (1-2) 繧「繧サ繝ウ繝悶Μ蜀縺ョ縺吶∋縺ヲ縺ョ蝙九↓縺、縺縺ヲ縲√励Λ繧ー繧、繝ウ縺ィ縺励※譛牙柑縺玖ェソ縺ケ繧 + foreach( Type t in asm.GetTypes() ) + { + // (1-3) 竊薙け繝ゥ繧ケ縺ァ縺ゅj竊撤ublic縺ァ縺ゅj竊捺歓雎。繧ッ繝ゥ繧ケ縺ァ縺ェ縺鞘的Plugin蝙九ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺御ス懊l繧九蝙九r謖√▲縺ヲ縺繧後ー譛牙柑 + if( t.IsClass && t.IsPublic && !t.IsAbstract && t.GetInterface( str繝励Λ繧ー繧、繝ウ蝙句錐 ) != null ) + { + // (1-4) 繧ッ繝ゥ繧ケ蜷阪°繧峨う繝ウ繧ケ繧ソ繝ウ繧ケ繧剃ス懈舌☆繧 + var st = new STPlugin() { + plugin = (IPluginActivity) asm.CreateInstance( t.FullName ), + str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝 = Path.GetDirectoryName( dllName ), + str繧「繧サ繝ウ繝悶Μ邁。譏灘錐 = asm.GetName().Name, + Version = asm.GetName().Version, + }; + + // (1-5) 繝励Λ繧ー繧、繝ウ繝ェ繧ケ繝医∈逋サ骭イ + this.list繝励Λ繧ー繧、繝ウ.Add( st ); + Trace.TraceInformation( "繝励Λ繧ー繧、繝ウ {0} ({1}, {2}, {3}) 繧定ェュ縺ソ霎シ縺ソ縺セ縺励◆縲", t.FullName, Path.GetFileName( dllName ), st.str繧「繧サ繝ウ繝悶Μ邁。譏灘錐, st.Version.ToString() ); + } + } + } + catch (Exception e) + { + Trace.TraceError( e.ToString() ); + Trace.TraceInformation( dllName + " 縺九i繝励Λ繧ー繧、繝ウ繧堤函謌舌☆繧九%縺ィ縺ォ螟ア謨励@縺セ縺励◆縲ゅせ繧ュ繝繝励@縺セ縺吶" ); + } + } + + // (2) 繧オ繝悶ヵ繧ゥ繝ォ繝縺後≠繧後ー蜀榊クー縺吶k + string[] strDirs = Directory.GetDirectories( str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝繝代せ, "*" ); + foreach( string dir in strDirs ) + this.t謖螳壹ヵ繧ゥ繝ォ繝蜀縺ァ縺ョ繝励Λ繧ー繧、繝ウ讀懃エ「縺ィ逕滓( dir + "\\", str繝励Λ繧ー繧、繝ウ蝙句錐 ); + } + //----------------- + private void Window_ApplicationActivated( object sender, EventArgs e ) + { + this.bApplicationActive = true; + } + private void Window_ApplicationDeactivated( object sender, EventArgs e ) + { + this.bApplicationActive = false; + } + private void Window_KeyDown( object sender, KeyEventArgs e ) + { + if ( e.KeyCode == Keys.Menu ) + { + e.Handled = true; + e.SuppressKeyPress = true; + } + else if ( ( e.KeyCode == Keys.Return ) && e.Alt ) + { + if ( ConfigIni != null ) + { + ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝 = !ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝; + this.t蜈ィ逕サ髱「_繧ヲ繧」繝ウ繝峨え繝「繝シ繝牙繧頑崛縺(); + } + e.Handled = true; + e.SuppressKeyPress = true; + } + else + { + for ( int i = 0; i < 0x10; i++ ) + { + if ( ConfigIni.KeyAssign.System.Capture[ i ].繧ウ繝シ繝 > 0 && + e.KeyCode == DeviceConstantConverter.KeyToKeyCode( (SlimDXKeys.Key) ConfigIni.KeyAssign.System.Capture[ i ].繧ウ繝シ繝 ) ) + { + // Debug.WriteLine( "capture: " + string.Format( "{0:2x}", (int) e.KeyCode ) + " " + (int) e.KeyCode ); + string strFullPath = + Path.Combine( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝, "Capture_img" ); + strFullPath = Path.Combine( strFullPath, DateTime.Now.ToString( "yyyyMMddHHmmss" ) + ".png" ); + SaveResultScreen( strFullPath ); + } + } + } + } + private void Window_MouseUp( object sender, MouseEventArgs e ) + { + mb = e.Button; + } + + private void Window_MouseDoubleClick( object sender, MouseEventArgs e) // #23510 2010.11.13 yyagi: to go full screen mode + { + if ( mb.Equals(MouseButtons.Left) && ConfigIni.bIsAllowedDoubleClickFullscreen ) // #26752 2011.11.27 yyagi + { + ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝 = false; + this.t蜈ィ逕サ髱「_繧ヲ繧」繝ウ繝峨え繝「繝シ繝牙繧頑崛縺(); + } + } + private void Window_ResizeEnd(object sender, EventArgs e) // #23510 2010.11.20 yyagi: to get resized window size + { + if ( ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝 ) + { + ConfigIni.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョX = base.Window.Location.X; // #30675 2013.02.04 ikanick add + ConfigIni.n蛻晄悄繧ヲ繧」繝ウ繝峨え髢句ァ倶ス咲スョY = base.Window.Location.Y; // + } + + ConfigIni.n繧ヲ繧、繝ウ繝峨えwidth = (ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝) ? base.Window.ClientSize.Width : currentClientSize.Width; // #23510 2010.10.31 yyagi add + ConfigIni.n繧ヲ繧、繝ウ繝峨えheight = (ConfigIni.b繧ヲ繧」繝ウ繝峨え繝「繝シ繝) ? base.Window.ClientSize.Height : currentClientSize.Height; + } + #endregion + #endregion + } +} diff --git a/TJAPlayer3/DTXManiaGR.exe.x86.manifest b/TJAPlayer3/DTXManiaGR.exe.x86.manifest new file mode 100644 index 00000000..0bfcb3b0 --- /dev/null +++ b/TJAPlayer3/DTXManiaGR.exe.x86.manifest @@ -0,0 +1,8 @@ +サソ + + + + + + + \ No newline at end of file diff --git a/TJAPlayer3/GlobalSuppressions.cs b/TJAPlayer3/GlobalSuppressions.cs new file mode 100644 index 00000000..92c01f87 Binary files /dev/null and b/TJAPlayer3/GlobalSuppressions.cs differ diff --git a/TJAPlayer3/Items/CItemBase.cs b/TJAPlayer3/Items/CItemBase.cs new file mode 100644 index 00000000..7a1be928 --- /dev/null +++ b/TJAPlayer3/Items/CItemBase.cs @@ -0,0 +1,120 @@ +サソusing System; +using System.Globalization; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; + +namespace TJAPlayer3 +{ + /// + /// 縺吶∋縺ヲ縺ョ繧「繧、繝繝縺ョ蝓コ譛ャ繧ッ繝ゥ繧ケ縲 + /// + internal class CItemBase + { + // 繝励Ο繝代ユ繧」 + + public E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・; + public enum E繝代ロ繝ォ遞ョ蛻・ + { + 騾壼クク, + 縺昴ョ莉 + } + + public E遞ョ蛻・ e遞ョ蛻・; + public enum E遞ョ蛻・ + { + 蝓コ譛ャ蠖「, + ONorOFF繝医げ繝ォ, + ONorOFFor荳榊ョ壹せ繝ェ繝シ繧ケ繝繝シ繝, + 謨エ謨ー, + 繝ェ繧ケ繝, + 蛻譖ソ繝ェ繧ケ繝 + } + + public string str鬆逶ョ蜷; + public string str隱ャ譏取枚; + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CItemBase() + { + this.str鬆逶ョ蜷 = ""; + this.str隱ャ譏取枚 = ""; + } + public CItemBase( string str鬆逶ョ蜷 ) + : this() + { + this.t蛻晄悄蛹( str鬆逶ョ蜷 ); + } + public CItemBase(string str鬆逶ョ蜷, string str隱ャ譏取枚jp) + : this() { + this.t蛻晄悄蛹(str鬆逶ョ蜷, str隱ャ譏取枚jp); + } + public CItemBase(string str鬆逶ョ蜷, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) + : this() { + this.t蛻晄悄蛹(str鬆逶ョ蜷, str隱ャ譏取枚jp, str隱ャ譏取枚en); + } + + public CItemBase(string str鬆逶ョ蜷, E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・) + : this() + { + this.t蛻晄悄蛹( str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・ ); + } + public CItemBase(string str鬆逶ョ蜷, E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp) + : this() { + this.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp); + } + public CItemBase(string str鬆逶ョ蜷, E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) + : this() { + this.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚en); + } + + + // 繝。繧ス繝繝会シ帛ュ舌け繝ゥ繧ケ縺ァ螳溯」縺吶k + + public virtual void tEnter謚シ荳() + { + } + public virtual void t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍() + { + } + public virtual void t鬆逶ョ蛟、繧貞燕縺ク遘サ蜍() + { + } + public virtual void t蛻晄悄蛹( string str鬆逶ョ蜷 ) + { + this.t蛻晄悄蛹( str鬆逶ョ蜷, E繝代ロ繝ォ遞ョ蛻・.騾壼クク ); + } + public virtual void t蛻晄悄蛹(string str鬆逶ョ蜷, string str隱ャ譏取枚jp) { + this.t蛻晄悄蛹(str鬆逶ョ蜷, E繝代ロ繝ォ遞ョ蛻・.騾壼クク, str隱ャ譏取枚jp, str隱ャ譏取枚jp); + } + public virtual void t蛻晄悄蛹(string str鬆逶ョ蜷, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) { + this.t蛻晄悄蛹(str鬆逶ョ蜷, E繝代ロ繝ォ遞ョ蛻・.騾壼クク, str隱ャ譏取枚jp, str隱ャ譏取枚en); + } + + public virtual void t蛻晄悄蛹( string str鬆逶ョ蜷, E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・ ) + { + this.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, "", ""); + } + public virtual void t蛻晄悄蛹(string str鬆逶ョ蜷, E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp) { + this.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚jp); + } + public virtual void t蛻晄悄蛹(string str鬆逶ョ蜷, E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) { + this.str鬆逶ョ蜷 = str鬆逶ョ蜷; + this.e繝代ロ繝ォ遞ョ蛻・ = e繝代ロ繝ォ遞ョ蛻・; + this.str隱ャ譏取枚 = (CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ja") ? str隱ャ譏取枚jp : str隱ャ譏取枚en; + } + public virtual object obj迴セ蝨ィ蛟、() + { + return null; + } + public virtual int GetIndex() + { + return 0; + } + public virtual void SetIndex( int index ) + { + } + } +} diff --git a/TJAPlayer3/Items/CItemInteger.cs b/TJAPlayer3/Items/CItemInteger.cs new file mode 100644 index 00000000..d86f7832 --- /dev/null +++ b/TJAPlayer3/Items/CItemInteger.cs @@ -0,0 +1,125 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; + +namespace TJAPlayer3 +{ + /// + /// 縲梧紛謨ー縲阪r陦ィ縺吶い繧、繝繝縲 + /// + internal class CItemInteger : CItemBase + { + // 繝励Ο繝代ユ繧」 + + public int n迴セ蝨ィ縺ョ蛟、; + public bool b蛟、縺後ヵ繧ゥ繝シ繧ォ繧ケ縺輔l縺ヲ縺繧; + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CItemInteger() + { + base.e遞ョ蛻・ = CItemBase.E遞ョ蛻・.謨エ謨ー; + this.n譛蟆丞、 = 0; + this.n譛螟ァ蛟、 = 0; + this.n迴セ蝨ィ縺ョ蛟、 = 0; + this.b蛟、縺後ヵ繧ゥ繝シ繧ォ繧ケ縺輔l縺ヲ縺繧 = false; + } + public CItemInteger( string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、 ) + : this() + { + this.t蛻晄悄蛹( str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、 ); + } + public CItemInteger(string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, string str隱ャ譏取枚jp) + : this() { + this.t蛻晄悄蛹(str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, str隱ャ譏取枚jp); + } + public CItemInteger(string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) + : this() { + this.t蛻晄悄蛹(str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, str隱ャ譏取枚jp, str隱ャ譏取枚en); + } + + + public CItemInteger( string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・ ) + : this() + { + this.t蛻晄悄蛹( str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, e繝代ロ繝ォ遞ョ蛻・ ); + } + public CItemInteger(string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp) + : this() { + this.t蛻晄悄蛹(str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp); + } + public CItemInteger(string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) + : this() { + this.t蛻晄悄蛹(str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚en); + } + + + // CItemBase 螳溯」 + + public override void tEnter謚シ荳() + { + this.b蛟、縺後ヵ繧ゥ繝シ繧ォ繧ケ縺輔l縺ヲ縺繧 = !this.b蛟、縺後ヵ繧ゥ繝シ繧ォ繧ケ縺輔l縺ヲ縺繧; + } + public override void t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍() + { + if( ++this.n迴セ蝨ィ縺ョ蛟、 > this.n譛螟ァ蛟、 ) + { + this.n迴セ蝨ィ縺ョ蛟、 = this.n譛螟ァ蛟、; + } + } + public override void t鬆逶ョ蛟、繧貞燕縺ク遘サ蜍() + { + if( --this.n迴セ蝨ィ縺ョ蛟、 < this.n譛蟆丞、 ) + { + this.n迴セ蝨ィ縺ョ蛟、 = this.n譛蟆丞、; + } + } + public void t蛻晄悄蛹( string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、 ) + { + this.t蛻晄悄蛹( str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, "", "" ); + } + public void t蛻晄悄蛹(string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, string str隱ャ譏取枚jp) { + this.t蛻晄悄蛹(str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, str隱ャ譏取枚jp, str隱ャ譏取枚jp); + } + public void t蛻晄悄蛹(string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) { + this.t蛻晄悄蛹(str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, str隱ャ譏取枚jp, str隱ャ譏取枚en); + } + + + public void t蛻晄悄蛹( string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・ ) + { + this.t蛻晄悄蛹( str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, e繝代ロ繝ォ遞ョ蛻・, "", "" ); + } + public void t蛻晄悄蛹(string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp) { + this.t蛻晄悄蛹(str鬆逶ョ蜷, n譛蟆丞、, n譛螟ァ蛟、, n蛻晄悄蛟、, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚jp); + } + public void t蛻晄悄蛹(string str鬆逶ョ蜷, int n譛蟆丞、, int n譛螟ァ蛟、, int n蛻晄悄蛟、, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) { + base.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚en); + this.n譛蟆丞、 = n譛蟆丞、; + this.n譛螟ァ蛟、 = n譛螟ァ蛟、; + this.n迴セ蝨ィ縺ョ蛟、 = n蛻晄悄蛟、; + this.b蛟、縺後ヵ繧ゥ繝シ繧ォ繧ケ縺輔l縺ヲ縺繧 = false; + } + public override object obj迴セ蝨ィ蛟、() + { + return this.n迴セ蝨ィ縺ョ蛟、; + } + public override int GetIndex() + { + return this.n迴セ蝨ィ縺ョ蛟、; + } + public override void SetIndex( int index ) + { + this.n迴セ蝨ィ縺ョ蛟、 = index; + } + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private int n譛蟆丞、; + private int n譛螟ァ蛟、; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Items/CItemList.cs b/TJAPlayer3/Items/CItemList.cs new file mode 100644 index 00000000..4035bdb1 --- /dev/null +++ b/TJAPlayer3/Items/CItemList.cs @@ -0,0 +1,153 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; + +namespace TJAPlayer3 +{ + /// + /// 縲後Μ繧ケ繝医搾シ郁、謨ー縺ョ蝗コ螳壼、縺九i縺ョシ代▽繧帝∈謚槫庄閭スシ峨r陦ィ縺吶い繧、繝繝縲 + /// + internal class CItemList : CItemBase + { + // 繝励Ο繝代ユ繧」 + + public List list鬆逶ョ蛟、; + public int n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ; + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CItemList() + { + base.e遞ョ蛻・ = CItemBase.E遞ョ蛻・.繝ェ繧ケ繝; + this.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ = 0; + this.list鬆逶ョ蛟、 = new List(); + } + public CItemList( string str鬆逶ョ蜷 ) + : this() + { + this.t蛻晄悄蛹( str鬆逶ョ蜷 ); + } + public CItemList( string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・ ) + : this() + { + this.t蛻晄悄蛹( str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・ ); + } + public CItemList( string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, int n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, params string[] arg鬆逶ョ繝ェ繧ケ繝 ) + : this() + { + this.t蛻晄悄蛹( str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, arg鬆逶ョ繝ェ繧ケ繝 ); + } + public CItemList(string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, int n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, string str隱ャ譏取枚jp, params string[] arg鬆逶ョ繝ェ繧ケ繝) + : this() { + this.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, str隱ャ譏取枚jp, arg鬆逶ョ繝ェ繧ケ繝); + } + public CItemList(string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, int n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, string str隱ャ譏取枚jp, string str隱ャ譏取枚en, params string[] arg鬆逶ョ繝ェ繧ケ繝) + : this() { + this.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, str隱ャ譏取枚jp, str隱ャ譏取枚en, arg鬆逶ョ繝ェ繧ケ繝); + } + + + // CItemBase 螳溯」 + + public override void tEnter謚シ荳() + { + this.t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍(); + } + public override void t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍() + { + if( ++this.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ >= this.list鬆逶ョ蛟、.Count ) + { + this.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ = 0; + } + } + public override void t鬆逶ョ蛟、繧貞燕縺ク遘サ蜍() + { + if( --this.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ < 0 ) + { + this.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ = this.list鬆逶ョ蛟、.Count - 1; + } + } + public override void t蛻晄悄蛹( string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・ ) + { + base.t蛻晄悄蛹( str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・ ); + this.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ = 0; + this.list鬆逶ョ蛟、.Clear(); + } + public void t蛻晄悄蛹( string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, int n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, params string[] arg鬆逶ョ繝ェ繧ケ繝 ) + { + this.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, "", "",arg鬆逶ョ繝ェ繧ケ繝); + } + public void t蛻晄悄蛹(string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, int n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, string str隱ャ譏取枚jp, params string[] arg鬆逶ョ繝ェ繧ケ繝) { + this.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, str隱ャ譏取枚jp, str隱ャ譏取枚jp, arg鬆逶ョ繝ェ繧ケ繝); + } + public void t蛻晄悄蛹(string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, int n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, string str隱ャ譏取枚jp, string str隱ャ譏取枚en, params string[] arg鬆逶ョ繝ェ繧ケ繝) { + base.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚en); + this.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ = n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、; + foreach (string str in arg鬆逶ョ繝ェ繧ケ繝) { + this.list鬆逶ョ蛟、.Add(str); + } + } + public override object obj迴セ蝨ィ蛟、() + { + return this.list鬆逶ョ蛟、[ n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ ]; + } + public override int GetIndex() + { + return n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ; + } + public override void SetIndex( int index ) + { + n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ = index; + } + } + + + + + /// + /// 邁。譏薙さ繝ウ繝輔ぅ繧ー縺ョ縲悟繧頑崛縺医阪↓菴ソ逕ィ縺吶k縲√後Μ繧ケ繝医搾シ郁、謨ー縺ョ蝗コ螳壼、縺九i縺ョシ代▽繧帝∈謚槫庄閭スシ峨r陦ィ縺吶い繧、繝繝縲 + /// e遞ョ蛻・縺碁&縺縺ョ縺ィ縲》Enter謚シ荳()縺ァ菴輔b縺励↑縺莉・螟悶ッ縲√後Μ繧ケ繝医阪◎縺ョ縺セ縺セ縲 + /// + internal class CSwitchItemList : CItemList + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CSwitchItemList() + { + base.e遞ョ蛻・ = CItemBase.E遞ョ蛻・.蛻譖ソ繝ェ繧ケ繝; + this.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ = 0; + this.list鬆逶ョ蛟、 = new List(); + } + public CSwitchItemList( string str鬆逶ョ蜷 ) + : this() + { + this.t蛻晄悄蛹( str鬆逶ョ蜷 ); + } + public CSwitchItemList( string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・ ) + : this() + { + this.t蛻晄悄蛹( str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・ ); + } + public CSwitchItemList( string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, int n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, params string[] arg鬆逶ョ繝ェ繧ケ繝 ) + : this() + { + this.t蛻晄悄蛹( str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, arg鬆逶ョ繝ェ繧ケ繝 ); + } + public CSwitchItemList(string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, int n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, string str隱ャ譏取枚jp, params string[] arg鬆逶ョ繝ェ繧ケ繝) + : this() { + this.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, str隱ャ譏取枚jp, arg鬆逶ョ繝ェ繧ケ繝); + } + public CSwitchItemList( string str鬆逶ョ蜷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, int n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, string str隱ャ譏取枚jp, string str隱ャ譏取枚en, params string[] arg鬆逶ョ繝ェ繧ケ繝 ) + : this() + { + this.t蛻晄悄蛹( str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, n蛻晄悄繧、繝ウ繝繝繧ッ繧ケ蛟、, str隱ャ譏取枚jp, str隱ャ譏取枚en, arg鬆逶ョ繝ェ繧ケ繝 ); + } + + public override void tEnter謚シ荳() + { + // this.t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍(); // 菴輔b縺励↑縺 + } + } + +} diff --git a/TJAPlayer3/Items/CItemThreeState.cs b/TJAPlayer3/Items/CItemThreeState.cs new file mode 100644 index 00000000..bc6f5622 --- /dev/null +++ b/TJAPlayer3/Items/CItemThreeState.cs @@ -0,0 +1,154 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; + +namespace TJAPlayer3 +{ + /// + /// 縲後せ繝ェ繝シ繧ケ繝繝シ繝医搾シON, OFF, 荳榊ョ 縺ョ3迥カ諷具シ峨r陦ィ縺吶い繧、繝繝縲 + /// + internal class CItemThreeState : CItemBase + { + // 繝励Ο繝代ユ繧」 + + public E迥カ諷 e迴セ蝨ィ縺ョ迥カ諷; + public enum E迥カ諷 + { + ON, + OFF, + 荳榊ョ + } + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CItemThreeState() + { + base.e遞ョ蛻・ = CItemBase.E遞ョ蛻・.ONorOFFor荳榊ョ壹せ繝ェ繝シ繧ケ繝繝シ繝; + this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.荳榊ョ; + } + public CItemThreeState( string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷 ) + : this() + { + this.t蛻晄悄蛹( str鬆逶ョ蜷, e蛻晄悄迥カ諷 ); + } + public CItemThreeState(string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, string str隱ャ譏取枚jp) + : this() { + this.t蛻晄悄蛹(str鬆逶ョ蜷, e蛻晄悄迥カ諷, str隱ャ譏取枚jp, str隱ャ譏取枚jp); + } + public CItemThreeState(string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) + : this() { + this.t蛻晄悄蛹(str鬆逶ョ蜷, e蛻晄悄迥カ諷, str隱ャ譏取枚jp, str隱ャ譏取枚en); + } + + public CItemThreeState( string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・ ) + : this() + { + this.t蛻晄悄蛹( str鬆逶ョ蜷, e蛻晄悄迥カ諷, e繝代ロ繝ォ遞ョ蛻・ ); + } + public CItemThreeState(string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp) + : this() { + this.t蛻晄悄蛹(str鬆逶ョ蜷, e蛻晄悄迥カ諷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚jp); + } + public CItemThreeState(string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) + : this() { + this.t蛻晄悄蛹(str鬆逶ョ蜷, e蛻晄悄迥カ諷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚en); + } + + + // CItemBase 螳溯」 + + public override void tEnter謚シ荳() + { + this.t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍(); + } + public override void t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍() + { + switch( this.e迴セ蝨ィ縺ョ迥カ諷 ) + { + case E迥カ諷.ON: + this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.OFF; + return; + + case E迥カ諷.OFF: + this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.ON; + return; + + case E迥カ諷.荳榊ョ: + this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.ON; + return; + } + } + public override void t鬆逶ョ蛟、繧貞燕縺ク遘サ蜍() + { + switch( this.e迴セ蝨ィ縺ョ迥カ諷 ) + { + case E迥カ諷.ON: + this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.OFF; + return; + + case E迥カ諷.OFF: + this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.ON; + return; + + case E迥カ諷.荳榊ョ: + this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.OFF; + return; + } + } + public void t蛻晄悄蛹( string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷 ) + { + this.t蛻晄悄蛹( str鬆逶ョ蜷, e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク ); + } + public void t蛻晄悄蛹(string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, string str隱ャ譏取枚jp) { + this.t蛻晄悄蛹(str鬆逶ョ蜷, e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, str隱ャ譏取枚jp, str隱ャ譏取枚jp); + } + public void t蛻晄悄蛹(string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) { + this.t蛻晄悄蛹(str鬆逶ョ蜷, e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, str隱ャ譏取枚jp, str隱ャ譏取枚en); + } + + public void t蛻晄悄蛹( string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・ ) + { + this.t蛻晄悄蛹(str鬆逶ョ蜷, e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, "", ""); + } + public void t蛻晄悄蛹(string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp) { + this.t蛻晄悄蛹(str鬆逶ョ蜷, e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, str隱ャ譏取枚jp, str隱ャ譏取枚jp); + } + public void t蛻晄悄蛹(string str鬆逶ョ蜷, E迥カ諷 e蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) { + base.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚en); + this.e迴セ蝨ィ縺ョ迥カ諷 = e蛻晄悄迥カ諷; + } + public override object obj迴セ蝨ィ蛟、() + { + if ( this.e迴セ蝨ィ縺ョ迥カ諷 == E迥カ諷.荳榊ョ ) + { + return "- -"; + } + else + { + return this.e迴セ蝨ィ縺ョ迥カ諷.ToString(); + } + } + public override int GetIndex() + { + return (int)this.e迴セ蝨ィ縺ョ迥カ諷; + } + public override void SetIndex( int index ) + { + switch (index ) + { + case 0: + this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.ON; + break; + case 1: + this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.OFF; + break; + case 2: + this.e迴セ蝨ィ縺ョ迥カ諷 = E迥カ諷.荳榊ョ; + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + } +} diff --git a/TJAPlayer3/Items/CItemToggle.cs b/TJAPlayer3/Items/CItemToggle.cs new file mode 100644 index 00000000..495dd1fe --- /dev/null +++ b/TJAPlayer3/Items/CItemToggle.cs @@ -0,0 +1,111 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; + +namespace TJAPlayer3 +{ + /// + /// 縲後ヨ繧ー繝ォ縲搾シON, OFF 縺ョ2迥カ諷具シ峨r陦ィ縺吶い繧、繝繝縲 + /// + internal class CItemToggle : CItemBase + { + // 繝励Ο繝代ユ繧」 + + public bool bON; + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CItemToggle() + { + base.e遞ョ蛻・ = CItemBase.E遞ョ蛻・.ONorOFF繝医げ繝ォ; + this.bON = false; + } + public CItemToggle( string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷 ) + : this() + { + this.t蛻晄悄蛹( str鬆逶ョ蜷, b蛻晄悄迥カ諷 ); + } + public CItemToggle(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, string str隱ャ譏取枚jp) + : this() { + this.t蛻晄悄蛹(str鬆逶ョ蜷, b蛻晄悄迥カ諷, str隱ャ譏取枚jp); + } + public CItemToggle(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) + : this() { + this.t蛻晄悄蛹(str鬆逶ョ蜷, b蛻晄悄迥カ諷, str隱ャ譏取枚jp, str隱ャ譏取枚en); + } + public CItemToggle(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・) + : this() + { + this.t蛻晄悄蛹( str鬆逶ョ蜷, b蛻晄悄迥カ諷, e繝代ロ繝ォ遞ョ蛻・ ); + } + public CItemToggle(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp) + : this() { + this.t蛻晄悄蛹(str鬆逶ョ蜷, b蛻晄悄迥カ諷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp); + } + public CItemToggle(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) + : this() { + this.t蛻晄悄蛹(str鬆逶ョ蜷, b蛻晄悄迥カ諷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚en); + } + + + // CItemBase 螳溯」 + + public override void tEnter謚シ荳() + { + this.t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍(); + } + public override void t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍() + { + this.bON = !this.bON; + } + public override void t鬆逶ョ蛟、繧貞燕縺ク遘サ蜍() + { + this.t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍(); + } + public void t蛻晄悄蛹( string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷 ) + { + this.t蛻晄悄蛹( str鬆逶ョ蜷, b蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク ); + } + public void t蛻晄悄蛹(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, string str隱ャ譏取枚jp) { + this.t蛻晄悄蛹(str鬆逶ョ蜷, b蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, str隱ャ譏取枚jp, str隱ャ譏取枚jp); + } + public void t蛻晄悄蛹(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) { + this.t蛻晄悄蛹(str鬆逶ョ蜷, b蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, str隱ャ譏取枚jp, str隱ャ譏取枚en); + } + + public void t蛻晄悄蛹(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・) + { + this.t蛻晄悄蛹(str鬆逶ョ蜷, b蛻晄悄迥カ諷, e繝代ロ繝ォ遞ョ蛻・, "", ""); + } + public void t蛻晄悄蛹(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp) { + this.t蛻晄悄蛹(str鬆逶ョ蜷, b蛻晄悄迥カ諷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚jp); + } + public void t蛻晄悄蛹(string str鬆逶ョ蜷, bool b蛻晄悄迥カ諷, CItemBase.E繝代ロ繝ォ遞ョ蛻・ e繝代ロ繝ォ遞ョ蛻・, string str隱ャ譏取枚jp, string str隱ャ譏取枚en) { + base.t蛻晄悄蛹(str鬆逶ョ蜷, e繝代ロ繝ォ遞ョ蛻・, str隱ャ譏取枚jp, str隱ャ譏取枚en); + this.bON = b蛻晄悄迥カ諷; + } + public override object obj迴セ蝨ィ蛟、() + { + return ( this.bON ) ? "ON" : "OFF"; + } + public override int GetIndex() + { + return ( this.bON ) ? 1 : 0; + } + public override void SetIndex( int index ) + { + switch ( index ) + { + case 0: + this.bON = false; + break; + case 1: + this.bON = true; + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + } +} diff --git a/TJAPlayer3/Plugins/CPluginHost.cs b/TJAPlayer3/Plugins/CPluginHost.cs new file mode 100644 index 00000000..80710234 --- /dev/null +++ b/TJAPlayer3/Plugins/CPluginHost.cs @@ -0,0 +1,87 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Drawing; +using SlimDX; +using SlimDX.Direct3D9; +using FDK; + +namespace TJAPlayer3 +{ + internal class CPluginHost : IPluginHost + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CPluginHost() + { + this._DTXManiaVersion = new CDTXVersion( TJAPlayer3.VERSION ); + } + + + // IPluginHost 螳溯」 + + public CDTXVersion DTXManiaVersion + { + get { return this._DTXManiaVersion; } + } + public Device D3D9Device + { + get { return (TJAPlayer3.app != null ) ? TJAPlayer3.app.Device.UnderlyingDevice : null; } + } + public Format TextureFormat + { + get { return TJAPlayer3.TextureFormat; } + } + public CTimer Timer + { + get { return TJAPlayer3.Timer; } + } + public CSound邂。逅 Sound邂。逅 + { + get { return TJAPlayer3.Sound邂。逅; } + } + public Size ClientSize + { + get { return TJAPlayer3.app.Window.ClientSize; } + } + public CStage.E繧ケ繝繝シ繧ク e迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク + { + get { return ( TJAPlayer3.r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク != null ) ? TJAPlayer3.r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID : CStage.E繧ケ繝繝シ繧ク.菴輔b縺励↑縺; } + } + public CStage.E繝輔ぉ繝シ繧コ e迴セ蝨ィ縺ョ繝輔ぉ繝シ繧コ + { + get { return ( TJAPlayer3.r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク != null ) ? TJAPlayer3.r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繝輔ぉ繝シ繧コID : CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷; } + } + public bool t蜈・蜉帙r蜊譛峨☆繧(IPluginActivity act) + { + if (TJAPlayer3.act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ != null) + return false; + + TJAPlayer3.act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ = act; + return true; + } + public bool t蜈・蜉帙ョ蜊譛峨r隗」髯、縺吶k(IPluginActivity act) + { + if (TJAPlayer3.act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ == null || TJAPlayer3.act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ != act) + return false; + + TJAPlayer3.act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ = null; + return true; + } + public void t繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k( E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound ) + { + if( TJAPlayer3.Skin != null ) + TJAPlayer3.Skin[ sound ].t蜀咲函縺吶k(); + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private CDTXVersion _DTXManiaVersion; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Plugins/IPluginActivity.cs b/TJAPlayer3/Plugins/IPluginActivity.cs new file mode 100644 index 00000000..845b3208 --- /dev/null +++ b/TJAPlayer3/Plugins/IPluginActivity.cs @@ -0,0 +1,76 @@ +サソnamespace TJAPlayer3 +{ + /// + /// Activity 繝励Λ繧ー繧、繝ウ縺ク縺ョ繧、繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ縲 + /// DTXMania 縺ッ縲!PluginActivity 縺ォ蟇セ縺励※縲∽サ・荳九ョ繝ゥ繧、繝輔し繧、繧ッ繝ォ繧貞ョ溯。後@縺セ縺吶 + /// (1) DTXMania 縺ョ襍キ蜍募ヲ逅縺ョ譛蠕鯉シ医そ繝繝医い繝繝礼判髱「縺瑚。ィ遉コ縺輔l繧狗峩蜑搾シ峨↓荳蠎ヲ縺縺代^n蛻晄悄蛹()_OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈()_OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() 繧偵%縺ョ鬆逡ェ縺ァ1蝗槭★縺、蜻シ縺ウ蜃コ縺励∪縺吶 + /// (2) DTXMania 縺ョ邨ゆコ蜃ヲ逅縺ョ譛蛻晢シThank you for playing 縺梧カ医∴縺溽峩蠕鯉シ峨↓荳蠎ヲ縺縺代^nUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ()_OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ()_On邨ゆコ() 繧偵%縺ョ鬆逡ェ縺ァ1蝗槭★縺、蜻シ縺ウ蜃コ縺励∪縺吶 + /// (3) DTXMania 縺ョ襍キ蜍穂クュ縲√☆縺ェ繧上■(1)ス(2)縺ョ髢薙ッ縲√←繧薙↑繧キ繝シ繝ウ縺ァ縺ゅ▲縺ヲ繧ゅ∝クク縺ォ On騾イ陦梧緒逕サ() 繧1繝輔Ξ繝シ繝縺ォ縺、縺1蝗槭★縺、蜻シ縺ウ蜃コ縺励∪縺吶 + /// (4) Direct3D 繝繝舌う繧ケ縺ョ繝ェ繧サ繝繝域凾縺ォ縺ッ縲√ョ繝舌う繧ケ縺ョ繝ェ繧サ繝繝亥燕縺ォ OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() 繧1蝗槫他縺ウ蜃コ縺励√ョ繝舌う繧ケ繧偵Μ繧サ繝繝医@縺溘ョ縺。縲^nUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() 繧1蝗槫他縺ウ蜃コ縺励∪縺吶 + /// (5) Direct3D 繝繝舌う繧ケ縺ョ繝ュ繧ケ繝域凾縺ォ縺ッ縲√ョ繝舌う繧ケ縺ョ蜀咲函謌仙燕縺ォ OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ()_OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() 繧1蝗槭★縺、蜻シ縺ウ蜃コ縺励√ョ繝舌う繧ケ繧貞咲函謌舌@縺溘ョ縺。縲^nManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈()_OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() 繧1蝗槭★縺、蜻シ縺ウ蜃コ縺励∪縺吶 + /// + public interface IPluginActivity + { + /// + /// 繝励Λ繧ー繧、繝ウ縺ョ蛻晄悄蛹悶r陦後>縺セ縺吶 + /// DTXMania 縺ョ襍キ蜍募ヲ逅縺ョ譛蠕鯉シ医そ繝繝医い繝繝礼判髱「縺瑚。ィ遉コ縺輔l繧狗峩蜑搾シ峨↓縲.TXMania 縺九i荳蠎ヲ縺縺大他縺ウ蜃コ縺輔l縺セ縺吶 + /// 繝励Λ繧ー繧、繝ウ縺後√帙せ繝茨シDTXManiaシ峨ョ諠蝣ア縺ォ繧「繧ッ繧サ繧ケ縺吶k縺溘a縺ョ繧ェ繝悶ず繧ァ繧ッ繝医 + /// + void On蛻晄悄蛹( global::TJAPlayer3.IPluginHost PluginHost ); + + /// + /// 繝励Λ繧ー繧、繝ウ縺ョ邨ゆコ蜃ヲ逅繧定。後>縺セ縺吶 + /// DTXMania 縺ョ邨ゆコ蜃ヲ逅縺ョ譛蛻晢シThank you for playing 縺梧カ医∴縺溽峩蠕鯉シ峨↓縲.TXMania 縺九i荳蠎ヲ縺縺大他縺ウ蜃コ縺輔l縺セ縺吶 + /// + void On邨ゆコ(); + + /// + /// Managed 繝ェ繧ス繝シ繧ケ繧剃ス懈舌@縺セ縺吶 + /// + void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + + /// + /// Unmanaged 繝ェ繧ス繝シ繧ケ繧剃ス懈舌@縺セ縺吶 + /// + void OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + + /// + /// Unmanaged 繝ェ繧ス繝シ繧ケ繧定ァ」謾セ縺励∪縺吶 + /// + void OnUnmanaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + + /// + /// Managed 繝ェ繧ス繝シ繧ケ繧定ァ」謾セ縺励∪縺吶 + /// + void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + + /// + /// 繝励Λ繧ー繧、繝ウ縺ョ騾イ陦後→謠冗判繧定。後>縺セ縺吶 + /// 窶サ迴セ蝨ィ縺ョ DTXMania 縺ァ縺ッ縲騾イ陦後→謠冗判縺ッ蛻髮「縺輔l縺ヲ縺縺セ縺帙s縲 + /// 窶サBeginScene()/EndScene() 縺ッ DTXMania 蛛エ縺ァ陦後≧縺溘a縲√励Λ繧ー繧、繝ウ蛛エ縺ァ縺ッ荳崎ヲ√〒縺吶 + /// 窶サkeyboard.t繝昴シ繝ェ繝ウ繧ー() 縺ッ DTXMania 蛛エ縺ァ陦後>縺セ縺吶ョ縺ァ繝励Λ繧ー繧、繝ウ蛛エ縺ァ縺ッ陦後o縺ェ縺縺ァ荳九&縺縲 + /// 繝代ャ繝牙・蜉帙ゆサ悶ョ繝励Λ繧ー繧、繝ウ縺悟・蜉帛頃譛我クュ縺ァ縺ゅk蝣エ蜷医ッ null 縺梧ク。縺輔l縺セ縺吶 + /// 繧ュ繝シ繝懊シ繝牙・蜉帙ゆサ悶ョ繝励Λ繧ー繧、繝ウ縺悟・蜉帛頃譛我クュ縺ァ縺ゅk蝣エ蜷医ッ null 縺梧ク。縺輔l縺セ縺吶 + /// + void On騾イ陦梧緒逕サ( global::TJAPlayer3.CPad pad, FDK.IInputDevice keyboard ); + + /// + /// 繧ケ繝繝シ繧ク縺悟、峨o繧句コヲ縺ォ蜻シ縺ウ蜃コ縺輔l縺セ縺吶 + /// 蜻シ縺ウ蜃コ縺励ち繧、繝溘Φ繧ー縺ッ縲∵眠縺励>繧ケ繝繝シ繧ク縺ョ豢サ諤ァ蛹也峩蠕後°縺、謠冗判髢句ァ句燕縺ァ縺吶 + /// + void On繧ケ繝繝シ繧ク螟画峩(); + + /// + /// 驕ク譖イ逕サ髱「縺ァ驕ク謚樊峇縺悟、画峩縺輔l縺溷エ蜷医↓蜻シ縺ウ蜃コ縺輔l縺セ縺吶 + /// 蜷後§ set.def 縺ォ螻槭☆繧区峇縺ョ髮」譏灘コヲ縺鯉シHHテ2縺ァシ牙、画峩縺輔l縺溷エ蜷医〒繧ょ他縺ウ蜃コ縺輔l縺セ縺吶 + /// 縺溘□縺励驕ク謚槭′譖イ縺ァ縺ェ縺シBOX, BACK, RANDOM 縺ェ縺ゥシ牙エ蜷医↓縺ッ蜻シ縺ウ蜃コ縺輔l縺セ縺帙s縲 + /// + /// 驕ク謚槭&繧後※縺繧区峇縺ョ繝輔ぃ繧、繝ォ縺ョ蜷榊燕縲らオカ蟇セ繝代せ縲 + /// 驕ク謚槭&繧後※縺繧区峇縺ョ繝悶Ο繝繧ッ蜀縺ョ譖イ逡ェ蜿キ(0ス4)縲 + void On驕ク謚樊峇螟画峩( string str驕ク謚樊峇繝輔ぃ繧、繝ォ蜷, int n譖イ逡ェ蜿キin繝悶Ο繝繧ッ ); + + void On貍泌・上け繝ェ繧「( global::TJAPlayer3.CScoreIni scoreIni ); + void On貍泌・丞、ア謨( global::TJAPlayer3.CScoreIni scoreIni ); + void On貍泌・上く繝」繝ウ繧サ繝ォ( global::TJAPlayer3.CScoreIni scoreIni ); + } +} diff --git a/TJAPlayer3/Plugins/IPluginHost.cs b/TJAPlayer3/Plugins/IPluginHost.cs new file mode 100644 index 00000000..7e47436a --- /dev/null +++ b/TJAPlayer3/Plugins/IPluginHost.cs @@ -0,0 +1,64 @@ +サソnamespace TJAPlayer3 +{ + /// + /// 繝励Λ繧ー繧、繝ウ繝帙せ繝域ュ蝣ア謠蝉セ帙う繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ縲 + /// 繝励Λ繧ー繧、繝ウ縺ァ縺ッ縲^n蛻晄悄蛹() 縺ァ貂。縺輔l繧九%縺ョ繧、繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ繧ェ繝悶ず繧ァ繧ッ繝医r騾壹§縺ヲ縲 + /// DTXMania 縺ョ謖√▽讒倥縺ェ繝ェ繧ス繝シ繧ケ縺ォ繧「繧ッ繧サ繧ケ縺ァ縺阪∪縺吶 + /// + public interface IPluginHost + { + /// + /// DTXMania 縺ョ繝舌シ繧ク繝ァ繝ウ繧定。ィ縺励∪縺吶 + /// + global::TJAPlayer3.CDTXVersion DTXManiaVersion { get; } + + /// + /// Direct3D9 繝繝舌う繧ケ繧ェ繝悶ず繧ァ繧ッ繝医 + /// 繝ュ繧ケ繝医@縺溘j繝ェ繧サ繝繝医@縺溘j縺吶k縺薙→縺後≠繧九ョ縺ァ縲∝クク縺ォ蜷後§蛟、縺ァ縺ゅk縺ィ縺ッ菫晁ィシ縺輔l縺セ縺帙s縲 + /// + SlimDX.Direct3D9.Device D3D9Device { get; } + + /// + /// DirectSound 縺ョ邂。逅繧ッ繝ゥ繧ケ縲 + /// WAV, XA, OGG, MP3 縺ョ繧オ繧ヲ繝ウ繝峨ヵ繧。繧、繝ォ縺九i CSound 繧ェ繝悶ず繧ァ繧ッ繝医r逕滓舌〒縺阪∪縺吶 + /// + FDK.CSound邂。逅 Sound邂。逅 { get; } + + /// + /// 謠冗判繧ィ繝ェ繧「縺ョ繧オ繧、繧コ繧定ソ斐@縺セ縺呻シ医ヴ繧ッ繧サ繝ォ蜊倅ス搾シ峨 + /// + System.Drawing.Size ClientSize { get; } + + /// + /// 迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク縺ョID繧定。ィ縺励∪縺吶 + /// + global::TJAPlayer3.CStage.E繧ケ繝繝シ繧ク e迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク { get; } + + /// + /// 迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク縺ォ縺翫¢繧九ヵ繧ァ繝シ繧コ縺ョID繧定。ィ縺励∪縺吶 + /// + global::TJAPlayer3.CStage.E繝輔ぉ繝シ繧コ e迴セ蝨ィ縺ョ繝輔ぉ繝シ繧コ { get; } + + /// + /// 閾ェ蛻莉・螟悶ッ蜈・蜉帙ョ繝シ繧ソ繧呈桶縺」縺ヲ縺ッ縺ェ繧峨↑縺縺薙→繧貞ョ」險縺励∪縺吶 + /// DTXMania 譛ャ菴薙ッ蜈・蜉帙ョ繝シ繧ソ縺ョ繝昴シ繝ェ繝ウ繧ー縺ョ縺ソ繧定。後>縲∽サ悶ョ繝励Λ繧ー繧、繝ウ縺ォ蟇セ縺励※縺ッ縲^n騾イ陦梧緒逕サ() 縺ョ2縺、縺ョ蜈・蜉帙↓ null 繧呈ク。縺励∪縺吶 + /// + /// 螳」險縺吶k繝励Λ繧ー繧、繝ウシ医☆縺ェ繧上■ this 繧呈欠螳壹☆繧具シ + /// 蜊譛峨↓謌仙粥縺吶l縺ー true 繧定ソ斐@縲∵里縺ォ隱ー縺九′蜊譛我クュ縺ァ縺ゅk蝣エ蜷医↓縺ッ false 繧定ソ斐@縺セ縺吶 + bool t蜈・蜉帙r蜊譛峨☆繧( IPluginActivity act ); + + /// + /// 閾ェ蛻莉・螟悶′蜈・蜉帙ョ繝シ繧ソ繧呈桶縺」縺ヲ濶ッ縺縺薙→繧貞ョ」險縺励∪縺吶 + /// DTXMania 譛ャ菴薙ッ繝昴シ繝ェ繝ウ繧ー莉・螟悶ョ蜈・蜉帛ヲ逅繧帝幕蟋九@縲∽サ悶ョ繝励Λ繧ー繧、繝ウ縺ォ蟇セ縺励※縺ッ縲^n騾イ陦梧緒逕サ() 縺ョ2縺、縺ョ蠑墓焚縺ォ譛牙柑縺ェ蛟、繧呈ク。縺励∪縺吶 + /// + /// 螳」險縺吶k繝励Λ繧ー繧、繝ウシ医☆縺ェ繧上■ this 繧呈欠螳壹☆繧具シ + /// 蜊譛芽ァ」髯、縺ォ謌仙粥縺吶l縺ー true縲∝、ア謨励☆繧後ー flase 繧定ソ斐@縺セ縺吶 + bool t蜈・蜉帙ョ蜊譛峨r隗」髯、縺吶k( IPluginActivity act ); + + /// + /// 謖螳壹&繧後◆繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝会シ州GM繧貞咲函縺励∪縺吶 + /// + /// 蜀咲函縺吶k繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨ョ隴伜挨蟄舌 + void t繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k( E繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 sound ); + } +} diff --git a/TJAPlayer3/Properties/AssemblyInfo.cs b/TJAPlayer3/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..26a12c0d --- /dev/null +++ b/TJAPlayer3/Properties/AssemblyInfo.cs @@ -0,0 +1,42 @@ +サソusing System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Resources; + +// 繧「繧サ繝ウ繝悶Μ縺ォ髢「縺吶k荳闊ャ諠蝣ア縺ッ莉・荳九ョ螻樊ァ繧サ繝繝医r縺ィ縺翫@縺ヲ蛻カ蠕。縺輔l縺セ縺吶 +// 繧「繧サ繝ウ繝悶Μ縺ォ髢「騾」莉倥¢繧峨l縺ヲ縺繧区ュ蝣ア繧貞、画峩縺吶k縺ォ縺ッ縲 +// 縺薙l繧峨ョ螻樊ァ蛟、繧貞、画峩縺励※縺上□縺輔>縲 +[assembly: AssemblyTitle("TJAPlayer3 - A .tja file player.")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("TJAPlayer3")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// ComVisible 繧 false 縺ォ險ュ螳壹☆繧九→縲√◎縺ョ蝙九ッ縺薙ョ繧「繧サ繝ウ繝悶Μ蜀縺ァ COM 繧ウ繝ウ繝昴シ繝阪Φ繝医°繧 +// 蜿らァ荳榊庄閭ス縺ォ縺ェ繧翫∪縺吶COM 縺九i縺薙ョ繧「繧サ繝ウ繝悶Μ蜀縺ョ蝙九↓繧「繧ッ繧サ繧ケ縺吶k蝣エ蜷医ッ縲 +// 縺昴ョ蝙九ョ ComVisible 螻樊ァ繧 true 縺ォ險ュ螳壹@縺ヲ縺上□縺輔>縲 +[assembly: ComVisible(false)] + +// 谺。縺ョ GUID 縺ッ縲√%縺ョ繝励Ο繧ク繧ァ繧ッ繝医′ COM 縺ォ蜈ャ髢九&繧後k蝣エ蜷医ョ縲》ypelib 縺ョ ID 縺ァ縺 +[assembly: Guid("ee05cb8c-73a8-41c3-8677-a0afbe7401f7")] + +// 繧「繧サ繝ウ繝悶Μ縺ョ繝舌シ繧ク繝ァ繝ウ諠蝣ア縺ッ縲∽サ・荳九ョ 4 縺、縺ョ蛟、縺ァ讒区舌&繧後※縺縺セ縺: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 縺吶∋縺ヲ縺ョ蛟、繧呈欠螳壹☆繧九°縲∽ク九ョ繧医≧縺ォ '*' 繧剃スソ縺」縺ヲ繝薙Ν繝峨♀繧医ウ繝ェ繝薙ず繝ァ繝ウ逡ェ蜿キ繧 +// 譌「螳壼、縺ォ縺吶k縺薙→縺後〒縺阪∪縺: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.1.0")] +[assembly: AssemblyFileVersion("1.4.5.3")] +[assembly: NeutralResourcesLanguage("ja-JP")] + +// 縺薙ョ繧「繧サ繝ウ繝悶Μ縺ッ縲後Λ繧、繝悶Λ繝ェ縲阪〒縺ゅkシ磯屮隱ュ蛹悶ヤ繝シ繝ォ縺ク縺ョ謖遉コシ峨 +// 竊 繝繝輔か繝ォ繝医ョ true 縺ョ縺セ縺セ縺縺ィ縲√い繧サ繝ウ繝悶Μ public 縺ェ繝。繝ウ繝舌b縺吶∋縺ヲ髮」隱ュ蛹悶&繧後※縺励∪縺縲 +[assembly: ObfuscateAssembly( false )] diff --git a/TJAPlayer3/Properties/Discord.Designer.cs b/TJAPlayer3/Properties/Discord.Designer.cs new file mode 100644 index 00000000..8591c74c --- /dev/null +++ b/TJAPlayer3/Properties/Discord.Designer.cs @@ -0,0 +1,117 @@ +サソ//------------------------------------------------------------------------------ +// +// 縺薙ョ繧ウ繝シ繝峨ッ繝繝シ繝ォ縺ォ繧医▲縺ヲ逕滓舌&繧後∪縺励◆縲 +// 繝ゥ繝ウ繧ソ繧、繝 繝舌シ繧ク繝ァ繝ウ:4.0.30319.42000 +// +// 縺薙ョ繝輔ぃ繧、繝ォ縺ク縺ョ螟画峩縺ッ縲∽サ・荳九ョ迥カ豕∽ク九〒荳肴ュ」縺ェ蜍穂ス懊ョ蜴溷屏縺ォ縺ェ縺」縺溘j縲 +// 繧ウ繝シ繝峨′蜀咲函謌舌&繧後k縺ィ縺阪↓謳榊、ア縺励◆繧翫@縺セ縺吶 +// +//------------------------------------------------------------------------------ + +namespace TJAPlayer3.Properties { + using System; + + + /// + /// 繝ュ繝シ繧ォ繝ゥ繧、繧コ縺輔l縺滓枚蟄怜励↑縺ゥ繧呈、懃エ「縺吶k縺溘a縺ョ縲∝宍蟇縺ォ蝙区欠螳壹&繧後◆繝ェ繧ス繝シ繧ケ 繧ッ繝ゥ繧ケ縺ァ縺吶 + /// + // 縺薙ョ繧ッ繝ゥ繧ケ縺ッ StronglyTypedResourceBuilder 繧ッ繝ゥ繧ケ縺 ResGen + // 縺セ縺溘ッ Visual Studio 縺ョ繧医≧縺ェ繝繝シ繝ォ繧剃スソ逕ィ縺励※閾ェ蜍慕函謌舌&繧後∪縺励◆縲 + // 繝。繝ウ繝舌シ繧定ソス蜉縺セ縺溘ッ蜑企勁縺吶k縺ォ縺ッ縲.ResX 繝輔ぃ繧、繝ォ繧堤キィ髮縺励※縲/str 繧ェ繝励す繝ァ繝ウ縺ィ蜈ア縺ォ + // ResGen 繧貞ョ溯。後@逶エ縺吶°縲√∪縺溘ッ VS 繝励Ο繧ク繧ァ繧ッ繝医r繝薙Ν繝峨@逶エ縺励∪縺吶 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Discord { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Discord() { + } + + /// + /// 縺薙ョ繧ッ繝ゥ繧ケ縺ァ菴ソ逕ィ縺輔l縺ヲ縺繧九く繝」繝繧キ繝・縺輔l縺 ResourceManager 繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧定ソ斐@縺セ縺吶 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TJAPlayer3.Properties.Discord", typeof(Discord).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 縺吶∋縺ヲ縺ォ縺、縺縺ヲ縲∫樟蝨ィ縺ョ繧ケ繝ャ繝繝峨ョ CurrentUICulture 繝励Ο繝代ユ繧」繧偵が繝シ繝舌シ繝ゥ繧、繝峨@縺セ縺 + /// 迴セ蝨ィ縺ョ繧ケ繝ャ繝繝峨ョ CurrentUICulture 繝励Ο繝代ユ繧」繧偵が繝シ繝舌シ繝ゥ繧、繝峨@縺セ縺吶 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Auto 縺ォ鬘樔シシ縺励※縺繧九Ο繝シ繧ォ繝ゥ繧、繧コ縺輔l縺滓枚蟄怜励r讀懃エ「縺励∪縺吶 + /// + internal static string Info_IsAuto { + get { + return ResourceManager.GetString("Info_IsAuto", resourceCulture); + } + } + + /// + /// Playing 縺ォ鬘樔シシ縺励※縺繧九Ο繝シ繧ォ繝ゥ繧、繧コ縺輔l縺滓枚蟄怜励r讀懃エ「縺励∪縺吶 + /// + internal static string Stage_InGame { + get { + return ResourceManager.GetString("Stage_InGame", resourceCulture); + } + } + + /// + /// Result 縺ォ鬘樔シシ縺励※縺繧九Ο繝シ繧ォ繝ゥ繧、繧コ縺輔l縺滓枚蟄怜励r讀懃エ「縺励∪縺吶 + /// + internal static string Stage_Result { + get { + return ResourceManager.GetString("Stage_Result", resourceCulture); + } + } + + /// + /// Settings 縺ォ鬘樔シシ縺励※縺繧九Ο繝シ繧ォ繝ゥ繧、繧コ縺輔l縺滓枚蟄怜励r讀懃エ「縺励∪縺吶 + /// + internal static string Stage_Settings { + get { + return ResourceManager.GetString("Stage_Settings", resourceCulture); + } + } + + /// + /// SongSelect 縺ォ鬘樔シシ縺励※縺繧九Ο繝シ繧ォ繝ゥ繧、繧コ縺輔l縺滓枚蟄怜励r讀懃エ「縺励∪縺吶 + /// + internal static string Stage_SongSelect { + get { + return ResourceManager.GetString("Stage_SongSelect", resourceCulture); + } + } + + /// + /// Startup 縺ォ鬘樔シシ縺励※縺繧九Ο繝シ繧ォ繝ゥ繧、繧コ縺輔l縺滓枚蟄怜励r讀懃エ「縺励∪縺吶 + /// + internal static string Stage_StartUp { + get { + return ResourceManager.GetString("Stage_StartUp", resourceCulture); + } + } + } +} diff --git a/TJAPlayer3/Properties/Discord.resx b/TJAPlayer3/Properties/Discord.resx new file mode 100644 index 00000000..1219284d --- /dev/null +++ b/TJAPlayer3/Properties/Discord.resx @@ -0,0 +1,138 @@ +サソ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Auto + + + Playing + + + Result + + + Settings + + + SongSelect + + + Startup + + \ No newline at end of file diff --git a/TJAPlayer3/Properties/Resources.Designer.cs b/TJAPlayer3/Properties/Resources.Designer.cs new file mode 100644 index 00000000..be4b21fc --- /dev/null +++ b/TJAPlayer3/Properties/Resources.Designer.cs @@ -0,0 +1,83 @@ +サソ//------------------------------------------------------------------------------ +// +// 縺薙ョ繧ウ繝シ繝峨ッ繝繝シ繝ォ縺ォ繧医▲縺ヲ逕滓舌&繧後∪縺励◆縲 +// 繝ゥ繝ウ繧ソ繧、繝 繝舌シ繧ク繝ァ繝ウ:4.0.30319.42000 +// +// 縺薙ョ繝輔ぃ繧、繝ォ縺ク縺ョ螟画峩縺ッ縲∽サ・荳九ョ迥カ豕∽ク九〒荳肴ュ」縺ェ蜍穂ス懊ョ蜴溷屏縺ォ縺ェ縺」縺溘j縲 +// 繧ウ繝シ繝峨′蜀咲函謌舌&繧後k縺ィ縺阪↓謳榊、ア縺励◆繧翫@縺セ縺吶 +// +//------------------------------------------------------------------------------ + +namespace TJAPlayer3.Properties { + using System; + + + /// + /// 繝ュ繝シ繧ォ繝ゥ繧、繧コ縺輔l縺滓枚蟄怜励↑縺ゥ繧呈、懃エ「縺吶k縺溘a縺ョ縲∝宍蟇縺ォ蝙区欠螳壹&繧後◆繝ェ繧ス繝シ繧ケ 繧ッ繝ゥ繧ケ縺ァ縺吶 + /// + // 縺薙ョ繧ッ繝ゥ繧ケ縺ッ StronglyTypedResourceBuilder 繧ッ繝ゥ繧ケ縺 ResGen + // 縺セ縺溘ッ Visual Studio 縺ョ繧医≧縺ェ繝繝シ繝ォ繧剃スソ逕ィ縺励※閾ェ蜍慕函謌舌&繧後∪縺励◆縲 + // 繝。繝ウ繝舌シ繧定ソス蜉縺セ縺溘ッ蜑企勁縺吶k縺ォ縺ッ縲.ResX 繝輔ぃ繧、繝ォ繧堤キィ髮縺励※縲/str 繧ェ繝励す繝ァ繝ウ縺ィ蜈ア縺ォ + // ResGen 繧貞ョ溯。後@逶エ縺吶°縲√∪縺溘ッ VS 繝励Ο繧ク繧ァ繧ッ繝医r繝薙Ν繝峨@逶エ縺励∪縺吶 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// 縺薙ョ繧ッ繝ゥ繧ケ縺ァ菴ソ逕ィ縺輔l縺ヲ縺繧九く繝」繝繧キ繝・縺輔l縺 ResourceManager 繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧定ソ斐@縺セ縺吶 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TJAPlayer3.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 縺吶∋縺ヲ縺ォ縺、縺縺ヲ縲∫樟蝨ィ縺ョ繧ケ繝ャ繝繝峨ョ CurrentUICulture 繝励Ο繝代ユ繧」繧偵が繝シ繝舌シ繝ゥ繧、繝峨@縺セ縺 + /// 迴セ蝨ィ縺ョ繧ケ繝ャ繝繝峨ョ CurrentUICulture 繝励Ο繝代ユ繧」繧偵が繝シ繝舌シ繝ゥ繧、繝峨@縺セ縺吶 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// (繧「繧、繧ウ繝ウ) 縺ォ鬘樔シシ縺励◆蝙 System.Drawing.Icon 縺ョ繝ュ繝シ繧ォ繝ゥ繧、繧コ縺輔l縺溘Μ繧ス繝シ繧ケ繧呈、懃エ「縺励∪縺吶 + /// + internal static System.Drawing.Icon dtx { + get { + object obj = ResourceManager.GetObject("dtx", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// (繧「繧、繧ウ繝ウ) 縺ォ鬘樔シシ縺励◆蝙 System.Drawing.Icon 縺ョ繝ュ繝シ繧ォ繝ゥ繧、繧コ縺輔l縺溘Μ繧ス繝シ繧ケ繧呈、懃エ「縺励∪縺吶 + /// + internal static System.Drawing.Icon tjap3 { + get { + object obj = ResourceManager.GetObject("tjap3", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + } +} diff --git a/TJAPlayer3/Properties/Resources.resx b/TJAPlayer3/Properties/Resources.resx new file mode 100644 index 00000000..ecc4e445 --- /dev/null +++ b/TJAPlayer3/Properties/Resources.resx @@ -0,0 +1,127 @@ +サソ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\dtx.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\TJAPlayer3-Develop-ReWrite.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/TJAPlayer3/Properties/Settings.Designer.cs b/TJAPlayer3/Properties/Settings.Designer.cs new file mode 100644 index 00000000..6e6c2f25 --- /dev/null +++ b/TJAPlayer3/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +サソ//------------------------------------------------------------------------------ +// +// 縺薙ョ繧ウ繝シ繝峨ッ繝繝シ繝ォ縺ォ繧医▲縺ヲ逕滓舌&繧後∪縺励◆縲 +// 繝ゥ繝ウ繧ソ繧、繝 繝舌シ繧ク繝ァ繝ウ:4.0.30319.42000 +// +// 縺薙ョ繝輔ぃ繧、繝ォ縺ク縺ョ螟画峩縺ッ縲∽サ・荳九ョ迥カ豕∽ク九〒荳肴ュ」縺ェ蜍穂ス懊ョ蜴溷屏縺ォ縺ェ縺」縺溘j縲 +// 繧ウ繝シ繝峨′蜀咲函謌舌&繧後k縺ィ縺阪↓謳榊、ア縺励◆繧翫@縺セ縺吶 +// +//------------------------------------------------------------------------------ + +namespace TJAPlayer3.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.7.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/TJAPlayer3/Properties/Settings.settings b/TJAPlayer3/Properties/Settings.settings new file mode 100644 index 00000000..39645652 --- /dev/null +++ b/TJAPlayer3/Properties/Settings.settings @@ -0,0 +1,7 @@ +サソ + + + + + + diff --git a/TJAPlayer3/Resources/TJAPlayer3-Develop-ReWrite.ico b/TJAPlayer3/Resources/TJAPlayer3-Develop-ReWrite.ico new file mode 100644 index 00000000..0f583138 Binary files /dev/null and b/TJAPlayer3/Resources/TJAPlayer3-Develop-ReWrite.ico differ diff --git a/TJAPlayer3/Songs/CBoxDef.cs b/TJAPlayer3/Songs/CBoxDef.cs new file mode 100644 index 00000000..d693a985 --- /dev/null +++ b/TJAPlayer3/Songs/CBoxDef.cs @@ -0,0 +1,113 @@ +サソusing System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using System.IO; +using System.Drawing; + +namespace TJAPlayer3 +{ + internal class CBoxDef + { + // 繝励Ο繝代ユ繧」 + + public Color Color; + public string Genre; + public string Title; + public string[] strBoxText = new string[3]; + public Color ForeColor; + public Color BackColor; + public bool IsChangedForeColor; + public bool IsChangedBackColor; + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CBoxDef() + { + for (int i = 0; i < 3; i++) + this.strBoxText[i] = ""; + this.Title = ""; + this.Genre = ""; + ForeColor = Color.White; + BackColor = Color.Black; + + } + public CBoxDef( string boxdef繝輔ぃ繧、繝ォ蜷 ) + : this() + { + this.t隱ュ縺ソ霎シ縺ソ( boxdef繝輔ぃ繧、繝ォ蜷 ); + } + + + // 繝。繧ス繝繝 + + public void t隱ュ縺ソ霎シ縺ソ( string boxdef繝輔ぃ繧、繝ォ蜷 ) + { + StreamReader reader = new StreamReader( boxdef繝輔ぃ繧、繝ォ蜷, Encoding.GetEncoding( "Shift_JIS" ) ); + string str = null; + while( ( str = reader.ReadLine() ) != null ) + { + if( str.Length != 0 ) + { + try + { + char[] ignoreCharsWoColon = new char[] { ' ', '\t' }; + + str = str.TrimStart( ignoreCharsWoColon ); + if( ( str[ 0 ] == '#' ) && ( str[ 0 ] != ';' ) ) + { + if( str.IndexOf( ';' ) != -1 ) + { + str = str.Substring( 0, str.IndexOf( ';' ) ); + } + + char[] ignoreChars = new char[] { ':', ' ', '\t' }; + + if ( str.StartsWith( "#TITLE", StringComparison.OrdinalIgnoreCase ) ) + { + this.Title = str.Substring( 6 ).Trim( ignoreChars ); + } + else if( str.StartsWith( "#GENRE", StringComparison.OrdinalIgnoreCase ) ) + { + this.Genre = str.Substring( 6 ).Trim( ignoreChars ); + } + else if ( str.StartsWith( "#FONTCOLOR", StringComparison.OrdinalIgnoreCase ) ) + { + this.Color = ColorTranslator.FromHtml( str.Substring( 10 ).Trim( ignoreChars ) ); + } + else if (str.StartsWith("#FORECOLOR", StringComparison.OrdinalIgnoreCase)) + { + this.ForeColor = ColorTranslator.FromHtml(str.Substring(10).Trim(ignoreChars)); + IsChangedForeColor = true; + } + else if (str.StartsWith("#BACKCOLOR", StringComparison.OrdinalIgnoreCase)) + { + this.BackColor = ColorTranslator.FromHtml(str.Substring(10).Trim(ignoreChars)); + IsChangedBackColor = true; + } + else + { + for(int i = 0; i < 3; i++) + { + if (str.StartsWith("#BOXEXPLANATION" + (i + 1).ToString(), StringComparison.OrdinalIgnoreCase)) + { + this.strBoxText[i] = str.Substring(16).Trim(ignoreChars); + } + } + } + } + continue; + } + catch (Exception e) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (178a9a36-a59e-4264-8e4c-b3c3459db43c)" ); + continue; + } + } + } + reader.Close(); + } + } +} diff --git a/TJAPlayer3/Songs/CCourse.cs b/TJAPlayer3/Songs/CCourse.cs new file mode 100644 index 00000000..bb72afa1 --- /dev/null +++ b/TJAPlayer3/Songs/CCourse.cs @@ -0,0 +1,48 @@ +サソusing System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; + +namespace TJAPlayer3 +{ + public class CCourse + { + //2016.11.07 kairera0467 + //縺ィ繧翫≠縺医★繝。繝「莉」繧上j縺ォ + // + // + //笳九さ繝シ繧ケ繝繝シ繧ソシ.tjcシ + + //隍謨ー縺ョ譖イ繧貞ア騾壹ョ繧イ繝シ繧ク縺ァ騾」邯壹@縺ヲ貍泌・上@縺セ縺吶 + //騾壼クク繧イ繝シ繧ク縺ッ譟先ョオ菴崎ェ榊ョ壹▲縺ス縺蠅玲ク帙ョ莉墓婿繧偵@縺セ縺呻シ郁」懈ュ」縺ェ縺暦シ峨 + + //縺セ縺滓峇縺ッ閾ェ蜍慕噪縺ォ蜀咲函縺輔l繧九◆繧√√ー縺縺昴¥遲峨ョ繧ェ繝励す繝ァ繝ウ縺ョ菴ソ逕ィ縺ッ蜃コ譚・縺セ縺帙s縲 + + //.tjc縺ョ繝輔ぃ繧、繝ォ縺ッ莉悶ョ隴憺擇シ.tja遲会シ峨→蜷梧ァ倥↓謇ア繧上l繧九ョ縺ァ隴憺擇繝繝シ繧ソ縺ィ蜷後§繝輔か繝ォ繝縺ォ蜈・繧後※繧よァ九>縺セ縺帙s縲 + // + // 笳上倥ャ繝 + + // TITLE: 繧ウ繝シ繧ケ縺ョ蜷榊燕縲 + + // COURSE: 縲窪asy縲阪君ormal縲阪粂ard縲阪薫ni縲阪窪dit縲阪b縺励¥縺ッ0-4縺ョ蛟、縲 + // 隴憺擇縺ョ髮」譏灘コヲ縲ゑシ医さ繝シ繧ケ縺ィ蜻シ縺カ縺ィ繧繧縺薙@縺縺ァ縺吶′縺碑ォ呈価縺上□縺輔>シ + // 謖螳壹@縺溯ュ憺擇縺ッ蜈ィ縺ヲ縺薙%縺ァ謖螳壹☆繧矩屮譏灘コヲ縺ョ隴憺擇縺梧オ√l縺セ縺吶 + // 譖イ縺斐→縺ョ謖螳壹ッシ井サ翫ョ縺ィ縺薙mシ峨〒縺阪∪縺帙s縲 + + // LIFE: 繝ゥ繧、繝輔ら怐逡・蜿ッ縲 + // 縺薙%縺ォ蛟、繧貞・繧後k縺ィ騾壼クク繧イ繝シ繧ク縺ョ莉」繧上j縺ォ繝ゥ繧、繝募宛縺ォ縺ェ繧翫∪縺吶 + + // SONG: 譖イ繝繝シ繧ソ縲 + // 貍泌・上☆繧区峇縺ョ繝輔ぃ繧、繝ォ蜷搾シ.tja/.tjfシ峨rtaikojiro.exe縺ョ縺ゅk繝繧」繝ャ繧ッ繝医Μ縺九i縺ョ逶ク蟇セ繝代せ縺ァ謖螳壹 + // 謖螳壹&繧後◆繝繝シ繧ソ縺ッ荳翫↓縺ゅk繧ゅョ縺九i鬆縺ォ貍泌・上&繧後∪縺吶 + + + public void t蜈・蜉( string str繝輔ぃ繧、繝ォ蜷 ) + { + StreamReader reader = new StreamReader( str繝輔ぃ繧、繝ォ蜷 ); + string str = reader.ReadToEnd(); + reader.Close(); + } + } +} diff --git a/TJAPlayer3/Songs/CDTX.cs b/TJAPlayer3/Songs/CDTX.cs new file mode 100644 index 00000000..2d63b090 --- /dev/null +++ b/TJAPlayer3/Songs/CDTX.cs @@ -0,0 +1,8495 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using System.Diagnostics; +using System.IO; +using System.Globalization; +using System.Threading; +using System.Text.RegularExpressions; +using FDK; +using FDK.ExtensionMethods; +using TJAPlayer3; + +namespace TJAPlayer3 +{ + internal class CDTX : CActivity + { + // 螳壽焚 + + public enum E遞ョ蛻・ { DTX, GDA, G2D, BMS, BME, SMF } + + // 繧ッ繝ゥ繧ケ + + public class CAVI : IDisposable + { + public CAvi avi; + private bool bDispose貂医∩; + public int n逡ェ蜿キ; + public string str繧ウ繝。繝ウ繝域枚 = ""; + public string str繝輔ぃ繧、繝ォ蜷 = ""; + + public void OnDeviceCreated() + { + #region [ strAVI繝輔ぃ繧、繝ォ蜷阪ョ菴懈舌] + //----------------- + string strAVI繝輔ぃ繧、繝ォ蜷; + if (!string.IsNullOrEmpty(TJAPlayer3.DTX.PATH_WAV)) + strAVI繝輔ぃ繧、繝ォ蜷 = TJAPlayer3.DTX.PATH_WAV + this.str繝輔ぃ繧、繝ォ蜷; + else + strAVI繝輔ぃ繧、繝ォ蜷 = TJAPlayer3.DTX.str繝輔か繝ォ繝蜷 + this.str繝輔ぃ繧、繝ォ蜷; + //----------------- + #endregion + + if (!File.Exists(strAVI繝輔ぃ繧、繝ォ蜷)) + { + Trace.TraceWarning("繝輔ぃ繧、繝ォ縺悟ュ伜惠縺励∪縺帙s縲({0})({1})", this.str繧ウ繝。繝ウ繝域枚, strAVI繝輔ぃ繧、繝ォ蜷); + this.avi = null; + return; + } + + // AVI 縺ョ逕滓舌 + + try + { + this.avi = new CAvi(strAVI繝輔ぃ繧、繝ォ蜷); + Trace.TraceInformation("蜍慕判繧堤函謌舌@縺セ縺励◆縲({0})({1})({2}frames)", this.str繧ウ繝。繝ウ繝域枚, strAVI繝輔ぃ繧、繝ォ蜷, this.avi.GetMaxFrameCount()); + } + catch (Exception e) + { + Trace.TraceError(e.ToString()); + Trace.TraceError("蜍慕判縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲({0})({1})", this.str繧ウ繝。繝ウ繝域枚, strAVI繝輔ぃ繧、繝ォ蜷); + this.avi = null; + } + } + public override string ToString() + { + return string.Format("CAVI{0}: File:{1}, Comment:{2}", CDTX.tZZ(this.n逡ェ蜿キ), this.str繝輔ぃ繧、繝ォ蜷, this.str繧ウ繝。繝ウ繝域枚); + } + + #region [ IDisposable 螳溯」 ] + //----------------- + public void Dispose() + { + if (this.bDispose貂医∩) + return; + + if (this.avi != null) + { + #region [ strAVI繝輔ぃ繧、繝ォ蜷 縺ョ菴懈舌 ] + //----------------- + string strAVI繝輔ぃ繧、繝ォ蜷; + if (!string.IsNullOrEmpty(TJAPlayer3.DTX.PATH_WAV)) + strAVI繝輔ぃ繧、繝ォ蜷 = TJAPlayer3.DTX.PATH_WAV + this.str繝輔ぃ繧、繝ォ蜷; + else + strAVI繝輔ぃ繧、繝ォ蜷 = TJAPlayer3.DTX.str繝輔か繝ォ繝蜷 + this.str繝輔ぃ繧、繝ォ蜷; + //----------------- + #endregion + + this.avi.Dispose(); + this.avi = null; + + Trace.TraceInformation("蜍慕判繧定ァ」謾セ縺励∪縺励◆縲({0})({1})", this.str繧ウ繝。繝ウ繝域枚, strAVI繝輔ぃ繧、繝ォ蜷); + } + + this.bDispose貂医∩ = true; + } + //----------------- + #endregion + } + public class CAVIPAN + { + public int nAVI逡ェ蜿キ; + public int n遘サ蜍墓凾髢田t; + public int n逡ェ蜿キ; + public Point pt蜍慕判蛛エ髢句ァ倶ス咲スョ = new Point(0, 0); + public Point pt蜍慕判蛛エ邨ゆコ菴咲スョ = new Point(0, 0); + public Point pt陦ィ遉コ蛛エ髢句ァ倶ス咲スョ = new Point(0, 0); + public Point pt陦ィ遉コ蛛エ邨ゆコ菴咲スョ = new Point(0, 0); + public Size sz髢句ァ九し繧、繧コ = new Size(0, 0); + public Size sz邨ゆコ繧オ繧、繧コ = new Size(0, 0); + + public override string ToString() + { + return string.Format("CAVIPAN{0}: AVI:{14}, 髢句ァ九し繧、繧コ:{1}x{2}, 邨ゆコ繧オ繧、繧コ:{3}x{4}, 蜍慕判蛛エ髢句ァ倶ス咲スョ:{5}x{6}, 蜍慕判蛛エ邨ゆコ菴咲スョ:{7}x{8}, 陦ィ遉コ蛛エ髢句ァ倶ス咲スョ:{9}x{10}, 陦ィ遉コ蛛エ邨ゆコ菴咲スョ:{11}x{12}, 遘サ蜍墓凾髢:{13}ct", + CDTX.tZZ(this.n逡ェ蜿キ), + this.sz髢句ァ九し繧、繧コ.Width, this.sz髢句ァ九し繧、繧コ.Height, + this.sz邨ゆコ繧オ繧、繧コ.Width, this.sz邨ゆコ繧オ繧、繧コ.Height, + this.pt蜍慕判蛛エ髢句ァ倶ス咲スョ.X, this.pt蜍慕判蛛エ髢句ァ倶ス咲スョ.Y, + this.pt蜍慕判蛛エ邨ゆコ菴咲スョ.X, this.pt蜍慕判蛛エ邨ゆコ菴咲スョ.Y, + this.pt陦ィ遉コ蛛エ髢句ァ倶ス咲スョ.X, this.pt陦ィ遉コ蛛エ髢句ァ倶ス咲スョ.Y, + this.pt陦ィ遉コ蛛エ邨ゆコ菴咲スョ.X, this.pt陦ィ遉コ蛛エ邨ゆコ菴咲スョ.Y, + this.n遘サ蜍墓凾髢田t, + CDTX.tZZ(this.nAVI逡ェ蜿キ)); + } + } + public class CDirectShow : IDisposable + { + public FDK.CDirectShow dshow; + private bool bDispose貂医∩; + public int n逡ェ蜿キ; + public string str繧ウ繝。繝ウ繝域枚 = ""; + public string str繝輔ぃ繧、繝ォ蜷 = ""; + + public void OnDeviceCreated() + { + #region [ str蜍慕判繝輔ぃ繧、繝ォ蜷阪ョ菴懈舌] + //----------------- + string str蜍慕判繝輔ぃ繧、繝ォ蜷; + if (!string.IsNullOrEmpty(TJAPlayer3.DTX.PATH_WAV)) + str蜍慕判繝輔ぃ繧、繝ォ蜷 = TJAPlayer3.DTX.PATH_WAV + this.str繝輔ぃ繧、繝ォ蜷; + else + str蜍慕判繝輔ぃ繧、繝ォ蜷 = TJAPlayer3.DTX.str繝輔か繝ォ繝蜷 + this.str繝輔ぃ繧、繝ォ蜷; + //----------------- + #endregion + + if (!File.Exists(str蜍慕判繝輔ぃ繧、繝ォ蜷)) + { + Trace.TraceWarning("繝輔ぃ繧、繝ォ縺悟ュ伜惠縺励∪縺帙s縲({0})({1})", this.str繧ウ繝。繝ウ繝域枚, str蜍慕判繝輔ぃ繧、繝ォ蜷); + this.dshow = null; + } + + // AVI 縺ョ逕滓舌 + + try + { + this.dshow = new FDK.CDirectShow(TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ + this.str繝輔ぃ繧、繝ォ蜷, TJAPlayer3.app.WindowHandle, true); + Trace.TraceInformation("DirectShow繧堤函謌舌@縺セ縺励◆縲({0})({1})({2}byte)", this.str繧ウ繝。繝ウ繝域枚, str蜍慕判繝輔ぃ繧、繝ォ蜷, this.dshow.n繝繝シ繧ソ繧オ繧、繧コbyte); + } + catch (Exception e) + { + Trace.TraceError(e.ToString()); + Trace.TraceError("DirectShow縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲({0})({1})", this.str繧ウ繝。繝ウ繝域枚, str蜍慕判繝輔ぃ繧、繝ォ蜷); + this.dshow = null; + } + } + public override string ToString() + { + return string.Format("CAVI{0}: File:{1}, Comment:{2}", CDTX.tZZ(this.n逡ェ蜿キ), this.str繝輔ぃ繧、繝ォ蜷, this.str繧ウ繝。繝ウ繝域枚); + } + + #region [ IDisposable 螳溯」 ] + //----------------- + public void Dispose() + { + if (this.bDispose貂医∩) + return; + + if (this.dshow != null) + { + #region [ strAVI繝輔ぃ繧、繝ォ蜷 縺ョ菴懈舌 ] + //----------------- + string str蜍慕判繝輔ぃ繧、繝ォ蜷; + if (!string.IsNullOrEmpty(TJAPlayer3.DTX.PATH_WAV)) + str蜍慕判繝輔ぃ繧、繝ォ蜷 = TJAPlayer3.DTX.PATH_WAV + this.str繝輔ぃ繧、繝ォ蜷; + else + str蜍慕判繝輔ぃ繧、繝ォ蜷 = TJAPlayer3.DTX.str繝輔か繝ォ繝蜷 + this.str繝輔ぃ繧、繝ォ蜷; + //----------------- + #endregion + + this.dshow.Dispose(); + this.dshow = null; + + Trace.TraceInformation("蜍慕判繧定ァ」謾セ縺励∪縺励◆縲({0})({1})", this.str繧ウ繝。繝ウ繝域枚, str蜍慕判繝輔ぃ繧、繝ォ蜷); + } + + this.bDispose貂医∩ = true; + } + //----------------- + #endregion + } + + public class CBPM + { + public double dbBPM蛟、; + public double bpm_change_time; + public double bpm_change_bmscroll_time; + public ECourse bpm_change_course = ECourse.eNormal; + public int n蜀驛ィ逡ェ蜿キ; + public int n陦ィ險倅ク翫ョ逡ェ蜿キ; + + public override string ToString() + { + StringBuilder builder = new StringBuilder(0x80); + if (this.n蜀驛ィ逡ェ蜿キ != this.n陦ィ險倅ク翫ョ逡ェ蜿キ) + { + builder.Append(string.Format("CBPM{0}(蜀驛ィ{1})", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ), this.n蜀驛ィ逡ェ蜿キ)); + } + else + { + builder.Append(string.Format("CBPM{0}", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ))); + } + builder.Append(string.Format(", BPM:{0}", this.dbBPM蛟、)); + return builder.ToString(); + } + } + public class CSCROLL + { + public double dbSCROLL蛟、; + public double dbSCROLL蛟、Y; + public int n蜀驛ィ逡ェ蜿キ; + public int n陦ィ險倅ク翫ョ逡ェ蜿キ; + + public override string ToString() + { + StringBuilder builder = new StringBuilder(0x80); + if (this.n蜀驛ィ逡ェ蜿キ != this.n陦ィ險倅ク翫ョ逡ェ蜿キ) + { + builder.Append(string.Format("CSCROLL{0}(蜀驛ィ{1})", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ), this.n蜀驛ィ逡ェ蜿キ)); + } + else + { + builder.Append(string.Format("CSCROLL{0}", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ))); + } + builder.Append(string.Format(", SCROLL:{0}", this.dbSCROLL蛟、)); + return builder.ToString(); + } + } + /// + /// 蛻、螳壹Λ繧、繝ウ遘サ蜍募多莉、 + /// + public class CJPOSSCROLL + { + public double db遘サ蜍墓凾髢; + public int n遘サ蜍戊キ晞屬px; + public int n遘サ蜍墓婿蜷; //遘サ蜍墓婿蜷代ッ0(蟾ヲ)縲1(蜿ウ)縺ョ2縺、縺縺代 + public int n蜀驛ィ逡ェ蜿キ; + public int n陦ィ險倅ク翫ョ逡ェ蜿キ; + + public override string ToString() + { + StringBuilder builder = new StringBuilder(0x80); + if (this.n蜀驛ィ逡ェ蜿キ != this.n陦ィ險倅ク翫ョ逡ェ蜿キ) + { + builder.Append(string.Format("CJPOSSCROLL{0}(蜀驛ィ{1})", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ), this.n蜀驛ィ逡ェ蜿キ)); + } + else + { + builder.Append(string.Format("CJPOSSCROLL{0}", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ))); + } + builder.Append(string.Format(", JPOSSCROLL:{0}", this.db遘サ蜍墓凾髢)); + return builder.ToString(); + } + } + + public class CDELAY + { + public int nDELAY蛟、; //譬シ邏肴凾縺ォ縺ッms縺ォ縺ェ縺」縺ヲ縺繧九◆繧√‥ouble縺ォ縺ッ縺励↑縺縲 + public int n蜀驛ィ逡ェ蜿キ; + public int n陦ィ險倅ク翫ョ逡ェ蜿キ; + public double delay_time; + public double delay_bmscroll_time; + public double delay_bpm; + public ECourse delay_course = ECourse.eNormal; + + public override string ToString() + { + StringBuilder builder = new StringBuilder(0x80); + if (this.n蜀驛ィ逡ェ蜿キ != this.n陦ィ險倅ク翫ョ逡ェ蜿キ) + { + builder.Append(string.Format("CDELAY{0}(蜀驛ィ{1})", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ), this.n蜀驛ィ逡ェ蜿キ)); + } + else + { + builder.Append(string.Format("CDELAY{0}", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ))); + } + builder.Append(string.Format(", DELAY:{0}", this.nDELAY蛟、)); + return builder.ToString(); + } + } + public enum E蛻蟯千ィョ鬘 + { + e邊セ蠎ヲ蛻蟯, + e騾」謇灘蟯, + e繧ケ繧ウ繧「蛻蟯, + e螟ァ髻ウ隨ヲ縺ョ縺ソ邊セ蠎ヲ蛻蟯 + } + public class CBRANCH + { + public E蛻蟯千ィョ鬘 e蛻蟯舌ョ遞ョ鬘; //0:邊セ蠎ヲ蛻蟯 1:騾」謇灘蟯 2:繧ケ繧ウ繧「蛻蟯 3:螟ァ髻ウ隨ヲ縺ョ縺ソ縺ョ邊セ蠎ヲ蛻蟯 + public double n譚。莉カ謨ー蛟、A; + public double n譚。莉カ謨ー蛟、B; + public double db蛻蟯先凾髢; + public double db蛻蟯先凾髢杜s; + public double db蛻、螳壽凾髢; + public double dbBMScrollTime; + public double dbBPM; + public double dbSCROLL; + public int n迴セ蝨ィ縺ョ蟆冗ッ; + public int n蜻ス莉、譎ゅョChipList逡ェ蜿キ; + + public int n陦ィ險倅ク翫ョ逡ェ蜿キ; + public int n蜀驛ィ逡ェ蜿キ; + + public override string ToString() + { + StringBuilder builder = new StringBuilder(0x80); + if (this.n蜀驛ィ逡ェ蜿キ != this.n陦ィ險倅ク翫ョ逡ェ蜿キ) + { + builder.Append(string.Format("CBRANCH{0}(蜀驛ィ{1})", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ), this.n蜀驛ィ逡ェ蜿キ)); + } + else + { + builder.Append(string.Format("CBRANCH{0}", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ))); + } + builder.Append(string.Format(", BRANCH:{0}", this.e蛻蟯舌ョ遞ョ鬘)); + return builder.ToString(); + } + } + + + public class CChip : IComparable, ICloneable + { + public bool bHit; + public bool b蜿ッ隕 = true; + public bool bShow; + public bool bShowRoll; + public bool bBranch = false; + public double db繝√ャ繝励し繧、繧コ蛟咲紫 = 1.0; + public double db螳滓焚蛟、; + public double dbBPM; + public float fNow_Measure_s = 4.0f;//蠑キ蛻カ蛻蟯舌ョ縺溘a縺ォ霑ス蜉.2020.04.21.akasoko26 + public float fNow_Measure_m = 4.0f;//蠑キ蛻カ蛻蟯舌ョ縺溘a縺ォ霑ス蜉.2020.04.21.akasoko26 + public bool IsEndedBranching = false;//蛻蟯舌′邨ゅo縺」縺滓凾縺ョ騾」謇楢ュ憺擇縺碁撼蜿ッ隕門喧縺ォ縺ェ縺」縺ヲ縺励∪縺縺溘a繝輔Λ繧ー繧定ソス蜉.2020.04.21.akasoko26 + public double dbSCROLL; + public double dbSCROLL_Y; + public ECourse n繧ウ繝シ繧ケ; + public int nSenote; + public int nState; + public int nRollCount; + public int nBalloon; + public int nProcessTime; + public int n繧ケ繧ッ繝ュ繝シ繝ォ譁ケ蜷; + public int n謠冗判蜆ェ蜈亥コヲ; //(迚ケ谿)迴セ迥カ騾」謇薙→縺ョ蛻、譁ュ逶ョ逧縺ァ菴ソ逕ィ + public ENoteState eNoteState; + public EAVI遞ョ蛻・ eAVI遞ョ蛻・; + public E讌ス蝎ィ繝代シ繝 e讌ス蝎ィ繝代シ繝 = E讌ス蝎ィ繝代シ繝.UNKNOWN; + public int n繝√Ε繝ウ繝阪Ν逡ェ蜿キ; + public STDGBVALUE n繝舌シ縺九i縺ョ霍晞屬dot; + public int n繝舌シ縺九i縺ョ繝弱シ繝譛ォ遶ッ霍晞屬dot; + public int n謨エ謨ー蛟、; + public int n譁蟄玲焚 = 16; + + public int n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ; + public int n邱冗ァサ蜍墓凾髢; + public int n騾乗主コヲ = 0xff; + public int n逋コ螢ー菴咲スョ; + public double n譚。莉カ謨ー蛟、A; + public double n譚。莉カ謨ー蛟、B; + public double db蛻蟯先凾髢薙ョ繧コ繝ャ; + public E蛻蟯千ィョ鬘 e蛻蟯舌ョ遞ョ鬘; + + public double db逋コ螢ー菴咲スョ; // 逋コ螢ー譎ょ綾繧呈シ邏阪@縺ヲ縺縺溷、画焚縺ョ縺縺。縺ョシ代▽繧断loat蝙九°繧嬰ouble蝙九↓螟画峩縲(kairera0467) + public double fBMSCROLLTime; + public double fBMSCROLLTime_end; + public int n逋コ螢ー譎ょ綾ms; + public double n蛻蟯先凾蛻サms; + + + public double db逋コ螢ー譎ょ綾ms; + public int n繝弱シ繝邨ゆコ菴咲スョ; + public int n繝弱シ繝邨ゆコ譎ょ綾ms; + public int n繝弱シ繝蜃コ迴セ譎ょ綾ms; + public int n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms; + public int n蛻蟯仙屓謨ー; + public int n騾」謇馴浹隨ヲState; + public int nLag; // 2011.2.1 yyagi + public CDTX.CAVI rAVI; + public CDTX.CAVIPAN rAVIPan; + public CDTX.CDirectShow rDShow; + public double db逋コ螢ー譎ょ綾; + public double db蛻、螳夂オゆコ譎ょ綾;//騾」謇鍋ウサ髻ウ隨ヲ縺ァ菴ソ逕ィ + public double dbProcess_Time; + public int nPlayerSide; + public bool bGOGOTIME = false; //2018.03.11 k1airera0467 繧エ繝シ繧エ繝シ繧ソ繧、繝蜀縺ョ繝√ャ繝励〒縺ゅk縺 + public int nList荳翫ョ菴咲スョ; + public bool IsFixedSENote; + public bool IsHitted = false; + public bool IsMissed = false; + + public bool bBPM繝√ャ繝励〒縺ゅk + { + get + { + if (this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 3 || this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 8) + { + return true; + } + else + { + return false; + } + } + } + public bool b閾ェ蜍募咲函髻ウ繝√Ε繝ウ繝阪Ν縺ァ縺ゅk + { + get + { + int num = this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ; + if ((((num != 1) && ((0x61 > num) || (num > 0x69))) && ((0x70 > num) || (num > 0x79))) && ((0x80 > num) || (num > 0x89))) + { + return ((0x90 <= num) && (num <= 0x92)); + } + return true; + } + } + + + + public bool b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk; // #32248 2013.10.14 yyagi + public CCounter RollDelay; // 18.9.22 AioiLight Add 騾」謇捺凾縺ォ襍、縺上↑繧九d縺、縺ョ繧ソ繧、繝槭シ + public CCounter RollInputTime; // 18.9.22 AioiLight Add 騾」謇灘・蜉帛セ後ヽollDelay縺御ス懷虚縺吶k縺セ縺ァ縺ョ繧ソ繧、繝槭シ + public int RollEffectLevel; // 18.9.22 AioiLight Add 騾」謇捺凾縺ォ襍、縺上↑繧九d縺、縺ョ蠎ヲ蜷医> + + public CChip() + { + this.n繝舌シ縺九i縺ョ霍晞屬dot = new STDGBVALUE() + { + Drums = 0, + Guitar = 0, + Bass = 0, + Taiko = 0 + }; + } + public void t蛻晄悄蛹() + { + this.bBranch = false; + this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0; + this.n謨エ謨ー蛟、 = 0; //謨エ謨ー蛟、繧鱈ist荳翫ョ逡ェ蜿キ縺ィ縺励※逕ィ縺繧九 + this.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 0; + this.db螳滓焚蛟、 = 0.0; + this.n逋コ螢ー菴咲スョ = 0; + this.db逋コ螢ー菴咲スョ = 0.0D; + this.n逋コ螢ー譎ょ綾ms = 0; + this.db逋コ螢ー譎ょ綾ms = 0.0D; + this.fBMSCROLLTime = 0; + this.n繝弱シ繝邨ゆコ菴咲スョ = 0; + this.n繝弱シ繝邨ゆコ譎ょ綾ms = 0; + this.n謠冗判蜆ェ蜈亥コヲ = 0; + this.nLag = -999; + this.b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk = false; + this.nList荳翫ョ菴咲スョ = 0; + this.db繝√ャ繝励し繧、繧コ蛟咲紫 = 1.0; + this.bHit = false; + this.IsMissed = false; + this.b蜿ッ隕 = true; + this.e讌ス蝎ィ繝代シ繝 = E讌ス蝎ィ繝代シ繝.UNKNOWN; + this.n騾乗主コヲ = 0xff; + this.n繝舌シ縺九i縺ョ霍晞屬dot.Drums = 0; + this.n繝舌シ縺九i縺ョ霍晞屬dot.Guitar = 0; + this.n繝舌シ縺九i縺ョ霍晞屬dot.Bass = 0; + this.n繝舌シ縺九i縺ョ霍晞屬dot.Taiko = 0; + this.n繝舌シ縺九i縺ョ繝弱シ繝譛ォ遶ッ霍晞屬dot = 0; + this.n邱冗ァサ蜍墓凾髢 = 0; + this.dbBPM = 120.0; + this.fNow_Measure_m = 4.0f; + this.fNow_Measure_s = 4.0f; + this.n繧ケ繧ッ繝ュ繝シ繝ォ譁ケ蜷 = 0; + this.dbSCROLL = 1.0; + this.dbSCROLL_Y = 0.0f; + } + public override string ToString() + { + + //2016.10.07 kairera0467 霑第律荳ュ縺ォ蜀咲キィ謌蝉コ亥ョ + string[] chToStr = + { + //繧キ繧ケ繝繝 + "??", "繝舌ャ繧ッ繧ウ繝シ繝ゥ繧ケ", "蟆冗ッ髟キ螟画峩", "BPM螟画峩", "??", "??", "??", "??", + "BPM螟画峩(諡。蠑オ)", "??", "??", "??", "??", "??", "??", "??", + + //螟ェ鮠1P(遘サ蜍穂コ亥ョ) + "??", "繝峨Φ", "繧ォ繝", "繝峨Φ(螟ァ)", "繧ォ繝(螟ァ)", "騾」謇", "騾」謇(螟ァ)", "縺オ縺縺帙s騾」謇", + "騾」謇鍋オらせ", "闃", "繝峨Φ(謇)", "繧ォ繝(謇)", "??", "??", "??", "AD-LIB", + + //螟ェ鮠謎コ亥y + "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", + + //螟ェ鮠謎コ亥y + "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", + + //螟ェ鮠謎コ亥y + "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", + + //繧キ繧ケ繝繝 + "蟆冗ッ邱", "諡咲キ", "??", "??", "AVI", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", + + //繧キ繧ケ繝繝(遘サ蜍穂コ亥ョ) + "SCROLL", "DELAY", "繧エ繝シ繧エ繝シ繧ソ繧、繝髢句ァ", "繧エ繝シ繧エ繝シ繧ソ繧、繝邨ゆコ", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", + + "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", + + "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", + + //螟ェ鮠1P縲√す繧ケ繝繝(迴セ陦) + "??", "??", "??", "螟ェ鮠点襍、", "螟ェ鮠点髱", "螟ェ鮠点襍、(螟ァ)", "螟ェ鮠点髱(螟ァ)", "螟ェ鮠点鮟", + "螟ェ鮠点鮟(螟ァ)", "螟ェ鮠点鬚ィ闊ケ", "螟ェ鮠点騾」謇捺忰遶ッ", "螟ェ鮠点闃", "??", "SCROLL", "繧エ繝シ繧エ繝シ繧ソ繧、繝髢句ァ", "繧エ繝シ繧エ繝シ繧ソ繧、繝邨ゆコ", + + "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "螟ェ鮠 AD-LIB", + + "??", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", + + "??", "??", "??", "??", "0xC4", "0xC5", "0xC6", "??", + "??", "??", "0xCA", "??", "??", "??", "??", "0xCF", + + //繧キ繧ケ繝繝(迴セ陦) + "0xD0", "??", "??", "??", "??", "??", "??", "??", + "??", "??", "繝溘く繧オ繝シ霑ス蜉", "繝溘く繧オ繝シ蜑企勁", "DELAY", "隴憺擇蛻蟯舌Μ繧サ繝繝", "隴憺擇蛻蟯舌い繝九Γ", "隴憺擇蛻蟯仙驛ィ蜃ヲ逅", + + //繧キ繧ケ繝繝(迴セ陦) + "蟆冗ッ邱唹N/OFF", "蛻蟯仙崋螳", "蛻、螳壽棧遘サ蜍", "", "", "", "", "", + "", "", "", "", "", "", "", "", + + "0xF0", "豁瑚ゥ", "??", "SUDDEN", "??", "??", "??", "??", + "??", "??", "??", "??", "??", "??", "??", "??", "隴憺擇邨ゆコ" + }; + return string.Format("CChip: 菴咲スョ:{0:D4}.{1:D3}, 譎ょ綾{2:D6}, Ch:{3:X2}({4}), Pn:{5}({11})(蜀驛ィ{6}), Pd:{7}, Sz:{8}, BMScroll:{9}, Auto:{10}, 繧ウ繝シ繧ケ:{11}", + this.n逋コ螢ー菴咲スョ / 384, this.n逋コ螢ー菴咲スョ % 384, + this.n逋コ螢ー譎ょ綾ms, + this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ, chToStr[this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ], + this.n謨エ謨ー蛟、, this.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, + this.db螳滓焚蛟、, + this.db繝√ャ繝励し繧、繧コ蛟咲紫, + this.fBMSCROLLTime, + this.b閾ェ蜍募咲函髻ウ繝√Ε繝ウ繝阪Ν縺ァ縺ゅk, + this.n繧ウ繝シ繧ケ, + CDTX.tZZ(this.n謨エ謨ー蛟、)); + } + /// + /// 繝√ャ繝励ョ蜀咲函髟キ繧貞叙蠕励☆繧九ら樟迥カ縲仝AV繝√ャ繝励→BGA繝√ャ繝励〒縺ョ縺ソ菴ソ逕ィ蜿ッ閭ス縲 + /// + /// 蜀咲函髟キ(ms) + public int GetDuration() + { + int nDuration = 0; + + if (this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01) // WAV + { + CDTX.CWAV wc; + TJAPlayer3.DTX.listWAV.TryGetValue(this.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, out wc); + if (wc == null) + { + nDuration = 0; + } + else + { + nDuration = (wc.rSound[0] == null) ? 0 : wc.rSound[0].n邱乗シ泌・乗凾髢杜s; + } + } + else if (this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x54) // AVI + { + if (this.rAVI != null && this.rAVI.avi != null) + { + int dwRate = (int)this.rAVI.avi.dw繝ャ繝シ繝; + int dwScale = (int)this.rAVI.avi.dw繧ケ繧ア繝シ繝ォ; + nDuration = (int)(1000.0f * dwScale / dwRate * this.rAVI.avi.GetMaxFrameCount()); + } + } + + double _db蜀咲函騾溷コヲ = (TJAPlayer3.DTXVmode.Enabled) ? TJAPlayer3.DTX.dbDTXVPlaySpeed : TJAPlayer3.DTX.db蜀咲函騾溷コヲ; + return (int)(nDuration / _db蜀咲函騾溷コヲ); + } + + #region [ IComparable 螳溯」 ] + //----------------- + + private static readonly byte[] n蜆ェ蜈亥コヲ = new byte[] { + 5, 5, 3, 7, 5, 5, 5, 5, 3, 5, 5, 5, 5, 5, 5, 5, //0x00 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x10 + 7, 7, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, //0x20 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x30 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x40 + 9, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x50 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x60 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x70 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0x80 + 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 9, 9, 9, //0x90 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xA0 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xB0 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xC0 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 4, 4, //0xD0 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xE0 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, //0xF0 + }; + + public int CompareTo(CDTX.CChip other) + { + // 縺セ縺壹ッ菴咲スョ縺ァ豈碑シ縲 + + //BGM繝√ャ繝励□縺醍匱螢ー菴咲スョ + //if( this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01 || this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x02 ) + //{ + // if( this.n逋コ螢ー菴咲スョ < other.n逋コ螢ー菴咲スョ ) + // return -1; + + // if( this.n逋コ螢ー菴咲スョ > other.n逋コ螢ー菴咲スョ ) + // return 1; + //} + + //if( this.n逋コ螢ー菴咲スョ < other.n逋コ螢ー菴咲スョ ) + // return -1; + + //if( this.n逋コ螢ー菴咲スョ > other.n逋コ螢ー菴咲スョ ) + // return 1; + + //隴憺擇隗」譫舌Γ繧ス繝繝鰻4縺ァ縺ッ逋コ螢ー譎ょ綾ms縺ァ豈碑シ縺吶k縲 + var n逋コ螢ー譎ょ綾msCompareToResult = 0; + n逋コ螢ー譎ょ綾msCompareToResult = this.n逋コ螢ー譎ょ綾ms.CompareTo(other.n逋コ螢ー譎ょ綾ms); + if (n逋コ螢ー譎ょ綾msCompareToResult != 0) + { + return n逋コ螢ー譎ょ綾msCompareToResult; + } + + n逋コ螢ー譎ょ綾msCompareToResult = this.db逋コ螢ー譎ょ綾ms.CompareTo(other.db逋コ螢ー譎ょ綾ms); + if (n逋コ螢ー譎ょ綾msCompareToResult != 0) + { + return n逋コ螢ー譎ょ綾msCompareToResult; + } + + // 菴咲スョ縺悟酔縺倥↑繧牙━蜈亥コヲ縺ァ豈碑シ縲 + return n蜆ェ蜈亥コヲ[this.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ].CompareTo(n蜆ェ蜈亥コヲ[other.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ]); + } + //----------------- + #endregion + /// + /// shallow copy縺ァ縺吶 + /// + /// + public object Clone() + { + return MemberwiseClone(); + } + } + public class CWAV : IDisposable + { + public bool bBGM縺ィ縺励※菴ソ縺; + public List list縺薙ョWAV繧剃スソ逕ィ縺吶k繝√Ε繝ウ繝阪Ν逡ェ蜿キ縺ョ髮蜷 = new List(16); + public int n繝√ャ繝励し繧、繧コ = 100; + public int n菴咲スョ; + public long[] n荳譎ょ●豁「譎ょ綾 = new long[TJAPlayer3.ConfigIni.nPoliphonicSounds]; // 4 + public int SongVol = CSound.DefaultSongVol; + public LoudnessMetadata? SongLoudnessMetadata = null; + public int n迴セ蝨ィ蜀咲函荳ュ縺ョ繧オ繧ヲ繝ウ繝臥分蜿キ; + public long[] n蜀咲函髢句ァ区凾蛻サ = new long[TJAPlayer3.ConfigIni.nPoliphonicSounds]; // 4 + public int n蜀驛ィ逡ェ蜿キ; + public int n陦ィ險倅ク翫ョ逡ェ蜿キ; + public CSound[] rSound = new CSound[TJAPlayer3.ConfigIni.nPoliphonicSounds]; // 4 + public string str繧ウ繝。繝ウ繝域枚 = ""; + public string str繝輔ぃ繧、繝ォ蜷 = ""; + public bool bBGM縺ィ縺励※菴ソ繧上↑縺 + { + get + { + return !this.bBGM縺ィ縺励※菴ソ縺; + } + set + { + this.bBGM縺ィ縺励※菴ソ縺 = !value; + } + } + public bool bIsBassSound = false; + public bool bIsGuitarSound = false; + public bool bIsDrumsSound = false; + public bool bIsSESound = false; + public bool bIsBGMSound = false; + + public override string ToString() + { + var sb = new StringBuilder(128); + + if (this.n陦ィ險倅ク翫ョ逡ェ蜿キ == this.n蜀驛ィ逡ェ蜿キ) + { + sb.Append(string.Format("CWAV{0}: ", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ))); + } + else + { + sb.Append(string.Format("CWAV{0}(蜀驛ィ{1}): ", CDTX.tZZ(this.n陦ィ險倅ク翫ョ逡ェ蜿キ), this.n蜀驛ィ逡ェ蜿キ)); + } + sb.Append( + $"{nameof(SongVol)}:{this.SongVol}, {nameof(LoudnessMetadata.Integrated)}:{this.SongLoudnessMetadata?.Integrated}, {nameof(LoudnessMetadata.TruePeak)}:{this.SongLoudnessMetadata?.TruePeak}, 菴咲スョ:{this.n菴咲スョ}, 繧オ繧、繧コ:{this.n繝√ャ繝励し繧、繧コ}, BGM:{(this.bBGM縺ィ縺励※菴ソ縺 ? 'Y' : 'N')}, File:{this.str繝輔ぃ繧、繝ォ蜷閤, Comment:{this.str繧ウ繝。繝ウ繝域枚}"); + + return sb.ToString(); + } + + #region [ Dispose-Finalize 繝代ち繝シ繝ウ螳溯」 ] + //----------------- + public void Dispose() + { + this.Dispose(true); + GC.SuppressFinalize(this); + } + public void Dispose(bool bManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ繧り。後≧) + { + if (this.bDisposed貂医∩) + return; + + if (bManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ繧り。後≧) + { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPoliphonicSounds; i++) // 4 + { + if (this.rSound[i] != null) + TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r遐エ譽縺吶k(this.rSound[i]); + this.rSound[i] = null; + + if ((i == 0) && TJAPlayer3.ConfigIni.bLog菴懈占ァ」謾セ繝ュ繧ー蜃コ蜉) + Trace.TraceInformation("繧オ繧ヲ繝ウ繝峨r隗」謾セ縺励∪縺励◆縲({0})({1})", this.str繧ウ繝。繝ウ繝域枚, this.str繝輔ぃ繧、繝ォ蜷); + } + } + + this.bDisposed貂医∩ = true; + } + ~CWAV() + { + this.Dispose(false); + } + //----------------- + #endregion + + #region [ private ] + //----------------- + private bool bDisposed貂医∩; + //----------------- + #endregion + } + + public class DanSongs + { + public CTexture TitleTex; + public CTexture SubTitleTex; + public string Title; + public string SubTitle; + public string FileName; + public string Genre; + public int ScoreInit; + public int ScoreDiff; + public int Level; + public int Difficulty; + public static int Number = 0; + public bool bTitleShow; + public Dan_C[] Dan_C = new Dan_C[4]; + public CWAV Wave; + + public DanSongs() + { + Number++; + } + } + + public struct STLYRIC + { + public long Time; + public Bitmap TextTex; + public string Text; + public int index; + } + + + // 讒矩菴 + + public struct STLANEINT + { + public int HH; + public int SD; + public int BD; + public int HT; + public int LT; + public int CY; + public int FT; + public int HHO; + public int RD; + public int LC; + public int LP; + public int LBD; + + public int Drums + { + get + { + return this.HH + this.SD + this.BD + this.HT + this.LT + this.CY + this.FT + this.HHO + this.RD + this.LC + this.LP + this.LBD; + } + } + public int Guitar; + public int Bass; + public int Taiko_Red; + public int Taiko_Blue; + + public int this[int index] + { + get + { + switch (index) + { + case 0: + return this.HH; + + case 1: + return this.SD; + + case 2: + return this.BD; + + case 3: + return this.HT; + + case 4: + return this.LT; + + case 5: + return this.CY; + + case 6: + return this.FT; + + case 7: + return this.HHO; + + case 8: + return this.RD; + + case 9: + return this.LC; + + case 10: + return this.LP; + + case 11: + return this.LBD; + + case 12: + return this.Guitar; + + case 13: + return this.Bass; + + case 14: + return this.Taiko_Red; + + case 15: + return this.Taiko_Blue; + } + throw new IndexOutOfRangeException(); + } + set + { + if (value < 0) + { + throw new ArgumentOutOfRangeException(); + } + switch (index) + { + case 0: + this.HH = value; + return; + + case 1: + this.SD = value; + return; + + case 2: + this.BD = value; + return; + + case 3: + this.HT = value; + return; + + case 4: + this.LT = value; + return; + + case 5: + this.CY = value; + return; + + case 6: + this.FT = value; + return; + + case 7: + this.HHO = value; + return; + + case 8: + this.RD = value; + return; + + case 9: + this.LC = value; + return; + + case 10: + this.LP = value; + return; + + case 11: + this.LBD = value; + return; + + case 12: + this.Guitar = value; + return; + + case 13: + this.Bass = value; + return; + + case 14: + this.Taiko_Red = value; + return; + + case 15: + this.Taiko_Blue = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + public struct STRESULT + { + public string SS; + public string S; + public string A; + public string B; + public string C; + public string D; + public string E; + + public string this[int index] + { + get + { + switch (index) + { + case 0: + return this.SS; + + case 1: + return this.S; + + case 2: + return this.A; + + case 3: + return this.B; + + case 4: + return this.C; + + case 5: + return this.D; + + case 6: + return this.E; + } + throw new IndexOutOfRangeException(); + } + set + { + switch (index) + { + case 0: + this.SS = value; + return; + + case 1: + this.S = value; + return; + + case 2: + this.A = value; + return; + + case 3: + this.B = value; + return; + + case 4: + this.C = value; + return; + + case 5: + this.D = value; + return; + + case 6: + this.E = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + public struct ST繝√ャ繝励′縺ゅk + { + public bool Drums; + public bool Guitar; + public bool Bass; + + public bool HHOpen; + public bool Ride; + public bool LeftCymbal; + public bool OpenGuitar; + public bool OpenBass; + + public bool Branch; + + public bool this[int index] + { + get + { + switch (index) + { + case 0: + return this.Drums; + + case 1: + return this.Guitar; + + case 2: + return this.Bass; + + case 3: + return this.HHOpen; + + case 4: + return this.Ride; + + case 5: + return this.LeftCymbal; + + case 6: + return this.OpenGuitar; + + case 7: + return this.OpenBass; + + case 8: + return this.Branch; + } + throw new IndexOutOfRangeException(); + } + set + { + switch (index) + { + case 0: + this.Drums = value; + return; + + case 1: + this.Guitar = value; + return; + + case 2: + this.Bass = value; + return; + + case 3: + this.HHOpen = value; + return; + + case 4: + this.Ride = value; + return; + + case 5: + this.LeftCymbal = value; + return; + + case 6: + this.OpenGuitar = value; + return; + + case 7: + this.OpenBass = value; + return; + + case 8: + this.Branch = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + public enum ECourse + { + eNormal, + eExpert, + eMaster + } + public class CLine + { + public int n蟆冗ッ逡ェ蜿キ; + public int n譁蟄玲焚; + public double db逋コ螢ー譎ょ綾; + public double dbBMS譎ょ綾; + public ECourse n繧ウ繝シ繧ケ = ECourse.eNormal; + public int n繧ソ繧、繝; + } + + // 繝励Ο繝代ユ繧」 + + + public class CBranchStartInfo + { + public int nMeasureCount; + public double dbTime; + public double dbBPM; + public double dbSCROLL; + public double dbSCROLLY; + public double dbBMScollTime; + public double db遘サ蜍募セ讖滓凾蛻サ; + public double db蜃コ迴セ譎ょ綾; + public double db蜀咲函騾溷コヲ; + public float fMeasure_s; + public float fMeasure_m; + } + + /// + /// 蛻蟯宣幕蟋区凾縺ョ諠蝣ア繧定ィ倬鹸縺吶k縺溘a縺ョ縺ゅl 2020.04.21 + /// + public CBranchStartInfo cBranchStart = new CBranchStartInfo(); + + public int nBGMAdjust + { + get; + private set; + } + public bool b蛻蟯舌r荳蝗槭〒繧る幕蟋九@縺 = false; //2020.04.22 akasoko26 蛻蟯占ュ憺擇縺ョ縺ソ蛟、繧剃サ」蜈・縺吶k繧医≧縺ォ縲 + + public int nPlayerSide; //2017.08.14 kairera0467 蠑墓焚縺ァ謖螳壹☆繧 + public bool bSession隴憺擇繧定ェュ縺ソ霎シ繧; + public string ARTIST; + public string BACKGROUND; + public string BACKGROUND_GR; + public double BASEBPM; + public double BPM; + public ST繝√ャ繝励′縺ゅk b繝√ャ繝励′縺ゅk; + public string COMMENT; + public double db蜀咲函騾溷コヲ; + public string GENRE; + public E繧ク繝」繝ウ繝ォ e繧ク繝」繝ウ繝ォ; + public bool HIDDENLEVEL; + public STDGBVALUE LEVEL; + public bool bLyrics; + public int[] LEVELtaiko = new int[(int)Difficulty.Total] { -1, -1, -1, -1, -1, -1, -1 }; + public Dictionary listAVI; + public Dictionary listAVIPAN; + public Dictionary listDS; + public Dictionary listBPM; + public List listChip; + public List[] listChip_Branch; + public Dictionary listWAV; + public Dictionary listSCROLL; + public Dictionary listSCROLL_Normal; + public Dictionary listSCROLL_Expert; + public Dictionary listSCROLL_Master; + public Dictionary listJPOSSCROLL; + public List List_DanSongs; + + + private double[] dbNowSCROLL_Normal; + private double[] dbNowSCROLL_Expert; + private double[] dbNowSCROLL_Master; + + + public Dictionary listDELAY; + public Dictionary listBRANCH; + public STLANEINT n蜿ッ隕悶メ繝繝玲焚; + public const int n譛螟ァ髻ウ謨ー = 4; + public const int n蟆冗ッ縺ョ隗」蜒丞コヲ = 384; + public string PANEL; + public string PATH_WAV; + public string PREIMAGE; + public string PREVIEW; + public string str繝上ャ繧キ繝・ofDTX繝輔ぃ繧、繝ォ; + public string str繝輔ぃ繧、繝ォ蜷; + public string str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ; + public string str繝輔か繝ォ繝蜷; + public string SUBTITLE; + public string TITLE; + public double dbDTXVPlaySpeed; + public double dbScrollSpeed; + public int n繝繝「BGM繧ェ繝輔そ繝繝; + + private int n迴セ蝨ィ縺ョ蟆冗ッ謨ー = 1; + + private int nNowRoll = 0; + private int nNowRollCount = 0; + + private int[] n騾」謇薙メ繝繝誉temp = new int[3]; + public int nOFFSET = 0; + private bool bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk = false; + private int nMOVIEOFFSET = 0; + private bool bMOVIEOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk = false; + private double dbNowBPM = 120.0; + private int nDELAY = 0; + public bool[] bHasBranch = new bool[(int)Difficulty.Total] { false, false, false, false, false, false, false }; + + //蛻蟯宣未騾」 + private ECourse n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = ECourse.eNormal; + + private bool b譛蛻昴ョ蛻蟯舌〒縺ゅk; + public int[] n繝弱シ繝謨ー = new int[4]; //3:蜈ア騾 + public int[] nDan_NotesCount = new int[1]; + public int[] n繝弱シ繝謨ー_Branch = new int[4]; // + public CChip[] pDan_LastChip; + public int[] n鬚ィ闊ケ謨ー = new int[4]; //0ス2:蜷繧ウ繝シ繧ケ 3:蜈ア騾 + + private List listLine; + private int nLineCountTemp; //蛻蟯宣幕蟋区凾縺ョ蟆冗ッ謨ー繧定ィ倬鹸縲 + private ECourse nLineCountCourseTemp = ECourse.eNormal; //迴セ蝨ィ繧ォ繧ヲ繝ウ繝井クュ縺ョ繧ウ繝シ繧ケ繧定ィ倬鹸縲 + + public int n蜿らァ荳ュ縺ョ髮」譏灘コヲ = 3; + public int nScoreModeTmp = 99; //2017.01.28 DD + public int[,] nScoreInit = new int[2, (int)Difficulty.Total]; //[ x, y ] x=騾壼ククor逵滓遠 y=繧ウ繝シ繧ケ + public int[] nScoreDiff = new int[(int)Difficulty.Total]; //[y] + public bool[,] b驟咲せ縺梧欠螳壹&繧後※縺繧 = new bool[3, (int)Difficulty.Total]; //2017.06.04 kairera0467 [ x, y ] x=騾壼クク(Init)or逵滓遠orDiff y=繧ウ繝シ繧ケ + + private double dbBarLength; + public float fNow_Measure_s = 4.0f; + public float fNow_Measure_m = 4.0f; + public double dbNowTime = 0.0; + public double dbNowBMScollTime = 0.0; + public double dbNowScroll = 1.0; + public double dbNowScrollY = 0.0; //2016.08.13 kairera0467 隍邏謨ー繧ケ繧ッ繝ュ繝シ繝ォ + public double dbLastTime = 0.0; //逶エ蜑阪ョ蟆冗ッ縺ョ髢句ァ区凾髢 + public double dbLastBMScrollTime = 0.0; + + public int[] bBARLINECUE = new int[2]; //蜻ス莉、繧貞・繧後◆谺。縺ョ蟆冗ッ縺ョ謫堺ス懊r螳溽樟縺吶k縺溘a縺ョ繝輔Λ繧ー縲0 = mainflag, 1 = cuetype + public bool b蟆冗ッ邱壹r謖ソ蜈・縺励※縺繧 = false; + + //Normal Regular Master縺ォ縺励◆縺縺代←縺薙%縺ッ謌第「縲 + private List listBalloon_Normal; + private List listBalloon_Expert; + private List listBalloon_Master; + private List listBalloon; //譌ァ讒区枚逕ィ + + public List listLyric; //豁瑚ゥ槭r譬シ邏阪@縺ヲ縺縺上Μ繧ケ繝医ゅせ繝壹Ν蠢倥l縺(縺峨> + public List listLyric2; + + private int listBalloon_Normal_謨ー蛟、邂。逅; + private int listBalloon_Expert_謨ー蛟、邂。逅; + private int listBalloon_Master_謨ー蛟、邂。逅; + + public bool[] b隴憺擇縺悟ュ伜惠縺吶k = new bool[(int)Difficulty.Total]; + + private string[] dlmtSpace = { " " }; + private string[] dlmtEnter = { "\n" }; + private string[] dlmtCOURSE = { "COURSE:" }; + + private int n繧ケ繧ッ繝ュ繝シ繝ォ譁ケ蜷 = 0; + //2015.09.18 kairera0467 + //繝舌ち繝輔Λ繧、繧ケ繝ゥ繧、繝峨∩縺溘>縺ェ繧「繝ャ繧偵d繧翫◆縺縺後◆繧√↓螳溯」縲 + //谺。驛2縺ソ縺溘>縺ェ隍邏謨ー縺ィ縺九ッ諢丞袖荳肴弱↑縺ョ縺ァ縲∵婿蜷代r謖螳壹@縺ヲ繧ケ繧ッ繝ュ繝シ繝ォ縺輔○繧九%縺ィ縺ォ縺励◆縲 + //0:騾壼クク + //1:荳 + //2:荳 + //3:蜿ウ荳 + //4:蜿ウ荳 + //5:蟾ヲ + //6:蟾ヲ荳 + //7:蟾ヲ荳 + + public string strBGIMAGE_PATH; + public string strBGVIDEO_PATH; + + public double db蜃コ迴セ譎ょ綾; + public double db遘サ蜍募セ讖滓凾蛻サ; + + public string strBGM_PATH; + public int SongVol; + public LoudnessMetadata? SongLoudnessMetadata; + + public bool bHIDDENBRANCH; //2016.04.01 kairera0467 驕ク譖イ逕サ髱「荳翫∬ュ憺擇蛻蟯宣幕蟋句燕縺セ縺ァ隴憺擇蛻蟯舌ョ陦ィ遉コ繧帝國縺 + public bool bGOGOTIME; //2018.03.11 kairera0467 + + public bool[] IsBranchBarDraw = new bool[4]; // 莉墓ァ伜、画峩縺ォ繧医j縲鮟濶イline縺ョ陦ィ遉コ豕輔r螟画峩.2020.04.21.akasoko26 + public bool IsEndedBranching; // BRANCHEND縺悟他縺ウ蜃コ縺輔l縺溘°縺ゥ縺縺 + public Dan_C[] Dan_C; + + public bool IsEnabledFixSENote; + public int FixSENote; + public GaugeIncreaseMode GaugeIncreaseMode; + + + +#if TEST_NOTEOFFMODE + public STLANEVALUE b貍泌・上〒逶エ蜑阪ョ髻ウ繧呈カ磯浹縺吶k; +// public bool bHH貍泌・上〒逶エ蜑阪ョHH繧呈カ磯浹縺吶k; +// public bool bGUITAR貍泌・上〒逶エ蜑阪ョGUITAR繧呈カ磯浹縺吶k; +// public bool bBASS貍泌・上〒逶エ蜑阪ョBASS繧呈カ磯浹縺吶k; +#endif + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CDTX() + { + this.nPlayerSide = 0; + this.TITLE = ""; + this.SUBTITLE = ""; + this.ARTIST = ""; + this.COMMENT = ""; + this.PANEL = ""; + this.GENRE = ""; + this.bLyrics = false; + this.e繧ク繝」繝ウ繝ォ = E繧ク繝」繝ウ繝ォ.None; + this.PREVIEW = ""; + this.PREIMAGE = ""; + this.BACKGROUND = ""; + this.BACKGROUND_GR = ""; + this.PATH_WAV = ""; + this.BPM = 120.0; + STDGBVALUE stdgbvalue = new STDGBVALUE(); + stdgbvalue.Drums = 0; + stdgbvalue.Guitar = 0; + stdgbvalue.Bass = 0; + this.LEVEL = stdgbvalue; + this.bHIDDENBRANCH = false; + this.db蜀咲函騾溷コヲ = 1.0; + this.b繝√ャ繝励′縺ゅk = new ST繝√ャ繝励′縺ゅk(); + this.b繝√ャ繝励′縺ゅk.Drums = false; + this.b繝√ャ繝励′縺ゅk.Guitar = false; + this.b繝√ャ繝励′縺ゅk.Bass = false; + this.b繝√ャ繝励′縺ゅk.HHOpen = false; + this.b繝√ャ繝励′縺ゅk.Ride = false; + this.b繝√ャ繝励′縺ゅk.LeftCymbal = false; + this.b繝√ャ繝励′縺ゅk.OpenGuitar = false; + this.b繝√ャ繝励′縺ゅk.OpenBass = false; + this.str繝輔ぃ繧、繝ォ蜷 = ""; + this.str繝輔か繝ォ繝蜷 = ""; + this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ = ""; + this.n辟。髯千ョ。逅WAV = new int[36 * 36]; + this.n辟。髯千ョ。逅BPM = new int[36 * 36]; + this.n辟。髯千ョ。逅PAN = new int[36 * 36]; + this.n辟。髯千ョ。逅SIZE = new int[36 * 36]; + this.listBalloon_Normal_謨ー蛟、邂。逅 = 0; + this.listBalloon_Expert_謨ー蛟、邂。逅 = 0; + this.listBalloon_Master_謨ー蛟、邂。逅 = 0; + this.nRESULTIMAGE逕ィ蜆ェ蜈磯菴 = new int[7]; + this.nRESULTMOVIE逕ィ蜆ェ蜈磯菴 = new int[7]; + this.nRESULTSOUND逕ィ蜆ェ蜈磯菴 = new int[7]; + + #region [ 2011.1.1 yyagi GDA->DTX螟画鋤繝繝シ繝悶Ν 繝ェ繝輔ぃ繧ッ繧ソ蠕 ] + STGDAPARAM[] stgdaparamArray = new STGDAPARAM[] { // GDA->DTX conversion table + new STGDAPARAM("TC", 0x03), new STGDAPARAM("BL", 0x02), new STGDAPARAM("GS", 0x29), + new STGDAPARAM("DS", 0x30), new STGDAPARAM("FI", 0x53), new STGDAPARAM("HH", 0x11), + new STGDAPARAM("SD", 0x12), new STGDAPARAM("BD", 0x13), new STGDAPARAM("HT", 0x14), + new STGDAPARAM("LT", 0x15), new STGDAPARAM("CY", 0x16), new STGDAPARAM("G1", 0x21), + new STGDAPARAM("G2", 0x22), new STGDAPARAM("G3", 0x23), new STGDAPARAM("G4", 0x24), + new STGDAPARAM("G5", 0x25), new STGDAPARAM("G6", 0x26), new STGDAPARAM("G7", 0x27), + new STGDAPARAM("GW", 0x28), new STGDAPARAM("01", 0x61), new STGDAPARAM("02", 0x62), + new STGDAPARAM("03", 0x63), new STGDAPARAM("04", 0x64), new STGDAPARAM("05", 0x65), + new STGDAPARAM("06", 0x66), new STGDAPARAM("07", 0x67), new STGDAPARAM("08", 0x68), + new STGDAPARAM("09", 0x69), new STGDAPARAM("0A", 0x70), new STGDAPARAM("0B", 0x71), + new STGDAPARAM("0C", 0x72), new STGDAPARAM("0D", 0x73), new STGDAPARAM("0E", 0x74), + new STGDAPARAM("0F", 0x75), new STGDAPARAM("10", 0x76), new STGDAPARAM("11", 0x77), + new STGDAPARAM("12", 0x78), new STGDAPARAM("13", 0x79), new STGDAPARAM("14", 0x80), + new STGDAPARAM("15", 0x81), new STGDAPARAM("16", 0x82), new STGDAPARAM("17", 0x83), + new STGDAPARAM("18", 0x84), new STGDAPARAM("19", 0x85), new STGDAPARAM("1A", 0x86), + new STGDAPARAM("1B", 0x87), new STGDAPARAM("1C", 0x88), new STGDAPARAM("1D", 0x89), + new STGDAPARAM("1E", 0x90), new STGDAPARAM("1F", 0x91), new STGDAPARAM("20", 0x92), + new STGDAPARAM("B1", 0xA1), new STGDAPARAM("B2", 0xA2), new STGDAPARAM("B3", 0xA3), + new STGDAPARAM("B4", 0xA4), new STGDAPARAM("B5", 0xA5), new STGDAPARAM("B6", 0xA6), + new STGDAPARAM("B7", 0xA7), new STGDAPARAM("BW", 0xA8), new STGDAPARAM("G0", 0x20), + new STGDAPARAM("B0", 0xA0) + }; + this.stGDAParam = stgdaparamArray; + #endregion + this.nBGMAdjust = 0; + this.nPolyphonicSounds = TJAPlayer3.ConfigIni.nPoliphonicSounds; + this.dbDTXVPlaySpeed = 1.0f; + + //this.nScoreModeTmp = 1; + for (int y = 0; y < (int)Difficulty.Total; y++) + { + this.nScoreInit[0, y] = 300; + this.nScoreInit[1, y] = 1000; + this.nScoreDiff[y] = 120; + this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬0, y] = false; + this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬1, y] = false; + this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬2, y] = false; + } + + this.dbBarLength = 1.0; + + this.b譛蛻昴ョ蛻蟯舌〒縺ゅk = true; + + this.SongVol = CSound.DefaultSongVol; + this.SongLoudnessMetadata = null; + + GaugeIncreaseMode = GaugeIncreaseMode.Normal; + +#if TEST_NOTEOFFMODE + this.bHH貍泌・上〒逶エ蜑阪ョHH繧呈カ磯浹縺吶k = true; + this.bGUITAR貍泌・上〒逶エ蜑阪ョGUITAR繧呈カ磯浹縺吶k = true; + this.bBASS貍泌・上〒逶エ蜑阪ョBASS繧呈カ磯浹縺吶k = true; +#endif + + Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; // Change default culture to invariant, fixes (Purota) + Dan_C = new Dan_C[4]; + pDan_LastChip = new CChip[1]; + DanSongs.Number = 0; + } + public CDTX(string str蜈ィ蜈・蜉帶枚蟄怜, int difficulty) + : this() + { + this.On豢サ諤ァ蛹(); + this.t蜈・蜉媽蜈ィ蜈・蜉帶枚蟄怜励°繧(str蜈ィ蜈・蜉帶枚蟄怜, difficulty); + } + public CDTX(string str繝輔ぃ繧、繝ォ蜷, bool b繝倥ャ繝縺ョ縺ソ, int difficulty) + : this() + { + this.On豢サ諤ァ蛹(); + this.t蜈・蜉(str繝輔ぃ繧、繝ォ蜷, b繝倥ャ繝縺ョ縺ソ, difficulty); + } + public CDTX(string str蜈ィ蜈・蜉帶枚蟄怜, double db蜀咲函騾溷コヲ, int nBGMAdjust, int difficulty) + : this() + { + this.On豢サ諤ァ蛹(); + this.t蜈・蜉媽蜈ィ蜈・蜉帶枚蟄怜励°繧(str蜈ィ蜈・蜉帶枚蟄怜, str蜈ィ蜈・蜉帶枚蟄怜, db蜀咲函騾溷コヲ, nBGMAdjust, difficulty); + } + public CDTX(string str繝輔ぃ繧、繝ォ蜷, bool b繝倥ャ繝縺ョ縺ソ, double db蜀咲函騾溷コヲ, int nBGMAdjust, int difficulty) + : this() + { + this.On豢サ諤ァ蛹(); + this.t蜈・蜉(str繝輔ぃ繧、繝ォ蜷, b繝倥ャ繝縺ョ縺ソ, db蜀咲函騾溷コヲ, nBGMAdjust, 0, 0, false, difficulty); + } + public CDTX(string str繝輔ぃ繧、繝ォ蜷, bool b繝倥ャ繝縺ョ縺ソ, double db蜀咲函騾溷コヲ, int nBGMAdjust, int nReadVersion, int difficulty) + : this() + { + this.On豢サ諤ァ蛹(); + this.t蜈・蜉(str繝輔ぃ繧、繝ォ蜷, b繝倥ャ繝縺ョ縺ソ, db蜀咲函騾溷コヲ, nBGMAdjust, nReadVersion, 0, false, difficulty); + } + public CDTX(string str繝輔ぃ繧、繝ォ蜷, bool b繝倥ャ繝縺ョ縺ソ, double db蜀咲函騾溷コヲ, int nBGMAdjust, int nReadVersion, int nPlayerSide, bool bSession, int difficulty) + : this() + { + this.On豢サ諤ァ蛹(); + this.t蜈・蜉(str繝輔ぃ繧、繝ォ蜷, b繝倥ャ繝縺ョ縺ソ, db蜀咲函騾溷コヲ, nBGMAdjust, nReadVersion, nPlayerSide, bSession, difficulty); + } + + + // 繝。繧ス繝繝 + + public void tAVI縺ョ隱ュ縺ソ霎シ縺ソ() + { + if (this.listAVI != null) + { + foreach (CAVI cavi in this.listAVI.Values) + { + cavi.OnDeviceCreated(); + } + } + if (this.listDS != null) + { + foreach (CDirectShow cds in this.listDS.Values) + { + cds.OnDeviceCreated(); + } + } + if (!this.b繝倥ャ繝縺ョ縺ソ)//&& this.b蜍慕判隱ュ縺ソ霎シ縺ソ ) + { + foreach (CChip chip in this.listChip) + { + if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x54 || chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x5A) + { + chip.eAVI遞ョ蛻・ = EAVI遞ョ蛻・.Unknown; + chip.rAVI = null; + chip.rDShow = null; + chip.rAVIPan = null; + if (this.listAVIPAN.TryGetValue(chip.n謨エ謨ー蛟、, out CAVIPAN cavipan)) + { + if (this.listAVI.TryGetValue(cavipan.nAVI逡ェ蜿キ, out CAVI cavi) && (cavi.avi != null)) + { + chip.eAVI遞ョ蛻・ = EAVI遞ョ蛻・.AVIPAN; + chip.rAVI = cavi; + //if( CDTXMania.ConfigIni.bDirectShowMode == true ) + chip.rDShow = this.listDS[cavipan.nAVI逡ェ蜿キ]; + chip.rAVIPan = cavipan; + continue; + } + } + + CDirectShow ds = null; + if (this.listAVI.TryGetValue(chip.n謨エ謨ー蛟、, out CAVI cavi2) && (cavi2.avi != null) || (this.listDS.TryGetValue(chip.n謨エ謨ー蛟、, out ds) && (ds.dshow != null))) + { + chip.eAVI遞ョ蛻・ = EAVI遞ョ蛻・.AVI; + chip.rAVI = cavi2; + //if(CDTXMania.ConfigIni.bDirectShowMode == true) + chip.rDShow = ds; + } + } + } + } + } + + public void tWave蜀咲函菴咲スョ閾ェ蜍戊」懈ュ」() + { + foreach (CWAV cwav in this.listWAV.Values) + { + this.tWave蜀咲函菴咲スョ閾ェ蜍戊」懈ュ」(cwav); + } + } + public void tWave蜀咲函菴咲スョ閾ェ蜍戊」懈ュ」(CWAV wc) + { + if (wc.rSound[0] != null && wc.rSound[0].n邱乗シ泌・乗凾髢杜s >= 5000) + { + for (int i = 0; i < nPolyphonicSounds; i++) + { + if ((wc.rSound[i] != null) && (wc.rSound[i].b蜀咲函荳ュ)) + { + long nCurrentTime = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms; + if (nCurrentTime > wc.n蜀咲函髢句ァ区凾蛻サ[i]) + { + long nAbsTimeFromStartPlaying = nCurrentTime - wc.n蜀咲函髢句ァ区凾蛻サ[i]; + //Trace.TraceInformation( "蜀咲函菴咲スョ閾ェ蜍戊」懈ュ」: {0}, seek蜈={1}ms, 蜈ィ髻ウ髟キ={2}ms", + // Path.GetFileName( wc.rSound[ 0 ].str繝輔ぃ繧、繝ォ蜷 ), + // nAbsTimeFromStartPlaying, + // wc.rSound[ 0 ].n邱乗シ泌・乗凾髢杜s + //); + // wc.rSound[ i ].t蜀咲函菴咲スョ繧貞、画峩縺吶k( wc.rSound[ i ].t譎ょ綾縺九i菴咲スョ繧定ソ斐☆( nAbsTimeFromStartPlaying ) ); + // WASAPI/ASIO逕ィ竊 + if (!TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bPAUSE) + { + if (wc.rSound[i].b荳譎ょ●豁「荳ュ) wc.rSound[i].t蜀咲函繧貞埼幕縺吶k(nAbsTimeFromStartPlaying); + else wc.rSound[i].t蜀咲函菴咲スョ繧貞、画峩縺吶k(nAbsTimeFromStartPlaying); + } + else + { + wc.rSound[i].t蜀咲函繧剃ク譎ょ●豁「縺吶k(); + } + } + } + } + } + } + public void tWav縺ョ蜀咲函蛛懈ュ「(int nWave縺ョ蜀驛ィ逡ェ蜿キ) + { + tWav縺ョ蜀咲函蛛懈ュ「(nWave縺ョ蜀驛ィ逡ェ蜿キ, false); + } + public void tWav縺ョ蜀咲函蛛懈ュ「(int nWave縺ョ蜀驛ィ逡ェ蜿キ, bool b繝溘く繧オ繝シ縺九i繧ょ炎髯、縺吶k) + { + if (this.listWAV.TryGetValue(nWave縺ョ蜀驛ィ逡ェ蜿キ, out CWAV cwav)) + { + for (int i = 0; i < nPolyphonicSounds; i++) + { + if (cwav.rSound[i] != null && cwav.rSound[i].b蜀咲函荳ュ) + { + if (b繝溘く繧オ繝シ縺九i繧ょ炎髯、縺吶k) + { + cwav.rSound[i].t繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺励※Mixer縺九i繧ょ炎髯、縺吶k(); + } + else + { + cwav.rSound[i].t蜀咲函繧貞●豁「縺吶k(); + } + } + } + } + } + public void tWAV縺ョ隱ュ縺ソ霎シ縺ソ(CWAV cwav) + { + string str = string.IsNullOrEmpty(this.PATH_WAV) ? this.str繝輔か繝ォ繝蜷 : this.PATH_WAV; + str = str + cwav.str繝輔ぃ繧、繝ォ蜷; + + try + { + #region [ 蜷梧凾逋コ髻ウ謨ー繧偵√メ繝」繝ウ繝阪Ν縺ォ繧医▲縺ヲ螟峨∴繧 ] + + int nPoly = nPolyphonicSounds; + if (TJAPlayer3.Sound邂。逅.GetCurrentSoundDeviceType() != "DirectSound") // DShow縺ァ縺ョ蜀咲函縺ョ蝣エ蜷医ッ繝溘く繧キ繝ウ繧ー雋闕キ縺碁ォ倥¥縺ェ縺縺溘a縲 + { + // 繝√ャ繝励ョ繝ゥ繧、繝輔ち繧、繝邂。逅繧定。後o縺ェ縺 + if (cwav.bIsBassSound) nPoly = (nPolyphonicSounds >= 2) ? 2 : 1; + else if (cwav.bIsGuitarSound) nPoly = (nPolyphonicSounds >= 2) ? 2 : 1; + else if (cwav.bIsSESound) nPoly = 1; + else if (cwav.bIsBGMSound) nPoly = 1; + } + + if (cwav.bIsBGMSound) nPoly = 1; + + #endregion + + for (int i = 0; i < nPoly; i++) + { + try + { + cwav.rSound[i] = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧(str, ESoundGroup.SongPlayback); + + if (!TJAPlayer3.ConfigIni.bDynamicBassMixerManagement) + { + cwav.rSound[i].tBASS繧オ繧ヲ繝ウ繝峨r繝溘く繧オ繝シ縺ォ霑ス蜉縺吶k(); + } + + if (TJAPlayer3.ConfigIni.bLog菴懈占ァ」謾セ繝ュ繧ー蜃コ蜉) + { + Trace.TraceInformation("繧オ繧ヲ繝ウ繝峨r菴懈舌@縺セ縺励◆縲({3})({0})({1})({2}bytes)", cwav.str繧ウ繝。繝ウ繝域枚, str, + cwav.rSound[0].n繧オ繧ヲ繝ウ繝峨ヰ繝繝輔ぃ繧オ繧、繧コ, cwav.rSound[0].b繧ケ繝医Μ繝シ繝蜀咲函縺吶k ? "Stream" : "OnMemory"); + } + } + catch (Exception e) + { + cwav.rSound[i] = null; + Trace.TraceError("繧オ繧ヲ繝ウ繝峨ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲({0})({1})", cwav.str繧ウ繝。繝ウ繝域枚, str); + Trace.TraceError(e.ToString()); + } + } + } + catch (Exception exception) + { + Trace.TraceError("繧オ繧ヲ繝ウ繝峨ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲({0})({1})", cwav.str繧ウ繝。繝ウ繝域枚, str); + Trace.TraceError(exception.ToString()); + + for (int j = 0; j < nPolyphonicSounds; j++) + { + cwav.rSound[j] = null; + } + + //continue; + } + } + + public static string tZZ(int n) + { + if (n < 0 || n >= 36 * 36) + return "!!"; // 繧ェ繝シ繝舌シシ上い繝ウ繝繝シ繝輔Ο繝シ縲 + + // n 繧36騾イ謨ー2譯√ョ譁蟄怜励↓縺励※霑斐☆縲 + + string str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + return new string(new char[] { str[n / 36], str[n % 36] }); + } + public void t繧ョ繧ソ繝シ縺ィ繝吶シ繧ケ縺ョ繝ゥ繝ウ繝繝蛹(E讌ス蝎ィ繝代シ繝 part, E繝ゥ繝ウ繝繝繝「繝シ繝 eRandom) + { + } + public void t螟ェ鮠薙メ繝繝励ョ繝ゥ繝ウ繝繝蛹(E繝ゥ繝ウ繝繝繝「繝シ繝 eRandom) + { + //2016.02.11 kairera0467 + //縺ェ繧薙□繧医%縺ョ繧ッ繧ス螳溯」縺ッ(諤) + Random rnd = new System.Random(); + + switch (eRandom) + { + case E繝ゥ繝ウ繝繝繝「繝シ繝.MIRROR: + foreach (var chip in this.listChip) + { + switch (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ) + { + case 0x11: + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x12; + break; + case 0x12: + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x11; + break; + case 0x13: + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x14; + chip.nSenote = 6; + break; + case 0x14: + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x13; + chip.nSenote = 5; + break; + } + } + break; + case E繝ゥ繝ウ繝繝繝「繝シ繝.RANDOM: + foreach (var chip in this.listChip) + { + int n = rnd.Next(50); + + if (n >= 5 && n <= 10) + { + switch (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ) + { + case 0x11: + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x12; + break; + case 0x12: + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x11; + break; + case 0x13: + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x14; + chip.nSenote = 6; + break; + case 0x14: + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x13; + chip.nSenote = 5; + break; + } + } + } + break; + case E繝ゥ繝ウ繝繝繝「繝シ繝.SUPERRANDOM: + foreach (var chip in this.listChip) + { + int n = rnd.Next(80); + + if (n >= 3 && n <= 43) + { + switch (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ) + { + case 0x11: + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x12; + break; + case 0x12: + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x11; + break; + case 0x13: + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x14; + chip.nSenote = 6; + break; + case 0x14: + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x13; + chip.nSenote = 5; + break; + } + } + } + break; + case E繝ゥ繝ウ繝繝繝「繝シ繝.HYPERRANDOM: + foreach (var chip in this.listChip) + { + int n = rnd.Next(100); + + if (n >= 20 && n <= 80) + { + switch (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ) + { + case 0x11: + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x12; + break; + case 0x12: + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x11; + break; + case 0x13: + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x14; + chip.nSenote = 6; + break; + case 0x14: + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x13; + chip.nSenote = 5; + break; + } + } + } + break; + case E繝ゥ繝ウ繝繝繝「繝シ繝.OFF: + default: + break; + } + if (eRandom != E繝ゥ繝ウ繝繝繝「繝シ繝.OFF) + { + #region[ list菴懈 ] + //縺イ縺ィ縺セ縺壹メ繝繝励□縺代ョ繝ェ繧ケ繝医r菴懈舌@縺ヲ縺翫¥縲 + List list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝; + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝 = new List(); + int nCount = 0; + int dkdkCount = 0; + + foreach (CChip chip in this.listChip) + { + if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x11 && chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 0x18) + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Add(chip); + } + } + #endregion + + this.tSenotes_Core_V2(list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝); + + } + + + } + + #region [ 繝√ャ繝励ョ蜀咲函縺ィ蛛懈ュ「 ] + public void t繝√ャ繝励ョ蜀咲函(CChip pChip, long n蜀咲函髢句ァ九す繧ケ繝繝譎ょ綾ms) + { + if (TJAPlayer3.ConfigIni.b貍泌・城溷コヲ縺御ク蛟埼溘〒縺ゅk縺ィ縺堺サ・螟夜浹螢ー繧貞咲函縺励↑縺 && TJAPlayer3.ConfigIni.n貍泌・城溷コヲ != 20) + return; + + if (pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ >= 0) + { + if (this.listWAV.TryGetValue(pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, out CWAV wc)) + { + int index = wc.n迴セ蝨ィ蜀咲函荳ュ縺ョ繧オ繧ヲ繝ウ繝臥分蜿キ = (wc.n迴セ蝨ィ蜀咲函荳ュ縺ョ繧オ繧ヲ繝ウ繝臥分蜿キ + 1) % nPolyphonicSounds; + if ((wc.rSound[0] != null) && + (wc.rSound[0].b繧ケ繝医Μ繝シ繝蜀咲函縺吶k || wc.rSound[index] == null)) + { + index = wc.n迴セ蝨ィ蜀咲函荳ュ縺ョ繧オ繧ヲ繝ウ繝臥分蜿キ = 0; + } + CSound sound = wc.rSound[index]; + if (sound != null) + { + sound.db蜀咲函騾溷コヲ = ((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0; + // 蜀咲函騾溷コヲ縺ォ繧医▲縺ヲ縲仝ASAPI/ASIO縺ァ菴ソ縺菴ソ逕ィmixer縺梧アコ縺セ繧九◆繧√∽サ倬囂諠蝣ア縺ョ險ュ螳(髻ウ驥/PAN)縺ッ縲∝咲函騾溷コヲ縺ョ險ュ螳壼セ後↓陦後≧ + + // 2018-08-27 twopointzero - DON'T attempt to load (or queue scanning) loudness metadata here. + // This code is called right after loading the .tja, and that code + // will have just made such an attempt. + TJAPlayer3.SongGainController.Set(wc.SongVol, wc.SongLoudnessMetadata, sound); + + sound.n菴咲スョ = wc.n菴咲スョ; + sound.t蜀咲函繧帝幕蟋九☆繧(); + } + wc.n蜀咲函髢句ァ区凾蛻サ[wc.n迴セ蝨ィ蜀咲函荳ュ縺ョ繧オ繧ヲ繝ウ繝臥分蜿キ] = n蜀咲函髢句ァ九す繧ケ繝繝譎ょ綾ms; + this.tWave蜀咲函菴咲スョ閾ェ蜍戊」懈ュ」(wc); + } + } + } + public void t蜷閾ェ蜍募咲函髻ウ繝√ャ繝励ョ蜀咲函譎ょ綾繧貞、画峩縺吶k(int nBGMAdjust縺ョ蠅玲ク帛、) + { + this.nBGMAdjust += nBGMAdjust縺ョ蠅玲ク帛、; + for (int i = 0; i < this.listChip.Count; i++) + { + int nChannelNumber = this.listChip[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ; + if ((( + (nChannelNumber == 1) || + ((0x61 <= nChannelNumber) && (nChannelNumber <= 0x69)) + ) || + ((0x70 <= nChannelNumber) && (nChannelNumber <= 0x79)) + ) || + (((0x80 <= nChannelNumber) && (nChannelNumber <= 0x89)) || ((0x90 <= nChannelNumber) && (nChannelNumber <= 0x92))) + ) + { + this.listChip[i].n逋コ螢ー譎ょ綾ms += nBGMAdjust縺ョ蠅玲ク帛、; + } + } + foreach (CWAV cwav in this.listWAV.Values) + { + for (int j = 0; j < nPolyphonicSounds; j++) + { + if ((cwav.rSound[j] != null) && cwav.rSound[j].b蜀咲函荳ュ) + { + cwav.n蜀咲函髢句ァ区凾蛻サ[j] += nBGMAdjust縺ョ蠅玲ク帛、; + } + } + } + } + public void t蜈ィ繝√ャ繝励ョ蜀咲函荳譎ょ●豁「() + { + foreach (CWAV cwav in this.listWAV.Values) + { + for (int i = 0; i < nPolyphonicSounds; i++) + { + if ((cwav.rSound[i] != null) && cwav.rSound[i].b蜀咲函荳ュ) + { + cwav.rSound[i].t蜀咲函繧剃ク譎ょ●豁「縺吶k(); + cwav.n荳譎ょ●豁「譎ょ綾[i] = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms; + } + } + } + } + public void t蜈ィ繝√ャ繝励ョ蜀咲函蜀埼幕() + { + foreach (CWAV cwav in this.listWAV.Values) + { + for (int i = 0; i < nPolyphonicSounds; i++) + { + if ((cwav.rSound[i] != null) && cwav.rSound[i].b荳譎ょ●豁「荳ュ) + { + //long num1 = cwav.n荳譎ょ●豁「譎ょ綾[ i ]; + //long num2 = cwav.n蜀咲函髢句ァ区凾蛻サ[ i ]; + cwav.rSound[i].t蜀咲函繧貞埼幕縺吶k(cwav.n荳譎ょ●豁「譎ょ綾[i] - cwav.n蜀咲函髢句ァ区凾蛻サ[i]); + cwav.n蜀咲函髢句ァ区凾蛻サ[i] += CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms - cwav.n荳譎ょ●豁「譎ょ綾[i]; + } + } + } + } + public void t蜈ィ繝√ャ繝励ョ蜀咲函蛛懈ュ「() + { + foreach (CWAV cwav in this.listWAV.Values) + { + this.tWav縺ョ蜀咲函蛛懈ュ「(cwav.n蜀驛ィ逡ェ蜿キ); + } + } + public void t蜈ィ繝√ャ繝励ョ蜀咲函蛛懈ュ「縺ィ繝溘く繧オ繝シ縺九i縺ョ蜑企勁() + { + foreach (CWAV cwav in this.listWAV.Values) + { + this.tWav縺ョ蜀咲函蛛懈ュ「(cwav.n蜀驛ィ逡ェ蜿キ, true); + } + } + #endregion + + public void t蜈・蜉(string str繝輔ぃ繧、繝ォ蜷, bool b繝倥ャ繝縺ョ縺ソ, int difficulty) + { + this.t蜈・蜉(str繝輔ぃ繧、繝ォ蜷, b繝倥ャ繝縺ョ縺ソ, 1.0, 0, 0, 0, false, difficulty); + } + public void t蜈・蜉(string str繝輔ぃ繧、繝ォ蜷, bool b繝倥ャ繝縺ョ縺ソ, double db蜀咲函騾溷コヲ, int nBGMAdjust, int nReadVersion, int nPlayerSide, bool bSession, int difficulty) + { + this.b繝倥ャ繝縺ョ縺ソ = b繝倥ャ繝縺ョ縺ソ; + this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ = Path.GetFullPath(str繝輔ぃ繧、繝ォ蜷); + this.str繝輔ぃ繧、繝ォ蜷 = Path.GetFileName(this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ); + this.str繝輔か繝ォ繝蜷 = Path.GetDirectoryName(this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ) + @"\"; + //if ( this.e遞ョ蛻・ != E遞ョ蛻・.SMF ) + { + try + { + this.nPlayerSide = nPlayerSide; + this.bSession隴憺擇繧定ェュ縺ソ霎シ繧 = bSession; + if (nReadVersion != 0) + { + //DTX譁ケ蠑 + + //DateTime timeBeginLoad = DateTime.Now; + //TimeSpan span; + string[] files = Directory.GetFiles(this.str繝輔か繝ォ繝蜷, "*.tja"); + + StreamReader reader = new StreamReader(str繝輔ぃ繧、繝ォ蜷, Encoding.GetEncoding("Shift_JIS")); + string str2 = reader.ReadToEnd(); + reader.Close(); + + //StreamReader reader2 = new StreamReader( this.str繝輔か繝ォ繝蜷 + "test.tja", Encoding.GetEncoding( "Shift_JIS" ) ); + StreamReader reader2 = new StreamReader(files[0], Encoding.GetEncoding("Shift_JIS")); + string str3 = reader2.ReadToEnd(); + reader2.Close(); + + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "DTXfileload譎る俣: {0}", span.ToString() ); + + this.t蜈・蜉媽蜈ィ蜈・蜉帶枚蟄怜励°繧(str2, str3, db蜀咲函騾溷コヲ, nBGMAdjust, difficulty); + } + else + { + //谺。驛取婿蠑 + + //DateTime timeBeginLoad = DateTime.Now; + //TimeSpan span; + + StreamReader reader = new StreamReader(str繝輔ぃ繧、繝ォ蜷, Encoding.GetEncoding("Shift_JIS")); + string str2 = reader.ReadToEnd(); + reader.Close(); + + //StreamReader reader2 = new StreamReader( this.str繝輔か繝ォ繝蜷 + "test.tja", Encoding.GetEncoding( "Shift_JIS" ) ); + //StreamReader reader2 = new StreamReader( str繝輔ぃ繧、繝ォ蜷, Encoding.GetEncoding( "Shift_JIS" ) ); + //string str3 = reader2.ReadToEnd(); + //reader2.Close(); + string str3 = str2; + + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "DTXfileload譎る俣: {0}", span.ToString() ); + + this.t蜈・蜉媽蜈ィ蜈・蜉帶枚蟄怜励°繧(str2, str3, db蜀咲函騾溷コヲ, nBGMAdjust, difficulty); + } + } + catch (Exception ex) + { + //MessageBox.Show( "縺翫d?繧ィ繝ゥ繝シ縺悟コ縺溘h縺縺ァ縺吶ゅ♀蜈讒倥" ); + Trace.TraceError("縺翫d?繧ィ繝ゥ繝シ縺悟コ縺溘h縺縺ァ縺吶ゅ♀蜈讒倥"); + Trace.TraceError(ex.ToString()); + Trace.TraceError("萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (79ff8639-9b3c-477f-bc4a-f2eea9784860)"); + } + } + } + public void t蜈・蜉媽蜈ィ蜈・蜉帶枚蟄怜励°繧(string str蜈ィ蜈・蜉帶枚蟄怜, int difficulty) + { + this.t蜈・蜉媽蜈ィ蜈・蜉帶枚蟄怜励°繧(str蜈ィ蜈・蜉帶枚蟄怜, str蜈ィ蜈・蜉帶枚蟄怜, 1.0, 0, difficulty); + } + public void t蜈・蜉媽蜈ィ蜈・蜉帶枚蟄怜励°繧(string str蜈ィ蜈・蜉帶枚蟄怜, string str1, double db蜀咲函騾溷コヲ, int nBGMAdjust, int Difficulty) + { + //DateTime timeBeginLoad = DateTime.Now; + //TimeSpan span; + + if (!string.IsNullOrEmpty(str蜈ィ蜈・蜉帶枚蟄怜)) + { + #region [ 謾ケ陦後き繝繝 ] + this.db蜀咲函騾溷コヲ = db蜀咲函騾溷コヲ; + str蜈ィ蜈・蜉帶枚蟄怜 = str蜈ィ蜈・蜉帶枚蟄怜.Replace(Environment.NewLine, "\n"); + str蜈ィ蜈・蜉帶枚蟄怜 = str蜈ィ蜈・蜉帶枚蟄怜.Replace('\t', ' '); + str蜈ィ蜈・蜉帶枚蟄怜 = str蜈ィ蜈・蜉帶枚蟄怜 + "\n"; + #endregion + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "謾ケ陦後き繝繝域凾髢: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + #region [ 蛻晄悄蛹 ] + for (int j = 0; j < 36 * 36; j++) + { + this.n辟。髯千ョ。逅WAV[j] = -j; + this.n辟。髯千ョ。逅BPM[j] = -j; + this.n辟。髯千ョ。逅PAN[j] = -10000 - j; + this.n辟。髯千ョ。逅SIZE[j] = -j; + } + this.n蜀驛ィ逡ェ蜿キWAV1to = 1; + this.n蜀驛ィ逡ェ蜿キBPM1to = 1; + this.bstackIF縺九iENDIF繧偵せ繧ュ繝繝励☆繧 = new Stack(); + this.bstackIF縺九iENDIF繧偵せ繧ュ繝繝励☆繧.Push(false); + this.n迴セ蝨ィ縺ョ荵ア謨ー = 0; + for (int k = 0; k < 7; k++) + { + this.nRESULTIMAGE逕ィ蜆ェ蜈磯菴梗k] = 0; + this.nRESULTMOVIE逕ィ蜆ェ蜈磯菴梗k] = 0; + this.nRESULTSOUND逕ィ蜆ェ蜈磯菴梗k] = 0; + } + #endregion + #region [ 蜈・蜉/陦瑚ァ」譫 ] + #region[蛻晄悄蛹望 + this.dbNowScroll = 1.0; + this.dbNowSCROLL_Normal = new double[] { 1.0, 0.0 }; + this.dbNowSCROLL_Expert = new double[] { 1.0, 0.0 }; + this.dbNowSCROLL_Master = new double[] { 1.0, 0.0 }; + this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = ECourse.eNormal; + #endregion + CharEnumerator ce = str蜈ィ蜈・蜉帶枚蟄怜.GetEnumerator(); + if (ce.MoveNext()) + { + this.n迴セ蝨ィ縺ョ陦梧焚 = 1; + do + { + if (!this.t蜈・蜉媽遨コ逋ス縺ィ謾ケ陦後r繧ケ繧ュ繝繝励☆繧(ref ce)) + { + break; + } + if (this.listChip.Count == 0) + { + //this.t蜈・蜉(str1); + //this.t蜈・蜉媽V3( str1, 3 ); + this.t蜈・蜉媽V4(str1, Difficulty); + } + if (ce.Current == '#') + { + if (ce.MoveNext()) + { + StringBuilder builder = new StringBuilder(0x20); + if (this.t蜈・蜉媽繧ウ繝槭Φ繝画枚蟄怜励r謚懊″蜃コ縺(ref ce, ref builder)) + { + StringBuilder builder2 = new StringBuilder(0x400); + if (this.t蜈・蜉媽繝代Λ繝。繝シ繧ソ譁蟄怜励r謚懊″蜃コ縺(ref ce, ref builder2)) + { + StringBuilder builder3 = new StringBuilder(0x400); + if (this.t蜈・蜉媽繧ウ繝。繝ウ繝域枚蟄怜励r謚懊″蜃コ縺(ref ce, ref builder3)) + { + this.t蜈・蜉媽陦瑚ァ」譫(ref builder, ref builder2, ref builder3); + + this.n迴セ蝨ィ縺ョ陦梧焚++; + continue; + } + } + } + } + break; + } + //this.t蜈・蜉(str1); + } + while (this.t蜈・蜉媽繧ウ繝。繝ウ繝医r繧ケ繧ュ繝繝励☆繧(ref ce)); + + #endregion + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "謚懊″蜃コ縺玲凾髢: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + this.n辟。髯千ョ。逅WAV = null; + this.n辟。髯千ョ。逅BPM = null; + this.n辟。髯千ョ。逅PAN = null; + this.n辟。髯千ョ。逅SIZE = null; + //this.t蜈・蜉媽陦瑚ァ」譫舌倥ャ繝( str1 ); + if (!this.b繝倥ャ繝縺ョ縺ソ) + { + #region [ BPM/BMP蛻晄悄蛹 ] + int ch; + CBPM cbpm = null; + foreach (CBPM cbpm2 in this.listBPM.Values) + { + if (cbpm2.n陦ィ險倅ク翫ョ逡ェ蜿キ == 0) + { + cbpm = cbpm2; + break; + } + } + if (cbpm == null) + { + cbpm = new CBPM(); + cbpm.n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キBPM1to++; + cbpm.n陦ィ險倅ク翫ョ逡ェ蜿キ = 0; + cbpm.dbBPM蛟、 = 120.0; + this.listBPM.Add(cbpm.n蜀驛ィ逡ェ蜿キ, cbpm); + CChip chip = new CChip(); + chip.n逋コ螢ー菴咲スョ = 0; + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 8; // 諡。蠑オBPM + chip.n謨エ謨ー蛟、 = 0; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = cbpm.n蜀驛ィ逡ェ蜿キ; + this.listChip.Insert(0, chip); + } + else + { + CChip chip = new CChip(); + chip.n逋コ螢ー菴咲スョ = 0; + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 8; // 諡。蠑オBPM + chip.n謨エ謨ー蛟、 = 0; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = cbpm.n蜀驛ィ逡ェ蜿キ; + this.listChip.Insert(0, chip); + } + #endregion + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "蜑肴コ門y螳御コ譎る俣: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + #region [ CWAV蛻晄悄蛹 ] + foreach (CWAV cwav in this.listWAV.Values) + { + if (cwav.n繝√ャ繝励し繧、繧コ < 0) + { + cwav.n繝√ャ繝励し繧、繧コ = 100; + } + if (cwav.n菴咲スョ <= -10000) + { + cwav.n菴咲スョ = 0; + } + } + #endregion + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "CWAV蜑肴コ門y譎る俣: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + #region [ 繝√ャ繝怜咲紫險ュ螳 ] // #28145 2012.4.22 yyagi 莠碁阪Ν繝シ繝励r1驥阪Ν繝シ繝励↓螟画峩縺励※鬮倬溷喧) + //foreach ( CWAV cwav in this.listWAV.Values ) + //{ + // foreach( CChip chip in this.listChip ) + // { + // if( chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ == cwav.n蜀驛ィ逡ェ蜿キ ) + // { + // chip.db繝√ャ繝励し繧、繧コ蛟咲紫 = ( (double) cwav.n繝√ャ繝励し繧、繧コ ) / 100.0; + // if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01 ) // BGM縺縺」縺溘i + // { + // cwav.bIsOnBGMLane = true; + // } + // } + // } + //} + foreach (CChip chip in this.listChip) + { + if (this.listWAV.TryGetValue(chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, out CWAV cwav)) + //foreach ( CWAV cwav in this.listWAV.Values ) + { + // if ( chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ == cwav.n蜀驛ィ逡ェ蜿キ ) + // { + chip.db繝√ャ繝励し繧、繧コ蛟咲紫 = ((double)cwav.n繝√ャ繝励し繧、繧コ) / 100.0; + //if ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01 ) // BGM縺縺」縺溘i + //{ + // cwav.bIsOnBGMLane = true; + //} + // } + } + } + #endregion + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "CWAV蜈ィ貅門y譎る俣: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + #region [ 蠢隕√↓蠢懊§縺ヲ遨コ謇薙■髻ウ繧0蟆冗ッ縺ォ螳夂セゥ縺吶k ] + //for ( int m = 0xb1; m <= 0xbc; m++ ) // #28146 2012.4.21 yyagi; bb -> bc + //{ + // foreach ( CChip chip in this.listChip ) + // { + // if ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == m ) + // { + // CChip c = new CChip(); + // c.n逋コ螢ー菴咲スョ = 0; + // c.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ; + // c.n謨エ謨ー蛟、 = chip.n謨エ謨ー蛟、; + // c.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ; + // this.listChip.Insert( 0, c ); + // break; + // } + // } + //} + #endregion + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "遨コ謇鍋「コ隱肴凾髢: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + #region [ 諡榊ュ神諡咲キ壹ョ謖ソ蜈・ ] + if (this.listChip.Count > 0) + { + this.listChip.Sort(); // 鬮倬溷喧縺ョ縺溘a縺ォ縺ッ縺薙l繧貞炎繧翫◆縺縺後〕istChip縺ョ譛蠕後′n逋コ螢ー菴咲スョ縺ョ邨らォッ縺ァ縺ゅk蠢隕√′縺ゅk縺ョ縺ァ縲 + // 菫晏ョ域ァ遒コ菫昴r蜆ェ蜈医@縺ヲ縺薙%縺ァ縺ョ繧ス繝シ繝医ッ谿九@縺ヲ縺翫¥ + // 縺ェ縺翫093譎らせ縺ァ縺ッ縲√%縺ョ繧ス繝シ繝医r蜑企勁縺励※繧ょ虚菴懊☆繧九h縺縺ォ縺ッ縺励※縺ゅk縲 + // (縺薙%縺セ縺ァ縺ョ荳驛ィ繝√ャ繝礼匳骭イ繧偵〕istChip.Add(c)縺九i蜷栗nsert(0,c)縺ォ螟画峩縺励※縺ゅk) + // 縺薙l縺ォ繧医j縲∵焚ms遞句コヲ縺ェ縺後i縺薙%縺ァ縺ョ繧ス繝シ繝医b鬮倬溷喧縺輔l縺ヲ縺繧九 + + //double barlength = 1.0; + //int nEndOfSong = ( this.listChip[ this.listChip.Count - 1 ].n逋コ螢ー菴咲スョ + 384 ) - ( this.listChip[ this.listChip.Count - 1 ].n逋コ螢ー菴咲スョ % 384 ); + //for ( int tick384 = 0; tick384 <= nEndOfSong; tick384 += 384 ) // 蟆冗ッ邱壹ョ謖ソ蜈・縲(蠕後↓蜃コ縺ヲ縺上k諡榊ュ千キ壹→繝ォ繝シ繝励r縺セ縺ィ繧√h縺縺ィ縺吶k縺ェ繧峨’or繝ォ繝シ繝励ョ邨ゆコ譚。莉カ縺ョ蠕ョ螯吶↑驕輔>縺ォ豕ィ諢上′蠢隕) + //{ + // CChip chip = new CChip(); + // chip.n逋コ螢ー菴咲スョ = tick384; + // chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x50; // 蟆冗ッ邱 + // chip.n謨エ謨ー蛟、 = 36 * 36 - 1; + // chip.dbSCROLL = 1.0; + // this.listChip.Add( chip ); + //} + ////this.listChip.Sort(); // 縺薙%縺ァ縺ョ繧ス繝シ繝医ッ荳崎ヲ√ゅ◆縺縺玲怙蠕後↓繧ス繝シ繝医☆繧九%縺ィ + //int nChipNo_BarLength = 0; + //int nChipNo_C1 = 0; + + //this.listChip.Sort(); + } + #endregion + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "諡榊ュ神諡咲キ壽諺蜈・譎る俣: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + #region [ C2 [諡咲キ喟蟆冗ッ邱夊。ィ遉コ謖螳咯 縺ョ蜃ヲ逅 ] // #28145 2012.4.21 yyagi; 2驥阪Ν繝シ繝励r縺サ縺シ1驥阪↓縺励※鬮倬溷喧 + bool bShowBeatBarLine = true; + for (int i = 0; i < this.listChip.Count; i++) + { + bool bChangedBeatBarStatus = false; + if ((this.listChip[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0xc2)) + { + if (this.listChip[i].n謨エ謨ー蛟、 == 1) // BAR/BEAT LINE = ON + { + bShowBeatBarLine = true; + bChangedBeatBarStatus = true; + } + else if (this.listChip[i].n謨エ謨ー蛟、 == 2) // BAR/BEAT LINE = OFF + { + bShowBeatBarLine = false; + bChangedBeatBarStatus = true; + } + } + int startIndex = i; + if (bChangedBeatBarStatus) // C2繝√ャ繝励ョ蜑阪↓50/51繝√ャ繝励′譚・縺ヲ縺繧句庄閭ス諤ァ縺ォ驟肴ョ + { + while (startIndex > 0 && this.listChip[startIndex].n逋コ螢ー菴咲スョ == this.listChip[i].n逋コ螢ー菴咲スョ) + { + startIndex--; + } + startIndex++; // 1縺、蟆上&縺城℃縺弱※縺繧九ョ縺ァ縲∵綾縺 + } + for (int j = startIndex; j <= i; j++) + { + if (((this.listChip[j].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x50) || (this.listChip[j].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x51)) && + (this.listChip[j].n謨エ謨ー蛟、 == (36 * 36 - 1))) + { + this.listChip[j].b蜿ッ隕 = bShowBeatBarLine; + } + } + } + #endregion + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "C2 [諡咲キ喟蟆冗ッ邱夊。ィ遉コ謖螳咯: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + this.n蜀驛ィ逡ェ蜿キBRANCH1to = 0; + this.n蜀驛ィ逡ェ蜿キJSCROLL1to = 0; + #region [ 逋コ螢ー譎ょ綾縺ョ險育ョ ] + double bpm = 120.0; + //double dbBarLength = 1.0; + int n逋コ螢ー菴咲スョ = 0; + int ms = 0; + int nBar = 0; + int nCount = 0; + this.nNowRollCount = 0; + + List tmplistlyric = new List(); + int BGM逡ェ蜿キ = 0; + + foreach (CChip chip in this.listChip) + { + if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x02) { } + //else if( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x03 ){} + else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01) { } + else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x08) { } + else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x11 && chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x1F) { } + else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x50) { } + else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x51) { } + else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x54) { } + else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x08) { } + else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0xF1) { } + else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0xF2) { } + else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0xFF) { } + else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0xDD) { chip.n逋コ螢ー譎ょ綾ms = ms + ((int)(((625 * (chip.n逋コ螢ー菴咲スョ - n逋コ螢ー菴咲スョ)) * this.dbBarLength) / bpm)); } + else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0xDF) { chip.n逋コ螢ー譎ょ綾ms = ms + ((int)(((625 * (chip.n逋コ螢ー菴咲スョ - n逋コ螢ー菴咲スョ)) * this.dbBarLength) / bpm)); } + else if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 0x93) + chip.n逋コ螢ー譎ょ綾ms = ms + ((int)(((625 * (chip.n逋コ螢ー菴咲スョ - n逋コ螢ー菴咲スョ)) * this.dbBarLength) / bpm)); + else if ((chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ > 0x9F && chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 0xA0) || (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0xF0 && chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 0xFE)) + chip.n逋コ螢ー譎ょ綾ms = ms + ((int)(((625 * (chip.n逋コ螢ー菴咲スョ - n逋コ螢ー菴咲スョ)) * this.dbBarLength) / bpm)); + nBar = chip.n逋コ螢ー菴咲スョ / 384; + ch = chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ; + + nCount++; + this.nNowRollCount++; + + switch (ch) + { + case 0x01: + { + n逋コ螢ー菴咲スョ = chip.n逋コ螢ー菴咲スョ; + + if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk == false) + chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET; + ms = chip.n逋コ螢ー譎ょ綾ms; + + #region[listlyric2縺ョ譎る俣蜷医o縺嫋 + for (int ind = 0; ind < listLyric2.Count; ind++) + { + if (listLyric2[ind].index == BGM逡ェ蜿キ) + { + STLYRIC lyrictmp = this.listLyric2[ind]; + + lyrictmp.Time += chip.n逋コ螢ー譎ょ綾ms; + + tmplistlyric.Add(lyrictmp); + } + } + + + BGM逡ェ蜿キ++; + #endregion + continue; + } + case 0x02: // BarLength + { + n逋コ螢ー菴咲スョ = chip.n逋コ螢ー菴咲スョ; + if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk == false) + chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET; + ms = chip.n逋コ螢ー譎ょ綾ms; + dbBarLength = chip.db螳滓焚蛟、; + continue; + } + case 0x03: // BPM + { + n逋コ螢ー菴咲スョ = chip.n逋コ螢ー菴咲スョ; + if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk == false) + chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET; + ms = chip.n逋コ螢ー譎ょ綾ms; + bpm = this.BASEBPM + chip.n謨エ謨ー蛟、; + this.dbNowBPM = bpm; + continue; + } + case 0x04: // BGA (繝ャ繧、繝、BGA1) + case 0x07: // 繝ャ繧、繝、BGA2 + break; + + case 0x15: + case 0x16: + case 0x17: + { + if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk) + { + chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET; + chip.n繝弱シ繝邨ゆコ譎ょ綾ms += this.nOFFSET; + } + + this.nNowRoll = this.nNowRollCount - 1; + continue; + } + case 0x18: + { + if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk) + { + chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET; + } + continue; + } + + case 0x55: + case 0x56: + case 0x57: + case 0x58: + case 0x59: + case 0x60: + break; + + case 0x50: + { + if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk) + chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET; + //chip.n逋コ螢ー譎ょ綾ms += this.nDELAY; + //chip.dbBPM = this.dbNowBPM; + //chip.dbSCROLL = this.dbNowSCROLL; + + if (this.n蜀驛ィ逡ェ蜿キBRANCH1to + 1 > this.listBRANCH.Count) + continue; + + if (this.listBRANCH[this.n蜀驛ィ逡ェ蜿キBRANCH1to].n迴セ蝨ィ縺ョ蟆冗ッ == nBar) + { + chip.bBranch = true; + this.n蜀驛ィ逡ェ蜿キBRANCH1to++; + } + + //switch (this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ) + //{ + // case 0: + // chip.dbSCROLL = this.dbNowSCROLL_Normal; + // break; + // case 1: + // chip.dbSCROLL = this.dbNowSCROLL_Expert; + // break; + // case 2: + // chip.dbSCROLL = this.dbNowSCROLL_Master; + // break; + //} + + //if( this.bBarLine == true ) + // chip.b蜿ッ隕 = true; + //else + // chip.b蜿ッ隕 = false; + + //if( this.b谺。縺ョ蟆冗ッ縺悟蟯舌〒縺ゅk ) + //{ + // chip.bBranch = true; + // this.b谺。縺ョ蟆冗ッ縺悟蟯舌〒縺ゅk = false; + //} + continue; + } + + case 0x05: // Extended Object (髱槫ッセ蠢) + case 0x06: // Miss繧「繝九Γ (髱槫ッセ蠢) + case 0x5A: // 譛ェ螳夂セゥ + case 0x5b: // 譛ェ螳夂セゥ + case 0x5c: // 譛ェ螳夂セゥ + case 0x5d: // 譛ェ螳夂セゥ + case 0x5e: // 譛ェ螳夂セゥ + case 0x5f: // 譛ェ螳夂セゥ + { + continue; + } + case 0x08: // 諡。蠑オBPM + { + n逋コ螢ー菴咲スョ = chip.n逋コ螢ー菴咲スョ; + if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk == false) + chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET; + ms = chip.n逋コ螢ー譎ょ綾ms; + if (this.listBPM.TryGetValue(chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, out CBPM cBPM)) + { + bpm = (cBPM.n陦ィ險倅ク翫ョ逡ェ蜿キ == 0 ? 0.0 : this.BASEBPM) + cBPM.dbBPM蛟、; + this.dbNowBPM = bpm; + } + continue; + } + case 0x54: // 蜍慕判蜀咲函 + { + if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk == false) + chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET; + if (this.bMOVIEOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk == false) + chip.n逋コ螢ー譎ょ綾ms += this.nMOVIEOFFSET; + else + chip.n逋コ螢ー譎ょ綾ms -= this.nMOVIEOFFSET; + if (this.listAVIPAN.TryGetValue(chip.n謨エ謨ー蛟、, out CAVIPAN cavipan)) + { + int num21 = ms + ((int)(((0x271 * (chip.n逋コ螢ー菴咲スョ - n逋コ螢ー菴咲スョ)) * this.dbBarLength) / bpm)); + int num22 = ms + ((int)(((0x271 * ((chip.n逋コ螢ー菴咲スョ + cavipan.n遘サ蜍墓凾髢田t) - n逋コ螢ー菴咲スョ)) * this.dbBarLength) / bpm)); + chip.n邱冗ァサ蜍墓凾髢 = num22 - num21; + } + continue; + } + case 0x97: + case 0x98: + case 0x99: + { + if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk) + { + chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET; + chip.n繝弱シ繝邨ゆコ譎ょ綾ms += this.nOFFSET; + } + + //chip.dbBPM = this.dbNowBPM; + //chip.dbSCROLL = this.dbNowSCROLL; + this.nNowRoll = this.nNowRollCount - 1; + + //chip.n繝弱シ繝邨ゆコ譎ょ綾ms = ms + ( (int) ( ( ( 0x271 * ( chip.n繝弱シ繝邨ゆコ菴咲スョ - n逋コ螢ー菴咲スョ ) ) * dbBarLength ) / bpm ) ); + + #region[繝√ャ繝礼分蜿キ繧定ィ倬鹸] + //switch(chip.n繧ウ繝シ繧ケ) + //{ + // case 0: + // this.n騾」謇薙メ繝繝誉temp[0] = this.nNowRoll; + // this.dbSCROLL_temp[0] = this.dbNowSCROLL; + // break; + // case 1: + // this.n騾」謇薙メ繝繝誉temp[1] = this.nNowRoll; + // this.dbSCROLL_temp[1] = this.dbNowSCROLL; + // break; + // case 2: + // this.n騾」謇薙メ繝繝誉temp[2] = this.nNowRoll; + // this.dbSCROLL_temp[2] = this.dbNowSCROLL; + // break; + //} + + #endregion + + continue; + } + case 0x9A: + { + + if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk) + { + chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET; + } + //chip.n逋コ螢ー譎ょ綾ms += this.nDELAY; + //chip.dbBPM = this.dbNowBPM; + //chip.dbSCROLL = this.dbNowSCROLL; + + #region[繝√ャ繝礼分蜿キ繧定ィ倬鹸] + //鬚ィ闊ケ縺ッ迴セ譎らせ縺ァ縺ッ譛ェ螳溯」縺ョ縺溘a蜃ヲ逅縺励↑縺縲 + + + //switch (chip.n繧ウ繝シ繧ケ) + //{ + // case 0: + // if (this.listChip[this.n騾」謇薙メ繝繝誉temp[0]].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x99) break; + // this.listChip[this.n騾」謇薙メ繝繝誉temp[0]].n繝弱シ繝邨ゆコ譎ょ綾ms = chip.n逋コ螢ー譎ょ綾ms; + // this.listChip[this.n騾」謇薙メ繝繝誉temp[0]].dbSCROLL = this.dbSCROLL_temp[0]; + // break; + // case 1: + // if (this.listChip[this.n騾」謇薙メ繝繝誉temp[1]].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x99) break; + // this.listChip[this.n騾」謇薙メ繝繝誉temp[1]].n繝弱シ繝邨ゆコ譎ょ綾ms = chip.n逋コ螢ー譎ょ綾ms; + // this.listChip[this.n騾」謇薙メ繝繝誉temp[1]].dbSCROLL = this.dbSCROLL_temp[1]; + // break; + // case 2: + // if (this.listChip[this.n騾」謇薙メ繝繝誉temp[2]].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x99) break; + // this.listChip[this.n騾」謇薙メ繝繝誉temp[2]].n繝弱シ繝邨ゆコ譎ょ綾ms = chip.n逋コ螢ー譎ょ綾ms; + // this.listChip[this.n騾」謇薙メ繝繝誉temp[2]].dbSCROLL = this.dbSCROLL_temp[2]; + // break; + //} + + #endregion + + //this.listChip[this.nNowRoll].n繝弱シ繝邨ゆコ譎ょ綾ms = chip.n逋コ螢ー譎ょ綾ms; + //this.listChip[this.nNowRoll].dbSCROLL = this.dbNowSCROLL; + //this.listChip[this.nNowRoll].dbBPM = this.dbNowBPM; + continue; + } + case 0x9D: + { + //if ( this.listSCROLL.ContainsKey( chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ) ) + //{ + //this.dbNowSCROLL = ( ( this.listSCROLL[ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ].n陦ィ險倅ク翫ョ逡ェ蜿キ == 0 ) ? 0.0 : 1.0 ) + this.listSCROLL[ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ].dbSCROLL蛟、; + //} + + //switch (chip.n繧ウ繝シ繧ケ) + //{ + // case 0: + // this.dbNowSCROLL_Normal = this.dbNowSCROLL; + // this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = 0; + // break; + // case 1: + // this.dbNowSCROLL_Expert = this.dbNowSCROLL; + // this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = 1; + // break; + // case 2: + // this.dbNowSCROLL_Master = this.dbNowSCROLL; + // this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = 2; + // break; + //} + + continue; + } + case 0xDC: + { + if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk) + chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET; + //if ( this.listDELAY.ContainsKey( chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ) ) + //{ + // this.nDELAY = ( ( this.listDELAY[ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ].n陦ィ險倅ク翫ョ逡ェ蜿キ == 0 ) ? 0 : 0 ) + this.listDELAY[ chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ].nDELAY蛟、; + //} + continue; + } + case 0xDE: + { + if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk) + { + chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET; + chip.n蛻蟯先凾蛻サms += this.nOFFSET; + } + this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = chip.n繧ウ繝シ繧ケ; + continue; + } + case 0x52: + { + if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk) + { + chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET; + chip.n蛻蟯先凾蛻サms += this.nOFFSET; + } + this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = chip.n繧ウ繝シ繧ケ; + continue; + } + case 0xDF: + { + if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk) + chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET; + //if ( this.listBRANCH.ContainsKey( chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ) ) + //{ + //this.listBRANCH[chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ].db蛻蟯先凾髢杜s = chip.n逋コ螢ー譎ょ綾ms + ( this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk ? this.nOFFSET : 0 ); + //} + + continue; + } + case 0xE0: + { + //if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk) + // chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET; + + //chip.dbBPM = this.dbNowBPM; + //chip.dbSCROLL = this.dbNowSCROLL; + //if( chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ == 1 ) + // this.bBarLine = false; + //else + // this.bBarLine = true; + continue; + } + default: + { + if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk) + chip.n逋コ螢ー譎ょ綾ms += this.nOFFSET; + //chip.n逋コ螢ー譎ょ綾ms += this.nDELAY; + chip.dbBPM = this.dbNowBPM; + //chip.dbSCROLL = this.dbNowSCROLL; + continue; + } + } + } + if (this.db蜀咲函騾溷コヲ > 0.0) + { + double _db蜀咲函騾溷コヲ = (TJAPlayer3.DTXVmode.Enabled) ? this.dbDTXVPlaySpeed : this.db蜀咲函騾溷コヲ; + foreach (CChip chip in this.listChip) + { + chip.n逋コ螢ー譎ょ綾ms = (int)(((double)chip.n逋コ螢ー譎ょ綾ms) / _db蜀咲函騾溷コヲ); + chip.db逋コ螢ー譎ょ綾ms = (((double)chip.n逋コ螢ー譎ょ綾ms) / _db蜀咲函騾溷コヲ); + chip.n繝弱シ繝邨ゆコ譎ょ綾ms = (int)(((double)chip.n繝弱シ繝邨ゆコ譎ょ綾ms) / _db蜀咲函騾溷コヲ); + } + } + #endregion + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "逋コ螢ー譎ょ綾險育ョ: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + + #region[listlyric繧呈凾髢馴縺ォ荳ヲ縺ウ譖ソ縺医] + this.listLyric2 = tmplistlyric; + this.listLyric2.Sort((a, b) => a.Time.CompareTo(b.Time)); + #endregion + + this.nBGMAdjust = 0; + this.t蜷閾ェ蜍募咲函髻ウ繝√ャ繝励ョ蜀咲函譎ょ綾繧貞、画峩縺吶k(nBGMAdjust); + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "蜀咲函譎ょ綾螟画峩: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + + #region [ 蜿ッ隕悶メ繝繝玲焚繧ォ繧ヲ繝ウ繝 ] + for (int n = 0; n < 14; n++) + { + this.n蜿ッ隕悶メ繝繝玲焚[n] = 0; + } + foreach (CChip chip in this.listChip) + { + int c = chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ; + if ((0x11 <= c) && (c <= 0x14)) + { + if (c == 0x11 || c == 0x13) + this.n蜿ッ隕悶メ繝繝玲焚.Taiko_Red++; + else if (c == 0x12 || c == 0x14) + this.n蜿ッ隕悶メ繝繝玲焚.Taiko_Blue++; + } + } + #endregion + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "蜿ッ隕悶メ繝繝玲焚繧ォ繧ヲ繝ウ繝 {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + #region [ 繝√ャ繝励ョ遞ョ鬘槭r蛻鬘槭@縲∝ッセ蠢懊☆繧九ヵ繝ゥ繧ー繧堤ォ九※繧 ] + foreach (CChip chip in this.listChip) + { + if ((chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01 && this.listWAV.TryGetValue(chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, out CWAV cwav)) && !cwav.list縺薙ョWAV繧剃スソ逕ィ縺吶k繝√Ε繝ウ繝阪Ν逡ェ蜿キ縺ョ髮蜷.Contains(chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ)) + { + cwav.list縺薙ョWAV繧剃スソ逕ィ縺吶k繝√Ε繝ウ繝阪Ν逡ェ蜿キ縺ョ髮蜷.Add(chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ); + + int c = chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >> 4; + switch (c) + { + case 0x01: + cwav.bIsDrumsSound = true; break; + case 0x02: + cwav.bIsGuitarSound = true; break; + case 0x0A: + cwav.bIsBassSound = true; break; + case 0x06: + case 0x07: + case 0x08: + case 0x09: + cwav.bIsSESound = true; break; + case 0x00: + if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01) + { + cwav.bIsBGMSound = true; break; + } + break; + } + } + } + #endregion + //span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + //Trace.TraceInformation( "ch逡ェ蜿キ髮蜷育「コ隱: {0}", span.ToString() ); + //timeBeginLoad = DateTime.Now; + #region[ seNotes險育ョ ] + if (this.listBRANCH.Count != 0) + this.tSetSenotes_branch(); + else + this.tSetSenotes(); + + #endregion + #region [ bLogDTX隧ウ邏ー繝ュ繧ー蜃コ蜉 ] + if (TJAPlayer3.ConfigIni.bLogDTX隧ウ邏ー繝ュ繧ー蜃コ蜉) + { + foreach (CWAV cwav in this.listWAV.Values) + { + Trace.TraceInformation(cwav.ToString()); + } + foreach (CAVI cavi in this.listAVI.Values) + { + Trace.TraceInformation(cavi.ToString()); + } + foreach (CBPM cbpm3 in this.listBPM.Values) + { + Trace.TraceInformation(cbpm3.ToString()); + } + foreach (CChip chip in this.listChip) + { + Trace.TraceInformation(chip.ToString()); + } + } + #endregion + + //繧ス繝シ繝医▲縺ス縺 + //this.listChip.Sort(delegate(CChip pchipA, CChip pchipB) { return pchipA.n逋コ螢ー譎ょ綾ms - pchipB.n逋コ螢ー譎ょ綾ms; } ); + //Random ran1 = new Random(); + //for (int n = 0; n < this.listChip.Count; n++ ) + //{ + + // if (CDTXMania.ConfigIni.bHispeedRandom) + // { + + // int nRan = ran1.Next(5, 40); + // this.listChip[n].dbSCROLL = nRan / 10.0; + // } + //} + int n謨エ謨ー蛟、邂。逅 = 0; + foreach (CChip chip in this.listChip) + { + if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x54) + chip.n謨エ謨ー蛟、 = n謨エ謨ー蛟、邂。逅; + n謨エ謨ー蛟、邂。逅++; + } + + } + } + } + } + + private string t繧ウ繝。繝ウ繝医r蜑企勁縺吶k(string input) + { + string strOutput = Regex.Replace(input, @" *//.*", ""); //2017.01.28 DD 繧ウ繝。繝ウ繝亥燕縺ョ繧ケ繝壹シ繧ケ繧ょ炎髯、縺吶k繧医≧縺ォ菫ョ豁」 + + return strOutput; + } + + private string[] t繧ウ繝槭Φ繝芽。後r蜑企勁縺励◆TJA繧定ソ斐☆(string[] input) + { + return this.t繧ウ繝槭Φ繝芽。後r蜑企勁縺励◆TJA繧定ソ斐☆(input, 0); + } + + private string[] t繧ウ繝槭Φ繝芽。後r蜑企勁縺励◆TJA繧定ソ斐☆(string[] input, int nMode) + { + var sb = new StringBuilder(); + + // 18/11/11 AioiLight 隴憺擇縺ォSpace縲√せ繝壹シ繧ケ縲ゝab遲峨′蜈・縺」縺ヲ縺繧九→縺翫°縺励¥縺ェ繧九ョ縺ァ菫ョ豁」縲 + // 螟壼繧ウ繝槭Φ繝峨b繧ケ繝壹シ繧ケ縺梧栢縺九l縺。繧縺」縺ヲ縺繧九′縲√さ繝槭Φ繝芽。後r髯、縺剰ュ憺擇繧定ソ斐☆縺ョ縺ァ螟ァ荳亥、ォ(縺溘カ繧)縲 + for (int i = 0; i < input.Length; i++) + { + input[i] = input[i].Trim(); + } + + for (int n = 0; n < input.Length; n++) + { + if (nMode == 0) + { + if (!string.IsNullOrEmpty(input[n]) && this.CharConvertNote(input[n].Substring(0, 1)) != -1) + { + sb.Append(input[n] + "\n"); + } + } + else if (nMode == 1) + { + if (!string.IsNullOrEmpty(input[n]) && (input[n].Substring(0, 1) == "#" || this.CharConvertNote(input[n].Substring(0, 1)) != -1)) + { + if (input[n].StartsWith("BALLOON") || input[n].StartsWith("BPM")) + { + //Aス曦縺ァ蟋九∪繧句多莉、縺悟炎髯、縺輔l縺ェ縺荳榊キ蜷医ョ蟇セ遲 + } + else + { + sb.Append(input[n] + "\n"); + } + } + } + else if (nMode == 2) + { + if (!string.IsNullOrEmpty(input[n]) && this.CharConvertNote(input[n].Substring(0, 1)) != -1) + { + if (input[n].StartsWith("BALLOON") || input[n].StartsWith("BPM")) + { + //Aス曦縺ァ蟋九∪繧句多莉、縺悟炎髯、縺輔l縺ェ縺荳榊キ蜷医ョ蟇セ遲 + } + else + { + sb.Append(input[n] + "\n"); + } + } + else + { + if (input[n].StartsWith("#BRANCHSTART") || input[n] == "#N" || input[n] == "#E" || input[n] == "#M") + { + sb.Append(input[n] + "\n"); + } + + } + } + } + + string[] strOutput = sb.ToString().Split(this.dlmtEnter, StringSplitOptions.None); + + return strOutput; + } + + private string[] t遨コ縺ョstring驟榊励r隧ー繧√◆string驟榊励r霑斐☆(string[] input) + { + var sb = new StringBuilder(); + + for (int n = 0; n < input.Length; n++) + { + if (!string.IsNullOrEmpty(input[n])) + { + sb.Append(input[n] + "\n"); + } + } + + string[] strOutput = sb.ToString().Split(this.dlmtEnter, StringSplitOptions.None); + + return strOutput; + } + + private string StringArrayToString(string[] input) + { + return this.StringArrayToString(input, ""); + } + private string StringArrayToString(string[] input, string str繝繝ェ繝溘ち譁蟄) + { + var sb = new StringBuilder(); + + for (int n = 0; n < input.Length; n++) + { + sb.Append(input[n] + str繝繝ェ繝溘ち譁蟄); + } + + return sb.ToString(); + } + + /// + /// + /// + /// + /// 1蟆冗ッ蜀縺ョ譁蟄玲焚 + private int t1蟆冗ッ縺ョ譁蟄玲焚繧偵き繧ヲ繝ウ繝医☆繧(string InputText) + { + return InputText.Length - 1; + } + + /// + /// + /// + /// + /// 1蟆冗ッ蜀縺ョ譁蟄玲焚 + private void t1蟆冗ッ縺ョ譁蟄玲焚繧偵き繧ヲ繝ウ繝医@縺ヲ繝ェ繧ケ繝医↓霑ス蜉縺吶k(string InputText) + { + int nCount = 0; + + if (InputText.StartsWith("#BRANCHSTART")) + { + this.nLineCountTemp = this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー; + return; + } + else if (InputText.StartsWith("#N")) + { + this.nLineCountCourseTemp = ECourse.eNormal; + this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー = this.nLineCountTemp; + return; + } + else if (InputText.StartsWith("#E")) + { + this.nLineCountCourseTemp = ECourse.eExpert; + this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー = this.nLineCountTemp; + return; + } + else if (InputText.StartsWith("#M")) + { + this.nLineCountCourseTemp = ECourse.eMaster; + this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー = this.nLineCountTemp; + return; + } + + + var line = new CLine(); + line.n繧ウ繝シ繧ケ = this.nLineCountCourseTemp; + line.n譁蟄玲焚 = InputText.Length - 1; + line.n蟆冗ッ逡ェ蜿キ = this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー; + + this.listLine.Add(line); + + this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー++; + + } + + /// + /// 0:謾ケ陦梧枚蟄励r蜑企勁縺励※縲√ョ繝ェ繝溘ち縺ィ縺励※繧ケ繝壹シ繧ケ繧貞・繧後k縲(霑斐j蛟、:string) + /// 1:謾ケ陦梧枚蟄励r蜑企勁縲√&繧峨↓Split縺励※霑斐☆(霑斐j蛟、:string[n]) + /// + /// + /// + /// + private object str謾ケ陦梧枚蟄励r蜑企勁縺吶k(string strInput, int nMode) + { + string str = ""; + str = strInput.Replace(Environment.NewLine, "\n"); + str = str.Replace('\t', ' '); + + if (nMode == 0) + { + str = str.Replace("\n", " "); + } + else if (nMode == 1) + { + str = str + "\n"; + + string[] strArray; + strArray = str.Split(this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries); + + return strArray; + } + + return str; + } + + /// + /// 繧ウ繝シ繧ケ縺斐→縺ォ隴憺擇繧貞蜑イ縺吶k縲 + /// + /// + /// 蜷繧ウ繝シ繧ケ縺ョ隴憺擇(string[5]) + private string[] t繧ウ繝シ繧ケ縺ァ隴憺擇繧貞蜑イ縺吶k(string strTJA) + { + string[] strCourseTJA = new string[(int)Difficulty.Total]; + + if (strTJA.IndexOf("COURSE", 0) != -1) + { + //tja蜀縺ォ縲靴OURSE縲阪′縺ゅl縺ー縺薙%繧剃スソ縺縲 + string[] strTemp = strTJA.Split(this.dlmtCOURSE, StringSplitOptions.RemoveEmptyEntries); + + for (int n = 1; n < strTemp.Length; n++) + { + int nCourse = 0; + string nNC = ""; + while (strTemp[n].Substring(0, 1) != "\n") //2017.01.29 DD COURSE蜊倩ェ櫁。ィ險倥↓蟇セ蠢 + { + nNC += strTemp[n].Substring(0, 1); + strTemp[n] = strTemp[n].Remove(0, 1); + } + + if (this.strConvertCourse(nNC) != -1) + { + nCourse = this.strConvertCourse(nNC); + strCourseTJA[nCourse] = strTemp[n]; + } + else + { + + } + //strCourseTJA[ ]; + + } + } + else + { + strCourseTJA[3] = strTJA; + } + + return strCourseTJA; + } + + private static readonly Regex regexForPrefixingCommaStartingLinesWithZero = new Regex(@"^,", RegexOptions.Multiline | RegexOptions.Compiled); + private static readonly Regex regexForStrippingHeadingLines = new Regex( + @"^(?!(TITLE|LEVEL|BPM|WAVE|OFFSET|BALLOON|EXAM1|EXAM2|EXAM3|EXAM4|RENREN22|RENREN23|RENREN32|RENREN33|RENREN42|RENREN43|BALLOONNOR|BALLOONEXP|BALLOONMAS|SONGVOL|SEVOL|SCOREINIT|SCOREDIFF|COURSE|STYLE|GAME|LIFE|DEMOSTART|SIDE|SUBTITLE|SCOREMODE|GENRE|MOVIEOFFSET|BGIMAGE|BGMOVIE|HIDDENBRANCH|GAUGEINCR|LYRICFILE|#HBSCROLL|#BMSCROLL)).+\n", + RegexOptions.Multiline | RegexOptions.Compiled); + + /// + /// 譁ー蝙九 + /// 笳区悴螳溯」 + /// _縲靴OURSE縲榊ョ夂セゥ縺檎┌縺隴憺擇縺ッ譛ェ蟇セ蠢 + /// 縲竊致er2015082200縺ァ蟇セ蠢懷ョ御コ縲 + /// + /// + /// 隴憺擇縺ョ繝繝シ繧ソ + private void t蜈・蜉媽V4(string strInput, int difficulty) + { + if (!String.IsNullOrEmpty(strInput)) //遨コ縺ェ繧蛾壹&縺ェ縺 + { + //StreamWriter stream = null; + //bool bLog = true; + //try + //{ + // stream = new StreamWriter("noteTest.txt", false); + //} + //catch (Exception ex) + //{ + // Trace.TraceError( ex.StackTrace ); + //} + + //2017.01.31 DD 繧ォ繝ウ繝槭ョ縺ソ縺ョ陦後r0,縺ォ鄂ョ縺肴鋤縺 + strInput = regexForPrefixingCommaStartingLinesWithZero.Replace(strInput, "0,"); + + //2017.02.03 DD 繝倥ャ繝蜀縺ォ縺ゅk蜻ス莉、莉・螟悶ョ譁蟄怜励r蜑企勁 + var startIndex = strInput.IndexOf("#START"); + if (startIndex < 0) + { + Trace.TraceWarning($"#START蜻ス莉、縺悟ー代↑縺上→繧1縺、縺ッ蠢隕√〒縺吶 ({str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ})"); + } + string strInputHeader = strInput.Remove(startIndex); + strInput = strInput.Remove(0, startIndex); + strInputHeader = regexForStrippingHeadingLines.Replace(strInputHeader, ""); + strInput = strInputHeader + "\n" + strInput; + + //縺ゥ縺縺帑スソ繧上↑縺縺ョ縺ァ蜈医↓Split縺励※繧ウ繝。繝ウ繝医r蜑企勁縲 + var strSplit縺励◆隴憺擇 = (string[])this.str謾ケ陦梧枚蟄励r蜑企勁縺吶k(strInput, 1); + for (int i = 0; strSplit縺励◆隴憺擇.Length > i; i++) + { + strSplit縺励◆隴憺擇[i] = this.t繧ウ繝。繝ウ繝医r蜑企勁縺吶k(strSplit縺励◆隴憺擇[i]); + } + //遨コ縺ョstring驟榊励r隧ー繧√k + strSplit縺励◆隴憺擇 = this.t遨コ縺ョstring驟榊励r隧ー繧√◆string驟榊励r霑斐☆(strSplit縺励◆隴憺擇); + + #region[繝倥ャ繝] + + //2015.05.21 kairera0467 + //繝倥ャ繝縺ョ隱ュ縺ソ霎シ縺ソ縺ッ隴憺擇蜈ィ菴薙°繧芽ゥイ蠖薙☆繧句多莉、繧呈爾縺吶 + //蟆代@蜃ヲ逅縺碁≦縺上↑繧句庄閭ス諤ァ縺ッ縺ゅk縺後√%縺薙ッ豁」遒コ諤ァ繧帝崎ヲ悶☆繧九 + //轤ケ謨ー縺ェ縺ゥ縺ョ謖螳壹ッ蠕後°繧牙推繧ウ繝シ繧ケ縺ァ陦後≧縺ョ縺ァ蝠城。後ッ辟。縺縺繧阪≧縲 + + //Split縺励◆繝倥ャ繝縺ョLength縺ョ蝗樊焚縺縺代’or縺ァ蝗槭@縺ヲ蜷遞ョ諠蝣ア繧定ェュ縺ソ蜿悶▲縺ヲ縺縺上 + for (int i = 0; strSplit縺励◆隴憺擇.Length > i; i++) + { + this.t蜈・蜉媽陦瑚ァ」譫舌倥ャ繝(strSplit縺励◆隴憺擇[i]); + } + #endregion + + #region[隴憺擇] + + int n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ = 3; + int n隴憺擇謨ー = 0; //2017.07.22 kairera0467 tja縺ォ蜷ォ縺セ繧後k隴憺擇縺ョ謨ー + + + bool b譁ー蜃ヲ逅 = false; + + //縺セ縺壹ッ繧ウ繝シ繧ケ縺斐→縺ォ隴憺擇繧貞蜑イ縲 + strSplit縺励◆隴憺擇 = this.t繧ウ繝シ繧ケ縺ァ隴憺擇繧貞蜑イ縺吶k(this.StringArrayToString(strSplit縺励◆隴憺擇, "\n")); + string strTest = ""; + //蟄伜惠縺吶k縺九ョ繝輔Λ繧ー菴懈舌 + for (int i = 0; i < strSplit縺励◆隴憺擇.Length; i++) + { + if (!String.IsNullOrEmpty(strSplit縺励◆隴憺擇[i])) + { + this.b隴憺擇縺悟ュ伜惠縺吶k[i] = true; + n隴憺擇謨ー++; + } + else + this.b隴憺擇縺悟ュ伜惠縺吶k[i] = false; + } + #region[ 隱ュ縺ソ霎シ縺セ縺帙k繧ウ繝シ繧ケ繧呈アコ螳 ] + if (this.b隴憺擇縺悟ュ伜惠縺吶k[difficulty] == false) + { + n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ = difficulty; + n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ++; + for (int n = 1; n < (int)Difficulty.Total; n++) + { + if (this.b隴憺擇縺悟ュ伜惠縺吶k[n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ] == false) + { + n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ++; + if (n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ > (int)Difficulty.Total - 1) + n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ = 0; + } + else + break; + } + } + else + n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ = difficulty; + #endregion + + //謖螳壹@縺溘さ繝シ繧ケ縺ョ隴憺擇縺ョ蜻ス莉、繧呈カ亥悉縺吶k縲 + strSplit縺励◆隴憺擇[n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ] = CDTXStyleExtractor.t繧サ繝繧キ繝ァ繝ウ隴憺擇縺後≠繧( + strSplit縺励◆隴憺擇[n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ], + TJAPlayer3.ConfigIni.nPlayerCount > 1 ? (this.nPlayerSide + 1) : 0, + this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ); + + //蜻ス莉、繧偵☆縺ケ縺ヲ豸亥悉縺励◆隴憺擇 + var str蜻ス莉、豸亥悉隴憺擇 = strSplit縺励◆隴憺擇[n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ].Split(this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries); + //if( bLog && stream != null ) + //{ + // stream.WriteLine( "-------------------------------------------------" ); + // stream.WriteLine( ">>this.str蜻ス莉、豸亥悉隴憺擇(繧ウ繝槭Φ繝牙炎髯、蜑)" ); + // for( int i = 0; i < this.str蜻ス莉、豸亥悉隴憺擇.Length; i++ ) + // { + // stream.WriteLine( this.str蜻ス莉、豸亥悉隴憺擇[ i ] ); + // } + // stream.WriteLine( "-------------------------------------------------" ); + //} + str蜻ス莉、豸亥悉隴憺擇 = this.t繧ウ繝槭Φ繝芽。後r蜑企勁縺励◆TJA繧定ソ斐☆(str蜻ス莉、豸亥悉隴憺擇, 2); + + //if( bLog && stream != null ) + //{ + // stream.WriteLine( "-------------------------------------------------" ); + // stream.WriteLine( ">>this.str蜻ス莉、豸亥悉隴憺擇" ); + // for( int i = 0; i < this.str蜻ス莉、豸亥悉隴憺擇.Length; i++ ) + // { + // stream.WriteLine( this.str蜻ス莉、豸亥悉隴憺擇[ i ] ); + // } + // stream.WriteLine( "-------------------------------------------------" ); + //} + + + //縺薙%縺ァ1陦後ョ譁蟄玲焚繧偵き繧ヲ繝ウ繝医る榊励↓縺励※霑斐☆縲 + var strSplit隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ = strSplit縺励◆隴憺擇[n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ].Split(this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries); + string str = ""; + try + { + if (n隴憺擇謨ー > 0) + { + //2017.07.22 kairera0467 隴憺擇縺2縺、莉・荳翫≠繧句エ蜷医ッCOURSE莉・荳九ョBALLOON蜻ス莉、繧剃スソ縺 + this.listBalloon.Clear(); + this.listBalloon_Normal.Clear(); + this.listBalloon_Expert.Clear(); + this.listBalloon_Master.Clear(); + this.listBalloon_Normal_謨ー蛟、邂。逅 = 0; + this.listBalloon_Expert_謨ー蛟、邂。逅 = 0; + this.listBalloon_Master_謨ー蛟、邂。逅 = 0; + } + + for (int i = 0; i < strSplit隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ.Length; i++) + { + if (!String.IsNullOrEmpty(strSplit隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ[i])) + { + this.t髮」譏灘コヲ蛻・繝倥ャ繝(strSplit隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ[i]); + } + } + for (int i = 0; i < str蜻ス莉、豸亥悉隴憺擇.Length; i++) + { + if (str蜻ス莉、豸亥悉隴憺擇[i].IndexOf(',', 0) == -1 && !String.IsNullOrEmpty(str蜻ス莉、豸亥悉隴憺擇[i])) + { + if (str蜻ス莉、豸亥悉隴憺擇[i].Substring(0, 1) == "#") + { + this.t1蟆冗ッ縺ョ譁蟄玲焚繧偵き繧ヲ繝ウ繝医@縺ヲ繝ェ繧ケ繝医↓霑ス蜉縺吶k(str + str蜻ス莉、豸亥悉隴憺擇[i]); + } + + if (this.CharConvertNote(str蜻ス莉、豸亥悉隴憺擇[i].Substring(0, 1)) != -1) + str += str蜻ス莉、豸亥悉隴憺擇[i]; + } + else + { + this.t1蟆冗ッ縺ョ譁蟄玲焚繧偵き繧ヲ繝ウ繝医@縺ヲ繝ェ繧ケ繝医↓霑ス蜉縺吶k(str + str蜻ス莉、豸亥悉隴憺擇[i]); + str = ""; + } + } + } + catch (Exception ex) + { + Trace.TraceError(ex.ToString()); + Trace.TraceError("萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (9e401212-0b78-4073-88d0-f7e791f36a91)"); + } + + //if( bLog && stream != null ) + //{ + // stream.WriteLine( "-------------------------------------------------" ); + // stream.WriteLine( ">>this.str蜻ス莉、豸亥悉隴憺擇 (蜻ス莉、豸亥悉縺励◆蠕)" ); + // for( int i = 0; i < this.str蜻ス莉、豸亥悉隴憺擇.Length; i++ ) + // { + // stream.WriteLine( this.str蜻ス莉、豸亥悉隴憺擇[ i ] ); + // } + // stream.WriteLine( "-------------------------------------------------" ); + //} + + //隱ュ縺ソ霎シ縺ソ驛ィ蛻譛ャ菴薙↓貂。縺呵ュ憺擇繧剃ス懈舌 + //0:繝倥ャ繝繝シ諠蝣ア 1:#START莉・髯 縺ィ縺ェ繧九ょ区焚縺ョ螳夂セゥ縺ッ蠕後°繧峨&繧後k縺溘a縲√%縺薙〒縺ッ逵∫払縲 + var strSplit縺励◆蠕後ョ隴憺擇 = strSplit隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ; //strSplit縺励◆隴憺擇[ n隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ ].Split( this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries ); + strSplit縺励◆蠕後ョ隴憺擇 = this.t繧ウ繝槭Φ繝芽。後r蜑企勁縺励◆TJA繧定ソ斐☆(strSplit縺励◆蠕後ョ隴憺擇, 1); + //string str蜻ス莉、豸亥悉隴憺擇temp = this.StringArrayToString( this.str蜻ス莉、豸亥悉隴憺擇 ); + //string[] strDelimiter = { "," }; + //this.str蜻ス莉、豸亥悉隴憺擇 = str蜻ス莉、豸亥悉隴憺擇temp.Split( strDelimiter, StringSplitOptions.RemoveEmptyEntries ); + + //if( bLog && stream != null ) + //{ + // stream.WriteLine( "-------------------------------------------------" ); + // stream.WriteLine( ">>this.str蜻ス莉、豸亥悉隴憺擇 (Split縺励◆蠕)" ); + // for( int i = 0; i < this.str蜻ス莉、豸亥悉隴憺擇.Length; i++ ) + // { + // stream.WriteLine( this.str蜻ス莉、豸亥悉隴憺擇[ i ] ); + // } + // stream.WriteLine( "-------------------------------------------------" ); + //} + + this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー = 1; + try + { + #region[ 譛蛻昴ョ蜃ヲ逅 ] + //1蟆冗ッ縺ョ譎る俣繧呈諺蜈・縺励※髢句ァ区凾髢薙r隱ソ遽縲 + this.dbNowTime += ((15000.0 / 120.0 * (4.0 / 4.0)) * 16.0); + //this.dbNowBMScollTime += (( this.dbBarLength ) * 16.0 ); + #endregion + //string strWrite = ""; + for (int i = 0; strSplit縺励◆蠕後ョ隴憺擇.Length > i; i++) + { + str = strSplit縺励◆蠕後ョ隴憺擇[i]; + //strWrite += str; + //if( !str.StartsWith( "#" ) && !string.IsNullOrEmpty( this.strTemp ) ) + //{ + // str = this.strTemp + str; + //} + + this.t蜈・蜉媽陦瑚ァ」譫占ュ憺擇_V4(str); + + if (!String.IsNullOrEmpty(strSplit隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ[i])) + this.tDanExamLoad(strSplit隱ュ縺ソ霎シ繧繧ウ繝シ繧ケ[i]); + } + } + catch (Exception ex) + { + Trace.TraceError(ex.ToString()); + Trace.TraceError("萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (2da1e880-6b63-4e82-b018-bf18c3568335)"); + } + //if( stream != null ) + //{ + // stream.Flush(); + // stream.Close(); + //} + #endregion + } + } + + private CChip t逋コ螢ー菴咲スョ縺九i驕主悉譁ケ蜷代〒荳逡ェ霑代¥縺ォ縺ゅk謖螳壹メ繝」繝ウ繝阪Ν縺ョ繝√ャ繝励r霑斐☆(int n逋コ螢ー譎ょ綾, int n繝√Ε繝ウ繝阪Ν逡ェ蜿キ) + { + //驕主悉譁ケ蜷代∈縺ョ讀懃エ「 + for (int i = this.listChip.Count - 1; i >= 0; i--) + { + if (this.listChip[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == n繝√Ε繝ウ繝阪Ν逡ェ蜿キ) + { + return this.listChip[i]; + } + } + + return null; + } + + //迴セ蝨ィ縲∽サ・荳九ョ繧医≧縺ェ陦後↓縺ッ蟇セ蠢懊〒縺阪※縺縺セ縺帙s縲 + //_繝代Λ繝。繝シ繧ソ繧呈戟縺、蜻ス莉、縺後≠繧 + //_陦後ョ騾比クュ縺ォ蜻ス莉、縺後≠繧 + private int t譁蟄玲焚隗」譫(string InputText) + { + int n譁蟄玲焚 = 0; + + for (int i = 0; i < InputText.Length; i++) + { + if (this.CharConvertNote(InputText.Substring(i, 1)) != -1) + { + n譁蟄玲焚++; + } + } + + + return n譁蟄玲焚; + } + + private static readonly Regex CommandAndArgumentRegex = + new Regex(@"^(#[A-Z]+)(?:\s?)(.+?)?$", RegexOptions.Compiled); + + private static readonly Regex BranchStartArgumentRegex = + new Regex(@"^([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)$", RegexOptions.Compiled); + + private string[] SplitComma(string input) + { + var result = new List(); + var workingIndex = 0; + for (int i = 0; i < input.Length; i++) + { + if (input[i].Equals(',')) // 繧ォ繝ウ繝槭↓縺カ縺。蠖薙◆縺」縺 + { + if (i - 1 >= 0)// &&貍皮ョ怜ュ舌〒繧ゅ∽セ句、悶′襍キ縺阪k縺ョ縺ァ... + { + if (input[i - 1].Equals('\\')) // 1譁蟄怜燕縺後ヰ繝繧ッ繧ケ繝ゥ繝繧キ繝・ + { + input = input.Remove(i - 1, 1); + } + else + { + // workingIndex縺九i莉翫ョ菴咲スョ縺セ縺ァ繧偵Μ繧ケ繝医↓繝悶メ霎シ繧 + result.Add(input.Substring(workingIndex, i - workingIndex)); + // workingIndex縺ォ莉翫ョ菴咲スョ+1繧剃サ」蜈・ + workingIndex = i + 1; + } + } + else + { + // workingIndex縺九i莉翫ョ菴咲スョ縺セ縺ァ繧偵Μ繧ケ繝医↓繝悶メ霎シ繧 + result.Add(input.Substring(workingIndex, i - workingIndex)); + // workingIndex縺ォ莉翫ョ菴咲スョ+1繧剃サ」蜈・ + workingIndex = i + 1; + } + } + if (i + 1 == input.Length) // 譛蠕後↓ + { + result.Add(input.Substring(workingIndex, input.Length - workingIndex)); + } + } + return result.ToArray(); + } + + /// + /// 隴憺擇隱ュ縺ソ霎シ縺ソ繝。繧ス繝繝鰻4縺ァ菴ソ逕ィ縲 + /// + /// + private void t蜻ス莉、繧呈諺蜈・縺吶k(string InputText) + { + string[] SplitComma(string input) + { + var result = new List(); + var workingIndex = 0; + for (int i = 0; i < input.Length; i++) + { + if (input[i] == ',') // 繧ォ繝ウ繝槭↓縺カ縺。蠖薙◆縺」縺 + { + if (input[i - 1] == '\\') // 1譁蟄怜燕縺後ヰ繝繧ッ繧ケ繝ゥ繝繧キ繝・ + { + input = input.Remove(i - 1, 1); + } + else + { + // workingIndex縺九i莉翫ョ菴咲スョ縺セ縺ァ繧偵Μ繧ケ繝医↓繝悶メ霎シ繧 + result.Add(input.Substring(workingIndex, i - workingIndex)); + // workingIndex縺ォ莉翫ョ菴咲スョ+1繧剃サ」蜈・ + workingIndex = i + 1; + } + } + if (i + 1 == input.Length) // 譛蠕後↓ + { + result.Add(input.Substring(workingIndex, input.Length - workingIndex)); + } + } + return result.ToArray(); + } + + + var match = CommandAndArgumentRegex.Match(InputText); + if (!match.Success) + { + return; + } + + var command = match.Groups[1].Value; + var argumentMatchGroup = match.Groups[2]; + var argument = argumentMatchGroup.Success ? argumentMatchGroup.Value : null; + + while (true) + {//蜻ス莉、縺ョ譛蠕後↓,縺梧ョ九▲縺ヲ縺励∪縺」縺ヲ縺繧九→縺阪ョ蟇セ蠢 + if (argument != null && argument[argument.Length - 1] == ',') + argument = argument.Substring(0, argument.Length - 1); + else + break; + } + + char[] chDelimiter = new char[] { ' ' }; + string[] strArray = null; + + if (command == "#START") + { + //#START縺ィ蜷梧凾縺ォ魑エ繧峨☆縺ョ縺ッ縺ゥ縺縺九→諤昴≧縺代←縺励c繝シ縺ェ縺励□縺ェ縲 + AddMusicPreTimeMs(); // 髻ウ貅舌r魑エ繧峨☆蜑阪↓驕蟒カ縲 + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x01; + chip.n逋コ螢ー菴咲スョ = 384; + chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.fBMSCROLLTime = this.dbNowBMScollTime; + chip.n謨エ謨ー蛟、 = 0x01; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1; + + // 繝√ャ繝励r驟咲スョ縲 + this.listChip.Add(chip); + + var chip1 = new CChip(); + chip1.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x54; + //chip1.n逋コ螢ー菴咲スョ = 384; + //chip1.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + if (this.nMOVIEOFFSET == 0) + chip1.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + else + chip1.n逋コ螢ー譎ょ綾ms = (int)this.nMOVIEOFFSET; + chip1.dbBPM = this.dbNowBPM; + chip1.fNow_Measure_m = this.fNow_Measure_m; + chip1.fNow_Measure_s = this.fNow_Measure_s; + chip1.dbSCROLL = this.dbNowScroll; + chip1.n謨エ謨ー蛟、 = 0x01; + chip1.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1; + chip1.eAVI遞ョ蛻・ = EAVI遞ョ蛻・.AVI; + + // 繝√ャ繝励r驟咲スョ縲 + + this.listChip.Add(chip1); + } + else if (command == "#END") + { + //縺溘a縺励↓蜑イ繧願セシ繧縲 + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xFF; + chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー + 2) * 384); + //chip.n逋コ螢ー譎ょ綾ms = (int)( this.dbNowTime + ((15000.0 / this.dbNowBPM * ( 4.0 / 4.0 )) * 16.0) * 2 ); + chip.n逋コ螢ー譎ょ綾ms = (int)(this.dbNowTime + 1000); //2016.07.16 kairera0467 邨ゆコ譎ゅ°繧1遘貞セ後↓險ュ鄂ョ縺吶k繧医≧螟画峩縲 + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n謨エ謨ー蛟、 = 0xFF; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1; + // 繝√ャ繝励r驟咲スョ縲 + + if(n蜿らァ荳ュ縺ョ髮」譏灘コヲ == (int)Difficulty.Dan) + { + for (int i = listChip.Count - 1; i >= 0; i--) + { + if (listChip[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x11 && listChip[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x18) + { + if (DanSongs.Number != 0) + { + Array.Resize(ref this.pDan_LastChip, this.pDan_LastChip.Length + 1); + this.pDan_LastChip[DanSongs.Number - 1] = listChip[i]; + break; + } + } + } + } + + this.listChip.Add(chip); + } + + else if (command == "#BPMCHANGE") + { + double dbBPM = Convert.ToDouble(argument); + this.dbNowBPM = dbBPM; + + this.listBPM.Add(this.n蜀驛ィ逡ェ蜿キBPM1to - 1, new CBPM() { n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キBPM1to - 1, n陦ィ險倅ク翫ョ逡ェ蜿キ = 0, dbBPM蛟、 = dbBPM, bpm_change_time = this.dbNowTime, bpm_change_bmscroll_time = this.dbNowBMScollTime, bpm_change_course = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ }); + + + //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九 + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x08; + chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384); + chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.fBMSCROLLTime = (float)this.dbNowBMScollTime; + chip.dbBPM = dbBPM; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キBPM1to - 1; + + // 繝√ャ繝励r驟咲スョ縲 + + this.listChip.Add(chip); + + var chip1 = new CChip(); + chip1.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x9C; + chip1.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384); + chip1.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip1.fBMSCROLLTime = (float)this.dbNowBMScollTime; + chip1.dbBPM = dbBPM; + chip1.dbSCROLL = this.dbNowScroll; + chip1.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キBPM1to - 1; + + // 繝√ャ繝励r驟咲スョ縲 + + this.listChip.Add(chip1); + + this.n蜀驛ィ逡ェ蜿キBPM1to++; + } + else if (command == "#SCROLL") + { + //2016.08.13 kairera0467 隍邏謨ー繧ケ繧ッ繝ュ繝シ繝ォ繧ゅ←縺阪ョ繝繧ケ繝 + if (argument.IndexOf('i') != -1) + { + //i縺悟・縺」縺ヲ縺縺溷エ蜷医∬、邏謨ー繧ケ繧ッ繝ュ繝シ繝ォ縺ィ縺ソ縺ェ縺吶 + + double[] dbComplexNum = new double[2]; + this.tParsedComplexNumber(argument, ref dbComplexNum); + + this.dbNowScroll = dbComplexNum[0]; + this.dbNowScrollY = dbComplexNum[1]; + + this.listSCROLL.Add(this.n蜀驛ィ逡ェ蜿キSCROLL1to, new CSCROLL() { n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キSCROLL1to, n陦ィ險倅ク翫ョ逡ェ蜿キ = 0, dbSCROLL蛟、 = dbComplexNum[0], dbSCROLL蛟、Y = dbComplexNum[1] }); + + switch (this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ) + { + case ECourse.eNormal: + this.dbNowSCROLL_Normal[0] = dbComplexNum[0]; + this.dbNowSCROLL_Normal[1] = dbComplexNum[1]; + break; + case ECourse.eExpert: + this.dbNowSCROLL_Expert[0] = dbComplexNum[0]; + this.dbNowSCROLL_Expert[1] = dbComplexNum[1]; + break; + case ECourse.eMaster: + this.dbNowSCROLL_Master[0] = dbComplexNum[0]; + this.dbNowSCROLL_Master[1] = dbComplexNum[1]; + break; + default: + this.dbNowSCROLL_Normal[0] = dbComplexNum[0]; + this.dbNowSCROLL_Normal[1] = dbComplexNum[1]; + break; + } + + //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九 + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x9D; + chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1; + chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キSCROLL1to; + chip.dbSCROLL = dbComplexNum[0]; + chip.dbSCROLL_Y = dbComplexNum[1]; + chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ; + + // 繝√ャ繝励r驟咲スョ縲 + + this.listChip.Add(chip); + } + else + { + double dbSCROLL = Convert.ToDouble(argument); + this.dbNowScroll = dbSCROLL; + this.dbNowScrollY = 0.0; + + this.listSCROLL.Add(this.n蜀驛ィ逡ェ蜿キSCROLL1to, new CSCROLL() { n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キSCROLL1to, n陦ィ險倅ク翫ョ逡ェ蜿キ = 0, dbSCROLL蛟、 = dbSCROLL, dbSCROLL蛟、Y = 0.0 }); + + switch (this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ) + { + case ECourse.eNormal: + this.dbNowSCROLL_Normal[0] = dbSCROLL; + break; + case ECourse.eExpert: + this.dbNowSCROLL_Expert[0] = dbSCROLL; + break; + case ECourse.eMaster: + this.dbNowSCROLL_Master[0] = dbSCROLL; + break; + } + + //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九 + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x9D; + chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1; + chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キSCROLL1to; + chip.dbSCROLL = dbSCROLL; + chip.dbSCROLL_Y = 0.0; + chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ; + + // 繝√ャ繝励r驟咲スョ縲 + + this.listChip.Add(chip); + } + + + + + this.n蜀驛ィ逡ェ蜿キSCROLL1to++; + } + else if (command == "#MEASURE") + { + strArray = argument.Split(new char[] { '/' }); + WarnSplitLength("#MEASURE subsplit", strArray, 2); + + double[] dbLength = new double[2]; + dbLength[0] = Convert.ToDouble(strArray[0]); + dbLength[1] = Convert.ToDouble(strArray[1]); + + double db蟆冗ッ髟キ蛟咲紫 = dbLength[0] / dbLength[1]; + this.dbBarLength = db蟆冗ッ髟キ蛟咲紫; + this.fNow_Measure_m = (float)dbLength[1]; + this.fNow_Measure_s = (float)dbLength[0]; + + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x02; + chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384); + chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.dbSCROLL = this.dbNowScroll; + chip.db螳滓焚蛟、 = db蟆冗ッ髟キ蛟咲紫; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1; + // 繝√ャ繝励r驟咲スョ縲 + + this.listChip.Add(chip); + + //lbMaster.Items.Add( ";諡榊ュ仙、画峩 " + strArray[0] + "/" + strArray[1] ); + } + else if (command == "#DELAY") + { + double nDELAY = (Convert.ToDouble(argument) * 1000.0); + + + this.listDELAY.Add(this.n蜀驛ィ逡ェ蜿キDELAY1to, new CDELAY() { n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キDELAY1to, n陦ィ險倅ク翫ョ逡ェ蜿キ = 0, nDELAY蛟、 = (int)nDELAY, delay_bmscroll_time = this.dbLastBMScrollTime, delay_bpm = this.dbNowBPM, delay_course = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ, delay_time = this.dbLastTime }); + + + //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九 + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xDC; + chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384); + chip.db逋コ螢ー譎ょ綾ms = this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キDELAY1to; + chip.fBMSCROLLTime = this.dbNowBMScollTime; + // 繝√ャ繝励r驟咲スョ縲 + + this.dbNowTime += nDELAY; + this.dbNowBMScollTime += nDELAY * this.dbNowBPM / 15000; + + this.listChip.Add(chip); + this.n蜀驛ィ逡ェ蜿キDELAY1to++; + } + + else if (command == "#GOGOSTART") + { + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x9E; + chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384); + chip.dbBPM = this.dbNowBPM; + chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1; + this.bGOGOTIME = true; + + // 繝√ャ繝励r驟咲スョ縲 + this.listChip.Add(chip); + } + else if (command == "#GOGOEND") + { + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x9F; + chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384); + chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.dbBPM = this.dbNowBPM; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1; + this.bGOGOTIME = false; + + // 繝√ャ繝励r驟咲スョ縲 + this.listChip.Add(chip); + } + else if (command == "#SECTION") + { + //蛻蟯:譚。莉カ繝ェ繧サ繝繝 + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xDD; + chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー - 1) * 384); + chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1; + chip.db逋コ螢ー譎ょ綾ms = this.dbNowTime; + // 繝√ャ繝励r驟咲スョ縲 + this.listChip.Add(chip); + } + else if (command == "#BRANCHSTART") + { + #region [ 隴憺擇蛻蟯舌ョ繝代シ繧ケ譁ケ豕輔r菴懊j逶エ縺 ] + this.b繝√ャ繝励′縺ゅk.Branch = true; + this.b譛蛻昴ョ蛻蟯舌〒縺ゅk = false; + this.b蛻蟯舌r荳蝗槭〒繧る幕蟋九@縺 = true; + + //蛻蟯:蛻蟯舌せ繧ソ繝シ繝 + E蛻蟯千ィョ鬘 e譚。莉カ; + + //譚。莉カ謨ー蛟、縲 + double[] nNum = new double[2]; + + //蜷榊燕縺ィ譚。莉カA縺ョ髢薙↓,縺檎┌縺縺ィ豁」蟶ク縺ォ蜍穂ス懊@縺ェ縺上↑繧.2020.04.23.akasoko26 + #region [ 蜷榊燕縺ィ譚。莉カA縺ョ髢薙↓,縺檎┌縺縺ィ豁」蟶ク縺ォ蜍穂ス懊@縺ェ縺上↑繧 ] + //遨コ逋ス繧貞炎髯、縺吶k縲 + argument = Regex.Replace(argument, @"\s", ""); + //2譁蟄礼岼縺,縺区焚蛟、縺九r繝√ぉ繝繧ッ + var IsNumber = bIsNumber(argument[1]); + //IsNumber == true 縺ァ縺ゅ▲縺溘i,縺檎┌縺縺ィ縺縺縺薙→縺ェ縺ョ縺ァ,繧2譁蟄礼岼縺ォ縺カ縺。霎シ繧繝サ繝サ繝サ + if (IsNumber) + argument = argument.Insert(1, ","); + #endregion + + var branchStartArgumentMatch = BranchStartArgumentRegex.Match(argument); + nNum[0] = Convert.ToDouble(branchStartArgumentMatch.Groups[2].Value); + nNum[1] = Convert.ToDouble(branchStartArgumentMatch.Groups[3].Value); + + switch (branchStartArgumentMatch.Groups[1].Value) + { + case "p": + e譚。莉カ = E蛻蟯千ィョ鬘.e邊セ蠎ヲ蛻蟯; + break; + case "r": + e譚。莉カ = E蛻蟯千ィョ鬘.e騾」謇灘蟯; + break; + case "s": + e譚。莉カ = E蛻蟯千ィョ鬘.e繧ケ繧ウ繧「蛻蟯; + break; + case "d": + e譚。莉カ = E蛻蟯千ィョ鬘.e螟ァ髻ウ隨ヲ縺ョ縺ソ邊セ蠎ヲ蛻蟯; + break; + default: + e譚。莉カ = E蛻蟯千ィョ鬘.e邊セ蠎ヲ蛻蟯; + break; + } + + #region [ 蛻蟯宣幕蟋区凾縺ョ繝√ャ繝玲ュ蝣ア繧定ィ倬鹸 ] + //迴セ蝨ィ縺ョ繝√ャ繝玲ュ蝣ア繧定ィ倬鹸縺吶k蠢隕√′縺ゅk縲 + this.t迴セ蝨ィ縺ョ繝√ャ繝玲ュ蝣ア繧定ィ倬鹸縺吶k(true); + #endregion + + #region [ 荳蟆冗ッ蜑阪ョ蛻蟯宣幕蟋気hip ] + //16蛻蜑阪↓謌サ縺呵ィ育ョ励↑繧薙°蠖薙※縺ォ縺励■繧縺繧√h縲ゅ(by Akasoko) + var c蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア = c荳蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア繧定ソ斐☆(listChip, e譚。莉カ); + CChip c蟆冗ッ蜑阪ョ騾」謇馴幕蟋倶ス咲スョ = null; + + var chip = new CChip(); + + if (e譚。莉カ == E蛻蟯千ィョ鬘.e騾」謇灘蟯) + { + /* + c蟆冗ッ蜑阪ョ騾」謇馴幕蟋倶ス咲スョ = c荳蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア繧定ソ斐☆(listChip, e譚。莉カ, true); + //騾」謇灘蟯舌ョ菴咲スョ繧貞咲樟 + //縺薙ョ險育ョ怜シ上ッ縺ゅ※縺ォ縺ェ繧峨↑縺縺ィ諤昴≧縺後√∪縺ゅ←縺縺励h縺繧ゅ↑縺繧薙〒縺薙l縺ァ + //縺ェ繧九∋縺城」謇薙ョ繧ア繝縺ョ驛ィ蛻縺ォ + var f騾」謇薙ョ髟キ縺輔ョ蜊雁 = (c蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア.n逋コ螢ー譎ょ綾ms - c蟆冗ッ蜑阪ョ騾」謇馴幕蟋倶ス咲スョ.n逋コ螢ー譎ょ綾ms) / 2.0f; + */ + + chip.n逋コ螢ー譎ょ綾ms = c蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア.n逋コ螢ー譎ょ綾ms; + } + else chip.n逋コ螢ー譎ょ綾ms = c蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア.n逋コ螢ー譎ょ綾ms; + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xDE; + chip.fNow_Measure_m = c蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア.fNow_Measure_m; + chip.fNow_Measure_s = c蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア.fNow_Measure_s; + + //繝弱シ繝 * 0.5蛻蠕後m縺ォ縺励※縲√ヮ繝シ繝縺梧ョ九i縺ェ縺繧医≧縺ォ縺吶k + chip.n蛻蟯先凾蛻サms = this.dbNowTime - ((15000.0 / this.dbNowBPM * (this.fNow_Measure_s / this.fNow_Measure_m)) * 0.5); + chip.e蛻蟯舌ョ遞ョ鬘 = e譚。莉カ; + chip.n譚。莉カ謨ー蛟、A = nNum[0];// list縺ォ霑ス蜉縺励※縺縺溘′莉墓ァ倥r螟画峩縲 + chip.n譚。莉カ謨ー蛟、B = nNum[1];// "" + chip.dbSCROLL = c蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア.dbSCROLL; + chip.dbBPM = c蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア.dbBPM; + this.listChip.Add(chip); + #endregion + + for (int i = 0; i < 3; i++) + IsBranchBarDraw[i] = true;//3繧ウ繝シ繧ケ蛻縺ョ鮟濶イ蟆剰ェャ邱夊。ィ遉コ繼ォ繝ゥ繝 + + IsEndedBranching = false; + #endregion + } + else if (command == "#N" || command == "#E" || command == "#M")//縺薙lCourse繧貞ィ驛ィ髮繧√※縺ゅ→縺九i蛻蟯舌&縺帙l縺ー縺縺莉カ + { + //髢句ァ区凾縺ョ諠蝣ア縺ォ繧サ繝繝 + t迴セ蝨ィ縺ョ繝√ャ繝玲ュ蝣ア繧定ィ倬鹸縺吶k(false); + + if (command == "#N") + this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = ECourse.eNormal;//蛻蟯:譎ョ騾夊ュ憺擇 + else if (command == "#E") + this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = ECourse.eExpert;//蛻蟯:邇莠コ隴憺擇 + else if (command == "#M") + this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = ECourse.eMaster;//蛻蟯:驕比ココ隴憺擇 + } + else if (command == "#LEVELHOLD") + { + var chip = new CChip(); + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xE1; + chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1; + chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1; + + this.listChip.Add(chip); + } + else if (command == "#BRANCHEND") + { + var GoBranch = new CChip(); + + //End逕ィ繝√Ε繝ウ繝阪Ν繧脱mpty縺九i蠑輔▲蠑オ縺」縺ヲ縺阪◆縲 + GoBranch.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x52; + GoBranch.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1; + GoBranch.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + GoBranch.fNow_Measure_m = this.fNow_Measure_m; + GoBranch.fNow_Measure_s = this.fNow_Measure_s; + GoBranch.dbSCROLL = this.dbNowScroll; + GoBranch.dbBPM = this.dbNowBPM; + GoBranch.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1; + + this.listChip.Add(GoBranch); + + //End譎ゅ↓繧るサ濶イ縺蟆冗ッ邱壹≠縺」縺溘∋シ + for (int i = 0; i < 3; i++) + IsBranchBarDraw[i] = true;//3繧ウ繝シ繧ケ蛻縺ョ鮟濶イ蟆剰ェャ邱夊。ィ遉コ繼ォ繝ゥ繝 + + IsEndedBranching = true; + } + else if (command == "#BARLINEOFF") + { + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xE0; + chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1; + chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime + 1; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1; + chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ; + this.bBARLINECUE[0] = 1; + + this.listChip.Add(chip); + } + else if (command == "#BARLINEON") + { + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xE0; + chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1; + chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime + 1; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 2; + chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ; + this.bBARLINECUE[0] = 0; + + this.listChip.Add(chip); + } + else if (command == "#LYRIC") + { + if (TJAPlayer3.r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID == CStage.E繧ケ繝繝シ繧ク.譖イ隱ュ縺ソ霎シ縺ソ)//襍キ蜍墓凾縺ォ驥阪◆縺上↑縺」縺ヲ縺励∪縺蝠城。後ョ菫ョ豁」逕ィ + this.listLyric.Add(this.pf豁瑚ゥ槭ヵ繧ゥ繝ウ繝.DrawPrivateFont(argument, TJAPlayer3.Skin.Game_Lyric_ForeColor, TJAPlayer3.Skin.Game_Lyric_BackColor)); + + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xF1; + chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 0; + chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ; + + // 繝√ャ繝励r驟咲スョ縲 + + this.listChip.Add(chip); + this.bLyrics = true; + } + else if (command == "#DIRECTION") + { + double dbSCROLL = Convert.ToDouble(argument); + this.n繧ケ繧ッ繝ュ繝シ繝ォ譁ケ蜷 = (int)dbSCROLL; + + //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九 + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xF2; + chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1; + chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 0; + chip.n繧ケ繧ッ繝ュ繝シ繝ォ譁ケ蜷 = (int)dbSCROLL; + chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ; + + // 繝√ャ繝励r驟咲スョ縲 + + this.listChip.Add(chip); + } + else if (command == "#SUDDEN") + { + strArray = argument.Split(chDelimiter); + WarnSplitLength("#SUDDEN", strArray, 2); + double db蜃コ迴セ譎ょ綾 = Convert.ToDouble(strArray[0]); + double db遘サ蜍募セ讖滓凾蛻サ = Convert.ToDouble(strArray[1]); + this.db蜃コ迴セ譎ょ綾 = db蜃コ迴セ譎ょ綾; + this.db遘サ蜍募セ讖滓凾蛻サ = db遘サ蜍募セ讖滓凾蛻サ; + + //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九 + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xF3; + chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1; + chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 0; + chip.n繝弱シ繝蜃コ迴セ譎ょ綾ms = (int)this.db蜃コ迴セ譎ょ綾; + chip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms = (int)this.db遘サ蜍募セ讖滓凾蛻サ; + chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ; + + // 繝√ャ繝励r驟咲スョ縲 + + this.listChip.Add(chip); + } + else if (command == "#JPOSSCROLL") + { + strArray = argument.Split(chDelimiter); + WarnSplitLength("#JPOSSCROLL", strArray, 3); + double db遘サ蜍墓凾蛻サ = Convert.ToDouble(strArray[0]); + int n遘サ蜍頻x = Convert.ToInt32(strArray[1]); + int n遘サ蜍墓婿蜷 = Convert.ToInt32(strArray[2]); + + //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九 + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xE2; + chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1; + chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 0; + chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ; + + // 繝√ャ繝励r驟咲スョ縲 + + this.listJPOSSCROLL.Add(this.n蜀驛ィ逡ェ蜿キJSCROLL1to, new CJPOSSCROLL() { n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キJSCROLL1to, n陦ィ險倅ク翫ョ逡ェ蜿キ = 0, db遘サ蜍墓凾髢 = db遘サ蜍墓凾蛻サ, n遘サ蜍戊キ晞屬px = n遘サ蜍頻x, n遘サ蜍墓婿蜷 = n遘サ蜍墓婿蜷 }); + this.listChip.Add(chip); + this.n蜀驛ィ逡ェ蜿キJSCROLL1to++; + } + else if (command == "#SENOTECHANGE") + { + FixSENote = int.Parse(argument); + IsEnabledFixSENote = true; + } + else if (command == "#NEXTSONG") + { + var delayTime = 6200.0; // 6.2遘偵ョ繧」繝ャ繧、 + //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九 + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x9B; + chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384) - 1; + chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + this.dbNowTime += delayTime; + this.dbNowBMScollTime += delayTime * this.dbNowBPM / 15000; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 0; + chip.n繧ウ繝シ繧ケ = this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ; + + // 繝√ャ繝励r驟咲スョ縲 + this.listChip.Add(chip); + + AddMusicPreTimeMs(); // 谿オ菴阪ョ蟷輔′髢九>縺ヲ縺九i縺ョ驕蟒カ縲 + + strArray = SplitComma(argument); // \,繧偵お繧ケ繧ア繝シ繝怜ヲ逅縺吶k繝。繧ス繝繝峨□縺槭▲ + + for (int i = listChip.Count - 1; i >= 0; i--) + { + if (listChip[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x11 && listChip[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x18) + { + if(DanSongs.Number != 0) + { + Array.Resize(ref this.pDan_LastChip, this.pDan_LastChip.Length + 1); + this.pDan_LastChip[DanSongs.Number - 1] = listChip[i]; + break; + } + } + } + + WarnSplitLength("#NEXTSONG", strArray, 8); + var dansongs = new DanSongs(); + dansongs.Title = strArray[0]; + dansongs.SubTitle = strArray[1]; + dansongs.Genre = strArray[2]; + dansongs.FileName = strArray[3]; + dansongs.ScoreInit = int.Parse(strArray[4]); + dansongs.ScoreDiff = int.Parse(strArray[5]); + + if (strArray.Length >= 7 && strArray[6] != "" && strArray[6] != null) + dansongs.Level = int.Parse(strArray[6]); + else if (strArray.Length < 7) + dansongs.Level = 10; + + if (strArray.Length >= 8 && strArray[7] != "" && strArray[7] != null) + dansongs.Difficulty = strConvertCourse(strArray[7]); + else if (strArray.Length < 8) + dansongs.Difficulty = 3; + + if (strArray.Length == 9 && strArray[8] != "" && strArray[8] != null) + dansongs.bTitleShow = bool.Parse(strArray[8]); + else if (strArray.Length < 9) + dansongs.bTitleShow = false; + + dansongs.Wave = new CWAV + { + n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キWAV1to, + n陦ィ險倅ク翫ョ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キWAV1to, + n繝√ャ繝励し繧、繧コ = this.n辟。髯千ョ。逅SIZE[this.n蜀驛ィ逡ェ蜿キWAV1to], + n菴咲スョ = this.n辟。髯千ョ。逅PAN[this.n蜀驛ィ逡ェ蜿キWAV1to], + SongVol = this.SongVol, + SongLoudnessMetadata = this.SongLoudnessMetadata, + str繝輔ぃ繧、繝ォ蜷 = CDTXCompanionFileFinder.FindFileName(this.str繝輔か繝ォ繝蜷, str繝輔ぃ繧、繝ォ蜷, dansongs.FileName), + str繧ウ繝。繝ウ繝域枚 = "TJA BGM" + }; + dansongs.Wave.SongLoudnessMetadata = LoudnessMetadataScanner.LoadForAudioPath(dansongs.Wave.str繝輔ぃ繧、繝ォ蜷); + List_DanSongs.Add(dansongs); + this.listWAV.Add(this.n蜀驛ィ逡ェ蜿キWAV1to, dansongs.Wave); + this.n蜀驛ィ逡ェ蜿キWAV1to++; + + var nextSongnextSongChip = new CChip(); + + nextSongnextSongChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x01; + nextSongnextSongChip.n逋コ螢ー菴咲スョ = 384; + nextSongnextSongChip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + nextSongnextSongChip.fNow_Measure_m = this.fNow_Measure_m; + nextSongnextSongChip.fNow_Measure_s = this.fNow_Measure_s; + nextSongnextSongChip.n謨エ謨ー蛟、 = 0x01; + nextSongnextSongChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1 + List_DanSongs.Count; + + this.listWAV[1].str繝輔ぃ繧、繝ォ蜷 = ""; + + // 繝√ャ繝励r驟咲スョ縲 + this.listChip.Add(nextSongnextSongChip); + + } + } + void t迴セ蝨ィ縺ョ繝√ャ繝玲ュ蝣ア繧定ィ倬鹸縺吶k(bool bInPut) + { + //2020.04.21 縺薙≧縺ェ縺」縺ヲ縺励∪縺」縺溘ョ縺ッ莉墓婿縺後↑縺縺ェ縲ゅ + if (bInPut) + { + #region [ 險倬鹸縺吶k ] + cBranchStart.dbTime = this.dbNowTime; + cBranchStart.dbSCROLL = this.dbNowScroll; + cBranchStart.dbSCROLLY = this.dbNowScrollY; + cBranchStart.dbBMScollTime = this.dbNowBMScollTime; + cBranchStart.dbBPM = this.dbNowBPM; + cBranchStart.fMeasure_s = this.fNow_Measure_s; + cBranchStart.fMeasure_m = this.fNow_Measure_m; + cBranchStart.nMeasureCount = this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー; + cBranchStart.db遘サ蜍募セ讖滓凾蛻サ = this.db遘サ蜍募セ讖滓凾蛻サ; + cBranchStart.db蜀咲函騾溷コヲ = this.db蜀咲函騾溷コヲ; + cBranchStart.db蜃コ迴セ譎ょ綾 = this.db蜃コ迴セ譎ょ綾; + #endregion + } + else + { + #region [ 險倬鹸縺励◆諠蝣ア繧誰ow~縺ォ驕ゥ蠢 ] + this.dbNowTime = cBranchStart.dbTime; + this.dbNowScroll = cBranchStart.dbSCROLL; + this.dbNowScrollY = cBranchStart.dbSCROLLY; + this.dbNowBMScollTime = cBranchStart.dbBMScollTime; + this.dbNowBPM = cBranchStart.dbBPM; + this.fNow_Measure_s = cBranchStart.fMeasure_s; + this.fNow_Measure_m = cBranchStart.fMeasure_m; + this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー = cBranchStart.nMeasureCount; + this.db遘サ蜍募セ讖滓凾蛻サ = cBranchStart.db遘サ蜍募セ讖滓凾蛻サ; + this.db蜀咲函騾溷コヲ = cBranchStart.db蜀咲函騾溷コヲ; + this.db蜃コ迴セ譎ょ綾 = cBranchStart.db蜃コ迴セ譎ょ綾; + #endregion + } + } + + /// + /// 荳蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア繧定ソ斐☆Method 2020.04.21.akasoko26 + /// + /// + /// + private CChip c荳蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア繧定ソ斐☆(List listChips, E蛻蟯千ィョ鬘 e蛻蟯千ィョ鬘, bool b蛻蟯仙燕縺ョ騾」謇馴幕蟋 = false) + { + //2020.04.20 c荳蟆冗ッ蜑阪ョ蟆冗ッ邱壽ュ蝣ア繧定ソ斐☆Method繧定ソス蜉 + //騾」謇灘蟯先凾縺ッ迴セ蝨ィ縺ョ蟆冗ッ莉・髯阪ョ騾」謇薙ョ邨ゅo繧企Κ蛻縺ョ譎ょ綾繧貞叙蠕励☆繧 + + int? nReturnChip = null; + + //--縺励※蜿門セ励@縺ェ縺縺ィ縺繧√hス槭ム繝。繝繝。汳 + for (int i = listChips.Count - 1; i >= 0; i--) + { + if (b蛻蟯仙燕縺ョ騾」謇馴幕蟋) + { + if (listChips[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15 || listChips[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x16) + { + if (nReturnChip == null) + nReturnChip = i; + + //ReturnChip縺系ull縺ァ縺ゅ▲縺溘i驕ゥ蠢 + } + } + else + { + var Flag = e蛻蟯千ィョ鬘 == E蛻蟯千ィョ鬘.e騾」謇灘蟯 ? 0x18 : 0x50; + + if (listChips[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == Flag) + { + if (nReturnChip == null) + nReturnChip = i; + //ReturnChip縺系ull縺ァ縺ゅ▲縺溘i驕ゥ蠢 + } + } + } + + //繧ゅ@縲]ReturnChip縺系ull縺縺」縺溘ilistChip縺ョCount - 1縺ォ繧サ繝繝医☆繧九 + return listChips[nReturnChip == null ? listChips.Count - 1 : (int)nReturnChip]; + } + + private void WarnSplitLength(string name, string[] strArray, int minimumLength) + { + if (strArray.Length < minimumLength) + { + Trace.TraceWarning( + $"蜻ス莉、 {name} 縺ョ繝代Λ繝。繝シ繧ソ縺瑚カウ繧翫∪縺帙s縲ょー代↑縺上→繧 {minimumLength} 縺、縺ョ繝代Λ繝。繝シ繧ソ縺悟ソ隕√〒縺吶 (迴セ蝨ィ縺ョ繝代Λ繝。繝シ繧ソ謨ー: {strArray.Length}). ({str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ})"); + } + } + + private void t蜈・蜉媽陦瑚ァ」譫占ュ憺擇_V4(string InputText) + { + if (!String.IsNullOrEmpty(InputText)) + { + int n譁蟄玲焚 = 16; + + //迴セ蝨ィ縺ョ繧ウ繝シ繧ケ縲∝ー冗ッ縺ォ蠖薙※縺ッ縺セ繧九b縺ョ繧偵Μ繧ケ繝医°繧画爾縺励※譁蟄玲焚繧定ソ斐☆縲 + for (int i = 0; i < this.listLine.Count; i++) + { + if (this.listLine[i].n蟆冗ッ逡ェ蜿キ == this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー && this.listLine[i].n繧ウ繝シ繧ケ == this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ) + { + n譁蟄玲焚 = this.listLine[i].n譁蟄玲焚; + } + + } + + if (InputText.StartsWith("#")) + { + this.t蜻ス莉、繧呈諺蜈・縺吶k(InputText); + return; + } + else + { + if (this.b蟆冗ッ邱壹r謖ソ蜈・縺励※縺繧 == false) + { + // 蟆冗ッ邱壹↓繧ゅd縺」縺ヲ縺ゅ£縺ェ縺縺ィ + // IsEndedBranching縺掲alse縺ァ1蝗 + // true縺ァ3蝗槭□繧3蝗 + for (int i = 0; i < (IsEndedBranching == true ? 3 : 1); i++) + { + CChip chip = new CChip(); + chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384); + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x50; + chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + chip.n謨エ謨ー蛟、 = this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー; + chip.n譁蟄玲焚 = n譁蟄玲焚; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー; + chip.dbBPM = this.dbNowBPM; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.IsEndedBranching = IsEndedBranching; + chip.dbSCROLL = this.dbNowScroll; + chip.dbSCROLL_Y = this.dbNowScrollY; + chip.fBMSCROLLTime = (float)this.dbNowBMScollTime; + + if (IsEndedBranching) + chip.n繧ウ繝シ繧ケ = (ECourse)i; + else + chip.n繧ウ繝シ繧ケ = n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ; + + if (this.bBARLINECUE[0] == 1) + { + chip.b蜿ッ隕 = false; + } + #region [ 菴懊j逶エ縺 ] + if (IsEndedBranching) + { + if (this.IsBranchBarDraw[i]) + chip.bBranch = true; + } + else + { + if (this.IsBranchBarDraw[(int)n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ]) + chip.bBranch = true; + } + #endregion + + this.listChip.Add(chip); + + #region [ 菴懊j逶エ縺 ] + if (IsEndedBranching) + this.IsBranchBarDraw[i] = false; + else this.IsBranchBarDraw[(int)n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ] = false; + #endregion + } + + + this.dbLastTime = this.dbNowTime; + this.b蟆冗ッ邱壹r謖ソ蜈・縺励※縺繧 = true; + + #region[ 諡咲キ壹メ繝繝励ユ繧ケ繝 ] + //1諡阪ョ譎る俣繧定ィ育ョ + double db1諡 = (60.0 / this.dbNowBPM) / 4.0; + //for繝ォ繝シ繝(諡肴焚) + for (int measure = 1; measure < this.fNow_Measure_s; measure++) + { + CChip hakusen = new CChip(); + hakusen.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー) * 384); + hakusen.n逋コ螢ー譎ょ綾ms = (int)(this.dbNowTime + (((db1諡 * 4.0)) * measure) * 1000.0); + hakusen.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x51; + //hakusen.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + hakusen.fBMSCROLLTime = this.dbNowBMScollTime; + hakusen.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー; + hakusen.n謨エ謨ー蛟、 = 0; + hakusen.dbBPM = this.dbNowBPM; + hakusen.dbSCROLL = this.dbNowScroll; + hakusen.fNow_Measure_m = this.fNow_Measure_m; + hakusen.fNow_Measure_s = this.fNow_Measure_s; + hakusen.dbSCROLL_Y = this.dbNowScrollY; + hakusen.n繧ウ繝シ繧ケ = n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ; + + this.listChip.Add(hakusen); + //--蜈ィ縺ヲ縺ョ諡咲キ壹ョ譎る俣繧貞コ蜉帙☆繧-- + //Trace.WriteLine( string.Format( "|| {0,3:##0} Time:{1} Beat:{2}", this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー, hakusen.n逋コ螢ー譎ょ綾ms, measure ) ); + //-------------------------------- + } + + #endregion + + } + + for (int n = 0; n < InputText.Length; n++) + { + if (InputText.Substring(n, 1) == ",") + { + this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー++; + this.b蟆冗ッ邱壹r謖ソ蜈・縺励※縺繧 = false; + return; + } + + if (InputText.Substring(0, 1) == "F") + { + bool bTest = true; + } + + + int nObjectNum = this.CharConvertNote(InputText.Substring(n, 1)); + + if (nObjectNum != 0) + { + if ((nObjectNum >= 5 && nObjectNum <= 7) || nObjectNum == 9) + { + if (nNowRoll != 0) + { + this.dbNowTime += (15000.0 / this.dbNowBPM * (this.fNow_Measure_s / this.fNow_Measure_m) * (16.0 / n譁蟄玲焚)); + this.dbNowBMScollTime += (double)((this.dbBarLength) * (16.0 / n譁蟄玲焚)); + continue; + } + else + { + this.nNowRollCount = listChip.Count; + nNowRoll = nObjectNum; + } + } + + // IsEndedBranching縺掲alse縺ァ1蝗 + // true縺ァ3蝗槭□繧3蝗 + for (int i = 0; i < (IsEndedBranching == true ? 3 : 1); i++) + { + var chip = new CChip(); + chip.IsMissed = false; + chip.bHit = false; + chip.b蜿ッ隕 = true; + chip.bShow = true; + chip.bShowRoll = true; + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x10 + nObjectNum; + //chip.n逋コ螢ー菴咲スョ = (this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー * 384) + ((384 * n) / n譁蟄玲焚); + chip.n逋コ螢ー菴咲スョ = (int)((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー * 384.0) + ((384.0 * n) / n譁蟄玲焚)); + chip.db逋コ螢ー菴咲スョ = this.dbNowTime; + chip.n逋コ螢ー譎ょ綾ms = (int)this.dbNowTime; + //chip.fBMSCROLLTime = (float)(( this.dbBarLength ) * (16.0f / this.n蜷蟆冗ッ縺ョ譁蟄玲焚[this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー])); + chip.fBMSCROLLTime = (float)this.dbNowBMScollTime; + chip.n謨エ謨ー蛟、 = nObjectNum; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1; + chip.IsEndedBranching = IsEndedBranching; + chip.fNow_Measure_m = this.fNow_Measure_m; + chip.fNow_Measure_s = this.fNow_Measure_s; + chip.dbBPM = this.dbNowBPM; + chip.dbSCROLL = this.dbNowScroll; + chip.dbSCROLL_Y = this.dbNowScrollY; + chip.n繧ケ繧ッ繝ュ繝シ繝ォ譁ケ蜷 = this.n繧ケ繧ッ繝ュ繝シ繝ォ譁ケ蜷; + + if (IsEndedBranching) + chip.n繧ウ繝シ繧ケ = (ECourse)i; + else + chip.n繧ウ繝シ繧ケ = n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ; + + chip.n蛻蟯仙屓謨ー = this.n蜀驛ィ逡ェ蜿キBRANCH1to; + chip.e讌ス蝎ィ繝代シ繝 = E讌ス蝎ィ繝代シ繝.TAIKO; + chip.n繝弱シ繝蜃コ迴セ譎ょ綾ms = (int)(this.db蜃コ迴セ譎ょ綾 * 1000.0); + chip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms = (int)(this.db遘サ蜍募セ讖滓凾蛻サ * 1000.0); + chip.nPlayerSide = this.nPlayerSide; + chip.bGOGOTIME = this.bGOGOTIME; + + if (nObjectNum == 7 || nObjectNum == 9) + { + //this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ繧痴witch縺ァ蛻蟯舌@縺ヲ縺縺溘◆繧鬚ィ闊ケ縺ョ蛟、縺後≧縺セ縺丞牡繧雁ス薙※繧峨l縺ヲ縺縺ェ縺 2020.04.21 akasoko26 + + switch (chip.n繧ウ繝シ繧ケ) + { + case ECourse.eNormal: + if (this.listBalloon_Normal.Count == 0) + { + chip.nBalloon = 5; + break; + } + + if (this.listBalloon_Normal.Count > this.listBalloon_Normal_謨ー蛟、邂。逅) + { + chip.nBalloon = this.listBalloon_Normal[this.listBalloon_Normal_謨ー蛟、邂。逅]; + this.listBalloon_Normal_謨ー蛟、邂。逅++; + break; + } + //else if( this.listBalloon.Count != 0 ) + //{ + // chip.nBalloon = this.listBalloon[ this.listBalloon_Normal_謨ー蛟、邂。逅 ]; + // this.listBalloon_Normal_謨ー蛟、邂。逅++; + // break; + //} + break; + case ECourse.eExpert: + if (this.listBalloon_Expert.Count == 0) + { + chip.nBalloon = 5; + break; + } + + if (this.listBalloon_Expert.Count > this.listBalloon_Expert_謨ー蛟、邂。逅) + { + chip.nBalloon = this.listBalloon_Expert[this.listBalloon_Expert_謨ー蛟、邂。逅]; + this.listBalloon_Expert_謨ー蛟、邂。逅++; + break; + } + //else if( this.listBalloon.Count != 0 ) + //{ + // chip.nBalloon = this.listBalloon[ this.listBalloon_Normal_謨ー蛟、邂。逅 ]; + // this.listBalloon_Normal_謨ー蛟、邂。逅++; + // break; + //} + break; + case ECourse.eMaster: + if (this.listBalloon_Master.Count == 0) + { + chip.nBalloon = 5; + break; + } + + if (this.listBalloon_Master.Count > this.listBalloon_Master_謨ー蛟、邂。逅) + { + chip.nBalloon = this.listBalloon_Master[this.listBalloon_Master_謨ー蛟、邂。逅]; + this.listBalloon_Master_謨ー蛟、邂。逅++; + break; + } + //else if( this.listBalloon.Count != 0 ) + //{ + // chip.nBalloon = this.listBalloon[ this.listBalloon_Normal_謨ー蛟、邂。逅 ]; + // this.listBalloon_Normal_謨ー蛟、邂。逅++; + // break; + //} + break; + } + } + if (nObjectNum == 8) + { + chip.n繝弱シ繝邨ゆコ菴咲スョ = (this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー * 384) + ((384 * n) / n譁蟄玲焚); + chip.n繝弱シ繝邨ゆコ譎ょ綾ms = (int)this.dbNowTime; + chip.fBMSCROLLTime_end = (float)this.dbNowBMScollTime; + + chip.n繝弱シ繝蜃コ迴セ譎ょ綾ms = listChip[nNowRollCount].n繝弱シ繝蜃コ迴セ譎ょ綾ms; + chip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms = listChip[nNowRollCount].n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms; + + chip.n騾」謇馴浹隨ヲState = nNowRoll; + listChip[nNowRollCount].n繝弱シ繝邨ゆコ菴咲スョ = (this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー * 384) + ((384 * n) / n譁蟄玲焚); + listChip[nNowRollCount].n繝弱シ繝邨ゆコ譎ょ綾ms = (int)this.dbNowTime; + listChip[nNowRollCount].fBMSCROLLTime_end = (int)this.dbNowBMScollTime; + //listChip[ nNowRollCount ].dbBPM = this.dbNowBPM; + //listChip[ nNowRollCount ].dbSCROLL = this.dbNowSCROLL; + nNowRoll = 0; + //continue; + } + + if (IsEnabledFixSENote) + { + chip.IsFixedSENote = true; + chip.nSenote = FixSENote - 1; + } + + #region[ 蝗コ螳壹&繧後k遞ョ鬘槭ョsenotes縺ッ縺薙%縺ァ險ュ螳壹@縺ヲ縺翫¥縲 ] + switch (nObjectNum) + { + case 3: + chip.nSenote = 5; + break; + case 4: + chip.nSenote = 6; + break; + case 5: + chip.nSenote = 7; + break; + case 6: + chip.nSenote = 0xA; + break; + case 7: + chip.nSenote = 0xB; + break; + case 8: + chip.nSenote = 0xC; + break; + case 9: + chip.nSenote = 0xD; + break; + case 10: + chip.nSenote = 0xE; + break; + case 11: + chip.nSenote = 0xF; + break; + } + #endregion + + if (nObjectNum < 5) + { + #region [ 菴懊j逶エ縺 ] + //隴憺擇蛻蟯舌′縺ェ縺隴憺擇縺ァ繧ょ、縺ッ蜉邂励&繧後※縺励∪縺縺後@繧縺ゅ↑縺 + //蛻蟯舌r髢句ァ九@縺ェ縺髢薙ッ蜈ア騾夊ュ憺擇縺ィ縺励※縺ソ縺ェ縺吶 + if (IsEndedBranching) + this.n繝弱シ繝謨ー_Branch[i]++; + else this.n繝弱シ繝謨ー_Branch[(int)chip.n繧ウ繝シ繧ケ]++; + + if (!IsEndedBranching && !this.b蛻蟯舌r荳蝗槭〒繧る幕蟋九@縺) + { + //IsEndedBranching==false = forloop縺瑚。後o繧後※縺縺ェ縺縺ィ縺阪ョ縺ソ + for (int l = 0; l < 3; l++) + this.n繝弱シ繝謨ー_Branch[l]++; + } + + + if(this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ == (int)Difficulty.Dan) + this.nDan_NotesCount[DanSongs.Number - 1]++; + + this.n繝弱シ繝謨ー[3]++; + #endregion + } + else if (nObjectNum == 7) + { + //鬚ィ闊ケ縺ッ縺薙ョ縺セ縺セ縺ァ繧よゥ溯ス縺励※縺繧九ョ縺ァ菴輔b縺励↑縺. + + if (this.b譛蛻昴ョ蛻蟯舌〒縺ゅk == false) + this.n鬚ィ闊ケ謨ー[(int)this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ]++; + else + this.n鬚ィ闊ケ謨ー[3]++; + } + + Array.Resize(ref nDan_NotesCount, nDan_NotesCount.Length + 1); + this.listChip.Add(chip); + + if(IsEndedBranching) + this.listChip_Branch[i].Add(chip); + else + this.listChip_Branch[(int)chip.n繧ウ繝シ繧ケ].Add(chip); + } + } + + if (IsEnabledFixSENote) IsEnabledFixSENote = false; + + this.dbLastTime = this.dbNowTime; + this.dbLastBMScrollTime = this.dbNowBMScollTime; + this.dbNowTime += (15000.0 / this.dbNowBPM * (this.fNow_Measure_s / this.fNow_Measure_m) * (16.0 / n譁蟄玲焚)); + this.dbNowBMScollTime += (((this.fNow_Measure_s / this.fNow_Measure_m)) * (16.0 / (double)n譁蟄玲焚)); + } + } + } + } + + /// + /// 髮」譏灘コヲ縺斐→縺ォ繧医▲縺ヲ螟峨o繧九倥ャ繝蛟、繧定ェュ縺ソ霎シ繧縲 + /// (BALLOON縺ェ縺ゥ縲) + /// + /// + private void t髮」譏灘コヲ蛻・繝倥ャ繝(string InputText) + { + if (TJAPlayer3.actEnumSongs.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + if (InputText.Equals("#HBSCROLL") && TJAPlayer3.ConfigIni.b繧ケ繧ッ繝ュ繝シ繝ォ繝「繝シ繝峨r荳頑嶌縺 == false) + { + TJAPlayer3.ConfigIni.eScrollMode = EScrollMode.HBSCROLL; + } + if (InputText.Equals("#BMSCROLL") && TJAPlayer3.ConfigIni.b繧ケ繧ッ繝ュ繝シ繝ォ繝「繝シ繝峨r荳頑嶌縺 == false) + { + TJAPlayer3.ConfigIni.eScrollMode = EScrollMode.BMSCROLL; + } + } + + string[] strArray = InputText.Split(new char[] { ':' }); + string strCommandName = ""; + string strCommandParam = ""; + + if (strArray.Length == 2) + { + strCommandName = strArray[0].Trim(); + strCommandParam = strArray[1].Trim(); + } + + void ParseOptionalInt16(Action setValue) + { + this.ParseOptionalInt16(strCommandName, strCommandParam, setValue); + } + + if (strCommandName.Equals("BALLOON") || strCommandName.Equals("BALLOONNOR")) + { + ParseBalloon(strCommandParam, this.listBalloon_Normal); + } + else if (strCommandName.Equals("BALLOONEXP")) + { + ParseBalloon(strCommandParam, this.listBalloon_Expert); + //tbBALLOON.Text = strCommandParam; + } + else if (strCommandName.Equals("BALLOONMAS")) + { + ParseBalloon(strCommandParam, this.listBalloon_Master); + //tbBALLOON.Text = strCommandParam; + } + else if (strCommandName.Equals("SCOREMODE")) + { + ParseOptionalInt16(value => this.nScoreModeTmp = value); + } + else if (strCommandName.Equals("SCOREINIT")) + { + if (!string.IsNullOrEmpty(strCommandParam)) + { + string[] scoreinit = strCommandParam.Split(','); + + this.ParseOptionalInt16("SCOREINIT first value", scoreinit[0], value => + { + this.nScoreInit[0, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = value; + this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬0, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = true; + }); + + if (scoreinit.Length == 2) + { + this.ParseOptionalInt16("SCOREINIT second value", scoreinit[1], value => + { + this.nScoreInit[1, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = value; + this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬2, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = true; + }); + } + } + } + else if (strCommandName.Equals("SCOREDIFF")) + { + ParseOptionalInt16(value => + { + this.nScoreDiff[this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = value; + this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬1, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = true; + }); + } + + //if( this.nScoreModeTmp == 99 ) //2017.01.28 DD SCOREMODE繧貞・蜉帙@縺ヲ縺縺ェ縺蝣エ蜷医ョ縺ソConfig縺ァ險ュ螳壹@縺溘Δ繝シ繝峨↓縺吶k + //{ + // this.nScoreModeTmp = CDTXMania.ConfigIni.nScoreMode; + //} + //if( CDTXMania.ConfigIni.nScoreMode == 3 && !this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬 2, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ ] ){ //2017.06.04 kairera0467 + // this.nScoreModeTmp = 3; + //} + + + + else if (strCommandName.Equals("SCOREMODE")) + { + if (!string.IsNullOrEmpty(strCommandParam)) + { + this.nScoreModeTmp = Convert.ToInt16(strCommandParam); + } + } + else if (strCommandName.Equals("SCOREINIT")) + { + if (!string.IsNullOrEmpty(strCommandParam)) + { + string[] scoreinit = strCommandParam.Split(','); + + this.nScoreInit[0, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = Convert.ToInt16(scoreinit[0]); + this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬0, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = true; + if (scoreinit.Length == 2) + { + this.nScoreInit[1, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = Convert.ToInt16(scoreinit[1]); + this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬2, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = true; + } + } + } + else if (strCommandName.Equals("SCOREDIFF")) + { + if (!string.IsNullOrEmpty(strCommandParam)) + { + this.nScoreDiff[this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = Convert.ToInt16(strCommandParam); + this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬1, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = true; + } + } + if (this.nScoreModeTmp == 99) //2017.01.28 DD SCOREMODE繧貞・蜉帙@縺ヲ縺縺ェ縺蝣エ蜷医ョ縺ソConfig縺ァ險ュ螳壹@縺溘Δ繝シ繝峨↓縺吶k + { + this.nScoreModeTmp = TJAPlayer3.ConfigIni.nScoreMode; + } + if (TJAPlayer3.ConfigIni.nScoreMode == 3 && !this.b驟咲せ縺梧欠螳壹&繧後※縺繧擬2, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ]) + { //2017.06.04 kairera0467 + this.nScoreModeTmp = 3; + } + } + + private void tDanExamLoad(string input) + { + string[] strArray = input.Split(new char[] { ':' }); + string strCommandName = ""; + string strCommandParam = ""; + + if (strArray.Length == 2) + { + strCommandName = strArray[0].Trim(); + strCommandParam = strArray[1].Trim(); + } + + if (strCommandName.Equals("EXAM1") || strCommandName.Equals("EXAM2") || strCommandName.Equals("EXAM3") || strCommandName.Equals("EXAM4")) + { + if (!string.IsNullOrEmpty(strCommandParam)) + { + Exam.Type examType; + int[] examValue; + Exam.Range examRange; + var splitExam = strCommandParam.Split(','); + switch (splitExam[0]) + { + case "g": + examType = Exam.Type.Gauge; + break; + case "jp": + examType = Exam.Type.JudgePerfect; + break; + case "jg": + examType = Exam.Type.JudgeGood; + break; + case "jb": + examType = Exam.Type.JudgeBad; + break; + case "s": + examType = Exam.Type.Score; + break; + case "r": + examType = Exam.Type.Roll; + break; + case "h": + examType = Exam.Type.Hit; + break; + case "c": + examType = Exam.Type.Combo; + break; + default: + examType = Exam.Type.Gauge; + break; + } + try + { + examValue = new int[] { int.Parse(splitExam[1]), int.Parse(splitExam[2]) }; + } + catch (Exception) + { + examValue = new int[] { 100, 100 }; + } + switch (splitExam[3]) + { + case "m": + examRange = Exam.Range.More; + break; + case "l": + examRange = Exam.Range.Less; + break; + default: + examRange = Exam.Range.More; + break; + } + + if(Dan_C[int.Parse(strCommandName.Substring(4)) - 1] == null) + Dan_C[int.Parse(strCommandName.Substring(4)) - 1] = new Dan_C(examType, examValue, examRange); + + List_DanSongs[DanSongs.Number - 1].Dan_C[int.Parse(strCommandName.Substring(4)) - 1] = new Dan_C(examType, examValue, examRange); + } + } + } + + private void ParseOptionalInt16(string name, string unparsedValue, Action setValue) + { + if (string.IsNullOrEmpty(unparsedValue)) + { + return; + } + + if (short.TryParse(unparsedValue, out var value)) + { + setValue(value); + } + else + { + Trace.TraceWarning($"蜻ス莉、蜷: {name} 縺ョ繝代Λ繝。繝シ繧ソ縺ョ蛟、縺梧ュ」縺励¥縺ェ縺縺薙→繧呈、懃衍縺励∪縺励◆縲ょ、: {unparsedValue} ({str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ})"); + } + } + + + private void ParseBalloon(string strCommandParam, List listBalloon) + { + string[] strParam = strCommandParam.Split(','); + for (int n = 0; n < strParam.Length; n++) + { + int n謇捺焚; + try + { + if (strParam[n] == null || strParam[n] == "") + break; + + n謇捺焚 = Convert.ToInt32(strParam[n]); + } + catch (Exception ex) + { + Trace.TraceError($"縺翫d?繧ィ繝ゥ繝シ縺悟コ縺溘h縺縺ァ縺吶ゅ♀蜈讒倥 ({str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ})"); + Trace.TraceError(ex.ToString()); + Trace.TraceError("萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (95327158-4e83-4fa9-b5e9-ad3c3d4c2a22)"); + break; + } + + listBalloon.Add(n謇捺焚); + } + } + private void t蜈・蜉媽陦瑚ァ」譫舌倥ャ繝(string InputText) + { + //繧縺ケ繝シ縲ょ磯ュ縺ォ繧ウ繝。繝ウ繝郁。後≠縺」縺溘i繧縺ー縺繧繧薙 + string[] strArray = InputText.Split(new char[] { ':' }); + string strCommandName = ""; + string strCommandParam = ""; + + if (InputText.StartsWith("#BRANCHSTART")) + { + //2015.08.18 kairera0467 + //譛ャ譚・縺ッ繝倥ャ繝蜻ス莉、縺ァ縺ッ縺ゅj縺セ縺帙s縺後髮」譏灘コヲ縺斐→縺ォ驕輔≧鬆逶ョ縺ェ縺ョ縺ァ縺薙%縺ァ隱ュ縺ソ霎シ縺セ縺帙∪縺吶 + //Length縺ョ繝√ぉ繝繧ッ繧偵&繧後k蜑阪↓縺ォif譁繧貞・繧後※縺縺セ縺吶 + this.bHasBranch[this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = true; + } + + //縺セ縺壹ッ縲:縲阪〒Split縺励※蜑イ繧雁ス薙※繧九 + if (strArray.Length == 2) + { + strCommandName = strArray[0].Trim(); + strCommandParam = strArray[1].Trim(); + } + else if (strArray.Length > 2) + { + //strArray縺2縺倥c縺ェ縺蝣エ蜷医√倥ャ繝縺ョSplit繧帝壹@縺ヲ縺縺ェ縺蜿ッ閭ス諤ァ縺後≠繧九 + //縺薙ョ蜃ヲ逅閾ェ菴薙ッ縲荊蜈・蜉帙阪r謾ケ騾縺励◆繧ゅョ縲4TART縺ァSplit縺励※縺縺ェ縺遲峨∽ク驛ィ縺ョ蜃ヲ逅縺檎焚縺ェ繧九 + + #region[繝倥ャ繝] + InputText = InputText.Replace(Environment.NewLine, "\n"); //謾ケ陦梧枚蟄励r蛻・縺ョ譁蟄怜励↓蟾ョ縺玲崛縺医 + InputText = InputText.Replace('\t', ' '); //菴輔ョ譁蟄励°遏・繧峨↑縺縺代←繧ケ繝壹シ繧ケ縺ォ蟾ョ縺玲崛縺医 + InputText = InputText + "\n"; + + string[] strDelimiter2 = { "\n" }; + strArray = InputText.Split(strDelimiter2, StringSplitOptions.RemoveEmptyEntries); + + + strArray = strArray[0].Split(new char[] { ':' }); + WarnSplitLength("Header Name & Value", strArray, 2); + + strCommandName = strArray[0].Trim(); + strCommandParam = strArray[1].Trim(); + + #endregion + //lblMessage.Text = "縺翫d?strArray縺ョLength縺2縺倥c縺ェ縺繧医≧縺ァ縺吶ュ縲ゅ♀蜈讒倥"; + } + + void ParseOptionalInt16(Action setValue) + { + this.ParseOptionalInt16(strCommandName, strCommandParam, setValue); + } + + //繝代Λ繝。繝シ繧ソ繧貞蛻・縲√◎縺薙°繧牙牡繧雁ス薙※縺ヲ縺縺阪∪縺吶 + if (strCommandName.Equals("TITLE")) + { + //this.TITLE = strCommandParam; + var subTitle = ""; + for (int i = 0; i < strArray.Length; i++) + { + subTitle += strArray[i]; + } + this.TITLE = subTitle.Substring(5); + //tbTitle.Text = strCommandParam; + } + if (strCommandName.Equals("SUBTITLE")) + { + if (strCommandParam.StartsWith("--")) + { + //this.SUBTITLE = strCommandParam.Remove( 0, 2 ); + var subTitle = ""; + for (int i = 0; i < strArray.Length; i++) + { + subTitle += strArray[i]; + } + this.SUBTITLE = subTitle.Substring(10); + } + else if (strCommandParam.StartsWith("++")) + { + // //this.TITLE += strCommandParam.Remove( 0, 2 ); //縺薙ョ縺セ縺セ縺縺ィ驕ク譖イ逕サ髱「縺ョ陦ィ遉コ縺後≧縺セ縺上>縺九↑縺縲 + //this.SUBTITLE = strCommandParam.Remove( 0, 2 ); + var subTitle = ""; + for (int i = 0; i < strArray.Length; i++) + { + subTitle += strArray[i]; + } + this.SUBTITLE = subTitle.Substring(10); + } + } + else if (strCommandName.Equals("LEVEL")) + { + var level = (int)Convert.ToDouble(strCommandParam); + this.LEVEL.Drums = level; + this.LEVEL.Taiko = level; + this.LEVELtaiko[this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = level; + } + else if (strCommandName.Equals("BPM")) + { + if (strCommandParam.IndexOf(",") != -1) + strCommandParam = strCommandParam.Replace(',', '.'); + + double dbBPM = Convert.ToDouble(strCommandParam); + this.BPM = dbBPM; + this.BASEBPM = dbBPM; + this.dbNowBPM = dbBPM; + + this.listBPM.Add(this.n蜀驛ィ逡ェ蜿キBPM1to - 1, new CBPM() { n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キBPM1to - 1, n陦ィ險倅ク翫ョ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キBPM1to - 1, dbBPM蛟、 = dbBPM, }); + this.n蜀驛ィ逡ェ蜿キBPM1to++; + + + //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九 + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x03; + chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー - 1) * 384); + chip.n謨エ謨ー蛟、 = 0x00; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = 1; + + this.listChip.Add(chip); + //tbBPM.Text = strCommandParam; + } + else if (strCommandName.Equals("WAVE")) + { + if (strBGM_PATH != null) + { + Trace.TraceWarning($"{nameof(CDTX)} is ignoring an extra WAVE header in {this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ}"); + } + else + { + this.strBGM_PATH = CDTXCompanionFileFinder.FindFileName(this.str繝輔か繝ォ繝蜷, str繝輔ぃ繧、繝ォ蜷, strCommandParam); + //tbWave.Text = strCommandParam; + if (this.listWAV != null) + { + // 2018-08-27 twopointzero - DO attempt to load (or queue scanning) loudness metadata here. + // TJAP3 is either launching, enumerating songs, or is about to + // begin playing a song. If metadata is available, we want it now. + // If is not yet available then we wish to queue scanning. + var absoluteBgmPath = Path.Combine(this.str繝輔か繝ォ繝蜷, this.strBGM_PATH); + this.SongLoudnessMetadata = LoudnessMetadataScanner.LoadForAudioPath(absoluteBgmPath); + + var wav = new CWAV() + { + n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キWAV1to, + n陦ィ險倅ク翫ョ逡ェ蜿キ = 1, + n繝√ャ繝励し繧、繧コ = this.n辟。髯千ョ。逅SIZE[this.n蜀驛ィ逡ェ蜿キWAV1to], + n菴咲スョ = this.n辟。髯千ョ。逅PAN[this.n蜀驛ィ逡ェ蜿キWAV1to], + SongVol = this.SongVol, + SongLoudnessMetadata = this.SongLoudnessMetadata, + str繝輔ぃ繧、繝ォ蜷 = this.strBGM_PATH, + str繧ウ繝。繝ウ繝域枚 = "TJA BGM", + }; + + this.listWAV.Add(this.n蜀驛ィ逡ェ蜿キWAV1to, wav); + this.n蜀驛ィ逡ェ蜿キWAV1to++; + } + } + } + else if (strCommandName.Equals("OFFSET") && !string.IsNullOrEmpty(strCommandParam)) + { + this.nOFFSET = (int)(Convert.ToDouble(strCommandParam) * 1000); + this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk = this.nOFFSET < 0 ? true : false; + + this.listBPM[0].bpm_change_bmscroll_time = -2000 * this.dbNowBPM / 15000; + if (this.bOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk == true) + this.nOFFSET = this.nOFFSET * -1; //OFFSET縺ッ遘偵r蜉邂励☆繧九ョ縺ァ縲∝ソ縺壽ュ」縺ョ謨ー縺ォ縺吶k縺薙→縲 + //tbOFFSET.Text = strCommandParam; + } + else if (strCommandName.Equals("MOVIEOFFSET")) + { + this.nMOVIEOFFSET = (int)(Convert.ToDouble(strCommandParam) * 1000); + this.bMOVIEOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk = this.nMOVIEOFFSET < 0 ? true : false; + + if (this.bMOVIEOFFSET縺ョ蛟、縺後槭う繝翫せ縺ァ縺ゅk == true) + this.nMOVIEOFFSET = this.nMOVIEOFFSET * -1; //OFFSET縺ッ遘偵r蜉邂励☆繧九ョ縺ァ縲∝ソ縺壽ュ」縺ョ謨ー縺ォ縺吶k縺薙→縲 + //tbOFFSET.Text = strCommandParam; + } + #region[遘サ蜍補剃ク榊キ蜷医′襍キ縺薙k縺ョ縺ァ縺薙%繧ゆク蠢懷セゥ豢サ縺輔○縺ヲ縺翫¥] + else if (strCommandName.Equals("BALLOON") || strCommandName.Equals("BALLOONNOR")) + { + ParseBalloon(strCommandParam, this.listBalloon_Normal); + } + else if (strCommandName.Equals("BALLOONEXP")) + { + ParseBalloon(strCommandParam, this.listBalloon_Expert); + //tbBALLOON.Text = strCommandParam; + } + else if (strCommandName.Equals("BALLOONMAS")) + { + ParseBalloon(strCommandParam, this.listBalloon_Master); + //tbBALLOON.Text = strCommandParam; + } + else if (strCommandName.Equals("SCOREMODE")) + { + ParseOptionalInt16(value => this.nScoreModeTmp = value); + } + else if (strCommandName.Equals("SCOREINIT")) + { + if (!string.IsNullOrEmpty(strCommandParam)) + { + string[] scoreinit = strCommandParam.Split(','); + + this.ParseOptionalInt16("SCOREINIT first value", scoreinit[0], value => + { + this.nScoreInit[0, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = value; + }); + + if (scoreinit.Length == 2) + { + this.ParseOptionalInt16("SCOREINIT second value", scoreinit[1], value => + { + this.nScoreInit[1, this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = value; + }); + } + } + } + else if (strCommandName.Equals("GAUGEINCR")) + { + if (!string.IsNullOrEmpty(strCommandParam)) + { + switch (strCommandParam.ToLower()) + { + case "normal": + GaugeIncreaseMode = GaugeIncreaseMode.Normal; + break; + case "floor": + GaugeIncreaseMode = GaugeIncreaseMode.Floor; + break; + case "round": + GaugeIncreaseMode = GaugeIncreaseMode.Round; + break; + case "ceiling": + GaugeIncreaseMode = GaugeIncreaseMode.Ceiling; + break; + case "notfix": + GaugeIncreaseMode = GaugeIncreaseMode.NotFix; + break; + default: + GaugeIncreaseMode = GaugeIncreaseMode.Normal; + break; + } + } + } + else if (strCommandName.Equals("SCOREDIFF")) + { + ParseOptionalInt16(value => this.nScoreDiff[this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ] = value); + } + #endregion + else if (strCommandName.Equals("SONGVOL") && !string.IsNullOrEmpty(strCommandParam)) + { + this.SongVol = Convert.ToInt32(strCommandParam).Clamp(CSound.MinimumSongVol, CSound.MaximumSongVol); + + foreach (var kvp in this.listWAV) + { + kvp.Value.SongVol = this.SongVol; + } + } + else if (strCommandName.Equals("SEVOL")) + { + //tbSeVol.Text = strCommandParam; + } + else if (strCommandName.Equals("COURSE")) + { + if (!string.IsNullOrEmpty(strCommandParam)) + { + //this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ = Convert.ToInt16( strCommandParam ); + this.n蜿らァ荳ュ縺ョ髮」譏灘コヲ = this.strConvertCourse(strCommandParam); + } + } + + else if (strCommandName.Equals("HEADSCROLL")) + { + //譁ー螳夂セゥ:蛻晄悄繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ險ュ螳(縺ィ縺縺繧医j縺薙ョ繧キ繧ケ繝繝縺ォ蜷医o縺帙k縺ォ縺ッ蠢鬆医) + //縺ゥ縺縺励※繧ゆク逡ェ譛蛻昴↓1蟆冗ッ謖ソ蜈・縺輔l繧九°繧峨√%縺縺吶k縺励°縺ェ縺九▲縺溘s縺___ + + this.dbScrollSpeed = Convert.ToDouble(strCommandParam); + + this.listSCROLL.Add(this.n蜀驛ィ逡ェ蜿キSCROLL1to, new CSCROLL() { n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キSCROLL1to, n陦ィ險倅ク翫ョ逡ェ蜿キ = 0, dbSCROLL蛟、 = this.dbScrollSpeed, }); + + + //繝√ャ繝苓ソス蜉縺励※蜑イ繧願セシ繧薙〒縺ソ繧九 + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0x9D; + chip.n逋コ螢ー菴咲スョ = ((this.n迴セ蝨ィ縺ョ蟆冗ッ謨ー - 2) * 384); + chip.n謨エ謨ー蛟、 = 0x00; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キSCROLL1to; + chip.dbSCROLL = this.dbScrollSpeed; + + // 繝√ャ繝励r驟咲スョ縲 + + this.listChip.Add(chip); + this.n蜀驛ィ逡ェ蜿キSCROLL1to++; + + //this.nScoreDiff = Convert.ToInt16( strCommandParam ); + //tbScoreDiff.Text = strCommandParam; + } + else if (strCommandName.Equals("GENRE")) + { + //2015.03.28 kairera0467 + //繧ク繝」繝ウ繝ォ縺ョ螳夂セゥ縲DTX縺九i蜈・蜉帙b縺ァ縺阪k縺後》ja縺九i繧ょ・蜉帙〒縺阪k繧医≧縺ォ縺吶k縲 + //譌・譛ャ隱槫錐縺縺ィ驕ク譖イ逕サ髱「縺ァ繝舌げ縺悟コ繧九ョ縺ァ縲√◎縺薙b縺ゥ縺縺ォ縺九@縺ヲ縺縺丈コ亥ョ壹 + + if (!string.IsNullOrEmpty(strCommandParam)) + { + this.GENRE = strCommandParam; + } + } + else if (strCommandName.Equals("DEMOSTART")) + { + //2015.04.10 kairera0467 + + if (!string.IsNullOrEmpty(strCommandParam)) + { + int nOFFSETms; + try + { + nOFFSETms = (int)(Convert.ToDouble(strCommandParam) * 1000.0); + } + catch + { + nOFFSETms = 0; + } + + + this.n繝繝「BGM繧ェ繝輔そ繝繝 = nOFFSETms; + } + } + else if (strCommandName.Equals("BGMOVIE")) + { + //2016.02.02 kairera0467 + //閭梧勹蜍慕判縺ョ螳夂セゥ縲DTX縺九i蜈・蜉帙b縺ァ縺阪k縺後》ja縺九i繧ょ・蜉帙〒縺阪k繧医≧縺ォ縺吶k縲 + + if (!string.IsNullOrEmpty(strCommandParam)) + { + this.strBGVIDEO_PATH = + CDTXCompanionFileFinder.FindFileName(this.str繝輔か繝ォ繝蜷, str繝輔ぃ繧、繝ォ蜷, strCommandParam); + } + + var avi = new CAVI() + { + n逡ェ蜿キ = 1, + str繝輔ぃ繧、繝ォ蜷 = this.strBGVIDEO_PATH, + str繧ウ繝。繝ウ繝域枚 = "BGMOVIE蜻ス莉、", + }; + + if (this.listAVI.ContainsKey(1)) // 譌「縺ォ繝ェ繧ケ繝井クュ縺ォ蟄伜惠縺励※縺繧九↑繧牙炎髯、縲ょセ後ョ繧ゅョ縺梧怏蜉ケ縲 + this.listAVI.Remove(1); + + this.listAVI.Add(1, avi); + + var ds = new CDirectShow() + { + n逡ェ蜿キ = 1, + str繝輔ぃ繧、繝ォ蜷 = this.strBGVIDEO_PATH, + str繧ウ繝。繝ウ繝域枚 = "BGMOVIE蜻ス莉、", + }; + + if (this.listDS.ContainsKey(1)) // 譌「縺ォ繝ェ繧ケ繝井クュ縺ォ蟄伜惠縺励※縺繧九↑繧牙炎髯、縲ょセ後ョ繧ゅョ縺梧怏蜉ケ縲 + this.listDS.Remove(1); + + this.listDS.Add(1, ds); + } + else if (strCommandName.Equals("BGIMAGE")) + { + //2016.02.02 kairera0467 + if (!string.IsNullOrEmpty(strCommandParam)) + { + this.strBGIMAGE_PATH = strCommandParam; + } + } + else if (strCommandName.Equals("HIDDENBRANCH")) + { + //2016.04.01 kairera0467 繝代Λ繝。繝シ繧ソ繝シ縺ッ + if (!string.IsNullOrEmpty(strCommandParam)) + { + this.bHIDDENBRANCH = true; + } + } + else if (strCommandName.Equals("LYRICFILE")) + { + if (!string.IsNullOrEmpty(strCommandParam)) + { + string[] strFiles = SplitComma(strCommandParam); + string[] strFilePath = new string[strFiles.Length]; + for (int index = 0; index < strFiles.Length; index++) + { + strFilePath[index] = this.str繝輔か繝ォ繝蜷 + strFiles[index]; + if (File.Exists(strFilePath[index])) + { + try + { + if (TJAPlayer3.r迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク.e繧ケ繝繝シ繧クID == CStage.E繧ケ繝繝シ繧ク.譖イ隱ュ縺ソ霎シ縺ソ)//襍キ蜍墓凾縺ォ驥阪◆縺上↑縺」縺ヲ縺励∪縺蝠城。後ョ菫ョ豁」逕ィ + this.LyricFileParser(strFilePath[index], index); + this.bLyrics = true; + } + catch + { + Console.WriteLine("lrc繝輔ぃ繧、繝ォNo.{0}縺ョ隱ュ縺ソ霎シ縺ソ縺ォ螟ア謨励@縺セ縺励◆縺後", index); + Console.WriteLine("蜃ヲ逅繧堤カ夊。後@縺セ縺吶"); + } + } + } + } + } + if (this.nScoreModeTmp == 99) + { + //2017.01.28 DD + this.nScoreModeTmp = TJAPlayer3.ConfigIni.nScoreMode; + } + } + /// + /// 謖螳壹@縺滓枚蟄励′謨ー蛟、縺九r霑斐☆繝。繧ス繝繝 + /// + /// + /// + public bool bIsNumber(char Char) + { + if ((Char >= '0') && (Char <= '9')) + return true; + else + return false; + } + + /// + /// string蝙九°繧永nt蝙九↓螟画鋤縺吶k縲 + /// TJAP2縺九i謖√▲縺ヲ縺阪◆縲 + /// + private int CharConvertNote(string str) + { + switch (str) + { + case "0": + return 0; + case "1": + return 1; + case "2": + return 2; + case "3": + return 3; + case "4": + return 4; + case "5": + return 5; + case "6": + return 6; + case "7": + return 7; + case "8": + return 8; + case "9": + return 7; //2017.01.30 DD 闃矩」謇薙r鬚ィ闊ケ騾」謇捺桶縺縺ォ + case "A": //2017.08.22 kairera0467 謇九▽縺ェ縺 + return 10; + case "B": + return 11; + case "F": + return 15; + default: + return -1; + } + } + + private int strConvertCourse(string str) + { + //2016.08.24 kairera0467 + //豁」隕剰。ィ迴セ繧剃スソ縺」縺ヲ縺繧九◆繧√‘asy縺ァ繧EASY縺ァ繧0K縲 + + // 蟆乗枚蟄怜、ァ譁蟄怜玄蛻・縺励↑縺豁」隕剰。ィ迴セ縺ァ莉ョ蟇セ蠢懊 (AioiLight) + // 逶ク螟峨o繧峨★蜴溷ァ狗噪縺ェ繧繧頑婿縺縺後∵ュ」蟶ク縺ォ蜍穂ス懊@縺溘 + string[] Matchptn = new string[7] { "easy", "normal", "hard", "oni", "edit", "tower", "dan" }; + for (int i = 0; i < Matchptn.Length; i++) + { + if (Regex.IsMatch(str, Matchptn[i], RegexOptions.IgnoreCase)) + { + return i; + } + } + + switch (str) + { + case "0": + return 0; + case "1": + return 1; + case "2": + return 2; + case "3": + return 3; + case "4": + return 4; + case "5": + return 5; + case "6": + return 6; + default: + return 3; + } + } + + /// + /// Lyric繝輔ぃ繧、繝ォ縺ョ繝代シ繧ケ繧ゅ←縺 + /// 閾ェ蜉帙〒菴懊▲縺溘ョ縺ァ縲√≧縺セ縺上ヱ繝シ繧ケ縺励※縺上l縺ェ縺縺九b + /// + /// lrc繝輔ぃ繧、繝ォ縺ョ繝代せ + private void LyricFileParser(string strFilePath, int ordnumber)//lrc繝輔ぃ繧、繝ォ縺ョ繝代シ繧ケ逕ィ + { + string str = CJudgeTextEncoding.ReadTextFile(strFilePath); + var strSplit蠕 = str.Split(this.dlmtEnter, StringSplitOptions.RemoveEmptyEntries); + Regex timeRegex = new Regex(@"^(\[)(\d{2})(:)(\d{2})([:.])(\d{2})(\])", RegexOptions.Multiline | RegexOptions.Compiled); + Regex timeRegexO = new Regex(@"^(\[)(\d{2})(:)(\d{2})(\])", RegexOptions.Multiline | RegexOptions.Compiled); + List list; + for (int i = 0; i < strSplit蠕.Length; i++) + { + list = new List(); + if (!String.IsNullOrEmpty(strSplit蠕啓i])) + { + if (strSplit蠕啓i].StartsWith("[")) + { + Match timestring = timeRegex.Match(strSplit蠕啓i]), timestringO = timeRegexO.Match(strSplit蠕啓i]); + while (timestringO.Success || timestring.Success) + { + long time; + if (timestring.Success) + { + time = Int32.Parse(timestring.Groups[2].Value) * 60000 + Int32.Parse(timestring.Groups[4].Value) * 1000 + Int32.Parse(timestring.Groups[6].Value) * 10; + strSplit蠕啓i] = strSplit蠕啓i].Remove(0, 10); + } + else if (timestringO.Success) + { + time = Int32.Parse(timestringO.Groups[2].Value) * 60000 + Int32.Parse(timestringO.Groups[4].Value) * 1000; + strSplit蠕啓i] = strSplit蠕啓i].Remove(0, 7); + } + else + break; + list.Add(time); + timestring = timeRegex.Match(strSplit蠕啓i]); + timestringO = timeRegexO.Match(strSplit蠕啓i]); + } + strSplit蠕啓i] = strSplit蠕啓i].Replace("\r", "").Replace("\n", ""); + + for (int listindex = 0; listindex < list.Count; listindex++) + { + STLYRIC stlrc; + stlrc.Text = strSplit蠕啓i]; + stlrc.TextTex = this.pf豁瑚ゥ槭ヵ繧ゥ繝ウ繝.DrawPrivateFont(strSplit蠕啓i], TJAPlayer3.Skin.Game_Lyric_ForeColor, TJAPlayer3.Skin.Game_Lyric_BackColor); + stlrc.Time = list[listindex]; + stlrc.index = ordnumber; + this.listLyric2.Add(stlrc); + } + } + } + } + } + + + /// + /// 隍邏謨ー縺ョ繝代シ繧ケ繧ゅ←縺 + /// + private void tParsedComplexNumber(string strScroll, ref double[] dbScroll) + { + bool bFirst = true; //譛蛻昴ョ謨ー蛟、縺 + bool bUse = false; //謨ー蛟、謇ア縺荳ュ + string[] arScroll = new string[2]; + char[] c = strScroll.ToCharArray(); + //1.0-1.0i + for (int i = 0; i < strScroll.Length; i++) + { + if (bFirst) + arScroll[0] += c[i]; + else + arScroll[1] += c[i]; + + //谺。縺ョ譁蟄励′'i'縺ェ繧芽┳蜃コ縲 + if (c[i + 1] == 'i') + break; + else if (c[i + 1] == '-' || c[i + 1] == '+') + bFirst = false; + + } + + dbScroll[0] = Convert.ToDouble(arScroll[0]); + dbScroll[1] = Convert.ToDouble(arScroll[1]); + return; + } + + private void tSetSenotes() + { + #region[ list菴懈 ] + //縺イ縺ィ縺セ縺壹メ繝繝励□縺代ョ繝ェ繧ケ繝医r菴懈舌@縺ヲ縺翫¥縲 + List list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝; + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝 = new List(); + int nCount = 0; + int dkdkCount = 0; + + foreach (CChip chip in this.listChip) + { + if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x11 && chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 0x18) + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Add(chip); + } + } + #endregion + + //譎る俣蛻、螳壹ッ縲√梧ャ。縺ョ繝√ャ繝励ョ逋コ螢ー譎ょ綾縲阪°繧峨檎樟蝨ィ(驕主悉)縺ョ繝√ャ繝励ョ逋コ螢ー譎ょ綾縲阪〒蠑輔¥蠢隕√′縺ゅk縲 + //騾縺ォ縺励※縺励∪縺縺ィ險育ョ励′縺ィ縺ヲ縺、繧ゅ↑縺縺薙→縺ォ縺ェ繧九ョ縺ァ豕ィ諢上 + + try + { + //this.tSenotes_Core( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝 ); + this.tSenotes_Core_V2(list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝, true); + } + catch (Exception ex) + { + Trace.TraceError(ex.ToString()); + Trace.TraceError("萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (b67473e4-1930-44f1-b320-4ead5786e74c)"); + } + + + #region[邨ア蜷亥燕] + //foreach( CChip pChip in list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝 ) + //{ + // int dbUnitTime = ( int )( ( ( 60.0 / this.dbNowBPM ) / 4.0 ) * 1000.0 ); + // int nUnit4 = dbUnitTime * 4; + // int nUnit8 = dbUnitTime * 2; + // int nUnit16 = dbUnitTime; + + // if( nCount == 0 ) + // { + // nCount++; + // continue; + // } + + // double db1蛟句燕縺ョ逋コ逕滓凾蛻サms = list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms * 1; + + // if( nCount == 1 ) + // { + // //nCount - 1縺ッ荳逡ェ譛蛻昴ョ繝弱シ繝縺ォ縺ェ繧九 + + // if( pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n逋コ螢ー譎ょ綾ms >= nUnit4 ) + // { + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 0; + // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 3; + + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms < nUnit4 ) + // { + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms < nUnit8 ) + // { + // //16蛻縺ェ繧峨後ラ縲 + // pChip.nSenote = 1; + // } + // else + // { + // if( dkdkCount == 0 ) + // { + // pChip.nSenote = 1; + // dkdkCount++; + // } + // else if( dkdkCount == 1 ) + // { + // pChip.nSenote = 2; + // dkdkCount = 0; + // } + + // } + // } + // else + // { + // //谺。繧4蛻縺ェ繧峨後ラ繝ウ縲阪°縲後き繝縲 + // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // { + // pChip.nSenote = 0; + // } + // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // { + // pChip.nSenote = 3; + // } + // } + // } + // else if( pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n逋コ螢ー譎ょ綾ms <= nUnit4 && pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n逋コ螢ー譎ょ綾ms >= nUnit8 ) + // { + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 1; + // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 4; + + // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // { + // pChip.nSenote = 1; + // } + // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // { + // pChip.nSenote = 4; + // } + // } + // else if( pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n逋コ螢ー譎ょ綾ms < nUnit8 ) + // { + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 1; + // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 4; + + // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // { + // pChip.nSenote = 1; + // } + // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // { + // pChip.nSenote = 4; + // } + // } + + // nCount++; + // continue; + // } + + // double db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms = list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n逋コ螢ー譎ょ綾ms * 1; + + // #region[譁ー縺励>繧縺、] + // if( nCount + 1 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count ) + // break; + + // if( pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n逋コ螢ー譎ょ綾ms >= nUnit4 ) + // { + // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // { + // pChip.nSenote = 0; + // } + // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // { + // pChip.nSenote = 3; + // } + + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms <= nUnit4 ) + // { + // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // pChip.nSenote = 1; + // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // pChip.nSenote = 4; + // } + // } + // else if( pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n逋コ螢ー譎ょ綾ms < nUnit4 && pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n逋コ螢ー譎ょ綾ms >= nUnit8 ) + // { + // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // { + // pChip.nSenote = 1; + // } + // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // { + // pChip.nSenote = 4; + // } + + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms <= nUnit4 ) + // { + // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // pChip.nSenote = 0; + // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // pChip.nSenote = 3; + + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 2 ].n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n逋コ螢ー譎ょ綾ms >= nUnit8 ) + // { + // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // pChip.nSenote = 1; + // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // pChip.nSenote = 4; + // } + // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 2 ].n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n逋コ螢ー譎ょ綾ms < nUnit8 ) + // { + // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // pChip.nSenote = 1; + // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // pChip.nSenote = 4; + // } + + // } + // else + // { + // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // pChip.nSenote = 0; + // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // pChip.nSenote = 3; + // } + // } + // else if( pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n逋コ螢ー譎ょ綾ms < nUnit8 ) //8蛻莉・荳 + // { + // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // { + // pChip.nSenote = 1; + // } + // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // { + // pChip.nSenote = 4; + // } + + // //蠕後m縺4蛻 + // try + // { + // if( nCount + 1 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count ) + // break; + + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms >= nUnit8 ) //蛻蟯舌′縺ゅk縺ィ縺薙%縺後ヰ繧ー繧九▲縺ス縺?(Index繧ィ繝ゥ繝シ) + // { + // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // { + // pChip.nSenote = 0; + // } + // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // { + // pChip.nSenote = 3; + // } + // } + // } + // catch( Exception ex ) + // { + + // } + + + // } + // #endregion + + // #region[蜿、縺繧縺、] + // ////2縺、蜑阪→1縺、蜑阪ョ繝√ャ繝励ョSenote繧呈アコ繧√※縺縺上 + // ////騾」謇薙∝、ァ髻ウ隨ヲ縺ェ縺ゥ縺ッ繝√ャ繝鈴咲スョ縺ョ髫帙↓豎コ繧√∪縺吶 + // //if (( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) >= nUnit4) + // //{ + // // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′4蛻莉・荳翫〒縺九▽縲√◎縺ョ髻ウ隨ヲ縺後ラ繝ウ縺ェ繧2縺、蜑阪ョSenote縺ッ縲後ラ繝ウ縲阪〒遒コ螳壹 + // // //蜷梧凾縺ォdkdk繧偵Μ繧サ繝繝 + // // dkdkCount = false; + // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].nSenote = 0; + // // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].nSenote = 3; + + // // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit4 ) + // // { + // // //1縺、蜑阪ョ髻ウ隨ヲ縺ィ迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ髢薙′4蛻莉・荳翫°縺、縲√◎縺ョ髻ウ隨ヲ縺後ラ繝ウ縺ェ繧1縺、蜑阪ョ髻ウ隨ヲ縺ッ縲後ラ繝ウ縲阪〒遒コ螳壹 + // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].nSenote = 0; + // // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].nSenote = 3; + // // } + // // else if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) <= nUnit4 ) + // // { + // // //4蛻 + // // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit8 ) + // // { + // // dkdkCount = false; + // // //1縺、蜑阪ョ髻ウ隨ヲ縺ィ迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ髢薙′8蛻莉・蜀縺ァ16蛻莉・荳翫〒縺九▽縲√◎縺ョ髻ウ隨ヲ縺瑚オ、縺ェ繧1縺、蜑阪ョ髻ウ隨ヲ縺ッ縲後ラ縲阪〒遒コ螳壹 + // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 2; + // // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 4; + // // } + // // else if( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) <= nUnit8 ) + // // { + // // dkdkCount = false; + // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // // { + // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 1; + + // // //繝峨さ繝峨Φ + // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // // { + // // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // // pChip.nSenote = dkdkCount ? 2 : 1; + // // if( dkdkCount == false ) + // // dkdkCount = true; + // // else + // // dkdkCount = false; + // // } + // // } + // // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 4; + // // } + + // // } + // //} + // //else if ( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) <= nUnit4 && ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) >= nUnit8) + // //{ + // // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′8蛻莉・荳翫〒縺九▽縲16蛻莉・蜀 + + // // if( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) >= nUnit8 && ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) > nUnit16 ) + // // { + // // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′8蛻莉・荳翫〒縺九▽縲16蛻莉・蜀縺ェ繧峨後ラ縲 + // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // // { + // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 1; + // // } + // // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // // { + // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 4; + // // } + // // } + // // else if( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) < nUnit8 ) + // // { + // // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′16蛻莉・蜀縺ェ繧峨後ラ縲阪〒遒コ螳 + // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // // { + // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 1; + // // } + // // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 4; + // // } + + // // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit16 ) + // // { + // // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit8 ) + // // { + // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // // { + // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 0; + // // } + // // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 3; + // // } + // // } + // //} + // //else if ( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) >= nUnit16 && ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) <= nUnit8 ) + // //{ + // // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′16蛻莉・荳 + // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // // { + // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 1; + // // } + // // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 4; + + // // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit8 ) + // // { + // // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // // { + // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 0; + // // } + // // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 3; + // // } + + + // //} + // #endregion + + // nCount++; + //} + #endregion + + + } + + /// + /// 隴憺擇蛻蟯舌′縺ゅk蝣エ蜷医ッ縺薙■繧峨r菴ソ縺 + /// + private void tSetSenotes_branch() + { + #region[ list菴懈 ] + //縺イ縺ィ縺セ縺壹メ繝繝励□縺代ョ繝ェ繧ケ繝医r菴懈舌@縺ヲ縺翫¥縲 + List list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝; + List list譎ョ騾夊ュ憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝; + List list邇莠コ隴憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝; + List list驕比ココ隴憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝; + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝 = new List(); + list譎ョ騾夊ュ憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝 = new List(); + list邇莠コ隴憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝 = new List(); + list驕比ココ隴憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝 = new List(); + int nCount = 0; + int dkdkCount = 0; + + foreach (CChip chip in this.listChip) + { + if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x11 && chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 0x18) + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Add(chip); + + switch (chip.n繧ウ繝シ繧ケ) + { + case ECourse.eNormal: + list譎ョ騾夊ュ憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝.Add(chip); + break; + case ECourse.eExpert: + list邇莠コ隴憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝.Add(chip); + break; + case ECourse.eMaster: + list驕比ココ隴憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝.Add(chip); + break; + } + } + } + #endregion + + //for縺ァ蜃ヲ逅縲 + for (int n = 0; n < 3; n++) + { + switch (n) + { + case 0: + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝 = list譎ョ騾夊ュ憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝; + break; + case 1: + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝 = list邇莠コ隴憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝; + break; + case 2: + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝 = list驕比ココ隴憺擇縺ョ縺ソ縺ョ繝ェ繧ケ繝; + break; + } + + //this.tSenotes_Core( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝 ); + this.tSenotes_Core_V2(list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝, true); + } + + } + + /// + /// 繧ウ繧「驛ィ蛻縲りュ憺擇蛻蟯先凾縺ョ蜃ヲ逅螳溯」縺ォ縺ゅ◆縺」縺ヲ蛻髮「縲 + /// + private void tSenotes_Core(List list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝) + { + int nCount = 0; + int dkdkCount = 0; + + foreach (CChip pChip in list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝) + { + int dbUnitTime = (int)(((60.0 / pChip.dbBPM) / 4.0) * 1000.0); + int nUnit4 = dbUnitTime * 4; + int nUnit6 = dbUnitTime * 3; + int nUnit8 = dbUnitTime * 2; + int nUnit16 = dbUnitTime; + + float fUnitTime = (((60.0f / (float)pChip.dbBPM) / 4.0f) * 1000.0f); + //float fUnitTime = (float)Math.Round( ( ( ( 60.0f / (float)pChip.dbBPM ) / 4.0f ) * 1000.0f ), 0 ); + float fUnit4 = fUnitTime * 4.0f; + float fUnit8 = fUnitTime * 2.0f; + float fUnit16 = fUnitTime; + + if (pChip.dbBPM < 120) + { + nUnit4 = (dbUnitTime * 4) / 2; + nUnit8 = (dbUnitTime * 2) / 2; + nUnit16 = dbUnitTime / 2; + + fUnit4 = fUnitTime * 4.0f; + fUnit8 = fUnitTime * 2.0f; + fUnit16 = fUnitTime; + } + + if (nCount == 0) + { + nCount++; + continue; + } + + double db1蛟句燕縺ョ逋コ逕滓凾蛻サms = list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms * 1; + + #region[ float ] + /* + if( nCount == 1 ) + { + //nCount - 1縺ッ荳逡ェ譛蛻昴ョ繝弱シ繝縺ォ縺ェ繧九 + + if( pChip.f逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].f逋コ螢ー譎ょ綾ms >= fUnit4 ) + { + //2逡ェ逶ョ縺ョ繝弱シ繝縺ィ1逡ェ逶ョ縺ョ繝弱シ繝縺ョ髢馴囈縺4蛻縺九◎繧御サ・荳 + if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 0; + else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 3; + + if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms < fUnit4 ) + { + if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms < fUnit8 ) + { + //16蛻縺ェ繧峨後ラ縲 + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + pChip.nSenote = 1; + } + else + { + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x93) + break; + + if( dkdkCount == 0 ) + { + pChip.nSenote = 1; + dkdkCount++; + } + else if( dkdkCount == 1 ) + { + pChip.nSenote = 2; + dkdkCount = 0; + } + + } + } + else + { + //谺。繧4蛻縺ェ繧峨後ラ繝ウ縲阪°縲後き繝縲 + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + { + pChip.nSenote = 0; + } + else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + { + pChip.nSenote = 3; + } + } + } + else if( pChip.f逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].f逋コ螢ー譎ょ綾ms < fUnit4 && pChip.f逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].f逋コ螢ー譎ょ綾ms > fUnit16 ) + { + //2逡ェ逶ョ縺ョ繝√ャ繝励→1逡ェ逶ョ縺ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳九〒縺九▽16蛻莉・荳 + if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 1; + else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 4; + + + + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + { + pChip.nSenote = 1; + } + else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + { + pChip.nSenote = 4; + } + // + //if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].nSenote = 0; + //else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].nSenote = 3; + + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms >= fUnit4) + { + //3逡ェ逶ョ縺ョ繝√ャ繝励→2逡ェ逶ョ縺ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳 + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + { + pChip.nSenote = 0; + } + else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + { + pChip.nSenote = 3; + } + } + } + else if( pChip.f逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].f逋コ螢ー譎ょ綾ms <= fUnit16 ) + { + //2逡ェ逶ョ縺ョ繝√ャ繝励→1逡ェ逶ョ縺ョ繝√ャ繝励ョ髢馴囈縺16蛻縺九◎繧御サ・荳 + if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 1; + else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 4; + + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + { + pChip.nSenote = 1; + } + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + { + pChip.nSenote = 4; + } + + //1逡ェ逶ョ縺ョ繝√ャ繝励′0x93 + if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + { + //3逡ェ逶ョ縺ョ繝√ャ繝励→2逡ェ逶ョ縺ョ繝√ャ繝励ョ髢馴囈縺16蛻 + if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms == fUnit16 ) + { + if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + { + pChip.nSenote = 2; + } + } + } + + + } + + nCount++; + continue; + } + + double db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms = list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n逋コ螢ー譎ょ綾ms * 1; + + #region[譁ー縺励>繧縺、] + if( pChip.f逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].f逋コ螢ー譎ょ綾ms >= fUnit4 ) + { + //迴セ蝨ィ縺ョ繝√ャ繝励→1縺、蜑阪ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳 + dkdkCount = 0; + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + { + pChip.nSenote = 0; + //break; + } + else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + { + pChip.nSenote = 3; + } + + if( nCount + 1 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count ) + break; + + //谺。縺ョ繝√ャ繝励→迴セ蝨ィ縺ョ繝√ャ繝励ョ髢薙′4蛻莉・荳 + if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms < fUnit4 ) + { + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + pChip.nSenote = 1; + else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + pChip.nSenote = 4; + } + } + else if( pChip.f逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].f逋コ螢ー譎ょ綾ms < fUnit4 && pChip.f逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].f逋コ螢ー譎ょ綾ms > fUnit16 ) + { + //迴セ蝨ィ縺ョ繝√ャ繝励→1縺、蜑阪ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳九°縺、16蛻莉・荳 + dkdkCount = 0; + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + { + pChip.nSenote = 1; + } + else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + { + pChip.nSenote = 4; + } + + if( nCount + 1 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count ) + break; + + + if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms >= fUnit4 ) + { + //谺。縺ョ繝√ャ繝励→迴セ蝨ィ縺ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳 + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + pChip.nSenote = 0; + else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + pChip.nSenote = 3; + } + else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms < fUnit4 && list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms > fUnit16 ) + { + //谺。縺ョ繝√ャ繝励→迴セ蝨ィ縺ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳 + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + pChip.nSenote = 1; + else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + pChip.nSenote = 4; + + if( nCount + 2 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count ) + break; + + //谺。縺ョ繝√ャ繝励′0x93 + //if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + //{ + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 2 ].n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n逋コ螢ー譎ょ綾ms < nUnit8 ) + // { + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].nSenote = 2; + // } + //} + } + else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms <= fUnit16 ) + { + //谺。縺ョ繝√ャ繝励→迴セ蝨ィ縺ョ繝√ャ繝励ョ髢馴囈縺16蛻莉・荳 + //縺昴≧縺ェ繧九→1縺、蜑阪ョ繝√ャ繝励ッ縲後ラ繝ウ縲阪°縲後き繝縲阪↓縺ェ繧 + //if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 0; + //else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 0; + } + } + else if( pChip.f逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].f逋コ螢ー譎ょ綾ms <= fUnit16 ) + { + //迴セ蝨ィ縺ョ繝弱シ繝縺ィ1縺、蜑阪ョ繝弱シ繝縺ョ髢馴囈縺16蛻縺九◎繧御サ・荳 + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + { + pChip.nSenote = 1; + } + else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + { + pChip.nSenote = 4; + } + + + try + { + if( nCount + 1 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count ) //荳逡ェ譛蠕後ョ繝弱シ繝縺縺」縺滓凾縺ョ繧ィ繝ゥ繝シ蟇セ遲悶 + break; + + //蠕後m縺4蛻 + if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms >= fUnit4 ) + { + dkdkCount = 0; + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + { + pChip.nSenote = 0; + } + else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + { + pChip.nSenote = 3; + } + } + else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms <= fUnit8 && list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms > fUnit16 ) + { + //谺。縺ョ繝弱シ繝縺ィ迴セ蝨ィ縺ョ繝弱シ繝縺ョ髢馴囈縺8蛻縺九◎繧御サ・荳九〒縺九▽16蛻莉・荳 + dkdkCount = 0; + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + { + pChip.nSenote = 0; + } + else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + { + pChip.nSenote = 3; + } + } + else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].f逋コ螢ー譎ょ綾ms - pChip.f逋コ螢ー譎ょ綾ms <= fUnit16 ) + { + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + { + pChip.nSenote = 1; + + if( nCount + 2 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count ) + break; + + if( pChip.f逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].f逋コ螢ー譎ょ綾ms == fUnit16 ) + { + //1縺、蜑阪ョ繝弱シ繝縺ィ迴セ蝨ィ縺ョ繝弱シ繝縺ョ髢馴囈縺16蛻 + if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + { + //繝√Ε繝ウ繝阪Ν逡ェ蜿キ縺0x93 + if( dkdkCount == 0 ) + { + pChip.nSenote = 2; + dkdkCount = 1; + } + else + { + pChip.nSenote = 1; + dkdkCount = 0; + } + } + + } + else + { + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + pChip.nSenote = 1; + else + pChip.nSenote = 4; + } + } + else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + { + pChip.nSenote = 4; + } + } + } + catch( Exception ex ) + { + + } + + + } + #endregion + */ + #endregion + + #region[ 繝溘Μ遘 ] + + if (nCount == 1) + { + #region[ 荳逡ェ譛蛻 ] + //nCount - 1縺ッ荳逡ェ譛蛻昴ョ繝弱シ繝縺ォ縺ェ繧九 + + if (pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].n逋コ螢ー譎ょ綾ms >= nUnit4) + { + //2逡ェ逶ョ縺ョ繝弱シ繝縺ィ1逡ェ逶ョ縺ョ繝弱シ繝縺ョ髢馴囈縺4蛻縺九◎繧御サ・荳 + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].nSenote = 0; + else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].nSenote = 3; + + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms < nUnit4) + { + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms < nUnit8) + { + + + + //16蛻縺ェ繧峨後ラ縲 + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + pChip.nSenote = 1; + } + else + { + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + { + pChip.nSenote = 0; + } + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + { + pChip.nSenote = 3; + } + } + } + else + { + //谺。繧4蛻縺ェ繧峨後ラ繝ウ縲阪°縲後き繝縲 + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + { + pChip.nSenote = 0; + } + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + { + pChip.nSenote = 3; + } + } + } + else if (pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms < nUnit4 && pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms > nUnit16) + { + //2逡ェ逶ョ縺ョ繝√ャ繝励→1逡ェ逶ョ縺ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳九〒縺九▽16蛻莉・荳 + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].nSenote = 1; + else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].nSenote = 4; + + + + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + { + pChip.nSenote = 1; + } + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + { + pChip.nSenote = 4; + } + + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms >= nUnit4) + { + //3逡ェ逶ョ縺ョ繝√ャ繝励→2逡ェ逶ョ縺ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳 + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + { + pChip.nSenote = 0; + } + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + { + pChip.nSenote = 3; + } + } + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms < nUnit4) + { + //3逡ェ逶ョ縺ョ繝√ャ繝励→2逡ェ逶ョ縺ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳 + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms <= nUnit8) + { + + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms < nUnit8) + { + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].nSenote = 0; + else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[0].nSenote = 3; + } + + + + + //16蛻縺ェ繧峨後ラ縲 + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + pChip.nSenote = 1; + } + else + { + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + { + pChip.nSenote = 1; + } + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + { + pChip.nSenote = 4; + } + } + } + } + else if (pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms <= nUnit16) + { + //2逡ェ逶ョ縺ョ繝√ャ繝励→1逡ェ逶ョ縺ョ繝√ャ繝励ョ髢馴囈縺16蛻縺九◎繧御サ・荳 + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].nSenote = 1; + else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].nSenote = 4; + + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + { + pChip.nSenote = 1; + } + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + { + pChip.nSenote = 4; + } + + //1逡ェ逶ョ縺ョ繝√ャ繝励′0x93 + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + { + //3逡ェ逶ョ縺ョ繝√ャ繝励→2逡ェ逶ョ縺ョ繝√ャ繝励ョ髢馴囈縺16蛻 + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms == nUnit16) + { + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + { + pChip.nSenote = 2; + } + } + } + + + } + + nCount++; + continue; + + #endregion + } + + double db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms = list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].n逋コ螢ー譎ょ綾ms * 1; + + #region[譁ー縺励>繧縺、] + if (pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms >= nUnit4) + { + //迴セ蝨ィ縺ョ繝√ャ繝励→1縺、蜑阪ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳 + dkdkCount = 0; + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + { + pChip.nSenote = 0; + } + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + { + pChip.nSenote = 3; + } + + if (nCount + 1 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count) + break; + + //谺。縺ョ繝√ャ繝励→迴セ蝨ィ縺ョ繝√ャ繝励ョ髢薙′4蛻莉・荳 + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms < nUnit6) + { + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + pChip.nSenote = 1; + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + pChip.nSenote = 4; + + //12縲16蛻縺後≠繧九↑繧峨後ラ繝ウ縲阪°縲後き繝縲阪↓螟峨∴繧 + + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 2].n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms <= nUnit16) + { + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + pChip.nSenote = 1; + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + pChip.nSenote = 4; + } + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 2].n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms < nUnit8) + { + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + pChip.nSenote = 0; + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + pChip.nSenote = 3; + } + } + //else + //{ + // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // { + // pChip.nSenote = 0; + // } + // else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // { + // pChip.nSenote = 3; + // } + //} + } + else if (pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms < nUnit4 && pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms > nUnit16) + { + //迴セ蝨ィ縺ョ繝√ャ繝励→1縺、蜑阪ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳九°縺、16蛻莉・荳 + dkdkCount = 0; + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + { + pChip.nSenote = 1; + } + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + { + pChip.nSenote = 4; + } + + if (nCount + 1 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count) + break; + + + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms >= nUnit4) + { + //谺。縺ョ繝√ャ繝励→迴セ蝨ィ縺ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳 + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + pChip.nSenote = 0; + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + pChip.nSenote = 3; + } + else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms < nUnit4 && list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms > nUnit16) + { + //谺。縺ョ繝√ャ繝励→迴セ蝨ィ縺ョ繝√ャ繝励ョ髢馴囈縺4蛻莉・荳 + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + pChip.nSenote = 1; + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + pChip.nSenote = 4; + + if (nCount + 2 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count) + break; + + //谺。縺ョ繝√ャ繝励′0x93 + //if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + //{ + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 2 ].n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].n逋コ螢ー譎ょ綾ms < nUnit8 ) + // { + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount + 1 ].nSenote = 2; + // } + //} + + //12縲16蛻縺後≠繧九↑繧峨後ラ繝ウ縲阪°縲後き繝縲阪↓螟峨∴繧 + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 2].n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms < nUnit8) + { + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + pChip.nSenote = 0; + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + pChip.nSenote = 3; + + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].n逋コ螢ー譎ょ綾ms >= nUnit8) + { + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + pChip.nSenote = 1; + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + pChip.nSenote = 4; + } + + + } + } + else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms <= nUnit16) + { + //谺。縺ョ繝√ャ繝励→迴セ蝨ィ縺ョ繝√ャ繝励ョ髢馴囈縺16蛻莉・荳 + //縺昴≧縺ェ繧九→1縺、蜑阪ョ繝√ャ繝励ッ縲後ラ繝ウ縲阪°縲後き繝縲阪↓縺ェ繧 + //if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 0; + //else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 3; + } + else + { + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + pChip.nSenote = 0; + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + pChip.nSenote = 3; + } + } + else if (pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms <= nUnit16) + { + //迴セ蝨ィ縺ョ繝弱シ繝縺ィ1縺、蜑阪ョ繝弱シ繝縺ョ髢馴囈縺16蛻縺九◎繧御サ・荳 + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + { + pChip.nSenote = 1; + } + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + { + pChip.nSenote = 4; + } + + + try + { + if (nCount + 1 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count) //荳逡ェ譛蠕後ョ繝弱シ繝縺縺」縺滓凾縺ョ繧ィ繝ゥ繝シ蟇セ遲悶 + break; + + //蠕後m縺4蛻 + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms >= nUnit4) + { + dkdkCount = 0; + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + { + pChip.nSenote = 0; + } + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + { + pChip.nSenote = 3; + } + } + else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms <= nUnit4 && list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms >= nUnit8) + { + //谺。縺ョ繝弱シ繝縺ィ迴セ蝨ィ縺ョ繝弱シ繝縺ョ髢馴囈縺8蛻縺九◎繧御サ・荳九〒縺九▽16蛻莉・荳 + dkdkCount = 0; + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + { + pChip.nSenote = 0; + } + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + { + pChip.nSenote = 3; + } + } + else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount + 1].n逋コ螢ー譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms < nUnit8) + { + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + { + pChip.nSenote = 1; + + if (nCount + 2 >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count) + break; + + + //2015.03.31 kairera0467縲縲後さ縲阪r隱ソ遽縺吶k驛ィ蛻縲ゅ◆縺縺怜虚菴懊′縺ゅd縺励☆縺弱k縺溘a縲√>縺」縺溘s蟆∝魂縲 + if (pChip.n逋コ螢ー譎ょ綾ms - list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n逋コ螢ー譎ょ綾ms <= nUnit16) + { + //1縺、蜑阪ョ繝弱シ繝縺ィ迴セ蝨ィ縺ョ繝弱シ繝縺ョ髢馴囈縺16蛻 + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + { + //繝√Ε繝ウ繝阪Ν逡ェ蜿キ縺0x93 + //if( dkdkCount == 0 ) + //{ + // pChip.nSenote = 2; + // dkdkCount = 1; + //} + //else + //{ + // pChip.nSenote = 1; + // dkdkCount = 0; + //} + } + + } + } + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + { + pChip.nSenote = 4; + } + } + } + catch (Exception ex) + { + Trace.TraceError(ex.ToString()); + Trace.TraceError("萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (1503896a-0dfb-4643-87f1-bd821a125137)"); + } + } + else + { + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93) + { + pChip.nSenote = 0; + } + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94) + { + pChip.nSenote = 3; + } + } + #endregion + + #endregion + + #region[蜿、縺繧縺、] + ////2縺、蜑阪→1縺、蜑阪ョ繝√ャ繝励ョSenote繧呈アコ繧√※縺縺上 + ////騾」謇薙∝、ァ髻ウ隨ヲ縺ェ縺ゥ縺ッ繝√ャ繝鈴咲スョ縺ョ髫帙↓豎コ繧√∪縺吶 + //if (( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) >= nUnit4) + //{ + // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′4蛻莉・荳翫〒縺九▽縲√◎縺ョ髻ウ隨ヲ縺後ラ繝ウ縺ェ繧2縺、蜑阪ョSenote縺ッ縲後ラ繝ウ縲阪〒遒コ螳壹 + // //蜷梧凾縺ォdkdk繧偵Μ繧サ繝繝 + // dkdkCount = false; + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].nSenote = 0; + // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 2].nSenote = 3; + + // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit4 ) + // { + // //1縺、蜑阪ョ髻ウ隨ヲ縺ィ迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ髢薙′4蛻莉・荳翫°縺、縲√◎縺ョ髻ウ隨ヲ縺後ラ繝ウ縺ェ繧1縺、蜑阪ョ髻ウ隨ヲ縺ッ縲後ラ繝ウ縲阪〒遒コ螳壹 + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].nSenote = 0; + // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[nCount - 1].nSenote = 3; + // } + // else if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) <= nUnit4 ) + // { + // //4蛻 + // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit8 ) + // { + // dkdkCount = false; + // //1縺、蜑阪ョ髻ウ隨ヲ縺ィ迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ髢薙′8蛻莉・蜀縺ァ16蛻莉・荳翫〒縺九▽縲√◎縺ョ髻ウ隨ヲ縺瑚オ、縺ェ繧1縺、蜑阪ョ髻ウ隨ヲ縺ッ縲後ラ縲阪〒遒コ螳壹 + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 2; + // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 4; + // } + // else if( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) <= nUnit8 ) + // { + // dkdkCount = false; + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // { + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 1; + + // //繝峨さ繝峨Φ + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // { + // if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // pChip.nSenote = dkdkCount ? 2 : 1; + // if( dkdkCount == false ) + // dkdkCount = true; + // else + // dkdkCount = false; + // } + // } + // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 4; + // } + + // } + //} + //else if ( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) <= nUnit4 && ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) >= nUnit8) + //{ + // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′8蛻莉・荳翫〒縺九▽縲16蛻莉・蜀 + + // if( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) >= nUnit8 && ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) > nUnit16 ) + // { + // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′8蛻莉・荳翫〒縺九▽縲16蛻莉・蜀縺ェ繧峨後ラ縲 + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // { + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 1; + // } + // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // { + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 4; + // } + // } + // else if( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) < nUnit8 ) + // { + // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′16蛻莉・蜀縺ェ繧峨後ラ縲阪〒遒コ螳 + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // { + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 1; + // } + // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 4; + // } + + // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit16 ) + // { + // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit8 ) + // { + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // { + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 0; + // } + // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 3; + // } + // } + //} + //else if ( ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) >= nUnit16 && ( db1蛟句燕縺ョ逋コ逕滓凾蛻サms - db2蛟句燕縺ョ逋コ螢ー譎ょ綾ms ) <= nUnit8 ) + //{ + // //2縺、蜑阪ョ髻ウ隨ヲ縺ィ1縺、蜑阪ョ髻ウ隨ヲ縺ョ髢薙′16蛻莉・荳 + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // { + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 1; + // } + // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].nSenote = 4; + + // if( ( pChip.n逋コ螢ー譎ょ綾ms - db1蛟句燕縺ョ逋コ逕滓凾蛻サms ) >= nUnit8 ) + // { + // if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x93 ) + // { + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 0; + // } + // else if( list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 2 ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x94 ) + // list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[ nCount - 1 ].nSenote = 3; + // } + + + //} + #endregion + + nCount++; + } + } + + /// + /// 繧ウ繧「驛ィ蛻Ver2縲5JAP2縺九i遘サ讀阪@縺溘□縺代 + /// + /// + private void tSenotes_Core_V2(List list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝, bool ignoreSENote = false) + { + const int DATA = 3; + int doco_count = 0; + int[] sort = new int[7]; + double[] time = new double[7]; + double[] scroll = new double[7]; + double time_tmp; + + for (int i = 0; i < list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count; i++) + { + for (int j = 0; j < 7; j++) + { + if (i + (j - 3) < 0) + { + sort[j] = -1; + time[j] = -1000000000; + scroll[j] = 1.0; + } + else if (i + (j - 3) >= list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝.Count) + { + sort[j] = -1; + time[j] = 1000000000; + scroll[j] = 1.0; + } + else + { + sort[j] = list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i + (j - 3)].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ; + time[j] = list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i + (j - 3)].fBMSCROLLTime; + scroll[j] = list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i + (j - 3)].dbSCROLL; + } + } + time_tmp = time[DATA]; + for (int j = 0; j < 7; j++) + { + time[j] = (time[j] - time_tmp) * scroll[j]; + if (time[j] < 0) time[j] *= -1; + } + + if (ignoreSENote && list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].IsFixedSENote) continue; + + switch (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ) + { + case 0x11: + + //シ亥キヲ2繧医j髮「繧後※縺繧具ス懶シ雲蜿ウ2_蜿ウ繝峨Φ_蜿ウ蜿ウ4_蜿ウ蜿ウ繝峨Φ窶ヲ + if ((time[DATA - 1] > 2/* || (sort[DATA-1] != 1 && time[DATA-1] >= 2 && time[DATA-2] >= 4 && time[DATA-3] <= 5)*/) && time[DATA + 1] == 2 && sort[DATA + 1] == 1 && time[DATA + 2] == 4 && sort[DATA + 2] == 0x11 && time[DATA + 3] == 6 && sort[DATA + 3] == 0x11) + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 1; + doco_count = 1; + break; + } + //繝峨さ繝峨さ荳ュ_蟾ヲ2_蜿ウ2_蜿ウ繝峨Φ + else if (doco_count != 0 && time[DATA - 1] == 2 && time[DATA + 1] == 2 && (sort[DATA + 1] == 0x11 || sort[DATA + 1] == 0x11)) + { + if (doco_count % 2 == 0) + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 1; + else + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 2; + doco_count++; + break; + } + else + { + doco_count = 0; + } + + //8蛻繝峨さ繝峨Φ + if ((time[DATA - 2] >= 4.1 && time[DATA - 1] == 2 && time[DATA + 1] == 2 && time[DATA + 2] >= 4.1) && (sort[DATA - 1] == 0x11 && sort[DATA + 1] == 0x11)) + { + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].dbBPM >= 120.0) + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i - 1].nSenote = 1; + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 2; + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i + 1].nSenote = 0; + break; + } + else if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].dbBPM < 120.0) + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i - 1].nSenote = 0; + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 0; + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i + 1].nSenote = 0; + break; + } + } + + //BPM120莉・荳九ョ縺ソ + //8蛻髢馴囈縺ョ縲後ラ繝峨ラ縲坂偵後ラ繝ウ繝峨Φ繝峨Φ縲 + + if (time[DATA - 1] >= 2 && time[DATA + 1] >= 2) + { + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].dbBPM < 120.0) + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 0; + break; + } + } + + //繝峨さ繝峨さ繝峨Φ + if (time[DATA - 3] >= 3.4 && time[DATA - 2] == 2 && time[DATA - 1] == 1 && time[DATA + 1] == 1 && time[DATA + 2] == 2 && time[DATA + 3] >= 3.4 && sort[DATA - 2] == 0x93 && sort[DATA - 1] == 0x11 && sort[DATA + 1] == 0x11 && sort[DATA + 2] == 0x11) + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i - 2].nSenote = 1; + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i - 1].nSenote = 2; + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i + 0].nSenote = 1; + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i + 1].nSenote = 2; + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i + 2].nSenote = 0; + i += 2; + //break; + } + //繝峨さ繝峨Φ + else if (time[DATA - 2] >= 2.4 && time[DATA - 1] == 1 && time[DATA + 1] == 1 && time[DATA + 2] >= 2.4 && sort[DATA - 1] == 0x11 && sort[DATA + 1] == 0x11) + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 2; + } + //蜿ウ縺ョ髻ウ隨ヲ縺2莉・荳企屬繧後※縺繧 + else if (time[DATA + 1] > 2) + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 0; + } + //蜿ウ縺ョ髻ウ隨ヲ縺1.4莉・荳垣蟾ヲ縺ョ髻ウ隨ヲ縺1.4莉・蜀 + else if (time[DATA + 1] >= 1.4 && time[DATA - 1] <= 1.4) + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 0; + } + //蜿ウ縺ョ髻ウ隨ヲ縺2莉・荳垣蜿ウ蜿ウ縺ョ髻ウ隨ヲ縺3莉・蜀 + else if (time[DATA + 1] >= 2 && time[DATA + 2] <= 3) + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 0; + } + //蜿ウ縺ョ髻ウ隨ヲ縺2莉・荳垣螟ァ髻ウ隨ヲ + else if (time[DATA + 1] >= 2 && (sort[DATA + 1] == 0x13 || sort[DATA + 1] == 0x14)) + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 0; + } + else + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 1; + } + break; + case 0x12: + doco_count = 0; + + //BPM120莉・荳九ョ縺ソ + //8蛻髢馴囈縺ョ縲後ラ繝峨ラ縲坂偵後ラ繝ウ繝峨Φ繝峨Φ縲 + if (time[DATA - 1] == 2 && time[DATA + 1] == 2) + { + if (list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i - 1].dbBPM < 120.0 && list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].dbBPM < 120.0 && list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i + 1].dbBPM < 120.0) + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 3; + break; + } + } + + //蜿ウ縺ョ髻ウ隨ヲ縺2莉・荳企屬繧後※縺繧 + if (time[DATA + 1] > 2) + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 3; + } + //蜿ウ縺ョ髻ウ隨ヲ縺1.4莉・荳垣蟾ヲ縺ョ髻ウ隨ヲ縺1.4莉・蜀 + else if (time[DATA + 1] >= 1.4 && time[DATA - 1] <= 1.4) + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 3; + } + //蜿ウ縺ョ髻ウ隨ヲ縺2莉・荳垣蜿ウ蜿ウ縺ョ髻ウ隨ヲ縺3莉・蜀 + else if (time[DATA + 1] >= 2 && time[DATA + 2] <= 3) + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 3; + } + //蜿ウ縺ョ髻ウ隨ヲ縺2莉・荳垣螟ァ髻ウ隨ヲ + else if (time[DATA + 1] >= 2 && (sort[DATA + 1] == 0x13 || sort[DATA + 1] == 0x14)) + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 3; + } + else + { + list髻ウ隨ヲ縺ョ縺ソ縺ョ繝ェ繧ケ繝[i].nSenote = 4; + } + break; + default: + doco_count = 0; + break; + } + } + } + + /// + /// 繧オ繧ヲ繝ウ繝峨Α繧ュ繧オ繝シ縺ォ繧オ繧ヲ繝ウ繝峨r逋サ骭イ_蜑企勁縺吶k譎ょ綾繧剃コ句燕縺ォ邂怜コ縺吶k + /// + public void PlanToAddMixerChannel() + { + if (TJAPlayer3.Sound邂。逅.GetCurrentSoundDeviceType() == "DirectSound") // DShow縺ァ縺ョ蜀咲函縺ョ蝣エ蜷医ッ繝溘く繧キ繝ウ繧ー雋闕キ縺碁ォ倥¥縺ェ縺縺溘a縲 + { // 繝√ャ繝励ョ繝ゥ繧、繝輔ち繧、繝邂。逅繧定。後o縺ェ縺 + return; + } + + List listAddMixerChannel = new List(128); ; + List listRemoveMixerChannel = new List(128); + List listRemoveTiming = new List(128); + + foreach (CChip pChip in listChip) + { + switch (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ) + { + // BGM, 貍泌・上メ繝」繝阪Ν, 荳榊庄隕悶し繧ヲ繝ウ繝, 繝輔ぅ繝ォ繧、繝ウ繧オ繧ヲ繝ウ繝, 遨コ謇薙■髻ウ縺ッ繝溘く繧オ繝シ邂。逅縺ョ蟇セ雎。 + // BGM: + case 0x01: + // Dr貍泌・上メ繝」繝阪Ν + //case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: case 0x18: case 0x19: case 0x1A: case 0x1B: case 0x1C: + // Gt貍泌・上メ繝」繝阪Ν + //case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: case 0x28: + // Bs貍泌・上メ繝」繝阪Ν + //case 0xA0: case 0xA1: case 0xA2: case 0xA3: case 0xA4: case 0xA5: case 0xA6: case 0xA7: case 0xA8: + // Dr荳榊庄隕悶メ繝繝 + //case 0x31: case 0x32: case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: + //case 0x38: case 0x39: case 0x3A: + // Dr/Gt/Bs遨コ謇薙■ + //case 0xB1: case 0xB2: case 0xB3: case 0xB4: case 0xB5: case 0xB6: case 0xB7: case 0xB8: + //case 0xB9: case 0xBA: case 0xBB: case 0xBC: + // 繝輔ぅ繝ォ繧、繝ウ繧オ繧ヲ繝ウ繝 + //case 0x1F: case 0x2F: case 0xAF: + // 閾ェ蜍墓シ泌・上メ繝繝 + //case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: case 0x68: case 0x69: + //case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x78: case 0x79: + //case 0x80: case 0x81: case 0x82: case 0x83: case 0x84: case 0x85: case 0x86: case 0x87: case 0x88: case 0x89: + //case 0x90: case 0x91: case 0x92: + + #region [ 逋コ髻ウ1遘貞燕縺ョ繧ソ繧、繝溘Φ繧ー繧堤ョ怜コ ] + int n逋コ髻ウ蜑堺ス呵」瀕s = 1000, n逋コ髻ウ蠕御ス呵」瀕s = 800; + { + int ch = pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >> 4; + if (ch == 0x02 || ch == 0x0A) + { + n逋コ髻ウ蜑堺ス呵」瀕s = 800; + n逋コ髻ウ蜑堺ス呵」瀕s = 500; + } + if (ch == 0x06 || ch == 0x07 || ch == 0x08 || ch == 0x09) + { + n逋コ髻ウ蜑堺ス呵」瀕s = 200; + n逋コ髻ウ蜑堺ス呵」瀕s = 500; + } + } + #endregion + #region [ BGM繝√ャ繝励↑繧峨ー蜊ウ繝溘く繧オ繝シ縺ォ霑ス蜉 ] + //if ( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01 ) // BGM繝√ャ繝励ッ蜊ウ繝溘く繧オ繝シ縺ォ霑ス蜉 + //{ + // if ( listWAV.ContainsKey( pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ) ) + // { + // CDTX.CWAV wc = CDTXMania.DTX.listWAV[ pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ]; + // if ( wc.rSound[ 0 ] != null ) + // { + // CDTXMania.Sound邂。逅.AddMixer( wc.rSound[ 0 ] ); // BGM縺ッ螟夐榊咲函縺励↑縺莉墓ァ倥→縺励※縺繧九ョ縺ァ縲1蛟狗岼縺縺代Α繧ュ繧オ繝シ縺ォ逋サ骭イ縺吶l縺ー繧医> + // } + // } + //} + #endregion + #region [ 逋コ髻ウ1遘貞燕縺ョ繧ソ繧、繝溘Φ繧ー繧堤ョ怜コ ] + int nAddMixer譎ょ綾ms, nAddMixer菴咲スョ = 0; + //Debug.WriteLine("=================================================================="); + //Debug.WriteLine( "Start: ch=" + pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ.ToString("x2") + ", nWAV逡ェ蜿キ=" + pChip.n謨エ謨ー蛟、 + ", time=" + pChip.n逋コ螢ー譎ょ綾ms + ", lasttime=" + listChip[ listChip.Count - 1 ].n逋コ螢ー譎ょ綾ms ); + t逋コ螢ー譎ょ綾ms縺ィ逋コ螢ー菴咲スョ繧貞叙蠕励☆繧(pChip.n逋コ螢ー譎ょ綾ms - n逋コ髻ウ蜑堺ス呵」瀕s, out nAddMixer譎ょ綾ms, out nAddMixer菴咲スョ); + //Debug.WriteLine( "nAddMixer譎ょ綾ms=" + nAddMixer譎ょ綾ms + ",nAddMixer菴咲スョ=" + nAddMixer菴咲スョ ); + + CChip c_AddMixer = new CChip() + { + n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xDA, + n謨エ謨ー蛟、 = pChip.n謨エ謨ー蛟、, + n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, + n逋コ螢ー譎ょ綾ms = nAddMixer譎ょ綾ms, + n逋コ螢ー菴咲スョ = nAddMixer菴咲スョ, + b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk = false + }; + listAddMixerChannel.Add(c_AddMixer); + //Debug.WriteLine("listAddMixerChannel:" ); + //DebugOut_CChipList( listAddMixerChannel ); + #endregion + + int duration = 0; + if (listWAV.TryGetValue(pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, out CDTX.CWAV wc)) + { + double _db蜀咲函騾溷コヲ = (TJAPlayer3.DTXVmode.Enabled) ? this.dbDTXVPlaySpeed : this.db蜀咲函騾溷コヲ; + duration = (wc.rSound[0] == null) ? 0 : (int)(wc.rSound[0].n邱乗シ泌・乗凾髢杜s / _db蜀咲函騾溷コヲ); // #23664 duration縺ォ蜀咲函騾溷コヲ縺悟刈蜻ウ縺輔l縺ヲ縺翫i縺壹∽ス朱溷咲函縺ァBGM縺碁泌繧後k蝠城。後r菫ョ豁」 (逋コ螢ー譎ょ綾ms縺ッ縲.TX隱ュ縺ソ霎シ縺ソ譎ゅ↓蜀咲函騾溷コヲ蜉蜻ウ貂) + } + //Debug.WriteLine("duration=" + duration ); + int n譁ーRemoveMixer譎ょ綾ms, n譁ーRemoveMixer菴咲スョ; + t逋コ螢ー譎ょ綾ms縺ィ逋コ螢ー菴咲スョ繧貞叙蠕励☆繧(pChip.n逋コ螢ー譎ょ綾ms + duration + n逋コ髻ウ蠕御ス呵」瀕s, out n譁ーRemoveMixer譎ょ綾ms, out n譁ーRemoveMixer菴咲スョ); + //Debug.WriteLine( "n譁ーRemoveMixer譎ょ綾ms=" + n譁ーRemoveMixer譎ょ綾ms + ",n譁ーRemoveMixer菴咲スョ=" + n譁ーRemoveMixer菴咲スョ ); + if (n譁ーRemoveMixer譎ょ綾ms < pChip.n逋コ螢ー譎ょ綾ms + duration) // 譖イ縺ョ譛蠕後〒繧オ繧ヲ繝ウ繝峨′蛻繧後k繧医≧縺ェ蝣エ蜷医ッ + { + CChip c_AddMixer_noremove = c_AddMixer; + c_AddMixer_noremove.b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk = true; + listAddMixerChannel[listAddMixerChannel.Count - 1] = c_AddMixer_noremove; + //continue; // 逋コ螢ー菴咲スョ縺ョ險育ョ励′縺ァ縺阪↑縺縺ョ縺ァ縲`ixer蜑企勁繧偵≠縺阪i繧√k___縺ョ縺ァ縺ッ縺ェ縺 + // #32248 2013.10.15 yyagi 貍泌・冗オゆコ蠕後b蜀咲函繧堤カ壹¢繧九メ繝繝励〒縺ゅk縺ィ縺縺繝輔Λ繧ー繧恥Chip蜀縺ォ遶九※繧 + break; + } + #region [ 譛ェ菴ソ逕ィ繧ウ繝シ繝 ] + //if ( n譁ーRemoveMixer譎ょ綾ms < pChip.n逋コ螢ー譎ょ綾ms + duration ) // 譖イ縺ョ譛蠕後〒繧オ繧ヲ繝ウ繝峨′蛻繧後k繧医≧縺ェ蝣エ蜷 + //{ + // n譁ーRemoveMixer譎ょ綾ms = pChip.n逋コ螢ー譎ょ綾ms + duration; + // // 縲御ス咲スョ縲阪ッ豈比セ玖ィ育ョ励〒豎ゅa縺ヲ縺願幻繧呈ソ√☆...縺薙ョ繧繧頑婿縺縺ィ隱、蜍穂ス懊@縺溘◆繧∝ッセ蠢應クュ豁「 + // n譁ーRemoveMixer菴咲スョ = listChip[ listChip.Count - 1 ].n逋コ螢ー菴咲スョ * n譁ーRemoveMixer譎ょ綾ms / listChip[ listChip.Count - 1 ].n逋コ螢ー譎ょ綾ms; + //} + #endregion + + #region [ 逋コ髻ウ邨ゆコ2遘貞セ後↓mixer縺九i蜑企勁縺吶k縺後√◎縺ョ蜑阪↓蜀咲匱髻ウ縺吶k縺薙→縺ォ縺ェ繧九ョ縺九r遒コ隱(蜀咲匱髻ウ縺ェ繧盈ixer蜑企勁繧ソ繧、繝溘Φ繧ー繧貞サカ譛) ] + int n謨エ謨ー蛟、 = pChip.n謨エ謨ー蛟、; + int index = listRemoveTiming.FindIndex( + delegate (CChip cchip) { return cchip.n謨エ謨ー蛟、 == n謨エ謨ー蛟、; } + ); + //Debug.WriteLine( "index=" + index ); + if (index >= 0) // 驕主悉縺ォ蜷後§繝√ャ繝励〒逋コ髻ウ荳ュ縺ョ繧ゅョ縺瑚ヲ九▽縺九▲縺溷エ蜷 + { // 驕主悉縺ョ逋コ髻ウ縺ョmixer蜑企勁繧堤「コ螳壹&縺帙k縺九∝サカ譛溘☆繧九°縺ョ2謚槭 + int n譌ァRemoveMixer譎ょ綾ms = listRemoveTiming[index].n逋コ螢ー譎ょ綾ms; + int n譌ァRemoveMixer菴咲スョ = listRemoveTiming[index].n逋コ螢ー菴咲スョ; + + //Debug.WriteLine( "n譌ァRemoveMixer譎ょ綾ms=" + n譌ァRemoveMixer譎ょ綾ms + ",n譌ァRemoveMixer菴咲スョ=" + n譌ァRemoveMixer菴咲スョ ); + if (pChip.n逋コ螢ー譎ょ綾ms - n逋コ髻ウ蜑堺ス呵」瀕s <= n譌ァRemoveMixer譎ょ綾ms) // mixer蜑企勁蜑阪↓縲∝酔縺倬浹縺ョ蜀咲匱髻ウ縺後≠繧句エ蜷医ッ縲 + { // mixer蜑企勁譎ょ綾繧帝≦蟒カ縺輔○繧(if-else蠕後↓陦後≧) + //Debug.WriteLine( "remove TAIL of listAddMixerChannel. TAIL INDEX=" + listAddMixerChannel.Count ); + //DebugOut_CChipList( listAddMixerChannel ); + listAddMixerChannel.RemoveAt(listAddMixerChannel.Count - 1); // 縺セ縺溘∝酔縺倥メ繝繝鈴浹縺ョ縲稽ixer縺ク縺ョ蜀崎ソス蜉縲阪ッ蜑企勁縺吶k + //Debug.WriteLine( "removed result:" ); + //DebugOut_CChipList( listAddMixerChannel ); + } + else // 騾縺ォ縲∵凾髢楢サク荳翫[ixer蜑企勁蠕後↓蜀咲匱髻ウ縺吶k繧医≧縺ェ豬√l縺ョ蝣エ蜷医ッ + { + //Debug.WriteLine( "Publish the value(listRemoveTiming[index] to listRemoveMixerChannel." ); + listRemoveMixerChannel.Add(listRemoveTiming[index]); // mixer蜑企勁繧堤「コ螳壹&縺帙k + //Debug.WriteLine( "listRemoveMixerChannel:" ); + //DebugOut_CChipList( listRemoveMixerChannel ); + //listRemoveTiming.RemoveAt( index ); + } + CChip c = new CChip() // mixer蜑企勁譎ょ綾繧呈峩譁ー(驕蟒カ)縺吶k + { + n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xDB, + n謨エ謨ー蛟、 = listRemoveTiming[index].n謨エ謨ー蛟、, + n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = listRemoveTiming[index].n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, + n逋コ螢ー譎ょ綾ms = n譁ーRemoveMixer譎ょ綾ms, + n逋コ螢ー菴咲スョ = n譁ーRemoveMixer菴咲スョ + }; + listRemoveTiming[index] = c; + //listRemoveTiming[ index ].n逋コ螢ー譎ょ綾ms = n譁ーRemoveMixer譎ょ綾ms; // mixer蜑企勁譎ょ綾繧呈峩譁ー(驕蟒カ)縺吶k + //listRemoveTiming[ index ].n逋コ螢ー菴咲スョ = n譁ーRemoveMixer菴咲スョ; + //Debug.WriteLine( "listRemoveTiming: modified" ); + //DebugOut_CChipList( listRemoveTiming ); + } + else // 驕主悉縺ォ蜷後§繝√ャ繝励r逋コ髻ウ縺励※縺縺ェ縺or + { // 逋コ髻ウ縺励※縺縺溘′譌「縺ォmixer蜑企勁遒コ螳壹@縺ヲ縺縺溘↑繧 + CChip c = new CChip() // 譁ー縺励¥mixer蜑企勁蛟呵」懊→縺励※霑ス蜉縺吶k + { + n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0xDB, + n謨エ謨ー蛟、 = pChip.n謨エ謨ー蛟、, + n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, + n逋コ螢ー譎ょ綾ms = n譁ーRemoveMixer譎ょ綾ms, + n逋コ螢ー菴咲スョ = n譁ーRemoveMixer菴咲スョ + }; + //Debug.WriteLine( "Add new chip to listRemoveMixerTiming: " ); + //Debug.WriteLine( "ch=" + c.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ.ToString( "x2" ) + ", nWAV逡ェ蜿キ=" + c.n謨エ謨ー蛟、 + ", time=" + c.n逋コ螢ー譎ょ綾ms + ", lasttime=" + listChip[ listChip.Count - 1 ].n逋コ螢ー譎ょ綾ms ); + listRemoveTiming.Add(c); + //Debug.WriteLine( "listRemoveTiming:" ); + //DebugOut_CChipList( listRemoveTiming ); + } + #endregion + break; + } + } + //Debug.WriteLine("=================================================================="); + //Debug.WriteLine( "Result:" ); + //Debug.WriteLine( "listAddMixerChannel:" ); + //DebugOut_CChipList( listAddMixerChannel ); + //Debug.WriteLine( "listRemoveMixerChannel:" ); + //DebugOut_CChipList( listRemoveMixerChannel ); + //Debug.WriteLine( "listRemoveTiming:" ); + //DebugOut_CChipList( listRemoveTiming ); + //Debug.WriteLine( "==================================================================" ); + + listChip.AddRange(listAddMixerChannel); + listChip.AddRange(listRemoveMixerChannel); + listChip.AddRange(listRemoveTiming); + listChip.Sort(); + } + private void DebugOut_CChipList(List c) + { + //Debug.WriteLine( "Count=" + c.Count ); + for (int i = 0; i < c.Count; i++) + { + Debug.WriteLine(i + ": ch=" + c[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ.ToString("x2") + ", WAV逡ェ蜿キ=" + c[i].n謨エ謨ー蛟、 + ", time=" + c[i].n逋コ螢ー譎ょ綾ms); + } + } + private bool t逋コ螢ー譎ょ綾ms縺ィ逋コ螢ー菴咲スョ繧貞叙蠕励☆繧(int n蟶梧悍逋コ螢ー譎ょ綾ms, out int n譁ー逋コ螢ー譎ょ綾ms, out int n譁ー逋コ螢ー菴咲スョ) + { + // 逋コ螢ー譎ょ綾ms縺九i逋コ螢ー菴咲スョ繧帝邂励☆繧九%縺ィ縺ッ縺ァ縺阪↑縺縺溘a縲∬ソ台シシ險育ョ励☆繧九 + // 蜈キ菴鍋噪縺ォ縺ッ縲∝ク梧悍逋コ螢ー菴咲スョ蜑榊セ後ョ2縺、縺ョ繝√ャ繝励ョ逋コ螢ー菴咲スョ縺ョ荳ュ髢薙r蜿悶k縲 + + if (n蟶梧悍逋コ螢ー譎ょ綾ms < 0) + { + n蟶梧悍逋コ螢ー譎ょ綾ms = 0; + } + //else if ( n蟶梧悍逋コ螢ー譎ょ綾ms > listChip[ listChip.Count - 1 ].n逋コ螢ー譎ょ綾ms ) // BGM縺ョ譛蠕後ョ菴咎渊繧呈ョコ縺励※縺励∪縺縺ョ縺ァ縲√%縺ョ譚。莉カ縺ッ螟悶☆ + //{ + // n蟶梧悍逋コ螢ー譎ょ綾ms = listChip[ listChip.Count - 1 ].n逋コ螢ー譎ょ綾ms; + //} + + int index_min = -1, index_max = -1; + for (int i = 0; i < listChip.Count; i++) // 蟶梧悍逋コ螢ー菴咲スョ蜑榊セ後ョ縲悟燕縲阪ョ譁ケ縺ョ繝√ャ繝励r讀懃エ「 + { + if (listChip[i].n逋コ螢ー譎ょ綾ms >= n蟶梧悍逋コ螢ー譎ょ綾ms) + { + index_min = i; + break; + } + } + if (index_min < 0) // 蟶梧悍逋コ螢ー譎ょ綾縺ォ閾ウ繧峨★縺ォ譖イ縺檎オゆコ縺励※縺励∪縺蝣エ蜷 + { + // list縺ョ譛邨る逶ョ縺ョ譎ょ綾繧偵◎縺ョ縺セ縺セ菴ソ逕ィ縺吶k + //___縺ョ縺ァ縺ッ繝繝。縲BGM縺悟ーサ蛻繧後↓縺ェ繧九 + // 縺昴%縺ァ縲〕ist縺ョ譛邨る逶ョ縺ョ逋コ螢ー譎ょ綾ms縺ィ逋コ逕滉ス咲スョ縺九i縲∝ク梧悍逋コ螢ー譎ょ綾縺ォ逶ク蠖薙☆繧句ク梧悍逋コ螢ー菴咲スョ繧呈ッ比セ玖ィ育ョ励@縺ヲ豎ゅa繧九 + //n譁ー逋コ螢ー譎ょ綾ms = n蟶梧悍逋コ螢ー譎ょ綾ms; + //n譁ー逋コ螢ー菴咲スョ = listChip[ listChip.Count - 1 ].n逋コ螢ー菴咲スョ * n蟶梧悍逋コ螢ー譎ょ綾ms / listChip[ listChip.Count - 1 ].n逋コ螢ー譎ょ綾ms; + n譁ー逋コ螢ー譎ょ綾ms = listChip[listChip.Count - 1].n逋コ螢ー譎ょ綾ms; + n譁ー逋コ螢ー菴咲スョ = listChip[listChip.Count - 1].n逋コ螢ー菴咲スョ; + return false; + } + index_max = index_min + 1; + if (index_max >= listChip.Count) + { + index_max = index_min; + } + n譁ー逋コ螢ー譎ょ綾ms = (listChip[index_max].n逋コ螢ー譎ょ綾ms + listChip[index_min].n逋コ螢ー譎ょ綾ms) / 2; + n譁ー逋コ螢ー菴咲スョ = (listChip[index_max].n逋コ螢ー菴咲スョ + listChip[index_min].n逋コ螢ー菴咲スョ) / 2; + + return true; + } + + public void SwapGuitarBassInfos() + { + } + + // SwapGuitarBassInfos_AutoFlags()縺ッ縲,DTX縺九iCConfigIni縺ォ遘サ蜍輔 + + // CActivity 螳溯」 + private CPrivateFastFont pf豁瑚ゥ槭ヵ繧ゥ繝ウ繝; + public override void On豢サ諤ァ蛹() + { + if (!string.IsNullOrEmpty(TJAPlayer3.Skin.Game_Lyric_FontName)) + { + this.pf豁瑚ゥ槭ヵ繧ゥ繝ウ繝 = new CPrivateFastFont(new FontFamily(TJAPlayer3.Skin.Game_Lyric_FontName), TJAPlayer3.Skin.Game_Lyric_FontSize); + } + else + { + this.pf豁瑚ゥ槭ヵ繧ゥ繝ウ繝 = new CPrivateFastFont(new FontFamily("MS UI Gothic"), TJAPlayer3.Skin.Game_Lyric_FontSize); + } + this.listWAV = new Dictionary(); + this.listBPM = new Dictionary(); + this.listSCROLL = new Dictionary(); + this.listSCROLL_Normal = new Dictionary(); + this.listSCROLL_Expert = new Dictionary(); + this.listSCROLL_Master = new Dictionary(); + this.listJPOSSCROLL = new Dictionary(); + this.listDELAY = new Dictionary(); + this.listBRANCH = new Dictionary(); + this.listAVI = new Dictionary(); + this.listAVIPAN = new Dictionary(); + this.listDS = new Dictionary(); + this.listChip = new List(); + this.listChip_Branch = new List[3]; + this.listChip_Branch[0] = new List(); + this.listChip_Branch[1] = new List(); + this.listChip_Branch[2] = new List(); + this.listBalloon = new List(); + this.listBalloon_Normal = new List(); + this.listBalloon_Expert = new List(); + this.listBalloon_Master = new List(); + this.listLine = new List(); + this.listLyric = new List(); + this.listLyric2 = new List(); + this.List_DanSongs = new List(); + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + if (this.listWAV != null) + { + foreach (CWAV cwav in this.listWAV.Values) + { + cwav.Dispose(); + } + this.listWAV = null; + } + if (this.listAVI != null) + { + foreach (CAVI cavi in this.listAVI.Values) + { + cavi.Dispose(); + } + this.listAVI = null; + } + if (this.listAVIPAN != null) + { + this.listAVIPAN.Clear(); + this.listAVIPAN = null; + } + if (this.listDS != null) + { + foreach (CDirectShow cds in this.listDS.Values) + { + cds.Dispose(); + } + this.listDS = null; + } + if (this.listBPM != null) + { + this.listBPM.Clear(); + this.listBPM = null; + } + if (this.listDELAY != null) + { + this.listDELAY.Clear(); + this.listDELAY = null; + } + if (this.listBRANCH != null) + { + this.listBRANCH.Clear(); + this.listBRANCH = null; + } + if (this.listSCROLL != null) + { + this.listSCROLL.Clear(); + this.listSCROLL = null; + } + + if (this.listSCROLL_Normal != null) + { + this.listSCROLL_Normal.Clear(); + this.listSCROLL_Normal = null; + } + if (this.listSCROLL_Expert != null) + { + this.listSCROLL_Expert.Clear(); + this.listSCROLL_Expert = null; + } + if (this.listSCROLL_Master != null) + { + this.listSCROLL_Master.Clear(); + this.listSCROLL_Master = null; + } + if (this.listJPOSSCROLL != null) + { + this.listJPOSSCROLL.Clear(); + this.listJPOSSCROLL = null; + } + if (this.List_DanSongs != null) + { + this.List_DanSongs.Clear(); + this.List_DanSongs = null; + } + + if (this.listChip != null) + { + this.listChip.Clear(); + } + + if (this.listBalloon != null) + { + this.listBalloon.Clear(); + } + if (this.listBalloon_Normal != null) + { + this.listBalloon_Normal.Clear(); + } + if (this.listBalloon_Expert != null) + { + this.listBalloon_Expert.Clear(); + } + if (this.listBalloon_Master != null) + { + this.listBalloon_Master.Clear(); + } + if (this.listLyric != null) + { + this.listLyric.Clear(); + } + if (this.listLyric2 != null) + { + this.listLyric2.Clear(); + } + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + this.tAVI縺ョ隱ュ縺ソ霎シ縺ソ(); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + if (this.listAVI != null) + { + foreach (CAVI cavi in this.listAVI.Values) + { + cavi.Dispose(); + } + } + if (this.listDS != null) + { + foreach (CDirectShow cds in this.listDS.Values) + { + cds.Dispose(); + } + } + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k(ref this.pf豁瑚ゥ槭ヵ繧ゥ繝ウ繝); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + /// + /// GDA繝√Ε繝ウ繝阪Ν逡ェ蜿キ縺ォ蟇セ蠢懊☆繧汽TX繝√Ε繝ウ繝阪Ν逡ェ蜿キ縲 + /// + [StructLayout(LayoutKind.Sequential)] + private struct STGDAPARAM + { + public string strGDA縺ョ繝√Ε繝ウ繝阪Ν譁蟄怜; + public int nDTX縺ョ繝√Ε繝ウ繝阪Ν逡ェ蜿キ; + + public STGDAPARAM(string strGDA縺ョ繝√Ε繝ウ繝阪Ν譁蟄怜, int nDTX縺ョ繝√Ε繝ウ繝阪Ν逡ェ蜿キ) // 2011.1.1 yyagi 讒矩菴薙ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ霑ス蜉(蛻晄悄蛹也ー。譏灘喧縺ョ縺溘a) + { + this.strGDA縺ョ繝√Ε繝ウ繝阪Ν譁蟄怜 = strGDA縺ョ繝√Ε繝ウ繝阪Ν譁蟄怜; + this.nDTX縺ョ繝√Ε繝ウ繝阪Ν逡ェ蜿キ = nDTX縺ョ繝√Ε繝ウ繝阪Ν逡ェ蜿キ; + } + } + + private readonly STGDAPARAM[] stGDAParam; + private bool b繝倥ャ繝縺ョ縺ソ; + private Stack bstackIF縺九iENDIF繧偵せ繧ュ繝繝励☆繧; + + private int n迴セ蝨ィ縺ョ陦梧焚; + private int n迴セ蝨ィ縺ョ荵ア謨ー; + + private int nPolyphonicSounds = 4; // #28228 2012.5.1 yyagi + + private int n蜀驛ィ逡ェ蜿キBPM1to; + private int n蜀驛ィ逡ェ蜿キSCROLL1to; + private int n蜀驛ィ逡ェ蜿キJSCROLL1to; + private int n蜀驛ィ逡ェ蜿キDELAY1to; + private int n蜀驛ィ逡ェ蜿キBRANCH1to; + private int n蜀驛ィ逡ェ蜿キWAV1to; + private int[] n辟。髯千ョ。逅BPM; + private int[] n辟。髯千ョ。逅PAN; + private int[] n辟。髯千ョ。逅SIZE; + private int[] n辟。髯千ョ。逅WAV; + private int[] nRESULTIMAGE逕ィ蜆ェ蜈磯菴; + private int[] nRESULTMOVIE逕ィ蜆ェ蜈磯菴; + private int[] nRESULTSOUND逕ィ蜆ェ蜈磯菴; + + private void t陦後ョ繧ウ繝。繝ウ繝亥ヲ逅(ref string strText) + { + int nCommentPos = strText.IndexOf("//"); + if (nCommentPos != -1) + strText = strText.Remove(nCommentPos); + } + + private bool t蜈・蜉媽繧ウ繝槭Φ繝画枚蟄怜励r謚懊″蜃コ縺(ref CharEnumerator ce, ref StringBuilder sb譁蟄怜) + { + if (!this.t蜈・蜉媽遨コ逋ス繧偵せ繧ュ繝繝励☆繧(ref ce)) + return false; // 譁蟄励′蟆ス縺阪◆ + + #region [ 繧ウ繝槭Φ繝臥オらォッ譁蟄(':')縲∝濠隗堤ゥコ逋ス縲√さ繝。繝ウ繝磯幕蟋区枚蟄(';')縲∵隼陦後ョ縺縺壹l縺九′蜃コ迴セ縺吶k縺セ縺ァ繧偵さ繝槭Φ繝画枚蟄怜励→隕九↑縺励《b譁蟄怜 縺ォ繧ウ繝斐シ縺吶k縲] + //----------------- + while (ce.Current != ':' && ce.Current != ' ' && ce.Current != ';' && ce.Current != '\n') + { + sb譁蟄怜.Append(ce.Current); + + if (!ce.MoveNext()) + return false; // 譁蟄励′蟆ス縺阪◆ + } + //----------------- + #endregion + + #region [ 繧ウ繝槭Φ繝臥オらォッ譁蟄(':')縺ァ邨らォッ縺励◆縺ェ繧峨√◎縺ョ谺。縺九i遨コ逋ス繧偵せ繧ュ繝繝励@縺ヲ縺翫¥縲] + //----------------- + if (ce.Current == ':') + { + if (!ce.MoveNext()) + return false; // 譁蟄励′蟆ス縺阪◆ + + if (!this.t蜈・蜉媽遨コ逋ス繧偵せ繧ュ繝繝励☆繧(ref ce)) + return false; // 譁蟄励′蟆ス縺阪◆ + } + //----------------- + #endregion + + return true; + } + private bool t蜈・蜉媽繧ウ繝。繝ウ繝医r繧ケ繧ュ繝繝励☆繧(ref CharEnumerator ce) + { + // 謾ケ陦後′迴セ繧後k縺セ縺ァ繧偵さ繝。繝ウ繝医→隕九↑縺励※繧ケ繧ュ繝繝励☆繧九 + + while (ce.Current != '\n') + { + if (!ce.MoveNext()) + return false; // 譁蟄励′蟆ス縺阪◆ + } + + // 謾ケ陦後ョ谺。縺ョ譁蟄励∈遘サ蜍輔@縺溽オ先棡繧定ソ斐☆縲 + + return ce.MoveNext(); + } + private bool t蜈・蜉媽繧ウ繝。繝ウ繝域枚蟄怜励r謚懊″蜃コ縺(ref CharEnumerator ce, ref StringBuilder sb譁蟄怜) + { + if (ce.Current != ';') // 繧ウ繝。繝ウ繝磯幕蟋区枚蟄(';')縺倥c縺ェ縺代l縺ー豁」蟶ク蟶ー驍縲 + return true; + + if (!ce.MoveNext()) // ';' 縺ョ谺。縺ァ譁蟄怜励′邨ゅo縺」縺ヲ縺溘i邨ゆコ蟶ー驍縲 + return false; + + #region [ ';' 縺ョ谺。縺ョ譁蟄励°繧 '\n' 縺ョシ代▽蜑阪∪縺ァ繧偵さ繝。繝ウ繝域枚蟄怜励→隕九↑縺励《b譁蟄怜励↓繧ウ繝斐シ縺吶k縲] + //----------------- + while (ce.Current != '\n') + { + sb譁蟄怜.Append(ce.Current); + + if (!ce.MoveNext()) + return false; + } + //----------------- + #endregion + + return true; + } + private void t蜈・蜉媽繝代Λ繝。繝シ繧ソ鬟溘>霎シ縺ソ繝√ぉ繝繧ッ(string str繧ウ繝槭Φ繝牙錐, ref string str繧ウ繝槭Φ繝, ref string str繝代Λ繝。繝シ繧ソ) + { + if ((str繧ウ繝槭Φ繝.Length > str繧ウ繝槭Φ繝牙錐.Length) && str繧ウ繝槭Φ繝.StartsWith(str繧ウ繝槭Φ繝牙錐, StringComparison.OrdinalIgnoreCase)) + { + str繝代Λ繝。繝シ繧ソ = str繧ウ繝槭Φ繝.Substring(str繧ウ繝槭Φ繝牙錐.Length).Trim(); + str繧ウ繝槭Φ繝 = str繧ウ繝槭Φ繝.Substring(0, str繧ウ繝槭Φ繝牙錐.Length); + } + } + private bool t蜈・蜉媽繝代Λ繝。繝シ繧ソ譁蟄怜励r謚懊″蜃コ縺(ref CharEnumerator ce, ref StringBuilder sb譁蟄怜) + { + if (!this.t蜈・蜉媽遨コ逋ス繧偵せ繧ュ繝繝励☆繧(ref ce)) + return false; // 譁蟄励′蟆ス縺阪◆ + + #region [ 謾ケ陦後∪縺溘ッ繧ウ繝。繝ウ繝磯幕蟋区枚蟄(';')縺悟コ迴セ縺吶k縺セ縺ァ繧偵ヱ繝ゥ繝。繝シ繧ソ譁蟄怜励→隕九↑縺励《b譁蟄怜 縺ォ繧ウ繝斐シ縺吶k縲] + //----------------- + while (ce.Current != '\n' && ce.Current != ';') + { + sb譁蟄怜.Append(ce.Current); + + if (!ce.MoveNext()) + return false; + } + //----------------- + #endregion + + return true; + } + private bool t蜈・蜉媽遨コ逋ス縺ィ謾ケ陦後r繧ケ繧ュ繝繝励☆繧(ref CharEnumerator ce) + { + // 遨コ逋ス縺ィ謾ケ陦後′邯壹¥髢薙ッ縺薙l繧峨r繧ケ繧ュ繝繝励☆繧九 + + while (ce.Current == ' ' || ce.Current == '\n') + { + if (ce.Current == '\n') + this.n迴セ蝨ィ縺ョ陦梧焚++; // 謾ケ陦梧枚蟄励〒縺ッ陦檎分蜿キ縺悟「励∴繧九 + + if (!ce.MoveNext()) + return false; // 譁蟄励′蟆ス縺阪◆ + } + + return true; + } + private bool t蜈・蜉媽遨コ逋ス繧偵せ繧ュ繝繝励☆繧(ref CharEnumerator ce) + { + // 遨コ逋ス縺檎カ壹¥髢薙ッ縺薙l繧偵せ繧ュ繝繝励☆繧九 + + while (ce.Current == ' ') + { + if (!ce.MoveNext()) + return false; // 譁蟄励′蟆ス縺阪◆ + } + + return true; + } + private void t蜈・蜉媽陦瑚ァ」譫(ref StringBuilder sb繧ウ繝槭Φ繝, ref StringBuilder sb繝代Λ繝。繝シ繧ソ, ref StringBuilder sb繧ウ繝。繝ウ繝) + { + string str繧ウ繝槭Φ繝 = sb繧ウ繝槭Φ繝.ToString(); + string str繝代Λ繝。繝シ繧ソ = sb繝代Λ繝。繝シ繧ソ.ToString().Trim(); + string str繧ウ繝。繝ウ繝 = sb繧ウ繝。繝ウ繝.ToString(); + + // 陦碁ュ繧ウ繝槭Φ繝峨ョ蜃ヲ逅 + + #region [ IF ] + //----------------- + if (str繧ウ繝槭Φ繝.StartsWith("IF", StringComparison.OrdinalIgnoreCase)) + { + this.t蜈・蜉媽繝代Λ繝。繝シ繧ソ鬟溘>霎シ縺ソ繝√ぉ繝繧ッ("IF", ref str繧ウ繝槭Φ繝, ref str繝代Λ繝。繝シ繧ソ); + + if (this.bstackIF縺九iENDIF繧偵せ繧ュ繝繝励☆繧.Count == 255) + { + Trace.TraceWarning("#IF 縺ョ蜈・繧悟ュ舌ョ謨ー縺 255 繧定カ縺医∪縺励◆縲ゅ%縺ョ #IF 繧堤┌隕悶@縺セ縺吶[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚); + } + else if (this.bstackIF縺九iENDIF繧偵せ繧ュ繝繝励☆繧.Peek()) + { + this.bstackIF縺九iENDIF繧偵せ繧ュ繝繝励☆繧.Push(true); // 隕ェ縺 true 縺ェ繧峨◎縺ョ蜈・繧悟ュ舌b蝠冗ュ皮┌逕ィ縺ァ true 縲 + } + else // 隕ェ縺 false 縺ェ繧牙・繧悟ュ舌ッ繝代Λ繝。繝シ繧ソ縺ィ荵ア謨ー繧呈ッ碑シ縺励※邨先棡繧貞愛譁ュ縺吶k縲 + { + int n謨ー蛟、 = 0; + + if (!int.TryParse(str繝代Λ繝。繝シ繧ソ, out n謨ー蛟、)) + n謨ー蛟、 = 1; + + this.bstackIF縺九iENDIF繧偵せ繧ュ繝繝励☆繧.Push(n謨ー蛟、 != this.n迴セ蝨ィ縺ョ荵ア謨ー); // 荵ア謨ー縺ィ謨ー蛟、縺御ク閾エ縺励◆繧 true 縲 + } + } + //----------------- + #endregion + #region [ ENDIF ] + //----------------- + else if (str繧ウ繝槭Φ繝.StartsWith("ENDIF", StringComparison.OrdinalIgnoreCase)) + { + this.t蜈・蜉媽繝代Λ繝。繝シ繧ソ鬟溘>霎シ縺ソ繝√ぉ繝繧ッ("ENDIF", ref str繧ウ繝槭Φ繝, ref str繝代Λ繝。繝シ繧ソ); + + if (this.bstackIF縺九iENDIF繧偵せ繧ュ繝繝励☆繧.Count > 1) + { + this.bstackIF縺九iENDIF繧偵せ繧ュ繝繝励☆繧.Pop(); // 蜈・繧悟ュ舌rシ代▽閼ア蜃コ縲 + } + else + { + Trace.TraceWarning("#ENDIF 縺ォ蟇セ蠢懊☆繧 #IF 縺後≠繧翫∪縺帙s縲ゅ%縺ョ #ENDIF 繧堤┌隕悶@縺セ縺吶[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚); + } + } + //----------------- + #endregion + + else if (!this.bstackIF縺九iENDIF繧偵せ繧ュ繝繝励☆繧.Peek()) // IFス昿NDIF 繧偵せ繧ュ繝繝励☆繧九↑繧我サ・荳九ッ縺吶∋縺ヲ辟。隕悶 + { + #region [ PATH_WAV ] + //----------------- + if (str繧ウ繝槭Φ繝.StartsWith("PATH_WAV", StringComparison.OrdinalIgnoreCase)) + { + this.t蜈・蜉媽繝代Λ繝。繝シ繧ソ鬟溘>霎シ縺ソ繝√ぉ繝繧ッ("PATH_WAV", ref str繧ウ繝槭Φ繝, ref str繝代Λ繝。繝シ繧ソ); + this.PATH_WAV = str繝代Λ繝。繝シ繧ソ; + } + //----------------- + #endregion + #region [ TITLE ] + //----------------- + else if (str繧ウ繝槭Φ繝.StartsWith("TITLE", StringComparison.OrdinalIgnoreCase)) + { + //this.t蜈・蜉媽繝代Λ繝。繝シ繧ソ鬟溘>霎シ縺ソ繝√ぉ繝繧ッ( "TITLE", ref str繧ウ繝槭Φ繝, ref str繝代Λ繝。繝シ繧ソ ); + //this.TITLE = str繝代Λ繝。繝シ繧ソ; + } + //----------------- + #endregion + #region [ ARTIST ] + //----------------- + else if (str繧ウ繝槭Φ繝.StartsWith("ARTIST", StringComparison.OrdinalIgnoreCase)) + { + this.t蜈・蜉媽繝代Λ繝。繝シ繧ソ鬟溘>霎シ縺ソ繝√ぉ繝繧ッ("ARTIST", ref str繧ウ繝槭Φ繝, ref str繝代Λ繝。繝シ繧ソ); + this.ARTIST = str繝代Λ繝。繝シ繧ソ; + } + //----------------- + #endregion + #region [ COMMENT ] + //----------------- + else if (str繧ウ繝槭Φ繝.StartsWith("COMMENT", StringComparison.OrdinalIgnoreCase)) + { + this.t蜈・蜉媽繝代Λ繝。繝シ繧ソ鬟溘>霎シ縺ソ繝√ぉ繝繧ッ("COMMENT", ref str繧ウ繝槭Φ繝, ref str繝代Λ繝。繝シ繧ソ); + this.COMMENT = str繝代Λ繝。繝シ繧ソ; + } + //----------------- + #endregion + #region [ GENRE ] + //----------------- + else if (str繧ウ繝槭Φ繝.StartsWith("GENRE", StringComparison.OrdinalIgnoreCase)) + { + this.t蜈・蜉媽繝代Λ繝。繝シ繧ソ鬟溘>霎シ縺ソ繝√ぉ繝繧ッ("GENRE", ref str繧ウ繝槭Φ繝, ref str繝代Λ繝。繝シ繧ソ); + this.GENRE = str繝代Λ繝。繝シ繧ソ; + } + //----------------- + #endregion + #region [ HIDDENLEVEL ] + //----------------- + else if (str繧ウ繝槭Φ繝.StartsWith("HIDDENLEVEL", StringComparison.OrdinalIgnoreCase)) + { + this.t蜈・蜉媽繝代Λ繝。繝シ繧ソ鬟溘>霎シ縺ソ繝√ぉ繝繧ッ("HIDDENLEVEL", ref str繧ウ繝槭Φ繝, ref str繝代Λ繝。繝シ繧ソ); + this.HIDDENLEVEL = str繝代Λ繝。繝シ繧ソ.ToLower().Equals("on"); + } + //----------------- + #endregion + #region [ PREVIEW ] + //----------------- + else if (str繧ウ繝槭Φ繝.StartsWith("PREVIEW", StringComparison.OrdinalIgnoreCase)) + { + this.t蜈・蜉媽繝代Λ繝。繝シ繧ソ鬟溘>霎シ縺ソ繝√ぉ繝繧ッ("PREVIEW", ref str繧ウ繝槭Φ繝, ref str繝代Λ繝。繝シ繧ソ); + this.PREVIEW = str繝代Λ繝。繝シ繧ソ; + } + //----------------- + #endregion + #region [ PREIMAGE ] + //----------------- + else if (str繧ウ繝槭Φ繝.StartsWith("PREIMAGE", StringComparison.OrdinalIgnoreCase)) + { + this.t蜈・蜉媽繝代Λ繝。繝シ繧ソ鬟溘>霎シ縺ソ繝√ぉ繝繧ッ("PREIMAGE", ref str繧ウ繝槭Φ繝, ref str繝代Λ繝。繝シ繧ソ); + this.PREIMAGE = str繝代Λ繝。繝シ繧ソ; + } + //----------------- + #endregion + #region [ RANDOM ] + //----------------- + else if (str繧ウ繝槭Φ繝.StartsWith("RANDOM", StringComparison.OrdinalIgnoreCase)) + { + this.t蜈・蜉媽繝代Λ繝。繝シ繧ソ鬟溘>霎シ縺ソ繝√ぉ繝繧ッ("RANDOM", ref str繧ウ繝槭Φ繝, ref str繝代Λ繝。繝シ繧ソ); + + int n謨ー蛟、 = 1; + if (!int.TryParse(str繝代Λ繝。繝シ繧ソ, out n謨ー蛟、)) + n謨ー蛟、 = 1; + + this.n迴セ蝨ィ縺ョ荵ア謨ー = TJAPlayer3.Random.Next(n謨ー蛟、) + 1; // 1ス樊焚蛟、 縺セ縺ァ縺ョ荵ア謨ー繧堤函謌舌 + } + //----------------- + #endregion + #region [ BPM ] + //----------------- + else if (str繧ウ繝槭Φ繝.StartsWith("BPM", StringComparison.OrdinalIgnoreCase)) + { + //this.t蜈・蜉媽陦瑚ァ」譫神BPM_BPMzz( str繧ウ繝槭Φ繝, str繝代Λ繝。繝シ繧ソ, str繧ウ繝。繝ウ繝 ); + } + //----------------- + #endregion + #region [ DTXVPLAYSPEED ] + //----------------- + else if (str繧ウ繝槭Φ繝.StartsWith("DTXVPLAYSPEED", StringComparison.OrdinalIgnoreCase)) + { + this.t蜈・蜉媽繝代Λ繝。繝シ繧ソ鬟溘>霎シ縺ソ繝√ぉ繝繧ッ("DTXVPLAYSPEED", ref str繧ウ繝槭Φ繝, ref str繝代Λ繝。繝シ繧ソ); + + double dtxvplayspeed = 0.0; + if (TryParse(str繝代Λ繝。繝シ繧ソ, out dtxvplayspeed) && dtxvplayspeed > 0.0) + { + this.dbDTXVPlaySpeed = dtxvplayspeed; + } + } + //----------------- + #endregion + else if (!this.b繝倥ャ繝縺ョ縺ソ) // 繝倥ャ繝縺ョ縺ソ縺ョ隗」譫舌ョ蝣エ蜷医∽サ・荳九ッ辟。隕悶 + { + #region [ PANEL ] + //----------------- + if (str繧ウ繝槭Φ繝.StartsWith("PANEL", StringComparison.OrdinalIgnoreCase)) + { + this.t蜈・蜉媽繝代Λ繝。繝シ繧ソ鬟溘>霎シ縺ソ繝√ぉ繝繧ッ("PANEL", ref str繧ウ繝槭Φ繝, ref str繝代Λ繝。繝シ繧ソ); + + int dummyResult; // #23885 2010.12.12 yyagi: not to confuse "#PANEL strings (panel)" and "#PANEL int (panpot of EL)" + if (!int.TryParse(str繝代Λ繝。繝シ繧ソ, out dummyResult)) + { // 謨ー蛟、縺倥c縺ェ縺縺ェ繧臼ANEL縺ィ縺ソ縺ェ縺 + this.PANEL = str繝代Λ繝。繝シ繧ソ; // + goto EOL; // + } // 謨ー蛟、縺ェ繧臼AN EL縺ィ縺ソ縺ェ縺 + + } + //----------------- + #endregion + #region [ BASEBPM ] + //----------------- + else if (str繧ウ繝槭Φ繝.StartsWith("BASEBPM", StringComparison.OrdinalIgnoreCase)) + { + this.t蜈・蜉媽繝代Λ繝。繝シ繧ソ鬟溘>霎シ縺ソ繝√ぉ繝繧ッ("BASEBPM", ref str繧ウ繝槭Φ繝, ref str繝代Λ繝。繝シ繧ソ); + + double basebpm = 0.0; + //if( double.TryParse( str2, out num6 ) && ( num6 > 0.0 ) ) + if (TryParse(str繝代Λ繝。繝シ繧ソ, out basebpm) && basebpm > 0.0) // #23880 2010.12.30 yyagi: alternative TryParse to permit both '.' and ',' for decimal point + { // #24204 2011.01.21 yyagi: Fix the condition correctly + this.BASEBPM = basebpm; + } + } + //----------------- + #endregion + + // 繧ェ繝悶ず繧ァ繧ッ繝郁ィ倩ソー繧ウ繝槭Φ繝峨ョ蜃ヲ逅縲 + + else if ( + !this.t蜈・蜉媽陦瑚ァ」譫神WAVPAN_PAN(str繧ウ繝槭Φ繝, str繝代Λ繝。繝シ繧ソ, str繧ウ繝。繝ウ繝) && + !this.t蜈・蜉媽陦瑚ァ」譫神AVIPAN(str繧ウ繝槭Φ繝, str繝代Λ繝。繝シ繧ソ, str繧ウ繝。繝ウ繝) && + !this.t蜈・蜉媽陦瑚ァ」譫神AVI_VIDEO(str繧ウ繝槭Φ繝, str繝代Λ繝。繝シ繧ソ, str繧ウ繝。繝ウ繝) && + // !this.t蜈・蜉媽陦瑚ァ」譫神BPM_BPMzz( str繧ウ繝槭Φ繝, str繝代Λ繝。繝シ繧ソ, str繧ウ繝。繝ウ繝 ) && // b繝倥ャ繝縺ョ縺ソ==true縺ョ蝣エ蜷医〒繧ゅメ繧ァ繝繧ッ縺吶k繧医≧螟画峩 + !this.t蜈・蜉媽陦瑚ァ」譫神SIZE(str繧ウ繝槭Φ繝, str繝代Λ繝。繝シ繧ソ, str繧ウ繝。繝ウ繝)) + { + this.t蜈・蜉媽陦瑚ァ」譫神繝√ャ繝鈴咲スョ(str繧ウ繝槭Φ繝, str繝代Λ繝。繝シ繧ソ, str繧ウ繝。繝ウ繝); + } + EOL: + Debug.Assert(true); // #23885 2010.12.12 yyagi: dummy line to exit parsing the line + // 2011.8.17 from: "int xx=0;" 縺九i螟画峩縲よッ主屓隴ヲ蜻翫′蜃コ繧九ョ縺ァ縲 + } + //else + //{ // Duration貂ャ螳壹ョ縺溘a縲|繝倥ャ繝縺ョ縺ソ==true縺ァ繧ゅ√メ繝繝鈴咲スョ縺ッ陦後≧ + // this.t蜈・蜉媽陦瑚ァ」譫神繝√ャ繝鈴咲スョ( str繧ウ繝槭Φ繝, str繝代Λ繝。繝シ繧ソ, str繧ウ繝。繝ウ繝 ); + //} + } + } + private bool t蜈・蜉媽陦瑚ァ」譫神AVI_VIDEO(string str繧ウ繝槭Φ繝, string str繝代Λ繝。繝シ繧ソ, string str繧ウ繝。繝ウ繝) + { + // (1) 繧ウ繝槭Φ繝峨r蜃ヲ逅縲 + + #region [ "AVI" or "VIDEO" 縺ァ蟋九∪繧峨↑縺繧ウ繝槭Φ繝峨ッ辟。蜉ケ縲] + //----------------- + if (str繧ウ繝槭Φ繝.StartsWith("AVI", StringComparison.OrdinalIgnoreCase)) + str繧ウ繝槭Φ繝 = str繧ウ繝槭Φ繝.Substring(3); // str繧ウ繝槭Φ繝 縺九i蜈磯ュ縺ョ"AVI"譁蟄励r髯、蜴サ縲 + + else if (str繧ウ繝槭Φ繝.StartsWith("VIDEO", StringComparison.OrdinalIgnoreCase)) + str繧ウ繝槭Φ繝 = str繧ウ繝槭Φ繝.Substring(5); // str繧ウ繝槭Φ繝 縺九i蜈磯ュ縺ョ"VIDEO"譁蟄励r髯、蜴サ縲 + + else + return false; + //----------------- + #endregion + + // (2) 繝代Λ繝。繝シ繧ソ繧貞ヲ逅縲 + + if (str繧ウ繝槭Φ繝.Length < 2) + return false; // AVI逡ェ蜿キ zz 縺後↑縺縺ェ繧臥┌蜉ケ縲 + + #region [ AVI逡ェ蜿キ zz 繧貞叙蠕励☆繧九] + //----------------- + int zz = C螟画鋤.n36騾イ謨ー2譯√ョ譁蟄怜励r謨ー蛟、縺ォ螟画鋤縺励※霑斐☆(str繧ウ繝槭Φ繝.Substring(0, 2)); + if (zz < 0 || zz >= 36 * 36) + { + Trace.TraceError("AVI(VIDEO)逡ェ蜿キ縺ォ 00ス杙Z 莉・螟悶ョ蛟、縺セ縺溘ッ荳肴ュ」縺ェ譁蟄怜励′謖螳壹&繧後∪縺励◆縲[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚); + return false; + } + //----------------- + #endregion + + #region [ AVI繝ェ繧ケ繝医↓ {zz, avi} 縺ョ邨繧堤匳骭イ縺吶k縲 ] + //----------------- + var avi = new CAVI() + { + n逡ェ蜿キ = zz, + str繝輔ぃ繧、繝ォ蜷 = str繝代Λ繝。繝シ繧ソ, + str繧ウ繝。繝ウ繝域枚 = str繧ウ繝。繝ウ繝, + }; + + if (this.listAVI.ContainsKey(zz)) // 譌「縺ォ繝ェ繧ケ繝井クュ縺ォ蟄伜惠縺励※縺繧九↑繧牙炎髯、縲ょセ後ョ繧ゅョ縺梧怏蜉ケ縲 + this.listAVI.Remove(zz); + + this.listAVI.Add(zz, avi); + + var ds = new CDirectShow() + { + n逡ェ蜿キ = zz, + str繝輔ぃ繧、繝ォ蜷 = str繝代Λ繝。繝シ繧ソ, + str繧ウ繝。繝ウ繝域枚 = str繧ウ繝。繝ウ繝, + }; + + if (this.listDS.ContainsKey(zz)) // 譌「縺ォ繝ェ繧ケ繝井クュ縺ォ蟄伜惠縺励※縺繧九↑繧牙炎髯、縲ょセ後ョ繧ゅョ縺梧怏蜉ケ縲 + this.listDS.Remove(zz); + + this.listDS.Add(zz, ds); + //----------------- + #endregion + + return true; + } + private bool t蜈・蜉媽陦瑚ァ」譫神AVIPAN(string str繧ウ繝槭Φ繝, string str繝代Λ繝。繝シ繧ソ, string str繧ウ繝。繝ウ繝) + { + // (1) 繧ウ繝槭Φ繝峨r蜃ヲ逅縲 + + #region [ "AVIPAN" 縺ァ蟋九∪繧峨↑縺繧ウ繝槭Φ繝峨ッ辟。蜉ケ縲] + //----------------- + if (!str繧ウ繝槭Φ繝.StartsWith("AVIPAN", StringComparison.OrdinalIgnoreCase)) + return false; + + str繧ウ繝槭Φ繝 = str繧ウ繝槭Φ繝.Substring(6); // str繧ウ繝槭Φ繝 縺九i蜈磯ュ縺ョ"AVIPAN"譁蟄励r髯、蜴サ縲 + //----------------- + #endregion + + // (2) 繝代Λ繝。繝シ繧ソ繧貞ヲ逅縲 + + if (str繧ウ繝槭Φ繝.Length < 2) + return false; // AVIPAN逡ェ蜿キ zz 縺後↑縺縺ェ繧臥┌蜉ケ縲 + + #region [ AVIPAN逡ェ蜿キ zz 繧貞叙蠕励☆繧九] + //----------------- + int zz = C螟画鋤.n36騾イ謨ー2譯√ョ譁蟄怜励r謨ー蛟、縺ォ螟画鋤縺励※霑斐☆(str繧ウ繝槭Φ繝.Substring(0, 2)); + if (zz < 0 || zz >= 36 * 36) + { + Trace.TraceError("AVIPAN逡ェ蜿キ縺ォ 00ス杙Z 莉・螟悶ョ蛟、縺セ縺溘ッ荳肴ュ」縺ェ譁蟄怜励′謖螳壹&繧後∪縺励◆縲[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚); + return false; + } + //----------------- + #endregion + + var avipan = new CAVIPAN() + { + n逡ェ蜿キ = zz, + }; + + // 繝代Λ繝。繝シ繧ソ蠑墓焚シ14蛟具シ峨r蜿門セ励@縲‖vipan 縺ォ逋サ骭イ縺励※縺縺上 + + string[] strParams = str繝代Λ繝。繝シ繧ソ.Split(new char[] { ' ', ',', '(', ')', '[', ']', 'x', '|' }, StringSplitOptions.RemoveEmptyEntries); + + #region [ 繝代Λ繝。繝シ繧ソ蠑墓焚縺ッ蜈ィ14蛟九↑縺縺ィ辟。蜉ケ縲] + //----------------- + if (strParams.Length < 14) + { + Trace.TraceError("AVIPAN: 蠑墓焚縺瑚カウ繧翫∪縺帙s縲[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚); + return false; + } + //----------------- + #endregion + + int i = 0; + int n蛟、 = 0; + + #region [ 1. AVI逡ェ蜿キ ] + //----------------- + if (string.IsNullOrEmpty(strParams[i]) || strParams[i].Length > 2) + { + Trace.TraceError("AVIPAN: {2}逡ェ逶ョ縺ョ謨ーシAVI逡ェ蜿キシ峨′逡ー蟶ク縺ァ縺吶[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚, i + 1); + return false; + } + avipan.nAVI逡ェ蜿キ = C螟画鋤.n36騾イ謨ー2譯√ョ譁蟄怜励r謨ー蛟、縺ォ螟画鋤縺励※霑斐☆(strParams[i]); + if (avipan.nAVI逡ェ蜿キ < 1 || avipan.nAVI逡ェ蜿キ >= 36 * 36) + { + Trace.TraceError("AVIPAN: {2}逡ェ逶ョ縺ョ謨ーシAVI逡ェ蜿キシ峨′逡ー蟶ク縺ァ縺吶[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚, i + 1); + return false; + } + i++; + //----------------- + #endregion + #region [ 2. 髢句ァ玖サ「騾√し繧、繧コ_蟷 ] + //----------------- + n蛟、 = 0; + if (!int.TryParse(strParams[i], out n蛟、)) + { + Trace.TraceError("AVIPAN: {2}逡ェ逶ョ縺ョ蠑墓焚シ磯幕蟋玖サ「騾√し繧、繧コ_蟷シ峨′逡ー蟶ク縺ァ縺吶[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚, i + 1); + return false; + } + avipan.sz髢句ァ九し繧、繧コ.Width = n蛟、; + i++; + //----------------- + #endregion + #region [ 3. 霆「騾√し繧、繧コ_鬮倥& ] + //----------------- + n蛟、 = 0; + if (!int.TryParse(strParams[i], out n蛟、)) + { + Trace.TraceError("AVIPAN: {2}逡ェ逶ョ縺ョ蠑墓焚シ磯幕蟋玖サ「騾√し繧、繧コ_鬮倥&シ峨′逡ー蟶ク縺ァ縺吶[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚, i + 1); + return false; + } + avipan.sz髢句ァ九し繧、繧コ.Height = n蛟、; + i++; + //----------------- + #endregion + #region [ 4. 邨ゆコ霆「騾√し繧、繧コ_蟷 ] + //----------------- + n蛟、 = 0; + if (!int.TryParse(strParams[i], out n蛟、)) + { + Trace.TraceError("AVIPAN: {2}逡ェ逶ョ縺ョ蠑墓焚シ育オゆコ霆「騾√し繧、繧コ_蟷シ峨′逡ー蟶ク縺ァ縺吶[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚, i + 1); + return false; + } + avipan.sz邨ゆコ繧オ繧、繧コ.Width = n蛟、; + i++; + //----------------- + #endregion + #region [ 5. 邨ゆコ霆「騾√し繧、繧コ_鬮倥& ] + //----------------- + n蛟、 = 0; + if (!int.TryParse(strParams[i], out n蛟、)) + { + Trace.TraceError("AVIPAN: {2}逡ェ逶ョ縺ョ蠑墓焚シ育オゆコ霆「騾√し繧、繧コ_鬮倥&シ峨′逡ー蟶ク縺ァ縺吶[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚, i + 1); + return false; + } + avipan.sz邨ゆコ繧オ繧、繧コ.Height = n蛟、; + i++; + //----------------- + #endregion + #region [ 6. 蜍慕判蛛エ髢句ァ倶ス咲スョ_X ] + //----------------- + n蛟、 = 0; + if (!int.TryParse(strParams[i], out n蛟、)) + { + Trace.TraceError("AVIPAN: {2}逡ェ逶ョ縺ョ蠑墓焚シ亥虚逕サ蛛エ髢句ァ倶ス咲スョ_Xシ峨′逡ー蟶ク縺ァ縺吶[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚, i + 1); + return false; + } + avipan.pt蜍慕判蛛エ髢句ァ倶ス咲スョ.X = n蛟、; + i++; + //----------------- + #endregion + #region [ 7. 蜍慕判蛛エ髢句ァ倶ス咲スョ_Y ] + //----------------- + n蛟、 = 0; + if (!int.TryParse(strParams[i], out n蛟、)) + { + Trace.TraceError("AVIPAN: {2}逡ェ逶ョ縺ョ蠑墓焚シ亥虚逕サ蛛エ髢句ァ倶ス咲スョ_Yシ峨′逡ー蟶ク縺ァ縺吶[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚, i + 1); + return false; + } + avipan.pt蜍慕判蛛エ髢句ァ倶ス咲スョ.Y = n蛟、; + i++; + //----------------- + #endregion + #region [ 8. 蜍慕判蛛エ邨ゆコ菴咲スョ_X ] + //----------------- + n蛟、 = 0; + if (!int.TryParse(strParams[i], out n蛟、)) + { + Trace.TraceError("AVIPAN: {2}逡ェ逶ョ縺ョ蠑墓焚シ亥虚逕サ蛛エ邨ゆコ菴咲スョ_Xシ峨′逡ー蟶ク縺ァ縺吶[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚, i + 1); + return false; + } + avipan.pt蜍慕判蛛エ邨ゆコ菴咲スョ.X = n蛟、; + i++; + //----------------- + #endregion + #region [ 9. 蜍慕判蛛エ邨ゆコ菴咲スョ_Y ] + //----------------- + n蛟、 = 0; + if (!int.TryParse(strParams[i], out n蛟、)) + { + Trace.TraceError("AVIPAN: {2}逡ェ逶ョ縺ョ蠑墓焚シ亥虚逕サ蛛エ邨ゆコ菴咲スョ_Yシ峨′逡ー蟶ク縺ァ縺吶[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚, i + 1); + return false; + } + avipan.pt蜍慕判蛛エ邨ゆコ菴咲スョ.Y = n蛟、; + i++; + //----------------- + #endregion + #region [ 10.陦ィ遉コ蛛エ髢句ァ倶ス咲スョ_X ] + //----------------- + n蛟、 = 0; + if (!int.TryParse(strParams[i], out n蛟、)) + { + Trace.TraceError("AVIPAN: {2}逡ェ逶ョ縺ョ蠑墓焚シ郁。ィ遉コ蛛エ髢句ァ倶ス咲スョ_Xシ峨′逡ー蟶ク縺ァ縺吶[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚, i + 1); + return false; + } + avipan.pt陦ィ遉コ蛛エ髢句ァ倶ス咲スョ.X = n蛟、; + i++; + //----------------- + #endregion + #region [ 11.陦ィ遉コ蛛エ髢句ァ倶ス咲スョ_Y ] + //----------------- + n蛟、 = 0; + if (!int.TryParse(strParams[i], out n蛟、)) + { + Trace.TraceError("AVIPAN: {2}逡ェ逶ョ縺ョ蠑墓焚シ郁。ィ遉コ蛛エ髢句ァ倶ス咲スョ_Yシ峨′逡ー蟶ク縺ァ縺吶[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚, i + 1); + return false; + } + avipan.pt陦ィ遉コ蛛エ髢句ァ倶ス咲スョ.Y = n蛟、; + i++; + //----------------- + #endregion + #region [ 12.陦ィ遉コ蛛エ邨ゆコ菴咲スョ_X ] + //----------------- + n蛟、 = 0; + if (!int.TryParse(strParams[i], out n蛟、)) + { + Trace.TraceError("AVIPAN: {2}逡ェ逶ョ縺ョ蠑墓焚シ郁。ィ遉コ蛛エ邨ゆコ菴咲スョ_Xシ峨′逡ー蟶ク縺ァ縺吶[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚, i + 1); + return false; + } + avipan.pt陦ィ遉コ蛛エ邨ゆコ菴咲スョ.X = n蛟、; + i++; + //----------------- + #endregion + #region [ 13.陦ィ遉コ蛛エ邨ゆコ菴咲スョ_Y ] + //----------------- + n蛟、 = 0; + if (!int.TryParse(strParams[i], out n蛟、)) + { + Trace.TraceError("AVIPAN: {2}逡ェ逶ョ縺ョ蠑墓焚シ郁。ィ遉コ蛛エ邨ゆコ菴咲スョ_Yシ峨′逡ー蟶ク縺ァ縺吶[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚, i + 1); + return false; + } + avipan.pt陦ィ遉コ蛛エ邨ゆコ菴咲スョ.Y = n蛟、; + i++; + //----------------- + #endregion + #region [ 14.遘サ蜍墓凾髢 ] + //----------------- + n蛟、 = 0; + if (!int.TryParse(strParams[i], out n蛟、)) + { + Trace.TraceError("AVIPAN: {2}逡ェ逶ョ縺ョ蠑墓焚シ育ァサ蜍墓凾髢難シ峨′逡ー蟶ク縺ァ縺吶[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚, i + 1); + return false; + } + + if (n蛟、 < 0) + n蛟、 = 0; + + avipan.n遘サ蜍墓凾髢田t = n蛟、; + i++; + //----------------- + #endregion + + #region [ AVIPAN繝ェ繧ケ繝医↓ {zz, avipan} 縺ョ邨繧堤匳骭イ縺吶k縲] + //----------------- + if (this.listAVIPAN.ContainsKey(zz)) // 譌「縺ォ繝ェ繧ケ繝井クュ縺ォ蟄伜惠縺励※縺繧九↑繧牙炎髯、縲ょセ後ョ繧ゅョ縺梧怏蜉ケ縲 + this.listAVIPAN.Remove(zz); + + this.listAVIPAN.Add(zz, avipan); + //----------------- + #endregion + + return true; + } + private bool t蜈・蜉媽陦瑚ァ」譫神BPM_BPMzz(string str繧ウ繝槭Φ繝, string str繝代Λ繝。繝シ繧ソ, string str繧ウ繝。繝ウ繝) + { + // (1) 繧ウ繝槭Φ繝峨r蜃ヲ逅縲 + + #region [ "BPM" 縺ァ蟋九∪繧峨↑縺繧ウ繝槭Φ繝峨ッ辟。蜉ケ縲] + //----------------- + if (!str繧ウ繝槭Φ繝.StartsWith("BPM", StringComparison.OrdinalIgnoreCase)) + return false; + + str繧ウ繝槭Φ繝 = str繧ウ繝槭Φ繝.Substring(3); // str繧ウ繝槭Φ繝 縺九i蜈磯ュ縺ョ"BPM"譁蟄励r髯、蜴サ縲 + //----------------- + #endregion + + // (2) 繝代Λ繝。繝シ繧ソ繧貞ヲ逅縲 + + int zz = 0; + + #region [ BPM逡ェ蜿キ zz 繧貞叙蠕励☆繧九] + //----------------- + if (str繧ウ繝槭Φ繝.Length < 2) + { + #region [ (A) "#BPM:" 縺ョ蝣エ蜷 竊 zz = 00 ] + //----------------- + zz = 0; + //----------------- + #endregion + } + else + { + #region [ (B) "#BPMzz:" 縺ョ蝣エ蜷 竊 zz = 00 ス ZZ ] + //----------------- + zz = C螟画鋤.n36騾イ謨ー2譯√ョ譁蟄怜励r謨ー蛟、縺ォ螟画鋤縺励※霑斐☆(str繧ウ繝槭Φ繝.Substring(0, 2)); + if (zz < 0 || zz >= 36 * 36) + { + Trace.TraceError("BPM逡ェ蜿キ縺ォ 00ス杙Z 莉・螟悶ョ蛟、縺セ縺溘ッ荳肴ュ」縺ェ譁蟄怜励′謖螳壹&繧後∪縺励◆縲[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚); + return false; + } + //----------------- + #endregion + } + //----------------- + #endregion + + double dbBPM = 0.0; + + #region [ BPM蛟、繧貞叙蠕励☆繧九] + //----------------- + //if( !double.TryParse( str繝代Λ繝。繝シ繧ソ, out result ) ) + if (!TryParse(str繝代Λ繝。繝シ繧ソ, out dbBPM)) // #23880 2010.12.30 yyagi: alternative TryParse to permit both '.' and ',' for decimal point + return false; + + if (dbBPM <= 0.0) + return false; + //----------------- + #endregion + + if (zz == 0) // "#BPM00:" 縺ィ "#BPM:" 縺ッ遲我セ。縲 + this.BPM = dbBPM; // 縺薙ョ譖イ縺ョ莉」陦ィ BPM 縺ォ譬シ邏阪☆繧九 + + #region [ BPM繝ェ繧ケ繝医↓ {蜀驛ィ逡ェ蜿キ, zz, dbBPM} 縺ョ邨繧堤匳骭イ縲] + //----------------- + this.listBPM.Add( + this.n蜀驛ィ逡ェ蜿キBPM1to, + new CBPM() + { + n蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キBPM1to, + n陦ィ險倅ク翫ョ逡ェ蜿キ = zz, + dbBPM蛟、 = dbBPM, + }); + //----------------- + #endregion + + #region [ BPM逡ェ蜿キ縺 zz 縺ァ縺ゅkBPM譛ェ險ュ螳壹ョBPM繝√ャ繝励′縺ゅl縺ー縲√◎縺ョ繧オ繧、繧コ繧貞、画峩縺吶k縲ら┌髯千ョ。逅縺ォ蟇セ蠢懊] + //----------------- + if (this.n辟。髯千ョ。逅BPM[zz] == -zz) // 蛻晄悄迥カ諷九〒縺ッ n辟。髯千ョ。逅BPM[zz] = -zz 縺ァ縺ゅk縲ゅ%縺ョ蝣エ蜷医#BPMzz 縺後∪縺蜃コ迴セ縺励※縺縺ェ縺縺薙→繧呈э蜻ウ縺吶k縲 + { + for (int i = 0; i < this.listChip.Count; i++) // 縺薙l縺セ縺ァ縺ォ蜃コ縺ヲ縺阪◆繝√ャ繝励ョ縺縺。縲∬ゥイ蠖薙☆繧具シBPM蛟、縺梧悴險ュ螳壹ョシ隠PM繝√ャ繝励ョ蛟、繧貞、画峩縺吶kシ井サ慕オ縺ソ荳翫∝ソ縺壼セ梧婿蜿らァ縺ィ縺ェ繧具シ峨 + { + var chip = this.listChip[i]; + + if (chip.bBPM繝√ャ繝励〒縺ゅk && chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ == -zz) // #BPMzz 陦後h繧雁燕縺ョ陦後↓蜃コ迴セ縺励◆ #BPMzz 縺ァ縺ッ縲∵紛謨ー蛟、_蜀驛ィ逡ェ蜿キ縺ッ -zz 縺ォ蛻晄悄蛹悶&繧後※縺繧九 + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = this.n蜀驛ィ逡ェ蜿キBPM1to; + } + } + this.n辟。髯千ョ。逅BPM[zz] = this.n蜀驛ィ逡ェ蜿キBPM1to; // 谺。縺ォ縺薙ョ BPM逡ェ蜿キ zz 繧剃スソ縺BPM繝√ャ繝励′迴セ繧後◆繧峨√%縺ョBPM蛟、縺梧シ邏阪&繧後k縺薙→縺ォ縺ェ繧九 + this.n蜀驛ィ逡ェ蜿キBPM1to++; // 蜀驛ィ逡ェ蜿キ縺ッ蜊倡エ泌「怜刈騾」逡ェ縲 + //----------------- + #endregion + + return true; + } + + private bool t蜈・蜉媽陦瑚ァ」譫神SIZE(string str繧ウ繝槭Φ繝, string str繝代Λ繝。繝シ繧ソ, string str繧ウ繝。繝ウ繝) + { + // (1) 繧ウ繝槭Φ繝峨r蜃ヲ逅縲 + + #region [ "SIZE" 縺ァ蟋九∪繧峨↑縺繧ウ繝槭Φ繝峨d縲√◎縺ョ蠕後m縺ォ2譁蟄暦シ育分蜿キシ峨′莉倬囂縺励※縺ェ縺繧ウ繝槭Φ繝峨ッ辟。蜉ケ縲] + //----------------- + if (!str繧ウ繝槭Φ繝.StartsWith("SIZE", StringComparison.OrdinalIgnoreCase)) + return false; + + str繧ウ繝槭Φ繝 = str繧ウ繝槭Φ繝.Substring(4); // str繧ウ繝槭Φ繝 縺九i蜈磯ュ縺ョ"SIZE"譁蟄励r髯、蜴サ縲 + + if (str繧ウ繝槭Φ繝.Length < 2) // 繧オ繧、繧コ逡ェ蜿キ縺ョ謖螳壹′縺ェ縺蝣エ蜷医ッ辟。蜉ケ縲 + return false; + //----------------- + #endregion + + #region [ nWAV逡ェ蜿キシ36騾イ謨ー2譯シ峨r蜿門セ励] + //----------------- + int nWAV逡ェ蜿キ = C螟画鋤.n36騾イ謨ー2譯√ョ譁蟄怜励r謨ー蛟、縺ォ螟画鋤縺励※霑斐☆(str繧ウ繝槭Φ繝.Substring(0, 2)); + + if (nWAV逡ェ蜿キ < 0 || nWAV逡ェ蜿キ >= 36 * 36) + { + Trace.TraceError("SIZE縺ョWAV逡ェ蜿キ縺ォ 00ス杙Z 莉・螟悶ョ蛟、縺セ縺溘ッ荳肴ュ」縺ェ譁蟄怜励′謖螳壹&繧後∪縺励◆縲[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚); + return false; + } + //----------------- + #endregion + + + // (2) 繝代Λ繝。繝シ繧ソ繧貞ヲ逅縲 + + #region [ n繧オ繧、繧コ蛟、 繧貞叙蠕励☆繧九ょ、縺ッ 0ス100 縺ォ蜿弱a繧九] + //----------------- + int n繧オ繧、繧コ蛟、; + + if (!int.TryParse(str繝代Λ繝。繝シ繧ソ, out n繧オ繧、繧コ蛟、)) + return true; // int螟画鋤縺ォ螟ア謨励@縺ヲ繧ゅ√%縺ョ陦瑚ェ菴薙ョ蜃ヲ逅縺ッ邨ゅ∴縺溘ョ縺ァtrue繧定ソ斐☆縲 + + n繧オ繧、繧コ蛟、 = Math.Min(Math.Max(n繧オ繧、繧コ蛟、, 0), 100); // 0譛ェ貅縺ッ0縲100雜縺医ッ100縺ォ蠑キ蛻カ螟画鋤縲 + //----------------- + #endregion + + #region [ nWAV逡ェ蜿キ縺ァ遉コ縺輔l繧九し繧、繧コ譛ェ險ュ螳壹ョWAV繝√ャ繝励′縺ゅl縺ー縲√◎縺ョ繧オ繧、繧コ繧貞、画峩縺吶k縲ら┌髯千ョ。逅縺ォ蟇セ蠢懊] + //----------------- + if (this.n辟。髯千ョ。逅SIZE[nWAV逡ェ蜿キ] == -nWAV逡ェ蜿キ) // 蛻晄悄迥カ諷九〒縺ッ n辟。髯千ョ。逅SIZE[xx] = -xx 縺ァ縺ゅk縲ゅ%縺ョ蝣エ蜷医#SIZExx 縺後∪縺蜃コ迴セ縺励※縺縺ェ縺縺薙→繧呈э蜻ウ縺吶k縲 + { + foreach (CWAV wav in this.listWAV.Values) // 縺薙l縺セ縺ァ縺ォ蜃コ縺ヲ縺阪◆WAV繝√ャ繝励ョ縺縺。縲∬ゥイ蠖薙☆繧具シ医し繧、繧コ縺梧悴險ュ螳壹ョシ峨メ繝繝励ョ繧オ繧、繧コ繧貞、画峩縺吶kシ井サ慕オ縺ソ荳翫∝ソ縺壼セ梧婿蜿らァ縺ィ縺ェ繧具シ峨 + { + if (wav.n繝√ャ繝励し繧、繧コ == -nWAV逡ェ蜿キ) // #SIZExx 陦後h繧雁燕縺ョ陦後↓蜃コ迴セ縺励◆ #WAVxx 縺ァ縺ッ縲√メ繝繝励し繧、繧コ縺ッ -xx 縺ォ蛻晄悄蛹悶&繧後※縺繧九 + wav.n繝√ャ繝励し繧、繧コ = n繧オ繧、繧コ蛟、; + } + } + this.n辟。髯千ョ。逅SIZE[nWAV逡ェ蜿キ] = n繧オ繧、繧コ蛟、; // 谺。縺ォ縺薙ョ nWAV逡ェ蜿キ繧剃スソ縺WAV繝√ャ繝励′迴セ繧後◆繧峨∬イ謨ー縺ョ莉」繧上j縺ォ縲√%縺ョ繧オ繧、繧コ蛟、縺梧シ邏阪&繧後k縺薙→縺ォ縺ェ繧九 + //----------------- + #endregion + + return true; + } + private bool t蜈・蜉媽陦瑚ァ」譫神WAVPAN_PAN(string str繧ウ繝槭Φ繝, string str繝代Λ繝。繝シ繧ソ, string str繧ウ繝。繝ウ繝) + { + // (1) 繧ウ繝槭Φ繝峨r蜃ヲ逅縲 + + #region [ "WAVPAN" or "PAN" 縺ァ蟋九∪繧峨↑縺繧ウ繝槭Φ繝峨ッ辟。蜉ケ縲] + //----------------- + if (str繧ウ繝槭Φ繝.StartsWith("WAVPAN", StringComparison.OrdinalIgnoreCase)) + str繧ウ繝槭Φ繝 = str繧ウ繝槭Φ繝.Substring(6); // str繧ウ繝槭Φ繝 縺九i蜈磯ュ縺ョ"WAVPAN"譁蟄励r髯、蜴サ縲 + + else if (str繧ウ繝槭Φ繝.StartsWith("PAN", StringComparison.OrdinalIgnoreCase)) + str繧ウ繝槭Φ繝 = str繧ウ繝槭Φ繝.Substring(3); // str繧ウ繝槭Φ繝 縺九i蜈磯ュ縺ョ"PAN"譁蟄励r髯、蜴サ縲 + + else + return false; + //----------------- + #endregion + + // (2) 繝代Λ繝。繝シ繧ソ繧貞ヲ逅縲 + + if (str繧ウ繝槭Φ繝.Length < 2) + return false; // WAV逡ェ蜿キ zz 縺後↑縺縺ェ繧臥┌蜉ケ縲 + + #region [ WAV逡ェ蜿キ zz 繧貞叙蠕励☆繧九] + //----------------- + int zz = C螟画鋤.n36騾イ謨ー2譯√ョ譁蟄怜励r謨ー蛟、縺ォ螟画鋤縺励※霑斐☆(str繧ウ繝槭Φ繝.Substring(0, 2)); + if (zz < 0 || zz >= 36 * 36) + { + Trace.TraceError("WAVPAN(PAN)縺ョWAV逡ェ蜿キ縺ォ 00ス杙Z 莉・螟悶ョ蛟、縺セ縺溘ッ荳肴ュ」縺ェ譁蟄怜励′謖螳壹&繧後∪縺励◆縲[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚); + return false; + } + //----------------- + #endregion + + #region [ WAV逡ェ蜿キ zz 繧呈戟縺、WAV繝√ャ繝励ョ菴咲スョ繧貞、画峩縺吶k縲ら┌髯仙ョ夂セゥ蟇セ蠢懊] + //----------------- + int n菴咲スョ; + if (int.TryParse(str繝代Λ繝。繝シ繧ソ, out n菴咲スョ)) + { + n菴咲スョ = Math.Min(Math.Max(n菴咲スョ, -100), 100); // -100ス+100 縺ォ荳ク繧√k + + if (this.n辟。髯千ョ。逅PAN[zz] == (-10000 - zz)) // 蛻晄悄迥カ諷九〒縺ッ n辟。髯千ョ。逅PAN[zz] = -10000 - zz 縺ァ縺ゅk縲ゅ%縺ョ蝣エ蜷医#WAVPANzz, #PANzz 縺後∪縺蜃コ迴セ縺励※縺縺ェ縺縺薙→繧呈э蜻ウ縺吶k縲 + { + foreach (CWAV wav in this.listWAV.Values) // 縺薙l縺セ縺ァ縺ォ蜃コ縺ヲ縺阪◆繝√ャ繝励ョ縺縺。縲∬ゥイ蠖薙☆繧具シ井ス咲スョ縺梧悴險ュ螳壹ョシ姥AV繝√ャ繝励ョ蛟、繧貞、画峩縺吶kシ井サ慕オ縺ソ荳翫∝ソ縺壼セ梧婿蜿らァ縺ィ縺ェ繧具シ峨 + { + if (wav.n菴咲スョ == (-10000 - zz)) // #WAVPANzz, #PANzz 陦後h繧雁燕縺ョ陦後↓蜃コ迴セ縺励◆ #WAVzz 縺ァ縺ッ縲∽ス咲スョ縺ッ -10000-zz 縺ォ蛻晄悄蛹悶&繧後※縺繧九 + wav.n菴咲スョ = n菴咲スョ; + } + } + this.n辟。髯千ョ。逅PAN[zz] = n菴咲スョ; // 谺。縺ォ縺薙ョ WAV逡ェ蜿キ zz 繧剃スソ縺WAV繝√ャ繝励′迴セ繧後◆繧峨√%縺ョ菴咲スョ縺梧シ邏阪&繧後k縺薙→縺ォ縺ェ繧九 + } + //----------------- + #endregion + + return true; + } + private bool t蜈・蜉媽陦瑚ァ」譫神繝√ャ繝鈴咲スョ(string str繧ウ繝槭Φ繝, string str繝代Λ繝。繝シ繧ソ, string str繧ウ繝。繝ウ繝) + { + // (1) 繧ウ繝槭Φ繝峨r蜃ヲ逅縲 + + if (str繧ウ繝槭Φ繝.Length != 5) // 繧ウ繝槭Φ繝峨ッ蠢縺5譁蟄励〒縺ゅk縺薙→縲 + return false; + + #region [ n蟆冗ッ逡ェ蜿キ 繧貞叙蠕励☆繧九] + //----------------- + int n蟆冗ッ逡ェ蜿キ = C螟画鋤.n蟆冗ッ逡ェ蜿キ縺ョ譁蟄怜3譯√r謨ー蛟、縺ォ螟画鋤縺励※霑斐☆(str繧ウ繝槭Φ繝.Substring(0, 3)); + if (n蟆冗ッ逡ェ蜿キ < 0) + return false; + + n蟆冗ッ逡ェ蜿キ++; // 蜈磯ュ縺ォ遨コ縺ョ1蟆冗ッ繧定ィュ縺代k縲 + //----------------- + #endregion + + #region [ n繝√Ε繝ウ繝阪Ν逡ェ蜿キ 繧貞叙蠕励☆繧九] + //----------------- + int n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = -1; + + // 繝輔ぃ繧、繝ォ繝輔か繝シ繝槭ャ繝医↓繧医▲縺ヲ蜃ヲ逅縺檎焚縺ェ繧九 + #region [ (B) 縺昴ョ莉悶ョ蝣エ蜷茨シ壹メ繝」繝ウ繝阪Ν逡ェ蜿キ縺ッ16騾イ謨ー2譯√] + //----------------- + n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = C螟画鋤.n16騾イ謨ー2譯√ョ譁蟄怜励r謨ー蛟、縺ォ螟画鋤縺励※霑斐☆(str繧ウ繝槭Φ繝.Substring(3, 2)); + + if (n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 0) + return false; + //----------------- + #endregion + //----------------- + #endregion + #region [ 蜿門セ励@縺溘メ繝」繝ウ繝阪Ν逡ェ蜿キ縺ァ縲》his.b繝√ャ繝励′縺ゅk 縺ォ隧イ蠖薙′縺ゅl縺ー險ュ螳壹☆繧九] + //----------------- + if ((n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x11) && (n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x1a)) + { + this.b繝√ャ繝励′縺ゅk.Drums = true; + } + else if ((n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x20) && (n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x27)) + { + this.b繝√ャ繝励′縺ゅk.Guitar = true; + } + else if ((n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0xA0) && (n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0xa7)) + { + this.b繝√ャ繝励′縺ゅk.Bass = true; + } + switch (n繝√Ε繝ウ繝阪Ν逡ェ蜿キ) + { + case 0x18: + this.b繝√ャ繝励′縺ゅk.HHOpen = true; + break; + + case 0x19: + this.b繝√ャ繝励′縺ゅk.Ride = true; + break; + + case 0x1a: + this.b繝√ャ繝励′縺ゅk.LeftCymbal = true; + break; + + case 0x20: + this.b繝√ャ繝励′縺ゅk.OpenGuitar = true; + break; + + case 0xA0: + this.b繝√ャ繝励′縺ゅk.OpenBass = true; + break; + } + //----------------- + #endregion + + + // (2) Ch.02繧貞ヲ逅縲 + + #region [ 蟆冗ッ髟キ螟画峩(Ch.02)縺ッ莉悶ョ繝√Ε繝ウ繝阪Ν縺ィ縺ッ繝代Λ繝。繝シ繧ソ縺檎音谿翫↑縺ョ縺ァ縲∝医↓縺ィ縺」縺ィ縺ィ邨ゅo繧峨○繧九 ] + //----------------- + if (n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x02) + { + // 蟆冗ッ髟キ蛟咲紫繧貞叙蠕励☆繧九 + + double db蟆冗ッ髟キ蛟咲紫 = 1.0; + //if( !double.TryParse( str繝代Λ繝。繝シ繧ソ, out result ) ) + if (!this.TryParse(str繝代Λ繝。繝シ繧ソ, out db蟆冗ッ髟キ蛟咲紫)) // #23880 2010.12.30 yyagi: alternative TryParse to permit both '.' and ',' for decimal point + { + Trace.TraceError("蟆冗ッ髟キ蛟咲紫縺ォ荳肴ュ」縺ェ蛟、繧呈欠螳壹@縺セ縺励◆縲[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚); + return false; + } + + // 蟆冗ッ髟キ蛟咲紫繝√ャ繝励r驟咲スョ縺吶k縲 + + this.listChip.Insert( + 0, + new CChip() + { + n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = n繝√Ε繝ウ繝阪Ν逡ェ蜿キ, + db螳滓焚蛟、 = db蟆冗ッ髟キ蛟咲紫, + n逋コ螢ー菴咲スョ = n蟆冗ッ逡ェ蜿キ * 384, + }); + + return true; // 驟咲スョ邨ゆコ縲 + } + //----------------- + #endregion + + + // (3) 繝代Λ繝。繝シ繧ソ繧貞ヲ逅縲 + + if (string.IsNullOrEmpty(str繝代Λ繝。繝シ繧ソ)) // 繝代Λ繝。繝シ繧ソ縺ッnull縺セ縺溘ッ遨コ譁蟄怜励〒縺ッ縺ェ縺縺薙→縲 + return false; + + #region [ str繝代Λ繝。繝シ繧ソ 縺ォ繧ェ繝悶ず繧ァ繧ッ繝郁ィ倩ソー繧呈シ邏阪@縲√◎縺ョ n譁蟄玲焚 繧偵き繧ヲ繝ウ繝医☆繧九] + //----------------- + int n譁蟄玲焚 = 0; + + var sb = new StringBuilder(str繝代Λ繝。繝シ繧ソ.Length); + + // str繝代Λ繝。繝シ繧ソ繧貞磯ュ縺九i1譁蟄励★縺、隕九↑縺後i豁」隕丞喧シ育┌蜉ケ譁蟄('_')繧帝」帙ー縺励◆繧贋ク肴ュ」縺ェ譁蟄励〒繧ィ繝ゥ繝シ繧貞コ縺励◆繧奇シ峨@縲《b 縺ク譬シ邏阪☆繧九 + + CharEnumerator ce = str繝代Λ繝。繝シ繧ソ.GetEnumerator(); + while (ce.MoveNext()) + { + if (ce.Current == '_') // '_' 縺ッ辟。隕悶 + continue; + + if (C螟画鋤.str36騾イ謨ー譁蟄.IndexOf(ce.Current) < 0) // 繧ェ繝悶ず繧ァ繧ッ繝郁ィ倩ソー縺ッ36騾イ謨ー譁蟄励〒縺ゅk縺薙→縲 + { + Trace.TraceError("荳肴ュ」縺ェ繧ェ繝悶ず繧ァ繧ッ繝域欠螳壹′縺ゅj縺セ縺吶[{0}: {1}陦珪", this.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ, this.n迴セ蝨ィ縺ョ陦梧焚); + return false; + } + + sb.Append(ce.Current); + n譁蟄玲焚++; + } + + str繝代Λ繝。繝シ繧ソ = sb.ToString(); // 豁」隕丞喧縺輔l縺滓枚蟄怜励↓縺ェ繧翫∪縺励◆縲 + + if ((n譁蟄玲焚 % 2) != 0) // 繝代Λ繝。繝シ繧ソ縺ョ譁蟄玲焚縺悟・謨ー縺ョ蝣エ蜷医∵怙蠕後ョ1譁蟄励r辟。隕悶☆繧九 + n譁蟄玲焚--; + //----------------- + #endregion + + + // (4) 繝代Λ繝。繝シ繧ソ繧偵が繝悶ず繧ァ繧ッ繝域焚蛟、縺ォ蛻隗」縺励※驟咲スョ縺吶k縲 + + for (int i = 0; i < (n譁蟄玲焚 / 2); i++) // 2譁蟄励〒1繧ェ繝悶ず繧ァ繧ッ繝域焚蛟、 + { + #region [ n繧ェ繝悶ず繧ァ繧ッ繝域焚蛟、 繧抵シ代▽蜿門セ励☆繧九'00' 縺ェ繧臥┌隕悶] + //----------------- + int n繧ェ繝悶ず繧ァ繧ッ繝域焚蛟、 = 0; + + if (n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x03) + { + // Ch.03 縺ョ縺ソ 16騾イ謨ー2譯√ + n繧ェ繝悶ず繧ァ繧ッ繝域焚蛟、 = C螟画鋤.n16騾イ謨ー2譯√ョ譁蟄怜励r謨ー蛟、縺ォ螟画鋤縺励※霑斐☆(str繝代Λ繝。繝シ繧ソ.Substring(i * 2, 2)); + } + else + { + // 縺昴ョ莉悶ョ繝√Ε繝ウ繝阪Ν縺ッ36騾イ謨ー2譯√ + n繧ェ繝悶ず繧ァ繧ッ繝域焚蛟、 = C螟画鋤.n36騾イ謨ー2譯√ョ譁蟄怜励r謨ー蛟、縺ォ螟画鋤縺励※霑斐☆(str繝代Λ繝。繝シ繧ソ.Substring(i * 2, 2)); + } + + if (n繧ェ繝悶ず繧ァ繧ッ繝域焚蛟、 == 0x00) + continue; + //----------------- + #endregion + + // 繧ェ繝悶ず繧ァ繧ッ繝域焚蛟、縺ォ蟇セ蠢懊☆繧九メ繝繝励r逕滓舌 + + var chip = new CChip(); + + chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ = n繝√Ε繝ウ繝阪Ν逡ェ蜿キ; + chip.n逋コ螢ー菴咲スョ = (n蟆冗ッ逡ェ蜿キ * 384) + ((384 * i) / (n譁蟄玲焚 / 2)); + chip.n謨エ謨ー蛟、 = n繧ェ繝悶ず繧ァ繧ッ繝域焚蛟、; + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = n繧ェ繝悶ず繧ァ繧ッ繝域焚蛟、; + + #region [ chip.e讌ス蝎ィ繝代シ繝 = ... ] + //----------------- + if ((n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x11) && (n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x1C)) + { + chip.e讌ス蝎ィ繝代シ繝 = E讌ス蝎ィ繝代シ繝.DRUMS; + } + if ((n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x20) && (n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x27)) + { + chip.e讌ス蝎ィ繝代シ繝 = E讌ス蝎ィ繝代シ繝.GUITAR; + } + if ((n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 160) && (n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0xA7)) + { + chip.e讌ス蝎ィ繝代シ繝 = E讌ス蝎ィ繝代シ繝.BASS; + } + //----------------- + #endregion + + #region [ 辟。髯仙ョ夂セゥ縺ク縺ョ蟇セ蠢 竊 蜀驛ィ逡ェ蜿キ縺ョ蜿門セ励] + //----------------- + if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01) + { + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = this.n辟。髯千ョ。逅WAV[n繧ェ繝悶ず繧ァ繧ッ繝域焚蛟、]; // 縺薙l縺梧悽蠖薙↓荳諢上↑WAV逡ェ蜿キ縺ィ縺ェ繧九ゑシ育┌髯仙ョ夂セゥ縺ョ蝣エ蜷医…hip.n謨エ謨ー蛟、 縺ッ荳諢上〒縺ゅk菫晁ィシ縺後↑縺縲ゑシ + } + else if (chip.bBPM繝√ャ繝励〒縺ゅk) + { + chip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ = this.n辟。髯千ョ。逅BPM[n繧ェ繝悶ず繧ァ繧ッ繝域焚蛟、]; // 縺薙l縺梧悽蠖薙↓荳諢上↑BPM逡ェ蜿キ縺ィ縺ェ繧九ゑシ亥酔荳翫ゑシ + } + //----------------- + #endregion + + #region [ 繝輔ぅ繝ォ繧、繝ウON/OFF繝√Ε繝ウ繝阪Ν(Ch.53)縺ョ蝣エ蜷医∫匱螢ー菴咲スョ繧貞ー代@蜑榊セ後↓縺壹i縺吶] + //----------------- + if (n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x53) + { + // 縺壹i縺吶ョ縺ッ縲√ヵ繧」繝ォ繧、繝ウON繝√ャ繝励→蜷後§菴咲スョ縺ォ縺繧九メ繝繝励〒繧ら「コ螳溘↓繝輔ぅ繝ォ繧、繝ウ縺檎匱蜍輔@縲 + // 蜷梧ァ倥↓縲√ヵ繧」繝ォ繧、繝ウOFF繝√ャ繝励→蜷後§菴咲スョ縺ォ縺繧九メ繝繝励〒繧ら「コ螳溘↓繝輔ぅ繝ォ繧、繝ウ縺檎オゆコ縺吶k繧医≧縺ォ縺吶k縺溘a縲 + + if ((n繧ェ繝悶ず繧ァ繧ッ繝域焚蛟、 > 0) && (n繧ェ繝悶ず繧ァ繧ッ繝域焚蛟、 != 2)) + { + chip.n逋コ螢ー菴咲スョ -= 32; // 384テキ32シ12 縺ィ縺縺縺薙→縺ァ縲√ヵ繧」繝ォ繧、繝ウON繝√ャ繝励ッ12蛻髻ウ隨ヲ縺サ縺ゥ蜑阪∈遘サ蜍輔 + } + else if (n繧ェ繝悶ず繧ァ繧ッ繝域焚蛟、 == 2) + { + chip.n逋コ螢ー菴咲スョ += 32; // 蜷後§縺上√ヵ繧」繝ォ繧、繝ウOFF繝√ャ繝励ッ12蛻髻ウ隨ヲ縺サ縺ゥ蠕後m縺ク遘サ蜍輔 + } + } + //----------------- + #endregion + + // 繝√ャ繝励r驟咲スョ縲 + + this.listChip.Add(chip); + } + return true; + } + #region [#23880 2010.12.30 yyagi: 繧ウ繝ウ繝槭→繧ケ繝壹シ繧ケ縺ョ荳。譁ケ繧貞ー乗焚轤ケ縺ィ縺励※謇ア縺TryParse] + /// + /// 蟆乗焚轤ケ縺ィ縺励※繧ウ繝ウ繝槭→繝斐Μ繧ェ繝峨ョ荳。譁ケ繧貞女縺台サ倥¢繧亀ryParse() + /// + /// strings convert to double + /// parsed double value + /// s 縺梧ュ」蟶ク縺ォ螟画鋤縺輔l縺溷エ蜷医ッ true縲ゅ◎繧御サ・螟悶ョ蝣エ蜷医ッ false縲 + /// style 縺 NumberStyles 蛟、縺ァ縺ェ縺縺九《tyle 縺ォ NumberStyles.AllowHexSpecifier 蛟、縺悟性縺セ繧後※縺繧 + private bool TryParse(string s, out double result) + { // #23880 2010.12.30 yyagi: alternative TryParse to permit both '.' and ',' for decimal point + // EU隲ク蝗ス縺ァ縺ョ #BPM 123,45 縺ョ繧医≧縺ェ險倩ソー縺ォ蟇セ蠢懊☆繧九◆繧√ + // 蟆乗焚轤ケ縺ョ譛邨ゆス咲スョ繧呈、懷コ縺励※縲√◎繧後rlocale縺ォ縺ゅ▲縺 + // 譁蟄励↓鄂ョ縺肴鋤縺医※縺九iTryParse()縺吶k + // 譯∝玄蛻繧翫ョ譁蟄励ッ繧ケ繧ュ繝繝励☆繧 + + const string DecimalSeparators = ".,"; // 蟆乗焚轤ケ譁蟄 + const string GroupSeparators = ".,' "; // 譯∝玄蛻繧頑枚蟄 + const string NumberSymbols = "0123456789"; // 謨ー蛟、譁蟄 + + int len = s.Length; // 譁蟄怜鈴聞 + int decimalPosition = len; // 逵溘ョ蟆乗焚轤ケ縺ョ菴咲スョ 譛蛻昴ッ譁蟄怜礼オらォッ菴咲スョ縺ォ莉ョ鄂ョ縺阪☆繧 + + for (int i = 0; i < len; i++) + { // 縺セ縺壹∫悄縺ョ蟆乗焚轤ケ(荳逡ェ譛蠕後↓迴セ繧後k蟆乗焚轤ケ)縺ョ菴咲スョ繧呈アゅa繧 + char c = s[i]; + if (NumberSymbols.IndexOf(c) >= 0) + { // 謨ー蛟、縺縺」縺溘i繧ケ繧ュ繝繝 + continue; + } + else if (DecimalSeparators.IndexOf(c) >= 0) + { // 蟆乗焚轤ケ譁蟄励□縺」縺溘i縲√◎縺ョ驛ス蠎ヲ菴咲スョ繧剃ク頑嶌縺崎ィ俶カ + decimalPosition = i; + } + else if (GroupSeparators.IndexOf(c) >= 0) + { // 譯∝玄蛻繧頑枚蟄励ョ蝣エ蜷医b繧ケ繧ュ繝繝 + continue; + } + else + { // 謨ー蛟、_蟆乗焚轤ケ_蛹コ蛻繧頑枚蟄嶺サ・螟悶′縺阪◆繧峨Ν繝シ繝礼オゆコ + break; + } + } + + StringBuilder decimalStr = new StringBuilder(16); + for (int i = 0; i < len; i++) + { // 谺。縺ォ縲〕ocale縺ォ縺ゅ▲縺滓焚蛟、譁蟄怜励r逕滓舌☆繧 + char c = s[i]; + if (NumberSymbols.IndexOf(c) >= 0) + { // 謨ー蛟、縺縺」縺溘i + decimalStr.Append(c); // 縺昴ョ縺セ縺セ繧ウ繝斐シ + } + else if (DecimalSeparators.IndexOf(c) >= 0) + { // 蟆乗焚轤ケ譁蟄励□縺」縺溘i + if (i == decimalPosition) + { // 譛蠕後↓蜃コ迴セ縺励◆蟆乗焚轤ケ譁蟄励↑繧峨〕ocale縺ォ蜷医▲縺溷ー乗焚轤ケ繧貞コ蜉帙☆繧 + decimalStr.Append(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator); + } + } + else if (GroupSeparators.IndexOf(c) >= 0) + { // 譯∝玄蛻繧頑枚蟄励□縺」縺溘i + continue; // 菴輔b縺励↑縺(繧ケ繧ュ繝繝) + } + else + { + break; + } + } + return double.TryParse(decimalStr.ToString(), out result); // 譛蠕後↓縲∬ェ蛻縺ョlocale蜷代¢縺ョ譁蟄怜励↓蟇セ縺励※TryParse螳溯。 + } + #endregion + /// + /// 髻ウ貅仙咲函蜑阪ョ遨コ逋ス繧定ソス蜉縺吶k繝。繧ス繝繝峨 + /// + private void AddMusicPreTimeMs() + { + this.dbNowTime += TJAPlayer3.ConfigIni.MusicPreTimeMs; + this.dbNowBMScollTime += TJAPlayer3.ConfigIni.MusicPreTimeMs * this.dbNowBPM / 15000; + } + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Songs/CDTXCompanionFileFinder.cs b/TJAPlayer3/Songs/CDTXCompanionFileFinder.cs new file mode 100644 index 00000000..ade714a3 --- /dev/null +++ b/TJAPlayer3/Songs/CDTXCompanionFileFinder.cs @@ -0,0 +1,228 @@ +サソusing System.Diagnostics; +using System.IO; +using System.Text; + +namespace TJAPlayer3 +{ + internal static class CDTXCompanionFileFinder + { + internal static string FindFileName( + string directory, + string mainFileName, + string expectedCompanionFileName) + { + var expectedCompanionPath = Path.Combine(directory, expectedCompanionFileName); + + if (File.Exists(expectedCompanionPath)) + { + return expectedCompanionFileName; + } + + // If we could not find the file by its exact provided name, in + // the vast majority of cases it has been mangled during zip + // compression by a zip tool which is not properly aware of + // multi-byte encodings, Unicode, etc. When decompressed, such + // zipped files end up a file names which are simply the raw bytes + // of the Shift-JIS encoded form. Some of these bytes will be + // invalid as characters of file names and will have been further + // mangled, usually to a single underscore character. + + // To begin finding the right file, we first need to get the raw + // bytes that would comprise the file name if encoded into + // Shift-JIS. + var encodedCompanionFileNameBytes = Encoding.GetEncoding("Shift_JIS").GetBytes(expectedCompanionFileName); + + // Here we have a helper method that will be used to try finding + // the file by interpreting the byte representation encoded + // just above, this time in terms of some other encoding which + // might be in use in the user's file system. + bool TryFindViaDecodedFileName(string prefix, Encoding encoding, out string foundCompanionFileName) + { + var decodedCompanionFileName = DecodeToLegalFileName(encodedCompanionFileNameBytes, encoding); + + try + { + if (!File.Exists(Path.Combine(directory, decodedCompanionFileName))) + { + foundCompanionFileName = null; + return false; + } + } + catch + { + Trace.TraceWarning( + $"{nameof(CDTXCompanionFileFinder)} could not find expected file '{expectedCompanionPath}' and could not check the existence of a file via {prefix} '{encoding.EncodingName}'. Possible illegal file path when combining directory '{directory}' with encoded file name '{decodedCompanionFileName}'."); + + foundCompanionFileName = null; + return false; + } + + Trace.TraceInformation( + $"{nameof(CDTXCompanionFileFinder)} could not find expected file '{expectedCompanionPath}' but found '{decodedCompanionFileName}' via {prefix} '{encoding.EncodingName}', Code Page {encoding.CodePage}, Windows Code Page {encoding.WindowsCodePage}."); + + foundCompanionFileName = decodedCompanionFileName; + return true; + } + + // Attempt to find the file as if the companion file's name was + // mangled into codepage 437 (effectively the legacy DOS codepage, + // and the one used by zip tools that are not unicode aware.) + // This step finds >99% of files with mangled names. + if (TryFindViaDecodedFileName( + "Encoding.GetEncoding(437)", + Encoding.GetEncoding(437), + out var foundCompanionFileNameViaEncoding437)) + { + return foundCompanionFileNameViaEncoding437; + } + + // Attempt to find the file as if the companion file's name + // was mangled into this computer's default encoding. This case + // has not been observed during testing on US English computers, + // but it is safe to perform and may assist other locales. + if (TryFindViaDecodedFileName( + "Encoding.Default", + Encoding.Default, + out var foundCompanionFileNameViaEncodingDefault)) + { + return foundCompanionFileNameViaEncodingDefault; + } + + // If the companion file still cannot be found, try to find a file + // with the expected extension but having the same file name as the + // main file with which it is associated (in most use cases: the .tja file.) + if (TryFindViaMainFileName( + directory, + mainFileName, + expectedCompanionPath, + out var foundCompanionFileNameByMainFileName)) + { + return foundCompanionFileNameByMainFileName; + } + + // If the file still cannot be found, try to find a single file + // with the expected supplementary file extension. (If more than + // one file is found with the same extension, we can't reliably + // choose the right one of them.) + if (TryFindViaCompanionFileExtension( + directory, + expectedCompanionPath, + out var foundCompanionFileNameByExtension)) + { + return foundCompanionFileNameByExtension; + } + + // If the file still cannot be found, produce a warning + // and return the original file name unchanged. + + Trace.TraceWarning( + $"{nameof(CDTXCompanionFileFinder)} could not find expected file '{expectedCompanionPath}' by any available means."); + + return expectedCompanionFileName; + } + + private static string DecodeToLegalFileName(byte[] encodedBytes, Encoding encoding) + { + // Decode and then replace characters which are illegal in file + // names in all locales, except for the backslash character which + // will be handled immediately after this. + var decodedBeforeDirectoryRemoval = encoding.GetString(encodedBytes) + .Replace('<', '_') + .Replace('>', '_') + .Replace(':', '_') + .Replace('"', '_') + .Replace('/', '_') + .Replace('|', '_') + .Replace('?', '_') + .Replace('*', '_'); + + // During decompression of incorrectly-generated zip files, + // Shift-JIS characters which encode to a representation that + // includes a backslash result in the decompressor placing the files + // in a subdirectory (or even subdirectories) based on characters + // before and between all backslashes, and then names the file based + // on the characters appearing after the final backslash. In these + // cases, we're already parsing files in one of those generated + // subdirectories and have only to deal with the file names having + // been abbreviated. We can usually find such files in the + // applicable directory via the substring after the final backslash. + var lastIndexOfBackslash = decodedBeforeDirectoryRemoval.LastIndexOf('\\'); + return lastIndexOfBackslash == -1 + ? decodedBeforeDirectoryRemoval + : decodedBeforeDirectoryRemoval.Substring(lastIndexOfBackslash + 1); + } + + private static bool TryFindViaMainFileName( + string directory, + string mainFileName, + string expectedCompanionPath, + out string foundCompanionFileName) + { + var mainFilePath = Path.Combine(directory, mainFileName); + + var companionFileExtension = Path.GetExtension(expectedCompanionPath); + + var mainFilePathWithCompanionFileExtension = + Path.ChangeExtension(mainFilePath, companionFileExtension); + + // Whether mangled or not, most companion files have names which + // match the name of the main file, except for the difference in + // the file extension. We can check for these by determining what + // the file might be called when the extension is replaced with the + // appropriate one and then check for the existence of that file. + var mainFileNameWithCompanionFileExtension = + Path.GetFileName(mainFilePathWithCompanionFileExtension); + if (File.Exists(mainFilePathWithCompanionFileExtension)) + { + Trace.TraceInformation( + $"{nameof(CDTXCompanionFileFinder)} could not find expected file '{expectedCompanionPath}' but found '{mainFileNameWithCompanionFileExtension}' by matching the '{mainFileName}' file name with the expected file extension."); + + foundCompanionFileName = mainFileNameWithCompanionFileExtension; + return true; + } + + foundCompanionFileName = null; + return false; + } + + private static bool TryFindViaCompanionFileExtension( + string directory, + string expectedCompanionPath, + out string foundCompanionFileName) + { + var companionFileExtension = Path.GetExtension(expectedCompanionPath); + + if (string.IsNullOrEmpty(companionFileExtension)) + { + Trace.TraceWarning( + $"{nameof(CDTXCompanionFileFinder)} could not find expected file '{expectedCompanionPath}' and could not search for appropriate sibling files because this file has no extension."); + } + else + { + // If no more precise approach can find the right file, we can + // usually safely find it by looking for any file with the + // expected file extension in the same folder as the main file. + // However, if someone extracts a collection of songs into a + // single folder, we will see many files with the expected + // extension. Therefore, we will only treat the file as found + // if there is one and only one file with the expected file + // extension within in the directory in question. + var filesWithTheCompanionFileExtension = + Directory.GetFiles(directory, "*" + companionFileExtension); + if (filesWithTheCompanionFileExtension.Length == 1) + { + var foundCompanionFilePath = filesWithTheCompanionFileExtension[0]; + foundCompanionFileName = Path.GetFileName(foundCompanionFilePath); + + Trace.TraceInformation( + $"{nameof(CDTXCompanionFileFinder)} could not find expected file '{expectedCompanionPath}' but found '{foundCompanionFileName}' by searching for a single sibling file with the expected extension."); + + return true; + } + } + + foundCompanionFileName = null; + return false; + } + } +} \ No newline at end of file diff --git a/TJAPlayer3/Songs/CDTXStyleExtractor.cs b/TJAPlayer3/Songs/CDTXStyleExtractor.cs new file mode 100644 index 00000000..a43568d8 --- /dev/null +++ b/TJAPlayer3/Songs/CDTXStyleExtractor.cs @@ -0,0 +1,546 @@ +サソusing System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; + +namespace TJAPlayer3 +{ + /// + /// CDTXStyleExtractor determines if there is a session notation, and if there is then + /// it returns a sheet of music clipped according to the specified player Side. + /// + /// The process operates as follows: + /// 1. Break the string up into top-level sections of the following types: + /// a) STYLE Single + /// b) STYLE Double/Couple + /// c) STYLE unrecognized + /// d) non-STYLE + /// 2. Within the top-level sections, break each up into sub-sections of the following types: + /// a) sheet START P1 + /// b) sheet START P2 + /// c) sheet START bare + /// d) sheet START unrecognized + /// e) non-sheet + /// 3. For the current seqNo, rank the found sheets + /// using a per-seqNo set of rankings for each + /// relevant section/subsection combination. + /// 4. Determine the best-ranked sheet + /// 5. Remove sheets other than the best-ranked + /// 6. Remove top-level STYLE-type sections which no longer contain a sheet + /// 7. From supported STYLE-type sections, remove non-sheet subsections beyond + /// the selected sheet, to reduce risk of incorrect command processing. + /// 8. Reassemble the string + /// + public static class CDTXStyleExtractor + { + private const RegexOptions StyleExtractorRegexOptions = + RegexOptions.Compiled | + RegexOptions.CultureInvariant | + RegexOptions.IgnoreCase | + RegexOptions.Multiline | + RegexOptions.Singleline; + + private const string StylePrefixRegexPattern = @"^STYLE\s*:\s*"; + private const string SheetStartPrefixRegexPattern = @"^#START"; + + private static readonly string StyleSingleSectionRegexMatchPattern = + $"{StylePrefixRegexPattern}(?:Single|1)"; + + private static readonly string StyleDoubleSectionRegexMatchPattern = + $"{StylePrefixRegexPattern}(?:Double|Couple|2)"; + + private static readonly string StyleUnrecognizedSectionRegexMatchPattern = + $"{StylePrefixRegexPattern}"; + + private static readonly string SheetStartBareRegexMatchPattern = + $"{SheetStartPrefixRegexPattern}$"; + + private static readonly string SheetStartP1RegexMatchPattern = + $"{SheetStartPrefixRegexPattern}\\s*P1"; + + private static readonly string SheetStartP2RegexMatchPattern = + $"{SheetStartPrefixRegexPattern}\\s*P2"; + + private static readonly string SheetStartUnrecognizedRegexMatchPattern = + $"{SheetStartPrefixRegexPattern}.*$"; + + private static readonly Regex SectionSplitRegex = new Regex($"(?={StylePrefixRegexPattern})", StyleExtractorRegexOptions); + private static readonly Regex SubSectionSplitRegex = new Regex($"(?={SheetStartPrefixRegexPattern})|(?<=#END\\n)", StyleExtractorRegexOptions); + + private static readonly Regex StyleSingleSectionMatchRegex = new Regex(StyleSingleSectionRegexMatchPattern, StyleExtractorRegexOptions); + private static readonly Regex StyleDoubleSectionMatchRegex = new Regex(StyleDoubleSectionRegexMatchPattern, StyleExtractorRegexOptions); + private static readonly Regex StyleUnrecognizedSectionMatchRegex = new Regex(StyleUnrecognizedSectionRegexMatchPattern, StyleExtractorRegexOptions); + + private static readonly Regex SheetStartPrefixMatchRegex = new Regex(SheetStartPrefixRegexPattern, StyleExtractorRegexOptions); + private static readonly Regex SheetStartBareMatchRegex = new Regex(SheetStartBareRegexMatchPattern, StyleExtractorRegexOptions); + private static readonly Regex SheetStartP1MatchRegex = new Regex(SheetStartP1RegexMatchPattern, StyleExtractorRegexOptions); + private static readonly Regex SheetStartP2MatchRegex = new Regex(SheetStartP2RegexMatchPattern, StyleExtractorRegexOptions); + private static readonly Regex SheetStartUnrecognizedMatchRegex = new Regex(SheetStartUnrecognizedRegexMatchPattern, StyleExtractorRegexOptions); + + private static readonly SectionKindAndSubSectionKind StyleSingleAndSheetStartBare = + new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartBare); + + private static readonly SectionKindAndSubSectionKind StyleSingleAndSheetStartP1 = + new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartP1); + + private static readonly SectionKindAndSubSectionKind StyleSingleAndSheetStartP2 = + new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartP2); + + private static readonly SectionKindAndSubSectionKind StyleSingleAndSheetStartUnrecognized = + new SectionKindAndSubSectionKind(SectionKind.StyleSingle, SubSectionKind.SheetStartUnrecognized); + + private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartBare = + new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartBare); + + private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartP1 = + new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartP1); + + private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartP2 = + new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartP2); + + private static readonly SectionKindAndSubSectionKind StyleDoubleAndSheetStartUnrecognized = + new SectionKindAndSubSectionKind(SectionKind.StyleDouble, SubSectionKind.SheetStartUnrecognized); + + private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartBare = + new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartBare); + + private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartP1 = + new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartP1); + + private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartP2 = + new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartP2); + + private static readonly SectionKindAndSubSectionKind StyleUnrecognizedAndSheetStartUnrecognized = + new SectionKindAndSubSectionKind(SectionKind.StyleUnrecognized, SubSectionKind.SheetStartUnrecognized); + + private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartBare = + new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartBare); + + private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartP1 = + new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartP1); + + private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartP2 = + new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartP2); + + private static readonly SectionKindAndSubSectionKind NonStyleAndSheetStartUnrecognized = + new SectionKindAndSubSectionKind(SectionKind.NonStyle, SubSectionKind.SheetStartUnrecognized); + + private static readonly IDictionary[] + SeqNoSheetRanksBySectionKindAndSubSectionKind = + { + // seqNo 0 + new Dictionary + { + [StyleSingleAndSheetStartBare] = 1, + [StyleSingleAndSheetStartP1] = 2, + [StyleSingleAndSheetStartUnrecognized] = 3, + [NonStyleAndSheetStartBare] = 4, + [NonStyleAndSheetStartP1] = 5, + [NonStyleAndSheetStartUnrecognized] = 6, + + [StyleUnrecognizedAndSheetStartBare] = 7, + [StyleUnrecognizedAndSheetStartUnrecognized] = 8, + [StyleUnrecognizedAndSheetStartP1] = 9, + [StyleDoubleAndSheetStartP1] = 10, + [StyleDoubleAndSheetStartBare] = 11, + [StyleDoubleAndSheetStartUnrecognized] = 12, + + [StyleSingleAndSheetStartP2] = 13, + [NonStyleAndSheetStartP2] = 14, + [StyleUnrecognizedAndSheetStartP2] = 15, + [StyleDoubleAndSheetStartP2] = 16, + }, + // seqNo 1 + new Dictionary + { + [StyleDoubleAndSheetStartP1] = 1, + [StyleUnrecognizedAndSheetStartP1] = 2, + [NonStyleAndSheetStartP1] = 3, + [StyleSingleAndSheetStartP1] = 4, + + [StyleDoubleAndSheetStartBare] = 5, + [StyleDoubleAndSheetStartUnrecognized] = 6, + [StyleUnrecognizedAndSheetStartBare] = 7, + [StyleUnrecognizedAndSheetStartUnrecognized] = 8, + [StyleSingleAndSheetStartBare] = 9, + [StyleSingleAndSheetStartUnrecognized] = 10, + [NonStyleAndSheetStartBare] = 11, + [NonStyleAndSheetStartUnrecognized] = 12, + + [StyleDoubleAndSheetStartP2] = 13, + [StyleUnrecognizedAndSheetStartP2] = 14, + [NonStyleAndSheetStartP2] = 15, + [StyleSingleAndSheetStartP2] = 16, + }, + // seqNo 2 + new Dictionary + { + [StyleDoubleAndSheetStartP2] = 1, + [StyleUnrecognizedAndSheetStartP2] = 2, + [NonStyleAndSheetStartP2] = 3, + [StyleSingleAndSheetStartP2] = 4, + + [StyleDoubleAndSheetStartUnrecognized] = 5, + [StyleDoubleAndSheetStartBare] = 6, + [StyleUnrecognizedAndSheetStartUnrecognized] = 7, + [StyleUnrecognizedAndSheetStartBare] = 8, + [StyleSingleAndSheetStartUnrecognized] = 9, + [StyleSingleAndSheetStartBare] = 10, + [NonStyleAndSheetStartUnrecognized] = 11, + [NonStyleAndSheetStartBare] = 12, + + [StyleDoubleAndSheetStartP1] = 13, + [StyleUnrecognizedAndSheetStartP1] = 14, + [NonStyleAndSheetStartP1] = 15, + [StyleSingleAndSheetStartP1] = 16, + }, + }; + + public static string t繧サ繝繧キ繝ァ繝ウ隴憺擇縺後≠繧(string strTJA, int seqNo, string str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ) + { + void TraceError(string subMessage) + { + Trace.TraceError(FormatTraceMessage(subMessage)); + } + + string FormatTraceMessage(string subMessage) + { + return $"{nameof(CDTXStyleExtractor)} {subMessage} (seqNo={seqNo}, {str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ})"; + } + + //蜈・蜉帙&繧後◆隴憺擇縺系ull縺ァ縺ェ縺縺九メ繧ァ繝繧ッ縲 + if (string.IsNullOrEmpty(strTJA)) + { + TraceError("is returning its input value early due to null or empty strTJA."); + return strTJA; + } + + // 1. Break the string up into top-level sections of the following types: + // a) STYLE Single + // b) STYLE Double/Couple + // c) STYLE unrecognized + // d) non-STYLE + var sections = GetSections(strTJA); + + // 2. Within the top-level sections, break each up into sub-sections of the following types: + // a) sheet START P1 + // b) sheet START P2 + // c) sheet START bare + // d) sheet START unrecognized + // e) non-sheet + SubdivideSectionsIntoSubSections(sections); + + // 3. For the current seqNo, rank the found sheets + // using a per-seqNo set of rankings for each + // relevant section/subsection combination. + RankSheets(seqNo, sections); + + // 4. Determine the best-ranked sheet + int bestRank; + try + { + bestRank = GetBestRank(sections); + } + catch (Exception) + { + TraceError("is returning its input value early due to an inability to determine the best rank. This can occur if a course contains no #START."); + return strTJA; + } + + // 5. Remove sheets other than the best-ranked + RemoveSheetsOtherThanTheBestRanked(sections, bestRank); + + // 6. Remove top-level STYLE-type sections which no longer contain a sheet + RemoveRecognizedStyleSectionsWithoutSheets(sections); + + // 7. From supported STYLE-type sections, remove non-sheet subsections beyond + // the selected sheet, to reduce risk of incorrect command processing. + RemoveStyleSectionSubSectionsBeyondTheSelectedSheet(sections); + + // 8. Reassemble the string + return Reassemble(sections); + } + + // 1. Break the string up into top-level sections of the following types: + // a) STYLE Single + // b) STYLE Double/Couple + // c) STYLE unrecognized + // d) non-STYLE + private static List
GetSections(string strTJA) + { + return SectionSplitRegex + .Split(strTJA) + .Select(o => new Section(GetSectionKind(o), o)) + .ToList(); + } + + private static SectionKind GetSectionKind(string section) + { + if (StyleSingleSectionMatchRegex.IsMatch(section)) + { + return SectionKind.StyleSingle; + } + + if (StyleDoubleSectionMatchRegex.IsMatch(section)) + { + return SectionKind.StyleDouble; + } + + if (StyleUnrecognizedSectionMatchRegex.IsMatch(section)) + { + return SectionKind.StyleUnrecognized; + } + + return SectionKind.NonStyle; + } + + private enum SectionKind + { + StyleSingle, + StyleDouble, + StyleUnrecognized, + NonStyle + } + + private sealed class Section + { + public readonly SectionKind SectionKind; + public readonly string OriginalRawValue; + + public List SubSections; + + public Section(SectionKind sectionKind, string originalRawValue) + { + SectionKind = sectionKind; + OriginalRawValue = originalRawValue; + } + } + + // 2. Within the top-level sections, break each up into sub-sections of the following types: + // a) sheet START P1 + // b) sheet START P2 + // c) sheet START bare + // d) sheet START unrecognized + // e) non-sheet + private static void SubdivideSectionsIntoSubSections(IEnumerable
sections) + { + foreach (var section in sections) + { + section.SubSections = SubSectionSplitRegex + .Split(section.OriginalRawValue) + .Select(o => new SubSection(GetSubsectionKind(o), o)) + .ToList(); + } + } + + private static SubSectionKind GetSubsectionKind(string subsection) + { + if (SheetStartPrefixMatchRegex.IsMatch(subsection)) + { + if (SheetStartBareMatchRegex.IsMatch(subsection)) + { + return SubSectionKind.SheetStartBare; + } + + if (SheetStartP1MatchRegex.IsMatch(subsection)) + { + return SubSectionKind.SheetStartP1; + } + + if (SheetStartP2MatchRegex.IsMatch(subsection)) + { + return SubSectionKind.SheetStartP2; + } + + if (SheetStartUnrecognizedMatchRegex.IsMatch(subsection)) + { + return SubSectionKind.SheetStartUnrecognized; + } + } + + return SubSectionKind.NonSheet; + } + + private enum SubSectionKind + { + SheetStartP1, + SheetStartP2, + SheetStartBare, + SheetStartUnrecognized, + NonSheet + } + + private sealed class SubSection + { + public readonly SubSectionKind SubSectionKind; + public readonly string OriginalRawValue; + + public int Rank; + + public SubSection(SubSectionKind subSectionKind, string originalRawValue) + { + SubSectionKind = subSectionKind; + OriginalRawValue = originalRawValue; + } + } + + // 3. For the current seqNo, rank the found sheets + // using a per-seqNo set of rankings for each + // relevant section/subsection combination. + private static void RankSheets(int seqNo, IList
sections) + { + var sheetRanksBySectionKindAndSubSectionKind = SeqNoSheetRanksBySectionKindAndSubSectionKind[seqNo]; + + foreach (var section in sections) + { + var sectionKind = section.SectionKind; + + foreach (var subSection in section.SubSections) + { + var subSectionKind = subSection.SubSectionKind; + + if (subSectionKind == SubSectionKind.NonSheet) + { + continue; + } + + var sectionKindAndSubSectionKind = new SectionKindAndSubSectionKind( + sectionKind, subSectionKind); + + subSection.Rank = sheetRanksBySectionKindAndSubSectionKind[sectionKindAndSubSectionKind]; + } + } + } + + private sealed class SectionKindAndSubSectionKind : IEquatable + { + public readonly SectionKind SectionKind; + public readonly SubSectionKind SubSectionKind; + + public SectionKindAndSubSectionKind(SectionKind sectionKind, SubSectionKind subSectionKind) + { + SectionKind = sectionKind; + SubSectionKind = subSectionKind; + } + + public bool Equals(SectionKindAndSubSectionKind other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return SectionKind == other.SectionKind && SubSectionKind == other.SubSectionKind; + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj is SectionKindAndSubSectionKind other && Equals(other); + } + + public override int GetHashCode() + { + unchecked + { + return ((int) SectionKind * 397) ^ (int) SubSectionKind; + } + } + + public static bool operator ==(SectionKindAndSubSectionKind left, SectionKindAndSubSectionKind right) + { + return Equals(left, right); + } + + public static bool operator !=(SectionKindAndSubSectionKind left, SectionKindAndSubSectionKind right) + { + return !Equals(left, right); + } + } + + // 4. Determine the best-ranked sheet + private static int GetBestRank(IList
sections) + { + return sections + .SelectMany(o => o.SubSections) + .Where(o => o.SubSectionKind != SubSectionKind.NonSheet) + .Select(o => o.Rank) + .Min(); + } + + // 5. Remove sheets other than the best-ranked + private static void RemoveSheetsOtherThanTheBestRanked(IList
sections, int bestRank) + { + // We can safely remove based on > bestRank because the subsection types + // which are never removed always have a Rank value of 0. + + foreach (var section in sections) + { + section.SubSections.RemoveAll(o => o.Rank > bestRank); + } + + // If there was a tie for the best sheet, + // take the first and remove the rest. + var extraBestRankedSheets = new HashSet(sections + .SelectMany(o => o.SubSections) + .Where(o => o.Rank == bestRank) + .Skip(1)); + + foreach (var section in sections) + { + section.SubSections.RemoveAll(extraBestRankedSheets.Contains); + } + } + + // 6. Remove top-level STYLE-type sections which no longer contain a sheet + private static void RemoveRecognizedStyleSectionsWithoutSheets(List
sections) + { + // Note that we dare not remove SectionKind.StyleUnrecognized instances without sheets. + // The reason is because there are plenty of .tja files with weird STYLE: header values + // and which are located very early in the file. Removing those sections would remove + // important information, and was one of the problems with the years-old splitting code + // which was replaced in late summer 2018 and which is now being overhauled in early fall 2018. + + sections.RemoveAll(o => + (o.SectionKind == SectionKind.StyleSingle || o.SectionKind == SectionKind.StyleDouble) && + o.SubSections.Count(subSection => subSection.SubSectionKind == SubSectionKind.NonSheet) == o.SubSections.Count); + } + + // 7. From supported STYLE-type sections, remove non-sheet subsections beyond + // the selected sheet, to reduce risk of incorrect command processing. + private static void RemoveStyleSectionSubSectionsBeyondTheSelectedSheet(List
sections) + { + foreach (var section in sections) + { + if (section.SectionKind == SectionKind.StyleSingle || section.SectionKind == SectionKind.StyleDouble) + { + var subSections = section.SubSections; + + var lastIndex = subSections.FindIndex(o => o.SubSectionKind != SubSectionKind.NonSheet); + var removalIndex = lastIndex + 1; + + if (lastIndex != -1 && removalIndex < subSections.Count) + { + subSections.RemoveRange(removalIndex, subSections.Count - removalIndex); + } + } + } + } + + // 8. Reassemble the string + private static string Reassemble(List
sections) + { + var sb = new StringBuilder(); + + foreach (var section in sections) + { + foreach (var subSection in section.SubSections) + { + sb.Append(subSection.OriginalRawValue); + } + } + + return sb.ToString(); + } + } +} \ No newline at end of file diff --git a/TJAPlayer3/Songs/CScoreIni.cs b/TJAPlayer3/Songs/CScoreIni.cs new file mode 100644 index 00000000..a3cb8634 --- /dev/null +++ b/TJAPlayer3/Songs/CScoreIni.cs @@ -0,0 +1,1545 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using System.Drawing.Imaging; +using System.Diagnostics; +using System.IO; +using System.Security.Cryptography; +using FDK; +using TJAPlayer3; + +namespace TJAPlayer3 +{ + public class CScoreIni + { + // 繝励Ο繝代ユ繧」 + + // [File] 繧サ繧ッ繧キ繝ァ繝ウ + public ST繝輔ぃ繧、繝ォ st繝輔ぃ繧、繝ォ; + [StructLayout( LayoutKind.Sequential )] + public struct ST繝輔ぃ繧、繝ォ + { + public string Title; + public string Name; + public string Hash; + public int PlayCountDrums; + public int PlayCountGuitar; + public int PlayCountBass; + // #23596 10.11.16 add ikanick-----/ + public int ClearCountDrums; + public int ClearCountGuitar; + public int ClearCountBass; + // #24459 2011.2.24 yyagi----------/ + public STDGBVALUE BestRank; + // --------------------------------/ + public int HistoryCount; + public string[] History; + public int BGMAdjust; + } + + // 貍泌・剰ィ倬鹸繧サ繧ッ繧キ繝ァ繝ウシ9遞ョ鬘橸シ + public ST繧サ繧ッ繧キ繝ァ繝ウ st繧サ繧ッ繧キ繝ァ繝ウ; + [StructLayout( LayoutKind.Sequential )] + public struct ST繧サ繧ッ繧キ繝ァ繝ウ + { + public CScoreIni.C貍泌・剰ィ倬鹸 HiScoreDrums; + public CScoreIni.C貍泌・剰ィ倬鹸 HiSkillDrums; + public CScoreIni.C貍泌・剰ィ倬鹸 HiScoreGuitar; + public CScoreIni.C貍泌・剰ィ倬鹸 HiSkillGuitar; + public CScoreIni.C貍泌・剰ィ倬鹸 HiScoreBass; + public CScoreIni.C貍泌・剰ィ倬鹸 HiSkillBass; + public CScoreIni.C貍泌・剰ィ倬鹸 LastPlayDrums; // #23595 2011.1.9 ikanick + public CScoreIni.C貍泌・剰ィ倬鹸 LastPlayGuitar; // + public CScoreIni.C貍泌・剰ィ倬鹸 LastPlayBass; // + public CScoreIni.C貍泌・剰ィ倬鹸 this[ int index ] + { + get + { + switch( index ) + { + case 0: + return this.HiScoreDrums; + + case 1: + return this.HiSkillDrums; + + case 2: + return this.HiScoreGuitar; + + case 3: + return this.HiSkillGuitar; + + case 4: + return this.HiScoreBass; + + case 5: + return this.HiSkillBass; + + // #23595 2011.1.9 ikanick + case 6: + return this.LastPlayDrums; + + case 7: + return this.LastPlayGuitar; + + case 8: + return this.LastPlayBass; + //------------ + } + throw new IndexOutOfRangeException(); + } + set + { + switch( index ) + { + case 0: + this.HiScoreDrums = value; + return; + + case 1: + this.HiSkillDrums = value; + return; + + case 2: + this.HiScoreGuitar = value; + return; + + case 3: + this.HiSkillGuitar = value; + return; + + case 4: + this.HiScoreBass = value; + return; + + case 5: + this.HiSkillBass = value; + return; + // #23595 2011.1.9 ikanick + case 6: + this.LastPlayDrums = value; + return; + + case 7: + this.LastPlayGuitar = value; + return; + + case 8: + this.LastPlayBass = value; + return; + //------------------ + } + throw new IndexOutOfRangeException(); + } + } + } + public enum E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・ : int + { + Unknown = -2, + File = -1, + HiScoreDrums = 0, + HiSkillDrums = 1, + HiScoreGuitar = 2, + HiSkillGuitar = 3, + HiScoreBass = 4, + HiSkillBass = 5, + LastPlayDrums = 6, // #23595 2011.1.9 ikanick + LastPlayGuitar = 7, // + LastPlayBass = 8, // + } + public enum ERANK : int // #24459 yyagi + { + SS = 0, + S = 1, + A = 2, + B = 3, + C = 4, + D = 5, + E = 6, + UNKNOWN = 99 + } + public class C貍泌・剰ィ倬鹸 + { + public STAUTOPLAY bAutoPlay; + public bool bDrums譛牙柑; + public bool bGuitar譛牙柑; + public STDGBVALUE bHidden; + public STDGBVALUE bLeft; + public STDGBVALUE bLight; + public STDGBVALUE bReverse; + public bool bSTAGEFAILED譛牙柑; + public STDGBVALUE bSudden; + public STDGBVALUE eInvisible; + public bool bTight; + public bool b貍泌・上↓MIDI蜈・蜉帙r菴ソ逕ィ縺励◆; + public bool b貍泌・上↓繧ュ繝シ繝懊シ繝峨r菴ソ逕ィ縺励◆; + public bool b貍泌・上↓繧ク繝ァ繧、繝代ャ繝峨r菴ソ逕ィ縺励◆; + public bool b貍泌・上↓繝槭え繧ケ繧剃スソ逕ィ縺励◆; + public double db繧イ繝シ繝蝙九せ繧ュ繝ォ蛟、; + public double db貍泌・丞梛繧ケ繧ュ繝ォ蛟、; + public E繝繝シ繧ッ繝「繝シ繝 eDark; + public STDGBVALUE eRandom; + public E繝繝。繝シ繧ク繝ャ繝吶Ν e繝繝。繝シ繧ク繝ャ繝吶Ν; + public STDGBVALUE f隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ; + public string Hash; + public int nGood縺ォ縺ェ繧狗ッ蝗イms; + public int nGood謨ー; + public int nGreat縺ォ縺ェ繧狗ッ蝗イms; + public int nGreat謨ー; + public int nMiss謨ー; + public int nPerfect縺ォ縺ェ繧狗ッ蝗イms; + public int nPerfect謨ー; + public int nPoor縺ォ縺ェ繧狗ッ蝗イms; + public int nPoor謨ー; + public int nPerfect謨ー_Auto蜷ォ縺セ縺ェ縺; + public int nGreat謨ー_Auto蜷ォ縺セ縺ェ縺; + public int nGood謨ー_Auto蜷ォ縺セ縺ェ縺; + public int nPoor謨ー_Auto蜷ォ縺セ縺ェ縺; + public int nMiss謨ー_Auto蜷ォ縺セ縺ェ縺; + public long n繧ケ繧ウ繧「; + public int n騾」謇捺焚; + public int n貍泌・城溷コヲ蛻蟄; + public int n貍泌・城溷コヲ蛻豈; + public int n譛螟ァ繧ウ繝ウ繝懈焚; + public int n蜈ィ繝√ャ繝玲焚; + public string strDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ; + public bool 繝ャ繝シ繝ウ9繝「繝シ繝; + public int nRisky; // #23559 2011.6.20 yyagi 0=OFF, 1-10=Risky + public string 譛邨よ峩譁ー譌・譎; + public float f繧イ繝シ繧ク; + public int[] n濶ッ = new int[(int)Difficulty.Total]; + public int[] n蜿ッ = new int[(int)Difficulty.Total]; + public int[] n荳榊庄 = new int[(int)Difficulty.Total]; + public int[] n騾」謇 = new int[(int)Difficulty.Total]; + public int[] n繝上う繧ケ繧ウ繧「 = new int[(int)Difficulty.Total]; + public Dan_C[] Dan_C; + public int[] n繧ッ繝ェ繧「; //0:譛ェ繧ッ繝ェ繧「 1:繧ッ繝ェ繧「 2:繝輔Ν繧ウ繝ウ繝 3:繝峨Φ繝繝輔Ν繧ウ繝ウ繝 + public int[] n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ; //0:譛ェ蜿門セ 1:逋ス邊 2:驫邊 3:驫邊 4:驥鷹寉 5:譯髮 6:邏ォ髮 7:陌ケ讌オ + + public C貍泌・剰ィ倬鹸() + { + this.bAutoPlay = new STAUTOPLAY(); + this.bAutoPlay.LC = false; + this.bAutoPlay.HH = false; + this.bAutoPlay.SD = false; + this.bAutoPlay.BD = false; + this.bAutoPlay.HT = false; + this.bAutoPlay.LT = false; + this.bAutoPlay.FT = false; + this.bAutoPlay.CY = false; + this.bAutoPlay.Guitar = false; + this.bAutoPlay.Bass = false; + this.bAutoPlay.GtR = false; + this.bAutoPlay.GtG = false; + this.bAutoPlay.GtB = false; + this.bAutoPlay.GtPick = false; + this.bAutoPlay.GtW = false; + this.bAutoPlay.BsR = false; + this.bAutoPlay.BsG = false; + this.bAutoPlay.BsB = false; + this.bAutoPlay.BsPick = false; + this.bAutoPlay.BsW = false; + + this.bSudden = new STDGBVALUE(); + this.bSudden.Drums = false; + this.bSudden.Guitar = false; + this.bSudden.Bass = false; + this.bHidden = new STDGBVALUE(); + this.bHidden.Drums = false; + this.bHidden.Guitar = false; + this.bHidden.Bass = false; + this.eInvisible = new STDGBVALUE(); + this.eInvisible.Drums = EInvisible.OFF; + this.eInvisible.Guitar = EInvisible.OFF; + this.eInvisible.Bass = EInvisible.OFF; + this.bReverse = new STDGBVALUE(); + this.bReverse.Drums = false; + this.bReverse.Guitar = false; + this.bReverse.Bass = false; + this.eRandom = new STDGBVALUE(); + this.eRandom.Drums = E繝ゥ繝ウ繝繝繝「繝シ繝.OFF; + this.eRandom.Guitar = E繝ゥ繝ウ繝繝繝「繝シ繝.OFF; + this.eRandom.Bass = E繝ゥ繝ウ繝繝繝「繝シ繝.OFF; + this.bLight = new STDGBVALUE(); + this.bLight.Drums = false; + this.bLight.Guitar = false; + this.bLight.Bass = false; + this.bLeft = new STDGBVALUE(); + this.bLeft.Drums = false; + this.bLeft.Guitar = false; + this.bLeft.Bass = false; + this.f隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ = new STDGBVALUE(); + this.f隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums = 1f; + this.f隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Guitar = 1f; + this.f隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Bass = 1f; + this.n貍泌・城溷コヲ蛻蟄 = 20; + this.n貍泌・城溷コヲ蛻豈 = 20; + this.bGuitar譛牙柑 = true; + this.bDrums譛牙柑 = true; + this.bSTAGEFAILED譛牙柑 = true; + this.e繝繝。繝シ繧ク繝ャ繝吶Ν = E繝繝。繝シ繧ク繝ャ繝吶Ν.譎ョ騾; + this.nPerfect縺ォ縺ェ繧狗ッ蝗イms = 34; + this.nGreat縺ォ縺ェ繧狗ッ蝗イms = 67; + this.nGood縺ォ縺ェ繧狗ッ蝗イms = 84; + this.nPoor縺ォ縺ェ繧狗ッ蝗イms = 117; + this.strDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ = "Unknown"; + this.譛邨よ峩譁ー譌・譎 = ""; + this.Hash = "00000000000000000000000000000000"; + this.繝ャ繝シ繝ウ9繝「繝シ繝 = true; + this.nRisky = 0; // #23559 2011.6.20 yyagi + this.f繧イ繝シ繧ク = 0.0f; + this.n繧ッ繝ェ繧「 = new int[5]; + this.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ = new int[5]; + Dan_C = new Dan_C[4]; + } + + public bool b繝輔Ν繧ウ繝ウ繝懊§繧縺ェ縺 + { + get + { + return !this.b繝輔Ν繧ウ繝ウ繝懊〒縺ゅk; + } + } + public bool b繝輔Ν繧ウ繝ウ繝懊〒縺ゅk + { + get + { + return ( ( this.n譛螟ァ繧ウ繝ウ繝懈焚 > 0 ) && ( this.n譛螟ァ繧ウ繝ウ繝懈焚 == ( this.nPerfect謨ー + this.nGreat謨ー + this.nGood謨ー + this.nPoor謨ー + this.nMiss謨ー ) ) ); + } + } + + public bool b蜈ィAUTO縺倥c縺ェ縺 + { + get + { + return !b蜈ィAUTO縺ァ縺ゅk; + } + } + public bool b蜈ィAUTO縺ァ縺ゅk + { + get + { + return (this.n蜈ィ繝√ャ繝玲焚 - this.nPerfect謨ー_Auto蜷ォ縺セ縺ェ縺 - this.nGreat謨ー_Auto蜷ォ縺セ縺ェ縺 - this.nGood謨ー_Auto蜷ォ縺セ縺ェ縺 - this.nPoor謨ー_Auto蜷ォ縺セ縺ェ縺 - this.nMiss謨ー_Auto蜷ォ縺セ縺ェ縺) == this.n蜈ィ繝√ャ繝玲焚; + } + } +#if false + [StructLayout( LayoutKind.Sequential )] + public struct STAUTOPLAY + { + public bool LC; + public bool HH; + public bool SD; + public bool BD; + public bool HT; + public bool LT; + public bool FT; + public bool CY; + public bool RD; + public bool Guitar; + public bool Bass; + public bool GtR; + public bool GtG; + public bool GtB; + public bool GtPick; + public bool GtW; + public bool BsR; + public bool BsG; + public bool BsB; + public bool BsPick; + public bool BsW; + public bool this[ int index ] + { + get + { + switch ( index ) + { + case (int) E繝ャ繝シ繝ウ.LC: + return this.LC; + case (int) E繝ャ繝シ繝ウ.HH: + return this.HH; + case (int) E繝ャ繝シ繝ウ.SD: + return this.SD; + case (int) E繝ャ繝シ繝ウ.BD: + return this.BD; + case (int) E繝ャ繝シ繝ウ.HT: + return this.HT; + case (int) E繝ャ繝シ繝ウ.LT: + return this.LT; + case (int) E繝ャ繝シ繝ウ.FT: + return this.FT; + case (int) E繝ャ繝シ繝ウ.CY: + return this.CY; + case (int) E繝ャ繝シ繝ウ.RD: + return this.RD; + case (int) E繝ャ繝シ繝ウ.Guitar: + return this.Guitar; + case (int) E繝ャ繝シ繝ウ.Bass: + return this.Bass; + case (int) E繝ャ繝シ繝ウ.GtR: + return this.GtR; + case (int) E繝ャ繝シ繝ウ.GtG: + return this.GtG; + case (int) E繝ャ繝シ繝ウ.GtB: + return this.GtB; + case (int) E繝ャ繝シ繝ウ.GtPick: + return this.GtPick; + case (int) E繝ャ繝シ繝ウ.GtW: + return this.GtW; + case (int) E繝ャ繝シ繝ウ.BsR: + return this.BsR; + case (int) E繝ャ繝シ繝ウ.BsG: + return this.BsG; + case (int) E繝ャ繝シ繝ウ.BsB: + return this.BsB; + case (int) E繝ャ繝シ繝ウ.BsPick: + return this.BsPick; + case (int) E繝ャ繝シ繝ウ.BsW: + return this.BsW; + } + throw new IndexOutOfRangeException(); + } + set + { + switch ( index ) + { + case (int) E繝ャ繝シ繝ウ.LC: + this.LC = value; + return; + case (int) E繝ャ繝シ繝ウ.HH: + this.HH = value; + return; + case (int) E繝ャ繝シ繝ウ.SD: + this.SD = value; + return; + case (int) E繝ャ繝シ繝ウ.BD: + this.BD = value; + return; + case (int) E繝ャ繝シ繝ウ.HT: + this.HT = value; + return; + case (int) E繝ャ繝シ繝ウ.LT: + this.LT = value; + return; + case (int) E繝ャ繝シ繝ウ.FT: + this.FT = value; + return; + case (int) E繝ャ繝シ繝ウ.CY: + this.CY = value; + return; + case (int) E繝ャ繝シ繝ウ.RD: + this.RD = value; + return; + case (int) E繝ャ繝シ繝ウ.Guitar: + this.Guitar = value; + return; + case (int) E繝ャ繝シ繝ウ.Bass: + this.Bass = value; + return; + case (int) E繝ャ繝シ繝ウ.GtR: + this.GtR = value; + return; + case (int) E繝ャ繝シ繝ウ.GtG: + this.GtG = value; + return; + case (int) E繝ャ繝シ繝ウ.GtB: + this.GtB = value; + return; + case (int) E繝ャ繝シ繝ウ.GtPick: + this.GtPick = value; + return; + case (int) E繝ャ繝シ繝ウ.GtW: + this.GtW = value; + return; + case (int) E繝ャ繝シ繝ウ.BsR: + this.BsR = value; + return; + case (int) E繝ャ繝シ繝ウ.BsG: + this.BsG = value; + return; + case (int) E繝ャ繝シ繝ウ.BsB: + this.BsB = value; + return; + case (int) E繝ャ繝シ繝ウ.BsPick: + this.BsPick = value; + return; + case (int) E繝ャ繝シ繝ウ.BsW: + this.BsW = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } +#endif + } + + /// + /// .score.ini 縺ョ蟄伜惠縺吶k繝輔か繝ォ繝シ育オカ蟇セ繝代せシ帶忰蟆セ縺ォ '\' 縺ッ縺、縺縺ヲ縺縺ェ縺シ峨 + /// 譛ェ菫晏ュ倥↑縺ゥ縺ァ繝輔ぃ繧、繝ォ蜷阪′縺ェ縺蝣エ蜷医ッ null縲 + /// + public string ini繝輔ぃ繧、繝ォ縺ョ縺ゅk繝輔か繝ォ繝蜷 + { + get; + private set; + } + + /// + /// .score.ini 縺ョ繝輔ぃ繧、繝ォ蜷搾シ育オカ蟇セ繝代せシ峨 + /// 譛ェ菫晏ュ倥↑縺ゥ縺ァ繝輔ぃ繧、繝ォ蜷阪′縺ェ縺蝣エ蜷医ッ null縲 + /// + public string ini繝輔ぃ繧、繝ォ蜷 + { + get; + private set; + } + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CScoreIni() + { + this.ini繝輔ぃ繧、繝ォ縺ョ縺ゅk繝輔か繝ォ繝蜷 = null; + this.ini繝輔ぃ繧、繝ォ蜷 = null; + this.st繝輔ぃ繧、繝ォ = new ST繝輔ぃ繧、繝ォ(); + st繝輔ぃ繧、繝ォ.Title = ""; + st繝輔ぃ繧、繝ォ.Name = ""; + st繝輔ぃ繧、繝ォ.Hash = ""; + st繝輔ぃ繧、繝ォ.History = new string[] { "", "", "", "", "" }; + st繝輔ぃ繧、繝ォ.BestRank.Drums = (int)ERANK.UNKNOWN; // #24459 2011.2.24 yyagi + st繝輔ぃ繧、繝ォ.BestRank.Guitar = (int)ERANK.UNKNOWN; // + st繝輔ぃ繧、繝ォ.BestRank.Bass = (int)ERANK.UNKNOWN; // + + this.st繧サ繧ッ繧キ繝ァ繝ウ = new ST繧サ繧ッ繧キ繝ァ繝ウ(); + st繧サ繧ッ繧キ繝ァ繝ウ.HiScoreDrums = new C貍泌・剰ィ倬鹸(); + st繧サ繧ッ繧キ繝ァ繝ウ.HiSkillDrums = new C貍泌・剰ィ倬鹸(); + st繧サ繧ッ繧キ繝ァ繝ウ.HiScoreGuitar = new C貍泌・剰ィ倬鹸(); + st繧サ繧ッ繧キ繝ァ繝ウ.HiSkillGuitar = new C貍泌・剰ィ倬鹸(); + st繧サ繧ッ繧キ繝ァ繝ウ.HiScoreBass = new C貍泌・剰ィ倬鹸(); + st繧サ繧ッ繧キ繝ァ繝ウ.HiSkillBass = new C貍泌・剰ィ倬鹸(); + st繧サ繧ッ繧キ繝ァ繝ウ.LastPlayDrums = new C貍泌・剰ィ倬鹸(); + st繧サ繧ッ繧キ繝ァ繝ウ.LastPlayGuitar = new C貍泌・剰ィ倬鹸(); + st繧サ繧ッ繧キ繝ァ繝ウ.LastPlayBass = new C貍泌・剰ィ倬鹸(); + } + + /// + /// 蛻晄悄蛹門セ後↓ini繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ縲 + /// 隱ュ縺ソ霎シ繧薙□ini縺ォ荳肴ュ」蛟、縺後≠繧後ー縲√◎繧後′蜷ォ縺セ繧後k繧サ繧ッ繧キ繝ァ繝ウ繧偵Μ繧サ繝繝医☆繧九 + /// + public CScoreIni( string str隱ュ縺ソ霎シ繧ini繝輔ぃ繧、繝ォ ) + : this() + { + this.t隱ュ縺ソ霎シ縺ソ( str隱ュ縺ソ霎シ繧ini繝輔ぃ繧、繝ォ ); + this.t蜈ィ貍泌・剰ィ倬鹸繧サ繧ッ繧キ繝ァ繝ウ縺ョ謨エ蜷域ァ繧偵メ繧ァ繝繧ッ縺嶺ク肴紛蜷医′縺ゅl縺ー繝ェ繧サ繝繝医☆繧(); + } + + + // 繝。繧ス繝繝 + + /// + /// 迴セ蝨ィ縺ョ this.Record[] 繧ェ繝悶ず繧ァ繧ッ繝医ョ縲∵欠螳壹&繧後◆繧サ繧ッ繧キ繝ァ繝ウ縺ョ諠蝣ア縺梧ュ」蠖薙〒縺ゅk縺句凄縺九r蛻、螳壹☆繧九 + /// 逵溷⊃縺ゥ縺。繧峨〒繧ゅ√◎縺ョ蜀螳ケ縺ッ譖ク縺肴鋤縺医↑縺縲 + /// + /// 蛻、螳壹☆繧九そ繧ッ繧キ繝ァ繝ウ縲 + /// 豁」蠖薙〒縺ゅkシ域紛蜷域ァ縺後≠繧具シ牙エ蜷医ッ true縲 + public bool b謨エ蜷域ァ縺後≠繧( E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・ e繧サ繧ッ繧キ繝ァ繝ウ ) + { + return true; // 繧ェ繝シ繝励Φ繧ス繝シ繧ケ蛹悶↓莨エ縺縲∵紛蜷域ァ繝√ぉ繝繧ッ繧堤┌蜉ケ蛹悶ゑシ2010.10.21シ + } + + /// + /// 謖螳壹&繧後◆繝輔ぃ繧、繝ォ縺ョ蜀螳ケ縺九i MD5 蛟、繧呈アゅa縲√◎繧後r16騾イ謨ー縺ォ螟画鋤縺励◆譁蟄怜励r霑斐☆縲 + /// + /// MD5 繧呈アゅa繧九ヵ繧。繧、繝ォ蜷阪 + /// 邂怜コ邨先棡縺ョ MD5 繧16騾イ謨ー縺ァ荳ヲ縺ケ縺滓枚蟄怜励 + public static string t繝輔ぃ繧、繝ォ縺ョMD5繧呈アゅa縺ヲ霑斐☆( string 繝輔ぃ繧、繝ォ蜷 ) + { + byte[] buffer = null; + FileStream stream = new FileStream( 繝輔ぃ繧、繝ォ蜷, FileMode.Open, FileAccess.Read ); + buffer = new byte[ stream.Length ]; + stream.Read( buffer, 0, (int) stream.Length ); + stream.Close(); + StringBuilder builder = new StringBuilder(0x21); + { + MD5CryptoServiceProvider m = new MD5CryptoServiceProvider(); + byte[] buffer2 = m.ComputeHash(buffer); + foreach (byte num in buffer2) + builder.Append(num.ToString("x2")); + } + return builder.ToString(); + } + + /// + /// 謖螳壹&繧後◆ .score.ini 繧定ェュ縺ソ霎シ繧縲ょ螳ケ縺ョ逵溷⊃縺ッ蛻、螳壹@縺ェ縺縲 + /// + /// 隱ュ縺ソ霎シ繧 .score.ini 繝輔ぃ繧、繝ォ繧呈欠螳壹@縺セ縺呻シ育オカ蟇セ繝代せ縺悟ョ牙ィシ峨 + public void t隱ュ縺ソ霎シ縺ソ( string ini繝輔ぃ繧、繝ォ蜷 ) + { + this.ini繝輔ぃ繧、繝ォ縺ョ縺ゅk繝輔か繝ォ繝蜷 = Path.GetDirectoryName( ini繝輔ぃ繧、繝ォ蜷 ); + this.ini繝輔ぃ繧、繝ォ蜷 = Path.GetFileName( ini繝輔ぃ繧、繝ォ蜷 ); + + E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・ section = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.Unknown; + if( File.Exists( ini繝輔ぃ繧、繝ォ蜷 ) ) + { + string str; + StreamReader reader = new StreamReader( ini繝輔ぃ繧、繝ォ蜷, Encoding.GetEncoding( "Shift_JIS" ) ); + while( ( str = reader.ReadLine() ) != null ) + { + str = str.Replace( '\t', ' ' ).TrimStart( new char[] { '\t', ' ' } ); + if( ( str.Length != 0 ) && ( str[ 0 ] != ';' ) ) + { + try + { + string item; + string para; + C貍泌・剰ィ倬鹸 c貍泌・剰ィ倬鹸; + #region [ section ] + if ( str[ 0 ] == '[' ) + { + StringBuilder builder = new StringBuilder( 0x20 ); + int num = 1; + while( ( num < str.Length ) && ( str[ num ] != ']' ) ) + { + builder.Append( str[ num++ ] ); + } + string str2 = builder.ToString(); + if( str2.Equals( "File" ) ) + { + section = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.File; + } + else if( str2.Equals( "HiScore.Drums" ) ) + { + section = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.HiScoreDrums; + } + else if( str2.Equals( "HiSkill.Drums" ) ) + { + section = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.HiSkillDrums; + } + else if( str2.Equals( "HiScore.Guitar" ) ) + { + section = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.HiScoreGuitar; + } + else if( str2.Equals( "HiSkill.Guitar" ) ) + { + section = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.HiSkillGuitar; + } + else if( str2.Equals( "HiScore.Bass" ) ) + { + section = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.HiScoreBass; + } + else if (str2.Equals("HiSkill.Bass")) + { + section = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.HiSkillBass; + } + // #23595 2011.1.9 ikanick + else if (str2.Equals("LastPlay.Drums")) + { + section = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.LastPlayDrums; + } + else if (str2.Equals("LastPlay.Guitar")) + { + section = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.LastPlayGuitar; + } + else if (str2.Equals("LastPlay.Bass")) + { + section = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.LastPlayBass; + } + //---------------------------------------------------- + else + { + section = E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.Unknown; + } + } + #endregion + else + { + string[] strArray = str.Split( new char[] { '=' } ); + if( strArray.Length == 2 ) + { + item = strArray[ 0 ].Trim(); + para = strArray[ 1 ].Trim(); + switch( section ) + { + case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.File: + { + if( !item.Equals( "Title" ) ) + { + goto Label_01C7; + } + this.st繝輔ぃ繧、繝ォ.Title = para; + continue; + } + case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.HiScoreDrums: + case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.HiSkillDrums: + case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.HiScoreGuitar: + case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.HiSkillGuitar: + case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.HiScoreBass: + case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.HiSkillBass: + case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.LastPlayDrums:// #23595 2011.1.9 ikanick + case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.LastPlayGuitar: + case E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・.LastPlayBass: + { + c貍泌・剰ィ倬鹸 = this.st繧サ繧ッ繧キ繝ァ繝ウ[ (int) section ]; + if( !item.Equals( "Score" ) ) + { + goto Label_03B9; + } + c貍泌・剰ィ倬鹸.n繧ケ繧ウ繧「 = long.Parse( para ); + + + continue; + } + } + } + } + continue; + #region [ File section ] + Label_01C7: + if( item.Equals( "Name" ) ) + { + this.st繝輔ぃ繧、繝ォ.Name = para; + } + else if( item.Equals( "Hash" ) ) + { + this.st繝輔ぃ繧、繝ォ.Hash = para; + } + else if( item.Equals( "PlayCountDrums" ) ) + { + this.st繝輔ぃ繧、繝ォ.PlayCountDrums = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( para, 0, 99999999, 0 ); + } + else if( item.Equals( "PlayCountGuitars" ) )// #23596 11.2.5 changed ikanick + { + this.st繝輔ぃ繧、繝ォ.PlayCountGuitar = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( para, 0, 99999999, 0 ); + } + else if( item.Equals( "PlayCountBass" ) ) + { + this.st繝輔ぃ繧、繝ォ.PlayCountBass = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( para, 0, 99999999, 0 ); + } + // #23596 10.11.16 add ikanick------------------------------------/ + else if (item.Equals("ClearCountDrums")) + { + this.st繝輔ぃ繧、繝ォ.ClearCountDrums = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆(para, 0, 99999999, 0); + } + else if (item.Equals("ClearCountGuitars"))// #23596 11.2.5 changed ikanick + { + this.st繝輔ぃ繧、繝ォ.ClearCountGuitar = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆(para, 0, 99999999, 0); + } + else if (item.Equals("ClearCountBass")) + { + this.st繝輔ぃ繧、繝ォ.ClearCountBass = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆(para, 0, 99999999, 0); + } + // #24459 2011.2.24 yyagi-----------------------------------------/ + else if ( item.Equals( "BestRankDrums" ) ) + { + this.st繝輔ぃ繧、繝ォ.BestRank.Drums = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( para, (int) ERANK.SS, (int) ERANK.E, (int) ERANK.UNKNOWN ); + } + else if ( item.Equals( "BestRankGuitar" ) ) + { + this.st繝輔ぃ繧、繝ォ.BestRank.Guitar = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( para, (int) ERANK.SS, (int) ERANK.E, (int) ERANK.UNKNOWN ); + } + else if ( item.Equals( "BestRankBass" ) ) + { + this.st繝輔ぃ繧、繝ォ.BestRank.Bass = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( para, (int) ERANK.SS, (int) ERANK.E, (int) ERANK.UNKNOWN ); + } + //----------------------------------------------------------------/ + else if ( item.Equals( "History0" ) ) + { + this.st繝輔ぃ繧、繝ォ.History[ 0 ] = para; + } + else if( item.Equals( "History1" ) ) + { + this.st繝輔ぃ繧、繝ォ.History[ 1 ] = para; + } + else if( item.Equals( "History2" ) ) + { + this.st繝輔ぃ繧、繝ォ.History[ 2 ] = para; + } + else if( item.Equals( "History3" ) ) + { + this.st繝輔ぃ繧、繝ォ.History[ 3 ] = para; + } + else if( item.Equals( "History4" ) ) + { + this.st繝輔ぃ繧、繝ォ.History[ 4 ] = para; + } + else if( item.Equals( "HistoryCount" ) ) + { + this.st繝輔ぃ繧、繝ォ.HistoryCount = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ遽蝗イ蜀縺ォ荳ク繧√※霑斐☆( para, 0, 99999999, 0 ); + } + else if( item.Equals( "BGMAdjust" ) ) + { + this.st繝輔ぃ繧、繝ォ.BGMAdjust = C螟画鋤.n蛟、繧呈枚蟄怜励°繧牙叙蠕励@縺ヲ霑斐☆( para, 0 ); + } + continue; + #endregion + #region [ Score section ] + Label_03B9: + if ( item.Equals( "HiScore1" ) ) + { + c貍泌・剰ィ倬鹸.n繝上う繧ケ繧ウ繧「[ 0 ] = int.Parse( para ); + } + else if ( item.Equals( "HiScore2" ) ) + { + c貍泌・剰ィ倬鹸.n繝上う繧ケ繧ウ繧「[ 1 ] = int.Parse( para ); + } + else if ( item.Equals( "HiScore3" ) ) + { + c貍泌・剰ィ倬鹸.n繝上う繧ケ繧ウ繧「[ 2 ] = int.Parse( para ); + } + else if ( item.Equals( "HiScore4" ) ) + { + c貍泌・剰ィ倬鹸.n繝上う繧ケ繧ウ繧「[ 3 ] = int.Parse( para ); + } + else if ( item.Equals( "HiScore5" ) ) + { + c貍泌・剰ィ倬鹸.n繝上う繧ケ繧ウ繧「[ 4 ] = int.Parse( para ); + } + if( item.Equals( "PlaySkill" ) ) + { + try + { + c貍泌・剰ィ倬鹸.db貍泌・丞梛繧ケ繧ュ繝ォ蛟、 = (double) decimal.Parse( para ); + } + catch + { + c貍泌・剰ィ倬鹸.db貍泌・丞梛繧ケ繧ュ繝ォ蛟、 = 0.0; + } + } + else if( item.Equals( "Skill" ) ) + { + try + { + c貍泌・剰ィ倬鹸.db繧イ繝シ繝蝙九せ繧ュ繝ォ蛟、 = (double) decimal.Parse( para ); + } + catch + { + c貍泌・剰ィ倬鹸.db繧イ繝シ繝蝙九せ繧ュ繝ォ蛟、 = 0.0; + } + } + else if( item.Equals( "Perfect" ) ) + { + c貍泌・剰ィ倬鹸.nPerfect謨ー = int.Parse( para ); + } + else if( item.Equals( "Great" ) ) + { + c貍泌・剰ィ倬鹸.nGreat謨ー = int.Parse( para ); + } + else if( item.Equals( "Good" ) ) + { + c貍泌・剰ィ倬鹸.nGood謨ー = int.Parse( para ); + } + else if( item.Equals( "Poor" ) ) + { + c貍泌・剰ィ倬鹸.nPoor謨ー = int.Parse( para ); + } + else if( item.Equals( "Miss" ) ) + { + c貍泌・剰ィ倬鹸.nMiss謨ー = int.Parse( para ); + } + else if( item.Equals( "Roll" ) ) + { + c貍泌・剰ィ倬鹸.n騾」謇捺焚 = int.Parse( para ); + } + else if( item.Equals( "MaxCombo" ) ) + { + c貍泌・剰ィ倬鹸.n譛螟ァ繧ウ繝ウ繝懈焚 = int.Parse( para ); + } + else if( item.Equals( "TotalChips" ) ) + { + c貍泌・剰ィ倬鹸.n蜈ィ繝√ャ繝玲焚 = int.Parse( para ); + } + else if( item.Equals( "AutoPlay" ) ) + { + // LC縺ェ縺 LC縺ゅj CY縺ィRD縺悟挨 Gt/Bs autolane/pick + if( para.Length == 9 || para.Length == 10 || para.Length == 11 || para.Length == 21 ) + { + for( int i = 0; i < para.Length; i++ ) + { + c貍泌・剰ィ倬鹸.bAutoPlay[ i ] = this.ONorOFF( para[ i ] ); + } + } + } + else if ( item.Equals( "Risky" ) ) + { + c貍泌・剰ィ倬鹸.nRisky = int.Parse( para ); + } + else if ( item.Equals( "TightDrums" ) ) + { + c貍泌・剰ィ倬鹸.bTight = C螟画鋤.bONorOFF( para[ 0 ] ); + } + else if ( item.Equals( "SuddenDrums" ) ) + { + c貍泌・剰ィ倬鹸.bSudden.Drums = C螟画鋤.bONorOFF( para[ 0 ] ); + } + else if ( item.Equals( "SuddenGuitar" ) ) + { + c貍泌・剰ィ倬鹸.bSudden.Guitar = C螟画鋤.bONorOFF( para[ 0 ] ); + } + else if ( item.Equals( "SuddenBass" ) ) + { + c貍泌・剰ィ倬鹸.bSudden.Bass = C螟画鋤.bONorOFF( para[ 0 ] ); + } + else if ( item.Equals( "HiddenDrums" ) ) + { + c貍泌・剰ィ倬鹸.bHidden.Drums = C螟画鋤.bONorOFF( para[ 0 ] ); + } + else if ( item.Equals( "HiddenGuitar" ) ) + { + c貍泌・剰ィ倬鹸.bHidden.Guitar = C螟画鋤.bONorOFF( para[ 0 ] ); + } + else if ( item.Equals( "HiddenBass" ) ) + { + c貍泌・剰ィ倬鹸.bHidden.Bass = C螟画鋤.bONorOFF( para[ 0 ] ); + } + else if ( item.Equals( "InvisibleDrums" ) ) + { + c貍泌・剰ィ倬鹸.eInvisible.Drums = (EInvisible) int.Parse( para ); + } + else if ( item.Equals( "InvisibleGuitar" ) ) + { + c貍泌・剰ィ倬鹸.eInvisible.Guitar = (EInvisible) int.Parse( para ); + } + else if ( item.Equals( "InvisibleBass" ) ) + { + c貍泌・剰ィ倬鹸.eInvisible.Bass = (EInvisible) int.Parse( para ); + } + else if ( item.Equals( "ReverseDrums" ) ) + { + c貍泌・剰ィ倬鹸.bReverse.Drums = C螟画鋤.bONorOFF( para[ 0 ] ); + } + else if ( item.Equals( "ReverseGuitar" ) ) + { + c貍泌・剰ィ倬鹸.bReverse.Guitar = C螟画鋤.bONorOFF( para[ 0 ] ); + } + else if ( item.Equals( "ReverseBass" ) ) + { + c貍泌・剰ィ倬鹸.bReverse.Bass = C螟画鋤.bONorOFF( para[ 0 ] ); + } + #endregion + else + { + #region [ RandomGuitar ] + if ( item.Equals( "RandomGuitar" ) ) + { + switch ( int.Parse( para ) ) + { + case (int) E繝ゥ繝ウ繝繝繝「繝シ繝.OFF: + { + c貍泌・剰ィ倬鹸.eRandom.Guitar = E繝ゥ繝ウ繝繝繝「繝シ繝.OFF; + continue; + } + case (int) E繝ゥ繝ウ繝繝繝「繝シ繝.RANDOM: + { + c貍泌・剰ィ倬鹸.eRandom.Guitar = E繝ゥ繝ウ繝繝繝「繝シ繝.RANDOM; + continue; + } + case (int) E繝ゥ繝ウ繝繝繝「繝シ繝.SUPERRANDOM: + { + c貍泌・剰ィ倬鹸.eRandom.Guitar = E繝ゥ繝ウ繝繝繝「繝シ繝.SUPERRANDOM; + continue; + } + case (int) E繝ゥ繝ウ繝繝繝「繝シ繝.HYPERRANDOM: // #25452 2011.6.20 yyagi + { + c貍泌・剰ィ倬鹸.eRandom.Guitar = E繝ゥ繝ウ繝繝繝「繝シ繝.SUPERRANDOM; + continue; + } + } + throw new Exception( "RandomGuitar 縺ョ蛟、縺檎┌蜉ケ縺ァ縺吶" ); + } + #endregion + #region [ RandomBass ] + if ( item.Equals( "RandomBass" ) ) + { + switch ( int.Parse( para ) ) + { + case (int) E繝ゥ繝ウ繝繝繝「繝シ繝.OFF: + { + c貍泌・剰ィ倬鹸.eRandom.Bass = E繝ゥ繝ウ繝繝繝「繝シ繝.OFF; + continue; + } + case (int) E繝ゥ繝ウ繝繝繝「繝シ繝.RANDOM: + { + c貍泌・剰ィ倬鹸.eRandom.Bass = E繝ゥ繝ウ繝繝繝「繝シ繝.RANDOM; + continue; + } + case (int) E繝ゥ繝ウ繝繝繝「繝シ繝.SUPERRANDOM: + { + c貍泌・剰ィ倬鹸.eRandom.Bass = E繝ゥ繝ウ繝繝繝「繝シ繝.SUPERRANDOM; + continue; + } + case (int) E繝ゥ繝ウ繝繝繝「繝シ繝.HYPERRANDOM: // #25452 2011.6.20 yyagi + { + c貍泌・剰ィ倬鹸.eRandom.Bass = E繝ゥ繝ウ繝繝繝「繝シ繝.SUPERRANDOM; + continue; + } + } + throw new Exception( "RandomBass 縺ョ蛟、縺檎┌蜉ケ縺ァ縺吶" ); + } + #endregion + #region [ LightGuitar ] + if ( item.Equals( "LightGuitar" ) ) + { + c貍泌・剰ィ倬鹸.bLight.Guitar = C螟画鋤.bONorOFF( para[ 0 ] ); + } + #endregion + #region [ LightBass ] + else if ( item.Equals( "LightBass" ) ) + { + c貍泌・剰ィ倬鹸.bLight.Bass = C螟画鋤.bONorOFF( para[ 0 ] ); + } + #endregion + #region [ LeftGuitar ] + else if ( item.Equals( "LeftGuitar" ) ) + { + c貍泌・剰ィ倬鹸.bLeft.Guitar = C螟画鋤.bONorOFF( para[ 0 ] ); + } + #endregion + #region [ LeftBass ] + else if ( item.Equals( "LeftBass" ) ) + { + c貍泌・剰ィ倬鹸.bLeft.Bass = C螟画鋤.bONorOFF( para[ 0 ] ); + } + #endregion + else + { + #region [ Dark ] + if ( item.Equals( "Dark" ) ) + { + switch ( int.Parse( para ) ) + { + case 0: + { + c貍泌・剰ィ倬鹸.eDark = E繝繝シ繧ッ繝「繝シ繝.OFF; + continue; + } + case 1: + { + c貍泌・剰ィ倬鹸.eDark = E繝繝シ繧ッ繝「繝シ繝.HALF; + continue; + } + case 2: + { + c貍泌・剰ィ倬鹸.eDark = E繝繝シ繧ッ繝「繝シ繝.FULL; + continue; + } + } + throw new Exception( "Dark 縺ョ蛟、縺檎┌蜉ケ縺ァ縺吶" ); + } + #endregion + #region [ ScrollSpeedDrums ] + if ( item.Equals( "ScrollSpeedDrums" ) ) + { + c貍泌・剰ィ倬鹸.f隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums = (float) decimal.Parse( para ); + } + #endregion + #region [ ScrollSpeedGuitar ] + else if ( item.Equals( "ScrollSpeedGuitar" ) ) + { + c貍泌・剰ィ倬鹸.f隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Guitar = (float) decimal.Parse( para ); + } + #endregion + #region [ ScrollSpeedBass ] + else if ( item.Equals( "ScrollSpeedBass" ) ) + { + c貍泌・剰ィ倬鹸.f隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Bass = (float) decimal.Parse( para ); + } + #endregion + #region [ PlaySpeed ] + else if ( item.Equals( "PlaySpeed" ) ) + { + string[] strArray2 = para.Split( new char[] { '/' } ); + if ( strArray2.Length == 2 ) + { + c貍泌・剰ィ倬鹸.n貍泌・城溷コヲ蛻蟄 = int.Parse( strArray2[ 0 ] ); + c貍泌・剰ィ倬鹸.n貍泌・城溷コヲ蛻豈 = int.Parse( strArray2[ 1 ] ); + } + } + #endregion + else + { + #region [ Guitar ] + if ( item.Equals( "Guitar" ) ) + { + c貍泌・剰ィ倬鹸.bGuitar譛牙柑 = C螟画鋤.bONorOFF( para[ 0 ] ); + } + #endregion + #region [ Drums ] + else if ( item.Equals( "Drums" ) ) + { + c貍泌・剰ィ倬鹸.bDrums譛牙柑 = C螟画鋤.bONorOFF( para[ 0 ] ); + } + #endregion + #region [ StageFailed ] + else if ( item.Equals( "StageFailed" ) ) + { + c貍泌・剰ィ倬鹸.bSTAGEFAILED譛牙柑 = C螟画鋤.bONorOFF( para[ 0 ] ); + } + #endregion + else + { + #region [ DamageLevel ] + if ( item.Equals( "DamageLevel" ) ) + { + switch ( int.Parse( para ) ) + { + case 0: + { + c貍泌・剰ィ倬鹸.e繝繝。繝シ繧ク繝ャ繝吶Ν = E繝繝。繝シ繧ク繝ャ繝吶Ν.蟆代↑縺; + continue; + } + case 1: + { + c貍泌・剰ィ倬鹸.e繝繝。繝シ繧ク繝ャ繝吶Ν = E繝繝。繝シ繧ク繝ャ繝吶Ν.譎ョ騾; + continue; + } + case 2: + { + c貍泌・剰ィ倬鹸.e繝繝。繝シ繧ク繝ャ繝吶Ν = E繝繝。繝シ繧ク繝ャ繝吶Ν.螟ァ縺阪>; + continue; + } + } + throw new Exception( "DamageLevel 縺ョ蛟、縺檎┌蜉ケ縺ァ縺吶" ); + } + #endregion + if ( item.Equals( "UseKeyboard" ) ) + { + c貍泌・剰ィ倬鹸.b貍泌・上↓繧ュ繝シ繝懊シ繝峨r菴ソ逕ィ縺励◆ = C螟画鋤.bONorOFF( para[ 0 ] ); + } + else if ( item.Equals( "UseMIDIIN" ) ) + { + c貍泌・剰ィ倬鹸.b貍泌・上↓MIDI蜈・蜉帙r菴ソ逕ィ縺励◆ = C螟画鋤.bONorOFF( para[ 0 ] ); + } + else if ( item.Equals( "UseJoypad" ) ) + { + c貍泌・剰ィ倬鹸.b貍泌・上↓繧ク繝ァ繧、繝代ャ繝峨r菴ソ逕ィ縺励◆ = C螟画鋤.bONorOFF( para[ 0 ] ); + } + else if ( item.Equals( "UseMouse" ) ) + { + c貍泌・剰ィ倬鹸.b貍泌・上↓繝槭え繧ケ繧剃スソ逕ィ縺励◆ = C螟画鋤.bONorOFF( para[ 0 ] ); + } + else if ( item.Equals( "PerfectRange" ) ) + { + c貍泌・剰ィ倬鹸.nPerfect縺ォ縺ェ繧狗ッ蝗イms = int.Parse( para ); + } + else if ( item.Equals( "GreatRange" ) ) + { + c貍泌・剰ィ倬鹸.nGreat縺ォ縺ェ繧狗ッ蝗イms = int.Parse( para ); + } + else if ( item.Equals( "GoodRange" ) ) + { + c貍泌・剰ィ倬鹸.nGood縺ォ縺ェ繧狗ッ蝗イms = int.Parse( para ); + } + else if ( item.Equals( "PoorRange" ) ) + { + c貍泌・剰ィ倬鹸.nPoor縺ォ縺ェ繧狗ッ蝗イms = int.Parse( para ); + } + else if ( item.Equals( "DTXManiaVersion" ) ) + { + c貍泌・剰ィ倬鹸.strDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ = para; + } + else if ( item.Equals( "DateTime" ) ) + { + c貍泌・剰ィ倬鹸.譛邨よ峩譁ー譌・譎 = para; + } + else if ( item.Equals( "Hash" ) ) + { + c貍泌・剰ィ倬鹸.Hash = para; + } + else if ( item.Equals( "9LaneMode" ) ) + { + c貍泌・剰ィ倬鹸.繝ャ繝シ繝ウ9繝「繝シ繝 = C螟画鋤.bONorOFF( para[ 0 ] ); + } + else if ( item.Equals( "HiScore1" ) ) + { + c貍泌・剰ィ倬鹸.n繝上う繧ケ繧ウ繧「[ 0 ] = int.Parse( para ); + } + else if ( item.Equals( "HiScore2" ) ) + { + c貍泌・剰ィ倬鹸.n繝上う繧ケ繧ウ繧「[ 1 ] = int.Parse( para ); + } + else if ( item.Equals( "HiScore3" ) ) + { + c貍泌・剰ィ倬鹸.n繝上う繧ケ繧ウ繧「[ 2 ] = int.Parse( para ); + } + else if ( item.Equals( "HiScore4" ) ) + { + c貍泌・剰ィ倬鹸.n繝上う繧ケ繧ウ繧「[ 3 ] = int.Parse( para ); + } + else + { + for (int i = 0; i < 5; i++) + { + if (item.Equals("Clear" + i.ToString())) + { + c貍泌・剰ィ倬鹸.n繧ッ繝ェ繧「[i] = int.Parse(para); + } + else if (item.Equals("ScoreRank" + i.ToString())) + { + c貍泌・剰ィ倬鹸.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[i] = int.Parse(para); + } + } + } + //else if ( item.Equals( "HiScore5" ) ) + //{ + // c貍泌・剰ィ倬鹸.n繝上う繧ケ繧ウ繧「[ 4 ] = int.Parse( para ); + //} + + + } + } + } + } + continue; + } + catch( Exception exception ) + { + Trace.TraceError( exception.ToString() ); + Trace.TraceError( "隱ュ縺ソ霎シ縺ソ繧剃クュ譁ュ縺励∪縺吶({0})", ini繝輔ぃ繧、繝ォ蜷 ); + break; + } + } + } + reader.Close(); + } + } + + internal void t繝偵せ繝医Μ繧定ソス蜉縺吶k( string str霑ス蜉譁蟄怜 ) + { + this.st繝輔ぃ繧、繝ォ.HistoryCount++; + for( int i = 3; i >= 0; i-- ) + this.st繝輔ぃ繧、繝ォ.History[ i + 1 ] = this.st繝輔ぃ繧、繝ォ.History[ i ]; + DateTime now = DateTime.Now; + this.st繝輔ぃ繧、繝ォ.History[ 0 ] = string.Format( "{0:0}.{1:D2}/{2}/{3} {4}", this.st繝輔ぃ繧、繝ォ.HistoryCount, now.Year % 100, now.Month, now.Day, str霑ス蜉譁蟄怜 ); + } + internal void t譖ク縺榊コ縺( string ini繝輔ぃ繧、繝ォ蜷 ) + { + this.ini繝輔ぃ繧、繝ォ縺ョ縺ゅk繝輔か繝ォ繝蜷 = Path.GetDirectoryName( ini繝輔ぃ繧、繝ォ蜷 ); + this.ini繝輔ぃ繧、繝ォ蜷 = Path.GetFileName( ini繝輔ぃ繧、繝ォ蜷 ); + + StreamWriter writer = new StreamWriter( ini繝輔ぃ繧、繝ォ蜷, false, Encoding.GetEncoding( "Shift_JIS" ) ); + writer.WriteLine( "[File]" ); + writer.WriteLine( "Title={0}", this.st繝輔ぃ繧、繝ォ.Title ); + writer.WriteLine( "Name={0}", this.st繝輔ぃ繧、繝ォ.Name ); + writer.WriteLine( "Hash={0}", this.st繝輔ぃ繧、繝ォ.Hash ); + writer.WriteLine( "PlayCountDrums={0}", this.st繝輔ぃ繧、繝ォ.PlayCountDrums ); + writer.WriteLine( "PlayCountGuitars={0}", this.st繝輔ぃ繧、繝ォ.PlayCountGuitar ); + writer.WriteLine( "PlayCountBass={0}", this.st繝輔ぃ繧、繝ォ.PlayCountBass ); + writer.WriteLine( "ClearCountDrums={0}", this.st繝輔ぃ繧、繝ォ.ClearCountDrums ); // #23596 10.11.16 add ikanick + writer.WriteLine( "ClearCountGuitars={0}", this.st繝輔ぃ繧、繝ォ.ClearCountGuitar ); // + writer.WriteLine( "ClearCountBass={0}", this.st繝輔ぃ繧、繝ォ.ClearCountBass ); // + writer.WriteLine( "BestRankDrums={0}", this.st繝輔ぃ繧、繝ォ.BestRank.Drums ); // #24459 2011.2.24 yyagi + writer.WriteLine( "BestRankGuitar={0}", this.st繝輔ぃ繧、繝ォ.BestRank.Guitar ); // + writer.WriteLine( "BestRankBass={0}", this.st繝輔ぃ繧、繝ォ.BestRank.Bass ); // + writer.WriteLine( "HistoryCount={0}", this.st繝輔ぃ繧、繝ォ.HistoryCount ); + writer.WriteLine( "History0={0}", this.st繝輔ぃ繧、繝ォ.History[ 0 ] ); + writer.WriteLine( "History1={0}", this.st繝輔ぃ繧、繝ォ.History[ 1 ] ); + writer.WriteLine( "History2={0}", this.st繝輔ぃ繧、繝ォ.History[ 2 ] ); + writer.WriteLine( "History3={0}", this.st繝輔ぃ繧、繝ォ.History[ 3 ] ); + writer.WriteLine( "History4={0}", this.st繝輔ぃ繧、繝ォ.History[ 4 ] ); + writer.WriteLine( "BGMAdjust={0}", this.st繝輔ぃ繧、繝ォ.BGMAdjust ); + writer.WriteLine(); + for ( int i = 0; i < 9; i++ ) + { + string[] strArray = { "HiScore.Drums", "HiSkill.Drums", "HiScore.Guitar", "HiSkill.Guitar", "HiScore.Bass", "HiSkill.Bass", "LastPlay.Drums", "LastPlay.Guitar", "LastPlay.Bass" }; + writer.WriteLine( "[{0}]", strArray[ i ] ); + writer.WriteLine( "Score={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].n繧ケ繧ウ繧「 ); + writer.WriteLine( "PlaySkill={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].db貍泌・丞梛繧ケ繧ュ繝ォ蛟、 ); + writer.WriteLine( "Skill={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].db繧イ繝シ繝蝙九せ繧ュ繝ォ蛟、 ); + writer.WriteLine( "Perfect={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].nPerfect謨ー ); + writer.WriteLine( "Great={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].nGreat謨ー ); + writer.WriteLine( "Good={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].nGood謨ー ); + writer.WriteLine( "Poor={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].nPoor謨ー ); + writer.WriteLine( "Miss={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].nMiss謨ー ); + writer.WriteLine( "MaxCombo={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].n譛螟ァ繧ウ繝ウ繝懈焚 ); + writer.WriteLine( "TotalChips={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].n蜈ィ繝√ャ繝玲焚 ); + writer.Write( "AutoPlay=" ); + for ( int j = 0; j < (int) E繝ャ繝シ繝ウ.MAX; j++ ) + { + writer.Write( this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].bAutoPlay[ j ] ? 1 : 0 ); + } + writer.WriteLine(); + writer.WriteLine( "Risky={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].nRisky ); + writer.WriteLine( "SuddenDrums={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].bSudden.Drums ? 1 : 0 ); + writer.WriteLine( "SuddenGuitar={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].bSudden.Guitar ? 1 : 0 ); + writer.WriteLine( "SuddenBass={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].bSudden.Bass ? 1 : 0 ); + writer.WriteLine( "HiddenDrums={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].bHidden.Drums ? 1 : 0 ); + writer.WriteLine( "HiddenGuitar={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].bHidden.Guitar ? 1 : 0 ); + writer.WriteLine( "HiddenBass={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].bHidden.Bass ? 1 : 0 ); + writer.WriteLine( "InvisibleDrums={0}", (int) this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].eInvisible.Drums ); + writer.WriteLine( "InvisibleGuitar={0}", (int) this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].eInvisible.Guitar ); + writer.WriteLine( "InvisibleBass={0}", (int) this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].eInvisible.Bass ); + writer.WriteLine( "ReverseDrums={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].bReverse.Drums ? 1 : 0 ); + writer.WriteLine( "ReverseGuitar={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].bReverse.Guitar ? 1 : 0 ); + writer.WriteLine( "ReverseBass={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].bReverse.Bass ? 1 : 0 ); + writer.WriteLine( "TightDrums={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].bTight ? 1 : 0 ); + writer.WriteLine( "RandomGuitar={0}", (int) this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].eRandom.Guitar ); + writer.WriteLine( "RandomBass={0}", (int) this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].eRandom.Bass ); + writer.WriteLine( "LightGuitar={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].bLight.Guitar ? 1 : 0 ); + writer.WriteLine( "LightBass={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].bLight.Bass ? 1 : 0 ); + writer.WriteLine( "LeftGuitar={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].bLeft.Guitar ? 1 : 0 ); + writer.WriteLine( "LeftBass={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].bLeft.Bass ? 1 : 0 ); + writer.WriteLine( "Dark={0}", (int) this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].eDark ); + writer.WriteLine( "ScrollSpeedDrums={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].f隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums ); + writer.WriteLine( "ScrollSpeedGuitar={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].f隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Guitar ); + writer.WriteLine( "ScrollSpeedBass={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].f隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Bass ); + writer.WriteLine( "PlaySpeed={0}/{1}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].n貍泌・城溷コヲ蛻蟄, this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].n貍泌・城溷コヲ蛻豈 ); + writer.WriteLine( "Guitar={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].bGuitar譛牙柑 ? 1 : 0 ); + writer.WriteLine( "Drums={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].bDrums譛牙柑 ? 1 : 0 ); + writer.WriteLine( "StageFailed={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].bSTAGEFAILED譛牙柑 ? 1 : 0 ); + writer.WriteLine( "DamageLevel={0}", (int) this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].e繝繝。繝シ繧ク繝ャ繝吶Ν ); + writer.WriteLine( "UseKeyboard={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].b貍泌・上↓繧ュ繝シ繝懊シ繝峨r菴ソ逕ィ縺励◆ ? 1 : 0 ); + writer.WriteLine( "UseMIDIIN={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].b貍泌・上↓MIDI蜈・蜉帙r菴ソ逕ィ縺励◆ ? 1 : 0 ); + writer.WriteLine( "UseJoypad={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].b貍泌・上↓繧ク繝ァ繧、繝代ャ繝峨r菴ソ逕ィ縺励◆ ? 1 : 0 ); + writer.WriteLine( "UseMouse={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].b貍泌・上↓繝槭え繧ケ繧剃スソ逕ィ縺励◆ ? 1 : 0 ); + writer.WriteLine( "PerfectRange={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].nPerfect縺ォ縺ェ繧狗ッ蝗イms ); + writer.WriteLine( "GreatRange={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].nGreat縺ォ縺ェ繧狗ッ蝗イms ); + writer.WriteLine( "GoodRange={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].nGood縺ォ縺ェ繧狗ッ蝗イms ); + writer.WriteLine( "PoorRange={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].nPoor縺ォ縺ェ繧狗ッ蝗イms ); + writer.WriteLine( "DTXManiaVersion={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].strDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ ); + writer.WriteLine( "DateTime={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].譛邨よ峩譁ー譌・譎 ); + writer.WriteLine( "Hash={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].Hash ); + writer.WriteLine( "HiScore1={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].n繝上う繧ケ繧ウ繧「[ 0 ] ); + writer.WriteLine( "HiScore2={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].n繝上う繧ケ繧ウ繧「[ 1 ] ); + writer.WriteLine( "HiScore3={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].n繝上う繧ケ繧ウ繧「[ 2 ] ); + writer.WriteLine( "HiScore4={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].n繝上う繧ケ繧ウ繧「[ 3 ] ); + writer.WriteLine( "HiScore5={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].n繝上う繧ケ繧ウ繧「[ 4 ] ); + writer.WriteLine( "Roll1={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].n騾」謇甜 0 ] ); + writer.WriteLine( "Roll2={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].n騾」謇甜 1 ] ); + writer.WriteLine( "Roll3={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].n騾」謇甜 2 ] ); + writer.WriteLine( "Roll4={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].n騾」謇甜 3 ] ); + writer.WriteLine( "Roll5={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ].n騾」謇甜 4 ] ); + writer.WriteLine("Clear0={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[i].n繧ッ繝ェ繧「[0]); + writer.WriteLine("Clear1={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[i].n繧ッ繝ェ繧「[1]); + writer.WriteLine("Clear2={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[i].n繧ッ繝ェ繧「[2]); + writer.WriteLine("Clear3={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[i].n繧ッ繝ェ繧「[3]); + writer.WriteLine("Clear4={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[i].n繧ッ繝ェ繧「[4]); + writer.WriteLine("ScoreRank0={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[i].n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[0]); + writer.WriteLine("ScoreRank1={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[i].n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[1]); + writer.WriteLine("ScoreRank2={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[i].n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[2]); + writer.WriteLine("ScoreRank3={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[i].n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[3]); + writer.WriteLine("ScoreRank4={0}", this.st繧サ繧ッ繧キ繝ァ繝ウ[i].n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[4]); + } + writer.Close(); + } + internal void t蜈ィ貍泌・剰ィ倬鹸繧サ繧ッ繧キ繝ァ繝ウ縺ョ謨エ蜷域ァ繧偵メ繧ァ繝繧ッ縺嶺ク肴紛蜷医′縺ゅl縺ー繝ェ繧サ繝繝医☆繧() + { + for( int i = 0; i < 9; i++ ) + { + if( !this.b謨エ蜷域ァ縺後≠繧( (E繧サ繧ッ繧キ繝ァ繝ウ遞ョ蛻・) i ) ) + this.st繧サ繧ッ繧キ繝ァ繝ウ[ i ] = new C貍泌・剰ィ倬鹸(); + } + } + internal static int t繝ゥ繝ウ繧ッ蛟、繧定ィ育ョ励@縺ヲ霑斐☆( C貍泌・剰ィ倬鹸 part ) + { + if( part.b貍泌・上↓MIDI蜈・蜉帙r菴ソ逕ィ縺励◆ || part.b貍泌・上↓繧ュ繝シ繝懊シ繝峨r菴ソ逕ィ縺励◆ || part.b貍泌・上↓繧ク繝ァ繧、繝代ャ繝峨r菴ソ逕ィ縺励◆ || part.b貍泌・上↓繝槭え繧ケ繧剃スソ逕ィ縺励◆ ) // 2010.9.11 + { + int nTotal = part.nPerfect謨ー + part.nGreat謨ー + part.nGood謨ー + part.nPoor謨ー + part.nMiss謨ー; + return t繝ゥ繝ウ繧ッ蛟、繧定ィ育ョ励@縺ヲ霑斐☆( nTotal, part.nPerfect謨ー, part.nGreat謨ー, part.nGood謨ー, part.nPoor謨ー, part.nMiss謨ー ); + } + return (int)ERANK.UNKNOWN; + } + internal static int t繝ゥ繝ウ繧ッ蛟、繧定ィ育ョ励@縺ヲ霑斐☆( int nTotal, int nPerfect, int nGreat, int nGood, int nPoor, int nMiss ) + { + if( nTotal <= 0 ) + return (int)ERANK.UNKNOWN; + + //int nRank = (int)ERANK.E; + int nAuto = nTotal - ( nPerfect + nGreat + nGood + nPoor + nMiss ); + if( nTotal == nAuto ) + { + return (int)ERANK.SS; + } + double dRate = ( (double) ( nPerfect + nGreat ) ) / ( (double) ( nTotal - nAuto ) ); + if( dRate == 1.0 ) + { + return (int)ERANK.SS; + } + if( dRate >= 0.95 ) + { + return (int)ERANK.S; + } + if( dRate >= 0.9 ) + { + return (int)ERANK.A; + } + if( dRate >= 0.85 ) + { + return (int)ERANK.B; + } + if( dRate >= 0.8 ) + { + return (int)ERANK.C; + } + if( dRate >= 0.7 ) + { + return (int)ERANK.D; + } + return (int)ERANK.E; + } + internal static double t繧イ繝シ繝蝙九せ繧ュ繝ォ繧定ィ育ョ励@縺ヲ霑斐☆( int nLevel, int nTotal, int nPerfect, int nCombo, E讌ス蝎ィ繝代シ繝 inst, STAUTOPLAY bAutoPlay ) + { + double ret; + if( ( nTotal == 0 ) || ( ( nPerfect == 0 ) && ( nCombo == 0 ) ) ) + ret = 0.0; + + ret = ( ( nLevel * ( ( nPerfect * 0.8 + nCombo * 0.2 ) / ( (double) nTotal ) ) ) / 2.0 ); + ret *= dbCalcReviseValForDrGtBsAutoLanes( inst, bAutoPlay ); + + return ret; + } + internal static double t貍泌・丞梛繧ケ繧ュ繝ォ繧定ィ育ョ励@縺ヲ霑斐☆( int nTotal, int nPerfect, int nGreat, int nGood, int nPoor, int nMiss, E讌ス蝎ィ繝代シ繝 inst, STAUTOPLAY bAutoPlay) + { + if( nTotal == 0 ) + return 0.0; + + int nAuto = nTotal - ( nPerfect + nGreat + nGood + nPoor + nMiss ); + double y = ( ( nPerfect * 1.0 + nGreat * 0.8 + nGood * 0.5 + nPoor * 0.2 + nMiss * 0.0 + nAuto * 0.0 ) * 100.0 ) / ( (double) nTotal ); + double ret = ( 100.0 * ( ( Math.Pow( 1.03, y ) - 1.0 ) / ( Math.Pow( 1.03, 100.0 ) - 1.0 ) ) ); + + ret *= dbCalcReviseValForDrGtBsAutoLanes( inst, bAutoPlay ); + return ret; + } + internal static double dbCalcReviseValForDrGtBsAutoLanes( E讌ス蝎ィ繝代シ繝 inst, STAUTOPLAY bAutoPlay ) + { + //蜑企勁 + return 1.0; + } + internal static double t雜邊セ蟇蝙九せ繧ュ繝ォ繧定ィ育ョ励@縺ヲ霑斐☆( CDTX dtx, int nTotal, int nPerfect, int nGood, int nMiss, int Poor, int nMaxLagTime, int nMinLagTimen, int nMaxCombo ) + { + //貍泌・乗千クセ 譛螟ァ60轤ケ + //譛螟ァ繧ウ繝ウ繝 譛螟ァ5轤ケ + //遨コ謇薙■ 譛螟ァ10轤ケ(貂帷せ縺ゅj) + //譛螟ァ_譛蟆上ぜ繝ャ譎る俣 譛螟ァ10轤ケ + //蟷ウ蝮繧コ繝ャ譎る俣 譛螟ァ5轤ケ + //繝懊シ繝翫せA 譛螟ァ5轤ケ + //繝懊シ繝翫せB 譛螟ァ5轤ケ + + double db貍泌・冗せ = 0; + double db譛螟ァ繧ウ繝ウ繝 = 0; + double db遨コ謇薙■ = 0; + double db譛螟ァ繧コ繝ャ譎る俣 = 0; + double db譛蟆上ぜ繝ャ譎る俣 = 0; + double db蟷ウ蝮譛螟ァ繧コ繝ャ譎る俣 = 0; + double db蟷ウ蝮譛蟆上ぜ繝ャ譎る俣 = 0; + double db繝懊シ繝翫せA = 0; + double db繝懊シ繝翫せB = 0; + + #region[ 貍泌・冗せ ] + + #endregion + #region[ 遨コ謇薙■ ] + int[] n遨コ謇薙■Array = new int[] { 1, 2, 3, 5, 10, 15, 20, 30, 40, 50 }; + int n遨コ謇薙■pt = 0; + for( n遨コ謇薙■pt = 0; n遨コ謇薙■pt < 10; n遨コ謇薙■pt++ ) + { + if( Poor == n遨コ謇薙■Array[ n遨コ謇薙■pt ] ) + break; + } + db遨コ謇薙■ = ( Poor == 0 ? 10 : 10 - n遨コ謇薙■pt ); + #endregion + + return 1.0; + } + internal static string t貍泌・上そ繧ッ繧キ繝ァ繝ウ縺ョMD5繧呈アゅa縺ヲ霑斐☆( C貍泌・剰ィ倬鹸 cc ) + { + StringBuilder builder = new StringBuilder(); + builder.Append( cc.n繧ケ繧ウ繧「.ToString() ); + builder.Append( cc.db繧イ繝シ繝蝙九せ繧ュ繝ォ蛟、.ToString( ".000000" ) ); + builder.Append( cc.db貍泌・丞梛繧ケ繧ュ繝ォ蛟、.ToString( ".000000" ) ); + builder.Append( cc.nPerfect謨ー ); + builder.Append( cc.nGreat謨ー ); + builder.Append( cc.nGood謨ー ); + builder.Append( cc.nPoor謨ー ); + builder.Append( cc.nMiss謨ー ); + builder.Append( cc.n譛螟ァ繧ウ繝ウ繝懈焚 ); + builder.Append( cc.n蜈ィ繝√ャ繝玲焚 ); + for( int i = 0; i < 10; i++ ) + builder.Append( boolToChar( cc.bAutoPlay[ i ] ) ); + builder.Append( boolToChar( cc.bTight ) ); + builder.Append( boolToChar( cc.bSudden.Drums ) ); + builder.Append( boolToChar( cc.bSudden.Guitar ) ); + builder.Append( boolToChar( cc.bSudden.Bass ) ); + builder.Append( boolToChar( cc.bHidden.Drums ) ); + builder.Append( boolToChar( cc.bHidden.Guitar ) ); + builder.Append( boolToChar( cc.bHidden.Bass ) ); + builder.Append( (int) cc.eInvisible.Drums ); + builder.Append( (int) cc.eInvisible.Guitar ); + builder.Append( (int) cc.eInvisible.Bass ); + builder.Append( boolToChar( cc.bReverse.Drums ) ); + builder.Append( boolToChar( cc.bReverse.Guitar ) ); + builder.Append( boolToChar( cc.bReverse.Bass ) ); + builder.Append( (int) cc.eRandom.Guitar ); + builder.Append( (int) cc.eRandom.Bass ); + builder.Append( boolToChar( cc.bLight.Guitar ) ); + builder.Append( boolToChar( cc.bLight.Bass ) ); + builder.Append( boolToChar( cc.bLeft.Guitar ) ); + builder.Append( boolToChar( cc.bLeft.Bass ) ); + builder.Append( (int) cc.eDark ); + builder.Append( cc.f隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums.ToString( ".000000" ) ); + builder.Append( cc.f隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Guitar.ToString( ".000000" ) ); + builder.Append( cc.f隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Bass.ToString( ".000000" ) ); + builder.Append( cc.n貍泌・城溷コヲ蛻蟄 ); + builder.Append( cc.n貍泌・城溷コヲ蛻豈 ); + builder.Append( boolToChar( cc.bGuitar譛牙柑 ) ); + builder.Append( boolToChar( cc.bDrums譛牙柑 ) ); + builder.Append( boolToChar( cc.bSTAGEFAILED譛牙柑 ) ); + builder.Append( (int) cc.e繝繝。繝シ繧ク繝ャ繝吶Ν ); + builder.Append( boolToChar( cc.b貍泌・上↓繧ュ繝シ繝懊シ繝峨r菴ソ逕ィ縺励◆ ) ); + builder.Append( boolToChar( cc.b貍泌・上↓MIDI蜈・蜉帙r菴ソ逕ィ縺励◆ ) ); + builder.Append( boolToChar( cc.b貍泌・上↓繧ク繝ァ繧、繝代ャ繝峨r菴ソ逕ィ縺励◆ ) ); + builder.Append( boolToChar( cc.b貍泌・上↓繝槭え繧ケ繧剃スソ逕ィ縺励◆ ) ); + builder.Append( cc.nPerfect縺ォ縺ェ繧狗ッ蝗イms ); + builder.Append( cc.nGreat縺ォ縺ェ繧狗ッ蝗イms ); + builder.Append( cc.nGood縺ォ縺ェ繧狗ッ蝗イms ); + builder.Append( cc.nPoor縺ォ縺ェ繧狗ッ蝗イms ); + builder.Append( cc.strDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ ); + builder.Append( cc.譛邨よ峩譁ー譌・譎 ); + + byte[] bytes = Encoding.GetEncoding( "Shift_JIS" ).GetBytes( builder.ToString() ); + StringBuilder builder2 = new StringBuilder(0x21); + { + MD5CryptoServiceProvider m = new MD5CryptoServiceProvider(); + byte[] buffer2 = m.ComputeHash(bytes); + foreach (byte num2 in buffer2) + builder2.Append(num2.ToString("x2")); + } + return builder2.ToString(); + } + internal static void t譖エ譁ー譚。莉カ繧貞叙蠕励☆繧( out bool bDrums繧呈峩譁ー縺吶k, out bool bGuitar繧呈峩譁ー縺吶k, out bool bBass繧呈峩譁ー縺吶k ) + { + bDrums繧呈峩譁ー縺吶k = !TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay; + bGuitar繧呈峩譁ー縺吶k = false; + bBass繧呈峩譁ー縺吶k = false; + } + internal static int t邱丞粋繝ゥ繝ウ繧ッ蛟、繧定ィ育ョ励@縺ヲ霑斐☆( C貍泌・剰ィ倬鹸 Drums, C貍泌・剰ィ倬鹸 Guitar, C貍泌・剰ィ倬鹸 Bass ) + { + int nTotal = Drums.n蜈ィ繝√ャ繝玲焚; + int nPerfect = Drums.nPerfect謨ー_Auto蜷ォ縺セ縺ェ縺; // #24569 2011.3.1 yyagi: to calculate result rank without AUTO chips + int nGreat = Drums.nGreat謨ー_Auto蜷ォ縺セ縺ェ縺; // + int nGood = Drums.nGood謨ー_Auto蜷ォ縺セ縺ェ縺; // + int nPoor = Drums.nPoor謨ー_Auto蜷ォ縺セ縺ェ縺; // + int nMiss = Drums.nMiss謨ー_Auto蜷ォ縺セ縺ェ縺; // + return t繝ゥ繝ウ繧ッ蛟、繧定ィ育ョ励@縺ヲ霑斐☆( nTotal, nPerfect, nGreat, nGood, nPoor, nMiss ); + } + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private bool ONorOFF( char c ) + { + return ( c != '0' ); + } + private static char boolToChar( bool b ) + { + if( !b ) + { + return '0'; + } + return '1'; + } + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Songs/CSong邂。逅.cs b/TJAPlayer3/Songs/CSong邂。逅.cs new file mode 100644 index 00000000..fcdc9a0c --- /dev/null +++ b/TJAPlayer3/Songs/CSong邂。逅.cs @@ -0,0 +1,1827 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Text; +using System.Diagnostics; +using System.IO; +using System.Threading; +using TJAPlayer3.C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers; +using FDK; +using System.Web.UI; +using System.Drawing; + +namespace TJAPlayer3 +{ + [Serializable] + internal class CSongs邂。逅 + { + // 繝励Ο繝代ユ繧」 + + /*public int nSongsDB縺九i蜿門セ励〒縺阪◆繧ケ繧ウ繧「謨ー + { + get; + set; + } + public int nSongsDB縺ク蜃コ蜉帙〒縺阪◆繧ケ繧ウ繧「謨ー + { + get; + set; + }*/ + public int n繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・縺九i蜿肴丐縺ァ縺阪◆繧ケ繧ウ繧「謨ー + { + get; + set; + } + public int n繝輔ぃ繧、繝ォ縺九i蜿肴丐縺ァ縺阪◆繧ケ繧ウ繧「謨ー + { + get; + set; + } + public int n讀懃エ「縺輔l縺溘せ繧ウ繧「謨ー + { + get; + set; + } + public int n讀懃エ「縺輔l縺滓峇繝弱シ繝画焚 + { + get; + set; + } + /*[NonSerialized] + public List listSongsDB;*/ // songs.db縺九i讒狗ッ峨&繧後klist + public List list譖イ繝ォ繝シ繝; // 襍キ蜍墓凾縺ォ繝輔か繝ォ繝讀懃エ「縺励※讒狗ッ峨&繧後klist + public List list譖イ繝ォ繝シ繝_Dan = new List(); // 襍キ蜍墓凾縺ォ繝輔か繝ォ繝讀懃エ「縺励※讒狗ッ峨&繧後klist + public bool bIsSuspending // 螟夜Κ繧ケ繝ャ繝繝峨°繧峨∝驛ィ繧ケ繝ャ繝繝峨ョsuspend繧呈欠遉コ縺吶k譎ゅ↓true縺ォ縺吶k + { // 蜀埼幕譎ゅッ縲√%繧後rfalse縺ォ縺励※縺九i縲∵ャ。縺ョautoReset.Set()繧貞ョ溯。後☆繧 + get; + set; + } + public bool bIsSlowdown // #PREMOVIE蜀咲函譎ゅ↓譖イ讀懃エ「繧帝≦縺上☆繧 + { + get; + set; + } + [NonSerialized] + public AutoResetEvent AutoReset; + /*public AutoResetEvent AutoReset + { + get + { + return autoReset; + } + private set + { + autoReset = value; + } + }*/ + + private int searchCount; // #PREMOVIE荳ュ縺ッ讀懃エ「n蝗槫ョ溯。後@縺溘i蟆代@繧ケ繝ェ繝シ繝励☆繧 + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CSongs邂。逅() + { + //this.listSongsDB = new List(); + this.list譖イ繝ォ繝シ繝 = new List(); + this.n讀懃エ「縺輔l縺滓峇繝弱シ繝画焚 = 0; + this.n讀懃エ「縺輔l縺溘せ繧ウ繧「謨ー = 0; + this.bIsSuspending = false; // #27060 + this.AutoReset = new AutoResetEvent( true ); // #27060 + this.searchCount = 0; + } + + + // 繝。繧ス繝繝 + /* + #region [ SongsDB(songs.db) 繧定ェュ縺ソ霎シ繧 ] + //----------------- + public void tSongsDB繧定ェュ縺ソ霎シ繧( string SongsDB繝輔ぃ繧、繝ォ蜷 ) + { + this.nSongsDB縺九i蜿門セ励〒縺阪◆繧ケ繧ウ繧「謨ー = 0; + if( File.Exists( SongsDB繝輔ぃ繧、繝ォ蜷 ) ) + { + BinaryReader br = null; + try + { + br = new BinaryReader( File.OpenRead( SongsDB繝輔ぃ繧、繝ォ蜷 ) ); + if ( !br.ReadString().Equals( SONGSDB_VERSION ) ) + { + throw new InvalidDataException( "繝倥ャ繝縺檎焚縺ェ繧翫∪縺吶" ); + } + this.listSongsDB = new List(); + + while( true ) + { + try + { + C繧ケ繧ウ繧「 item = this.tSongsDB縺九i繧ケ繧ウ繧「繧抵シ代▽隱ュ縺ソ霎シ繧( br ); + this.listSongsDB.Add( item ); + this.nSongsDB縺九i蜿門セ励〒縺阪◆繧ケ繧ウ繧「謨ー++; + } + catch( EndOfStreamException ) + { + break; + } + } + } + finally + { + if( br != null ) + br.Close(); + } + } + } + //----------------- + #endregion + */ + #region [ 譖イ繧呈、懃エ「縺励※繝ェ繧ケ繝医r菴懈舌☆繧 ] + //----------------- + public void t譖イ繧呈、懃エ「縺励※繝ェ繧ケ繝医r菴懈舌☆繧( string str蝓コ轤ケ繝輔か繝ォ繝, bool b蟄殖OX縺ク蜀榊クー縺吶k ) + { + this.t譖イ繧呈、懃エ「縺励※繝ェ繧ケ繝医r菴懈舌☆繧( str蝓コ轤ケ繝輔か繝ォ繝, b蟄殖OX縺ク蜀榊クー縺吶k, this.list譖イ繝ォ繝シ繝, null ); + } + private void t譖イ繧呈、懃エ「縺励※繝ェ繧ケ繝医r菴懈舌☆繧( string str蝓コ轤ケ繝輔か繝ォ繝, bool b蟄殖OX縺ク蜀榊クー縺吶k, List list繝弱シ繝峨Μ繧ケ繝, C譖イ繝ェ繧ケ繝医ヮ繝シ繝 node隕ェ ) + { + if( !str蝓コ轤ケ繝輔か繝ォ繝.EndsWith( @"\" ) ) + str蝓コ轤ケ繝輔か繝ォ繝 = str蝓コ轤ケ繝輔か繝ォ繝 + @"\"; + + DirectoryInfo info = new DirectoryInfo( str蝓コ轤ケ繝輔か繝ォ繝 ); + + if( TJAPlayer3.ConfigIni.bLog譖イ讀懃エ「繝ュ繧ー蜃コ蜉 ) + Trace.TraceInformation( "蝓コ轤ケ繝輔か繝ォ繝: " + str蝓コ轤ケ繝輔か繝ォ繝 ); + + #region [ a.繝輔か繝ォ繝蜀縺ォ set.def 縺悟ュ伜惠縺吶k蝣エ蜷 竊 1繝輔か繝ォ繝蜀縺ョtja繝輔ぃ繧、繝ォ辟。蛻カ髯疹 + //----------------------------- + string path = str蝓コ轤ケ繝輔か繝ォ繝 + "set.def"; + if( File.Exists( path ) ) + { + new FileInfo( path ); + if( TJAPlayer3.ConfigIni.bLog譖イ讀懃エ「繝ュ繧ー蜃コ蜉 ) + { + Trace.TraceInformation( "set.def讀懷コ : {0}", path ); + Trace.Indent(); + } + try + { + foreach( FileInfo fileinfo in info.GetFiles() ) + { + SlowOrSuspendSearchTask(); + #region[ 諡。蠑オ蟄舌r蜿門セ ] + string strExt = fileinfo.Extension.ToLower(); + #endregion + if( ( strExt.Equals( ".tja" ) || strExt.Equals( ".dtx" ) ) ) + { + if( strExt.Equals( ".tja" ) ) + { + //tja縲‥tx縺御ク。譁ケ蟄伜惠縺励※縺縺溷エ蜷医》ja繧定ェュ縺ソ霎シ縺セ縺壹↓tja縺ィ蜷悟錐縺ョdtx縺縺代r菴ソ縺縲 + string dtxscoreini = str蝓コ轤ケ繝輔か繝ォ繝 + ( fileinfo.Name.Replace( strExt, ".dtx" ) ); + if( File.Exists( dtxscoreini ) ) + { + continue; + } + } + + #region[ 譁ー蜃ヲ逅 ] + CDTX dtx = new CDTX( fileinfo.FullName, false, 1.0, 0, 1 ); + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 = new C譖イ繝ェ繧ケ繝医ヮ繝シ繝(); + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ = C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE; + + bool b = false; + for( int n = 0; n < (int)Difficulty.Total; n++ ) + { + if( dtx.b隴憺擇縺悟ュ伜惠縺吶k[ n ] ) + { + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.n繧ケ繧ウ繧「謨ー++; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝 = node隕ェ; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.strBreadcrumbs = ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝 == null ) ? + str蝓コ轤ケ繝輔か繝ォ繝 + fileinfo.Name : c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝.strBreadcrumbs + " > " + str蝓コ轤ケ繝輔か繝ォ繝 + fileinfo.Name; + + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν = dtx.TITLE; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧オ繝悶ち繧、繝医Ν = dtx.SUBTITLE; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ = dtx.GENRE; + if (c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝 != null && c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝.str繧ク繝」繝ウ繝ォ != "") + { + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ = c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝.str繧ク繝」繝ウ繝ォ; + } + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nLevel = dtx.LEVELtaiko; + + switch (c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ) + { + case "J-POP": + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ = "繝昴ャ繝励せ"; + break; + case "繧イ繝シ繝繝溘Η繝シ繧ク繝繧ッ": + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ = "繧イ繝シ繝繝舌Λ繧ィ繝繧」"; + break; + case "縺ゥ縺繧医≧": + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ = "繧ュ繝繧コ"; + break; + } + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str譛ャ蠖薙ョ繧ク繝」繝ウ繝ォ = c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ; + + + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ n ] = new C繧ケ繧ウ繧「(); + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ n ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ = str蝓コ轤ケ繝輔か繝ォ繝 + fileinfo.Name; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ n ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ = str蝓コ轤ケ繝輔か繝ォ繝; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ n ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ繧オ繧、繧コ = fileinfo.Length; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ n ].繝輔ぃ繧、繝ォ諠蝣ア.譛邨よ峩譁ー譌・譎 = fileinfo.LastWriteTime; + string strFileNameScoreIni = c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ n ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ + ".score.ini"; + if( File.Exists( strFileNameScoreIni ) ) + { + FileInfo infoScoreIni = new FileInfo( strFileNameScoreIni ); + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ n ].ScoreIni諠蝣ア.繝輔ぃ繧、繝ォ繧オ繧、繧コ = infoScoreIni.Length; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ n ].ScoreIni諠蝣ア.譛邨よ峩譁ー譌・譎 = infoScoreIni.LastWriteTime; + } + if( b == false ) + { + this.n讀懃エ「縺輔l縺溘せ繧ウ繧「謨ー++; + list繝弱シ繝峨Μ繧ケ繝.Add( c譖イ繝ェ繧ケ繝医ヮ繝シ繝 ); + this.n讀懃エ「縺輔l縺滓峇繝弱シ繝画焚++; + b = true; + } + } + } + dtx = null; + } + #endregion + } + } + finally + { + if( TJAPlayer3.ConfigIni.bLog譖イ讀懃エ「繝ュ繧ー蜃コ蜉 ) + { + Trace.Unindent(); + } + } + } + //----------------------------- + #endregion + + #region [ b.繝輔か繝ォ繝蜀縺ォ set.def 縺悟ュ伜惠縺励↑縺蝣エ蜷 竊 蛟句挨繝輔ぃ繧、繝ォ縺九i繝弱シ繝我ス懈 ] + //----------------------------- + else + { + foreach( FileInfo fileinfo in info.GetFiles() ) + { + SlowOrSuspendSearchTask(); // #27060 荳ュ譁ュ隕∵アゅ′縺ゅ▲縺溘i縲∬ァ」髯、隕∵アゅ′譚・繧九∪縺ァ蠕讖, #PREMOVIE蜀咲函荳ュ縺ッ讀懃エ「雋闕キ繧定誠縺ィ縺 + string strExt = fileinfo.Extension.ToLower(); + + if( ( strExt.Equals( ".tja" ) || strExt.Equals( ".dtx" ) ) ) + { + // 2017.06.02 kairera0467 蟒豁「縲 + //if( strExt.Equals( ".tja" ) ) + //{ + // //tja縲‥tx縺御ク。譁ケ蟄伜惠縺励※縺縺溷エ蜷医》ja繧定ェュ縺ソ霎シ縺セ縺壹↓dtx縺縺台スソ縺縲 + // string[] dtxscoreini = Directory.GetFiles( str蝓コ轤ケ繝輔か繝ォ繝, "*.dtx"); + // if(dtxscoreini.Length != 0 ) + // { + // continue; + // } + //} + + #region[ 譁ー蜃ヲ逅 ] + CDTX dtx = new CDTX( str蝓コ轤ケ繝輔か繝ォ繝 + fileinfo.Name, false, 1.0, 0, 0 ); + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 = new C譖イ繝ェ繧ケ繝医ヮ繝シ繝(); + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ = C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE; + + bool b = false; + for( int n = 0; n < (int)Difficulty.Total; n++ ) + { + if( dtx.b隴憺擇縺悟ュ伜惠縺吶k[ n ] ) + { + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.n繧ケ繧ウ繧「謨ー++; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝 = node隕ェ; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.strBreadcrumbs = ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝 == null ) ? + str蝓コ轤ケ繝輔か繝ォ繝 + fileinfo.Name : c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝.strBreadcrumbs + " > " + str蝓コ轤ケ繝輔か繝ォ繝 + fileinfo.Name; + + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν = dtx.TITLE; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧オ繝悶ち繧、繝医Ν = dtx.SUBTITLE; + + if (dtx.List_DanSongs != null) + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.DanSongs = dtx.List_DanSongs; + + if (dtx.Dan_C != null) + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.Dan_C = dtx.Dan_C; + + if (!string.IsNullOrEmpty(dtx.GENRE)) + { + if(c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝 != null) + { + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ = c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝.str繧ク繝」繝ウ繝ォ; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str譛ャ蠖薙ョ繧ク繝」繝ウ繝ォ = dtx.GENRE; + } + else + { + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ = dtx.GENRE; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str譛ャ蠖薙ョ繧ク繝」繝ウ繝ォ = dtx.GENRE; + } + } + else + { + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ = c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝.str繧ク繝」繝ウ繝ォ; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str譛ャ蠖薙ョ繧ク繝」繝ウ繝ォ = c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝.str繧ク繝」繝ウ繝ォ; + } + + switch (c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ) + { + case "J-POP": + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ = "繝昴ャ繝励せ"; + break; + case "繧イ繝シ繝繝溘Η繝シ繧ク繝繧ッ": + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ = "繧イ繝シ繝繝舌Λ繧ィ繝繧」"; + break; + case "縺ゥ縺繧医≧": + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ = "繧ュ繝繧コ"; + break; + } + + switch (c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str譛ャ蠖薙ョ繧ク繝」繝ウ繝ォ) + { + case "J-POP": + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str譛ャ蠖薙ョ繧ク繝」繝ウ繝ォ = "繝昴ャ繝励せ"; + break; + case "繧イ繝シ繝繝溘Η繝シ繧ク繝繧ッ": + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str譛ャ蠖薙ョ繧ク繝」繝ウ繝ォ = "繧イ繝シ繝繝舌Λ繧ィ繝繧」"; + break; + case "縺ゥ縺繧医≧": + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str譛ャ蠖薙ョ繧ク繝」繝ウ繝ォ = "繧ュ繝繧コ"; + break; + } + + if (c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝 != null) + { + if (c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝.IsChangedForeColor) + { + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor = c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝.ForeColor; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.IsChangedForeColor = true; + } + if (c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝.IsChangedBackColor) + { + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor = c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝.BackColor; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.IsChangedBackColor = true; + } + } + + + switch (CStr繧ク繝」繝ウ繝ォtoNum.ForAC15(c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ)) + { + case 0: + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_JPOP; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_JPOP; + break; + case 1: + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Anime; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_Anime; + break; + case 2: + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_VOCALOID; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_VOCALOID; + break; + case 3: + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Children; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_Children; + break; + case 4: + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Variety; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_Variety; + break; + case 5: + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Classic; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_Classic; + break; + case 6: + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_GameMusic; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_GameMusic; + break; + case 7: + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Namco; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_Namco; + break; + default: + break; + } + + + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nLevel = dtx.LEVELtaiko; + + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ n ] = new C繧ケ繧ウ繧「(); + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ n ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ = str蝓コ轤ケ繝輔か繝ォ繝 + fileinfo.Name; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ n ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ = str蝓コ轤ケ繝輔か繝ォ繝; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ n ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ繧オ繧、繧コ = fileinfo.Length; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ n ].繝輔ぃ繧、繝ォ諠蝣ア.譛邨よ峩譁ー譌・譎 = fileinfo.LastWriteTime; + string strFileNameScoreIni = c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ n ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ + ".score.ini"; + if( File.Exists( strFileNameScoreIni ) ) + { + FileInfo infoScoreIni = new FileInfo( strFileNameScoreIni ); + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ n ].ScoreIni諠蝣ア.繝輔ぃ繧、繝ォ繧オ繧、繧コ = infoScoreIni.Length; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ n ].ScoreIni諠蝣ア.譛邨よ峩譁ー譌・譎 = infoScoreIni.LastWriteTime; + } + if( b == false ) + { + this.n讀懃エ「縺輔l縺溘せ繧ウ繧「謨ー++; + list繝弱シ繝峨Μ繧ケ繝.Add( c譖イ繝ェ繧ケ繝医ヮ繝シ繝 ); + this.n讀懃エ「縺輔l縺滓峇繝弱シ繝画焚++; + b = true; + } + + if( TJAPlayer3.ConfigIni.bLog譖イ讀懃エ「繝ュ繧ー蜃コ蜉 ) + { + // Trace.Indent(); + // try + // { + // StringBuilder sb = new StringBuilder( 0x100 ); + // sb.Append( string.Format( "nID#{0:D3}", c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nID ) ); + // if( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝 != null ) + // { + // sb.Append( string.Format( "(in#{0:D3}):", c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝.nID ) ); + // } + // else + // { + // sb.Append( "(onRoot):" ); + // } + // sb.Append( " SONG, File=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ ); + // sb.Append( ", Size=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ繧オ繧、繧コ ); + // sb.Append( ", LastUpdate=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.譛邨よ峩譁ー譌・譎 ); + // Trace.TraceInformation( sb.ToString() ); + // } + // finally + // { + // Trace.Unindent(); + // } + } + } + } + #endregion + } + } + } + //----------------------------- + #endregion + + foreach( DirectoryInfo infoDir in info.GetDirectories() ) + { + SlowOrSuspendSearchTask(); // #27060 荳ュ譁ュ隕∵アゅ′縺ゅ▲縺溘i縲∬ァ」髯、隕∵アゅ′譚・繧九∪縺ァ蠕讖, #PREMOVIE蜀咲函荳ュ縺ッ讀懃エ「雋闕キ繧定誠縺ィ縺 + + #region [ a. "dtxfiles." 縺ァ蟋九∪繧九ヵ繧ゥ繝ォ繝縺ョ蝣エ蜷 ] + //----------------------------- + if( infoDir.Name.ToLower().StartsWith( "dtxfiles." ) ) + { + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 = new C譖イ繝ェ繧ケ繝医ヮ繝シ繝(); + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ = C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.bDTXFiles縺ァ蟋九∪繧九ヵ繧ゥ繝ォ繝蜷阪ョBOX縺ァ縺ゅk = true; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν = infoDir.Name.Substring( 9 ); + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.n繧ケ繧ウ繧「謨ー = 1; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝 = node隕ェ; + + + // 荳譌ヲ縲∽ク贋ス坑OX縺ョ繧ケ繧ュ繝ウ諠蝣ア繧偵さ繝斐シ (蠕後〒box.def縺ョ險倩シ峨↓縺ヲ荳頑嶌縺阪&繧後k蝣エ蜷医′縺ゅk) + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.strSkinPath = ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝 == null ) ? + "" : c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝.strSkinPath; + + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.strBreadcrumbs = ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝 == null ) ? + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν : c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝.strBreadcrumbs + " > " + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν; + + + + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝 = new List(); + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ 0 ] = new C繧ケ繧ウ繧「(); + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ = infoDir.FullName + @"\"; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ 0 ].隴憺擇諠蝣ア.繧ソ繧、繝医Ν = c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ 0 ].隴憺擇諠蝣ア.繧ウ繝。繝ウ繝 = + (CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "ja") ? + "BOX 縺ォ遘サ蜍輔@縺セ縺吶" : + "Enter into the BOX."; + list繝弱シ繝峨Μ繧ケ繝.Add(c譖イ繝ェ繧ケ繝医ヮ繝シ繝); + if( File.Exists( infoDir.FullName + @"\box.def" ) ) + { + CBoxDef boxdef = new CBoxDef( infoDir.FullName + @"\box.def" ); + if( ( boxdef.Title != null ) && ( boxdef.Title.Length > 0 ) ) + { + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν = boxdef.Title; + } + for(int i = 0; i < 3; i++) + { + if ((boxdef.strBoxText[i] != null) && (boxdef.strBoxText[i].Length > 0)) + { + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.strBoxText[i] = boxdef.strBoxText[i]; + } + } + if( ( boxdef.Genre != null ) && ( boxdef.Genre.Length > 0 ) ) + { + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ = boxdef.Genre; + } + if(boxdef.IsChangedForeColor) + { + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor = boxdef.ForeColor; + } + if (boxdef.IsChangedBackColor) + { + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor = boxdef.BackColor; + } + } + + switch (c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ) + { + case "J-POP": + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ = "繝昴ャ繝励せ"; + break; + case "繧イ繝シ繝繝溘Η繝シ繧ク繝繧ッ": + case "繝舌Λ繧ィ繝繧」繝シ": + case "繝舌Λ繧ィ繝繧」": + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ = "繧イ繝シ繝繝舌Λ繧ィ繝繧」"; + break; + case "縺ゥ縺繧医≧": + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ = "繧ュ繝繧コ"; + break; + } + if ( TJAPlayer3.ConfigIni.bLog譖イ讀懃エ「繝ュ繧ー蜃コ蜉 ) + { + Trace.Indent(); + try + { + StringBuilder sb = new StringBuilder( 0x100 ); + sb.Append( string.Format( "nID#{0:D3}", c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nID ) ); + if( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝 != null ) + { + sb.Append( string.Format( "(in#{0:D3}):", c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝.nID ) ); + } + else + { + sb.Append( "(onRoot):" ); + } + sb.Append( " BOX, Title=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν ); + sb.Append( ", Folder=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ ); + sb.Append( ", Comment=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ 0 ].隴憺擇諠蝣ア.繧ウ繝。繝ウ繝 ); + sb.Append( ", SkinPath=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.strSkinPath ); + Trace.TraceInformation( sb.ToString() ); + } + finally + { + Trace.Unindent(); + } + } + if( b蟄殖OX縺ク蜀榊クー縺吶k ) + { + this.t譖イ繧呈、懃エ「縺励※繝ェ繧ケ繝医r菴懈舌☆繧( infoDir.FullName + @"\", b蟄殖OX縺ク蜀榊クー縺吶k, c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝, c譖イ繝ェ繧ケ繝医ヮ繝シ繝 ); + } + } + //----------------------------- + #endregion + + #region [ b.box.def 繧貞性繧繝輔か繝ォ繝縺ョ蝣エ蜷 ] + //----------------------------- + else if( File.Exists( infoDir.FullName + @"\box.def" ) ) + { + CBoxDef boxdef = new CBoxDef( infoDir.FullName + @"\box.def" ); + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 = new C譖イ繝ェ繧ケ繝医ヮ繝シ繝(); + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ = C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.bDTXFiles縺ァ蟋九∪繧九ヵ繧ゥ繝ォ繝蜷阪ョBOX縺ァ縺ゅk = false; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν = boxdef.Title; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ = boxdef.Genre; + + switch (c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ) + { + case "J-POP": + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ = "繝昴ャ繝励せ"; + break; + case "繧イ繝シ繝繝溘Η繝シ繧ク繝繧ッ": + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ = "繧イ繝シ繝繝舌Λ繧ィ繝繧」"; + break; + case "縺ゥ縺繧医≧": + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ = "繧ュ繝繧コ"; + break; + } + + if (boxdef.IsChangedForeColor) + { + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor = boxdef.ForeColor; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.IsChangedForeColor = true; + } + if (boxdef.IsChangedBackColor) + { + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor = boxdef.BackColor; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.IsChangedBackColor = true; + } + + for (int i = 0; i < 3; i++) + { + if ((boxdef.strBoxText[i] != null) && (boxdef.strBoxText[i].Length > 0)) + { + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.strBoxText[i] = boxdef.strBoxText[i]; + } + } + switch (CStr繧ク繝」繝ウ繝ォtoNum.ForAC15(c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ)) + { + case 0: + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_JPOP; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_JPOP; + break; + case 1: + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Anime; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_Anime; + break; + case 2: + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_VOCALOID; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_VOCALOID; + break; + case 3: + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Children; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_Children; + break; + case 4: + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Variety; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_Variety; + break; + case 5: + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Classic; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_Classic; + break; + case 6: + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_GameMusic; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_GameMusic; + break; + case 7: + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor = TJAPlayer3.Skin.SongSelect_ForeColor_Namco; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor = TJAPlayer3.Skin.SongSelect_BackColor_Namco; + break; + default: + break; + } + + + + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.n繧ケ繧ウ繧「謨ー = 1; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ 0 ] = new C繧ケ繧ウ繧「(); + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ = infoDir.FullName + @"\"; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ 0 ].隴憺擇諠蝣ア.繧ソ繧、繝医Ν = boxdef.Title; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ 0 ].隴憺擇諠蝣ア.繧ク繝」繝ウ繝ォ = boxdef.Genre; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝 = node隕ェ; + + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.strBreadcrumbs = ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝 == null ) ? + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν : c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝.strBreadcrumbs + " > " + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν; + + + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝 = new List(); + list繝弱シ繝峨Μ繧ケ繝.Add( c譖イ繝ェ繧ケ繝医ヮ繝シ繝 ); + if( TJAPlayer3.ConfigIni.bLog譖イ讀懃エ「繝ュ繧ー蜃コ蜉 ) + { + Trace.TraceInformation( "box.def讀懷コ : {0}", infoDir.FullName + @"\box.def" ); + Trace.Indent(); + try + { + StringBuilder sb = new StringBuilder( 0x400 ); + sb.Append( string.Format( "nID#{0:D3}", c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nID ) ); + if( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝 != null ) + { + sb.Append( string.Format( "(in#{0:D3}):", c譖イ繝ェ繧ケ繝医ヮ繝シ繝.r隕ェ繝弱シ繝.nID ) ); + } + else + { + sb.Append( "(onRoot):" ); + } + sb.Append( "BOX, Title=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν ); + if( ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ != null ) && ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ.Length > 0 ) ) + { + sb.Append( ", Genre=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ク繝」繝ウ繝ォ ); + } + if (c譖イ繝ェ繧ケ繝医ヮ繝シ繝.IsChangedForeColor) + { + sb.Append(", ForeColor=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ForeColor.ToString()); + } + if (c譖イ繝ェ繧ケ繝医ヮ繝シ繝.IsChangedBackColor) + { + sb.Append(", BackColor=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.BackColor.ToString()); + } + Trace.TraceInformation( sb.ToString() ); + } + finally + { + Trace.Unindent(); + } + } + if( b蟄殖OX縺ク蜀榊クー縺吶k ) + { + this.t譖イ繧呈、懃エ「縺励※繝ェ繧ケ繝医r菴懈舌☆繧( infoDir.FullName + @"\", b蟄殖OX縺ク蜀榊クー縺吶k, c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝, c譖イ繝ェ繧ケ繝医ヮ繝シ繝 ); + } + } + //----------------------------- + #endregion + + #region [ c.騾壼クク繝輔か繝ォ繝縺ョ蝣エ蜷 ] + //----------------------------- + else + { + this.t譖イ繧呈、懃エ「縺励※繝ェ繧ケ繝医r菴懈舌☆繧( infoDir.FullName + @"\", b蟄殖OX縺ク蜀榊クー縺吶k, list繝弱シ繝峨Μ繧ケ繝, node隕ェ ); + } + //----------------------------- + #endregion + } + } + //----------------- + #endregion + /*#region [ 繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・繧呈峇繝ェ繧ケ繝医↓蜿肴丐縺吶k ] + //----------------- + public void t繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・繧呈峇繝ェ繧ケ繝医↓蜿肴丐縺吶k() + { + this.n繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・縺九i蜿肴丐縺ァ縺阪◆繧ケ繧ウ繧「謨ー = 0; + this.t繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・繧呈峇繝ェ繧ケ繝医↓蜿肴丐縺吶k( this.list譖イ繝ォ繝シ繝 ); + } + private void t繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・繧呈峇繝ェ繧ケ繝医↓蜿肴丐縺吶k( List 繝弱シ繝峨Μ繧ケ繝 ) + { + using( List.Enumerator enumerator = 繝弱シ繝峨Μ繧ケ繝.GetEnumerator() ) + { + while( enumerator.MoveNext() ) + { + SlowOrSuspendSearchTask(); // #27060 荳ュ譁ュ隕∵アゅ′縺ゅ▲縺溘i縲∬ァ」髯、隕∵アゅ′譚・繧九∪縺ァ蠕讖, #PREMOVIE蜀咲函荳ュ縺ッ讀懃エ「雋闕キ繧定誠縺ィ縺 + + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 node = enumerator.Current; + if( node.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) + { + this.t繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・繧呈峇繝ェ繧ケ繝医↓蜿肴丐縺吶k( node.list蟄舌Μ繧ケ繝 ); + } + else if( ( node.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE ) || ( node.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE_MIDI ) ) + { + Predicate match = null; + for( int lv = 0; lv < (int)Difficulty.Total; lv++ ) + { + if( node.ar繧ケ繧ウ繧「[ lv ] != null ) + { + if( match == null ) + { + match = delegate( C繧ケ繧ウ繧「 sc ) + { + return + ( + ( sc.繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ.Equals( node.ar繧ケ繧ウ繧「[ lv ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ ) + && sc.繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ繧オ繧、繧コ.Equals( node.ar繧ケ繧ウ繧「[ lv ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ繧オ繧、繧コ ) ) + && ( sc.繝輔ぃ繧、繝ォ諠蝣ア.譛邨よ峩譁ー譌・譎.Equals( node.ar繧ケ繧ウ繧「[ lv ].繝輔ぃ繧、繝ォ諠蝣ア.譛邨よ峩譁ー譌・譎 ) + && sc.ScoreIni諠蝣ア.繝輔ぃ繧、繝ォ繧オ繧、繧コ.Equals( node.ar繧ケ繧ウ繧「[ lv ].ScoreIni諠蝣ア.繝輔ぃ繧、繝ォ繧オ繧、繧コ ) ) ) + && sc.ScoreIni諠蝣ア.譛邨よ峩譁ー譌・譎.Equals( node.ar繧ケ繧ウ繧「[ lv ].ScoreIni諠蝣ア.譛邨よ峩譁ー譌・譎 ); + }; + } + int nMatched = this.listSongsDB.FindIndex( match ); + if( nMatched == -1 ) + { +//Trace.TraceInformation( "songs.db 縺ォ蟄伜惠縺励∪縺帙s縲({0})", node.ar繧ケ繧ウ繧「[ lv ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ ); + if ( TJAPlayer3.ConfigIni.bLog譖イ讀懃エ「繝ュ繧ー蜃コ蜉 ) + { + Trace.TraceInformation( "songs.db 縺ォ蟄伜惠縺励∪縺帙s縲({0})", node.ar繧ケ繧ウ繧「[ lv ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ ); + } + } + else + { + node.ar繧ケ繧ウ繧「[ lv ].隴憺擇諠蝣ア = this.listSongsDB[ nMatched ].隴憺擇諠蝣ア; + node.ar繧ケ繧ウ繧「[ lv ].bSongDB縺ォ繧ュ繝」繝繧キ繝・縺後≠縺」縺 = true; + if( TJAPlayer3.ConfigIni.bLog譖イ讀懃エ「繝ュ繧ー蜃コ蜉 ) + { + Trace.TraceInformation( "songs.db 縺九i霆「險倥@縺セ縺励◆縲({0})", node.ar繧ケ繧ウ繧「[ lv ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ ); + } + this.n繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・縺九i蜿肴丐縺ァ縺阪◆繧ケ繧ウ繧「謨ー++; + } + } + } + } + } + } + } + private C繧ケ繧ウ繧「 tSongsDB縺九i繧ケ繧ウ繧「繧抵シ代▽隱ュ縺ソ霎シ繧( BinaryReader br ) + { + C繧ケ繧ウ繧「 c繧ケ繧ウ繧「 = new C繧ケ繧ウ繧「(); + c繧ケ繧ウ繧「.繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ = br.ReadString(); + c繧ケ繧ウ繧「.繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ = br.ReadString(); + c繧ケ繧ウ繧「.繝輔ぃ繧、繝ォ諠蝣ア.譛邨よ峩譁ー譌・譎 = new DateTime( br.ReadInt64() ); + c繧ケ繧ウ繧「.繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ繧オ繧、繧コ = br.ReadInt64(); + c繧ケ繧ウ繧「.ScoreIni諠蝣ア.譛邨よ峩譁ー譌・譎 = new DateTime( br.ReadInt64() ); + c繧ケ繧ウ繧「.ScoreIni諠蝣ア.繝輔ぃ繧、繝ォ繧オ繧、繧コ = br.ReadInt64(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.繧ソ繧、繝医Ν = br.ReadString(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.繧「繝シ繝繧」繧ケ繝亥錐 = br.ReadString(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.繧ウ繝。繝ウ繝 = br.ReadString(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.繧ク繝」繝ウ繝ォ = br.ReadString(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.Preimage = br.ReadString(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.Premovie = br.ReadString(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.Presound = br.ReadString(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.Backgound = br.ReadString(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.繝ャ繝吶Ν.Drums = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.繝ャ繝吶Ν.Guitar = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.繝ャ繝吶Ν.Bass = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.譛螟ァ繝ゥ繝ウ繧ッ.Drums = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.譛螟ァ繝ゥ繝ウ繧ッ.Guitar = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.譛螟ァ繝ゥ繝ウ繧ッ.Bass = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.譛螟ァ繧ケ繧ュ繝ォ.Drums = br.ReadDouble(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.譛螟ァ繧ケ繧ュ繝ォ.Guitar = br.ReadDouble(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.譛螟ァ繧ケ繧ュ繝ォ.Bass = br.ReadDouble(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.繝輔Ν繧ウ繝ウ繝.Drums = br.ReadBoolean(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.繝輔Ν繧ウ繝ウ繝.Guitar = br.ReadBoolean(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.繝輔Ν繧ウ繝ウ繝.Bass = br.ReadBoolean(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞屓謨ー.Drums = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞屓謨ー.Guitar = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞屓謨ー.Bass = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦1 = br.ReadString(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦2 = br.ReadString(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦3 = br.ReadString(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦4 = br.ReadString(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦5 = br.ReadString(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦6 = br.ReadString(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦7 = br.ReadString(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.繝ャ繝吶Ν繧帝撼陦ィ遉コ縺ォ縺吶k = br.ReadBoolean(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.譖イ遞ョ蛻・ = (CDTX.E遞ョ蛻・) br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.Bpm = br.ReadDouble(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.Duration = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.strBGM繝輔ぃ繧、繝ォ蜷 = br.ReadString(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.SongVol = br.ReadInt32(); + var hasSongIntegratedLoudness = br.ReadBoolean(); + var songIntegratedLoudness = br.ReadDouble(); + var integratedLoudness = hasSongIntegratedLoudness ? new Lufs(songIntegratedLoudness) : default(Lufs?); + var hasSongPeakLoudness = br.ReadBoolean(); + var songPeakLoudness = br.ReadDouble(); + var peakLoudness = hasSongPeakLoudness ? new Lufs(songPeakLoudness) : default(Lufs?); + var songLoudnessMetadata = hasSongIntegratedLoudness + ? new LoudnessMetadata(integratedLoudness.Value, peakLoudness) + : default(LoudnessMetadata?); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.SongLoudnessMetadata = songLoudnessMetadata; + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝繝「BGM繧ェ繝輔そ繝繝 = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.b隴憺擇蛻蟯深0] = br.ReadBoolean(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.b隴憺擇蛻蟯深1] = br.ReadBoolean(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.b隴憺擇蛻蟯深2] = br.ReadBoolean(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.b隴憺擇蛻蟯深3] = br.ReadBoolean(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.b隴憺擇蛻蟯深4] = br.ReadBoolean(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.b隴憺擇蛻蟯深5] = br.ReadBoolean(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.b隴憺擇蛻蟯深6] = br.ReadBoolean(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.繝上う繧ケ繧ウ繧「 = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝上う繧ケ繧ウ繧「[0] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝上う繧ケ繧ウ繧「[1] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝上う繧ケ繧ウ繧「[2] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝上う繧ケ繧ウ繧「[3] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝上う繧ケ繧ウ繧「[4] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝上う繧ケ繧ウ繧「[5] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝上う繧ケ繧ウ繧「[6] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.str繧オ繝悶ち繧、繝医Ν = br.ReadString(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[0] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[1] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[2] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[3] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[4] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[5] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[6] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ッ繝ェ繧「[0] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ッ繝ェ繧「[1] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ッ繝ェ繧「[2] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ッ繝ェ繧「[3] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ッ繝ェ繧「[4] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[0] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[1] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[2] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[3] = br.ReadInt32(); + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[4] = br.ReadInt32(); + + + //Debug.WriteLine( "songs.db: " + c繧ケ繧ウ繧「.繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ ); + return c繧ケ繧ウ繧「; + } + //----------------- + #endregion*/ + #region [ SongsDB縺ォ縺ェ縺九▲縺滓峇繧偵ヵ繧。繧、繝ォ縺九i隱ュ縺ソ霎シ繧薙〒蜿肴丐縺吶k ] + //----------------- + public void tSongsDB縺ォ縺ェ縺九▲縺滓峇繧偵ヵ繧。繧、繝ォ縺九i隱ュ縺ソ霎シ繧薙〒蜿肴丐縺吶k() + { + this.n繝輔ぃ繧、繝ォ縺九i蜿肴丐縺ァ縺阪◆繧ケ繧ウ繧「謨ー = 0; + this.tSongsDB縺ォ縺ェ縺九▲縺滓峇繧偵ヵ繧。繧、繝ォ縺九i隱ュ縺ソ霎シ繧薙〒蜿肴丐縺吶k( this.list譖イ繝ォ繝シ繝 ); + } + private void tSongsDB縺ォ縺ェ縺九▲縺滓峇繧偵ヵ繧。繧、繝ォ縺九i隱ュ縺ソ霎シ繧薙〒蜿肴丐縺吶k( List 繝弱シ繝峨Μ繧ケ繝 ) + { + foreach( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 in 繝弱シ繝峨Μ繧ケ繝 ) + { + SlowOrSuspendSearchTask(); // #27060 荳ュ譁ュ隕∵アゅ′縺ゅ▲縺溘i縲∬ァ」髯、隕∵アゅ′譚・繧九∪縺ァ蠕讖, #PREMOVIE蜀咲函荳ュ縺ッ讀懃エ「雋闕キ繧定誠縺ィ縺 + + if( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) + { + this.tSongsDB縺ォ縺ェ縺九▲縺滓峇繧偵ヵ繧。繧、繝ォ縺九i隱ュ縺ソ霎シ繧薙〒蜿肴丐縺吶k( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝 ); + } + else if( ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE ) + || ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE_MIDI ) ) + { + for( int i = 0; i < (int)Difficulty.Total; i++ ) + { + if( ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ] != null ) && !c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].bSongDB縺ォ繧ュ繝」繝繧キ繝・縺後≠縺」縺 ) + { + #region [ DTX 繝輔ぃ繧、繝ォ縺ョ繝倥ャ繝縺縺題ェュ縺ソ霎シ縺ソ縲,繧ケ繧ウ繧「.隴憺擇諠蝣ア 繧定ィュ螳壹☆繧 ] + //----------------- + string path = c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ; + if( File.Exists( path ) ) + { + try + { + CDTX cdtx = new CDTX( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ, true, 0, 0, 0 ); + if( File.Exists( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ + "set.def" ) ) + cdtx = new CDTX( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ, true, 0, 0, 1 ); + + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繧ソ繧、繝医Ν = cdtx.TITLE; + + + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繧「繝シ繝繧」繧ケ繝亥錐 = cdtx.ARTIST; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繧ウ繝。繝ウ繝 = cdtx.COMMENT; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繧ク繝」繝ウ繝ォ = cdtx.GENRE; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.Preimage = cdtx.PREIMAGE; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.Presound = cdtx.PREVIEW; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.Backgound = ( ( cdtx.BACKGROUND != null ) && ( cdtx.BACKGROUND.Length > 0 ) ) ? cdtx.BACKGROUND : cdtx.BACKGROUND_GR; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繝ャ繝吶Ν.Drums = cdtx.LEVEL.Drums; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繝ャ繝吶Ν.Guitar = cdtx.LEVEL.Guitar; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繝ャ繝吶Ν.Bass = cdtx.LEVEL.Bass; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繝ャ繝吶Ν繧帝撼陦ィ遉コ縺ォ縺吶k = cdtx.HIDDENLEVEL; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.Bpm = cdtx.BPM; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.Duration = 0; // (cdtx.listChip == null)? 0 : cdtx.listChip[ cdtx.listChip.Count - 1 ].n逋コ螢ー譎ょ綾ms; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.strBGM繝輔ぃ繧、繝ォ蜷 = cdtx.strBGM_PATH; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.SongVol = cdtx.SongVol; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.SongLoudnessMetadata = cdtx.SongLoudnessMetadata; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.n繝繝「BGM繧ェ繝輔そ繝繝 = cdtx.n繝繝「BGM繧ェ繝輔そ繝繝; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.b隴憺擇蛻蟯深0] = cdtx.bHIDDENBRANCH ? false : cdtx.bHasBranch[ 0 ]; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.b隴憺擇蛻蟯深1] = cdtx.bHIDDENBRANCH ? false : cdtx.bHasBranch[ 1 ]; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.b隴憺擇蛻蟯深2] = cdtx.bHIDDENBRANCH ? false : cdtx.bHasBranch[ 2 ]; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.b隴憺擇蛻蟯深3] = cdtx.bHIDDENBRANCH ? false : cdtx.bHasBranch[ 3 ]; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.b隴憺擇蛻蟯深4] = cdtx.bHIDDENBRANCH ? false : cdtx.bHasBranch[4]; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.b隴憺擇蛻蟯深5] = cdtx.bHIDDENBRANCH ? false : cdtx.bHasBranch[5]; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.b隴憺擇蛻蟯深6] = cdtx.bHIDDENBRANCH ? false : cdtx.bHasBranch[6]; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.str繧オ繝悶ち繧、繝医Ν = cdtx.SUBTITLE; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.n繝ャ繝吶Ν[0] = cdtx.LEVELtaiko[0]; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.n繝ャ繝吶Ν[1] = cdtx.LEVELtaiko[1]; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.n繝ャ繝吶Ν[2] = cdtx.LEVELtaiko[2]; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.n繝ャ繝吶Ν[3] = cdtx.LEVELtaiko[3]; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.n繝ャ繝吶Ν[4] = cdtx.LEVELtaiko[4]; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.n繝ャ繝吶Ν[5] = cdtx.LEVELtaiko[5]; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.n繝ャ繝吶Ν[6] = cdtx.LEVELtaiko[6]; + this.n繝輔ぃ繧、繝ォ縺九i蜿肴丐縺ァ縺阪◆繧ケ繧ウ繧「謨ー++; + cdtx.On髱樊エサ諤ァ蛹(); +//Debug.WriteLine( "笘" + this.n繝輔ぃ繧、繝ォ縺九i蜿肴丐縺ァ縺阪◆繧ケ繧ウ繧「謨ー + " " + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繧ソ繧、繝医Ν ); + #region [ 譖イ讀懃エ「繝ュ繧ー蜃コ蜉 ] + //----------------- + if( TJAPlayer3.ConfigIni.bLog譖イ讀懃エ「繝ュ繧ー蜃コ蜉 ) + { + StringBuilder sb = new StringBuilder( 0x400 ); + sb.Append( string.Format( "譖イ繝繝シ繧ソ繝輔ぃ繧、繝ォ縺九i隴憺擇諠蝣ア繧定サ「險倥@縺セ縺励◆縲({0})", path ) ); + sb.Append( "(title=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繧ソ繧、繝医Ν ); + sb.Append( ", artist=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繧「繝シ繝繧」繧ケ繝亥錐 ); + sb.Append( ", comment=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繧ウ繝。繝ウ繝 ); + sb.Append( ", genre=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繧ク繝」繝ウ繝ォ ); + sb.Append( ", preimage=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.Preimage ); + sb.Append( ", premovie=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.Premovie ); + sb.Append( ", presound=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.Presound ); + sb.Append( ", background=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.Backgound ); + sb.Append( ", lvDr=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繝ャ繝吶Ν.Drums ); + sb.Append( ", lvGt=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繝ャ繝吶Ν.Guitar ); + sb.Append( ", lvBs=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繝ャ繝吶Ν.Bass ); + sb.Append( ", lvHide=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繝ャ繝吶Ν繧帝撼陦ィ遉コ縺ォ縺吶k ); + sb.Append( ", type=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.譖イ遞ョ蛻・ ); + sb.Append( ", bpm=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.Bpm ); + // sb.Append( ", duration=" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.Duration ); + Trace.TraceInformation( sb.ToString() ); + } + //----------------- + #endregion + } + catch( Exception exception ) + { + Trace.TraceError( exception.ToString() ); + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ] = null; + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.n繧ケ繧ウ繧「謨ー--; + this.n讀懃エ「縺輔l縺溘せ繧ウ繧「謨ー--; + Trace.TraceError( "譖イ繝繝シ繧ソ繝輔ぃ繧、繝ォ縺ョ隱ュ縺ソ霎シ縺ソ縺ォ螟ア謨励@縺セ縺励◆縲({0})", path ); + } + } + //----------------- + #endregion + + #region [ 蟇セ蠢懊☆繧 .score.ini 縺悟ュ伜惠縺励※縺繧後ー隱ュ縺ソ霎シ縺ソ縲,繧ケ繧ウ繧「.隴憺擇諠蝣ア 縺ォ霑ス蜉險ュ螳壹☆繧 ] + //----------------- + try + { + var scoreIniPath = c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ + ".score.ini"; + if( File.Exists( scoreIniPath ) ) + this.tScoreIni繧定ェュ縺ソ霎シ繧薙〒隴憺擇諠蝣ア繧定ィュ螳壹☆繧( scoreIniPath, c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ i ] ); + else + { + string[] dtxscoreini = Directory.GetFiles(c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[i].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ, "*.dtx.score.ini"); + if (dtxscoreini.Length != 0 && File.Exists(dtxscoreini[0])) + { + this.tScoreIni繧定ェュ縺ソ霎シ繧薙〒隴憺擇諠蝣ア繧定ィュ螳壹☆繧(dtxscoreini[0], c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[i]); + } + } + } + catch (Exception e) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (c8b6538c-46a1-403e-8cc3-fc7e7ff914fb)" ); + } + + //----------------- + #endregion + } + } + } + } + } + //----------------- + #endregion + #region [ 譖イ繝ェ繧ケ繝医∈蠕悟ヲ逅繧帝←逕ィ縺吶k ] + //----------------- + public void t譖イ繝ェ繧ケ繝医∈蠕悟ヲ逅繧帝←逕ィ縺吶k() + { + listStrBoxDefSkinSubfolderFullName = new List(); + if ( TJAPlayer3.Skin.strBoxDefSkinSubfolders != null ) + { + foreach ( string b in TJAPlayer3.Skin.strBoxDefSkinSubfolders ) + { + listStrBoxDefSkinSubfolderFullName.Add( b ); + } + } + + #region [ "譛霑鷹♀繧薙□譖イ"BOX繧堤函謌舌☆繧 ] + + if(list譖イ繝ォ繝シ繝.Count > 0) + { + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 crecentryplaysong = new C譖イ繝ェ繧ケ繝医ヮ繝シ繝(); + crecentryplaysong.e繝弱シ繝臥ィョ蛻・ = C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX; + crecentryplaysong.str繧ソ繧、繝医Ν = "譛霑代≠縺昴s縺譖イ"; + crecentryplaysong.strBoxText[0] = ""; + crecentryplaysong.strBoxText[1] = "譛霑代≠縺昴s縺譖イ繧帝寔繧√◆繧茨シ"; + crecentryplaysong.strBoxText[2] = ""; + crecentryplaysong.str繧ク繝」繝ウ繝ォ = "譛霑鷹♀繧薙□譖イ"; + crecentryplaysong.n繧ケ繧ウ繧「謨ー = 1; + crecentryplaysong.list蟄舌Μ繧ケ繝 = new List(); + crecentryplaysong.BackColor = ColorTranslator.FromHtml("#164748"); + + crecentryplaysong.ar繧ケ繧ウ繧「[0] = new C繧ケ繧ウ繧「(); + crecentryplaysong.ar繧ケ繧ウ繧「[0].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ = ""; + crecentryplaysong.ar繧ケ繧ウ繧「[0].隴憺擇諠蝣ア.繧ソ繧、繝医Ν = crecentryplaysong.str繧ソ繧、繝医Ν; + crecentryplaysong.ar繧ケ繧ウ繧「[0].隴憺擇諠蝣ア.繧ウ繝。繝ウ繝 = + (CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "ja") ? + "譛霑鷹♀繧薙□譖イ" : + "Recentry play songs"; + + list譖イ繝ォ繝シ繝.Add(crecentryplaysong); + } + + #endregion + + this.t譖イ繝ェ繧ケ繝医∈蠕悟ヲ逅繧帝←逕ィ縺吶k(this.list譖イ繝ォ繝シ繝); + + foreach (C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 in list譖イ繝ォ繝シ繝) + { + if(c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX) + { + if (c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν == "谿オ菴埼%蝣エ") + { + list譖イ繝ォ繝シ繝.Remove(c譖イ繝ェ繧ケ繝医ヮ繝シ繝); + for (int i = 0; i < c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝.Count; i++) + { + if(c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝[i].e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE) + { + list譖イ繝ォ繝シ繝_Dan.Add(c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝[i]); + continue; + } + } + } + else + { + for (int i = 0; i < c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝.Count; i++) + { + if(c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝[i].ar繧ケ繧ウ繧「[6] != null) + { + list譖イ繝ォ繝シ繝_Dan.Add(c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝[i]); + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝.Remove(c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝[i]); + continue; + } + } + } + } + else + { + if (c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[5] != null) + { + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝.Remove(c譖イ繝ェ繧ケ繝医ヮ繝シ繝); + list譖イ繝ォ繝シ繝_Dan.Add(c譖イ繝ェ繧ケ繝医ヮ繝シ繝); + continue; + } + } + } + + #region [ skin蜷阪〒豈碑シ縺励※縲《ystem繧ケ繧ュ繝ウ縺ィboxdef繧ケ繧ュ繝ウ縺ォ驥崎、縺後≠繧後ー縲|oxdef繧ケ繧ュ繝ウ蛛エ繧貞炎髯、縺吶k ] + string[] systemSkinNames = CSkin.GetSkinName( TJAPlayer3.Skin.strSystemSkinSubfolders ); + List l = new List( listStrBoxDefSkinSubfolderFullName ); + foreach ( string boxdefSkinSubfolderFullName in l ) + { + if ( Array.BinarySearch( systemSkinNames, + CSkin.GetSkinName( boxdefSkinSubfolderFullName ), + StringComparer.InvariantCultureIgnoreCase ) >= 0 ) + { + listStrBoxDefSkinSubfolderFullName.Remove( boxdefSkinSubfolderFullName ); + } + } + #endregion + string[] ba = listStrBoxDefSkinSubfolderFullName.ToArray(); + Array.Sort( ba ); + TJAPlayer3.Skin.strBoxDefSkinSubfolders = ba; + } + private void t譖イ繝ェ繧ケ繝医∈蠕悟ヲ逅繧帝←逕ィ縺吶k( List 繝弱シ繝峨Μ繧ケ繝 ) + { + // 縺吶∋縺ヲ縺ョ繝弱シ繝峨↓縺、縺縺ヲ窶ヲ + foreach ( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 in 繝弱シ繝峨Μ繧ケ繝 ) + { + SlowOrSuspendSearchTask(); // #27060 荳ュ譁ュ隕∵アゅ′縺ゅ▲縺溘i縲∬ァ」髯、隕∵アゅ′譚・繧九∪縺ァ蠕讖, #PREMOVIE蜀咲函荳ュ縺ッ讀懃エ「雋闕キ繧定誠縺ィ縺 + + #region [ BOX繝弱シ繝峨↑繧牙ュ舌Μ繧ケ繝医↓ < " + itemBack.str繧ソ繧、繝医Ν; + + itemBack.ar繧ケ繧ウ繧「[0] = new C繧ケ繧ウ繧「(); + itemBack.ar繧ケ繧ウ繧「[0].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ = ""; + itemBack.ar繧ケ繧ウ繧「[0].隴憺擇諠蝣ア.繧ソ繧、繝医Ν = itemBack.str繧ソ繧、繝医Ν; + itemBack.ar繧ケ繧ウ繧「[0].隴憺擇諠蝣ア.繧ウ繝。繝ウ繝 = + (CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "ja") ? + "BOX 繧貞コ縺セ縺吶" : + "Exit from the BOX."; + + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝.Insert(Math.Min(index * (7 + 1), c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝.Count), itemBack); + + #region [ 繝ュ繧ー蜃コ蜉 ] + //----------------------------- + if (TJAPlayer3.ConfigIni.bLog譖イ讀懃エ「繝ュ繧ー蜃コ蜉) + { + StringBuilder sb = new StringBuilder(0x100); + sb.Append(string.Format("nID#{0:D3}", itemBack.nID)); + if (itemBack.r隕ェ繝弱シ繝 != null) + { + sb.Append(string.Format("(in#{0:D3}):", itemBack.r隕ェ繝弱シ繝.nID)); + } + else + { + sb.Append("(onRoot):"); + } + sb.Append(" BACKBOX"); + Trace.TraceInformation(sb.ToString()); + } + //----------------------------- + #endregion + } + + continue; + } + //----------------------------- + #endregion + + #region [ 繝弱シ繝峨↓繧ソ繧、繝医Ν縺後↑縺縺ェ繧峨∵怙蛻昴↓隕九▽縺代◆繧ケ繧ウ繧「縺ョ繧ソ繧、繝医Ν繧定ィュ螳壹☆繧 ] + //----------------------------- + if ( string.IsNullOrEmpty( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν ) ) + { + for( int j = 0; j < (int)Difficulty.Total; j++ ) + { + if( ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ j ] != null ) && !string.IsNullOrEmpty( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ j ].隴憺擇諠蝣ア.繧ソ繧、繝医Ν ) ) + { + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν = c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ j ].隴憺擇諠蝣ア.繧ソ繧、繝医Ν; + + if( TJAPlayer3.ConfigIni.bLog譖イ讀懃エ「繝ュ繧ー蜃コ蜉 ) + Trace.TraceInformation( "繧ソ繧、繝医Ν繧定ィュ螳壹@縺セ縺励◆縲(nID#{0:D3}, title={1})", c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nID, c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν ); + + break; + } + } + } + //----------------------------- + #endregion + } + + #region [ 繝弱シ繝峨r繧ス繝シ繝医☆繧 ] + //----------------------------- + if ( TJAPlayer3.ConfigIni.nDefaultSongSort == 0 ) + { + t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝1_邨カ蟇セ繝代せ鬆( 繝弱シ繝峨Μ繧ケ繝 ); + } + else if( TJAPlayer3.ConfigIni.nDefaultSongSort == 1 ) + { + t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝9_繧ク繝」繝ウ繝ォ鬆( 繝弱シ繝峨Μ繧ケ繝, E讌ス蝎ィ繝代シ繝.TAIKO, 1, 0 ); + } + else if( TJAPlayer3.ConfigIni.nDefaultSongSort == 2 ) + { + t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝9_繧ク繝」繝ウ繝ォ鬆( 繝弱シ繝峨Μ繧ケ繝, E讌ス蝎ィ繝代シ繝.TAIKO, 2, 0 ); + } + //----------------------------- + #endregion + } + //----------------- + #endregion + + /*#region [ 繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・繧担ongsDB縺ォ蜃コ蜉帙☆繧 ] + //----------------- + public void t繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・繧担ongsDB縺ォ蜃コ蜉帙☆繧( string SongsDB繝輔ぃ繧、繝ォ蜷 ) + { + this.nSongsDB縺ク蜃コ蜉帙〒縺阪◆繧ケ繧ウ繧「謨ー = 0; + try + { + BinaryWriter bw = new BinaryWriter( new FileStream( SongsDB繝輔ぃ繧、繝ォ蜷, FileMode.Create, FileAccess.Write ) ); + bw.Write( SONGSDB_VERSION ); + this.tSongsDB縺ォ繝ェ繧ケ繝医rシ代▽蜃コ蜉帙☆繧( bw, this.list譖イ繝ォ繝シ繝 ); + bw.Close(); + } + catch (Exception e) + { + Trace.TraceError( "songs.db縺ョ蜃コ蜉帙↓螟ア謨励@縺セ縺励◆縲" ); + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (ca70d133-f092-4351-8ebd-0906d8f1cffa)" ); + } + } + private void tSongsDB縺ォ繝弱シ繝峨rシ代▽蜃コ蜉帙☆繧( BinaryWriter bw, C譖イ繝ェ繧ケ繝医ヮ繝シ繝 node ) + { + for( int i = 0; i < (int)Difficulty.Total; i++ ) + { + // 縺薙%縺ァ縺ッsuspend縺ォ蠢懊§縺ェ縺繧医≧縺ォ縺励※縺翫¥(豺ア縺諢丞袖縺ッ縺ェ縺縲ゅヵ繧。繧、繝ォ縺ョ譖ク縺崎セシ縺ソ繧ェ繝シ繝励Φ迥カ諷九r髟キ譎る俣邯ュ謖√@縺溘¥縺ェ縺縺縺) + //if ( this.bIsSuspending ) // #27060 荳ュ譁ュ隕∵アゅ′縺ゅ▲縺溘i縲∬ァ」髯、隕∵アゅ′譚・繧九∪縺ァ蠕讖 + //{ + // autoReset.WaitOne(); + //} + + if( node.ar繧ケ繧ウ繧「[ i ] != null ) + { + bw.Write( node.ar繧ケ繧ウ繧「[ i ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].繝輔ぃ繧、繝ォ諠蝣ア.譛邨よ峩譁ー譌・譎.Ticks ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ繧オ繧、繧コ ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].ScoreIni諠蝣ア.譛邨よ峩譁ー譌・譎.Ticks ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].ScoreIni諠蝣ア.繝輔ぃ繧、繝ォ繧オ繧、繧コ ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繧ソ繧、繝医Ν ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繧「繝シ繝繧」繧ケ繝亥錐 ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繧ウ繝。繝ウ繝 ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繧ク繝」繝ウ繝ォ ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.Preimage ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.Premovie ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.Presound ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.Backgound ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繝ャ繝吶Ν.Drums ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繝ャ繝吶Ν.Guitar ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繝ャ繝吶Ν.Bass ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.譛螟ァ繝ゥ繝ウ繧ッ.Drums ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.譛螟ァ繝ゥ繝ウ繧ッ.Guitar ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.譛螟ァ繝ゥ繝ウ繧ッ.Bass ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.譛螟ァ繧ケ繧ュ繝ォ.Drums ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.譛螟ァ繧ケ繧ュ繝ォ.Guitar ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.譛螟ァ繧ケ繧ュ繝ォ.Bass ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繝輔Ν繧ウ繝ウ繝.Drums ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繝輔Ν繧ウ繝ウ繝.Guitar ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繝輔Ν繧ウ繝ウ繝.Bass ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.貍泌・丞屓謨ー.Drums ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.貍泌・丞屓謨ー.Guitar ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.貍泌・丞屓謨ー.Bass ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦1 ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦2 ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦3 ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦4 ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦5 ); + bw.Write(node.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦6); + bw.Write(node.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦7); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繝ャ繝吶Ν繧帝撼陦ィ遉コ縺ォ縺吶k ); + bw.Write( (int) node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.譖イ遞ョ蛻・ ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.Bpm ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.Duration ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.strBGM繝輔ぃ繧、繝ォ蜷 ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.SongVol ); + var songLoudnessMetadata = node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.SongLoudnessMetadata; + bw.Write( songLoudnessMetadata.HasValue ); + bw.Write( songLoudnessMetadata?.Integrated.ToDouble() ?? 0.0 ); + bw.Write( songLoudnessMetadata?.TruePeak.HasValue ?? false ); + bw.Write( songLoudnessMetadata?.TruePeak?.ToDouble() ?? 0.0 ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.n繝繝「BGM繧ェ繝輔そ繝繝 ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.b隴憺擇蛻蟯深0] ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.b隴憺擇蛻蟯深1] ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.b隴憺擇蛻蟯深2] ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.b隴憺擇蛻蟯深3] ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.b隴憺擇蛻蟯深4] ); + bw.Write(node.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.b隴憺擇蛻蟯深5]); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.b隴憺擇蛻蟯深6] ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.繝上う繧ケ繧ウ繧「 ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.n繝上う繧ケ繧ウ繧「[0] ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.n繝上う繧ケ繧ウ繧「[1] ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.n繝上う繧ケ繧ウ繧「[2] ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.n繝上う繧ケ繧ウ繧「[3] ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.n繝上う繧ケ繧ウ繧「[4] ); + bw.Write(node.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.n繝上う繧ケ繧ウ繧「[5]); + bw.Write(node.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.n繝上う繧ケ繧ウ繧「[6]); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.str繧オ繝悶ち繧、繝医Ν ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.n繝ャ繝吶Ν[0] ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.n繝ャ繝吶Ν[1] ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.n繝ャ繝吶Ν[2] ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.n繝ャ繝吶Ν[3] ); + bw.Write( node.ar繧ケ繧ウ繧「[ i ].隴憺擇諠蝣ア.n繝ャ繝吶Ν[4] ); + bw.Write(node.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.n繝ャ繝吶Ν[5]); + bw.Write(node.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.n繝ャ繝吶Ν[6]); + bw.Write(node.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.n繧ッ繝ェ繧「[0]); + bw.Write(node.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.n繧ッ繝ェ繧「[1]); + bw.Write(node.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.n繧ッ繝ェ繧「[2]); + bw.Write(node.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.n繧ッ繝ェ繧「[3]); + bw.Write(node.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.n繧ッ繝ェ繧「[4]); + bw.Write(node.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[0]); + bw.Write(node.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[1]); + bw.Write(node.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[2]); + bw.Write(node.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[3]); + bw.Write(node.ar繧ケ繧ウ繧「[i].隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[4]); + this.nSongsDB縺ク蜃コ蜉帙〒縺阪◆繧ケ繧ウ繧「謨ー++; + } + } + } + private void tSongsDB縺ォ繝ェ繧ケ繝医rシ代▽蜃コ蜉帙☆繧( BinaryWriter bw, List list ) + { + foreach( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 in list ) + { + if( ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE ) + || ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE_MIDI ) ) + { + this.tSongsDB縺ォ繝弱シ繝峨rシ代▽蜃コ蜉帙☆繧( bw, c譖イ繝ェ繧ケ繝医ヮ繝シ繝 ); + } + if( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝 != null ) + { + this.tSongsDB縺ォ繝ェ繧ケ繝医rシ代▽蜃コ蜉帙☆繧( bw, c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝 ); + } + } + } + //----------------- + #endregion*/ + + #region [ 譖イ繝ェ繧ケ繝医た繝シ繝 ] + //----------------- + + public static void t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝1_邨カ蟇セ繝代せ鬆( List 繝弱シ繝峨Μ繧ケ繝 ) + { + t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝1_邨カ蟇セ繝代せ鬆(繝弱シ繝峨Μ繧ケ繝, E讌ス蝎ィ繝代シ繝.TAIKO, 1, 0); + + foreach( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 in 繝弱シ繝峨Μ繧ケ繝 ) + { + if( ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝 != null ) && ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝.Count > 1 ) ) + { + t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝1_邨カ蟇セ繝代せ鬆( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝 ); + } + } + } + + public static void t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝1_邨カ蟇セ繝代せ鬆( List 繝弱シ繝峨Μ繧ケ繝, E讌ス蝎ィ繝代シ繝 part, int order, params object[] p ) + { + var comparer = new ComparerChain( + new C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer繝弱シ繝臥ィョ蛻・(), + new C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer邨カ蟇セ繝代せ(order), + new C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer繧ソ繧、繝医Ν(order)); + + 繝弱シ繝峨Μ繧ケ繝.Sort( comparer ); + } + + public static void t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝2_繧ソ繧、繝医Ν鬆( List 繝弱シ繝峨Μ繧ケ繝, E讌ス蝎ィ繝代シ繝 part, int order, params object[] p ) + { + var comparer = new ComparerChain( + new C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer繝弱シ繝臥ィョ蛻・(), + new C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer繧ソ繧、繝医Ν(order), + new C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer邨カ蟇セ繝代せ(order)); + + 繝弱シ繝峨Μ繧ケ繝.Sort( comparer ); + } + + /// + /// + /// + /// + /// + /// 1=Ascend -1=Descend + public static void t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝3_貍泌・丞屓謨ー縺ョ螟壹>鬆( List 繝弱シ繝峨Μ繧ケ繝, E讌ス蝎ィ繝代シ繝 part, int order, params object[] p ) + { + order = -order; + int nL12345 = (int) p[ 0 ]; + if ( part != E讌ス蝎ィ繝代シ繝.UNKNOWN ) + { + 繝弱シ繝峨Μ繧ケ繝.Sort( delegate( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n1, C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n2 ) + { + #region [ 蜈ア騾壼ヲ逅 ] + if( ( n1.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) && ( n2.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) ) + { + return order * n1.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ.CompareTo( n2.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ ); + } + #endregion + int nSumPlayCountN1 = 0, nSumPlayCountN2 = 0; +// for( int i = 0; i <(int)Difficulty.Total; i++ ) +// { + if( n1.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + nSumPlayCountN1 += n1.ar繧ケ繧ウ繧「[ nL12345 ].隴憺擇諠蝣ア.貍泌・丞屓謨ー[ (int) part ]; + } + if( n2.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + nSumPlayCountN2 += n2.ar繧ケ繧ウ繧「[ nL12345 ].隴憺擇諠蝣ア.貍泌・丞屓謨ー[ (int) part ]; + } +// } + var num = nSumPlayCountN2 - nSumPlayCountN1; + if( num != 0 ) + { + return order * num; + } + return order * n1.str繧ソ繧、繝医Ν.CompareTo( n2.str繧ソ繧、繝医Ν ); + } ); + foreach ( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 in 繝弱シ繝峨Μ繧ケ繝 ) + { + int nSumPlayCountN1 = 0; +// for ( int i = 0; i < 5; i++ ) +// { + if ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + nSumPlayCountN1 += c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ nL12345 ].隴憺擇諠蝣ア.貍泌・丞屓謨ー[ (int) part ]; + } +// } +// Debug.WriteLine( nSumPlayCountN1 + ":" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν ); + } + } + } + public static void t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝4_LEVEL鬆( List 繝弱シ繝峨Μ繧ケ繝, E讌ス蝎ィ繝代シ繝 part, int order, params object[] p ) + { + order = -order; + int nL12345 = (int)p[ 0 ]; + if ( part != E讌ス蝎ィ繝代シ繝.UNKNOWN ) + { + 繝弱シ繝峨Μ繧ケ繝.Sort( delegate( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n1, C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n2 ) + { + #region [ 蜈ア騾壼ヲ逅 ] + if ( ( n1.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) && ( n2.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) ) + { + return order * n1.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ.CompareTo( n2.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ ); + } + #endregion + int nSumPlayCountN1 = 0, nSumPlayCountN2 = 0; + if ( n1.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + nSumPlayCountN1 = n1.nLevel[ nL12345 ]; + } + if ( n2.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + nSumPlayCountN2 = n2.nLevel[ nL12345 ]; + } + var num = nSumPlayCountN2 - nSumPlayCountN1; + if ( num != 0 ) + { + return order * num; + } + return order * n1.str繧ソ繧、繝医Ν.CompareTo( n2.str繧ソ繧、繝医Ν ); + } ); + foreach ( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 in 繝弱シ繝峨Μ繧ケ繝 ) + { + int nSumPlayCountN1 = 0; + if ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + nSumPlayCountN1 = c譖イ繝ェ繧ケ繝医ヮ繝シ繝.nLevel[ nL12345 ]; + } +// Debug.WriteLine( nSumPlayCountN1 + ":" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν ); + } + } + } + public static void t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝5_BestRank鬆( List 繝弱シ繝峨Μ繧ケ繝, E讌ス蝎ィ繝代シ繝 part, int order, params object[] p ) + { + order = -order; + int nL12345 = (int) p[ 0 ]; + if ( part != E讌ス蝎ィ繝代シ繝.UNKNOWN ) + { + 繝弱シ繝峨Μ繧ケ繝.Sort( delegate( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n1, C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n2 ) + { + #region [ 蜈ア騾壼ヲ逅 ] + if ( ( n1.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) && ( n2.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) ) + { + return order * n1.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ.CompareTo( n2.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ ); + } + #endregion + int nSumPlayCountN1 = 0, nSumPlayCountN2 = 0; + bool isFullCombo1 = false, isFullCombo2 = false; + if ( n1.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + isFullCombo1 = n1.ar繧ケ繧ウ繧「[ nL12345 ].隴憺擇諠蝣ア.繝輔Ν繧ウ繝ウ繝彈 (int) part ]; + nSumPlayCountN1 = n1.ar繧ケ繧ウ繧「[ nL12345 ].隴憺擇諠蝣ア.譛螟ァ繝ゥ繝ウ繧ッ[ (int) part ]; + } + if ( n2.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + isFullCombo2 = n2.ar繧ケ繧ウ繧「[ nL12345 ].隴憺擇諠蝣ア.繝輔Ν繧ウ繝ウ繝彈 (int) part ]; + nSumPlayCountN2 = n2.ar繧ケ繧ウ繧「[ nL12345 ].隴憺擇諠蝣ア.譛螟ァ繝ゥ繝ウ繧ッ[ (int) part ]; + } + if ( isFullCombo1 ^ isFullCombo2 ) + { + if ( isFullCombo1 ) return order; else return -order; + } + var num = nSumPlayCountN2 - nSumPlayCountN1; + if ( num != 0 ) + { + return order * num; + } + return order * n1.str繧ソ繧、繝医Ν.CompareTo( n2.str繧ソ繧、繝医Ν ); + } ); + foreach ( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 in 繝弱シ繝峨Μ繧ケ繝 ) + { + int nSumPlayCountN1 = 0; + if ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + nSumPlayCountN1 = c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ nL12345 ].隴憺擇諠蝣ア.譛螟ァ繝ゥ繝ウ繧ッ[ (int) part ]; + } +// Debug.WriteLine( nSumPlayCountN1 + ":" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν ); + } + } + } + public static void t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝6_SkillPoint鬆( List 繝弱シ繝峨Μ繧ケ繝, E讌ス蝎ィ繝代シ繝 part, int order, params object[] p ) + { + order = -order; + int nL12345 = (int) p[ 0 ]; + if ( part != E讌ス蝎ィ繝代シ繝.UNKNOWN ) + { + 繝弱シ繝峨Μ繧ケ繝.Sort( delegate( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n1, C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n2 ) + { + #region [ 蜈ア騾壼ヲ逅 ] + if ( ( n1.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) && ( n2.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) ) + { + return order * n1.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ.CompareTo( n2.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ ); + } + #endregion + double nSumPlayCountN1 = 0, nSumPlayCountN2 = 0; + if ( n1.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + nSumPlayCountN1 = n1.ar繧ケ繧ウ繧「[ nL12345 ].隴憺擇諠蝣ア.譛螟ァ繧ケ繧ュ繝ォ[ (int) part ]; + } + if ( n2.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + nSumPlayCountN2 = n2.ar繧ケ繧ウ繧「[ nL12345 ].隴憺擇諠蝣ア.譛螟ァ繧ケ繧ュ繝ォ[ (int) part ]; + } + double d = nSumPlayCountN2 - nSumPlayCountN1; + if ( d != 0 ) + { + return order * System.Math.Sign(d); + } + return order * n1.str繧ソ繧、繝医Ν.CompareTo( n2.str繧ソ繧、繝医Ν ); + } ); + foreach ( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 in 繝弱シ繝峨Μ繧ケ繝 ) + { + double nSumPlayCountN1 = 0; + if ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + nSumPlayCountN1 = c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ nL12345 ].隴憺擇諠蝣ア.譛螟ァ繧ケ繧ュ繝ォ[ (int) part ]; + } +// Debug.WriteLine( nSumPlayCountN1 + ":" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν ); + } + } + } + public static void t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝7_譖エ譁ー譌・譎る( List 繝弱シ繝峨Μ繧ケ繝, E讌ス蝎ィ繝代シ繝 part, int order, params object[] p ) + { + int nL12345 = (int) p[ 0 ]; + if ( part != E讌ス蝎ィ繝代シ繝.UNKNOWN ) + { + 繝弱シ繝峨Μ繧ケ繝.Sort( delegate( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n1, C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n2 ) + { + #region [ 蜈ア騾壼ヲ逅 ] + if ( ( n1.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) && ( n2.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) ) + { + return order * n1.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ.CompareTo( n2.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ ); + } + #endregion + DateTime nSumPlayCountN1 = DateTime.Parse("0001/01/01 12:00:01.000"); + DateTime nSumPlayCountN2 = DateTime.Parse("0001/01/01 12:00:01.000"); + if ( n1.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + nSumPlayCountN1 = n1.ar繧ケ繧ウ繧「[ nL12345 ].繝輔ぃ繧、繝ォ諠蝣ア.譛邨よ峩譁ー譌・譎; + } + if ( n2.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + nSumPlayCountN2 = n2.ar繧ケ繧ウ繧「[ nL12345 ].繝輔ぃ繧、繝ォ諠蝣ア.譛邨よ峩譁ー譌・譎; + } + int d = nSumPlayCountN1.CompareTo(nSumPlayCountN2); + if ( d != 0 ) + { + return order * System.Math.Sign( d ); + } + return order * n1.str繧ソ繧、繝医Ν.CompareTo( n2.str繧ソ繧、繝医Ν ); + } ); + foreach ( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 in 繝弱シ繝峨Μ繧ケ繝 ) + { + DateTime nSumPlayCountN1 = DateTime.Parse( "0001/01/01 12:00:01.000" ); + if ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + nSumPlayCountN1 = c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ nL12345 ].繝輔ぃ繧、繝ォ諠蝣ア.譛邨よ峩譁ー譌・譎; + } +// Debug.WriteLine( nSumPlayCountN1 + ":" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν ); + } + } + } + public static void t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝8_繧「繝シ繝繧」繧ケ繝亥錐鬆( List 繝弱シ繝峨Μ繧ケ繝, E讌ス蝎ィ繝代シ繝 part, int order, params object[] p ) + { + int nL12345 = (int) p[ 0 ]; + 繝弱シ繝峨Μ繧ケ繝.Sort( delegate( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n1, C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n2 ) + { + string strAuthorN1 = ""; + string strAuthorN2 = ""; + if (n1.ar繧ケ繧ウ繧「[ nL12345 ] != null ) { + strAuthorN1 = n1.ar繧ケ繧ウ繧「[ nL12345 ].隴憺擇諠蝣ア.繧「繝シ繝繧」繧ケ繝亥錐; + } + if ( n2.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + strAuthorN2 = n2.ar繧ケ繧ウ繧「[ nL12345 ].隴憺擇諠蝣ア.繧「繝シ繝繧」繧ケ繝亥錐; + } + + return order * strAuthorN1.CompareTo( strAuthorN2 ); + } ); + foreach ( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 in 繝弱シ繝峨Μ繧ケ繝 ) + { + string s = ""; + if ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + s = c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ nL12345 ].隴憺擇諠蝣ア.繧「繝シ繝繧」繧ケ繝亥錐; + } +Debug.WriteLine( s + ":" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν ); + } + } + + public static void t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝9_繧ク繝」繝ウ繝ォ鬆(List 繝弱シ繝峨Μ繧ケ繝, E讌ス蝎ィ繝代シ繝 part, int order, params object[] p) + { + try + { + var acGenreComparer = order == 1 + ? (IComparer) new C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparerAC8_14() + : new C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparerAC15(); + + var comparer = new ComparerChain( + new C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer繝弱シ繝臥ィョ蛻・(), + acGenreComparer, + new C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer邨カ蟇セ繝代せ(1), + new C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer繧ソ繧、繝医Ν(1)); + + 繝弱シ繝峨Μ繧ケ繝.Sort( comparer ); + } + catch (Exception ex) + { + Trace.TraceError(ex.ToString()); + Trace.TraceError("萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (bca6dda7-76ad-42fc-a415-250f52c0b17d)"); + } + } + +#if TEST_SORTBGM + public static void t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝9_BPM鬆( List 繝弱シ繝峨Μ繧ケ繝, E讌ス蝎ィ繝代シ繝 part, int order, params object[] p ) + { + order = -order; + int nL12345 = (int) p[ 0 ]; + if ( part != E讌ス蝎ィ繝代シ繝.UNKNOWN ) + { + 繝弱シ繝峨Μ繧ケ繝.Sort( delegate( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n1, C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n2 ) + { + #region [ 蜈ア騾壼ヲ逅 ] + if ( n1 == n2 ) + { + return 0; + } + int num = this.t豈碑シ0_蜈ア騾( n1, n2 ); + if ( num != 0 ) + { + return num; + } + if ( ( n1.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) && ( n2.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) ) + { + return order * n1.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ.CompareTo( n2.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ ); + } + #endregion + double dBPMn1 = 0.0, dBPMn2 = 0.0; + if ( n1.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + dBPMn1 = n1.ar繧ケ繧ウ繧「[ nL12345 ].隴憺擇諠蝣ア.bpm; + } + if ( n2.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + dBPMn2 = n2.ar繧ケ繧ウ繧「[ nL12345 ].隴憺擇諠蝣ア.bpm; + } + double d = dBPMn1- dBPMn2; + if ( d != 0 ) + { + return order * System.Math.Sign( d ); + } + return order * n1.str繧ソ繧、繝医Ν.CompareTo( n2.str繧ソ繧、繝医Ν ); + } ); + foreach ( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 in 繝弱シ繝峨Μ繧ケ繝 ) + { + double dBPM = 0; + if ( c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ nL12345 ] != null ) + { + dBPM = c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[ nL12345 ].隴憺擇諠蝣ア.bpm; + } +Debug.WriteLine( dBPM + ":" + c譖イ繝ェ繧ケ繝医ヮ繝シ繝.str繧ソ繧、繝医Ν ); + } + } + } +#endif + //----------------- + #endregion + #region [ .score.ini 繧定ェュ縺ソ霎シ繧薙〒 C繧ケ繧ウ繧「.隴憺擇諠蝣ア縺ォ險ュ螳壹☆繧 ] + //----------------- + public void tScoreIni繧定ェュ縺ソ霎シ繧薙〒隴憺擇諠蝣ア繧定ィュ螳壹☆繧( string strScoreIni繝輔ぃ繧、繝ォ繝代せ, C繧ケ繧ウ繧「 score ) + { + if( !File.Exists( strScoreIni繝輔ぃ繧、繝ォ繝代せ ) ) + return; + + try + { + var ini = new CScoreIni( strScoreIni繝輔ぃ繧、繝ォ繝代せ ); + ini.t蜈ィ貍泌・剰ィ倬鹸繧サ繧ッ繧キ繝ァ繝ウ縺ョ謨エ蜷域ァ繧偵メ繧ァ繝繧ッ縺嶺ク肴紛蜷医′縺ゅl縺ー繝ェ繧サ繝繝医☆繧(); + + for( int n讌ス蝎ィ逡ェ蜿キ = 0; n讌ス蝎ィ逡ェ蜿キ < 3; n讌ス蝎ィ逡ェ蜿キ++ ) + { + int n = ( n讌ス蝎ィ逡ェ蜿キ * 2 ) + 1; // n = 0ス5 + + #region socre.隴憺擇諠蝣ア.譛螟ァ繝ゥ繝ウ繧ッ[ n讌ス蝎ィ逡ェ蜿キ ] = ... + //----------------- + if( ini.st繧サ繧ッ繧キ繝ァ繝ウ[ n ].b貍泌・上↓MIDI蜈・蜉帙r菴ソ逕ィ縺励◆ || + ini.st繧サ繧ッ繧キ繝ァ繝ウ[ n ].b貍泌・上↓繧ュ繝シ繝懊シ繝峨r菴ソ逕ィ縺励◆ || + ini.st繧サ繧ッ繧キ繝ァ繝ウ[ n ].b貍泌・上↓繧ク繝ァ繧、繝代ャ繝峨r菴ソ逕ィ縺励◆ || + ini.st繧サ繧ッ繧キ繝ァ繝ウ[ n ].b貍泌・上↓繝槭え繧ケ繧剃スソ逕ィ縺励◆ ) + { + // (A) 蜈ィ繧ェ繝シ繝医§繧縺ェ縺繧医≧縺ェ縺ョ縺ァ縲∵シ泌・冗オ先棡諠蝣ア繧呈怏蜉ケ縺ィ縺励※繝ゥ繝ウ繧ッ繧堤ョ怜コ縺吶k縲 + + score.隴憺擇諠蝣ア.譛螟ァ繝ゥ繝ウ繧ッ[ n讌ス蝎ィ逡ェ蜿キ ] = + CScoreIni.t繝ゥ繝ウ繧ッ蛟、繧定ィ育ョ励@縺ヲ霑斐☆( + ini.st繧サ繧ッ繧キ繝ァ繝ウ[ n ].n蜈ィ繝√ャ繝玲焚, + ini.st繧サ繧ッ繧キ繝ァ繝ウ[ n ].nPerfect謨ー, + ini.st繧サ繧ッ繧キ繝ァ繝ウ[ n ].nGreat謨ー, + ini.st繧サ繧ッ繧キ繝ァ繝ウ[ n ].nGood謨ー, + ini.st繧サ繧ッ繧キ繝ァ繝ウ[ n ].nPoor謨ー, + ini.st繧サ繧ッ繧キ繝ァ繝ウ[ n ].nMiss謨ー ); + } + else + { + // (B) 蜈ィ繧ェ繝シ繝医i縺励>縺ョ縺ァ縲√Λ繝ウ繧ッ縺ッ辟。蜉ケ縺ィ縺吶k縲 + + score.隴憺擇諠蝣ア.譛螟ァ繝ゥ繝ウ繧ッ[ n讌ス蝎ィ逡ェ蜿キ ] = (int) CScoreIni.ERANK.UNKNOWN; + } + //----------------- + #endregion + score.隴憺擇諠蝣ア.譛螟ァ繧ケ繧ュ繝ォ[ n讌ス蝎ィ逡ェ蜿キ ] = ini.st繧サ繧ッ繧キ繝ァ繝ウ[ n ].db貍泌・丞梛繧ケ繧ュ繝ォ蛟、; + score.隴憺擇諠蝣ア.繝輔Ν繧ウ繝ウ繝彈 n讌ス蝎ィ逡ェ蜿キ ] = ini.st繧サ繧ッ繧キ繝ァ繝ウ[ n ].b繝輔Ν繧ウ繝ウ繝懊〒縺ゅk; + score.隴憺擇諠蝣ア.繝上う繧ケ繧ウ繧「 = (int)ini.st繧サ繧ッ繧キ繝ァ繝ウ.HiScoreDrums.n繧ケ繧ウ繧「; + score.隴憺擇諠蝣ア.n繧ッ繝ェ繧「 = ini.st繧サ繧ッ繧キ繝ァ繝ウ.HiScoreDrums.n繧ッ繝ェ繧「; + score.隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ = ini.st繧サ繧ッ繧キ繝ァ繝ウ.HiScoreDrums.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ; + for( int i = 0; i < (int)Difficulty.Total; i++ ) + { + score.隴憺擇諠蝣ア.n繝上う繧ケ繧ウ繧「[ i ] = (int)ini.st繧サ繧ッ繧キ繝ァ繝ウ.HiScoreDrums.n繝上う繧ケ繧ウ繧「[ i ]; + } + } + score.隴憺擇諠蝣ア.貍泌・丞屓謨ー.Drums = ini.st繝輔ぃ繧、繝ォ.PlayCountDrums; + score.隴憺擇諠蝣ア.貍泌・丞屓謨ー.Guitar = ini.st繝輔ぃ繧、繝ォ.PlayCountGuitar; + score.隴憺擇諠蝣ア.貍泌・丞屓謨ー.Bass = ini.st繝輔ぃ繧、繝ォ.PlayCountBass; + for( int i = 0; i < (int)Difficulty.Total; i++ ) + score.隴憺擇諠蝣ア.貍泌・丞ア・豁エ[ i ] = ini.st繝輔ぃ繧、繝ォ.History[ i ]; + } + catch (Exception e) + { + Trace.TraceError( "貍泌・剰ィ倬鹸繝輔ぃ繧、繝ォ縺ョ隱ュ縺ソ霎シ縺ソ縺ォ螟ア謨励@縺セ縺励◆縲[{0}]", strScoreIni繝輔ぃ繧、繝ォ繝代せ ); + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (801f823d-a952-4809-a1bb-cf6a56194f5c)" ); + } + } + //----------------- + #endregion + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + //private const string SONGSDB_VERSION = "SongsDB5"; + private List listStrBoxDefSkinSubfolderFullName; + + /// + /// 讀懃エ「繧剃クュ譁ュ_繧ケ繝ュ繝シ繝繧ヲ繝ウ縺吶k + /// + private void SlowOrSuspendSearchTask() + { + if ( this.bIsSuspending ) // #27060 荳ュ譁ュ隕∵アゅ′縺ゅ▲縺溘i縲∬ァ」髯、隕∵アゅ′譚・繧九∪縺ァ蠕讖 + { + AutoReset.WaitOne(); + } + if ( this.bIsSlowdown && ++this.searchCount > 10 ) // #27060 #PREMOVIE蜀咲函荳ュ縺ッ讀懃エ「雋闕キ繧剃ク九£繧 + { + Thread.Sleep( 100 ); + this.searchCount = 0; + } + } + + //----------------- + #endregion + } +} +縲 diff --git a/TJAPlayer3/Songs/CStr繧ク繝」繝ウ繝ォtoNum.cs b/TJAPlayer3/Songs/CStr繧ク繝」繝ウ繝ォtoNum.cs new file mode 100644 index 00000000..080b2aa3 --- /dev/null +++ b/TJAPlayer3/Songs/CStr繧ク繝」繝ウ繝ォtoNum.cs @@ -0,0 +1,57 @@ +サソnamespace TJAPlayer3 +{ + internal static class CStr繧ク繝」繝ウ繝ォtoNum + { + internal static int ForAC8_14( string str繧ク繝」繝ウ繝ォ ) + { + switch( str繧ク繝」繝ウ繝ォ ) + { + case "繧「繝九Γ": + return 0; + case "繝昴ャ繝励せ": + return 1; + case "繧イ繝シ繝繝溘Η繝シ繧ク繝繧ッ": + return 2; + case "繝翫Β繧ウ繧ェ繝ェ繧ク繝翫Ν": + return 3; + case "繧ッ繝ゥ繧キ繝繧ッ": + return 4; + case "縺ゥ縺繧医≧": + return 5; + case "繝舌Λ繧ィ繝繧」": + return 6; + case "繝懊シ繧ォ繝ュ繧、繝": + case "VOCALOID": + return 7; + default: + return 8; + } + } + + internal static int ForAC15(string str繧ク繝」繝ウ繝ォ) + { + switch (str繧ク繝」繝ウ繝ォ) + { + case "繝昴ャ繝励せ": + return 0; + case "繧「繝九Γ": + return 1; + case "繝懊シ繧ォ繝ュ繧、繝": + case "VOCALOID": + return 2; + case "繧ュ繝繧コ": + return 3; + case "繝舌Λ繧ィ繝繧」": + return 4; + case "繧ッ繝ゥ繧キ繝繧ッ": + return 5; + case "繧イ繝シ繝繝舌Λ繧ィ繝繧」": + return 6; + case "繝翫Β繧ウ繧ェ繝ェ繧ク繝翫Ν": + return 7; + default: + return 8; + } + } + } +} \ No newline at end of file diff --git a/TJAPlayer3/Songs/C繧ケ繧ウ繧「.cs b/TJAPlayer3/Songs/C繧ケ繧ウ繧「.cs new file mode 100644 index 00000000..7329a286 --- /dev/null +++ b/TJAPlayer3/Songs/C繧ケ繧ウ繧「.cs @@ -0,0 +1,315 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Runtime.Serialization.Formatters.Binary; +using FDK; + +namespace TJAPlayer3 +{ + [Serializable] + internal class C繧ケ繧ウ繧「 + { + // 繝励Ο繝代ユ繧」 + + public STScoreIni諠蝣ア ScoreIni諠蝣ア; + [Serializable] + [StructLayout( LayoutKind.Sequential )] + public struct STScoreIni諠蝣ア + { + public DateTime 譛邨よ峩譁ー譌・譎; + public long 繝輔ぃ繧、繝ォ繧オ繧、繧コ; + + public STScoreIni諠蝣ア( DateTime 譛邨よ峩譁ー譌・譎, long 繝輔ぃ繧、繝ォ繧オ繧、繧コ ) + { + this.譛邨よ峩譁ー譌・譎 = 譛邨よ峩譁ー譌・譎; + this.繝輔ぃ繧、繝ォ繧オ繧、繧コ = 繝輔ぃ繧、繝ォ繧オ繧、繧コ; + } + } + + public ST繝輔ぃ繧、繝ォ諠蝣ア 繝輔ぃ繧、繝ォ諠蝣ア; + [Serializable] + [StructLayout( LayoutKind.Sequential )] + public struct ST繝輔ぃ繧、繝ォ諠蝣ア + { + public string 繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ; + public string 繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ; + public DateTime 譛邨よ峩譁ー譌・譎; + public long 繝輔ぃ繧、繝ォ繧オ繧、繧コ; + + public ST繝輔ぃ繧、繝ォ諠蝣ア( string 繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ, string 繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ, DateTime 譛邨よ峩譁ー譌・譎, long 繝輔ぃ繧、繝ォ繧オ繧、繧コ ) + { + this.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ = 繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ; + this.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ = 繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ; + this.譛邨よ峩譁ー譌・譎 = 譛邨よ峩譁ー譌・譎; + this.繝輔ぃ繧、繝ォ繧オ繧、繧コ = 繝輔ぃ繧、繝ォ繧オ繧、繧コ; + } + } + + public ST隴憺擇諠蝣ア 隴憺擇諠蝣ア; + [Serializable] + [StructLayout( LayoutKind.Sequential )] + public struct ST隴憺擇諠蝣ア + { + public string 繧ソ繧、繝医Ν; + public string 繧「繝シ繝繧」繧ケ繝亥錐; + public string 繧ウ繝。繝ウ繝; + public string 繧ク繝」繝ウ繝ォ; + public string Preimage; + public string Premovie; + public string Presound; + public string Backgound; + public STDGBVALUE 繝ャ繝吶Ν; + public STRANK 譛螟ァ繝ゥ繝ウ繧ッ; + public STSKILL 譛螟ァ繧ケ繧ュ繝ォ; + public STDGBVALUE 繝輔Ν繧ウ繝ウ繝; + public STDGBVALUE 貍泌・丞屓謨ー; + public STHISTORY 貍泌・丞ア・豁エ; + public bool 繝ャ繝吶Ν繧帝撼陦ィ遉コ縺ォ縺吶k; + public CDTX.E遞ョ蛻・ 譖イ遞ョ蛻・; + public double Bpm; + public int Duration; + public string strBGM繝輔ぃ繧、繝ォ蜷; + public int SongVol; + public LoudnessMetadata? SongLoudnessMetadata; + public int n繝繝「BGM繧ェ繝輔そ繝繝; + public bool[] b隴憺擇蛻蟯; + public int 繝上う繧ケ繧ウ繧「; + public int[] n繝上う繧ケ繧ウ繧「; + public string str繧オ繝悶ち繧、繝医Ν; + public int[] n繝ャ繝吶Ν; + public int[] n繧ッ繝ェ繧「; //0:譛ェ繧ッ繝ェ繧「 1:繧ッ繝ェ繧「 2:繝輔Ν繧ウ繝ウ繝 3:繝峨Φ繝繝輔Ν繧ウ繝ウ繝 + public int[] n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ; //0:譛ェ蜿門セ 1:逋ス邊 2:驫邊 3:驫邊 4:驥鷹寉 5:譯髮 6:邏ォ髮 7:陌ケ讌オ + + [Serializable] + [StructLayout( LayoutKind.Sequential )] + public struct STHISTORY + { + public string 陦1; + public string 陦2; + public string 陦3; + public string 陦4; + public string 陦5; + public string 陦6; + public string 陦7; + public string this[ int index ] + { + get + { + switch( index ) + { + case 0: + return this.陦1; + + case 1: + return this.陦2; + + case 2: + return this.陦3; + + case 3: + return this.陦4; + + case 4: + return this.陦5; + case 5: + return this.陦6; + case 6: + return this.陦7; + } + throw new IndexOutOfRangeException(); + } + set + { + switch( index ) + { + case 0: + this.陦1 = value; + return; + + case 1: + this.陦2 = value; + return; + + case 2: + this.陦3 = value; + return; + + case 3: + this.陦4 = value; + return; + + case 4: + this.陦5 = value; + return; + case 5: + this.陦6 = value; + return; + case 6: + this.陦7 = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + + [Serializable] + [StructLayout( LayoutKind.Sequential )] + public struct STRANK + { + public int Drums; + public int Guitar; + public int Bass; + public int this[ int index ] + { + get + { + switch( index ) + { + case 0: + return this.Drums; + + case 1: + return this.Guitar; + + case 2: + return this.Bass; + } + throw new IndexOutOfRangeException(); + } + set + { + if ( ( value < (int)CScoreIni.ERANK.SS ) || ( ( value != (int)CScoreIni.ERANK.UNKNOWN ) && ( value > (int)CScoreIni.ERANK.E ) ) ) + { + throw new ArgumentOutOfRangeException(); + } + switch( index ) + { + case 0: + this.Drums = value; + return; + + case 1: + this.Guitar = value; + return; + + case 2: + this.Bass = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + + [Serializable] + [StructLayout( LayoutKind.Sequential )] + public struct STSKILL + { + public double Drums; + public double Guitar; + public double Bass; + public double this[ int index ] + { + get + { + switch( index ) + { + case 0: + return this.Drums; + + case 1: + return this.Guitar; + + case 2: + return this.Bass; + } + throw new IndexOutOfRangeException(); + } + set + { + if( ( value < 0.0 ) || ( value > 100.0 ) ) + { + throw new ArgumentOutOfRangeException(); + } + switch( index ) + { + case 0: + this.Drums = value; + return; + + case 1: + this.Guitar = value; + return; + + case 2: + this.Bass = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + } + + public bool bSongDB縺ォ繧ュ繝」繝繧キ繝・縺後≠縺」縺; + public bool b繧ケ繧ウ繧「縺梧怏蜉ケ縺ァ縺ゅk + { + get + { + return ( ( ( this.隴憺擇諠蝣ア.繝ャ繝吶Ν[ 0 ] + this.隴憺擇諠蝣ア.繝ャ繝吶Ν[ 1 ] ) + this.隴憺擇諠蝣ア.繝ャ繝吶Ν[ 2 ] ) != 0 ); + } + } + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public C繧ケ繧ウ繧「() + { + this.ScoreIni諠蝣ア = new STScoreIni諠蝣ア( DateTime.MinValue, 0L ); + this.bSongDB縺ォ繧ュ繝」繝繧キ繝・縺後≠縺」縺 = false; + this.繝輔ぃ繧、繝ォ諠蝣ア = new ST繝輔ぃ繧、繝ォ諠蝣ア( "", "", DateTime.MinValue, 0L ); + this.隴憺擇諠蝣ア = new ST隴憺擇諠蝣ア(); + this.隴憺擇諠蝣ア.繧ソ繧、繝医Ν = ""; + this.隴憺擇諠蝣ア.繧「繝シ繝繧」繧ケ繝亥錐 = ""; + this.隴憺擇諠蝣ア.繧ウ繝。繝ウ繝 = ""; + this.隴憺擇諠蝣ア.繧ク繝」繝ウ繝ォ = ""; + this.隴憺擇諠蝣ア.Preimage = ""; + this.隴憺擇諠蝣ア.Premovie = ""; + this.隴憺擇諠蝣ア.Presound = ""; + this.隴憺擇諠蝣ア.Backgound = ""; + this.隴憺擇諠蝣ア.繝ャ繝吶Ν = new STDGBVALUE(); + this.隴憺擇諠蝣ア.譛螟ァ繝ゥ繝ウ繧ッ = new ST隴憺擇諠蝣ア.STRANK(); + this.隴憺擇諠蝣ア.譛螟ァ繝ゥ繝ウ繧ッ.Drums = (int)CScoreIni.ERANK.UNKNOWN; + this.隴憺擇諠蝣ア.譛螟ァ繝ゥ繝ウ繧ッ.Guitar = (int)CScoreIni.ERANK.UNKNOWN; + this.隴憺擇諠蝣ア.譛螟ァ繝ゥ繝ウ繧ッ.Bass = (int)CScoreIni.ERANK.UNKNOWN; + this.隴憺擇諠蝣ア.繝輔Ν繧ウ繝ウ繝 = new STDGBVALUE(); + this.隴憺擇諠蝣ア.貍泌・丞屓謨ー = new STDGBVALUE(); + this.隴憺擇諠蝣ア.貍泌・丞ア・豁エ = new ST隴憺擇諠蝣ア.STHISTORY(); + this.隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦1 = ""; + this.隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦2 = ""; + this.隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦3 = ""; + this.隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦4 = ""; + this.隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦5 = ""; + this.隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦6 = ""; + this.隴憺擇諠蝣ア.貍泌・丞ア・豁エ.陦7 = ""; + this.隴憺擇諠蝣ア.繝ャ繝吶Ν繧帝撼陦ィ遉コ縺ォ縺吶k = false; + this.隴憺擇諠蝣ア.譛螟ァ繧ケ繧ュ繝ォ = new ST隴憺擇諠蝣ア.STSKILL(); + this.隴憺擇諠蝣ア.譖イ遞ョ蛻・ = CDTX.E遞ョ蛻・.DTX; + this.隴憺擇諠蝣ア.Bpm = 120.0; + this.隴憺擇諠蝣ア.Duration = 0; + this.隴憺擇諠蝣ア.strBGM繝輔ぃ繧、繝ォ蜷 = ""; + this.隴憺擇諠蝣ア.SongVol = CSound.DefaultSongVol; + this.隴憺擇諠蝣ア.SongLoudnessMetadata = null; + this.隴憺擇諠蝣ア.n繝繝「BGM繧ェ繝輔そ繝繝 = 0; + this.隴憺擇諠蝣ア.b隴憺擇蛻蟯 = new bool[(int)Difficulty.Total]; + this.隴憺擇諠蝣ア.繝上う繧ケ繧ウ繧「 = 0; + this.隴憺擇諠蝣ア.n繝上う繧ケ繧ウ繧「 = new int[(int)Difficulty.Total]; + this.隴憺擇諠蝣ア.str繧オ繝悶ち繧、繝医Ν = ""; + this.隴憺擇諠蝣ア.n繝ャ繝吶Ν = new int[(int)Difficulty.Total] { -1, -1, -1, -1, -1, -1, -1}; + this.隴憺擇諠蝣ア.n繧ッ繝ェ繧「 = new int[5]; + this.隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ = new int[5]; + } + } +} diff --git a/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝.cs b/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝.cs new file mode 100644 index 00000000..be7521f5 --- /dev/null +++ b/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝.cs @@ -0,0 +1,86 @@ +サソusing System; +using System.Collections.Generic; +using System.Drawing; + +namespace TJAPlayer3 +{ + [Serializable] + internal class C譖イ繝ェ繧ケ繝医ヮ繝シ繝 + { + // 繝励Ο繝代ユ繧」 + + public E繝弱シ繝臥ィョ蛻・ e繝弱シ繝臥ィョ蛻・ = E繝弱シ繝臥ィョ蛻・.UNKNOWN; + public enum E繝弱シ繝臥ィョ蛻・ + { + SCORE, + SCORE_MIDI, + BOX, + BACKBOX, + RANDOM, + UNKNOWN + } + public int nID { get; private set; } + public C繧ケ繧ウ繧「[] ar繧ケ繧ウ繧「 = new C繧ケ繧ウ繧「[(int)Difficulty.Total]; + public string[] ar髮」譏灘コヲ繝ゥ繝吶Ν = new string[(int)Difficulty.Total]; + public bool bDTXFiles縺ァ蟋九∪繧九ヵ繧ゥ繝ォ繝蜷阪ョBOX縺ァ縺ゅk; + public bool bBoxDef縺ァ菴懈舌&繧後◆BOX縺ァ縺ゅk + { + get + { + return !this.bDTXFiles縺ァ蟋九∪繧九ヵ繧ゥ繝ォ繝蜷阪ョBOX縺ァ縺ゅk; + } + set + { + this.bDTXFiles縺ァ蟋九∪繧九ヵ繧ゥ繝ォ繝蜷阪ョBOX縺ァ縺ゅk = !value; + } + } + public Color col譁蟄苓牡 = Color.White; + public Color ForeColor = Color.White; + public Color BackColor = Color.Black; + public bool IsChangedForeColor; + public bool IsChangedBackColor; + public List list繝ゥ繝ウ繝繝逕ィ繝弱シ繝峨Μ繧ケ繝; + public List list蟄舌Μ繧ケ繝; + public int nGood遽蝗イms = -1; + public int nGreat遽蝗イms = -1; + public int nPerfect遽蝗イms = -1; + public int nPoor遽蝗イms = -1; + public int n繧ケ繧ウ繧「謨ー; + public C譖イ繝ェ繧ケ繝医ヮ繝シ繝 r隕ェ繝弱シ繝; + public int Openindex; + public Stack stack繝ゥ繝ウ繝繝貍泌・冗分蜿キ = new Stack(); + public string str繧ク繝」繝ウ繝ォ = ""; + public string str譛ャ蠖薙ョ繧ク繝」繝ウ繝ォ = ""; + public string str繧ソ繧、繝医Ν = ""; + public List DanSongs; + public Dan_C[] Dan_C; + public string str繧オ繝悶ち繧、繝医Ν = ""; + public string strBreadcrumbs = ""; // #27060 2011.2.27 yyagi; MUSIC BOX縺ョ繝代Φ縺上★繝ェ繧ケ繝 (譖イ繝ェ繧ケ繝域ァ矩蜀縺ョ邨カ蟇セ菴咲スョ謐墓拷縺ョ縺溘a縺ォ菴ソ縺) + public string strSkinPath = ""; // #28195 2012.5.4 yyagi; box.def縺ァ縺ョ繧ケ繧ュ繝ウ蛻繧頑崛縺亥ッセ蠢 + public bool bBranch = false; + public int[] nLevel = new int[(int)Difficulty.Total]{ 0, 0, 0, 0, 0, 0, 0 }; + public string[] strBoxText = new string[3]; + public E繧ク繝」繝ウ繝ォ e繧ク繝」繝ウ繝ォ = E繧ク繝」繝ウ繝ォ.None; + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public C譖イ繝ェ繧ケ繝医ヮ繝シ繝() + { + this.nID = id++; + } + + public C譖イ繝ェ繧ケ繝医ヮ繝シ繝 Clone() + { + return (C譖イ繝ェ繧ケ繝医ヮ繝シ繝)MemberwiseClone(); + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private static int id; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers/ComparerChain.cs b/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers/ComparerChain.cs new file mode 100644 index 00000000..358edcc9 --- /dev/null +++ b/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers/ComparerChain.cs @@ -0,0 +1,34 @@ +サソusing System.Collections.Generic; + +namespace TJAPlayer3.C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers +{ + internal sealed class ComparerChain : IComparer where T : class + { + private readonly IComparer[] _comparers; + + public ComparerChain(params IComparer[] comparers) + { + _comparers = comparers; + } + + public int Compare(T x, T y) + { + if (ReferenceEquals(x, y)) + { + return 0; + } + + for (int i = 0; i < _comparers.Length; i++) + { + var result = _comparers[i].Compare(x, y); + + if (result != 0) + { + return result; + } + } + + return 0; + } + } +} \ No newline at end of file diff --git a/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparerAC15.cs b/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparerAC15.cs new file mode 100644 index 00000000..8d8e8374 --- /dev/null +++ b/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparerAC15.cs @@ -0,0 +1,12 @@ +サソusing System.Collections.Generic; + +namespace TJAPlayer3.C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers +{ + internal sealed class C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparerAC15 : IComparer + { + public int Compare(C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n1, C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n2) + { + return CStr繧ク繝」繝ウ繝ォtoNum.ForAC15(n1.str繧ク繝」繝ウ繝ォ).CompareTo(CStr繧ク繝」繝ウ繝ォtoNum.ForAC15(n2.str繧ク繝」繝ウ繝ォ)); + } + } +} \ No newline at end of file diff --git a/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparerAC8_14.cs b/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparerAC8_14.cs new file mode 100644 index 00000000..58edc97e --- /dev/null +++ b/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparerAC8_14.cs @@ -0,0 +1,12 @@ +サソusing System.Collections.Generic; + +namespace TJAPlayer3.C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers +{ + internal sealed class C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparerAC8_14 : IComparer + { + public int Compare(C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n1, C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n2) + { + return CStr繧ク繝」繝ウ繝ォtoNum.ForAC8_14(n1.str繧ク繝」繝ウ繝ォ).CompareTo(CStr繧ク繝」繝ウ繝ォtoNum.ForAC8_14(n2.str繧ク繝」繝ウ繝ォ)); + } + } +} \ No newline at end of file diff --git a/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer繧ソ繧、繝医Ν.cs b/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer繧ソ繧、繝医Ν.cs new file mode 100644 index 00000000..829d0f10 --- /dev/null +++ b/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer繧ソ繧、繝医Ν.cs @@ -0,0 +1,19 @@ +サソusing System.Collections.Generic; + +namespace TJAPlayer3.C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers +{ + internal sealed class C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer繧ソ繧、繝医Ν : IComparer + { + private readonly int _order; + + public C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer繧ソ繧、繝医Ν(int order) + { + this._order = order; + } + + public int Compare(C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n1, C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n2) + { + return _order * n1.str繧ソ繧、繝医Ν.CompareTo( n2.str繧ソ繧、繝医Ν ); + } + } +} \ No newline at end of file diff --git a/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer繝弱シ繝臥ィョ蛻・.cs b/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer繝弱シ繝臥ィョ蛻・.cs new file mode 100644 index 00000000..bdc9fd53 --- /dev/null +++ b/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer繝弱シ繝臥ィョ蛻・.cs @@ -0,0 +1,33 @@ +サソusing System; +using System.Collections.Generic; + +namespace TJAPlayer3.C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers +{ + internal sealed class C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer繝弱シ繝臥ィョ蛻・ : IComparer + { + public int Compare(C譖イ繝ェ繧ケ繝医ヮ繝シ繝 x, C譖イ繝ェ繧ケ繝医ヮ繝シ繝 y) + { + return ToComparable(x.e繝弱シ繝臥ィョ蛻・).CompareTo(ToComparable(y.e繝弱シ繝臥ィョ蛻・)); + } + + private static int ToComparable(C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・ e繝弱シ繝臥ィョ蛻・) + { + switch (e繝弱シ繝臥ィョ蛻・) + { + case C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX: + return 0; + case C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE: + case C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE_MIDI: + return 1; + case C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.UNKNOWN: + return 2; + case C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.RANDOM: + return 3; + case C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BACKBOX: + return 4; + default: + throw new ArgumentOutOfRangeException(); + } + } + } +} diff --git a/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer邨カ蟇セ繝代せ.cs b/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer邨カ蟇セ繝代せ.cs new file mode 100644 index 00000000..2df01ab7 --- /dev/null +++ b/TJAPlayer3/Songs/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers/C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer邨カ蟇セ繝代せ.cs @@ -0,0 +1,40 @@ +サソusing System.Collections.Generic; + +namespace TJAPlayer3.C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparers +{ + internal sealed class C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer邨カ蟇セ繝代せ : IComparer + { + private readonly int _order; + + public C譖イ繝ェ繧ケ繝医ヮ繝シ繝韻omparer邨カ蟇セ繝代せ(int order) + { + this._order = order; + } + + public int Compare(C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n1, C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n2) + { + if( ( n1.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) && ( n2.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) ) + { + return _order * n1.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ.CompareTo( n2.ar繧ケ繧ウ繧「[ 0 ].繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ ); + } + + var str = str繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ(n1); + var strB = str繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ(n2); + + return _order * str.CompareTo( strB ); + } + + private static string str繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ(C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝) + { + for (int i = 0; i < (int)Difficulty.Total; i++) + { + if (c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[i] != null) + { + return c譖イ繝ェ繧ケ繝医ヮ繝シ繝.ar繧ケ繧ウ繧「[i].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ ?? ""; + } + } + + return ""; + } + } +} \ No newline at end of file diff --git a/TJAPlayer3/Songs/Dan-C.cs b/TJAPlayer3/Songs/Dan-C.cs new file mode 100644 index 00000000..df9ac9b3 --- /dev/null +++ b/TJAPlayer3/Songs/Dan-C.cs @@ -0,0 +1,391 @@ +サソusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace TJAPlayer3 +{ + /// + /// 谿オ菴崎ェ榊ョ壹r邂。逅縺吶k繧ッ繝ゥ繧ケ縲 + /// + public class Dan_C + { + public Dan_C() + { + + } + + public Dan_C(Dan_C dan_C) : this(dan_C.GetExamType(), new int[] { dan_C.GetValue(false), dan_C.GetValue(true) }, dan_C.GetExamRange()) + { + + } + + /// + /// 谿オ菴崎ェ榊ョ壹ョ譚。莉カ繧貞晄悄蛹悶@縲∫函謌舌@縺セ縺吶 + /// + /// 譚。莉カ縺ョ遞ョ蛻・縲 + /// 譚。莉カ縺ョ蜷域シ驥上 + /// 譚。莉カ縺ョ蜷域シ縺ョ遽蝗イ縲 + public Dan_C(Exam.Type examType, int[] value, Exam.Range examRange) + { + IsEnable = true; + NotReached = false; + SetExamType(examType); + SetValue(value[0], value[1]); + SetExamRange(examRange); + } + + /// + /// 譚。莉カ縺ィ迴セ蝨ィ縺ョ蛟、繧定ゥ穂セ。縺励※縲√け繝ェ繧「縺励◆縺九←縺縺九r蛻、譁ュ縺励∪縺吶 + /// + /// 縺昴ョ譚。莉カ縺ョ迴セ蝨ィ縺ョ蛟、縲 + public bool Update(int nowValue) + { + var isChangedAmount = false; + if (!GetEnable()) return isChangedAmount; + if (GetAmount() < nowValue) isChangedAmount = true; + if (GetExamRange() == Exam.Range.Less && nowValue > GetValue(false)) isChangedAmount = false; // n譛ェ貅縺ァ縺昴ョ謨ー繧定カ縺医◆繧映alse繧定ソ斐☆縲 + SetAmount(nowValue); + switch (GetExamType()) + { + case Exam.Type.Gauge: + SetCleared(); + break; + case Exam.Type.JudgePerfect: + SetCleared(); + break; + case Exam.Type.JudgeGood: + SetCleared(); + break; + case Exam.Type.JudgeBad: + SetCleared(); + break; + case Exam.Type.Score: + SetCleared(); + break; + case Exam.Type.Roll: + SetCleared(); + break; + case Exam.Type.Hit: + SetCleared(); + break; + case Exam.Type.Combo: + SetCleared(); + break; + default: + break; + } + return isChangedAmount; + } + + /// + /// 谿オ菴崎ェ榊ョ壹ョ譚。莉カ縺梧怏蜉ケ縺ァ縺ゅk縺九←縺縺九r霑斐@縺セ縺吶 + /// + /// 谿オ菴崎ェ榊ョ壹ョ譚。莉カ縺梧怏蜉ケ縺ァ縺ゅk縺九←縺縺九 + public bool GetEnable() + { + return this.IsEnable; + } + + /// + /// 蜷蜷域シ譚。莉カ縺ョ繝懊シ繝繝シ繧定ィュ螳壹@縺セ縺吶 + /// + /// 襍、蜷域シ譚。莉カ + /// 驥大粋譬シ譚。莉カ + public void SetValue(int redValue, int goldValue) + { + if (redValue != -1) this.Value[0] = redValue; + if (goldValue != -1) this.Value[1] = goldValue; + } + + /// + /// 蜷蜷域シ譚。莉カ縺ョ繝懊シ繝繝シ繧定ソ斐@縺セ縺吶 + /// + /// true繧呈欠螳壹☆繧九→縲驥大粋譬シ譚。莉カ繧定ソ斐@縺セ縺吶 + /// 蜷域シ譚。莉カ縺ョ蛟、縲 + public int GetValue(bool isGoldValue) + { + return isGoldValue == true ? this.Value[1] : this.Value[0]; + } + + /// + /// 迴セ蝨ィ縺ョ蛟、繧定ィュ螳壹@縺セ縺吶 + /// + /// 迴セ蝨ィ縺ョ蛟、縲 + public void SetAmount(int amount) + { + this.Amount = amount; + } + + /// + /// 迴セ蝨ィ縺ョ蛟、繧定ソ斐@縺セ縺吶 + /// + /// 迴セ蝨ィ縺ョ蛟、縲 + public int GetAmount() + { + return this.Amount; + } + + /// + /// 譚。莉カ縺ョ遞ョ蛻・繧定ソ斐@縺セ縺吶 + /// + /// 譚。莉カ縺ョ遞ョ蛻・ + public Exam.Type GetExamType() + { + return this.Type; + } + + /// + /// 譚。莉カ縺ョ遞ョ蛻・繧定ィュ螳壹@縺セ縺吶 + /// + /// 譚。莉カ縺ョ遞ョ蛻・縲 + private void SetExamType(Exam.Type type) + { + this.Type = type; + } + + /// + /// 譚。莉カ縺ョ遽蝗イ繧定ソ斐@縺セ縺吶 + /// + /// 譚。莉カ縺ョ遽蝗イ + public Exam.Range GetExamRange() + { + return this.Range; + } + + /// + /// 譚。莉カ縺ョ遽蝗イ繧定ィュ螳壹@縺セ縺吶 + /// + /// + private void SetExamRange(Exam.Range range) + { + this.Range = range; + } + + /// + /// 譚。莉カ縺ォ繧ッ繝ェ繧「縺励※縺繧九°縺ゥ縺縺玖ソ斐@縺セ縺吶 + /// + /// 譚。莉カ縺ォ繧ッ繝ェ繧「縺励※縺繧九°縺ゥ縺縺九 + public bool[] GetCleared() + { + return IsCleared; + } + + + /// + /// 譚。莉カ縺ィ迴セ蝨ィ縺ョ蛟、繧偵メ繧ァ繝繧ッ縺励※縲∝粋譬シ繧ゅ@縺上ッ驥大粋譬シ繧偵@縺ヲ繧九°蜷ヲ縺九r譖エ譁ー縺吶k縲 + /// + private void SetCleared() + { + if (GetExamRange() == Exam.Range.More) + { + if (GetAmount() >= GetValue(false)) + { + IsCleared[0] = true; + if (GetAmount() >= GetValue(true)) + { + IsCleared[1] = true; + } + } + else + { + IsCleared[0] = false; + IsCleared[1] = false; + } + } + else + { + if (GetAmount() < GetValue(true)) + { + IsCleared[1] = true; + } + else + { + IsCleared[1] = false; + } + if (GetAmount() < GetValue(false)) + { + IsCleared[0] = true; + } + else + { + IsCleared[0] = false; + } + } + } + + /// + /// 繧イ繝シ繧ク縺ョ謠冗判縺ョ縺溘a縺ョ逋セ蛻邇繧定ソ斐☆縲 + /// + /// Amount縺ョ逋セ蛻邇縲 + public int GetAmountToPercent() + { + var percent = 0.0D; + if(GetValue(false) == 0) + { + return 0; + } + if(GetExamRange() == Exam.Range.More) + { + switch (GetExamType()) + { + case Exam.Type.Gauge: + case Exam.Type.JudgePerfect: + case Exam.Type.JudgeGood: + case Exam.Type.JudgeBad: + case Exam.Type.Score: + case Exam.Type.Roll: + case Exam.Type.Hit: + case Exam.Type.Combo: + percent = 1.0 * GetAmount() / GetValue(false); + break; + default: + break; + } + } + else + { + switch (GetExamType()) + { + case Exam.Type.Gauge: + case Exam.Type.JudgePerfect: + case Exam.Type.JudgeGood: + case Exam.Type.JudgeBad: + case Exam.Type.Score: + case Exam.Type.Roll: + case Exam.Type.Hit: + case Exam.Type.Combo: + percent = (1.0 * (GetValue(false) - GetAmount())) / GetValue(false); + break; + default: + break; + } + } + percent = percent * 100.0; + if (percent < 0.0) + percent = 0.0D; + if (percent > 100.0) + percent = 100.0D; + return (int)percent; + } + + /// + /// 譚。莉カ縺ォ驕疲舌〒縺阪k隕玖セシ縺ソ縺後≠繧九°縺ゥ縺縺句、繧剃サ」蜈・縺励∪縺吶 + /// + /// 譛ェ驕疲舌°縺ゥ縺縺九 + public void SetReached(bool notReached) + { + NotReached = notReached; + } + + /// + /// 譚。莉カ縺ォ驕疲舌〒縺阪k隕玖セシ縺ソ縺後≠繧九°縺ゥ縺縺九r霑斐@縺セ縺吶 + /// + /// 譚。莉カ縺ォ驕疲舌〒縺阪k隕玖セシ縺ソ縺後≠繧九°縺ゥ縺縺九 + public bool GetReached() + { + return NotReached; + } + + // 繧ェ繝シ繝舌シ繝ゥ繧、繝峨Γ繧ス繝繝 + /// + /// ToString()縺ョ繧ェ繝シ繝舌シ繝ゥ繧、繝峨Γ繧ス繝繝峨よョオ菴崎ェ榊ョ壹Δ繝シ繝峨ョ蜷譚。莉カ縺ョ迴セ蝨ィ迥カ豕√rString蝙九〒霑斐@縺セ縺吶 + /// + /// 谿オ菴崎ェ榊ョ壹Δ繝シ繝峨ョ蜷譚。莉カ縺ョ迴セ蝨ィ迥カ豕√ + public override string ToString() + { + return String.Format("Type: {0} / Value: {1}/{2} / Range: {3} / Amount: {4} / Clear: {5}/{6} / Percent: {7} / NotReached: {8}", GetExamType(), GetValue(false), GetValue(true), GetExamRange(), GetAmount(), GetCleared()[0], GetCleared()[1], GetAmountToPercent(), GetReached()); + } + + + // 繝輔ぅ繝シ繝ォ繝 + /// + /// 縺昴ョ譚。莉カ縺梧怏蜉ケ縺ァ縺ゅk縺九←縺縺九 + /// + private bool IsEnable; + /// + /// 譚。莉カ縺ョ遞ョ蛻・縲 + /// + private Exam.Type Type; + /// + /// 譚。莉カ縺ョ遽蝗イ縲 + /// + private Exam.Range Range; + /// + /// 譚。莉カ縺ョ蛟、縲 + /// + public int[] Value = new int[] { 0, 0 }; + /// + /// 驥上 + /// + public int Amount; + /// + /// 譚。莉カ繧偵け繝ェ繧「縺励※縺繧九°蜷ヲ縺九 + /// + public readonly bool[] IsCleared = new[] { false, false }; + + /// + /// 譖イ縺斐→縺ョ譚。莉カ繧呈シ邏阪☆繧 + /// + public Dan_C[] SongExam = new Dan_C[3]; + + /// + /// 譚。莉カ縺ョ驕疲占ヲ玖セシ縺ソ縺後↑縺上↑縺」縺溘i縲∫悄縺ォ縺ェ繧九 + /// 縺薙ョ螟画焚縺御ク蠎ヲtrue縺ォ縺ェ繧後ー縲∝渕譛ャ逧縺ォfalse縺ォ謌サ繧九%縺ィ縺ッ縺ェ縺縲 + /// (繧ケ繧ウ繧「蜉邂励↓縺、縺縺ヲ縺ッ縲√%縺ョ髯舌j縺ァ縺ッ縺ェ縺縲) + /// + private bool NotReached = false; + } + + public static class Exam + { + /// + /// 谿オ菴崎ェ榊ョ壹ョ譚。莉カ縺ョ遞ョ蛻・縲 + /// + public enum Type + { + Gauge, + JudgePerfect, + JudgeGood, + JudgeBad, + Score, + Roll, + Hit, + Combo + } + + /// + /// 谿オ菴崎ェ榊ョ壹ョ蜷域シ遽蝗イ縲 + /// + public enum Range + { + /// + /// 莉・荳 + /// + More, + /// + /// 譛ェ貅 + /// + Less + } + + /// + /// 繧ケ繝繝シ繧ソ繧ケ縲 + /// + public enum Status + { + /// + /// 荳榊粋譬シ + /// + Failure, + /// + /// 蜷域シ + /// + Success, + /// + /// 繧医j濶ッ縺蜷域シ + /// + Better_Success + } + } +} diff --git a/TJAPlayer3/Songs/GaugeIncreaseMode.cs b/TJAPlayer3/Songs/GaugeIncreaseMode.cs new file mode 100644 index 00000000..427579f6 --- /dev/null +++ b/TJAPlayer3/Songs/GaugeIncreaseMode.cs @@ -0,0 +1,29 @@ +サソnamespace TJAPlayer3 +{ + /// + /// 繧イ繝シ繧ク蠅怜刈驥上ョ遞ョ鬘槭 + /// + public enum GaugeIncreaseMode + { + /// + /// 蛻繧頑昏縺ヲ繧九Floor縺ィ蜷檎セゥ縲 + /// + Normal, + /// + /// 蛻繧頑昏縺ヲ繧九 + /// + Floor, + /// + /// 蝗帶昏莠泌・縺吶k縲 + /// + Round, + /// + /// 蛻繧贋ク翫£繧九 + /// + Ceiling, + /// + /// 荳ク繧∝ヲ逅繧定。後o縺ェ縺縲 + /// + NotFix + } +} diff --git a/TJAPlayer3/Stages/01.StartUp/CStage襍キ蜍.cs b/TJAPlayer3/Stages/01.StartUp/CStage襍キ蜍.cs new file mode 100644 index 00000000..cbd59964 --- /dev/null +++ b/TJAPlayer3/Stages/01.StartUp/CStage襍キ蜍.cs @@ -0,0 +1,365 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using System.Threading; +using System.IO; +using FDK; +using System.Runtime.Serialization.Formatters.Binary; +using System.Windows.Input; + +namespace TJAPlayer3 +{ + internal class CStage襍キ蜍 : CStage + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CStage襍キ蜍() + { + base.e繧ケ繝繝シ繧クID = CStage.E繧ケ繝繝シ繧ク.襍キ蜍; + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + public List list騾イ陦梧枚蟄怜; + + // CStage 螳溯」 + + public override void On豢サ諤ァ蛹() + { + Trace.TraceInformation( "襍キ蜍輔せ繝繝シ繧ク繧呈エサ諤ァ蛹悶@縺セ縺吶" ); + Trace.Indent(); + try + { + this.list騾イ陦梧枚蟄怜 = new List(); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷; + base.On豢サ諤ァ蛹(); + Trace.TraceInformation( "襍キ蜍輔せ繝繝シ繧ク縺ョ豢サ諤ァ蛹悶r螳御コ縺励∪縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + } + public override void On髱樊エサ諤ァ蛹() + { + Trace.TraceInformation( "襍キ蜍輔せ繝繝シ繧ク繧帝撼豢サ諤ァ蛹悶@縺セ縺吶" ); + Trace.Indent(); + try + { + this.list騾イ陦梧枚蟄怜 = null; + if ( es != null ) + { + if ( ( es.thDTXFileEnumerate != null ) && es.thDTXFileEnumerate.IsAlive ) + { + Trace.TraceWarning( "繝ェ繧ケ繝域ァ狗ッ峨せ繝ャ繝繝峨r蠑キ蛻カ蛛懈ュ「縺励∪縺吶" ); + es.thDTXFileEnumerate.Abort(); + es.thDTXFileEnumerate.Join(); + } + } + base.On髱樊エサ諤ァ蛹(); + Trace.TraceInformation( "襍キ蜍輔せ繝繝シ繧ク縺ョ髱樊エサ諤ァ蛹悶r螳御コ縺励∪縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + this.tx閭梧勹 = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\1_Title\Background.png" ), false ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx閭梧勹 ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + if( base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + this.list騾イ陦梧枚蟄怜.Add( "DTXManiaXG Ver.K powered by YAMAHA Silent Session Drums\n" ); + this.list騾イ陦梧枚蟄怜.Add( "Product by.kairera0467\n" ); + this.list騾イ陦梧枚蟄怜.Add( "Release: " + TJAPlayer3.VERSION + " [" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString() + "]" ); + + this.list騾イ陦梧枚蟄怜.Add(""); + this.list騾イ陦梧枚蟄怜.Add("TJAPlayer3-Develop-ReWrite forked TJAPlayer3(@aioilight)"); + this.list騾イ陦梧枚蟄怜.Add("TJAPlayer3-Develop-BSQ forked TJAPlayer3-Develop-ReWrite(@TouhouRenren)"); + this.list騾イ陦梧枚蟄怜.Add("-Develop-BSQ edited by 0AuBSQ"); + this.list騾イ陦梧枚蟄怜.Add(""); + + es = new CEnumSongs(); + es.StartEnumFromCache(); // 譖イ繝ェ繧ケ繝亥叙蠕(蛻・繧ケ繝ャ繝繝峨〒螳溯。後&繧後k) + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + return 0; + } + + // CSongs邂。逅 s邂。逅 = CDTXMania.Songs邂。逅; + + //if( this.tx閭梧勹 != null ) + // this.tx閭梧勹.t2D謠冗判( CDTXMania.app.Device, 0, 0 ); + + #region [ this.str迴セ蝨ィ騾イ陦御クュ 縺ョ豎コ螳 ] + //----------------- + switch( base.e繝輔ぉ繝シ繧コID ) + { + case CStage.E繝輔ぉ繝シ繧コ.襍キ蜍0_繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨r讒狗ッ: + this.str迴セ蝨ィ騾イ陦御クュ = "SYSTEM SOUND..."; + break; + + case CStage.E繝輔ぉ繝シ繧コ.襍キ蜍00_songlist縺九i譖イ繝ェ繧ケ繝医r菴懈舌☆繧: + this.str迴セ蝨ィ騾イ陦御クュ = "SONG LIST..."; + break; + + /*case CStage.E繝輔ぉ繝シ繧コ.襍キ蜍1_SongsDB縺九i繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・繧呈ァ狗ッ: + this.str迴セ蝨ィ騾イ陦御クュ = "SONG DATABASE..."; + break;*/ + + case CStage.E繝輔ぉ繝シ繧コ.襍キ蜍2_譖イ繧呈、懃エ「縺励※繝ェ繧ケ繝医r菴懈舌☆繧: + this.str迴セ蝨ィ騾イ陦御クュ = string.Format( "{0} ... {1}", "Enumerating songs", es.Songs邂。逅.n讀懃エ「縺輔l縺溘せ繧ウ繧「謨ー ); + break; + + case CStage.E繝輔ぉ繝シ繧コ.襍キ蜍3_繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・繧偵Μ繧ケ繝医↓蜿肴丐縺吶k: + this.str迴セ蝨ィ騾イ陦御クュ = string.Format( "{0} ... {1}/{2}", "Loading score properties from songs.db", es.Songs邂。逅.n繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・縺九i蜿肴丐縺ァ縺阪◆繧ケ繧ウ繧「謨ー, es.Songs邂。逅.n讀懃エ「縺輔l縺溘せ繧ウ繧「謨ー ); + break; + + case CStage.E繝輔ぉ繝シ繧コ.襍キ蜍4_繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・縺ォ縺ェ縺九▲縺滓峇繧偵ヵ繧。繧、繝ォ縺九i隱ュ縺ソ霎シ繧薙〒蜿肴丐縺吶k: + this.str迴セ蝨ィ騾イ陦御クュ = string.Format( "{0} ... {1}/{2}", "Loading score properties from files", es.Songs邂。逅.n繝輔ぃ繧、繝ォ縺九i蜿肴丐縺ァ縺阪◆繧ケ繧ウ繧「謨ー, es.Songs邂。逅.n讀懃エ「縺輔l縺溘せ繧ウ繧「謨ー - es.Songs邂。逅.n繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・縺九i蜿肴丐縺ァ縺阪◆繧ケ繧ウ繧「謨ー ); + break; + + case CStage.E繝輔ぉ繝シ繧コ.襍キ蜍5_譖イ繝ェ繧ケ繝医∈蠕悟ヲ逅繧帝←逕ィ縺吶k: + this.str迴セ蝨ィ騾イ陦御クュ = string.Format( "{0} ... ", "Building songlists" ); + break; + + /*case CStage.E繝輔ぉ繝シ繧コ.襍キ蜍6_繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・繧担ongsDB縺ォ蜃コ蜉帙☆繧: + this.str迴セ蝨ィ騾イ陦御クュ = string.Format( "{0} ... ", "Saving songs.db" ); + break;*/ + + case CStage.E繝輔ぉ繝シ繧コ.襍キ蜍廟繝繧ッ繧ケ繝√Ε縺ョ隱ュ縺ソ霎シ縺ソ: + this.list騾イ陦梧枚蟄怜.Add("LOADING TEXTURES..."); + TJAPlayer3.Tx.LoadTexture(); + this.list騾イ陦梧枚蟄怜.Add("LOADING TEXTURES...OK"); + this.str迴セ蝨ィ騾イ陦御クュ = "Setup done."; + this.e繝輔ぉ繝シ繧コID = E繝輔ぉ繝シ繧コ.襍キ蜍7_螳御コ; + break; + } + //----------------- + #endregion + + if(e繝輔ぉ繝シ繧コID != E繝輔ぉ繝シ繧コ.襍キ蜍7_螳御コ) + { + #region [ this.list騾イ陦梧枚蟄怜暦シ逆his.迴セ蝨ィ騾イ陦御クュ 縺ョ陦ィ遉コ ] + //----------------- + lock (this.list騾イ陦梧枚蟄怜) + { + int x = 320; + int y = 20; + foreach (string str in this.list騾イ陦梧枚蟄怜) + { + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(x, y, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, str); + y += 24; + } + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(x, y, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.str迴セ蝨ィ騾イ陦御クュ); + } + //----------------- + #endregion + } + else + { + TJAPlayer3.Tx.Readme.t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + } + + if ( es != null && es.IsSongListEnumCompletelyDone ) // 譖イ繝ェ繧ケ繝井ス懈舌′邨ゅo縺」縺溘i + { + TJAPlayer3.Songs邂。逅 = ( es != null ) ? es.Songs邂。逅 : null; // 譛蠕後↓縲∵峇繝ェ繧ケ繝医r諡セ縺荳翫£繧 + + if(TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.Return)) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + return 1; + } + } + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private string str迴セ蝨ィ騾イ陦御クュ = ""; + private CTexture tx閭梧勹; + private CEnumSongs es; + +#if false + private void t譖イ繝ェ繧ケ繝医ョ讒狗ッ() + { + // シ∵ウィ諢擾シ + // 譛ャ繝。繧ス繝繝峨ッ蛻・繧ケ繝ャ繝繝峨〒蜍穂ス懊☆繧九′縲√励Λ繧ー繧、繝ウ蛛エ縺ァ繧ォ繝ャ繝ウ繝医ョ繧」繝ャ繧ッ繝医Μ繧貞、画峩縺励※繧ょ、ァ荳亥、ォ縺ェ繧医≧縺ォ縲 + // 縺吶∋縺ヲ縺ョ繝輔ぃ繧、繝ォ繧「繧ッ繧サ繧ケ縺ッ縲檎オカ蟇セ繝代せ縲阪〒陦後≧縺薙→縲(2010.9.16) + + DateTime now = DateTime.Now; + string strPathSongsDB = CDTXMania.strEXE縺ョ縺ゅk繝輔か繝ォ繝 + "songs.db"; + string strPathSongList = CDTXMania.strEXE縺ョ縺ゅk繝輔か繝ォ繝 + "songlist.db"; + + try + { + #region [ 0) 繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨ョ讒狗ッ ] + //----------------------------- + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.襍キ蜍0_繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨r讒狗ッ; + + Trace.TraceInformation( "0) 繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨r讒狗ッ峨@縺セ縺吶" ); + Trace.Indent(); + + try + { + for( int i = 0; i < CDTXMania.Skin.n繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝画焚; i++ ) + { + CSkin.C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 = CDTXMania.Skin[ i ]; + if( !CDTXMania.b繧ウ繝ウ繝代け繝医Δ繝シ繝 || c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.bCompact蟇セ雎。 ) + { + try + { + c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.t隱ュ縺ソ霎シ縺ソ(); + Trace.TraceInformation( "繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨r隱ュ縺ソ霎シ縺ソ縺セ縺励◆縲({0})", new object[] { c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.str繝輔ぃ繧、繝ォ蜷 } ); + if( ( c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 == CDTXMania.Skin.bgm襍キ蜍慕判髱「 ) && c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.b隱ュ縺ソ霎シ縺ソ謌仙粥 ) + { + c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.t蜀咲函縺吶k(); + } + } + catch( FileNotFoundException ) + { + Trace.TraceWarning( "繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨′蟄伜惠縺励∪縺帙s縲({0})", new object[] { c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.str繝輔ぃ繧、繝ォ蜷 } ); + } + catch( Exception exception ) + { + Trace.TraceError( exception.Message ); + Trace.TraceWarning( "繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨ョ隱ュ縺ソ霎シ縺ソ縺ォ螟ア謨励@縺セ縺励◆縲({0})", new object[] { c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.str繝輔ぃ繧、繝ォ蜷 } ); + } + } + } + lock( this.list騾イ陦梧枚蟄怜 ) + { + this.list騾イ陦梧枚蟄怜.Add( "Loading system sounds ... OK " ); + } + } + finally + { + Trace.Unindent(); + } + //----------------------------- + #endregion + + if( CDTXMania.b繧ウ繝ウ繝代け繝医Δ繝シ繝 ) + { + Trace.TraceInformation( "繧ウ繝ウ繝代け繝医Δ繝シ繝峨↑縺ョ縺ァ谿九j縺ョ襍キ蜍募ヲ逅縺ッ逵∫払縺励∪縺吶" ); + return; + } + + #region [ 00) songlist.db縺ョ隱ュ縺ソ霎シ縺ソ縺ォ繧医k譖イ繝ェ繧ケ繝医ョ讒狗ッ ] + //----------------------------- + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.襍キ蜍00_songlist縺九i譖イ繝ェ繧ケ繝医r菴懈舌☆繧; + + Trace.TraceInformation( "1) songlist.db繧定ェュ縺ソ霎シ縺ソ縺セ縺吶" ); + Trace.Indent(); + + try + { + if ( !CDTXMania.ConfigIni.bConfigIni縺後↑縺縺汽TXMania縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧 ) + { + try + { + CDTXMania.Songs邂。逅.tSongListDB繧定ェュ縺ソ霎シ繧( strPathSongList ); + } + catch + { + Trace.TraceError( "songlist.db 縺ョ隱ュ縺ソ霎シ縺ソ縺ォ螟ア謨励@縺セ縺励◆縲" ); + } + + int scores = ( CDTXMania.Songs邂。逅 == null ) ? 0 : CDTXMania.Songs邂。逅.n讀懃エ「縺輔l縺溘せ繧ウ繧「謨ー; // 隱ュ縺ソ霎シ縺ソ騾比クュ縺ァ繧「繝励Μ邨ゆコ縺励◆蝣エ蜷医↑縺ゥ縲,DTXMania.Songs邂。逅 縺系ull縺ョ蝣エ蜷医′縺ゅk縺ョ縺ァ豕ィ諢 + Trace.TraceInformation( "songlist.db 縺ョ隱ュ縺ソ霎シ縺ソ繧貞ョ御コ縺励∪縺励◆縲[{0}繧ケ繧ウ繧「]", scores ); + lock ( this.list騾イ陦梧枚蟄怜 ) + { + this.list騾イ陦梧枚蟄怜.Add( "Loading songlist.db ... OK" ); + } + } + else + { + Trace.TraceInformation( "蛻晏屓縺ョ襍キ蜍輔〒縺ゅk縺九∪縺溘ッDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ縺御ク翫′縺」縺溘◆繧√《onglist.db 縺ョ隱ュ縺ソ霎シ縺ソ繧偵せ繧ュ繝繝励@縺セ縺吶" ); + lock ( this.list騾イ陦梧枚蟄怜 ) + { + this.list騾イ陦梧枚蟄怜.Add( "Loading songlist.db ... Skip" ); + } + } + } + finally + { + Trace.Unindent(); + } + + #endregion + + #region [ 1) songs.db 縺ョ隱ュ縺ソ霎シ縺ソ ] + //----------------------------- + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.襍キ蜍1_SongsDB縺九i繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・繧呈ァ狗ッ; + + Trace.TraceInformation( "2) songs.db 繧定ェュ縺ソ霎シ縺ソ縺セ縺吶" ); + Trace.Indent(); + + try + { + if ( !CDTXMania.ConfigIni.bConfigIni縺後↑縺縺汽TXMania縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧 ) + { + try + { + CDTXMania.Songs邂。逅.tSongsDB繧定ェュ縺ソ霎シ繧( strPathSongsDB ); + } + catch + { + Trace.TraceError( "songs.db 縺ョ隱ュ縺ソ霎シ縺ソ縺ォ螟ア謨励@縺セ縺励◆縲" ); + } + + int scores = ( CDTXMania.Songs邂。逅 == null ) ? 0 : CDTXMania.Songs邂。逅.nSongsDB縺九i蜿門セ励〒縺阪◆繧ケ繧ウ繧「謨ー; // 隱ュ縺ソ霎シ縺ソ騾比クュ縺ァ繧「繝励Μ邨ゆコ縺励◆蝣エ蜷医↑縺ゥ縲,DTXMania.Songs邂。逅 縺系ull縺ョ蝣エ蜷医′縺ゅk縺ョ縺ァ豕ィ諢 + Trace.TraceInformation( "songs.db 縺ョ隱ュ縺ソ霎シ縺ソ繧貞ョ御コ縺励∪縺励◆縲[{0}繧ケ繧ウ繧「]", scores ); + lock ( this.list騾イ陦梧枚蟄怜 ) + { + this.list騾イ陦梧枚蟄怜.Add( "Loading songs.db ... OK" ); + } + } + else + { + Trace.TraceInformation( "蛻晏屓縺ョ襍キ蜍輔〒縺ゅk縺九∪縺溘ッDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ縺御ク翫′縺」縺溘◆繧√《ongs.db 縺ョ隱ュ縺ソ霎シ縺ソ繧偵せ繧ュ繝繝励@縺セ縺吶" ); + lock ( this.list騾イ陦梧枚蟄怜 ) + { + this.list騾イ陦梧枚蟄怜.Add( "Loading songs.db ... Skip" ); + } + } + } + finally + { + Trace.Unindent(); + } + //----------------------------- + #endregion + + } + finally + { + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.襍キ蜍7_螳御コ; + TimeSpan span = (TimeSpan) ( DateTime.Now - now ); + Trace.TraceInformation( "襍キ蜍墓園隕∵凾髢: {0}", new object[] { span.ToString() } ); + } + } +#endif + #endregion + } +} diff --git a/TJAPlayer3/Stages/01.StartUp/TextureLoader.cs b/TJAPlayer3/Stages/01.StartUp/TextureLoader.cs new file mode 100644 index 00000000..a43dad93 --- /dev/null +++ b/TJAPlayer3/Stages/01.StartUp/TextureLoader.cs @@ -0,0 +1,1114 @@ +using FDK; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace TJAPlayer3 +{ + class TextureLoader + { + const string BASE = @"Graphics\"; + + // Stage + const string TITLE = @"1_Title\"; + const string CONFIG = @"2_Config\"; + const string SONGSELECT = @"3_SongSelect\"; + const string DANISELECT = @"3_DaniSelect\"; + const string SONGLOADING = @"4_SongLoading\"; + const string GAME = @"5_Game\"; + const string RESULT = @"6_Result\"; + const string EXIT = @"7_Exit\"; + + // InGame + const string CHARA = @"1_Chara\"; + const string DANCER = @"2_Dancer\"; + const string MOB = @"3_Mob\"; + const string COURSESYMBOL = @"4_CourseSymbol\"; + const string BACKGROUND = @"5_Background\"; + const string TAIKO = @"6_Taiko\"; + const string GAUGE = @"7_Gauge\"; + const string FOOTER = @"8_Footer\"; + const string END = @"9_End\"; + const string EFFECTS = @"10_Effects\"; + const string BALLOON = @"11_Balloon\"; + const string LANE = @"12_Lane\"; + const string GENRE = @"13_Genre\"; + const string GAMEMODE = @"14_GameMode\"; + const string FAILED = @"15_Failed\"; + const string RUNNER = @"16_Runner\"; + const string PUCHICHARA = @"18_PuchiChara\"; + const string TRAINING = @"19_Training\"; + const string DANC = @"17_DanC\"; + + // InGame_Effects + const string FIRE = @"Fire\"; + const string HIT = @"Hit\"; + const string ROLL = @"Roll\"; + const string SPLASH = @"Splash\"; + + + public TextureLoader() + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + } + + internal CTexture TxC(string FileName) + { + var tex = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(BASE + FileName)); + listTexture.Add(tex); + return tex; + } + internal CTextureAf TxCAf(string FileName) + { + var tex = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓植f(CSkin.Path(BASE + FileName)); + listTexture.Add(tex); + return tex; + } + internal CTexture TxCGen(string FileName) + { + return TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(BASE + GAME + GENRE + FileName + ".png")); + } + + public void LoadTexture() + { + #region 蜈ア騾 + Tile_Black = TxC(@"Tile_Black.png"); + Menu_Title = TxC(@"Menu_Title.png"); + Menu_Highlight = TxC(@"Menu_Highlight.png"); + Enum_Song = TxC(@"Enum_Song.png"); + Scanning_Loudness = TxC(@"Scanning_Loudness.png"); + Overlay = TxC(@"Overlay.png"); + Network_Connection = TxC(@"Network_Connection.png"); + Readme = TxC(@"Readme.png"); + NamePlate = new CTexture[2]; + NamePlateBase = TxC(@"NamePlate.png"); + NamePlate[0] = TxC(@"1P_NamePlate.png"); + NamePlate[1] = TxC(@"2P_NamePlate.png"); + NamePlate_Effect[0] = TxC(@"9_NamePlateEffect\GoldMStar.png"); + NamePlate_Effect[1] = TxC(@"9_NamePlateEffect\PurpleMStar.png"); + NamePlate_Effect[2] = TxC(@"9_NamePlateEffect\GoldBStar.png"); + NamePlate_Effect[3] = TxC(@"9_NamePlateEffect\PurpleBStar.png"); + NamePlate_Effect[4] = TxC(@"9_NamePlateEffect\Slash.png"); + #endregion + #region 1_繧ソ繧、繝医Ν逕サ髱「 + Title_Background = TxC(TITLE + @"Background.png"); + Entry_Bar = TxC(TITLE + @"Entry_Bar.png"); + Entry_Bar_Text = TxC(TITLE + @"Entry_Bar_Text.png"); + + Banapas_Load[0] = TxC(TITLE + @"Banapas_Load.png"); + Banapas_Load[1] = TxC(TITLE + @"Banapas_Load_Text.png"); + Banapas_Load[2] = TxC(TITLE + @"Banapas_Load_Anime.png"); + + Banapas_Load_Clear[0] = TxC(TITLE + @"Banapas_Load_Clear.png"); + Banapas_Load_Clear[1] = TxC(TITLE + @"Banapas_Load_Clear_Anime.png"); + + Banapas_Load_Failure[0] = TxC(TITLE + @"Banapas_Load_Failure.png"); + Banapas_Load_Failure[1] = TxC(TITLE + @"Banapas_Load_Clear_Anime.png"); + + Entry_Player[0] = TxC(TITLE + @"Entry_Player.png"); + Entry_Player[1] = TxC(TITLE + @"Entry_Player_Select_Bar.png"); + Entry_Player[2] = TxC(TITLE + @"Entry_Player_Select.png"); + + for(int i = 0; i < Donchan_Entry.Length; i++) + { + Donchan_Entry[i] = TxC(TITLE + @"Donchan_Entry\" + i.ToString() + ".png"); + } + + for(int i = 0; i < Entry_Donchan_Normal.Length; i++) + { + Entry_Donchan_Normal[i] = TxC(TITLE + @"Donchan_Normal\" + i.ToString() + ".png"); + } + + for(int i = 0; i < 6; i++) + { + ModeSelect_Bar[i] = TxC(TITLE + @"ModeSelect_Bar_" + i.ToString() + ".png"); + } + + for(int i = 0; i < 6; i++) + { + ModeSelect_Bar_Chara[i] = TxC(TITLE + @"ModeSelect_Bar_Chara_" + i.ToString() + ".png"); + } + + for(int i = 0; i < 6; i++) + { + ModeSelect_Bar_Text[i] = TxC(TITLE + @"ModeSelect_Bar_Text_" + i.ToString() + ".png"); + } + + ModeSelect_Bar[6] = TxC(TITLE + @"ModeSelect_Bar_Overlay.png"); + + #endregion + + #region 2_繧ウ繝ウ繝輔ぅ繧ー逕サ髱「 + Config_Background = TxC(CONFIG + @"Background.png"); + Config_Header = TxC(CONFIG + @"Header.png"); + Config_Cursor = TxC(CONFIG + @"Cursor.png"); + Config_ItemBox = TxC(CONFIG + @"ItemBox.png"); + Config_Arrow = TxC(CONFIG + @"Arrow.png"); + Config_KeyAssign = TxC(CONFIG + @"KeyAssign.png"); + Config_Font = TxC(CONFIG + @"Font.png"); + Config_Font_Bold = TxC(CONFIG + @"Font_Bold.png"); + Config_Enum_Song = TxC(CONFIG + @"Enum_Song.png"); + #endregion + + #region 3_驕ク譖イ逕サ髱「 + SongSelect_Background = TxC(SONGSELECT + @"Background.png"); + SongSelect_Header = TxC(SONGSELECT + @"Header.png"); + SongSelect_Auto = TxC(SONGSELECT + @"Auto.png"); + SongSelect_Level = TxC(SONGSELECT + @"Level.png"); + SongSelect_Branch = TxC(SONGSELECT + @"Branch.png"); + SongSelect_Branch_Text = TxC(SONGSELECT + @"Branch_Text.png"); + SongSelect_Bar_Center = TxC(SONGSELECT + @"Bar_Center.png"); + SongSelect_Frame_Score = TxC(SONGSELECT + @"Frame_Score.png"); + SongSelect_Frame_Box = TxC(SONGSELECT + @"Frame_Box.png"); + SongSelect_Frame_BackBox = TxC(SONGSELECT + @"Frame_BackBox.png"); + SongSelect_Frame_Random = TxC(SONGSELECT + @"Frame_Random.png"); + SongSelect_Bar_Genre_Back = TxC(SONGSELECT + @"Bar_Genre_Back.png"); + SongSelect_Bar_Genre_RecentryPlaySong = TxC(SONGSELECT + @"Bar_Genre_RecentryPlaySong.png"); + SongSelect_Bar_Select = TxC(SONGSELECT + @"Bar_Select.png"); + SongSelect_Level_Number = TxC(SONGSELECT + @"Level_Number.png"); + SongSelect_Credit = TxC(SONGSELECT + @"Credit.png"); + SongSelect_Timer = TxC(SONGSELECT + @"Timer.png"); + SongSelect_Song_Number = TxC(SONGSELECT + @"Song_Number.png"); + SongSelect_Bar_Genre_Overlay = TxC(SONGSELECT + @"Bar_Genre_Overlay.png"); + SongSelect_Crown = TxC(SONGSELECT + @"SongSelect_Crown.png"); + SongSelect_ScoreRank = TxC(SONGSELECT + @"ScoreRank.png"); + SongSelect_BoardNumber = TxC(SONGSELECT + @"BoardNumber.png"); + + for (int i = 0; i < (int)Difficulty.Total; i++) + { + SongSelect_ScoreWindow[i] = TxC(SONGSELECT + @"ScoreWindow_" + i.ToString() + ".png"); + } + for (int i = 0; i < SongSelect_Donchan_Select.Length; i++) + { + SongSelect_Donchan_Select[i] = TxC(SONGSELECT + @"Donchan\Select\" + i.ToString() + ".png"); + } + for (int i = 0; i < SongSelect_Donchan_Normal.Length; i++) + { + SongSelect_Donchan_Normal[i] = TxC(SONGSELECT + @"Donchan\Loop\" + i.ToString() + ".png"); + } + for (int i = 0; i < SongSelect_Donchan_Jump.Length; i++) + { + SongSelect_Donchan_Jump[i] = TxC(SONGSELECT + @"Donchan\Start\" + i.ToString() + ".png"); + } + + SongSelect_ScoreWindow_Text = TxC(SONGSELECT + @"ScoreWindow_Text.png"); + + TJAPlayer3.Skin.SongSelect_Bar_Genre_Count = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + SONGSELECT + @"Bar_Genre\"), "Bar_Genre_"); + + if (TJAPlayer3.Skin.SongSelect_Bar_Genre_Count != 0) + { + SongSelect_Bar_Genre = new CTexture[TJAPlayer3.Skin.SongSelect_Bar_Genre_Count]; + for (int i = 0; i < SongSelect_Bar_Genre.Length; i++) + { + SongSelect_Bar_Genre[i] = TxC(SONGSELECT + @"Bar_Genre\Bar_Genre_" + i.ToString() + ".png"); + } + } + + TJAPlayer3.Skin.SongSelect_Genre_Background_Count = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + SONGSELECT + @"Genre_Background\"), "GenreBackground_"); + + if (TJAPlayer3.Skin.SongSelect_Genre_Background_Count != 0) + { + SongSelect_GenreBack = new CTexture[TJAPlayer3.Skin.SongSelect_Genre_Background_Count]; + for (int i = 0; i < SongSelect_GenreBack.Length; i++) + { + SongSelect_GenreBack[i] = TxC(SONGSELECT + @"Genre_Background\GenreBackground_" + i.ToString() + ".png"); + } + } + + TJAPlayer3.Skin.SongSelect_Box_Chara_Count = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + SONGSELECT + @"Box_Chara\"), "Box_Chara_"); + + if (TJAPlayer3.Skin.SongSelect_Box_Chara_Count != 0) + { + SongSelect_Box_Chara = new CTexture[TJAPlayer3.Skin.SongSelect_Box_Chara_Count]; + for (int i = 0; i < SongSelect_Box_Chara.Length; i++) + { + SongSelect_Box_Chara[i] = TxC(SONGSELECT + @"Box_Chara\Box_Chara_" + i.ToString() + ".png"); + } + } + + #region [ 髮」譏灘コヲ驕ク謚樒判髱「 ] + Difficulty_Bar = TxC(SONGSELECT + @"Difficulty_Select\Difficulty_Bar.png"); + Difficulty_Number = TxC(SONGSELECT + @"Difficulty_Select\Difficulty_Number.png"); + Difficulty_Star = TxC(SONGSELECT + @"Difficulty_Select\Difficulty_Star.png"); + Difficulty_Star_Red = TxC(SONGSELECT + @"Difficulty_Select\Difficulty_Star_Red.png"); + Difficulty_Crown = TxC(SONGSELECT + @"Difficulty_Select\Difficulty_Crown.png"); + Difficulty_Option = TxC($"{SONGSELECT}Difficulty_Select/Difficulty_Option.png"); + Difficulty_Option_Select = TxC($"{SONGSELECT}Difficulty_Select/Difficulty_Option_Select.png"); + + Difficulty_Select_Bar[0] = TxC(SONGSELECT + @"Difficulty_Select\Difficulty_Select_Bar.png"); + Difficulty_Select_Bar[1] = TxC(SONGSELECT + @"Difficulty_Select\Difficulty_Select_Bar2.png"); + + TJAPlayer3.Skin.SongSelect_Difficulty_Background_Count = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + SONGSELECT + @"Difficulty_Select\Difficulty_Back\"), "Difficulty_Back_"); + + if (TJAPlayer3.Skin.SongSelect_Difficulty_Background_Count != 0) + { + Difficulty_Back = new CTexture[TJAPlayer3.Skin.SongSelect_Difficulty_Background_Count]; + for (int i = 0; i < Difficulty_Back.Length; i++) + { + Difficulty_Back[i] = TxC(SONGSELECT + @"Difficulty_Select\Difficulty_Back\Difficulty_Back_" + i.ToString() + ".png"); + } + } + #endregion + + #endregion + + #region 3_谿オ菴埼∈謚樒判髱「 + + Dani_Background = TxC(DANISELECT + "Background.png"); + Dani_Difficulty_Cymbol = TxC(DANISELECT + "Difficulty_Cymbol.png"); + Dani_Level_Number = TxC(DANISELECT + "Level_Number.png"); + Dani_Soul_Number = TxC(DANISELECT + "SoulNumber.png"); + Dani_Exam_Number = TxC(DANISELECT + "ExamNumber.png"); + Dani_Bar_Center = TxC(DANISELECT + "Bar_Center.png"); + + for (int i = 0; i < 2; i++) + Challenge_Select[i] = TxC(DANISELECT + "Challenge_Select_" + i.ToString() + ".png"); + + #endregion + + #region 4_隱ュ縺ソ霎シ縺ソ逕サ髱「 + SongLoading_Plate = TxC(SONGLOADING + @"Plate.png"); + SongLoading_Bg = TxC(SONGLOADING + @"Bg.png"); + SongLoading_BgWait = TxC(SONGLOADING + @"Bg_Wait.png"); + SongLoading_Chara = TxC(SONGLOADING + @"Chara.png"); + SongLoading_Fade = TxC(SONGLOADING + @"Fade.png"); + SongLoading_Bg_Dan = TxC(SONGLOADING + @"Bg_Dan.png"); + #endregion + + #region 5_貍泌・冗判髱「 + #region 蜈ア騾 + Notes = TxC(GAME + @"Notes.png"); + Judge_Frame = TxC(GAME + @"Notes.png"); + SENotes = TxC(GAME + @"SENotes.png"); + Notes_Arm = TxC(GAME + @"Notes_Arm.png"); + Judge = TxC(GAME + @"Judge.png"); + ChipEffect = TxC(GAME + @"ChipEffect.png"); + ScoreRank = TxC(GAME + @"ScoreRank.png"); + + Judge_Meter = TxC(GAME + @"Judge_Meter.png"); + Bar = TxC(GAME + @"Bar.png"); + Bar_Branch = TxC(GAME + @"Bar_Branch.png"); + + #endregion + #region 繧ュ繝」繝ゥ繧ッ繧ソ繝シ + TJAPlayer3.Skin.Game_Chara_Ptn_Normal = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + GAME + CHARA + @"Normal\")); + if (TJAPlayer3.Skin.Game_Chara_Ptn_Normal != 0) + { + Chara_Normal = new CTexture[TJAPlayer3.Skin.Game_Chara_Ptn_Normal]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_Normal; i++) + { + Chara_Normal[i] = TxC(GAME + CHARA + @"Normal\" + i.ToString() + ".png"); + } + } + TJAPlayer3.Skin.Game_Chara_Ptn_Clear = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + GAME + CHARA + @"Clear\")); + if (TJAPlayer3.Skin.Game_Chara_Ptn_Clear != 0) + { + Chara_Normal_Cleared = new CTexture[TJAPlayer3.Skin.Game_Chara_Ptn_Clear]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_Clear; i++) + { + Chara_Normal_Cleared[i] = TxC(GAME + CHARA + @"Clear\" + i.ToString() + ".png"); + } + } + if (TJAPlayer3.Skin.Game_Chara_Ptn_Clear != 0) + { + Chara_Normal_Maxed = new CTexture[TJAPlayer3.Skin.Game_Chara_Ptn_Clear]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_Clear; i++) + { + Chara_Normal_Maxed[i] = TxC(GAME + CHARA + @"Clear_Max\" + i.ToString() + ".png"); + } + } + TJAPlayer3.Skin.Game_Chara_Ptn_GoGo = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + GAME + CHARA + @"GoGo\")); + if (TJAPlayer3.Skin.Game_Chara_Ptn_GoGo != 0) + { + Chara_GoGoTime = new CTexture[TJAPlayer3.Skin.Game_Chara_Ptn_GoGo]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_GoGo; i++) + { + Chara_GoGoTime[i] = TxC(GAME + CHARA + @"GoGo\" + i.ToString() + ".png"); + } + } + if (TJAPlayer3.Skin.Game_Chara_Ptn_GoGo != 0) + { + Chara_GoGoTime_Maxed = new CTexture[TJAPlayer3.Skin.Game_Chara_Ptn_GoGo]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_GoGo; i++) + { + Chara_GoGoTime_Maxed[i] = TxC(GAME + CHARA + @"GoGo_Max\" + i.ToString() + ".png"); + } + } + + TJAPlayer3.Skin.Game_Chara_Ptn_10combo = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + GAME + CHARA + @"10combo\")); + if (TJAPlayer3.Skin.Game_Chara_Ptn_10combo != 0) + { + Chara_10Combo = new CTexture[TJAPlayer3.Skin.Game_Chara_Ptn_10combo]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_10combo; i++) + { + Chara_10Combo[i] = TxC(GAME + CHARA + @"10combo\" + i.ToString() + ".png"); + } + } + TJAPlayer3.Skin.Game_Chara_Ptn_10combo_Max = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + GAME + CHARA + @"10combo_Max\")); + if (TJAPlayer3.Skin.Game_Chara_Ptn_10combo_Max != 0) + { + Chara_10Combo_Maxed = new CTexture[TJAPlayer3.Skin.Game_Chara_Ptn_10combo_Max]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_10combo_Max; i++) + { + Chara_10Combo_Maxed[i] = TxC(GAME + CHARA + @"10combo_Max\" + i.ToString() + ".png"); + } + } + + TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + GAME + CHARA + @"GoGoStart\")); + if (TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart != 0) + { + Chara_GoGoStart = new CTexture[TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart; i++) + { + Chara_GoGoStart[i] = TxC(GAME + CHARA + @"GoGoStart\" + i.ToString() + ".png"); + } + } + TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart_Max = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + GAME + CHARA + @"GoGoStart_Max\")); + if (TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart_Max != 0) + { + Chara_GoGoStart_Maxed = new CTexture[TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart_Max]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart_Max; i++) + { + Chara_GoGoStart_Maxed[i] = TxC(GAME + CHARA + @"GoGoStart_Max\" + i.ToString() + ".png"); + } + } + TJAPlayer3.Skin.Game_Chara_Ptn_ClearIn = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + GAME + CHARA + @"ClearIn\")); + if (TJAPlayer3.Skin.Game_Chara_Ptn_ClearIn != 0) + { + Chara_Become_Cleared = new CTexture[TJAPlayer3.Skin.Game_Chara_Ptn_ClearIn]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_ClearIn; i++) + { + Chara_Become_Cleared[i] = TxC(GAME + CHARA + @"ClearIn\" + i.ToString() + ".png"); + } + } + TJAPlayer3.Skin.Game_Chara_Ptn_SoulIn = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + GAME + CHARA + @"SoulIn\")); + if (TJAPlayer3.Skin.Game_Chara_Ptn_SoulIn != 0) + { + Chara_Become_Maxed = new CTexture[TJAPlayer3.Skin.Game_Chara_Ptn_SoulIn]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_SoulIn; i++) + { + Chara_Become_Maxed[i] = TxC(GAME + CHARA + @"SoulIn\" + i.ToString() + ".png"); + } + } + TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Breaking = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + GAME + CHARA + @"Balloon_Breaking\")); + if (TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Breaking != 0) + { + Chara_Balloon_Breaking = new CTexture[TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Breaking]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Breaking; i++) + { + Chara_Balloon_Breaking[i] = TxC(GAME + CHARA + @"Balloon_Breaking\" + i.ToString() + ".png"); + } + } + TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Broke = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + GAME + CHARA + @"Balloon_Broke\")); + if (TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Broke != 0) + { + Chara_Balloon_Broke = new CTexture[TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Broke]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Broke; i++) + { + Chara_Balloon_Broke[i] = TxC(GAME + CHARA + @"Balloon_Broke\" + i.ToString() + ".png"); + } + } + TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Miss = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + GAME + CHARA + @"Balloon_Miss\")); + if (TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Miss != 0) + { + Chara_Balloon_Miss = new CTexture[TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Miss]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Miss; i++) + { + Chara_Balloon_Miss[i] = TxC(GAME + CHARA + @"Balloon_Miss\" + i.ToString() + ".png"); + } + } + #endregion + #region 雕翫j蟄 + TJAPlayer3.Skin.Game_Dancer_Ptn = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + GAME + DANCER + @"1\")); + if (TJAPlayer3.Skin.Game_Dancer_Ptn != 0) + { + Dancer = new CTexture[5][]; + for (int i = 0; i < 5; i++) + { + Dancer[i] = new CTexture[TJAPlayer3.Skin.Game_Dancer_Ptn]; + for (int p = 0; p < TJAPlayer3.Skin.Game_Dancer_Ptn; p++) + { + Dancer[i][p] = TxC(GAME + DANCER + (i + 1) + @"\" + p.ToString() + ".png"); + } + } + } + #endregion + #region 繝「繝 + TJAPlayer3.Skin.Game_Mob_Ptn = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + GAME + MOB)); + Mob = new CTexture[TJAPlayer3.Skin.Game_Mob_Ptn]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Mob_Ptn; i++) + { + Mob[i] = TxC(GAME + MOB + i.ToString() + ".png"); + } + #endregion + #region 繝輔ャ繧ソ繝シ + Mob_Footer = TxC(GAME + FOOTER + @"0.png"); + #endregion + #region 閭梧勹 + + Background = TxC(GAME + Background + @"0\" + @"Background.png"); + + Background_Up_1st = new CTexture[3]; + Background_Up_1st[0] = TxC(GAME + BACKGROUND + @"0\" + @"1P_Up_1st.png"); + Background_Up_1st[1] = TxC(GAME + BACKGROUND + @"0\" + @"2P_Up_1st.png"); + Background_Up_1st[2] = TxC(GAME + BACKGROUND + @"0\" + @"Clear_Up_1st.png"); + + Background_Up_2nd = new CTexture[3]; + Background_Up_2nd[0] = TxC(GAME + BACKGROUND + @"0\" + @"1P_Up_2nd.png"); + Background_Up_2nd[1] = TxC(GAME + BACKGROUND + @"0\" + @"2P_Up_2nd.png"); + Background_Up_2nd[2] = TxC(GAME + BACKGROUND + @"0\" + @"Clear_Up_2nd.png"); + + Background_Up_3rd = new CTexture[3]; + Background_Up_3rd[0] = TxC(GAME + BACKGROUND + @"0\" + @"1P_Up_3rd.png"); + Background_Up_3rd[1] = TxC(GAME + BACKGROUND + @"0\" + @"2P_Up_3rd.png"); + Background_Up_3rd[2] = TxC(GAME + BACKGROUND + @"0\" + @"Clear_Up_3rd.png"); + + for(int i = 0; i < Background_Up_Dan.Length; i++) + Background_Up_Dan[i] = TxC(GAME + BACKGROUND + @"1\" + i.ToString() + @".png"); + + Background_Down = TxC(GAME + BACKGROUND + @"0\" + @"Down.png"); + Background_Down_Clear = TxC(GAME + BACKGROUND + @"0\" + @"Down_Clear.png"); + Background_Down_Scroll = TxC(GAME + BACKGROUND + @"0\" + @"Down_Scroll.png"); + + #endregion + #region 螟ェ鮠 + Taiko_Background = new CTexture[3]; + Taiko_Background[0] = TxC(GAME + TAIKO + @"1P_Background.png"); + Taiko_Background[1] = TxC(GAME + TAIKO + @"2P_Background.png"); + Taiko_Background[2] = TxC(GAME + TAIKO + @"Dan_Background.png"); + Taiko_Frame = new CTexture[2]; + Taiko_Frame[0] = TxC(GAME + TAIKO + @"1P_Frame.png"); + Taiko_Frame[1] = TxC(GAME + TAIKO + @"2P_Frame.png"); + Taiko_PlayerNumber = new CTexture[2]; + Taiko_PlayerNumber[0] = TxC(GAME + TAIKO + @"1P_PlayerNumber.png"); + Taiko_PlayerNumber[1] = TxC(GAME + TAIKO + @"2P_PlayerNumber.png"); + Taiko_NamePlate = new CTexture[2]; + Taiko_NamePlate[0] = TxC(GAME + TAIKO + @"1P_NamePlate.png"); + Taiko_NamePlate[1] = TxC(GAME + TAIKO + @"2P_NamePlate.png"); + Taiko_Base = TxC(GAME + TAIKO + @"Base.png"); + Taiko_Don_Left = TxC(GAME + TAIKO + @"Don.png"); + Taiko_Don_Right = TxC(GAME + TAIKO + @"Don.png"); + Taiko_Ka_Left = TxC(GAME + TAIKO + @"Ka.png"); + Taiko_Ka_Right = TxC(GAME + TAIKO + @"Ka.png"); + Taiko_LevelUp = TxC(GAME + TAIKO + @"LevelUp.png"); + Taiko_LevelDown = TxC(GAME + TAIKO + @"LevelDown.png"); + Couse_Symbol = new CTexture[(int)Difficulty.Total + 1]; // +1縺ッ逵滓遠縺。繝「繝シ繝峨ョ蛻 + string[] Couse_Symbols = new string[(int)Difficulty.Total + 1] { "Easy", "Normal", "Hard", "Oni", "Edit", "Tower", "Dan", "Shin" }; + for (int i = 0; i < (int)Difficulty.Total + 1; i++) + { + Couse_Symbol[i] = TxC(GAME + COURSESYMBOL + Couse_Symbols[i] + ".png"); + } + Taiko_Score = new CTexture[3]; + Taiko_Score[0] = TxC(GAME + TAIKO + @"Score.png"); + Taiko_Score[1] = TxC(GAME + TAIKO + @"Score_1P.png"); + Taiko_Score[2] = TxC(GAME + TAIKO + @"Score_2P.png"); + Taiko_Combo = new CTexture[3]; + Taiko_Combo[0] = TxC(GAME + TAIKO + @"Combo.png"); + Taiko_Combo[1] = TxC(GAME + TAIKO + @"Combo_Big.png"); + Taiko_Combo[2] = TxC(GAME + TAIKO + @"Combo_Midium.png"); + Taiko_Combo_Effect = TxC(GAME + TAIKO + @"Combo_Effect.png"); + Taiko_Combo_Text = TxC(GAME + TAIKO + @"Combo_Text.png"); + #endregion + #region 繧イ繝シ繧ク + Gauge = new CTexture[2]; + Gauge[0] = TxC(GAME + GAUGE + @"1P.png"); + Gauge[1] = TxC(GAME + GAUGE + @"2P.png"); + Gauge_Base = new CTexture[2]; + Gauge_Base[0] = TxC(GAME + GAUGE + @"1P_Base.png"); + Gauge_Base[1] = TxC(GAME + GAUGE + @"2P_Base.png"); + Gauge_Line = new CTexture[2]; + Gauge_Line[0] = TxC(GAME + GAUGE + @"1P_Line.png"); + Gauge_Line[1] = TxC(GAME + GAUGE + @"2P_Line.png"); + TJAPlayer3.Skin.Game_Gauge_Rainbow_Ptn = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + GAME + GAUGE + @"Rainbow\")); + if (TJAPlayer3.Skin.Game_Gauge_Rainbow_Ptn != 0) + { + Gauge_Rainbow = new CTexture[TJAPlayer3.Skin.Game_Gauge_Rainbow_Ptn]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Gauge_Rainbow_Ptn; i++) + { + Gauge_Rainbow[i] = TxC(GAME + GAUGE + @"Rainbow\" + i.ToString() + ".png"); + } + } + + TJAPlayer3.Skin.Game_Gauge_Dan_Rainbow_Ptn = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + GAME + DANC + @"Rainbow\")); + if (TJAPlayer3.Skin.Game_Gauge_Dan_Rainbow_Ptn != 0) + { + Gauge_Dan_Rainbow = new CTexture[TJAPlayer3.Skin.Game_Gauge_Dan_Rainbow_Ptn]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Gauge_Dan_Rainbow_Ptn; i++) + { + Gauge_Dan_Rainbow[i] = TxC(GAME + DANC + @"Rainbow\" + i.ToString() + ".png"); + } + } + Gauge_Dan = new CTexture[4]; + + Gauge_Dan[0] = TxC(GAME + GAUGE + @"1P_Dan_Base.png"); + Gauge_Dan[1] = TxC(GAME + GAUGE + @"1P_Dan.png"); + Gauge_Dan[2] = TxC(GAME + GAUGE + @"1P_Dan_Clear_Base.png"); + Gauge_Dan[3] = TxC(GAME + GAUGE + @"1P_Dan_Clear.png"); + + Gauge_Soul = TxC(GAME + GAUGE + @"Soul.png"); + Gauge_Flash = TxC(GAME + GAUGE + @"Flash.png"); + Gauge_Soul_Fire = TxC(GAME + GAUGE + @"Fire.png"); + Gauge_Soul_Explosion = new CTexture[2]; + Gauge_Soul_Explosion[0] = TxC(GAME + GAUGE + @"1P_Explosion.png"); + Gauge_Soul_Explosion[1] = TxC(GAME + GAUGE + @"2P_Explosion.png"); + #endregion + #region 蜷ケ縺榊コ縺 + Balloon_Combo = new CTexture[2]; + Balloon_Combo[0] = TxC(GAME + BALLOON + @"Combo_1P.png"); + Balloon_Combo[1] = TxC(GAME + BALLOON + @"Combo_2P.png"); + Balloon_Roll = TxC(GAME + BALLOON + @"Roll.png"); + Balloon_Balloon = TxC(GAME + BALLOON + @"Balloon.png"); + Balloon_Number_Roll = TxC(GAME + BALLOON + @"Number_Roll.png"); + Balloon_Number_Combo = TxC(GAME + BALLOON + @"Number_Combo.png"); + + Balloon_Breaking = new CTexture[6]; + for (int i = 0; i < 6; i++) + { + Balloon_Breaking[i] = TxC(GAME + BALLOON + @"Breaking_" + i.ToString() + ".png"); + } + #endregion + #region 繧ィ繝輔ぉ繧ッ繝 + Effects_Hit_Explosion = TxCAf(GAME + EFFECTS + @"Hit\Explosion.png"); + if (Effects_Hit_Explosion != null) Effects_Hit_Explosion.b蜉邂怜粋謌 = TJAPlayer3.Skin.Game_Effect_HitExplosion_AddBlend; + Effects_Hit_Explosion_Big = TxC(GAME + EFFECTS + @"Hit\Explosion_Big.png"); + if (Effects_Hit_Explosion_Big != null) Effects_Hit_Explosion_Big.b蜉邂怜粋謌 = TJAPlayer3.Skin.Game_Effect_HitExplosionBig_AddBlend; + Effects_Hit_FireWorks = TxC(GAME + EFFECTS + @"Hit\FireWorks.png"); + if (Effects_Hit_FireWorks != null) Effects_Hit_FireWorks.b蜉邂怜粋謌 = TJAPlayer3.Skin.Game_Effect_FireWorks_AddBlend; + + + Effects_Fire = TxC(GAME + EFFECTS + @"Fire.png"); + if (Effects_Fire != null) Effects_Fire.b蜉邂怜粋謌 = TJAPlayer3.Skin.Game_Effect_Fire_AddBlend; + + Effects_Rainbow = TxC(GAME + EFFECTS + @"Rainbow.png"); + + Effects_GoGoSplash = TxC(GAME + EFFECTS + @"GoGoSplash.png"); + if (Effects_GoGoSplash != null) Effects_GoGoSplash.b蜉邂怜粋謌 = TJAPlayer3.Skin.Game_Effect_GoGoSplash_AddBlend; + Effects_Hit_Great = new CTexture[15]; + Effects_Hit_Great_Big = new CTexture[15]; + Effects_Hit_Good = new CTexture[15]; + Effects_Hit_Good_Big = new CTexture[15]; + for (int i = 0; i < 15; i++) + { + Effects_Hit_Great[i] = TxC(GAME + EFFECTS + @"Hit\" + @"Great\" + i.ToString() + ".png"); + Effects_Hit_Great_Big[i] = TxC(GAME + EFFECTS + @"Hit\" + @"Great_Big\" + i.ToString() + ".png"); + Effects_Hit_Good[i] = TxC(GAME + EFFECTS + @"Hit\" + @"Good\" + i.ToString() + ".png"); + Effects_Hit_Good_Big[i] = TxC(GAME + EFFECTS + @"Hit\" + @"Good_Big\" + i.ToString() + ".png"); + } + TJAPlayer3.Skin.Game_Effect_Roll_Ptn = TJAPlayer3.t騾」逡ェ逕サ蜒上ョ譫壽焚繧呈焚縺医k(CSkin.Path(BASE + GAME + EFFECTS + @"Roll\")); + Effects_Roll = new CTexture[TJAPlayer3.Skin.Game_Effect_Roll_Ptn]; + for (int i = 0; i < TJAPlayer3.Skin.Game_Effect_Roll_Ptn; i++) + { + Effects_Roll[i] = TxC(GAME + EFFECTS + @"Roll\" + i.ToString() + ".png"); + } + #endregion + #region 繝ャ繝シ繝ウ + Lane_Base = new CTexture[3]; + Lane_Text = new CTexture[3]; + string[] Lanes = new string[3] { "Normal", "Expert", "Master" }; + for (int i = 0; i < 3; i++) + { + Lane_Base[i] = TxC(GAME + LANE + "Base_" + Lanes[i] + ".png"); + Lane_Text[i] = TxC(GAME + LANE + "Text_" + Lanes[i] + ".png"); + } + Lane_Red = TxC(GAME + LANE + @"Red.png"); + Lane_Blue = TxC(GAME + LANE + @"Blue.png"); + Lane_Yellow = TxC(GAME + LANE + @"Yellow.png"); + Lane_Background_Main = TxC(GAME + LANE + @"Background_Main.png"); + Lane_Background_Sub = TxC(GAME + LANE + @"Background_Sub.png"); + Lane_Background_GoGo = TxC(GAME + LANE + @"Background_GoGo.png"); + + #endregion + #region 邨ゆコ貍泌コ + End_Clear_Chara = TxC(GAME + END + @"Clear_Chara.png"); + End_Star = TxC(GAME + END + @"Star.png"); + + End_Clear_Text = new CTexture[2]; + End_Clear_Text[0] = TxC(GAME + END + @"Clear_Text.png"); + End_Clear_Text[1] = TxC(GAME + END + @"Clear_Text_End.png"); + + End_Clear_L = new CTexture[5]; + End_Clear_R = new CTexture[5]; + for (int i = 0; i < 5; i++) + { + End_Clear_L[i] = TxC(GAME + END + @"Clear\" + @"Clear_L_" + i.ToString() + ".png"); + End_Clear_R[i] = TxC(GAME + END + @"Clear\" + @"Clear_R_" + i.ToString() + ".png"); + } + End_Clear_Text_ = TxC(GAME + END + @"Clear\" + @"Clear_Text.png"); + End_Clear_Text_Effect = TxC(GAME + END + @"Clear\" + @"Clear_Text_Effect.png"); + if (End_Clear_Text_Effect != null) End_Clear_Text_Effect.b蜉邂怜粋謌 = true; + + ClearFailed = TxC(GAME + END + @"ClearFailed\" + "Clear_Failed.png"); + ClearFailed1 = TxC(GAME + END + @"ClearFailed\" + "Clear_Failed1.png"); + ClearFailed2 = TxC(GAME + END + @"ClearFailed\" + "Clear_Failed2.png"); + End_ClearFailed = new CTexture[26]; + for (int i = 0; i < 26; i++) + End_ClearFailed[i] = TxC(GAME + END + @"ClearFailed\" + i.ToString() + ".png"); + + End_FullCombo = new CTexture[67]; + for (int i = 0; i < 67; i++) + End_FullCombo[i] = TxC(GAME + END + @"FullCombo\" + i.ToString() + ".png"); + End_FullComboLoop = new CTexture[3]; + for (int i = 0; i < 3; i++) + End_FullComboLoop[i] = TxC(GAME + END + @"FullCombo\" + "loop_" + i.ToString() + ".png"); + + End_DondaFullComboBg = TxC(GAME + END + @"DondaFullCombo\" + "bg.png"); + End_DondaFullCombo = new CTexture[62]; + for (int i = 0; i < 62; i++) + End_DondaFullCombo[i] = TxC(GAME + END + @"DondaFullCombo\" + i.ToString() + ".png"); + End_DondaFullComboLoop = new CTexture[3]; + for (int i = 0; i < 3; i++) + End_DondaFullComboLoop[i] = TxC(GAME + END + @"DondaFullCombo\" + "loop_" + i.ToString() + ".png"); + #endregion + #region 繧イ繝シ繝繝「繝シ繝 + GameMode_Timer_Tick = TxC(GAME + GAMEMODE + @"Timer_Tick.png"); + GameMode_Timer_Frame = TxC(GAME + GAMEMODE + @"Timer_Frame.png"); + #endregion + #region 繧ケ繝繝シ繧ク螟ア謨 + Failed_Game = TxC(GAME + FAILED + @"Game.png"); + Failed_Stage = TxC(GAME + FAILED + @"Stage.png"); + #endregion + #region 繝ゥ繝ウ繝翫シ + Runner = TxC(GAME + RUNNER + @"0.png"); + #endregion + #region DanC + DanC_Background = TxC(GAME + DANC + @"Background.png"); + DanC_Gauge = new CTexture[4]; + var type = new string[] { "Normal", "Reach", "Clear", "Flush" }; + for (int i = 0; i < 4; i++) + { + DanC_Gauge[i] = TxC(GAME + DANC + @"Gauge_" + type[i] + ".png"); + } + DanC_Base = TxC(GAME + DANC + @"Base.png"); + DanC_Gauge_Base = TxC(GAME + DANC + @"Gauge_Base.png"); + DanC_Failed = TxC(GAME + DANC + @"Failed.png"); + DanC_Number = TxC(GAME + DANC + @"Number.png"); + DanC_Small_Number = TxC(GAME + DANC + @"Small_Number.png"); + DanC_ExamType = TxC(GAME + DANC + @"ExamType.png"); + DanC_ExamRange = TxC(GAME + DANC + @"ExamRange.png"); + DanC_ExamUnit = TxC(GAME + DANC + @"ExamUnit.png"); + DanC_Screen = TxC(GAME + DANC + @"Screen.png"); + DanC_SmallBase = TxC(GAME + DANC + @"SmallBase.png"); + DanC_Small_ExamCymbol = TxC(GAME + DANC + @"Small_ExamCymbol.png"); + DanC_ExamCymbol = TxC(GAME + DANC + @"ExamCymbol.png"); + DanC_MiniNumber = TxC(GAME + DANC + @"MiniNumber.png"); + #endregion + #region PuichiChara + PuchiChara = TxC(GAME + PUCHICHARA + @"0.png"); + #endregion + #region Training + Tokkun_DownBG = TxC(GAME + TRAINING + @"Down.png"); + Tokkun_BigTaiko = TxC(GAME + TRAINING + @"BigTaiko.png"); + Tokkun_ProgressBar = TxC(GAME + TRAINING + @"ProgressBar_Red.png"); + Tokkun_ProgressBarWhite = TxC(GAME + TRAINING + @"ProgressBar_White.png"); + Tokkun_GoGoPoint = TxC(GAME + TRAINING + @"GoGoPoint.png"); + Tokkun_JumpPoint = TxC(GAME + TRAINING + @"JumpPoint.png"); + Tokkun_Background_Up = TxC(GAME + TRAINING + @"Background_Up.png"); + Tokkun_BigNumber = TxC(GAME + TRAINING + @"BigNumber.png"); + Tokkun_SmallNumber = TxC(GAME + TRAINING + @"SmallNumber.png"); + Tokkun_Speed_Measure = TxC(GAME + TRAINING + @"Speed_Measure.png"); + #endregion + #endregion + + #region 6_邨先棡逋コ陦ィ + Result_FadeIn = TxC(RESULT + @"FadeIn.png"); + Result_Gauge = TxC(RESULT + @"Gauge.png"); + Result_Gauge_Base = TxC(RESULT + @"Gauge_Base.png"); + Result_Header = TxC(RESULT + @"Header.png"); + Result_Number = TxC(RESULT + @"Number.png"); + Result_Panel = TxC(RESULT + @"Panel.png"); + Result_Soul_Text = TxC(RESULT + @"Soul_Text.png"); + Result_Soul_Fire = TxC(RESULT + @"Result_Soul_Fire.png"); + Result_Diff_Bar = TxC(RESULT + @"DifficultyBar.png"); + Result_Score_Number = TxC(RESULT + @"Score_Number.png"); + Result_Dan = TxC(RESULT + @"Dan.png"); + + Result_CrownEffect = TxC(RESULT + @"CrownEffect.png"); + Result_ScoreRankEffect = TxC(RESULT + @"ScoreRankEffect.png"); + Result_Cloud = TxC(RESULT + @"Cloud.png"); + Result_Shine = TxC(RESULT + @"Shine.png"); + Result_Speech_Bubble = TxC(RESULT + @"Speech_Bubble.png"); + Result_Flower = TxC(RESULT + @"Flower\Flower.png"); + + for (int i = 1; i <= 5; i++) + Result_Flower_Rotate[i - 1] = TxC(RESULT + @"Flower\Rotate_" + i.ToString() + ".png"); + + for (int i = 0; i < 3; i++) + Result_Work[i] = TxC(RESULT + @"Work\" + i.ToString() + ".png"); + + + for (int i = 0; i < 41; i++) + Result_Rainbow[i] = TxC(RESULT + @"Rainbow\" + i.ToString() + ".png"); + + for (int i = 0; i < 2; i++) + Result_Background[i] = TxC(RESULT + @"Background_" + i.ToString() + ".png"); + + for (int i = 0; i < 2; i++) + Result_Mountain[i] = TxC(RESULT + @"Background_Mountain_" + i.ToString() + ".png"); + + for (int i = 0; i < 3; i++) + Result_Crown[i] = TxC(RESULT + @"Crown\Crown_" + i.ToString() + ".png"); + + for (int i = 0; i < Result_Donchan_Normal.Length; i++) + Result_Donchan_Normal[i] = TxC(RESULT + @"Result_Donchan_Normal\" + i.ToString() + ".png"); + + for (int i = 0; i < Result_Donchan_Clear.Length; i++) + Result_Donchan_Clear[i] = TxC(RESULT + @"Result_Donchan_Clear\" + i.ToString() + ".png"); + + for (int i = 0; i < Result_Donchan_Failed.Length; i++) + Result_Donchan_Failed[i] = TxC(RESULT + @"Result_Donchan_Failed\" + i.ToString() + ".png"); + + for (int i = 0; i < Result_Donchan_Failed_In.Length; i++) + Result_Donchan_Failed_In[i] = TxC(RESULT + @"Result_Donchan_Failed_In\" + i.ToString() + ".png"); + + #endregion + + #region 7_邨ゆコ逕サ髱「 + Exit_Background = TxC(EXIT + @"Background.png"); + #endregion + + } + + public void DisposeTexture() + { + foreach (var tex in listTexture) + { + var texture = tex; + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref texture); + texture?.Dispose(); + texture = null; + } + listTexture.Clear(); + } + + #region 蜈ア騾 + public CTexture Tile_Black, + Menu_Title, + Menu_Highlight, + Enum_Song, + Scanning_Loudness, + NamePlateBase, + Overlay, + Readme, + Network_Connection; + public CTexture[] NamePlate; + + public CTexture[] NamePlate_Effect = new CTexture[5]; + #endregion + #region 1_繧ソ繧、繝医Ν逕サ髱「 + public CTexture Title_Background, + Entry_Bar, + Entry_Bar_Text; + + public CTexture[] Banapas_Load = new CTexture[3]; + public CTexture[] Banapas_Load_Clear = new CTexture[2]; + public CTexture[] Banapas_Load_Failure = new CTexture[2]; + public CTexture[] Entry_Player = new CTexture[3]; + public CTexture[] Donchan_Entry = new CTexture[44]; + public CTexture[] Entry_Donchan_Normal = new CTexture[13]; + public CTexture[] ModeSelect_Bar = new CTexture[7]; + public CTexture[] ModeSelect_Bar_Chara = new CTexture[6]; + public CTexture[] ModeSelect_Bar_Text = new CTexture[6]; + #endregion + + #region 2_繧ウ繝ウ繝輔ぅ繧ー逕サ髱「 + public CTexture Config_Background, + Config_Header, + Config_Cursor, + Config_ItemBox, + Config_Arrow, + Config_KeyAssign, + Config_Font, + Config_Font_Bold, + Config_Enum_Song; + #endregion + + #region 3_驕ク譖イ逕サ髱「 + + public CTexture SongSelect_Background, + SongSelect_Header, + SongSelect_Auto, + SongSelect_Level, + SongSelect_Branch, + SongSelect_Branch_Text, + SongSelect_Frame_Score, + SongSelect_Frame_Box, + SongSelect_Frame_BackBox, + SongSelect_Frame_Random, + SongSelect_Bar_Center, + SongSelect_Bar_Genre_Back, + SongSelect_Bar_Genre_RecentryPlaySong, + SongSelect_Level_Number, + SongSelect_Bar_Select, + SongSelect_Bar_Genre_Overlay, + SongSelect_Credit, + SongSelect_Timer, + SongSelect_Crown, + SongSelect_ScoreRank, + SongSelect_Song_Number, + SongSelect_BoardNumber, + SongSelect_ScoreWindow_Text; + public CTexture[] SongSelect_GenreBack, + SongSelect_Bar_Genre, + SongSelect_Box_Chara, + SongSelect_ScoreWindow = new CTexture[(int)Difficulty.Total], + SongSelect_Donchan_Select = new CTexture[47], + SongSelect_Donchan_Normal = new CTexture[49], + SongSelect_Donchan_Jump = new CTexture[18], + SongSelect_NamePlate = new CTexture[1]; + + #region [ 髮」譏灘コヲ驕ク謚樒判髱「 ] + public CTexture Difficulty_Bar; + public CTexture Difficulty_Number; + public CTexture Difficulty_Star; + public CTexture Difficulty_Star_Red; + public CTexture Difficulty_Crown; + public CTexture Difficulty_Option; + public CTexture Difficulty_Option_Select; + + public CTexture[] Difficulty_Select_Bar = new CTexture[2]; + public CTexture[] Difficulty_Back; + #endregion + + #endregion + + #region 3_谿オ菴埼∈謚樒判髱「 + + public CTexture Dani_Background; + public CTexture Dani_Difficulty_Cymbol; + public CTexture Dani_Level_Number; + public CTexture Dani_Soul_Number; + public CTexture Dani_Exam_Number; + public CTexture Dani_Bar_Center; + + public CTexture[] Challenge_Select = new CTexture[2]; + + #endregion + + #region 4_隱ュ縺ソ霎シ縺ソ逕サ髱「 + public CTexture SongLoading_Plate, + SongLoading_Bg, + SongLoading_BgWait, + SongLoading_Chara, + SongLoading_Bg_Dan, + SongLoading_Fade; + #endregion + + #region 5_貍泌・冗判髱「 + #region 蜈ア騾 + public CTexture Notes, + Judge_Frame, + SENotes, + Notes_Arm, + ChipEffect, + ScoreRank, + Judge; + public CTexture Judge_Meter, + Bar, + Bar_Branch; + #endregion + #region 繧ュ繝」繝ゥ繧ッ繧ソ繝シ + public CTexture[] Chara_Normal, + Chara_Normal_Cleared, + Chara_Normal_Maxed, + Chara_GoGoTime, + Chara_GoGoTime_Maxed, + Chara_10Combo, + Chara_10Combo_Maxed, + Chara_GoGoStart, + Chara_GoGoStart_Maxed, + Chara_Become_Cleared, + Chara_Become_Maxed, + Chara_Balloon_Breaking, + Chara_Balloon_Broke, + Chara_Balloon_Miss; + #endregion + #region 雕翫j蟄 + public CTexture[][] Dancer; + #endregion + #region 繝「繝 + public CTexture[] Mob; + public CTexture Mob_Footer; + #endregion + #region 閭梧勹 + public CTexture Background, + Background_Down, + Background_Down_Clear, + Background_Down_Scroll; + public CTexture[] Background_Up_1st, + Background_Up_2nd, + Background_Up_3rd, + Background_Up_Dan = new CTexture[6]; + #endregion + #region 螟ェ鮠 + public CTexture[] Taiko_Frame, // MTaiko荳区聞縺 + Taiko_Background; + public CTexture Taiko_Base, + Taiko_Don_Left, + Taiko_Don_Right, + Taiko_Ka_Left, + Taiko_Ka_Right, + Taiko_LevelUp, + Taiko_LevelDown, + Taiko_Combo_Effect, + Taiko_Combo_Text; + public CTexture[] Couse_Symbol, // 繧ウ繝シ繧ケ繧キ繝ウ繝懊Ν + Taiko_PlayerNumber, + Taiko_NamePlate; // 繝阪シ繝繝励Ξ繝シ繝 + public CTexture[] Taiko_Score, + Taiko_Combo; + #endregion + #region 繧イ繝シ繧ク + public CTexture[] Gauge, + Gauge_Base, + Gauge_Line, + Gauge_Rainbow, + Gauge_Soul_Explosion; + public CTexture Gauge_Soul, + Gauge_Flash, + Gauge_Soul_Fire; + public CTexture[] Gauge_Dan; + public CTexture[] Gauge_Dan_Rainbow; + #endregion + #region 蜷ケ縺榊コ縺 + public CTexture[] Balloon_Combo; + public CTexture Balloon_Roll, + Balloon_Balloon, + Balloon_Number_Roll, + Balloon_Number_Combo/*,*/ + /*Balloon_Broken*/; + public CTexture[] Balloon_Breaking; + #endregion + #region 繧ィ繝輔ぉ繧ッ繝 + public CTexture Effects_Hit_Explosion, + Effects_Hit_Explosion_Big, + Effects_Fire, + Effects_Rainbow, + Effects_GoGoSplash, + Effects_Hit_FireWorks; + public CTexture[] Effects_Hit_Great, + Effects_Hit_Good, + Effects_Hit_Great_Big, + Effects_Hit_Good_Big; + public CTexture[] Effects_Roll; + #endregion + #region 繝ャ繝シ繝ウ + public CTexture[] Lane_Base, + Lane_Text; + public CTexture Lane_Red, + Lane_Blue, + Lane_Yellow; + public CTexture Lane_Background_Main, + Lane_Background_Sub, + Lane_Background_GoGo; + #endregion + #region 邨ゆコ貍泌コ + public CTexture End_Clear_Chara; + public CTexture[] End_Clear_Text; + public CTexture End_Star; + + public CTexture[] End_Clear_L, + End_Clear_R, + End_ClearFailed, + End_FullCombo, + End_FullComboLoop, + End_DondaFullCombo, + End_DondaFullComboLoop; + public CTexture End_Clear_Text_, + End_Clear_Text_Effect, + ClearFailed, + ClearFailed1, + ClearFailed2, + End_DondaFullComboBg; + #endregion + #region 繧イ繝シ繝繝「繝シ繝 + public CTexture GameMode_Timer_Frame, + GameMode_Timer_Tick; + #endregion + #region 繧ケ繝繝シ繧ク螟ア謨 + public CTexture Failed_Game, + Failed_Stage; + #endregion + #region 繝ゥ繝ウ繝翫シ + public CTexture Runner; + #endregion + #region DanC + public CTexture DanC_Background; + public CTexture[] DanC_Gauge; + public CTexture DanC_Base; + public CTexture DanC_Gauge_Base; + public CTexture DanC_Failed; + public CTexture DanC_Number, + DanC_Small_Number, + DanC_SmallBase, + DanC_ExamType, + DanC_ExamRange, + DanC_Small_ExamCymbol, + DanC_ExamCymbol, + DanC_MiniNumber, + DanC_ExamUnit; + public CTexture DanC_Screen; + #endregion + #region PuchiChara + public CTexture PuchiChara; + #endregion + #region Training + public CTexture Tokkun_DownBG, + Tokkun_BigTaiko, + Tokkun_ProgressBar, + Tokkun_ProgressBarWhite, + Tokkun_GoGoPoint, + Tokkun_JumpPoint, + Tokkun_Background_Up, + Tokkun_BigNumber, + Tokkun_SmallNumber, + Tokkun_Speed_Measure; + #endregion + #endregion + + #region 6_邨先棡逋コ陦ィ + public CTexture Result_FadeIn, + Result_Gauge, + Result_Gauge_Base, + Result_Header, + Result_Number, + Result_Panel, + Result_Soul_Text, + Result_Soul_Fire, + Result_Diff_Bar, + Result_Score_Number, + + Result_CrownEffect, + Result_ScoreRankEffect, + Result_Speech_Bubble, + Result_Cloud, + Result_Flower, + Result_Shine, + + Result_Dan; + + public CTexture[] + Result_Rainbow = new CTexture[41], + Result_Background = new CTexture[2], + Result_Crown = new CTexture[3], + Result_Donchan_Normal = new CTexture[28], + Result_Donchan_Clear = new CTexture[38], + Result_Donchan_Failed = new CTexture[29], + Result_Donchan_Failed_In = new CTexture[15], + + Result_Flower_Rotate = new CTexture[5], + Result_Work = new CTexture[3], + + Result_Mountain = new CTexture[2]; + #endregion + + #region 7_邨ゆコ逕サ髱「 + public CTexture Exit_Background/* , */ + /*Exit_Text */; + #endregion + + #region [ 隗」謾セ逕ィ ] + public List listTexture = new List(); + #endregion + } +} diff --git a/TJAPlayer3/Stages/02.Title/CActEnumSongs.cs b/TJAPlayer3/Stages/02.Title/CActEnumSongs.cs new file mode 100644 index 00000000..332a82c1 --- /dev/null +++ b/TJAPlayer3/Stages/02.Title/CActEnumSongs.cs @@ -0,0 +1,168 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.IO; +using System.Drawing; +using System.Threading; +using System.Globalization; +using System.Runtime.Serialization.Formatters.Binary; +using SlimDX; +using SlimDX.Direct3D9; +using FDK; +using SampleFramework; + +namespace TJAPlayer3 +{ + internal class CActEnumSongs : CActivity + { + public bool b繧ウ繝槭Φ繝峨〒縺ョ譖イ繝繝シ繧ソ蜿門セ; + + + /// + /// Constructor + /// + public CActEnumSongs() + { + Init( false ); + } + + public CActEnumSongs( bool _b繧ウ繝槭Φ繝峨〒縺ョ譖イ繝繝シ繧ソ蜿門セ ) + { + Init( _b繧ウ繝槭Φ繝峨〒縺ョ譖イ繝繝シ繧ソ蜿門セ ); + } + private void Init( bool _b繧ウ繝槭Φ繝峨〒縺ョ譖イ繝繝シ繧ソ蜿門セ ) + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + b繧ウ繝槭Φ繝峨〒縺ョ譖イ繝繝シ繧ソ蜿門セ = _b繧ウ繝槭Φ繝峨〒縺ョ譖イ繝繝シ繧ソ蜿門セ; + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + if ( this.b豢サ諤ァ蛹悶@縺ヲ繧 ) + return; + base.On豢サ諤ァ蛹(); + + try + { + this.ctNowEnumeratingSongs = new CCounter(); // 0, 1000, 17, CDTXMania.Timer ); + this.ctNowEnumeratingSongs.t髢句ァ( 0, 100, 17, TJAPlayer3.Timer ); + } + finally + { + } + } + public override void On髱樊エサ諤ァ蛹() + { + if ( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return; + base.On髱樊エサ諤ァ蛹(); + this.ctNowEnumeratingSongs = null; + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if ( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return; + //string pathNowEnumeratingSongs = CSkin.Path( @"Graphics\ScreenTitle NowEnumeratingSongs.png" ); + //if ( File.Exists( pathNowEnumeratingSongs ) ) + //{ + // this.txNowEnumeratingSongs = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( pathNowEnumeratingSongs, false ); + //} + //else + //{ + // this.txNowEnumeratingSongs = null; + //} + //string pathDialogNowEnumeratingSongs = CSkin.Path( @"Graphics\ScreenConfig NowEnumeratingSongs.png" ); + //if ( File.Exists( pathDialogNowEnumeratingSongs ) ) + //{ + // this.txDialogNowEnumeratingSongs = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( pathDialogNowEnumeratingSongs, false ); + //} + //else + //{ + // this.txDialogNowEnumeratingSongs = null; + //} + + try + { + System.Drawing.Font ftMessage = new System.Drawing.Font("MS UI Gothic", 40f, FontStyle.Bold, GraphicsUnit.Pixel ); + string[] strMessage = + { + " 譖イ繝繝シ繧ソ縺ョ荳隕ァ繧箪n 蜿門セ励@縺ヲ縺縺セ縺吶\n 縺励ー繧峨¥縺雁セ縺。縺上□縺輔>縲", + " Now enumerating songs.\n Please wait..." + }; + int ci = ( CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ja" ) ? 0 : 1; + if ( ( strMessage != null ) && ( strMessage.Length > 0 ) ) + { + Bitmap image = new Bitmap( 1, 1 ); + Graphics graphics = Graphics.FromImage( image ); + SizeF ef = graphics.MeasureString( strMessage[ ci ], ftMessage ); + Size size = new Size( (int) Math.Ceiling( (double) ef.Width ), (int) Math.Ceiling( (double) ef.Height ) ); + graphics.Dispose(); + image.Dispose(); + image = new Bitmap( size.Width, size.Height ); + graphics = Graphics.FromImage( image ); + graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; + graphics.DrawString( strMessage[ ci ], ftMessage, Brushes.White, (float) 0f, (float) 0f ); + graphics.Dispose(); + this.txMessage = new CTexture( TJAPlayer3.app.Device, image, TJAPlayer3.TextureFormat ); + this.txMessage.vc諡。螟ァ邵ョ蟆丞咲紫 = new Vector3( 0.5f, 0.5f, 1f ); + image.Dispose(); + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k( ref ftMessage ); + } + else + { + this.txMessage = null; + } + } + catch ( CTextureCreateFailedException e ) + { + Trace.TraceError( "繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲(txMessage)" ); + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (761b726d-d27c-470d-be0b-a702971601b5)" ); + this.txMessage = null; + } + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if ( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return; + + //CDTXMania.t螳牙ィ縺ォDispose縺吶k( ref this.txDialogNowEnumeratingSongs ); + //CDTXMania.t螳牙ィ縺ォDispose縺吶k( ref this.txNowEnumeratingSongs ); + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k( ref this.txMessage ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + public override int On騾イ陦梧緒逕サ() + { + if ( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + return 0; + } + this.ctNowEnumeratingSongs.t騾イ陦鍬oop(); + if ( TJAPlayer3.Tx.Enum_Song != null ) + { + TJAPlayer3.Tx.Enum_Song.Opacity = (int) ( 176.0 + 80.0 * Math.Sin( (double) (2 * Math.PI * this.ctNowEnumeratingSongs.n迴セ蝨ィ縺ョ蛟、 * 2 / 100.0 ) ) ); + TJAPlayer3.Tx.Enum_Song.t2D謠冗判( TJAPlayer3.app.Device, 18, 7 ); + } + if ( b繧ウ繝槭Φ繝峨〒縺ョ譖イ繝繝シ繧ソ蜿門セ && TJAPlayer3.Tx.Config_Enum_Song != null ) + { + TJAPlayer3.Tx.Config_Enum_Song.t2D謠冗判( TJAPlayer3.app.Device, 180, 177 ); + this.txMessage.t2D謠冗判( TJAPlayer3.app.Device, 190, 197 ); + } + + return 0; + } + + + private CCounter ctNowEnumeratingSongs; + //private CTexture txNowEnumeratingSongs = null; + //private CTexture txDialogNowEnumeratingSongs = null; + private CTexture txMessage; + } +} diff --git a/TJAPlayer3/Stages/02.Title/CActScanningLoudness.cs b/TJAPlayer3/Stages/02.Title/CActScanningLoudness.cs new file mode 100644 index 00000000..a77bfc7e --- /dev/null +++ b/TJAPlayer3/Stages/02.Title/CActScanningLoudness.cs @@ -0,0 +1,54 @@ +サソusing System; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActScanningLoudness : CActivity + { + public bool bIsActivelyScanning; + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + if ( this.b豢サ諤ァ蛹悶@縺ヲ繧 ) + return; + base.On豢サ諤ァ蛹(); + + try + { + this.ctNowScanningLoudness = new CCounter(); + this.ctNowScanningLoudness.t髢句ァ( 0, 200, 29, TJAPlayer3.Timer ); + } + finally + { + } + } + + public override void On髱樊エサ諤ァ蛹() + { + if ( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return; + base.On髱樊エサ諤ァ蛹(); + this.ctNowScanningLoudness = null; + } + + public override int On騾イ陦梧緒逕サ() + { + if ( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + return 0; + } + this.ctNowScanningLoudness.t騾イ陦鍬oop(); + if ( bIsActivelyScanning && TJAPlayer3.Tx.Scanning_Loudness != null ) + { + TJAPlayer3.Tx.Scanning_Loudness.Opacity = (int) ( 176.0 + 80.0 * Math.Sin( (double) (2 * Math.PI * this.ctNowScanningLoudness.n迴セ蝨ィ縺ョ蛟、 / 100.0 ) ) ); + TJAPlayer3.Tx.Scanning_Loudness.t2D謠冗判( TJAPlayer3.app.Device, 18 + 89 + 18, 7 ); // 2018-09-03 twopointzero: display right of Enum_Song, using its width and margin + } + + return 0; + } + + private CCounter ctNowScanningLoudness; + } +} diff --git a/TJAPlayer3/Stages/02.Title/CEnumSongs.cs b/TJAPlayer3/Stages/02.Title/CEnumSongs.cs new file mode 100644 index 00000000..7e0a3ce4 --- /dev/null +++ b/TJAPlayer3/Stages/02.Title/CEnumSongs.cs @@ -0,0 +1,594 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.IO; +using System.Threading; +using System.Runtime.Serialization.Formatters.Binary; +using SlimDX; +using SlimDX.Direct3D9; +using FDK; +using SampleFramework; + +namespace TJAPlayer3 +{ + internal class CEnumSongs // #27060 2011.2.7 yyagi 譖イ繝ェ繧ケ繝医r蜿門セ励☆繧九け繝ゥ繧ケ + { // 繝輔ぃ繧、繝ォ繧ュ繝」繝繧キ繝・(songslist.db)縺九i縺ョ蜿門セ励→縲√ョ繧」繧ケ繧ッ縺九i縺ョ蜿門セ励r縲√%縺ョ荳縺、縺ョ繧ッ繝ゥ繧ケ縺ォ髮邏縲 + + public CSongs邂。逅 Songs邂。逅 // 譖イ縺ョ謗「邏「邨先棡縺ッ縺薙ョSongs邂。逅縺ォ隱ュ縺ソ霎シ縺セ繧後k + { + get; + private set; + } + + public bool IsSongListEnumCompletelyDone // 譖イ繝ェ繧ケ繝域爾邏「縺ィ縲∝ョ滄圀縺ョ譖イ繝ェ繧ケ繝医∈縺ョ蜿肴丐縺悟ョ御コ縺励◆シ + { + get + { + return ( this.state == DTXEnumState.CompletelyDone ); + } + } + public bool IsEnumerating + { + get + { + if ( thDTXFileEnumerate == null ) + { + return false; + } + return thDTXFileEnumerate.IsAlive; + } + } + public bool IsSongListEnumerated // 譖イ繝ェ繧ケ繝域爾邏「縺悟ョ御コ縺励◆縺後∝ョ滄圀縺ョ譖イ繝ェ繧ケ繝医∈縺ョ蜿肴丐縺ッ縺セ縺シ + { + get + { + return ( this.state == DTXEnumState.Enumeratad ); + } + } + public bool IsSongListEnumStarted // 譖イ繝ェ繧ケ繝域爾邏「髢句ァ句セ鯉シ(謗「邏「螳御コ繧ょ性繧) + { + get + { + return ( this.state != DTXEnumState.None ); + } + } + public void SongListEnumCompletelyDone() + { + this.state = DTXEnumState.CompletelyDone; + this.Songs邂。逅 = null; // GC縺ッOS縺ォ莉サ縺帙k + } + public bool IsSlowdown // #PREMOVIE蜀咲函荳ュ縺ッ讀懃エ「雋闕キ繧定誠縺ィ縺 + { + get + { + return this.Songs邂。逅.bIsSlowdown; + } + set + { + this.Songs邂。逅.bIsSlowdown = value; + } + } + + public void ChangeEnumeratePriority( ThreadPriority tp ) + { + if ( this.thDTXFileEnumerate != null && this.thDTXFileEnumerate.IsAlive == true ) + { + this.thDTXFileEnumerate.Priority = tp; + } + } + private readonly string strPathSongsDB = TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 + "songs.db"; + private readonly string strPathSongList = TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 + "songlist.db"; + + public Thread thDTXFileEnumerate + { + get; + private set; + } + private enum DTXEnumState + { + None, + Ongoing, + Suspended, + Enumeratad, // 謗「邏「螳御コ縲∫樟蝨ィ縺ョ譖イ繝ェ繧ケ繝医↓譛ェ蜿肴丐 + CompletelyDone // 謗「邏「螳御コ縲∫樟蝨ィ縺ョ譖イ繝ェ繧ケ繝医↓蜿肴丐螳御コ + } + private DTXEnumState state = DTXEnumState.None; + + + /// + /// Constractor + /// + public CEnumSongs() + { + this.Songs邂。逅 = new CSongs邂。逅(); + } + + public void Init() + { + + } + + /// + /// 譖イ繝ェ繧ケ繝医ョ繧ュ繝」繝繧キ繝・(songlist.db)蜿門セ励せ繝ャ繝繝峨ョ髢句ァ + /// + public void StartEnumFromCache() + { + this.thDTXFileEnumerate = new Thread( new ThreadStart( this.t譖イ繝ェ繧ケ繝医ョ讒狗ッ1 ) ); + this.thDTXFileEnumerate.Name = "譖イ繝ェ繧ケ繝医ョ讒狗ッ"; + this.thDTXFileEnumerate.IsBackground = true; + this.thDTXFileEnumerate.Start(); + } + + /// + /// + /// + public delegate void AsyncDelegate(); + + /// + /// 譖イ讀懃エ「繧ケ繝ャ繝繝峨ョ髢句ァ + /// + public void StartEnumFromDisk() + { + if ( state == DTXEnumState.None || state == DTXEnumState.CompletelyDone ) + { + Trace.TraceInformation( "笘譖イ繝繝シ繧ソ讀懃エ「繧ケ繝ャ繝繝峨r襍キ蜍輔@縺セ縺励◆縲" ); + lock ( this ) + { + state = DTXEnumState.Ongoing; + } + // this.autoReset = new AutoResetEvent( true ); + + if ( this.Songs邂。逅 == null ) // Enumerating Songs螳御コ蠕後,ONFIG逕サ髱「縺九i蜀阪せ繧ュ繝」繝ウ縺励◆縺ィ縺阪↓縺薙≧縺ェ繧 + { + this.Songs邂。逅 = new CSongs邂。逅(); + } + this.thDTXFileEnumerate = new Thread( new ThreadStart( this.t譖イ繝ェ繧ケ繝医ョ讒狗ッ2 ) ); + this.thDTXFileEnumerate.Name = "譖イ繝ェ繧ケ繝医ョ讒狗ッ"; + this.thDTXFileEnumerate.IsBackground = true; + this.thDTXFileEnumerate.Priority = System.Threading.ThreadPriority.Lowest; + this.thDTXFileEnumerate.Start(); + } + } + + + /// + /// 譖イ謗「邏「繧ケ繝ャ繝繝峨ョ繧オ繧ケ繝壹Φ繝 + /// + public void Suspend() + { + if ( this.state != DTXEnumState.CompletelyDone && + ( ( thDTXFileEnumerate.ThreadState & ( System.Threading.ThreadState.Background ) ) != 0 ) ) + { + // this.thDTXFileEnumerate.Suspend(); // obsolete縺ォ縺、縺堺スソ逕ィ荳ュ豁「 + this.Songs邂。逅.bIsSuspending = true; + this.state = DTXEnumState.Suspended; + Trace.TraceInformation( "笘譖イ繝繝シ繧ソ讀懃エ「繧ケ繝ャ繝繝峨r荳ュ譁ュ縺励∪縺励◆縲" ); + } + } + + /// + /// 譖イ謗「邏「繧ケ繝ャ繝繝峨ョ繝ャ繧ク繝・繝シ繝 + /// + public void Resume() + { + if ( this.state == DTXEnumState.Suspended ) + { + if ( ( this.thDTXFileEnumerate.ThreadState & ( System.Threading.ThreadState.WaitSleepJoin | System.Threading.ThreadState.StopRequested ) ) != 0 ) // + { + // this.thDTXFileEnumerate.Resume(); // obsolete縺ォ縺、縺堺スソ逕ィ荳ュ豁「 + this.Songs邂。逅.bIsSuspending = false; + this.Songs邂。逅.AutoReset.Set(); + this.state = DTXEnumState.Ongoing; + Trace.TraceInformation( "笘譖イ繝繝シ繧ソ讀懃エ「繧ケ繝ャ繝繝峨r蜀埼幕縺励∪縺励◆縲" ); + } + } + } + + /// + /// 譖イ謗「邏「繧ケ繝ャ繝繝峨↓繧オ繧ケ繝壹Φ繝画欠遉コ繧貞コ縺励※縺九i縲∵悽蠖薙↓繧オ繧ケ繝壹Φ繝臥憾諷九↓驕キ遘サ縺吶k縺セ縺ァ縺ョ髢薙√ヶ繝ュ繝繧ッ縺吶k + /// 500ms * 10蝗橸シ5遘偵〒繧ソ繧、繝繧「繧ヲ繝医@縲√し繧ケ繝壹Φ繝牙ョ御コ縺励※辟。縺上※繧ゅヶ繝ュ繝繧ッ隗」髯、縺吶k + /// + public void WaitUntilSuspended() + { + // 譖イ讀懃エ「縺御ク譎ゆクュ譁ュ縺輔l繧九∪縺ァ蠕讖 + for ( int i = 0; i < 10; i++ ) + { + if ( this.state == DTXEnumState.CompletelyDone || + ( thDTXFileEnumerate.ThreadState & ( System.Threading.ThreadState.WaitSleepJoin | System.Threading.ThreadState.Background | System.Threading.ThreadState.Stopped ) ) != 0 ) + { + break; + } + Trace.TraceInformation( "笘譖イ繝繝シ繧ソ讀懃エ「繧ケ繝ャ繝繝峨ョ荳ュ譁ュ蠕縺。縺ァ縺: {0}", this.thDTXFileEnumerate.ThreadState.ToString() ); + Thread.Sleep( 500 ); + } + + } + + /// + /// 譖イ謗「邏「繧ケ繝ャ繝繝峨r蠑キ蛻カ邨ゆコ縺吶k + /// + public void Abort() + { + if ( thDTXFileEnumerate != null ) + { + thDTXFileEnumerate.Abort(); + thDTXFileEnumerate = null; + this.state = DTXEnumState.None; + + this.Songs邂。逅 = null; // Songs邂。逅繧貞榊晄悄蛹悶☆繧 (騾比クュ縺セ縺ァ菴懊▲縺滓峇繝ェ繧ケ繝医ョ譛蠕後↓縲∽ク縺九i驥崎、縺励※霑ス險倥☆繧九%縺ィ縺ォ縺ェ繧峨↑縺繧医≧縺ォ縺吶k縲) + this.Songs邂。逅 = new CSongs邂。逅(); + } + } + + + + /// + /// songlist.db縺九i縺ョ譖イ繝ェ繧ケ繝域ァ狗ッ + /// + public void t譖イ繝ェ繧ケ繝医ョ讒狗ッ1() + { + // シ∵ウィ諢擾シ + // 譛ャ繝。繧ス繝繝峨ッ蛻・繧ケ繝ャ繝繝峨〒蜍穂ス懊☆繧九′縲√励Λ繧ー繧、繝ウ蛛エ縺ァ繧ォ繝ャ繝ウ繝医ョ繧」繝ャ繧ッ繝医Μ繧貞、画峩縺励※繧ょ、ァ荳亥、ォ縺ェ繧医≧縺ォ縲 + // 縺吶∋縺ヲ縺ョ繝輔ぃ繧、繝ォ繧「繧ッ繧サ繧ケ縺ッ縲檎オカ蟇セ繝代せ縲阪〒陦後≧縺薙→縲(2010.9.16) + // 讒狗ッ峨′螳御コ縺励◆繧峨.TXEnumerateState state 繧 DTXEnumerateState.Done 縺ォ縺吶k縺薙→縲(2012.2.9) + DateTime now = DateTime.Now; + + try + { + #region [ 0) 繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨ョ讒狗ッ ] + //----------------------------- + TJAPlayer3.stage襍キ蜍.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.襍キ蜍0_繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨r讒狗ッ; + + Trace.TraceInformation( "0) 繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨r讒狗ッ峨@縺セ縺吶" ); + Trace.Indent(); + + try + { + TJAPlayer3.Skin.bgm襍キ蜍慕判髱「.t蜀咲函縺吶k(); + for ( int i = 0; i < TJAPlayer3.Skin.n繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝画焚; i++ ) + { + if ( !TJAPlayer3.Skin[ i ].b謗剃サ ) // BGM邉サ莉・螟悶ョ縺ソ隱ュ縺ソ霎シ繧縲(BGM邉サ縺ッ蠢隕√↓縺ェ縺」縺溘→縺阪↓隱ュ縺ソ霎シ繧) + { + CSkin.C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 = TJAPlayer3.Skin[ i ]; + if ( !TJAPlayer3.b繧ウ繝ウ繝代け繝医Δ繝シ繝 || c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.bCompact蟇セ雎。 ) + { + try + { + c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.t隱ュ縺ソ霎シ縺ソ(); + Trace.TraceInformation( "繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨r隱ュ縺ソ霎シ縺ソ縺セ縺励◆縲({0})", c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.str繝輔ぃ繧、繝ォ蜷 ); + //if ( ( c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝 == CDTXMania.Skin.bgm襍キ蜍慕判髱「 ) && c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.b隱ュ縺ソ霎シ縺ソ謌仙粥 ) + //{ + // c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.t蜀咲函縺吶k(); + //} + } + catch ( FileNotFoundException ) + { + Trace.TraceWarning( "繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨′蟄伜惠縺励∪縺帙s縲({0})", c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.str繝輔ぃ繧、繝ォ蜷 ); + } + catch ( Exception e ) + { + Trace.TraceWarning( e.ToString() ); + Trace.TraceWarning( "繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨ョ隱ュ縺ソ霎シ縺ソ縺ォ螟ア謨励@縺セ縺励◆縲({0})", c繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.str繝輔ぃ繧、繝ォ蜷 ); + } + } + } + } + lock ( TJAPlayer3.stage襍キ蜍.list騾イ陦梧枚蟄怜 ) + { + TJAPlayer3.stage襍キ蜍.list騾イ陦梧枚蟄怜.Add( "SYSTEM SOUND...OK" ); + } + } + finally + { + Trace.Unindent(); + } + //----------------------------- + #endregion + + if ( TJAPlayer3.b繧ウ繝ウ繝代け繝医Δ繝シ繝 ) + { + Trace.TraceInformation( "繧ウ繝ウ繝代け繝医Δ繝シ繝峨↑縺ョ縺ァ谿九j縺ョ襍キ蜍募ヲ逅縺ッ逵∫払縺励∪縺吶" ); + return; + } + + #region [ 00) songlist.db縺ョ隱ュ縺ソ霎シ縺ソ縺ォ繧医k譖イ繝ェ繧ケ繝医ョ讒狗ッ ] + //----------------------------- + TJAPlayer3.stage襍キ蜍.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.襍キ蜍00_songlist縺九i譖イ繝ェ繧ケ繝医r菴懈舌☆繧; + + Trace.TraceInformation( "1) songlist.db繧定ェュ縺ソ霎シ縺ソ縺セ縺吶" ); + Trace.Indent(); + + try + { + if ( !TJAPlayer3.ConfigIni.bConfigIni縺後↑縺縺汽TXMania縺ョ繝舌シ繧ク繝ァ繝ウ縺檎焚縺ェ繧 ) + { + CSongs邂。逅 s = new CSongs邂。逅(); + s = Deserialize( strPathSongList ); // 逶エ謗・this.Songs邂。逅縺ォdeserialize()邨先棡繧剃サ」蜈・縺吶k縺ョ縺ッ驕ソ縺代k縲Oull縺ォ縺輔l縺ヲ縺励∪縺縺薙→縺後≠繧九◆繧√ + if ( s != null ) + { + this.Songs邂。逅 = s; + } + + int scores = this.Songs邂。逅.n讀懃エ「縺輔l縺溘せ繧ウ繧「謨ー; + Trace.TraceInformation( "songlist.db 縺ョ隱ュ縺ソ霎シ縺ソ繧貞ョ御コ縺励∪縺励◆縲[{0}繧ケ繧ウ繧「]", scores ); + lock ( TJAPlayer3.stage襍キ蜍.list騾イ陦梧枚蟄怜 ) + { + TJAPlayer3.stage襍キ蜍.list騾イ陦梧枚蟄怜.Add( "SONG LIST...OK" ); + } + } + else + { + Trace.TraceInformation( "蛻晏屓縺ョ襍キ蜍輔〒縺ゅk縺九∪縺溘ッDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ縺御ク翫′縺」縺溘◆繧√《onglist.db 縺ョ隱ュ縺ソ霎シ縺ソ繧偵せ繧ュ繝繝励@縺セ縺吶" ); + lock ( TJAPlayer3.stage襍キ蜍.list騾イ陦梧枚蟄怜 ) + { + TJAPlayer3.stage襍キ蜍.list騾イ陦梧枚蟄怜.Add( "SONG LIST...SKIPPED" ); + } + } + } + finally + { + Trace.Unindent(); + } + + #endregion + } + finally + { + TJAPlayer3.stage襍キ蜍.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.襍キ蜍廟繝繧ッ繧ケ繝√Ε縺ョ隱ュ縺ソ霎シ縺ソ; + TimeSpan span = (TimeSpan) ( DateTime.Now - now ); + Trace.TraceInformation( "襍キ蜍墓園隕∵凾髢: {0}", span.ToString() ); + lock ( this ) // #28700 2012.6.12 yyagi; state change must be in finally{} for exiting as of compact mode. + { + state = DTXEnumState.CompletelyDone; + } + } + } + + + /// + /// 襍キ蜍輔@縺ヲ繧ソ繧、繝医Ν逕サ髱「縺ォ驕キ遘サ縺励◆蠕後↓繝舌ャ繧ッ繧ー繝ゥ繧ヲ繝ウ繝峨〒逋コ逕溘&縺帙k譖イ讀懃エ「 + /// #27060 2012.2.6 yyagi + /// + private void t譖イ繝ェ繧ケ繝医ョ讒狗ッ2() + { + // シ∵ウィ諢擾シ + // 譛ャ繝。繧ス繝繝峨ッ蛻・繧ケ繝ャ繝繝峨〒蜍穂ス懊☆繧九′縲√励Λ繧ー繧、繝ウ蛛エ縺ァ繧ォ繝ャ繝ウ繝医ョ繧」繝ャ繧ッ繝医Μ繧貞、画峩縺励※繧ょ、ァ荳亥、ォ縺ェ繧医≧縺ォ縲 + // 縺吶∋縺ヲ縺ョ繝輔ぃ繧、繝ォ繧「繧ッ繧サ繧ケ縺ッ縲檎オカ蟇セ繝代せ縲阪〒陦後≧縺薙→縲(2010.9.16) + // 讒狗ッ峨′螳御コ縺励◆繧峨.TXEnumerateState state 繧 DTXEnumerateState.Done 縺ォ縺吶k縺薙→縲(2012.2.9) + + DateTime now = DateTime.Now; + + try + { + + #region [ 2) 譖イ繝繝シ繧ソ縺ョ讀懃エ「 ] + //----------------------------- + // base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.襍キ蜍2_譖イ繧呈、懃エ「縺励※繝ェ繧ケ繝医r菴懈舌☆繧; + + Trace.TraceInformation( "enum2) 譖イ繝繝シ繧ソ繧呈、懃エ「縺励∪縺吶" ); + Trace.Indent(); + + try + { + if ( !string.IsNullOrEmpty( TJAPlayer3.ConfigIni.str譖イ繝繝シ繧ソ讀懃エ「繝代せ ) ) + { + string[] strArray = TJAPlayer3.ConfigIni.str譖イ繝繝シ繧ソ讀懃エ「繝代せ.Split( new char[] { ';' } ); + if ( strArray.Length > 0 ) + { + // 蜈ィ繝代せ縺ォ縺、縺縺ヲ窶ヲ + foreach ( string str in strArray ) + { + string path = str; + if ( !Path.IsPathRooted( path ) ) + { + path = TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 + str; // 逶ク蟇セ繝代せ縺ョ蝣エ蜷医∫オカ蟇セ繝代せ縺ォ逶エ縺(2010.9.16) + } + + if ( !string.IsNullOrEmpty( path ) ) + { + Trace.TraceInformation( "讀懃エ「繝代せ: " + path ); + Trace.Indent(); + + try + { + this.Songs邂。逅.t譖イ繧呈、懃エ「縺励※繝ェ繧ケ繝医r菴懈舌☆繧(path, true); + } + catch ( Exception e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (105fd674-e722-4a4e-bd9a-e6f82ac0b1d3)" ); + } + finally + { + Trace.Unindent(); + } + } + } + } + } + else + { + Trace.TraceWarning( "譖イ繝繝シ繧ソ縺ョ讀懃エ「繝代せ(TJAPath)縺ョ謖螳壹′縺ゅj縺セ縺帙s縲" ); + } + } + finally + { + Trace.TraceInformation( "譖イ繝繝シ繧ソ縺ョ讀懃エ「繧貞ョ御コ縺励∪縺励◆縲[{0}譖イ{1}繧ケ繧ウ繧「]", this.Songs邂。逅.n讀懃エ「縺輔l縺滓峇繝弱シ繝画焚, this.Songs邂。逅.n讀懃エ「縺輔l縺溘せ繧ウ繧「謨ー ); + Trace.Unindent(); + } + // lock ( this.list騾イ陦梧枚蟄怜 ) + // { + // this.list騾イ陦梧枚蟄怜.Add( string.Format( "{0} ... {1} scores ({2} songs)", "Enumerating songs", this..Songs邂。逅_陬剰ェュ.n讀懃エ「縺輔l縺溘せ繧ウ繧「謨ー, this.Songs邂。逅_陬剰ェュ.n讀懃エ「縺輔l縺滓峇繝弱シ繝画焚 ) ); + // } + //----------------------------- + #endregion + #region [ 4) songs.db 縺ォ縺ェ縺九▲縺滓峇繝繝シ繧ソ繧偵ヵ繧。繧、繝ォ縺九i隱ュ縺ソ霎シ繧薙〒蜿肴丐 ] + //----------------------------- + // base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.襍キ蜍4_繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・縺ォ縺ェ縺九▲縺滓峇繧偵ヵ繧。繧、繝ォ縺九i隱ュ縺ソ霎シ繧薙〒蜿肴丐縺吶k; + + int num2 = this.Songs邂。逅.n讀懃エ「縺輔l縺溘せ繧ウ繧「謨ー - this.Songs邂。逅.n繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・縺九i蜿肴丐縺ァ縺阪◆繧ケ繧ウ繧「謨ー; + + Trace.TraceInformation( "{0}, {1}", this.Songs邂。逅.n讀懃エ「縺輔l縺溘せ繧ウ繧「謨ー, this.Songs邂。逅.n繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・縺九i蜿肴丐縺ァ縺阪◆繧ケ繧ウ繧「謨ー ); + Trace.TraceInformation( "enum4) songs.db 縺ォ縺ェ縺九▲縺滓峇繝繝シ繧ソ[{0}繧ケ繧ウ繧「]縺ョ諠蝣ア繧偵ヵ繧。繧、繝ォ縺九i隱ュ縺ソ霎シ繧薙〒蜿肴丐縺励∪縺吶", num2 ); + Trace.Indent(); + + try + { + this.Songs邂。逅.tSongsDB縺ォ縺ェ縺九▲縺滓峇繧偵ヵ繧。繧、繝ォ縺九i隱ュ縺ソ霎シ繧薙〒蜿肴丐縺吶k(); + } + catch ( Exception e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (276bb40f-6406-40c1-9f03-e2a9869dbc88)" ); + } + finally + { + Trace.TraceInformation( "譖イ繝繝シ繧ソ縺ク縺ョ蜿肴丐繧貞ョ御コ縺励∪縺励◆縲[{0}/{1}繧ケ繧ウ繧「]", this.Songs邂。逅.n繝輔ぃ繧、繝ォ縺九i蜿肴丐縺ァ縺阪◆繧ケ繧ウ繧「謨ー, num2 ); + Trace.Unindent(); + } + // lock ( this.list騾イ陦梧枚蟄怜 ) + // { + // this.list騾イ陦梧枚蟄怜.Add( string.Format( "{0} ... {1}/{2}", "Loading score properties from files", CDTXMania.Songs邂。逅_陬剰ェュ.n繝輔ぃ繧、繝ォ縺九i蜿肴丐縺ァ縺阪◆繧ケ繧ウ繧「謨ー, CDTXMania.Songs邂。逅_陬剰ェュ.n讀懃エ「縺輔l縺溘せ繧ウ繧「謨ー - cs.n繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・縺九i蜿肴丐縺ァ縺阪◆繧ケ繧ウ繧「謨ー ) ); + // } + //----------------------------- + #endregion + #region [ 5) 譖イ繝ェ繧ケ繝医∈縺ョ蠕悟ヲ逅縺ョ驕ゥ逕ィ ] + //----------------------------- + // base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.襍キ蜍5_譖イ繝ェ繧ケ繝医∈蠕悟ヲ逅繧帝←逕ィ縺吶k; + + Trace.TraceInformation( "enum5) 譖イ繝ェ繧ケ繝医∈縺ョ蠕悟ヲ逅繧帝←逕ィ縺励∪縺吶" ); + Trace.Indent(); + + try + { + this.Songs邂。逅.t譖イ繝ェ繧ケ繝医∈蠕悟ヲ逅繧帝←逕ィ縺吶k(); + } + catch ( Exception e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (6480ffa0-1cc1-40d4-9cc9-aceeecd0264b)" ); + } + finally + { + Trace.TraceInformation( "譖イ繝ェ繧ケ繝医∈縺ョ蠕悟ヲ逅繧貞ョ御コ縺励∪縺励◆縲" ); + Trace.Unindent(); + } + // lock ( this.list騾イ陦梧枚蟄怜 ) + // { + // this.list騾イ陦梧枚蟄怜.Add( string.Format( "{0} ... OK", "Building songlists" ) ); + // } + //----------------------------- + #endregion + + // if ( !bSucceededFastBoot ) // songs2.db隱ュ縺ソ霎シ縺ソ縺ォ謌仙粥縺励◆縺ェ繧峨《ongs2.db繧呈眠縺溘↓菴懊i縺ェ縺 + #region [ 7) songs2.db 縺ク縺ョ菫晏ュ ] // #27060 2012.1.26 yyagi + Trace.TraceInformation( "enum7) 譖イ繝繝シ繧ソ縺ョ諠蝣ア繧 songlist.db 縺ク蜃コ蜉帙@縺セ縺吶" ); + Trace.Indent(); + + SerializeSongList( this.Songs邂。逅, strPathSongList ); + Trace.TraceInformation("songlist.db 縺ク縺ョ蜃コ蜉帙r螳御コ縺励∪縺励◆縲"); + Trace.Unindent(); + //----------------------------- + #endregion + // } + + } + finally + { + // base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.襍キ蜍7_螳御コ; + TimeSpan span = (TimeSpan) ( DateTime.Now - now ); + Trace.TraceInformation( "譖イ謗「邏「謇隕∵凾髢: {0}", span.ToString() ); + } + lock ( this ) + { + // state = DTXEnumState.Done; // Done縺ォ縺吶k縺ョ縺ッCDTXMania.cs蛛エ縺ォ縺ヲ縲 + state = DTXEnumState.Enumeratad; + } + } + + + + /// + /// 譖イ繝ェ繧ケ繝医ョserialize + /// + private static void SerializeSongList( CSongs邂。逅 cs, string strPathSongList ) + { + bool bSucceededSerialize = true; + Stream output = null; + try + { + output = File.Create( strPathSongList ); + BinaryFormatter formatter = new BinaryFormatter(); + formatter.Serialize( output, cs ); + } + catch ( Exception e ) + { + bSucceededSerialize = false; + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (9ad477a4-d922-412c-b87d-e3a49a608e92)" ); + } + finally + { + output.Close(); + if ( !bSucceededSerialize ) + { + try + { + File.Delete( strPathSongList ); // serialize縺ォ螟ア謨励@縺溘i縲《ongs2.db繝輔ぃ繧、繝ォ繧呈カ医@縺ヲ縺翫¥ + } + catch ( Exception e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (62860c67-b44f-46f4-b4fc-999c6fe18cce)" ); + } + } + } + } + + /// + /// 譖イ繝ェ繧ケ繝医ョdeserialize + /// + /// + /// + private CSongs邂。逅 Deserialize( string strPathSongList ) + { + try + { + #region [ SongListDB(songlist.db)繧定ェュ縺ソ霎シ繧 ] + + if (!File.Exists(strPathSongList)) + { + return null; + } + + // byte[] buf = File.ReadAllBytes( SongListDB繝輔ぃ繧、繝ォ蜷 ); // 荳譌ヲ繝。繝「繝ェ縺ォ縺セ縺ィ繧∬ェュ縺ソ縺励※縺九ideserialize縺励◆譁ケ縺碁ォ倬溘°縺ィ諤昴▲縺溘i蜈ィ縺丞、峨o繧峨↑縺九▲縺溘ョ縺ァ蜑企勁 + // using ( MemoryStream input = new MemoryStream(buf, false) ) + using ( Stream input = File.OpenRead( strPathSongList ) ) + { + try + { + BinaryFormatter formatter = new BinaryFormatter(); + return (CSongs邂。逅) formatter.Deserialize( input ); + } + catch ( Exception e ) + { + // songs邂。逅 = null; + + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (a4289e34-7140-4b67-b821-3b5370a725e1)" ); + } + } + #endregion + } + catch (Exception e) + { + Trace.TraceError( "songlist.db 縺ョ隱ュ縺ソ霎シ縺ソ縺ォ螟ア謨励@縺セ縺励◆縲" ); + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (5a907ed2-f849-4bc4-acd0-d2a6aa3c9c87)" ); + } + return null; + } + } +} diff --git a/TJAPlayer3/Stages/02.Title/CStage繧ソ繧、繝医Ν.cs b/TJAPlayer3/Stages/02.Title/CStage繧ソ繧、繝医Ν.cs new file mode 100644 index 00000000..6b1478e1 --- /dev/null +++ b/TJAPlayer3/Stages/02.Title/CStage繧ソ繧、繝医Ν.cs @@ -0,0 +1,758 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Diagnostics; +using System.Drawing; +using FDK; +using System.Reflection; + +namespace TJAPlayer3 +{ + internal class CStage繧ソ繧、繝医Ν : CStage + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CStage繧ソ繧、繝医Ν() + { + base.e繧ケ繝繝シ繧クID = CStage.E繧ケ繝繝シ繧ク.繧ソ繧、繝医Ν; + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + base.list蟄植ctivities.Add( this.actFIfromSetup = new CActFIFOBlack() ); + base.list蟄植ctivities.Add( this.actFI = new CActFIFOBlack() ); + base.list蟄植ctivities.Add( this.actFO = new CActFIFOBlack() ); + + } + + + // CStage 螳溯」 + + public override void On豢サ諤ァ蛹() + { + Trace.TraceInformation( "繧ソ繧、繝医Ν繧ケ繝繝シ繧ク繧呈エサ諤ァ蛹悶@縺セ縺吶" ); + Trace.Indent(); + try + { + this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ蠕讖 = new CCounter(); + + this.ct繧ウ繧、繝ウ繧、繝ウ蠕讖 = new CCounter(0, 2000, 1, TJAPlayer3.Timer); + + this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥 = new CCounter(); + this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ螟ア謨 = new CCounter(); + + this.ct繧ィ繝ウ繝医Μ繝シ繝舌シ轤ケ貊 = new CCounter(0, 510, 2, TJAPlayer3.Timer); + this.ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊 = new CCounter(); + + this.ct縺ゥ繧薙■繧繧薙お繝ウ繝医Μ繝シ繝ォ繝シ繝 = new CCounter(); + this.ct縺ゥ繧薙■繧繧薙う繝ウ = new CCounter(); + this.ct縺ゥ繧薙■繧繧薙Ν繝シ繝 = new CCounter(0, TJAPlayer3.Tx.Entry_Donchan_Normal.Length - 1, 1000 / 30, TJAPlayer3.Timer); + + this.ctBarAnimeIn = new CCounter(); + this.ctBarMove = new CCounter(); + this.ctBarMove.n迴セ蝨ィ縺ョ蛟、 = 250; + + this.b繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ = false; + this.b繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ螟ア謨 = false; + this.b繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ = false; + this.b繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ豎コ螳 = false; + this.b繝「繝シ繝蛾∈謚 = false; + this.b縺ゥ繧薙■繧繧薙き繧ヲ繝ウ繧ソ繝シ蛻晄悄蛹 = false; + + this.n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ = 1; + + for (int i = 0; i < this.nbModes; i++) + { + this.stModeBar[i].BarTexture = TJAPlayer3.Tx.ModeSelect_Bar[i]; + this.stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。 = i + 1; + } + + TJAPlayer3.Skin.soundEntry.t蜀咲函縺吶k(); + TJAPlayer3.Skin.SoundBanapas.bPlayed = false; + if (TJAPlayer3.ConfigIni.bBGM髻ウ繧堤匱螢ー縺吶k) + TJAPlayer3.Skin.bgm繧ソ繧、繝医Ν繧、繝ウ.t蜀咲函縺吶k(); + b髻ウ螢ー蜀咲函 = false; + base.On豢サ諤ァ蛹(); + } + finally + { + Trace.TraceInformation( "繧ソ繧、繝医Ν繧ケ繝繝シ繧ク縺ョ豢サ諤ァ蛹悶r螳御コ縺励∪縺励◆縲" ); + Trace.Unindent(); + } + } + public override void On髱樊エサ諤ァ蛹() + { + Trace.TraceInformation( "繧ソ繧、繝医Ν繧ケ繝繝シ繧ク繧帝撼豢サ諤ァ蛹悶@縺セ縺吶" ); + Trace.Indent(); + try + { + + } + finally + { + Trace.TraceInformation( "繧ソ繧、繝医Ν繧ケ繝繝シ繧ク縺ョ髱樊エサ諤ァ蛹悶r螳御コ縺励∪縺励◆縲" ); + Trace.Unindent(); + } + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + + } + public override int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + #region [ 蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ] + //--------------------- + if ( base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + if( TJAPlayer3.r逶エ蜑阪ョ繧ケ繝繝シ繧ク == TJAPlayer3.stage襍キ蜍 ) + { + this.actFIfromSetup.t繝輔ぉ繝シ繝峨う繝ウ髢句ァ(); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.繧ソ繧、繝医Ν_襍キ蜍慕判髱「縺九i縺ョ繝輔ぉ繝シ繝峨う繝ウ; + } + else + { + this.actFI.t繝輔ぉ繝シ繝峨う繝ウ髢句ァ(); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨う繝ウ; + } + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + //--------------------- + #endregion + + this.ct繧ウ繧、繝ウ繧、繝ウ蠕讖.t騾イ陦鍬oop(); + this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.t騾イ陦(); + this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ螟ア謨.t騾イ陦(); + this.ct繧ィ繝ウ繝医Μ繝シ繝舌シ轤ケ貊.t騾イ陦鍬oop(); + this.ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.t騾イ陦(); + this.ct縺ゥ繧薙■繧繧薙う繝ウ.t騾イ陦(); + this.ct縺ゥ繧薙■繧繧薙Ν繝シ繝.t騾イ陦鍬oop(); + this.ct縺ゥ繧薙■繧繧薙お繝ウ繝医Μ繝シ繝ォ繝シ繝.t騾イ陦鍬oop(); + this.ctBarMove.t騾イ陦(); + + if (!TJAPlayer3.Skin.bgm繧ソ繧、繝医Ν繧、繝ウ.b蜀咲函荳ュ) + { + if (TJAPlayer3.ConfigIni.bBGM髻ウ繧堤匱螢ー縺吶k && !b髻ウ螢ー蜀咲函) + { + TJAPlayer3.Skin.bgm繧ソ繧、繝医Ν.t蜀咲函縺吶k(); + b髻ウ螢ー蜀咲函 = true; + } + } + + // 騾イ陦 + + #region [ 繧ュ繝シ髢「菫 ] + + if (base.e繝輔ぉ繝シ繧コID == CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷 // 騾壼クク迥カ諷九√°縺、 + && TJAPlayer3.act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ == null) // 繝励Λ繧ー繧、繝ウ縺ョ蜈・蜉帛頃譛峨′縺ェ縺 + { + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.Escape)) + return (int)E謌サ繧雁、.EXIT; + + if ((TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧((int)SlimDXKeys.Key.RightShift) || TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧((int)SlimDXKeys.Key.LeftShift)) && TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.F1)) + { + TJAPlayer3.Skin.soundEntry.t蛛懈ュ「縺吶k(); + n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚 = (int)E謌サ繧雁、.CONFIG - 1; + this.actFO.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝; + TJAPlayer3.Skin.sound蜿匁カ磯浹.t蜀咲函縺吶k(); + } + + if (!b繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ && !b繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ螟ア謨) + { + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.P)) + this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ蠕讖.t髢句ァ(0, 600, 1, TJAPlayer3.Timer); + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧((int)SlimDXKeys.Key.P)) + ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ蠕讖.t騾イ陦(); + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺碁屬縺輔l縺((int)SlimDXKeys.Key.P)) + { + this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ蠕讖.t蛛懈ュ「(); + if (this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ蠕讖.n迴セ蝨ィ縺ョ蛟、 < 600 && !b繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ螟ア謨) + { + ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ螟ア謨.t髢句ァ(0, 1128, 1, TJAPlayer3.Timer); + b繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ螟ア謨 = true; + } + } + } + + if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RBlue) || TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.RightArrow)) + { + if(b繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ && !b繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ豎コ螳) + { + if(n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ + 1 <= 2) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ += 1; + } + } + + if (b繝「繝シ繝蛾∈謚) + { + if (n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚 < this.nbModes - 1) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + ctBarMove.t髢句ァ(0, 250, 1.2f, TJAPlayer3.Timer); + n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚++; + for (int i = 0; i < this.nbModes; i++) + this.stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。 = Math.Max(0, i + 1 - n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚); + } + } + } + + if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LBlue)||TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.LeftArrow)) + { + if(b繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ && !b繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ豎コ螳) + { + if(n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ - 1 >= 0) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ -= 1; + } + } + + if (b繝「繝シ繝蛾∈謚) + { + if(n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚 > 0) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + ctBarMove.t髢句ァ(0, 250, 1.2f, TJAPlayer3.Timer); + n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚--; + for (int i = 0; i < this.nbModes; i++) + this.stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。 = Math.Max(0, i + 1 - n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚); + } + } + } + + + if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RRed) || TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LRed) || TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.Return)) + { + if (b繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ) + { + if (n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ == 0 || n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ == 2) + { + if (!b繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ豎コ螳) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.t髢句ァ(0, 1055, 1, TJAPlayer3.Timer); + b繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ豎コ螳 = true; + } + } + else + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + b繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ = false; + b繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ = false; + TJAPlayer3.Skin.SoundBanapas.bPlayed = false; + ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥 = new CCounter(); + ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ蠕讖 = new CCounter(); + } + } + if (b繝「繝シ繝蛾∈謚) + { + if (this.n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚 == (int)E謌サ繧雁、.CONFIG - 1) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚 = (int)E謌サ繧雁、.CONFIG - 1; + this.actFO.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(0, 500); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝; + } + else if (this.n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚 == (int)E謌サ繧雁、.DANGAMESTART - 1) + { + if (TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝_Dan.Count > 0 && TJAPlayer3.ConfigIni.nPlayerCount != 2) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚 = (int)E謌サ繧雁、.DANGAMESTART - 1; + this.actFO.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(0, 500); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝; + } + else + { + TJAPlayer3.Skin.soundError.t蜀咲函縺吶k(); + } + } + else if (this.n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚 == (int)E謌サ繧雁、.GAMESTART - 1) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚 = (int)E謌サ繧雁、.GAMESTART - 1; + this.actFO.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(0, 500); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝; + } + else + { + TJAPlayer3.Skin.soundError.t蜀咲函縺吶k(); + } + } + } + + if (ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ蠕讖.n迴セ蝨ィ縺ョ蛟、 >= 500) + { + if (!b繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ) + { + TJAPlayer3.Skin.soundEntry.t蛛懈ュ「縺吶k(); + ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.t髢句ァ(0, 3655, 1, TJAPlayer3.Timer); + b繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ = true; + } + } + + if (ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 >= 1055) + { + if (!b繝「繝シ繝蛾∈謚) + { + if (!TJAPlayer3.Skin.soundsanka.bPlayed) + TJAPlayer3.Skin.soundsanka.t蜀咲函縺吶k(); + + ct縺ゥ繧薙■繧繧薙う繝ウ.t髢句ァ(0, 180, 2, TJAPlayer3.Timer); + ctBarAnimeIn.t髢句ァ(0, 1295, 1, TJAPlayer3.Timer); + b繝「繝シ繝蛾∈謚 = true; + } + } + } + + #endregion + + #region [ 閭梧勹謠冗判 ] + + if (TJAPlayer3.Tx.Title_Background != null ) + TJAPlayer3.Tx.Title_Background.t2D謠冗判( TJAPlayer3.app.Device, 0, 0 ); + + #endregion + + #region [ 繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ ] + + if (!b繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ && !b繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ螟ア謨) + { + TJAPlayer3.Tx.Entry_Bar.t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + + if (this.ct繧ウ繧、繝ウ繧、繝ウ蠕讖.n迴セ蝨ィ縺ョ蛟、 <= 255) + TJAPlayer3.Tx.Entry_Bar_Text.Opacity = this.ct繧ウ繧、繝ウ繧、繝ウ蠕讖.n迴セ蝨ィ縺ョ蛟、; + else if (this.ct繧ウ繧、繝ウ繧、繝ウ蠕讖.n迴セ蝨ィ縺ョ蛟、 <= 2000 - 355) + TJAPlayer3.Tx.Entry_Bar_Text.Opacity = 255; + else + TJAPlayer3.Tx.Entry_Bar_Text.Opacity = 255 - (this.ct繧ウ繧、繝ウ繧、繝ウ蠕讖.n迴セ蝨ィ縺ョ蛟、 - (2000 - 355)); + + TJAPlayer3.Tx.Entry_Bar_Text.t2D謠冗判(TJAPlayer3.app.Device, 563, 312, new RectangleF(0, 0, 395, 50)); + TJAPlayer3.Tx.Entry_Bar_Text.t2D謠冗判(TJAPlayer3.app.Device, 563, 430, new RectangleF(0, 50, 395, 50)); + } + else + { + if (this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 <= 1000 && this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ螟ア謨.n迴セ蝨ィ縺ョ蛟、 <= 1128) + { + if (b繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ) + { + TJAPlayer3.Tx.Tile_Black.Opacity = this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 <= 2972 ? 128 : 128 - (this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 - 2972); + + for (int i = 0; i < 1280 / TJAPlayer3.Tx.Tile_Black.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width + 1; i++) + for (int j = 0; j < 720 / TJAPlayer3.Tx.Tile_Black.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height + 1; j++) + TJAPlayer3.Tx.Tile_Black.t2D謠冗判(TJAPlayer3.app.Device, i * TJAPlayer3.Tx.Tile_Black.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, j * TJAPlayer3.Tx.Tile_Black.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + + TJAPlayer3.Tx.Banapas_Load[0].Opacity = ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 >= 872 ? 255 - (ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 - 872) * 2 : ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 * 2; + TJAPlayer3.Tx.Banapas_Load[0].vc諡。螟ァ邵ョ蟆丞咲紫.Y = ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 <= 100 ? ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 * 0.01f : 1.0f; + TJAPlayer3.Tx.Banapas_Load[0].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 360); + + TJAPlayer3.Tx.Banapas_Load[1].Opacity = ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 >= 872 ? 255 - (ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 - 872) * 2 : ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 <= 96 ? (int)((ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 - 96) * 7.96875f) : 255; + TJAPlayer3.Tx.Banapas_Load[1].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 360); + + for (int i = 0; i < 5; i++) + { + TJAPlayer3.Tx.Banapas_Load[2].Opacity = ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 >= 872 ? 255 - (ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 - 872) * 2 : ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 <= 96 ? (int)((ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 - 96) * 7.96875f) : 255; + TJAPlayer3.Tx.Banapas_Load[2].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 480 + 90 * i, 410, new Rectangle(0 + 72 * (ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 >= 200 + (i - 1) * 320 ? ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 <= (200 + i * 320) ? (ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 - (200 + i * 320)) / 40 : 0 : 0), 0, 72, 72)); + } + } + if (b繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ螟ア謨) + { + TJAPlayer3.Tx.Tile_Black.Opacity = this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ螟ア謨.n迴セ蝨ィ縺ョ蛟、 <= 1000 ? 128 : 128 - (this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ螟ア謨.n迴セ蝨ィ縺ョ蛟、 - 1000); + + for (int i = 0; i < 1280 / TJAPlayer3.Tx.Tile_Black.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width + 1; i++) + for (int j = 0; j < 720 / TJAPlayer3.Tx.Tile_Black.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height + 1; j++) + TJAPlayer3.Tx.Tile_Black.t2D謠冗判(TJAPlayer3.app.Device, i * TJAPlayer3.Tx.Tile_Black.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, j * TJAPlayer3.Tx.Tile_Black.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + + if (!TJAPlayer3.Skin.soundError.bPlayed) + TJAPlayer3.Skin.soundError.t蜀咲函縺吶k(); + + int count = this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ螟ア謨.n迴セ蝨ィ縺ョ蛟、; + TJAPlayer3.Tx.Banapas_Load_Failure[0].Opacity = count >= 872 ? 255 - (count - 872) * 2 : count * 2; + TJAPlayer3.Tx.Banapas_Load_Failure[0].vc諡。螟ァ邵ョ蟆丞咲紫.Y = count <= 100 ? count * 0.01f : 1.0f; + TJAPlayer3.Tx.Banapas_Load_Failure[0].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 360); + + if (ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ螟ア謨.n迴セ蝨ィ縺ョ蛟、 >= 1128) + { + b繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ螟ア謨 = false; + TJAPlayer3.Skin.soundError.bPlayed = false; + } + } + } + else + { + if (b繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ) + { + TJAPlayer3.Tx.Tile_Black.Opacity = this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 <= 2972 ? 128 : 128 - (this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 - 2972); + + for (int i = 0; i < 1280 / TJAPlayer3.Tx.Tile_Black.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width + 1; i++) + for (int j = 0; j < 720 / TJAPlayer3.Tx.Tile_Black.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height + 1; j++) + TJAPlayer3.Tx.Tile_Black.t2D謠冗判(TJAPlayer3.app.Device, i * TJAPlayer3.Tx.Tile_Black.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, j * TJAPlayer3.Tx.Tile_Black.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + + if (!TJAPlayer3.Skin.SoundBanapas.bPlayed) + TJAPlayer3.Skin.SoundBanapas.t蜀咲函縺吶k(); + + int count = this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 - 1000; + TJAPlayer3.Tx.Banapas_Load_Clear[0].Opacity = count >= 1872 ? 255 - (count - 1872) * 2 : count * 2; + TJAPlayer3.Tx.Banapas_Load_Clear[0].vc諡。螟ァ邵ョ蟆丞咲紫.Y = count <= 100 ? count * 0.01f : 1.0f; + TJAPlayer3.Tx.Banapas_Load_Clear[0].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 360); + + float anime = 0f; + float scalex = 0f; + float scaley = 0f; + + if (count >= 300) + { + if (count <= 300 + 270) + { + anime = (float)Math.Sin((float)(count - 300) / 1.5f * (Math.PI / 180)) * 95f; + scalex = -(float)Math.Sin((float)(count - 300) / 1.5f * (Math.PI / 180)) * 0.15f; + scaley = (float)Math.Sin((float)(count - 300) / 1.5f * (Math.PI / 180)) * 0.2f; + } + else if (count <= 300 + 270 + 100) + { + scalex = (float)Math.Sin((float)(count - (300 + 270)) * 1.8f * (Math.PI / 180)) * 0.13f; + scaley = -(float)Math.Sin((float)(count - (300 + 270)) * 1.8f * (Math.PI / 180)) * 0.1f; + anime = 0; + } + else if (count <= 300 + 540 + 100) + { + anime = (float)Math.Sin((float)(count - (300 + 270 + 100)) / 1.5f * (Math.PI / 180)) * 95f; + scalex = -(float)Math.Sin((float)(count - (300 + 270 + 100)) / 1.5f * (Math.PI / 180)) * 0.15f; + scaley = (float)Math.Sin((float)(count - (300 + 270 + 100)) / 1.5f * (Math.PI / 180)) * 0.2f; + } + else if (count <= 300 + 540 + 100 + 100) + { + scalex = (float)Math.Sin((float)(count - (300 + 540 + 100)) * 1.8f * (Math.PI / 180)) * 0.13f; + scaley = -(float)Math.Sin((float)(count - (300 + 540 + 100)) * 1.8f * (Math.PI / 180)) * 0.1f; + } + } + + TJAPlayer3.Tx.Banapas_Load_Clear[1].vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f + scalex; + TJAPlayer3.Tx.Banapas_Load_Clear[1].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f + scaley; + TJAPlayer3.Tx.Banapas_Load_Clear[1].Opacity = count >= 1872 ? 255 - (count - 1872) * 2 : count * 2; + TJAPlayer3.Tx.Banapas_Load_Clear[1].t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 198, 514 - anime); + + if (ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 >= 2000) + { + b繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ = true; + } + } + } + } + + #endregion + + #region [ 繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ ] + + if (b繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ) + { + if (!this.b縺ゥ繧薙■繧繧薙き繧ヲ繝ウ繧ソ繝シ蛻晄悄蛹) + { + this.ct縺ゥ繧薙■繧繧薙お繝ウ繝医Μ繝シ繝ォ繝シ繝 = new CCounter(0, TJAPlayer3.Tx.Donchan_Entry.Length - 1, 1000 / 60, TJAPlayer3.Timer); + this.b縺ゥ繧薙■繧繧薙き繧ヲ繝ウ繧ソ繝シ蛻晄悄蛹 = true; + } + + TJAPlayer3.Tx.Entry_Player[0].Opacity = ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 >= 800 ? 255 - (ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 - 800) : (this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 - 3400); + TJAPlayer3.Tx.Entry_Player[1].Opacity = ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 >= 800 ? 255 - (ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 - 800) : (this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 - 3400); + TJAPlayer3.Tx.Donchan_Entry[this.ct縺ゥ繧薙■繧繧薙お繝ウ繝医Μ繝シ繝ォ繝シ繝.n迴セ蝨ィ縺ョ蛟、].Opacity = ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 >= 800 ? 255 - (ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 - 800) : (this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 - 3400); + + TJAPlayer3.Tx.Entry_Player[0].t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + + TJAPlayer3.Tx.Donchan_Entry[this.ct縺ゥ繧薙■繧繧薙お繝ウ繝医Μ繝シ繝ォ繝シ繝.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, 485, 140); + + TJAPlayer3.Tx.Entry_Player[2].Opacity = ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 >= 800 ? 255 - (ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 - 800 ) : (this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 - 3400) - (this.ct繧ィ繝ウ繝医Μ繝シ繝舌シ轤ケ貊.n迴セ蝨ィ縺ョ蛟、 <= 255 ? this.ct繧ィ繝ウ繝医Μ繝シ繝舌シ轤ケ貊.n迴セ蝨ィ縺ョ蛟、 : 255 - (this.ct繧ィ繝ウ繝医Μ繝シ繝舌シ轤ケ貊.n迴セ蝨ィ縺ョ蛟、 - 255)); + TJAPlayer3.Tx.Entry_Player[2].t2D謠冗判(TJAPlayer3.app.Device, pt繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ繝舌シ蠎ァ讓兌n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ].X, pt繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ繝舌シ蠎ァ讓兌n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ].Y, + new RectangleF(n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ == 1 ? 199 : 0, 0, n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ == 1 ? 224 : 199, 92)); + + TJAPlayer3.Tx.Entry_Player[2].Opacity = ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 >= 800 ? 255 - (ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 - 800) : (this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 - 3400); + TJAPlayer3.Tx.Entry_Player[2].t2D謠冗判(TJAPlayer3.app.Device, pt繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ繝舌シ蠎ァ讓兌n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ].X, pt繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ繝舌シ蠎ァ讓兌n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ].Y, + new RectangleF(n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ == 1 ? 199 : 0, 92, n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ == 1 ? 224 : 199, 92)); + + TJAPlayer3.Tx.Entry_Player[1].t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + + #region [ 騾乗主コヲ ] + + int Opacity = 0; + + if (ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 <= 100) + Opacity = (int)(ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 * 2.55f); + else if (ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 <= 200) + Opacity = 255 - (int)((ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 - 100) * 2.55f); + else if (ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 <= 300) + Opacity = (int)((ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 - 200) * 2.55f); + else if (ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 <= 400) + Opacity = 255 - (int)((ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 - 300) * 2.55f); + else if (ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 <= 500) + Opacity = (int)((ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 - 400) * 2.55f); + else if (ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 <= 600) + Opacity = 255 - (int)((ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 - 500) * 2.55f); + + #endregion + + TJAPlayer3.Tx.Entry_Player[2].Opacity = Opacity; + TJAPlayer3.Tx.Entry_Player[2].t2D謠冗判(TJAPlayer3.app.Device, pt繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ繝舌シ蠎ァ讓兌n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ].X, pt繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ繝舌シ蠎ァ讓兌n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ].Y, + new RectangleF(n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ == 1 ? 199 : 0, 92 * 2, n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ == 1 ? 224 : 199, 92)); + + TJAPlayer3.NamePlate.tNamePlateDraw(530, 385, 0, true, ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 >= 800 ? 255 - (ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊.n迴セ蝨ィ縺ョ蛟、 - 800) : (this.ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥.n迴セ蝨ィ縺ョ蛟、 - 3400)); + } + + #endregion + + #region [ 繝「繝シ繝蛾∈謚 ] + + if (b繝「繝シ繝蛾∈謚) + { + this.ctBarAnimeIn.t騾イ陦(); + + #region [ 縺ゥ繧薙■繧繧捺緒逕サ ] + + float DonchanX = 0f, DonchanY = 0f; + + DonchanX = (float)Math.Sin(ct縺ゥ繧薙■繧繧薙う繝ウ.n迴セ蝨ィ縺ョ蛟、 / 2 * (Math.PI / 180)) * 200f; + DonchanY = ( (float)Math.Sin((90 + (ct縺ゥ繧薙■繧繧薙う繝ウ.n迴セ蝨ィ縺ョ蛟、 / 2)) * (Math.PI / 180)) * 150f); + + TJAPlayer3.Tx.Entry_Donchan_Normal[ct縺ゥ繧薙■繧繧薙Ν繝シ繝.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, -200 + DonchanX, 341 - DonchanY); + + #endregion + + if(ctBarAnimeIn.n迴セ蝨ィ縺ョ蛟、 >= (int)(16 * 16.6f)) + { + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, ctBarMove.n迴セ蝨ィ縺ョ蛟、.ToString()); + + for (int i = 0; i < this.nbModes; i++) + { + if(this.stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。 == 1 && ctBarMove.n迴セ蝨ィ縺ョ蛟、 >= 150) + { + int BarAnime = ctBarAnimeIn.n迴セ蝨ィ縺ョ蛟、 >= (int)(26 * 16.6f) + 100 ? 0 : ctBarAnimeIn.n迴セ蝨ィ縺ョ蛟、 >= (int)(26 * 16.6f) && ctBarAnimeIn.n迴セ蝨ィ縺ョ蛟、 <= (int)(26 * 16.6f) + 100 ? 40 + (int)((ctBarAnimeIn.n迴セ蝨ィ縺ョ蛟、 - (26 * 16.6)) / 100f * 71f) : ctBarAnimeIn.n迴セ蝨ィ縺ョ蛟、 < (int)(26 * 16.6f) ? 40 : 111; + int BarAnime1 = BarAnime == 0 ? ctBarMove.n迴セ蝨ィ縺ョ蛟、 >= 150 ? 40 + (int)((ctBarMove.n迴セ蝨ィ縺ョ蛟、 - 150) / 100f * 71f) : ctBarMove.n迴セ蝨ィ縺ョ蛟、 < 150 ? 40 : 111 : 0; + + this.stModeBar[i].BarTexture.Opacity = (int)((ctBarAnimeIn.n迴セ蝨ィ縺ョ蛟、 - (16 * 16.6f)) * 1.23f); + + this.stModeBar[i].BarTexture.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + this.stModeBar[i].BarTexture.t2D謠冗判(TJAPlayer3.app.Device, 320, 347 - BarAnime - BarAnime1, new Rectangle(0, 0, 641, 27)); + this.stModeBar[i].BarTexture.t2D謠冗判(TJAPlayer3.app.Device, 320, 346 + BarAnime + BarAnime1, new Rectangle(0, 76, 641, 30)); + + this.stModeBar[i].BarTexture.vc諡。螟ァ邵ョ蟆丞咲紫.Y = BarAnime / 25.7f + BarAnime1 / 25.7f; + this.stModeBar[i].BarTexture.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 360, new Rectangle(0, 27, 641, 45)); + + TJAPlayer3.Tx.ModeSelect_Bar[this.nbModes].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + TJAPlayer3.Tx.ModeSelect_Bar[this.nbModes].t2D謠冗判(TJAPlayer3.app.Device, 320, 306, new Rectangle(0, 0, 641, 27)); + TJAPlayer3.Tx.ModeSelect_Bar[this.nbModes].t2D謠冗判(TJAPlayer3.app.Device, 320, 334 + (BarAnime + BarAnime1) / 0.95238f, new Rectangle(0, 71, 641, 35)); + + TJAPlayer3.Tx.ModeSelect_Bar[this.nbModes].vc諡。螟ァ邵ョ蟆丞咲紫.Y = (BarAnime + BarAnime1) / 0.95238f; + TJAPlayer3.Tx.ModeSelect_Bar[this.nbModes].t2D諡。螟ァ邇閠諷ョ荳贋クュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 333, new Rectangle(0, 27, 641, 1)); + + float anime = 0; + float BarAnimeCount = this.ctBarMove.n迴セ蝨ィ縺ョ蛟、 - 150; + + if (BarAnimeCount <= 45) + anime = BarAnimeCount * 3.333333333f; + else + anime = 150 - (BarAnimeCount - 45) * 0.61764705f; + + TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].Opacity = (int)(BarAnimeCount * 2.55f) + (int)(BarAnime * 2.5f); + //130 + TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640 - TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 4 + 114 - anime, 360, + new Rectangle(0, 0, TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + + TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640 + TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 4 - 114 + anime, 360, + new Rectangle(TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, 0, TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + + TJAPlayer3.Tx.ModeSelect_Bar_Text[i].Opacity = 255; + TJAPlayer3.Tx.ModeSelect_Bar_Text[i]?.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 355 - BarAnimeCount / 1.5f, new Rectangle(0, 0, 642, 122)); + + TJAPlayer3.Tx.ModeSelect_Bar_Text[i].Opacity = (int)(BarAnimeCount * 2.55f); + TJAPlayer3.Tx.ModeSelect_Bar_Text[i]?.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 355 + 132 / 2, new Rectangle(0, 122, 642, 148)); + + } + else if (this.stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。 <= 2) + { + int BarAnimeY = ctBarAnimeIn.n迴セ蝨ィ縺ョ蛟、 >= (int)(26 * 16.6f) + 100 && ctBarAnimeIn.n迴セ蝨ィ縺ョ蛟、 <= (int)(26 * 16.6f) + 299 ? 600 - (ctBarAnimeIn.n迴セ蝨ィ縺ョ蛟、 - (int)(26 * 16.6f + 100)) * 3 : ctBarAnimeIn.n迴セ蝨ィ縺ョ蛟、 >= (int)(26 * 16.6f) + 100 ? 0 : 600; + int BarAnimeX = ctBarAnimeIn.n迴セ蝨ィ縺ョ蛟、 >= (int)(26 * 16.6f) + 100 && ctBarAnimeIn.n迴セ蝨ィ縺ョ蛟、 <= (int)(26 * 16.6f) + 299 ? 100 - (int)((ctBarAnimeIn.n迴セ蝨ィ縺ョ蛟、 - (int)(26 * 16.6f + 100)) * 0.5f) : ctBarAnimeIn.n迴セ蝨ィ縺ョ蛟、 >= (int)(26 * 16.6f) + 100 ? 0 : 100; + + int BarMoveX = 0; + int BarMoveY = 0; + + if (this.stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。 - n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚 != 0) + { + if (this.stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。 - this.n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚 != this.nbModes) + { + BarMoveX = ctBarMove.n迴セ蝨ィ縺ョ蛟、 <= 100 ? (int)(this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。珪.X - this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚枉.X) - (int)(ctBarMove.n迴セ蝨ィ縺ョ蛟、 / 100f * (this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。珪.X - this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚枉.X)) : 0; + BarMoveY = ctBarMove.n迴セ蝨ィ縺ョ蛟、 <= 100 ? (int)(this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。珪.Y - this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚枉.Y) - (int)(ctBarMove.n迴セ蝨ィ縺ョ蛟、 / 100f * (this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。珪.Y - this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚枉.Y)) : 0; + } + else + { + BarMoveX = ctBarMove.n迴セ蝨ィ縺ョ蛟、 <= 100 ? (int)(this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。珪.X - this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚 + 1].X) - (int)(ctBarMove.n迴セ蝨ィ縺ョ蛟、 / 100f * (this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。珪.X - this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚 + 1].X)) : 0; + BarMoveY = ctBarMove.n迴セ蝨ィ縺ョ蛟、 <= 100 ? (int)(this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。珪.Y - this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚 + 1].Y) - (int)(ctBarMove.n迴セ蝨ィ縺ョ蛟、 / 100f * (this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。珪.Y - this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚 + 1].Y)) : 0; + } + } + else + { + BarMoveX = ctBarMove.n迴セ蝨ィ縺ョ蛟、 <= 100 ? (int)(this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。 - 1].X - this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚枉.X) - (int)(ctBarMove.n迴セ蝨ィ縺ョ蛟、 / 100f * (this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。 - 1].X - this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚枉.X)) : 0; + BarMoveY = ctBarMove.n迴セ蝨ィ縺ョ蛟、 <= 100 ? (int)(this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。 - 1].Y - this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚枉.Y) - (int)(ctBarMove.n迴セ蝨ィ縺ョ蛟、 / 100f * (this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。 - 1].Y - this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌this.n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚枉.Y)) : 0; + } + + this.stModeBar[i].BarTexture.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + TJAPlayer3.Tx.ModeSelect_Bar[this.nbModes].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + this.stModeBar[i].BarTexture.t2D謠冗判(TJAPlayer3.app.Device, this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。珪.X + BarAnimeX - BarMoveX, this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。珪.Y + BarAnimeY - BarMoveY); + TJAPlayer3.Tx.ModeSelect_Bar[this.nbModes].t2D謠冗判(TJAPlayer3.app.Device, this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。珪.X + BarAnimeX - BarMoveX, this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。珪.Y + BarAnimeY - BarMoveY); + TJAPlayer3.Tx.ModeSelect_Bar_Text[i]?.t2D謠冗判(TJAPlayer3.app.Device, this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。珪.X + BarAnimeX - BarMoveX, this.pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓兌stModeBar[i].n迴セ蝨ィ蟄伜惠縺励※縺繧玖。珪.Y + BarAnimeY - BarMoveY - 13, new Rectangle(0, 0, 642, 122)); + } + } + } + + TJAPlayer3.NamePlate.tNamePlateDraw(TJAPlayer3.Skin.SongSelect_NamePlate_X[0], TJAPlayer3.Skin.SongSelect_NamePlate_Y[0], 0, false, 255); + } + + #endregion + + #region[ 繝舌シ繧ク繝ァ繝ウ陦ィ遉コ ] + +#if DEBUG + + //string strVersion = "KTT:J:A:I:2017072200"; + string strCreator = "https://github.com/AioiLight/TJAPlayer3"; + AssemblyName asmApp = Assembly.GetExecutingAssembly().GetName(); + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(4, 44, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, "DEBUG BUILD"); + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(4, 4, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, asmApp.Name + " Ver." + TJAPlayer3.VERSION + " (" + strCreator + ")" ); + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(4, 24, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, "Skin:" + TJAPlayer3.Skin.Skin_Name + " Ver." + TJAPlayer3.Skin.Skin_Version + " (" + TJAPlayer3.Skin.Skin_Creator + ")"); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(4, 24, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, strSubTitle); + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(4, (720 - 24), C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, "TJAPlayer3 forked TJAPlayer2 forPC(kairera0467)"); + +#endif + #endregion + + CStage.E繝輔ぉ繝シ繧コ e繝輔ぉ繝シ繧コid = base.e繝輔ぉ繝シ繧コID; + switch( e繝輔ぉ繝シ繧コid ) + { + case CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨う繝ウ: + if( this.actFI.On騾イ陦梧緒逕サ() != 0 ) + { + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷; + } + break; + + case CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝: + if( this.actFO.On騾イ陦梧緒逕サ() == 0 ) + { + TJAPlayer3.Skin.bgm繧ソ繧、繝医Ν.t蛛懈ュ「縺吶k(); + TJAPlayer3.Skin.bgm繧ソ繧、繝医Ν繧、繝ウ.t蛛懈ュ「縺吶k(); + break; + } + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟邨ゆコ迥カ諷; + + switch ( this.n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚) + { + case (int)E謌サ繧雁、.GAMESTART - 1: + return (int)E謌サ繧雁、.GAMESTART; + + case (int)E謌サ繧雁、.DANGAMESTART - 1: + return (int)E謌サ繧雁、.DANGAMESTART; + + case (int)E謌サ繧雁、.TAIKOTOWERSSTART - 1: + return (int)E謌サ繧雁、.TAIKOTOWERSSTART; + + case (int)E謌サ繧雁、.SHOPSTART - 1: + return (int)E謌サ繧雁、.SHOPSTART; + + case (int)E謌サ繧雁、.BOUKENSTART - 1: + return (int)E謌サ繧雁、.BOUKENSTART; + + case (int) E謌サ繧雁、.CONFIG - 1: + return (int) E謌サ繧雁、.CONFIG; + + case (int)E謌サ繧雁、.EXIT - 1: + return (int) E謌サ繧雁、.EXIT; + } + break; + + case CStage.E繝輔ぉ繝シ繧コ.繧ソ繧、繝医Ν_襍キ蜍慕判髱「縺九i縺ョ繝輔ぉ繝シ繝峨う繝ウ: + if( this.actFIfromSetup.On騾イ陦梧緒逕サ() != 0 ) + { + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷; + } + break; + } + } + return 0; + } + public enum E謌サ繧雁、 + { + 邯咏カ = 0, + GAMESTART, + DANGAMESTART, + TAIKOTOWERSSTART, + SHOPSTART, + BOUKENSTART, + CONFIG, + EXIT + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private CCounter ct繧ウ繧、繝ウ繧、繝ウ蠕讖; + + private CCounter ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ蠕讖; + + private CCounter ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ謌仙粥; + private CCounter ct繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ螟ア謨; + + private CCounter ct繧ィ繝ウ繝医Μ繝シ繝舌シ轤ケ貊; + private CCounter ct繧ィ繝ウ繝医Μ繝シ繝舌シ豎コ螳夂せ貊; + + private CCounter ct縺ゥ繧薙■繧繧薙お繝ウ繝医Μ繝シ繝ォ繝シ繝; + private CCounter ct縺ゥ繧薙■繧繧薙う繝ウ; + private CCounter ct縺ゥ繧薙■繧繧薙Ν繝シ繝; + + private CCounter ctBarAnimeIn; + private CCounter ctBarMove; + + + + private bool b繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ; + private bool b繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ螟ア謨; + private bool b繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ; + private bool b繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ豎コ螳; + private bool b繝「繝シ繝蛾∈謚; + private bool b縺ゥ繧薙■繧繧薙き繧ヲ繝ウ繧ソ繝シ蛻晄悄蛹; + + private int n迴セ蝨ィ縺ョ驕ク謚櫁。後励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ; + private int n迴セ蝨ィ縺ョ驕ク謚櫁。後Δ繝シ繝蛾∈謚; + + private Point[] pt繝励Ξ繧、繝、繝シ繧ィ繝ウ繝医Μ繝シ繝舌シ蠎ァ讓 = + { new Point(337, 488), new Point( 529, 487), new Point(743, 486) }; + + //private Point[] pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓 = + // { new Point(290, 107), new Point(319, 306), new Point(356, 513), new Point(385, 712), new Point(414, 911), new Point(443, 1110), new Point(472, 1309) }; + + + private Point[] pt繝「繝シ繝蛾∈謚槭ヰ繝シ蠎ァ讓 = + { new Point(290, 107), new Point(319, 306), new Point(356, 513), new Point(385, 712), new Point(385, 712), new Point(385, 712), new Point(385, 712) }; + + private int nbModes = 6; + private STModeBar[] stModeBar = new STModeBar[6]; + + private struct STModeBar + { + public int n迴セ蝨ィ蟄伜惠縺励※縺繧玖。; + public CTexture BarTexture; + } + + private bool b髻ウ螢ー蜀咲函; + private CActFIFOBlack actFI; + private CActFIFOBlack actFIfromSetup; + private CActFIFOBlack actFO; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/04.Config/CActConfigKeyAssign.cs b/TJAPlayer3/Stages/04.Config/CActConfigKeyAssign.cs new file mode 100644 index 00000000..05ebb023 --- /dev/null +++ b/TJAPlayer3/Stages/04.Config/CActConfigKeyAssign.cs @@ -0,0 +1,396 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActConfigKeyAssign : CActivity + { + // 繝励Ο繝代ユ繧」 + + public bool b繧ュ繝シ蜈・蜉帛セ縺。縺ョ譛荳ュ縺ァ縺ゅk + { + get + { + return this.b繧ュ繝シ蜈・蜉帛セ縺。; + } + } + + + // 繝。繧ス繝繝 + + public void t髢句ァ( EKeyConfigPart part, EKeyConfigPad pad, string str繝代ャ繝牙錐 ) + { + if( part != EKeyConfigPart.UNKNOWN ) + { + this.part = part; + this.pad = pad; + this.str繝代ャ繝牙錐 = str繝代ャ繝牙錐; + for( int i = 0; i < 0x10; i++ ) + { + this.structReset逕ィKeyAssign[ i ].蜈・蜉帙ョ繝舌う繧ケ = TJAPlayer3.ConfigIni.KeyAssign[ (int) part ][ (int) pad ][ i ].蜈・蜉帙ョ繝舌う繧ケ; + this.structReset逕ィKeyAssign[ i ].ID = TJAPlayer3.ConfigIni.KeyAssign[ (int) part ][ (int) pad ][ i ].ID; + this.structReset逕ィKeyAssign[ i ].繧ウ繝シ繝 = TJAPlayer3.ConfigIni.KeyAssign[ (int) part ][ (int) pad ][ i ].繧ウ繝シ繝; + } + } + } + + public void tEnter謚シ荳() + { + if( !this.b繧ュ繝シ蜈・蜉帛セ縺。 ) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + switch( this.n迴セ蝨ィ縺ョ驕ク謚櫁。 ) + { + case 0x10: + for( int i = 0; i < 0x10; i++ ) + { + TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ i ].蜈・蜉帙ョ繝舌う繧ケ = this.structReset逕ィKeyAssign[ i ].蜈・蜉帙ョ繝舌う繧ケ; + TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ i ].ID = this.structReset逕ィKeyAssign[ i ].ID; + TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ i ].繧ウ繝シ繝 = this.structReset逕ィKeyAssign[ i ].繧ウ繝シ繝; + } + return; + + case 0x11: + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.t繧「繧オ繧、繝ウ螳御コ騾夂衍(); + return; + } + this.b繧ュ繝シ蜈・蜉帛セ縺。 = true; + } + } + public void t谺。縺ォ遘サ蜍() + { + if( !this.b繧ュ繝シ蜈・蜉帛セ縺。 ) + { + TJAPlayer3.Skin.sound繧ォ繝シ繧ス繝ォ遘サ蜍暮浹.t蜀咲函縺吶k(); + this.n迴セ蝨ィ縺ョ驕ク謚櫁。 = ( this.n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1 ) % 0x12; + } + } + public void t蜑阪↓遘サ蜍() + { + if( !this.b繧ュ繝シ蜈・蜉帛セ縺。 ) + { + TJAPlayer3.Skin.sound繧ォ繝シ繧ス繝ォ遘サ蜍暮浹.t蜀咲函縺吶k(); + this.n迴セ蝨ィ縺ョ驕ク謚櫁。 = ( ( this.n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1 ) + 0x12 ) % 0x12; + } + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + this.part = EKeyConfigPart.UNKNOWN; + this.pad = EKeyConfigPad.UNKNOWN; + this.str繝代ャ繝牙錐 = ""; + this.n迴セ蝨ィ縺ョ驕ク謚櫁。 = 0; + this.b繧ュ繝シ蜈・蜉帛セ縺。 = false; + this.structReset逕ィKeyAssign = new CConfigIni.CKeyAssign.STKEYASSIGN[ 0x10 ]; + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧ォ繝シ繧ス繝ォ ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txHitKey繝繧、繧「繝ュ繧ー ); + base.On髱樊エサ諤ァ蛹(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //this.tx繧ォ繝シ繧ス繝ォ = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\ScreenConfig menu cursor.png" ), false ); + //this.txHitKey繝繧、繧「繝ュ繧ー = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\ScreenConfig hit key to assign dialog.png" ), false ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + if( this.b繧ュ繝シ蜈・蜉帛セ縺。 ) + { + if( TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.Escape ) ) + { + TJAPlayer3.Skin.sound蜿匁カ磯浹.t蜀咲函縺吶k(); + this.b繧ュ繝シ蜈・蜉帛セ縺。 = false; + TJAPlayer3.Input邂。逅.t繝昴シ繝ェ繝ウ繧ー( TJAPlayer3.app.bApplicationActive, false ); + } + else if( ( this.t繧ュ繝シ繝√ぉ繝繧ッ縺ィ繧「繧オ繧、繝ウ_Keyboard() || this.t繧ュ繝シ繝√ぉ繝繧ッ縺ィ繧「繧オ繧、繝ウ_MidiIn() ) || ( this.t繧ュ繝シ繝√ぉ繝繧ッ縺ィ繧「繧オ繧、繝ウ_Joypad() || this.t繧ュ繝シ繝√ぉ繝繧ッ縺ィ繧「繧オ繧、繝ウ_Mouse() ) ) + { + this.b繧ュ繝シ蜈・蜉帛セ縺。 = false; + TJAPlayer3.Input邂。逅.t繝昴シ繝ェ繝ウ繧ー( TJAPlayer3.app.bApplicationActive, false ); + } + } + else if( ( TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.Delete ) && ( this.n迴セ蝨ィ縺ョ驕ク謚櫁。 >= 0 ) ) && ( this.n迴セ蝨ィ縺ョ驕ク謚櫁。 <= 15 ) ) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n迴セ蝨ィ縺ョ驕ク謚櫁。 ].蜈・蜉帙ョ繝舌う繧ケ = E蜈・蜉帙ョ繝舌う繧ケ.荳肴; + TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n迴セ蝨ィ縺ョ驕ク謚櫁。 ].ID = 0; + TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n迴セ蝨ィ縺ョ驕ク謚櫁。 ].繧ウ繝シ繝 = 0; + } + if(TJAPlayer3.Tx.Menu_Highlight != null ) + { + int num = 20; + int num2 = 0x144; + int num3 = 0x3e + ( num * ( this.n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1 ) ); + TJAPlayer3.Tx.Menu_Highlight.t2D謠冗判( TJAPlayer3.app.Device, num2, num3, new Rectangle( 0, 0, 0x10, 0x20 ) ); + num2 += 0x10; + Rectangle rectangle = new Rectangle( 8, 0, 0x10, 0x20 ); + for( int j = 0; j < 14; j++ ) + { + TJAPlayer3.Tx.Menu_Highlight.t2D謠冗判( TJAPlayer3.app.Device, num2, num3, rectangle ); + num2 += 0x10; + } + TJAPlayer3.Tx.Menu_Highlight.t2D謠冗判( TJAPlayer3.app.Device, num2, num3, new Rectangle( 0x10, 0, 0x10, 0x20 ) ); + } + int num5 = 20; + int x = 0x134; + int y = 0x40; + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.actFont.t譁蟄怜玲緒逕サ( x, y, this.str繝代ャ繝牙錐, false, 0.75f ); + y += num5; + CConfigIni.CKeyAssign.STKEYASSIGN[] stkeyassignArray = TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ]; + for( int i = 0; i < 0x10; i++ ) + { + switch( stkeyassignArray[ i ].蜈・蜉帙ョ繝舌う繧ケ ) + { + case E蜈・蜉帙ョ繝舌う繧ケ.繧ュ繝シ繝懊シ繝: + this.t繧「繧オ繧、繝ウ繧ウ繝シ繝峨ョ謠冗判_Keyboard( i + 1, x + 20, y, stkeyassignArray[ i ].ID, stkeyassignArray[ i ].繧ウ繝シ繝, this.n迴セ蝨ィ縺ョ驕ク謚櫁。 == i ); + break; + + case E蜈・蜉帙ョ繝舌う繧ケ.MIDI蜈・蜉: + this.t繧「繧オ繧、繝ウ繧ウ繝シ繝峨ョ謠冗判_MidiIn( i + 1, x + 20, y, stkeyassignArray[ i ].ID, stkeyassignArray[ i ].繧ウ繝シ繝, this.n迴セ蝨ィ縺ョ驕ク謚櫁。 == i ); + break; + + case E蜈・蜉帙ョ繝舌う繧ケ.繧ク繝ァ繧、繝代ャ繝: + this.t繧「繧オ繧、繝ウ繧ウ繝シ繝峨ョ謠冗判_Joypad( i + 1, x + 20, y, stkeyassignArray[ i ].ID, stkeyassignArray[ i ].繧ウ繝シ繝, this.n迴セ蝨ィ縺ョ驕ク謚櫁。 == i ); + break; + + case E蜈・蜉帙ョ繝舌う繧ケ.繝槭え繧ケ: + this.t繧「繧オ繧、繝ウ繧ウ繝シ繝峨ョ謠冗判_Mouse( i + 1, x + 20, y, stkeyassignArray[ i ].ID, stkeyassignArray[ i ].繧ウ繝シ繝, this.n迴セ蝨ィ縺ョ驕ク謚櫁。 == i ); + break; + + default: + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.actFont.t譁蟄怜玲緒逕サ( x + 20, y, string.Format( "{0,2}.", i + 1 ), this.n迴セ蝨ィ縺ョ驕ク謚櫁。 == i, 0.75f ); + break; + } + y += num5; + } + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.actFont.t譁蟄怜玲緒逕サ( x + 20, y, "Reset", this.n迴セ蝨ィ縺ョ驕ク謚櫁。 == 0x10, 0.75f ); + y += num5; + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.actFont.t譁蟄怜玲緒逕サ( x + 20, y, "<< Returnto List", this.n迴セ蝨ィ縺ョ驕ク謚櫁。 == 0x11, 0.75f ); + y += num5; + if( this.b繧ュ繝シ蜈・蜉帛セ縺。 && ( TJAPlayer3.Tx.Config_KeyAssign != null ) ) + { + TJAPlayer3.Tx.Config_KeyAssign.t2D謠冗判( TJAPlayer3.app.Device, 0x185, 0xd7 ); + } + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + [StructLayout( LayoutKind.Sequential )] + private struct STKEYLABEL + { + public int nCode; + public string strLabel; + public STKEYLABEL( int nCode, string strLabel ) + { + this.nCode = nCode; + this.strLabel = strLabel; + } + } + + private bool b繧ュ繝シ蜈・蜉帛セ縺。; + private STKEYLABEL[] KeyLabel = new STKEYLABEL[] { + new STKEYLABEL(0x35, "[ESC]"), new STKEYLABEL(1, "[ 1 ]"), new STKEYLABEL(2, "[ 2 ]"), new STKEYLABEL(3, "[ 3 ]"), new STKEYLABEL(4, "[ 4 ]"), new STKEYLABEL(5, "[ 5 ]"), new STKEYLABEL(6, "[ 6 ]"), new STKEYLABEL(7, "[ 7 ]"), new STKEYLABEL(8, "[ 8 ]"), new STKEYLABEL(9, "[ 9 ]"), new STKEYLABEL(0, "[ 0 ]"), new STKEYLABEL(0x53, "[ - ]"), new STKEYLABEL(0x34, "[ = ]"), new STKEYLABEL(0x2a, "[BSC]"), new STKEYLABEL(0x81, "[TAB]"), new STKEYLABEL(0x1a, "[ Q ]"), + new STKEYLABEL(0x20, "[ W ]"), new STKEYLABEL(14, "[ E ]"), new STKEYLABEL(0x1b, "[ R ]"), new STKEYLABEL(0x1d, "[ T ]"), new STKEYLABEL(0x22, "[ Y ]"), new STKEYLABEL(30, "[ U ]"), new STKEYLABEL(0x12, "[ I ]"), new STKEYLABEL(0x18, "[ O ]"), new STKEYLABEL(0x19, "[ P ]"), new STKEYLABEL(0x4a, "[ [ ]"), new STKEYLABEL(0x73, "[ ] ]"), new STKEYLABEL(0x75, "[Enter]"), new STKEYLABEL(0x4b, "[L-Ctrl]"), new STKEYLABEL(10, "[ A ]"), new STKEYLABEL(0x1c, "[ S ]"), new STKEYLABEL(13, "[ D ]"), + new STKEYLABEL(15, "[ F ]"), new STKEYLABEL(0x10, "[ G ]"), new STKEYLABEL(0x11, "[ H ]"), new STKEYLABEL(0x13, "[ J ]"), new STKEYLABEL(20, "[ K ]"), new STKEYLABEL(0x15, "[ L ]"), new STKEYLABEL(0x7b, "[ ; ]"), new STKEYLABEL(0x26, "[ ' ]"), new STKEYLABEL(0x45, "[ ` ]"), new STKEYLABEL(0x4e, "[L-Shift]"), new STKEYLABEL(0x2b, @"[ \]"), new STKEYLABEL(0x23, "[ Z ]"), new STKEYLABEL(0x21, "[ X ]"), new STKEYLABEL(12, "[ C ]"), new STKEYLABEL(0x1f, "[ V ]"), new STKEYLABEL(11, "[ B ]"), + new STKEYLABEL(0x17, "[ N ]"), new STKEYLABEL(0x16, "[ M ]"), new STKEYLABEL(0x2f, "[ , ]"), new STKEYLABEL(0x6f, "[ . ]"), new STKEYLABEL(0x7c, "[ / ]"), new STKEYLABEL(120, "[R-Shift]"), new STKEYLABEL(0x6a, "[ * ]"), new STKEYLABEL(0x4d, "[L-Alt]"), new STKEYLABEL(0x7e, "[Space]"), new STKEYLABEL(0x2d, "[CAPS]"), new STKEYLABEL(0x36, "[F1]"), new STKEYLABEL(0x37, "[F2]"), new STKEYLABEL(0x38, "[F3]"), new STKEYLABEL(0x39, "[F4]"), new STKEYLABEL(0x3a, "[F5]"), new STKEYLABEL(0x3b, "[F6]"), + new STKEYLABEL(60, "[F7]"), new STKEYLABEL(0x3d, "[F8]"), new STKEYLABEL(0x3e, "[F9]"), new STKEYLABEL(0x3f, "[F10]"), new STKEYLABEL(0x58, "[NumLock]"), new STKEYLABEL(0x7a, "[Scroll]"), new STKEYLABEL(0x60, "[NPad7]"), new STKEYLABEL(0x61, "[NPad8]"), new STKEYLABEL(0x62, "[NPad9]"), new STKEYLABEL(0x66, "[NPad-]"), new STKEYLABEL(0x5d, "[NPad4]"), new STKEYLABEL(0x5e, "[NPad5]"), new STKEYLABEL(0x5f, "[NPad6]"), new STKEYLABEL(0x68, "[NPad+]"), new STKEYLABEL(90, "[NPad1]"), new STKEYLABEL(0x5b, "[NPad2]"), + new STKEYLABEL(0x5c, "[NPad3]"), new STKEYLABEL(0x59, "[NPad0]"), new STKEYLABEL(0x67, "[NPad.]"), new STKEYLABEL(0x40, "[F11]"), new STKEYLABEL(0x41, "[F12]"), new STKEYLABEL(0x42, "[F13]"), new STKEYLABEL(0x43, "[F14]"), new STKEYLABEL(0x44, "[F15]"), new STKEYLABEL(0x48, "[Kana]"), new STKEYLABEL(0x24, "[ ? ]"), new STKEYLABEL(0x30, "[Henkan]"), new STKEYLABEL(0x57, "[MuHenkan]"), new STKEYLABEL(0x8f, @"[ \ ]"), new STKEYLABEL(0x25, "[NPad.]"), new STKEYLABEL(0x65, "[NPad=]"), new STKEYLABEL(0x72, "[ ^ ]"), + new STKEYLABEL(40, "[ @ ]"), new STKEYLABEL(0x2e, "[ : ]"), new STKEYLABEL(130, "[ _ ]"), new STKEYLABEL(0x49, "[Kanji]"), new STKEYLABEL(0x7f, "[Stop]"), new STKEYLABEL(0x29, "[AX]"), new STKEYLABEL(100, "[NPEnter]"), new STKEYLABEL(0x74, "[R-Ctrl]"), new STKEYLABEL(0x54, "[Mute]"), new STKEYLABEL(0x2c, "[Calc]"), new STKEYLABEL(0x70, "[PlayPause]"), new STKEYLABEL(0x52, "[MediaStop]"), new STKEYLABEL(0x85, "[Volume-]"), new STKEYLABEL(0x86, "[Volume+]"), new STKEYLABEL(0x8b, "[WebHome]"), new STKEYLABEL(0x63, "[NPad,]"), + new STKEYLABEL(0x69, "[ / ]"), new STKEYLABEL(0x80, "[PrtScn]"), new STKEYLABEL(0x77, "[R-Alt]"), new STKEYLABEL(110, "[Pause]"), new STKEYLABEL(70, "[Home]"), new STKEYLABEL(0x84, "[Up]"), new STKEYLABEL(0x6d, "[PageUp]"), new STKEYLABEL(0x4c, "[Left]"), new STKEYLABEL(0x76, "[Right]"), new STKEYLABEL(0x33, "[End]"), new STKEYLABEL(50, "[Down]"), new STKEYLABEL(0x6c, "[PageDown]"), new STKEYLABEL(0x47, "[Insert]"), new STKEYLABEL(0x31, "[Delete]"), new STKEYLABEL(0x4f, "[L-Win]"), new STKEYLABEL(0x79, "[R-Win]"), + new STKEYLABEL(0x27, "[APP]"), new STKEYLABEL(0x71, "[Power]"), new STKEYLABEL(0x7d, "[Sleep]"), new STKEYLABEL(0x87, "[Wake]") + }; + private int n迴セ蝨ィ縺ョ驕ク謚櫁。; + private EKeyConfigPad pad; + private EKeyConfigPart part; + private CConfigIni.CKeyAssign.STKEYASSIGN[] structReset逕ィKeyAssign; + private string str繝代ャ繝牙錐; + //private CTexture txHitKey繝繧、繧「繝ュ繧ー; + //private CTexture tx繧ォ繝シ繧ス繝ォ; + + private void t繧「繧オ繧、繝ウ繧ウ繝シ繝峨ョ謠冗判_Joypad( int line, int x, int y, int nID, int nCode, bool b蠑キ隱ソ ) + { + string str = ""; + switch( nCode ) + { + case 0: + str = "Left"; + break; + + case 1: + str = "Right"; + break; + + case 2: + str = "Up"; + break; + + case 3: + str = "Down"; + break; + + case 4: + str = "Forward"; + break; + + case 5: + str = "Back"; + break; + + case 6: + str = "CCW"; + break; + + case 7: + str = "CW"; + break; + + default: + if ((8 <= nCode) && (nCode < 8 + 128)) // other buttons (128 types) + { + str = string.Format("Button{0}", nCode - 7); + } + else if ((8 + 128 <= nCode) && (nCode < 8 + 128 + 8)) // POV HAT ( 8 types; 45 degrees per HATs) + { + str = string.Format("POV {0}", (nCode - 8 - 128) * 45); + } + else + { + str = string.Format( "Code{0}", nCode ); + } + break; + } + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.actFont.t譁蟄怜玲緒逕サ( x, y, string.Format( "{0,2}. Joypad #{1} ", line, nID ) + str, b蠑キ隱ソ, 0.75f ); + } + private void t繧「繧オ繧、繝ウ繧ウ繝シ繝峨ョ謠冗判_Keyboard( int line, int x, int y, int nID, int nCode, bool b蠑キ隱ソ ) + { + string str = null; + foreach( STKEYLABEL stkeylabel in this.KeyLabel ) + { + if( stkeylabel.nCode == nCode ) + { + str = string.Format( "{0,2}. Key {1}", line, stkeylabel.strLabel ); + break; + } + } + if( str == null ) + { + str = string.Format( "{0,2}. Key 0x{1:X2}", line, nCode ); + } + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.actFont.t譁蟄怜玲緒逕サ( x, y, str, b蠑キ隱ソ, 0.75f ); + } + private void t繧「繧オ繧、繝ウ繧ウ繝シ繝峨ョ謠冗判_MidiIn( int line, int x, int y, int nID, int nCode, bool b蠑キ隱ソ ) + { + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.actFont.t譁蟄怜玲緒逕サ( x, y, string.Format( "{0,2}. MidiIn #{1} code.{2}", line, nID, nCode ), b蠑キ隱ソ, 0.75f ); + } + private void t繧「繧オ繧、繝ウ繧ウ繝シ繝峨ョ謠冗判_Mouse( int line, int x, int y, int nID, int nCode, bool b蠑キ隱ソ ) + { + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.actFont.t譁蟄怜玲緒逕サ( x, y, string.Format( "{0,2}. Mouse Button{1}", line, nCode ), b蠑キ隱ソ, 0.75f ); + } + private bool t繧ュ繝シ繝√ぉ繝繧ッ縺ィ繧「繧オ繧、繝ウ_Joypad() + { + foreach( IInputDevice device in TJAPlayer3.Input邂。逅.list蜈・蜉帙ョ繝舌う繧ケ ) + { + if( device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.Joystick ) + { + for (int i = 0; i < 8 + 0x80 + 8; i++) // +8 for Axis, +8 for HAT + { + if (device.b繧ュ繝シ縺梧款縺輔l縺(i)) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + TJAPlayer3.ConfigIni.t謖螳壹@縺溷・蜉帙′譌「縺ォ繧「繧オ繧、繝ウ貂医∩縺ァ縺ゅk蝣エ蜷医ッ縺昴l繧貞ィ蜑企勁縺吶k( E蜈・蜉帙ョ繝舌う繧ケ.繧ク繝ァ繧、繝代ャ繝, device.ID, i ); + TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n迴セ蝨ィ縺ョ驕ク謚櫁。 ].蜈・蜉帙ョ繝舌う繧ケ = E蜈・蜉帙ョ繝舌う繧ケ.繧ク繝ァ繧、繝代ャ繝; + TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n迴セ蝨ィ縺ョ驕ク謚櫁。 ].ID = device.ID; + TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n迴セ蝨ィ縺ョ驕ク謚櫁。 ].繧ウ繝シ繝 = i; + return true; + } + } + } + } + return false; + } + private bool t繧ュ繝シ繝√ぉ繝繧ッ縺ィ繧「繧オ繧、繝ウ_Keyboard() + { + for( int i = 0; i < 0x100; i++ ) + { + if (i != (int)SlimDXKeys.Key.Escape && + i != (int)SlimDXKeys.Key.Return && + i != (int)SlimDXKeys.Key.UpArrow && + i != (int)SlimDXKeys.Key.DownArrow && + i != (int)SlimDXKeys.Key.LeftArrow && + i != (int)SlimDXKeys.Key.RightArrow && + i != (int)SlimDXKeys.Key.Delete && + TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺( i ) ) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + TJAPlayer3.ConfigIni.t謖螳壹@縺溷・蜉帙′譌「縺ォ繧「繧オ繧、繝ウ貂医∩縺ァ縺ゅk蝣エ蜷医ッ縺昴l繧貞ィ蜑企勁縺吶k( E蜈・蜉帙ョ繝舌う繧ケ.繧ュ繝シ繝懊シ繝, 0, i ); + TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n迴セ蝨ィ縺ョ驕ク謚櫁。 ].蜈・蜉帙ョ繝舌う繧ケ = E蜈・蜉帙ョ繝舌う繧ケ.繧ュ繝シ繝懊シ繝; + TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n迴セ蝨ィ縺ョ驕ク謚櫁。 ].ID = 0; + TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n迴セ蝨ィ縺ョ驕ク謚櫁。 ].繧ウ繝シ繝 = i; + return true; + } + } + return false; + } + private bool t繧ュ繝シ繝√ぉ繝繧ッ縺ィ繧「繧オ繧、繝ウ_MidiIn() + { + foreach( IInputDevice device in TJAPlayer3.Input邂。逅.list蜈・蜉帙ョ繝舌う繧ケ ) + { + if( device.e蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・ == E蜈・蜉帙ョ繝舌う繧ケ遞ョ蛻・.MidiIn ) + { + for( int i = 0; i < 0x100; i++ ) + { + if( device.b繧ュ繝シ縺梧款縺輔l縺( i ) ) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + TJAPlayer3.ConfigIni.t謖螳壹@縺溷・蜉帙′譌「縺ォ繧「繧オ繧、繝ウ貂医∩縺ァ縺ゅk蝣エ蜷医ッ縺昴l繧貞ィ蜑企勁縺吶k( E蜈・蜉帙ョ繝舌う繧ケ.MIDI蜈・蜉, device.ID, i ); + TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n迴セ蝨ィ縺ョ驕ク謚櫁。 ].蜈・蜉帙ョ繝舌う繧ケ = E蜈・蜉帙ョ繝舌う繧ケ.MIDI蜈・蜉; + TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n迴セ蝨ィ縺ョ驕ク謚櫁。 ].ID = device.ID; + TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n迴セ蝨ィ縺ョ驕ク謚櫁。 ].繧ウ繝シ繝 = i; + return true; + } + } + } + } + return false; + } + private bool t繧ュ繝シ繝√ぉ繝繧ッ縺ィ繧「繧オ繧、繝ウ_Mouse() + { + for( int i = 0; i < 8; i++ ) + { + if( TJAPlayer3.Input邂。逅.Mouse.b繧ュ繝シ縺梧款縺輔l縺( i ) ) + { + TJAPlayer3.ConfigIni.t謖螳壹@縺溷・蜉帙′譌「縺ォ繧「繧オ繧、繝ウ貂医∩縺ァ縺ゅk蝣エ蜷医ッ縺昴l繧貞ィ蜑企勁縺吶k( E蜈・蜉帙ョ繝舌う繧ケ.繝槭え繧ケ, 0, i ); + TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n迴セ蝨ィ縺ョ驕ク謚櫁。 ].蜈・蜉帙ョ繝舌う繧ケ = E蜈・蜉帙ョ繝舌う繧ケ.繝槭え繧ケ; + TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n迴セ蝨ィ縺ョ驕ク謚櫁。 ].ID = 0; + TJAPlayer3.ConfigIni.KeyAssign[ (int) this.part ][ (int) this.pad ][ this.n迴セ蝨ィ縺ョ驕ク謚櫁。 ].繧ウ繝シ繝 = i; + } + } + return false; + } + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/04.Config/CActConfigList.cs b/TJAPlayer3/Stages/04.Config/CActConfigList.cs new file mode 100644 index 00000000..657d02eb --- /dev/null +++ b/TJAPlayer3/Stages/04.Config/CActConfigList.cs @@ -0,0 +1,1773 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using System.Drawing; +using System.Threading; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActConfigList : CActivity + { + // 繝励Ο繝代ユ繧」 + + public bool bIsKeyAssignSelected // #24525 2011.3.15 yyagi + { + get + { + E繝。繝九Η繝シ遞ョ蛻・ e = this.e繝。繝九Η繝シ遞ョ蛻・; + if (e == E繝。繝九Η繝シ遞ョ蛻・.KeyAssignDrums || e == E繝。繝九Η繝シ遞ョ蛻・.KeyAssignSystem) + { + return true; + } + else + { + return false; + } + } + } + public bool bIsFocusingParameter // #32059 2013.9.17 yyagi + { + get + { + return b隕∫エ蛟、縺ォ繝輔か繝シ繧ォ繧ケ荳ュ; + } + } + public bool b迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ縺ッReturnToMenu縺ァ縺ゅk + { + get + { + CItemBase currentItem = this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ]; + if (currentItem == this.iSystemReturnToMenu || currentItem == this.iDrumsReturnToMenu) + { + return true; + } + else + { + return false; + } + } + } + public CItemBase ib迴セ蝨ィ縺ョ驕ク謚樣逶ョ + { + get + { + return this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ]; + } + } + public int n迴セ蝨ィ縺ョ驕ク謚樣逶ョ; + + + // 繝。繧ス繝繝 + #region [ t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟System() ] + public void t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟System() + { + this.tConfigIni縺ク險倬鹸縺吶k(); + this.list鬆逶ョ繝ェ繧ケ繝.Clear(); + + // #27029 2012.1.5 from: 隱ャ譏取枚縺ッ譛螟ァ9陦娯13陦後↓螟画峩縲 + + this.iSystemReturnToMenu = new CItemBase( "<< ReturnTo Menu", CItemBase.E繝代ロ繝ォ遞ョ蛻・.縺昴ョ莉, + "蟾ヲ蛛エ縺ョ繝。繝九Η繝シ縺ォ謌サ繧翫∪縺吶", + "Return to left menu." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemReturnToMenu ); + + this.iSystemReloadDTX = new CItemBase( "譖イ繝繝シ繧ソ蜀崎ェュ霎シ縺ソ", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, + "譖イ繝繝シ繧ソ縺ョ荳隕ァ諠蝣ア繧貞叙蠕励@逶エ縺励∪縺吶", + "Reload song data." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemReloadDTX ); + + //this.iCommonDark = new CItemList( "Dark", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, (int) CDTXMania.ConfigIni.eDark, + // "HALF: 閭梧勹縲√Ξ繝シ繝ウ縲√ご繝シ繧ク縺瑚。ィ遉コ\n縺輔l縺ェ縺上↑繧翫∪縺吶\nFULL: 縺輔i縺ォ蟆冗ッ邱壹∵牛邱壹∝愛螳壹Λ\n繧、繝ウ縲√ヱ繝繝峨b陦ィ遉コ縺輔l縺ェ縺上↑繧翫∪縺吶", + // "OFF: all display parts are shown.\nHALF: wallpaper, lanes and gauge are\n disappeared.\nFULL: additionaly to HALF, bar/beat\n lines, hit bar, pads are disappeared.", + // new string[] { "OFF", "HALF", "FULL" } ); + //this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iCommonDark ); + + this.iTaikoPlayerCount = new CItemInteger( "繝励Ξ繧、莠コ謨ー", 1, 2, TJAPlayer3.ConfigIni.nPlayerCount, + "繝励Ξ繧、莠コ謨ー蛻繧頑崛縺茨シ喀n2縺ォ縺吶k縺ィ貍泌・冗判髱「縺2莠コ繝励Ξ繧、蟆ら畑縺ョ繝ャ繧、繧「繧ヲ繝医↓縺ェ繧翫2P蟆ら畑隴憺擇繧定ェュ縺ソ霎シ繧繧医≧縺ォ縺ェ繧翫∪縺吶", + "" ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iTaikoPlayerCount ); + + this.iSystemRisky = new CItemInteger( "Risky", 0, 10, TJAPlayer3.ConfigIni.nRisky, + "Risky繝「繝シ繝峨ョ險ュ螳:\n1莉・荳翫ョ蛟、縺ォ縺吶k縺ィ縲√◎縺ョ蝗樊焚蛻縺ョ\nPoor/Miss縺ァFAILED縺ィ縺ェ繧翫∪縺吶\n0縺ォ縺吶k縺ィ辟。蜉ケ縺ォ縺ェ繧翫―nDamageLevel縺ォ蠕薙▲縺溘ご繝シ繧ク蠅玲ク帙→\n縺ェ繧翫∪縺吶\nStageFailed縺ョ險ュ螳壹→菴オ逕ィ縺ァ縺阪∪縺吶", + "Risky mode:\nSet over 1, in case you'd like to specify\n the number of Poor/Miss times to be\n FAILED.\nSet 0 to disable Risky mode." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemRisky ); + + this.iCommonPlaySpeed = new CItemInteger("蜀咲函騾溷コヲ", 5, 400, TJAPlayer3.ConfigIni.n貍泌・城溷コヲ, + "譖イ縺ョ貍泌・城溷コヲ繧偵騾溘¥縺励◆繧企≦縺上@縺歃n" + + "繧翫☆繧九%縺ィ縺後〒縺阪∪縺吶\n" + + "シ遺サ荳驛ィ縺ョ繧オ繧ヲ繝ウ繝峨き繝シ繝峨〒縺ッ豁」縺励¥\n" + + "縲蜀咲函縺ァ縺阪↑縺蜿ッ閭ス諤ァ縺後≠繧翫∪縺吶ゑシ噂n" + + "\n" + + "TimeStretch縺薫N縺ョ縺ィ縺阪↓縲∵シ泌・十n" + + "騾溷コヲ繧遅0.850莉・荳九↓縺吶k縺ィ縲√メ繝繝励ョ\n" + + "繧コ繝ャ縺悟、ァ縺阪¥縺ェ繧翫∪縺吶", + "It changes the song speed.\n" + + "For example, you can play in half\n" + + " speed by setting PlaySpeed = 0.500\n" + + " for your practice.\n" + + "\n" + + "Note: It also changes the songs' pitch.\n" + + "In case TimeStretch=ON, some sound\n" + + "lag occurs slower than x0.900."); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iCommonPlaySpeed ); + + this.iSystemTimeStretch = new CItemToggle( "TimeStretch", TJAPlayer3.ConfigIni.bTimeStretch, + "貍泌・城溷コヲ縺ョ螟画峩譁ケ蠑:\n" + + "ON縺ォ縺吶k縺ィ縲∵シ泌・城溷コヲ縺ョ螟画峩繧偵―n" + + "蜻ィ豕「謨ー螟画峩縺ァ縺ッ縺ェ縺十n" + + "繧ソ繧、繝繧ケ繝医Ξ繝繝√〒陦後>縺セ縺吶" + + "\n" + + "縺薙l繧丹N縺ォ縺吶k縺ィ縲√し繧ヲ繝ウ繝牙ヲ逅縺ォ\n" + + "繧医j螟壹¥縺ョCPU諤ァ閭ス繧剃スソ逕ィ縺励∪縺吶\n" + + "縺セ縺溘∵シ泌・城溷コヲ繧遅0.850莉・荳九↓縺吶k縺ィ縲―n" + + "繝√ャ繝励ョ繧コ繝ャ縺悟、ァ縺阪¥縺ェ繧翫∪縺吶", + "How to change the playing speed:\n" + + "Turn ON to use time stretch\n" + + "to change the play speed." + + "\n" + + "If you set TimeStretch=ON, it usese\n" + + "more CPU power. And some sound\n" + + "lag occurs slower than x0.900."); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemTimeStretch ); + + + this.iSystemFullscreen = new CItemToggle( "Fullscreen", TJAPlayer3.ConfigIni.b蜈ィ逕サ髱「繝「繝シ繝, + "逕サ髱「繝「繝シ繝芽ィュ螳夲シ喀nON 縺ァ蜈ィ逕サ髱「繝「繝シ繝峨^FF 縺ァ繧ヲ繧」繝ウ繝噂n繧ヲ繝「繝シ繝峨↓縺ェ繧翫∪縺吶", + "Fullscreen mode or window mode." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemFullscreen ); + this.iSystemStageFailed = new CItemToggle( "StageFailed", TJAPlayer3.ConfigIni.bSTAGEFAILED譛牙柑, + "STAGE FAILED 譛牙柑シ喀nON 縺ォ縺吶k縺ィ縲√ご繝シ繧ク縺後↑縺上↑縺」縺滓凾\n縺ォ STAGE FAILED 縺ィ縺ェ繧頑シ泌・上′荳ュ譁ュ\n縺輔l縺セ縺吶0FF 縺ョ蝣エ蜷医ッ縲√ご繝シ繧ク縺圭n縺ェ縺上↑縺」縺ヲ繧よ怙蠕後∪縺ァ貍泌・上〒縺阪∪縺吶", + "Turn OFF if you don't want to encount\n GAME OVER." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemStageFailed ); + this.iSystemRandomFromSubBox = new CItemToggle( "RandSubBox", TJAPlayer3.ConfigIni.b繝ゥ繝ウ繝繝繧サ繝ャ繧ッ繝医〒蟄殖OX繧呈、懃エ「蟇セ雎。縺ィ縺吶k, + "蟄殖OX繧坦ANDOM縺ョ蟇セ雎。縺ィ縺吶kシ喀nON 縺ォ縺吶k縺ィ縲ヽANDOM SELECT 譎\n縺ォ蟄殖OX繧る∈謚槫ッセ雎。縺ィ縺励∪縺吶", + "Turn ON to use child BOX (subfolders)\n at RANDOM SELECT." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemRandomFromSubBox ); + + + + //this.iSystemAdjustWaves = new CItemToggle( "AdjustWaves", CDTXMania.ConfigIni.bWave蜀咲函菴咲スョ閾ェ蜍戊ェソ謨エ讖溯ス譛牙柑, + // "繧オ繧ヲ繝ウ繝牙咲函菴咲スョ閾ェ蜍戊」懈ュ」シ喀n" + + // "繝上シ繝峨え繧ァ繧「繧ОS縺ォ襍キ蝗縺吶k繧オ繧ヲ繝ウ\n" + + // "繝峨ョ縺壹l繧貞シキ蛻カ逧縺ォ陬懈ュ」縺励∪縺吶\n" + + // "BGM 縺ョ繧医≧縺ォ蜀咲函譎る俣縺ョ髟キ縺髻ウ螢ー\n" + + // "繝繝シ繧ソ縺御スソ逕ィ縺輔l縺ヲ縺繧区峇縺ァ蜉ケ譫懊′\n" + + // "縺ゅj縺セ縺吶" + + // "\n" + + // "窶サ DirectSound菴ソ逕ィ譎ゅョ縺ソ譛牙柑縺ァ縺吶", + // "Automatic wave playing position\n" + + // " adjustment feature. If you turn it ON,\n" + + // " it decrease the lag which comes from\n" + + // " the difference of hardware/OS.\n" + + // "Usually, you should turn it ON." + + // "\n"+ + // "Note: This setting is effetive\n" + + // " only when DirectSound is used."); + //this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemAdjustWaves ); + this.iSystemVSyncWait = new CItemToggle( "VSyncWait", TJAPlayer3.ConfigIni.b蝙ら峩蟶ー邱壼セ縺。繧定。後≧, + "蝙ら峩蟶ー邱壼酔譛滂シ喀n逕サ髱「縺ョ謠冗判繧偵ョ繧」繧ケ繝励Ξ繧、縺ョ蝙ら峩蟶ー\n邱壻クュ縺ォ陦後↑縺蝣エ蜷医↓縺ッ ON 繧呈欠螳壹@\n縺セ縺吶0N 縺ォ縺吶k縺ィ縲√ぎ繧ソ縺、縺阪ョ縺ェ縺Ыn貊代i縺九↑逕サ髱「謠冗判縺悟ョ溽樟縺輔l縺セ縺吶", + "Turn ON to wait VSync (Vertical\n Synchronizing signal) at every\n drawings. (so FPS becomes 60)\nIf you have enough CPU/GPU power,\n the scroll would become smooth." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemVSyncWait ); + this.iSystemAVI = new CItemToggle( "AVI", TJAPlayer3.ConfigIni.bAVI譛牙柑, + "AVI縺ョ菴ソ逕ィシ喀n蜍慕判(AVI)繧貞咲函蜿ッ閭ス縺ォ縺吶k蝣エ蜷医↓\nON 縺ォ縺励∪縺吶AVI 縺ョ蜀咲函縺ォ縺ッ縲√◎繧圭n縺ェ繧翫ョ繝槭す繝ウ繝代Ρ繝シ縺悟ソ隕√→縺輔l縺セ縺吶", + "To use AVI playback or not." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemAVI ); + this.iSystemBGA = new CItemToggle( "BGA", TJAPlayer3.ConfigIni.bBGA譛牙柑, + "BGA縺ョ菴ソ逕ィシ喀n逕サ蜒(BGA)繧定。ィ遉コ蜿ッ閭ス縺ォ縺吶k蝣エ蜷医↓\nON 縺ォ縺励∪縺吶BGA 縺ョ蜀咲函縺ォ縺ッ縲√◎繧圭n縺ェ繧翫ョ繝槭す繝ウ繝代Ρ繝シ縺悟ソ隕√→縺輔l縺セ縺吶", + "To draw BGA (back ground animations)\n or not." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemBGA ); + this.iSystemPreviewSoundWait = new CItemInteger( "PreSoundWait", 0, 0x2710, TJAPlayer3.ConfigIni.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ髻ウ縺碁ウエ繧九∪縺ァ縺ョ繧ヲ繧ァ繧、繝ms, + "繝励Ξ繝薙Η繝シ髻ウ貍泌・上∪縺ァ縺ョ譎る俣シ喀n譖イ縺ォ繧ォ繝シ繧ス繝ォ縺悟粋繧上&繧後※縺九i繝励Ξ\n繝薙Η繝シ髻ウ縺碁ウエ繧雁ァ九a繧九∪縺ァ縺ョ譎る俣繧箪n謖螳壹@縺セ縺吶\n0 ス 10000 [ms] 縺梧欠螳壼庄閭ス縺ァ縺吶", + "Delay time(ms) to start playing preview\n sound in SELECT MUSIC screen.\nYou can specify from 0ms to 10000ms." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemPreviewSoundWait ); + this.iSystemPreviewImageWait = new CItemInteger( "PreImageWait", 0, 0x2710, TJAPlayer3.ConfigIni.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ逕サ蜒上′陦ィ遉コ髢句ァ九&繧後k縺セ縺ァ縺ョ繧ヲ繧ァ繧、繝ms, + "繝励Ξ繝薙Η繝シ逕サ蜒剰。ィ遉コ縺セ縺ァ縺ョ譎る俣シ喀n譖イ縺ォ繧ォ繝シ繧ス繝ォ縺悟粋繧上&繧後※縺九i繝励Ξ\n繝薙Η繝シ逕サ蜒上′陦ィ遉コ縺輔l繧九∪縺ァ縺ョ譎る俣\n繧呈欠螳壹@縺セ縺吶\n0 ス 10000 [ms] 縺梧欠螳壼庄閭ス縺ァ縺吶", + "Delay time(ms) to show preview image\n in SELECT MUSIC screen.\nYou can specify from 0ms to 10000ms." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemPreviewImageWait ); + this.iSystemDebugInfo = new CItemToggle( "Debug Info", TJAPlayer3.ConfigIni.b貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k, + "貍泌・乗ュ蝣ア縺ョ陦ィ遉コシ喀n貍泌・丈クュ縲。GA鬆伜沺縺ョ荳矩Κ縺ォ貍泌・乗ュ蝣ア\nシFPS縲。PM縲∵シ泌・乗凾髢薙↑縺ゥシ峨r陦ィ遉コ縺予n縺セ縺吶\n縺セ縺溘∝ー冗ッ邱壹ョ讓ェ縺ォ蟆冗ッ逡ェ蜿キ縺瑚。ィ遉コ\n縺輔l繧九h縺縺ォ縺ェ繧翫∪縺吶", + "To show song informations on playing\n BGA area. (FPS, BPM, total time etc)\nYou can ON/OFF the indications\n by pushing [Del] while playing drums" ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemDebugInfo ); + this.iSystemBGAlpha = new CItemInteger( "BG Alpha", 0, 0xff, TJAPlayer3.ConfigIni.n閭梧勹縺ョ騾城℃蠎ヲ, + "閭梧勹逕サ蜒上ョ蜊企乗主牡蜷茨シ喀n閭梧勹逕サ蜒上rDTXMania縺ョ繝輔Ξ繝シ繝逕サ蜒十n縺ィ蜷域舌☆繧矩圀縺ョ縲∬レ譎ッ逕サ蜒上ョ騾乗主コヲ\n繧呈欠螳壹@縺セ縺吶\n0 縺悟ョ悟ィ騾乗弱〒縲255 縺悟ョ悟ィ荳埼乗蚕n縺ィ縺ェ繧翫∪縺吶", + "The degree for transparing playing\n screen and wallpaper.\n\n0=completely transparent,\n255=no transparency" ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemBGAlpha ); + this.iSystemBGMSound = new CItemToggle( "BGM Sound", TJAPlayer3.ConfigIni.bBGM髻ウ繧堤匱螢ー縺吶k, + "BGM縺ョ蜀咲函シ喀n縺薙l繧丹FF縺ォ縺吶k縺ィ縲。GM 繧貞咲函縺励↑\n縺上↑繧翫∪縺吶", + "Turn OFF if you don't want to play\n BGM." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemBGMSound ); + //this.iSystemAudienceSound = new CItemToggle( "Audience", CDTXMania.ConfigIni.b豁灘」ー繧堤匱螢ー縺吶k, + // "豁灘」ー縺ョ蜀咲函シ喀n縺薙l繧丹FF縺ォ縺吶k縺ィ縲∵ュ灘」ー繧貞咲函縺励↑\n縺上↑繧翫∪縺吶", + // "Turn ON if you want to be cheered\n at the end of fill-in zone or not." ); + //this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemAudienceSound ); + //this.iSystemDamageLevel = new CItemList( "DamageLevel", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, (int) CDTXMania.ConfigIni.e繝繝。繝シ繧ク繝ャ繝吶Ν, + // "繧イ繝シ繧ク貂帛ー大牡蜷茨シ喀nMiss 繝偵ャ繝域凾縺ョ繧イ繝シ繧ク縺ョ貂帛ー大コヲ蜷医>\n繧呈欠螳壹@縺セ縺吶\nRisky縺1莉・荳翫ョ蝣エ蜷医ッ辟。蜉ケ縺ィ縺ェ繧翫∪縺", + // "Damage level at missing (and\n recovering level) at playing.\nThis setting is ignored when Risky >= 1.", + // new string[] { "Small", "Normal", "Large" } ); + //this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemDamageLevel ); + this.iSystemSaveScore = new CItemToggle( "SaveScore", TJAPlayer3.ConfigIni.bScoreIni繧貞コ蜉帙☆繧, + "貍泌・剰ィ倬鹸縺ョ菫晏ュ假シ喀nON 縺ァ貍泌・剰ィ倬鹸繧 ス.score.ini 繝輔ぃ繧、\n繝ォ縺ォ菫晏ュ倥@縺セ縺吶\n", + "To save high-scores/skills, turn it ON.\nTurn OFF in case your song data are\n in read-only media (CD-ROM etc).\nNote that the score files also contain\n 'BGM Adjust' parameter. So if you\n want to keep adjusting parameter,\n you need to set SaveScore=ON." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemSaveScore ); + + this.iSystemApplyLoudnessMetadata = new CItemToggle( "Apply Loudness Metadata", TJAPlayer3.ConfigIni.ApplyLoudnessMetadata, + "BS1770GAIN 縺ォ繧医k繝ゥ繧ヲ繝峨ロ繧ケ繝。繝シ繧ソ縺ョ貂ャ驥上r驕ゥ逕ィ縺励∪縺吶\n蛻ゥ逕ィ縺吶k縺ォ縺ッBS1770GAIN縺悟ソ隕√〒縺吶", + "To apply BS1770GAIN loudness\nmetadata when playing songs, turn it ON.\nTurn OFF if you prefer to use only\nthe main song level controls.\nIt needs BS1770GAIN." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemApplyLoudnessMetadata ); + + this.iSystemTargetLoudness = new CItemInteger( "Target Loudness", (int)Math.Round(CSound.MinimumLufs.ToDouble() * 10.0), (int)Math.Round(CSound.MaximumLufs.ToDouble() * 10.0), (int)Math.Round(TJAPlayer3.ConfigIni.TargetLoudness * 10.0), + "BS1770GAIN 縺ォ繧医k繝ゥ繧ヲ繝峨ロ繧ケ繝。繝シ繧ソ縺ョ逶ョ讓吝、繧呈欠螳壹@縺セ縺吶", + "When applying BS1770GAIN loudness\nmetadata while playing songs, song levels\nwill be adjusted to target this loudness,\nmeasured in cB (centibels) relative to full scale.\n"); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemTargetLoudness ); + + this.iSystemApplySongVol = new CItemToggle( "Apply SONGVOL", TJAPlayer3.ConfigIni.ApplySongVol, + ".tja繝輔ぃ繧、繝ォ縺ョSONGVOL繝倥ャ繝繧帝浹貅舌ョ髻ウ驥上↓驕ゥ逕ィ縺励∪縺吶りィュ螳壹↓繧医k髻ウ驥剰ェソ謨エ繧剃スソ逕ィ縺吶k蝣エ蜷医ッ縺薙ョ險ュ螳壹rOFF縺ォ縺励※縺上□縺輔>縲", + "To apply .tja SONGVOL properties when playing\nsongs, turn it ON. Turn OFF if you prefer to\nuse only the main song level controls." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemApplySongVol ); + + this.iSystemSoundEffectLevel = new CItemInteger( "Sound Effect Level", CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, TJAPlayer3.ConfigIni.SoundEffectLevel, + $"蜉ケ譫憺浹縺ョ髻ウ驥上r隱ソ遽縺励∪縺吶\n{CSound.MinimumGroupLevel} ス {CSound.MaximumGroupLevel} % 縺ョ蛟、縺梧欠螳壼庄閭ス縺ァ縺吶\n", + $"The level adjustment for sound effects.\nYou can specify from {CSound.MinimumGroupLevel} to {CSound.MaximumGroupLevel}%." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemSoundEffectLevel ); + + this.iSystemVoiceLevel = new CItemInteger( "Voice Level", CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, TJAPlayer3.ConfigIni.VoiceLevel, + $"蜷逕サ髱「縺ァ豬√l繧九懊う繧ケ縲√さ繝ウ繝懊懊う繧ケ縺ョ髻ウ驥上r隱ソ遽縺励∪縺吶\n{CSound.MinimumGroupLevel} ス {CSound.MaximumGroupLevel} % 縺ョ蛟、縺梧欠螳壼庄閭ス縺ァ縺吶\n", + $"The level adjustment for voices.\nYou can specify from {CSound.MinimumGroupLevel} to {CSound.MaximumGroupLevel}%." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemVoiceLevel ); + + this.iSystemSongPlaybackLevel = new CItemInteger( "Song Playback Level", CSound.MinimumGroupLevel, CSound.MaximumGroupLevel, TJAPlayer3.ConfigIni.SongPlaybackLevel, + $"繧イ繝シ繝荳ュ縺ョ髻ウ貅舌ョ髻ウ驥上r隱ソ遽縺励∪縺吶\n{CSound.MinimumGroupLevel} ス {CSound.MaximumGroupLevel} % 縺ョ蛟、縺梧欠螳壼庄閭ス縺ァ縺吶\n", + $"The level adjustment for songs during gameplay.\nYou can specify from {CSound.MinimumGroupLevel} to {CSound.MaximumGroupLevel}%." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemSongPlaybackLevel ); + + this.iSystemKeyboardSoundLevelIncrement = new CItemInteger( "Keyboard Level Increment", 1, 20, TJAPlayer3.ConfigIni.KeyboardSoundLevelIncrement, + "繧ュ繝シ繝懊シ繝峨〒髻ウ驥剰ェソ謨エ繧偵☆繧九→縺阪ョ蠅怜刈驥上∵ク帛ー鷹上r謖螳壹@縺セ縺吶\n1 ス 20 縺ョ蛟、縺梧欠螳壼庄閭ス縺ァ縺吶\n", + "The amount of sound level change for each press\nof a sound level control key.\nYou can specify from 1 to 20." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemKeyboardSoundLevelIncrement ); + + this.MusicPreTimeMs = new CItemInteger("MusicPreTimeMs", 0, 10000, TJAPlayer3.ConfigIni.MusicPreTimeMs, + "髻ウ貅仙咲函蜑阪ョ遨コ逋ス譎る俣 (ms)縲\n", + "Blank time before music source to play. (ms)\n"); + this.list鬆逶ョ繝ェ繧ケ繝.Add(this.MusicPreTimeMs); + + //this.iSystemStoicMode = new CItemToggle( "StoicMode", CDTXMania.ConfigIni.b繧ケ繝医う繝繧ッ繝「繝シ繝, + // "繧ケ繝医う繝繧ッシ育ヲ∵ャイシ峨Δ繝シ繝会シ喀n莉・荳九r縺セ縺ィ繧√※陦ィ遉コON/OFF縺励∪縺吶\n_繝励Ξ繝薙Η繝シ逕サ蜒/蜍慕判\n_繝ェ繧カ繝ォ繝育判蜒/蜍慕判\n_NowLoading逕サ蜒十n_貍泌・冗判髱「縺ョ閭梧勹逕サ蜒十n_BGA 逕サ蜒 / AVI 蜍慕判\n_繧ー繝ゥ繝慕判蜒十n", + // "Turn ON to disable drawing\n * preview image / movie\n * result image / movie\n * nowloading image\n * wallpaper (in playing screen)\n * BGA / AVI (in playing screen)" ); + //this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemStoicMode ); + //this.iSystemShowLag = new CItemList( "ShowLagTime", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, CDTXMania.ConfigIni.nShowLagType, + // "繧コ繝ャ譎る俣陦ィ遉コシ喀n繧ク繝」繧ケ繝医ち繧、繝溘Φ繧ー縺九i縺ョ繧コ繝ャ譎る俣(ms)\n繧定。ィ遉コ縺励∪縺吶\n OFF: 繧コ繝ャ譎る俣繧定。ィ遉コ縺励∪縺帙s縲\n ON: 繧コ繝ャ譎る俣繧定。ィ遉コ縺励∪縺吶\n GREAT-: PERFECT莉・螟悶ョ譎ゅョ縺ソ\n陦ィ遉コ縺励∪縺吶", + // "About displaying the lag from\n the \"just timing\".\n OFF: Don't show it.\n ON: Show it.\n GREAT-: Show it except you've\n gotten PERFECT.", + // new string[] { "OFF", "ON", "GREAT-" } ); + //this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemShowLag ); + this.iSystemAutoResultCapture = new CItemToggle( "Autosaveresult", TJAPlayer3.ConfigIni.bIsAutoResultCapture, + "繝ェ繧カ繝ォ繝育判蜒剰ェ蜍穂ソ晏ュ俶ゥ溯スシ喀nON縺ォ縺吶k縺ィ縲√ワ繧、繧ケ繧ウ繧「/繝上う繧ケ繧ュ繝ォ譎ゅ↓\n閾ェ蜍輔〒繝ェ繧カ繝ォ繝育判蜒上r譖イ繝繝シ繧ソ縺ィ蜷後§\n繝輔か繝ォ繝縺ォ菫晏ュ倥@縺セ縺吶", + "AutoSaveResult:\nTurn ON to save your result screen\n image automatically when you get\n hiscore/hiskill." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemAutoResultCapture ); + + SendDiscordPlayingInformation = new CItemToggle(nameof(SendDiscordPlayingInformation), + TJAPlayer3.ConfigIni.SendDiscordPlayingInformation, + "Discord縺ォ蜀咲函荳ュ縺ョ隴憺擇諠蝣ア繧帝∽ソ。縺吶k", + "Share Playing .tja file infomation on Discord."); + list鬆逶ョ繝ェ繧ケ繝.Add(SendDiscordPlayingInformation); + + //this.iSystemJudgeDispPriority = new CItemList( "JudgePriority", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, (int) CDTXMania.ConfigIni.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ, + // "蛻、螳壽枚蟄怜励→繧ウ繝ウ繝懆。ィ遉コ縺ョ蜆ェ蜈磯菴阪r\n" + + // "謖螳壹@縺セ縺吶\n" + + // "\n" + + // " Under: 繝√ャ繝励ョ荳九↓陦ィ遉コ縺励∪縺吶\n" + + // " Over: 繝√ャ繝励ョ荳翫↓陦ィ遉コ縺励∪縺吶", + // "The display prioity between chips\n" + + // " and judge mark/combo.\n" + + // "\n" + + // " Under: Show them under the chips.\n" + + // " Over: Show them over the chips.", + // new string[] { "Under", "Over" } ); + //this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemJudgeDispPriority ); + + this.iSystemBufferedInput = new CItemToggle( "BufferedInput", TJAPlayer3.ConfigIni.b繝舌ャ繝輔ぃ蜈・蜉帙r陦後≧, + "繝舌ャ繝輔ぃ蜈・蜉帙Δ繝シ繝会シ喀nON 縺ォ縺吶k縺ィ縲:PS 繧定カ縺医k蜈・蜉幄ァ」蜒十n蠎ヲ繧貞ョ溽樟縺励∪縺吶\nOFF 縺ォ縺吶k縺ィ縲∝・蜉幄ァ」蜒丞コヲ縺ッ FPS 縺ォ\n遲峨@縺上↑繧翫∪縺吶", + "To select joystick input method.\n\nON to use buffer input. No lost/lags.\nOFF to use realtime input. It may\n causes lost/lags for input.\n Moreover, input frequency is\n synchronized with FPS." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemBufferedInput ); + this.iLogOutputLog = new CItemToggle( "TraceLog", TJAPlayer3.ConfigIni.b繝ュ繧ー蜃コ蜉, + "Trace繝ュ繧ー蜃コ蜉幢シ喀nDTXManiaLog.txt 縺ォ繝ュ繧ー繧貞コ蜉帙@縺セ縺吶\n螟画峩縺励◆蝣エ蜷医ッ縲.TXMania 縺ョ蜀崎オキ蜍表n蠕後↓譛牙柑縺ィ縺ェ繧翫∪縺吶", + "Turn ON to put debug log to\n DTXManiaLog.txt\nTo take it effective, you need to\n re-open DTXMania." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iLogOutputLog ); + + // #24820 2013.1.3 yyagi + this.iSystemSoundType = new CItemList("SoundType", CItemList.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, TJAPlayer3.ConfigIni.nSoundDeviceType, + "繧オ繧ヲ繝ウ繝峨ョ蜃コ蜉帶婿蠑:\n" + + "WASAPI, ASIO, DSound(DirectSound)\n" + + "縺ョ荳ュ縺九i繧オ繧ヲ繝ウ繝牙コ蜉帶婿蠑上r驕ク謚杤n" + + "縺励∪縺吶\n" + + "WASAPI縺ッVista莉・髯阪〒縺ョ縺ソ菴ソ逕ィ蜿ッ閭ス\n" + + "縺ァ縺吶ASIO縺ッ蟇セ蠢懈ゥ溷勣縺ァ縺ョ縺ソ菴ソ逕ィ\n" + + "蜿ッ閭ス縺ァ縺吶\n" + + "WASAPI縺帰SIO繧呈欠螳壹☆繧九%縺ィ縺ァ縲―n" + + "驕蟒カ縺ョ蟆代↑縺貍泌・上r讌ス縺励縺薙→縺圭n" + + "縺ァ縺阪∪縺吶\n" + + "\n" + + "窶サ 險ュ螳壹ッCONFIGURATION逕サ髱「縺ョ\n" + + "縲邨ゆコ譎ゅ↓譛牙柑縺ォ縺ェ繧翫∪縺吶", + "Sound output type:\n" + + "You can choose WASAPI, ASIO or\n" + + "DShow(DirectShow).\n" + + "WASAPI can use only after Vista.\n" + + "ASIO can use on the\n" + + "\"ASIO-supported\" sound device.\n" + + "You should use WASAPI or ASIO\n" + + "to decrease the sound lag.\n" + + "\n" + + "Note: Exit CONFIGURATION to make\n" + + " the setting take effect.", + new string[] { "DSound", "ASIO", "WASAPI" }); + this.list鬆逶ョ繝ェ繧ケ繝.Add(this.iSystemSoundType); + + // #24820 2013.1.15 yyagi + this.iSystemWASAPIBufferSizeMs = new CItemInteger( "WASAPIBufSize", 0, 99999, TJAPlayer3.ConfigIni.nWASAPIBufferSizeMs, + "WASAPI菴ソ逕ィ譎ゅョ繝舌ャ繝輔ぃ繧オ繧、繧コ:\n" + + "0ス99999ms 繧呈欠螳壼庄閭ス縺ァ縺吶\n" + + "0繧呈欠螳壹☆繧九→縲^S縺後ヰ繝繝輔ぃ縺ョ\n" + + "繧オ繧、繧コ繧定ェ蜍戊ィュ螳壹@縺セ縺吶\n" + + "蛟、繧貞ー上&縺上☆繧九⊇縺ゥ逋コ髻ウ繝ゥ繧ー縺圭n" + + "貂帛ー代@縺セ縺吶′縲髻ウ蜑イ繧後d逡ー蟶ク蜍穂ス懊r\n" + + "蠑輔″襍キ縺薙☆蝣エ蜷医′縺ゅj縺セ縺吶\n" + + "窶サ 險ュ螳壹ッCONFIGURATION逕サ髱「縺ョ\n" + + "縲邨ゆコ譎ゅ↓譛牙柑縺ォ縺ェ繧翫∪縺吶", + "Sound buffer size for WASAPI:\n" + + "You can set from 0 to 99999ms.\n" + + "Set 0 to use a default sysytem\n" + + "buffer size.\n" + + "Smaller value makes smaller lag,\n" + + "but it may cause sound troubles.\n" + + "\n" + + "Note: Exit CONFIGURATION to make\n" + + " the setting take effect." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemWASAPIBufferSizeMs ); + + // #24820 2013.1.17 yyagi + string[] asiodevs = CEnumerateAllAsioDevices.GetAllASIODevices(); + this.iSystemASIODevice = new CItemList( "ASIO device", CItemList.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, TJAPlayer3.ConfigIni.nASIODevice, + "ASIO繝繝舌う繧ケ:\n" + + "ASIO菴ソ逕ィ譎ゅョ繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ繧箪n" + + "驕ク謚槭@縺セ縺吶\n" + + "\n" + + "窶サ 險ュ螳壹ッCONFIGURATION逕サ髱「縺ョ\n" + + "縲邨ゆコ譎ゅ↓譛牙柑縺ォ縺ェ繧翫∪縺吶", + "ASIO Sound Device:\n" + + "Select the sound device to use\n" + + "under ASIO mode.\n" + + "\n" + + "Note: Exit CONFIGURATION to make\n" + + " the setting take effect.", + asiodevs ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemASIODevice ); + + // #24820 2013.1.3 yyagi + //this.iSystemASIOBufferSizeMs = new CItemInteger("ASIOBuffSize", 0, 99999, CDTXMania.ConfigIni.nASIOBufferSizeMs, + // "ASIO菴ソ逕ィ譎ゅョ繝舌ャ繝輔ぃ繧オ繧、繧コ:\n" + + // "0ス99999ms 繧呈欠螳壼庄閭ス縺ァ縺吶\n" + + // "謗ィ螂ィ蛟、縺ッ0縺ァ縲√し繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ァ縺ョ\n" + + // "險ュ螳壼、繧偵◎縺ョ縺セ縺セ菴ソ逕ィ縺励∪縺吶\n" + + // "(繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺ョASIO險ュ螳壹ッ縲―n" + + // " ASIO caps縺ェ縺ゥ縺ァ陦後>縺セ縺)\n" + + // "蛟、繧貞ー上&縺上☆繧九⊇縺ゥ逋コ髻ウ繝ゥ繧ー縺圭n" + + // "貂帛ー代@縺セ縺吶′縲髻ウ蜑イ繧後d逡ー蟶ク蜍穂ス懊r\n" + + // "蠑輔″襍キ縺薙☆蝣エ蜷医′縺ゅj縺セ縺吶\n" + + // "\n" + + // "窶サ 險ュ螳壹ッCONFIGURATION逕サ髱「縺ョ\n" + + // "縲邨ゆコ譎ゅ↓譛牙柑縺ォ縺ェ繧翫∪縺吶", + // "Sound buffer size for ASIO:\n" + + // "You can set from 0 to 99999ms.\n" + + // "You should set it to 0, to use\n" + + // "a default value specified to\n" + + // "the sound device.\n" + + // "Smaller value makes smaller lag,\n" + + // "but it may cause sound troubles.\n" + + // "\n" + + // "Note: Exit CONFIGURATION to make\n" + + // " the setting take effect." ); + //this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemASIOBufferSizeMs ); + + // #33689 2014.6.17 yyagi + this.iSystemSoundTimerType = new CItemToggle( "UseOSTimer", TJAPlayer3.ConfigIni.bUseOSTimer, + "OS繧ソ繧、繝槭シ繧剃スソ逕ィ縺吶k縺九←縺縺:\n" + + "貍泌・上ち繧、繝槭シ縺ィ縺励※縲.TXMania迢ャ閾ェ縺ョ\n" + + "繧ソ繧、繝槭シ繧剃スソ縺縺九^S讓呎コ悶ョ繧ソ繧、繝槭シ\n" + + "繧剃スソ縺縺九r驕ク謚槭@縺セ縺吶\n" + + "OS讓呎コ悶ち繧、繝槭シ繧剃スソ縺縺ィ繧ケ繧ッ繝ュ繝シ繝ォ縺圭n" + + "貊代i縺九↓縺ェ繧翫∪縺吶′縲∵シ泌・上〒髻ウ繧コ繝ャ縺圭n" + + "逋コ逕溘☆繧九%縺ィ縺後≠繧翫∪縺吶(縺昴ョ縺溘a\n" + + "AdjustWaves縺ョ蜉ケ譫懊′驕ゥ逕ィ縺輔l縺セ縺吶)\n" + + "\n" + + "縺薙ョ謖螳壹ッWASAPI/ASIO菴ソ逕ィ譎ゅョ縺ソ譛牙柑\n" + + "縺ァ縺吶\n", + "Use OS Timer or not:\n" + + "If this settings is ON, DTXMania uses\n" + + "OS Standard timer. It brings smooth\n" + + "scroll, but may cause some sound lag.\n" + + "(so AdjustWaves is also avilable)\n" + + "\n" + + "If OFF, DTXMania uses its original\n" + + "timer and the effect is vice versa.\n" + + "\n" + + "This settings is avilable only when\n" + + "you uses WASAPI/ASIO.\n" + ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemSoundTimerType ); + + + ShowChara = new CItemToggle("ShowChara", TJAPlayer3.ConfigIni.ShowChara, + "繧ュ繝」繝ゥ繧ッ繧ソ繝シ逕サ蜒上r陦ィ遉コ縺吶k縺九←縺縺欺n", + "Show Character Images.\n" + + ""); + this.list鬆逶ョ繝ェ繧ケ繝.Add(ShowChara); + + ShowDancer = new CItemToggle("ShowDancer", TJAPlayer3.ConfigIni.ShowDancer, + "繝繝ウ繧オ繝シ逕サ蜒上r陦ィ遉コ縺吶k縺九←縺縺欺n", + "Show Dancer Images.\n" + + ""); + this.list鬆逶ョ繝ェ繧ケ繝.Add(ShowDancer); + + ShowMob = new CItemToggle("ShowMob", TJAPlayer3.ConfigIni.ShowMob, + "繝「繝也判蜒上r陦ィ遉コ縺吶k縺九←縺縺欺n", + "Show Mob Images.\n" + + ""); + this.list鬆逶ョ繝ェ繧ケ繝.Add(ShowMob); + + ShowRunner = new CItemToggle("ShowRunner", TJAPlayer3.ConfigIni.ShowRunner, + "繝ゥ繝ウ繝翫シ逕サ蜒上r陦ィ遉コ縺吶k縺九←縺縺欺n", + "Show Runner Images.\n" + + ""); + this.list鬆逶ョ繝ェ繧ケ繝.Add(ShowRunner); + + ShowFooter = new CItemToggle("ShowFooter", TJAPlayer3.ConfigIni.ShowFooter, + "繝輔ャ繧ソ繝シ逕サ蜒上r陦ィ遉コ縺吶k縺九←縺縺欺n", + "Show Footer Image.\n" + + ""); + this.list鬆逶ョ繝ェ繧ケ繝.Add(ShowFooter); + + FastRender = new CItemToggle(nameof(FastRender), TJAPlayer3.ConfigIni.FastRender, + "莠句燕逕サ蜒乗緒逕サ讖溯ス繧剃スソ縺縺九←縺縺九\n", + "Use pre-textures render.\n"); + this.list鬆逶ョ繝ェ繧ケ繝.Add(FastRender); + ShowPuchiChara = new CItemToggle("ShowPuchiChara", TJAPlayer3.ConfigIni.ShowPuchiChara, + "縺キ縺。繧ュ繝」繝ゥ逕サ蜒上r陦ィ遉コ縺吶k縺九←縺縺欺n", + "Show PuchiChara Images.\n" + + ""); + this.list鬆逶ョ繝ェ繧ケ繝.Add(ShowPuchiChara); + + + + this.iSystemSkinSubfolder = new CItemList("Skin (蜈ィ菴)", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, nSkinIndex, + "繧ケ繧ュ繝ウ蛻譖ソシ喀n" + + "繧ケ繧ュ繝ウ繧貞繧頑崛縺医∪縺吶\n", + //"CONFIGURATION繧呈栢縺代k縺ィ縲∬ィュ螳壹@縺歃n" + + //"繧ケ繧ュ繝ウ縺ォ螟画峩縺輔l縺セ縺吶", + "Skin:\n" + + "Change skin.", + skinNames); + this.list鬆逶ョ繝ェ繧ケ繝.Add(this.iSystemSkinSubfolder); + //this.iSystemUseBoxDefSkin = new CItemToggle( "Skin (Box)", CDTXMania.ConfigIni.bUseBoxDefSkin, + // "Music box繧ケ繧ュ繝ウ縺ョ蛻ゥ逕ィシ喀n" + + // "迚ケ蛻・縺ェ繧ケ繧ュ繝ウ縺瑚ィュ螳壹&繧後◆Music box\n" + + // "縺ォ蜃コ蜈・繧翫@縺溘→縺阪↓縲∬ェ蜍輔〒繧ケ繧ュ繝ウ繧箪n" + + // "蛻繧頑崛縺医k縺九←縺縺九r險ュ螳壹@縺セ縺吶\n", + // //"\n" + + // //"(Music Box繧ケ繧ュ繝ウ縺ッ縲|ox.def繝輔ぃ繧、繝ォ\n" + + // //" 縺ァ謖螳壹〒縺阪∪縺)\n", + // "Box skin:\n" + + // "Automatically change skin\n" + + // "specified in box.def file." ); + //this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemUseBoxDefSkin ); + + + this.iSystemGoToKeyAssign = new CItemBase( "System Keys", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, + "繧キ繧ケ繝繝縺ョ繧ュ繝シ蜈・蜉帙↓髢「縺吶k鬆逶ョ繧定ィュ\n螳壹@縺セ縺吶", + "Settings for the system key/pad inputs." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemGoToKeyAssign ); + + OnListMenu縺ョ蛻晄悄蛹(); + this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ = 0; + this.e繝。繝九Η繝シ遞ョ蛻・ = E繝。繝九Η繝シ遞ョ蛻・.System; + } + #endregion + #region [ t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟Drums() ] + public void t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟Drums() + { + this.tConfigIni縺ク險倬鹸縺吶k(); + this.list鬆逶ョ繝ェ繧ケ繝.Clear(); + + // #27029 2012.1.5 from: 隱ャ譏取枚縺ッ譛螟ァ9陦娯13陦後↓螟画峩縲 + + this.iDrumsReturnToMenu = new CItemBase( "<< Return To Menu", CItemBase.E繝代ロ繝ォ遞ョ蛻・.縺昴ョ莉, + "蟾ヲ蛛エ縺ョ繝。繝九Η繝シ縺ォ謌サ繧翫∪縺吶", + "Return to left menu." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iDrumsReturnToMenu ); + + #region [ AutoPlay ] + this.iTaikoAutoPlay = new CItemToggle( "AUTO PLAY", TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay, + "縺吶∋縺ヲ縺ョ髻ウ隨ヲ繧定ェ蜍輔〒貍泌・上@縺セ縺吶\n" + + "", + "To play both Taiko\n" + + " automatically." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iTaikoAutoPlay ); + + this.iTaikoAutoPlay2P = new CItemToggle( "AUTO PLAY 2P", TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay, + "縺吶∋縺ヲ縺ョ髻ウ隨ヲ繧定ェ蜍輔〒貍泌・上@縺セ縺吶\n" + + "", + "To play both Taiko\n" + + " automatically." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iTaikoAutoPlay2P ); + + this.iTaikoAutoRoll = new CItemToggle( "AUTO Roll", TJAPlayer3.ConfigIni.bAuto蜈育函縺ョ騾」謇, + "OFF縺ォ縺吶k縺ィAUTO蜈育函縺碁サ濶イ騾」謇薙r\n" + + "蜿ゥ縺九↑縺上↑繧翫∪縺吶", + "To play both Taiko\n" + + " automatically." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iTaikoAutoRoll ); + #endregion + + this.iDrumsScrollSpeed = new CItemInteger( "ScrollSpeed", 0, 0x7cf, TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums, + "貍泌・乗凾縺ョ繝峨Λ繝隴憺擇縺ョ繧ケ繧ッ繝ュ繝シ繝ォ縺ョ\n" + + "騾溷コヲ繧呈欠螳壹@縺セ縺吶\n" + + "x0.1 ス x200.0 繧呈欠螳壼庄閭ス縺ァ縺吶", + "To change the scroll speed for the\n" + + "drums lanes.\n" + + "You can set it from x0.1 to x200.0.\n" + + "(ScrollSpeed=x0.5 means half speed)" ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iDrumsScrollSpeed ); + + this.iSystemRisky = new CItemInteger( "Risky", 0, 10, TJAPlayer3.ConfigIni.nRisky, + "Risky繝「繝シ繝峨ョ險ュ螳:\n" + + "1莉・荳翫ョ蛟、縺ォ縺吶k縺ィ縲√◎縺ョ蝗樊焚蛻縺ョ\n" + + "荳榊庄縺ァ貍泌・上′蠑キ蛻カ邨ゆコ縺励∪縺吶\n" + + "0縺ォ縺吶k縺ィ辟。蜉ケ縺ォ縺ェ繧翫―n" + + "繝弱Ν繝槭ご繝シ繧ク縺ョ縺ソ縺ォ縺ェ繧翫∪縺吶\n" + + "\n" + + "", + "Risky mode:\n" + + "Set over 1, in case you'd like to specify\n" + + " the number of Poor/Miss times to be\n" + + " FAILED.\n" + + "Set 0 to disable Risky mode." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemRisky ); + + this.iTaikoRandom = new CItemList( "Random", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, (int) TJAPlayer3.ConfigIni.eRandom.Taiko, + "縺繧上f繧九Λ繝ウ繝繝縲\n RANDOM: 縺。繧縺」縺ィ螟峨o繧欺n MIRROR: 縺ゅ∋縺薙∋ \n SUPER: 縺昴%縺昴%繝、繝舌>\n HYPER: 邨先ァ九Ζ繝舌>\n縺ェ縺翫∝ョ溯」縺ッ驕ゥ蠖薙↑讓。讒", + "Notes come randomly.\n\n Part: swapping lanes randomly for each\n measures.\n Super: swapping chip randomly\n Hyper: swapping randomly\n (number of lanes also changes)", + new string[] { "OFF", "RANDOM", "MIRROR", "SUPER", "HYPER" } ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iTaikoRandom ); + + this.iTaikoStealth = new CItemList( "Stealth", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, (int) TJAPlayer3.ConfigIni.eSTEALTH, + "DORON:繝峨Ο繝ウ\n"+ + "STEALTH:繧ケ繝繝ォ繧ケ", + "DORON:Hidden for NoteImage.\n"+ + "STEALTH:Hidden for NoteImage and SeNotes", + new string[] { "OFF", "DORON", "STEALTH" } ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iTaikoStealth ); + + this.iTaikoNoInfo = new CItemToggle( "NoInfo", TJAPlayer3.ConfigIni.bNoInfo, + "譛牙柑縺ォ縺吶k縺ィ譖イ諠蝣ア縺ェ縺ゥ縺瑚ヲ九∴縺ェ縺上↑繧翫∪縺吶\n" + + "", + "It becomes MISS to hit pad without\n" + + " chip." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iTaikoNoInfo ); + + this.iTaikoJust = new CItemToggle( "JUST", TJAPlayer3.ConfigIni.bJust, + "譛牙柑縺ォ縺吶k縺ィ縲瑚憶縲堺サ・螟悶ョ蛻、螳壹′蜈ィ縺ヲ荳榊庄縺ォ縺ェ繧翫∪縺吶\n" + + "", + "譛牙柑縺ォ縺吶k縺ィ縲瑚憶縲堺サ・螟悶ョ蛻、螳壹′蜈ィ縺ヲ荳榊庄縺ォ縺ェ繧翫∪縺吶" ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iTaikoJust ); + + this.iDrumsTight = new CItemToggle( "Tight", TJAPlayer3.ConfigIni.bTight, + "繝峨Λ繝繝√ャ繝励ョ縺ェ縺縺ィ縺薙m縺ァ繝代ャ繝峨r\n" + + "蜿ゥ縺上→繝溘せ縺ォ縺ェ繧翫∪縺吶", + "It becomes MISS to hit pad without\n" + + " chip." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iDrumsTight ); + + this.iSystemMinComboDrums = new CItemInteger( "D-MinCombo", 1, 0x1869f, TJAPlayer3.ConfigIni.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚.Drums, + "陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚シ医ラ繝ゥ繝シ会シ喀n" + + "逕サ髱「縺ォ陦ィ遉コ縺輔l繧九さ繝ウ繝懊ョ譛蟆上ョ謨ー\n" + + "繧呈欠螳壹@縺セ縺吶\n" + + "1 ス 99999 縺ョ蛟、縺梧欠螳壼庄閭ス縺ァ縺吶", + "Initial number to show the combo\n" + + " for the drums.\n" + + "You can specify from 1 to 99999." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iSystemMinComboDrums ); + + + // #23580 2011.1.3 yyagi + this.iInputAdjustTimeMs = new CItemInteger( "InputAdjust", -99, 99, TJAPlayer3.ConfigIni.nInputAdjustTimeMs, + "繝峨Λ繝縺ョ蜈・蜉帙ち繧、繝溘Φ繧ー縺ョ蠕ョ隱ソ謨エ繧箪n" + + "陦後>縺セ縺吶\n" + + "-99 ス 99ms 縺セ縺ァ謖螳壼庄閭ス縺ァ縺吶\n" + + "蜈・蜉帙Λ繧ー繧定サス貂帙☆繧九◆繧√↓縺ッ縲∬イ縺ョ\n" + + "蛟、繧呈欠螳壹@縺ヲ縺上□縺輔>縲\n", + "To adjust the input timing.\n" + + "You can set from -99 to 99ms.\n" + + "To decrease input lag, set minus value." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iInputAdjustTimeMs ); + + this.iTaikoDefaultCourse = new CItemList( "DefaultCourse", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, TJAPlayer3.ConfigIni.nDefaultCourse, + "繝繝輔か繝ォ繝医〒驕ク謚槭&繧後k髮」譏灘コヲ\n" + + " \n" + + " ", + new string[] { "Easy", "Normal", "Hard", "Oni", "Edit" }); + this.list鬆逶ョ繝ェ繧ケ繝.Add(this.iTaikoDefaultCourse); + + this.iTaikoScoreMode = new CItemList("ScoreMode", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, TJAPlayer3.ConfigIni.nScoreMode, + "繧ケ繧ウ繧「險育ョ玲婿豕表n" + + "TYPE-A: 譌ァ驟咲せ\n" + + "TYPE-B: 譌ァ遲蝉ス馴咲せ\n" + + "TYPE-C: 譁ー驟咲せ\n", + " \n" + + " \n" + + " ", + new string[] { "TYPE-A", "TYPE-B", "TYPE-C"}); + this.list鬆逶ョ繝ェ繧ケ繝.Add(this.iTaikoScoreMode); + + ShinuchiMode = new CItemToggle(nameof(ShinuchiMode), TJAPlayer3.ConfigIni.ShinuchiMode, CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, + "逵滓遠繝「繝シ繝峨r譛牙柑縺ォ縺吶k縲", + "Turn on fixed score mode."); + this.list鬆逶ョ繝ェ繧ケ繝.Add(this.ShinuchiMode); + + this.iTaikoBranchGuide = new CItemToggle("BranchGuide", TJAPlayer3.ConfigIni.bBranchGuide, + "隴憺擇蛻蟯舌ョ蜿り縺ォ縺ェ繧区焚蛟、縺ェ縺ゥ繧定。ィ遉コ縺励∪縺吶\n" + + "繧ェ繝シ繝医励Ξ繧、縺縺ィ陦ィ遉コ縺輔l縺セ縺帙s縲", + "\n" + + ""); + this.list鬆逶ョ繝ェ繧ケ繝.Add(this.iTaikoBranchGuide); + + this.iTaikoBranchAnime = new CItemList("BranchAnime", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, TJAPlayer3.ConfigIni.nBranchAnime, + "隴憺擇蛻蟯先凾縺ョ繧「繝九Γ繝シ繧キ繝ァ繝ウ\n" + + "TYPE-A: 螟ェ鮠7ス槫、ェ鮠14\n" + + "TYPE-B: 螟ェ鮠15ス杤n" + + " \n", + " \n" + + " \n" + + " ", + new string[] { "TYPE-A", "TYPE-B" }); + this.list鬆逶ョ繝ェ繧ケ繝.Add(this.iTaikoBranchAnime); + + this.iTaikoGameMode = new CItemList("GameMode", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, (int)TJAPlayer3.ConfigIni.eGameMode, + "繧イ繝シ繝繝「繝シ繝噂n" + + "(1莠コ繝励Ξ繧、蟆ら畑)\n" + + "TYPE-A: 螳瑚オー!蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ!\n" + + "TYPE-B: 螳瑚オー!蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ!(豼霎)\n" + + " \n", + " \n" + + " \n" + + " ", + new string[] { "OFF", "TYPE-A", "TYPE-B" }); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iTaikoGameMode ); + + this.iTaikoBigNotesJudge = new CItemToggle( "BigNotesJudge", TJAPlayer3.ConfigIni.b螟ァ髻ウ隨ヲ蛻、螳, + "螟ァ髻ウ隨ヲ縺ョ荳。謇句愛螳壹r譛牙柑縺ォ縺励∪縺吶", + "螟ァ髻ウ隨ヲ縺ョ荳。謇句愛螳壹r譛牙柑縺ォ縺励∪縺吶"); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iTaikoBigNotesJudge ); + + this.iTaikoJudgeCountDisp = new CItemToggle( "JudgeCountDisp", TJAPlayer3.ConfigIni.bJudgeCountDisplay, + "蟾ヲ荳九↓蛻、螳壽焚繧定。ィ遉コ縺励∪縺吶\n" + + "(1莠コ繝励Ξ繧、蟆ら畑)", + "Show the JudgeCount\n" + + "(SinglePlay Only)"); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iTaikoJudgeCountDisp ); + + this.iDrumsGoToKeyAssign = new CItemBase( "KEY CONFIG", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, + "繝峨Λ繝縺ョ繧ュ繝シ蜈・蜉帙↓髢「縺吶k鬆逶ョ繧定ィュ\n"+ + "螳壹@縺セ縺吶", + "Settings for the drums key/pad inputs." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iDrumsGoToKeyAssign ); + + OnListMenu縺ョ蛻晄悄蛹(); + this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ = 0; + this.e繝。繝九Η繝シ遞ョ蛻・ = E繝。繝九Η繝シ遞ョ蛻・.Drums; + } + #endregion + + /// Sud+Hid縺ョ蛻晄悄蛟、繧定ソ斐☆ + /// + /// + /// 0: None + /// 1: Sudden + /// 2: Hidden + /// 3: Sud+Hid + /// 4: Semi-Invisible + /// 5: Full-Invisible + /// + private int getDefaultSudHidValue( E讌ス蝎ィ繝代シ繝 eInst ) + { + int defvar; + int nInst = (int) eInst; + if ( TJAPlayer3.ConfigIni.eInvisible[ nInst ] != EInvisible.OFF ) + { + defvar = (int) TJAPlayer3.ConfigIni.eInvisible[ nInst ] + 3; + } + else + { + defvar = ( TJAPlayer3.ConfigIni.bSudden[ nInst ] ? 1 : 0 ) + + ( TJAPlayer3.ConfigIni.bHidden[ nInst ] ? 2 : 0 ); + } + return defvar; + } + + /// + /// ESC謚シ荳区凾縺ョ蜿ウ繝。繝九Η繝シ謠冗判 + /// + public void tEsc謚シ荳() + { + if ( this.b隕∫エ蛟、縺ォ繝輔か繝シ繧ォ繧ケ荳ュ ) // #32059 2013.9.17 add yyagi + { + this.b隕∫エ蛟、縺ォ繝輔か繝シ繧ォ繧ケ荳ュ = false; + } + + if ( this.e繝。繝九Η繝シ遞ョ蛻・ == E繝。繝九Η繝シ遞ョ蛻・.KeyAssignSystem ) + { + t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟System(); + } + else if ( this.e繝。繝九Η繝シ遞ョ蛻・ == E繝。繝九Η繝シ遞ョ蛻・.KeyAssignDrums ) + { + t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟Drums(); + } + // 縺薙l莉・螟悶↑繧我ス輔b縺励↑縺 + } + public void tEnter謚シ荳() + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + if( this.b隕∫エ蛟、縺ォ繝輔か繝シ繧ォ繧ケ荳ュ ) + { + this.b隕∫エ蛟、縺ォ繝輔か繝シ繧ォ繧ケ荳ュ = false; + } + else if( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ].e遞ョ蛻・ == CItemBase.E遞ョ蛻・.謨エ謨ー ) + { + this.b隕∫エ蛟、縺ォ繝輔か繝シ繧ォ繧ケ荳ュ = true; + } + else if( this.b迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ縺ッReturnToMenu縺ァ縺ゅk ) + { + //this.tConfigIni縺ク險倬鹸縺吶k(); + //CONFIG荳ュ縺ォ繧ケ繧ュ繝ウ螟牙喧縺檎匱逕溘☆繧九→髱「蛟偵↑縺ョ縺ァ縲∽ク譌ヲ繝槭せ繧ッ縺励◆縲 + } + #region [ 蛟九縺ョ繧ュ繝シ繧「繧オ繧、繝ウ ] + //螟ェ鮠薙ョ繧ュ繝シ險ュ螳壹 + else if( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iKeyAssignTaikoLRed ) + { + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.t繝代ャ繝蛾∈謚樣夂衍( EKeyConfigPart.DRUMS, EKeyConfigPad.LRed ); + } + else if( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iKeyAssignTaikoRRed ) + { + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.t繝代ャ繝蛾∈謚樣夂衍( EKeyConfigPart.DRUMS, EKeyConfigPad.RRed ); + } + else if( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iKeyAssignTaikoLBlue ) + { + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.t繝代ャ繝蛾∈謚樣夂衍( EKeyConfigPart.DRUMS, EKeyConfigPad.LBlue ); + } + else if ( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iKeyAssignTaikoRBlue ) + { + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.t繝代ャ繝蛾∈謚樣夂衍( EKeyConfigPart.DRUMS, EKeyConfigPad.RBlue ); + } + + //螟ェ鮠薙ョ繧ュ繝シ險ュ螳壹2P + else if( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iKeyAssignTaikoLRed2P ) + { + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.t繝代ャ繝蛾∈謚樣夂衍( EKeyConfigPart.DRUMS, EKeyConfigPad.LRed2P ); + } + else if( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iKeyAssignTaikoRRed2P ) + { + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.t繝代ャ繝蛾∈謚樣夂衍( EKeyConfigPart.DRUMS, EKeyConfigPad.RRed2P ); + } + else if( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iKeyAssignTaikoLBlue2P ) + { + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.t繝代ャ繝蛾∈謚樣夂衍( EKeyConfigPart.DRUMS, EKeyConfigPad.LBlue2P ); + } + else if ( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iKeyAssignTaikoRBlue2P ) + { + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.t繝代ャ繝蛾∈謚樣夂衍( EKeyConfigPart.DRUMS, EKeyConfigPad.RBlue2P ); + } + + else if ( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iKeyAssignSystemCapture ) + { + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.t繝代ャ繝蛾∈謚樣夂衍( EKeyConfigPart.SYSTEM, EKeyConfigPad.Capture); + } + #endregion + else + { + // #27029 2012.1.5 from + //if( ( this.iSystemBDGroup.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ == (int) EBDGroup.縺ゥ縺」縺。繧BD ) && + // ( ( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iSystemHHGroup ) || ( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iSystemHitSoundPriorityHH ) ) ) + //{ + // // 螟画峩遖∵ュ「シ井ス輔b縺励↑縺シ + //} + //else + //{ + // // 螟画峩險ア蜿ッ + this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ].tEnter謚シ荳(); + //} + + + // Enter謚シ荳句セ後ョ蠕悟ヲ逅 + + if( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iSystemFullscreen ) + { + TJAPlayer3.app.b谺。縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蜈ィ逕サ髱「_繧ヲ繧」繝ウ繝峨え蛻繧頑崛縺医r陦後≧ = true; + } + else if( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iSystemVSyncWait ) + { + TJAPlayer3.ConfigIni.b蝙ら峩蟶ー邱壼セ縺。繧定。後≧ = this.iSystemVSyncWait.bON; + TJAPlayer3.app.b谺。縺ョ繧ソ繧、繝溘Φ繧ー縺ァ蝙ら峩蟶ー邱壼酔譛溷繧頑崛縺医r陦後≧ = true; + } + #region [ 繧ュ繝シ繧「繧オ繧、繝ウ縺ク縺ョ驕キ遘サ縺ィ閼ア蜃コ ] + else if ( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iSystemGoToKeyAssign ) // #24609 2011.4.12 yyagi + { + t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟KeyAssignSystem(); + } + else if ( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iKeyAssignSystemReturnToMenu ) // #24609 2011.4.12 yyagi + { + t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟System(); + } + else if ( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iDrumsGoToKeyAssign ) // #24525 2011.3.15 yyagi + { + t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟KeyAssignDrums(); + } + else if ( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iKeyAssignDrumsReturnToMenu ) // #24525 2011.3.15 yyagi + { + t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟Drums(); + } + #endregion + #region [ 繧ケ繧ュ繝ウ鬆逶ョ縺ァEnter繧呈款荳九@縺溷エ蜷医↓髯舌j縲√せ繧ュ繝ウ縺ョ邵ョ蟆上し繝ウ繝励Ν繧堤函謌舌☆繧九] + else if ( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iSystemSkinSubfolder ) // #28195 2012.5.2 yyagi + { + tGenerateSkinSample(); + } + #endregion + #region [ 譖イ繝繝シ繧ソ荳隕ァ縺ョ蜀崎ェュ縺ソ霎シ縺ソ ] + else if ( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iSystemReloadDTX ) // #32081 2013.10.21 yyagi + { + if ( TJAPlayer3.EnumSongs.IsEnumerating ) + { + // Debug.WriteLine( "繝舌ャ繧ッ繧ー繝ゥ繧ヲ繝ウ繝峨〒EnumeratingSongs荳ュ縺縺」縺溘ョ縺ァ縲∽ク譌ヲ荳ュ譁ュ縺励∪縺吶" ); + TJAPlayer3.EnumSongs.Abort(); + TJAPlayer3.actEnumSongs.On髱樊エサ諤ァ蛹(); + } + + TJAPlayer3.EnumSongs.StartEnumFromDisk(); + TJAPlayer3.EnumSongs.ChangeEnumeratePriority( ThreadPriority.Normal ); + TJAPlayer3.actEnumSongs.b繧ウ繝槭Φ繝峨〒縺ョ譖イ繝繝シ繧ソ蜿門セ = true; + TJAPlayer3.actEnumSongs.On豢サ諤ァ蛹(); + } + #endregion + } + } + + private void tGenerateSkinSample() + { + nSkinIndex = ( ( CItemList ) this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] ).n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ; + if ( nSkinSampleIndex != nSkinIndex ) + { + string path = skinSubFolders[ nSkinIndex ]; + path = System.IO.Path.Combine( path, @"Graphics\1_Title\Background.png" ); + Bitmap bmSrc = new Bitmap( path ); + Bitmap bmDest = new Bitmap( bmSrc.Width / 4, bmSrc.Height / 4 ); + Graphics g = Graphics.FromImage( bmDest ); + g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; + g.DrawImage( bmSrc, new Rectangle( 0, 0, bmSrc.Width / 4, bmSrc.Height / 4 ), + 0, 0, bmSrc.Width, bmSrc.Height, GraphicsUnit.Pixel ); + if ( txSkinSample1 != null ) + { + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k( ref txSkinSample1 ); + } + txSkinSample1 = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmDest, false ); + g.Dispose(); + bmDest.Dispose(); + bmSrc.Dispose(); + nSkinSampleIndex = nSkinIndex; + } + } + + #region [ 鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳 ( Exit, KeyAssignSystem/Drums) ] + public void t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟Exit() + { + this.tConfigIni縺ク險倬鹸縺吶k(); + this.e繝。繝九Η繝シ遞ョ蛻・ = E繝。繝九Η繝シ遞ョ蛻・.Unknown; + } + public void t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟KeyAssignSystem() + { + //this.tConfigIni縺ク險倬鹸縺吶k(); + this.list鬆逶ョ繝ェ繧ケ繝.Clear(); + + // #27029 2012.1.5 from: 隱ャ譏取枚縺ッ譛螟ァ9陦娯13陦後↓螟画峩縲 + + this.iKeyAssignSystemReturnToMenu = new CItemBase( "<< ReturnTo Menu", CItemBase.E繝代ロ繝ォ遞ョ蛻・.縺昴ョ莉, + "蟾ヲ蛛エ縺ョ繝。繝九Η繝シ縺ォ謌サ繧翫∪縺吶", + "Return to left menu." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iKeyAssignSystemReturnToMenu ); + this.iKeyAssignSystemCapture = new CItemBase( "Capture", + "繧ュ繝」繝励メ繝」繧ュ繝シ險ュ螳夲シ喀n逕サ髱「繧ュ繝」繝励メ繝」縺ョ繧ュ繝シ縺ョ蜑イ繧雁ス薙※繧定ィュ\n螳壹@縺セ縺吶", + "Capture key assign:\nTo assign key for screen capture.\n (You can use keyboard only. You can't\nuse pads to capture screenshot." ); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iKeyAssignSystemCapture ); + + OnListMenu縺ョ蛻晄悄蛹(); + this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ = 0; + this.e繝。繝九Η繝シ遞ョ蛻・ = E繝。繝九Η繝シ遞ョ蛻・.KeyAssignSystem; + } + public void t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟KeyAssignDrums() + { +// this.tConfigIni縺ク險倬鹸縺吶k(); + this.list鬆逶ョ繝ェ繧ケ繝.Clear(); + + // #27029 2012.1.5 from: 隱ャ譏取枚縺ッ譛螟ァ9陦娯13陦後↓螟画峩縲 + + this.iKeyAssignDrumsReturnToMenu = new CItemBase( "<< ReturnTo Menu", CItemBase.E繝代ロ繝ォ遞ョ蛻・.縺昴ョ莉, + "蟾ヲ蛛エ縺ョ繝。繝九Η繝シ縺ォ謌サ繧翫∪縺吶", + "Return to left menu."); + this.list鬆逶ョ繝ェ繧ケ繝.Add(this.iKeyAssignDrumsReturnToMenu); + + this.iKeyAssignTaikoLRed = new CItemBase( "LeftRed", + "蟾ヲ蛛エ縺ョ髱「縺ク縺ョ繧ュ繝シ縺ョ蜑イ繧雁ス薙※繧定ィュ\n螳壹@縺セ縺吶", + "Drums key assign:\nTo assign key/pads for LeftRed\n button."); + this.list鬆逶ョ繝ェ繧ケ繝.Add(this.iKeyAssignTaikoLRed); + this.iKeyAssignTaikoRRed = new CItemBase( "RightRed", + "蜿ウ蛛エ縺ョ髱「縺ク縺ョ繧ュ繝シ縺ョ蜑イ繧雁ス薙※\n繧定ィュ螳壹@縺セ縺吶", + "Drums key assign:\nTo assign key/pads for RightRed\n button."); + this.list鬆逶ョ繝ェ繧ケ繝.Add(this.iKeyAssignTaikoRRed); + this.iKeyAssignTaikoLBlue = new CItemBase( "LeftBlue", + "蟾ヲ蛛エ縺ョ縺オ縺。縺ク縺ョ繧ュ繝シ縺ョ\n蜑イ繧雁ス薙※繧定ィュ螳壹@縺セ縺吶", + "Drums key assign:\nTo assign key/pads for LeftBlue\n button."); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iKeyAssignTaikoLBlue ); + this.iKeyAssignTaikoRBlue = new CItemBase( "RightBlue", + "蜿ウ蛛エ縺ョ縺オ縺。縺ク縺ョ繧ュ繝シ縺ョ\n蜑イ繧雁ス薙※繧定ィュ螳壹@縺セ縺吶", + "Drums key assign:\nTo assign key/pads for RightBlue\n button."); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iKeyAssignTaikoRBlue ); + + this.iKeyAssignTaikoLRed2P = new CItemBase( "LeftRed2P", + "蟾ヲ蛛エ縺ョ髱「縺ク縺ョ繧ュ繝シ縺ョ蜑イ繧雁ス薙※繧定ィュ\n螳壹@縺セ縺吶", + "Drums key assign:\nTo assign key/pads for RightCymbal\n button."); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iKeyAssignTaikoLRed2P ); + this.iKeyAssignTaikoRRed2P = new CItemBase( "RightRed2P", + "蜿ウ蛛エ縺ョ髱「縺ク縺ョ繧ュ繝シ縺ョ蜑イ繧雁ス薙※\n繧定ィュ螳壹@縺セ縺吶", + "Drums key assign:\nTo assign key/pads for RightRed2P\n button."); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iKeyAssignTaikoRRed2P ); + this.iKeyAssignTaikoLBlue2P = new CItemBase( "LeftBlue2P", + "蟾ヲ蛛エ縺ョ縺オ縺。縺ク縺ョ繧ュ繝シ縺ョ\n蜑イ繧雁ス薙※繧定ィュ螳壹@縺セ縺吶", + "Drums key assign:\nTo assign key/pads for LeftBlue2P\n button."); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iKeyAssignTaikoLBlue2P ); + this.iKeyAssignTaikoRBlue2P = new CItemBase( "RightBlue2P", + "蜿ウ蛛エ縺ョ縺オ縺。縺ク縺ョ繧ュ繝シ縺ョ\n蜑イ繧雁ス薙※繧定ィュ螳壹@縺セ縺吶", + "Drums key assign:\nTo assign key/pads for RightBlue2P\n button."); + this.list鬆逶ョ繝ェ繧ケ繝.Add( this.iKeyAssignTaikoRBlue2P ); + + OnListMenu縺ョ蛻晄悄蛹(); + this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ = 0; + this.e繝。繝九Η繝シ遞ョ蛻・ = E繝。繝九Η繝シ遞ョ蛻・.KeyAssignDrums; + } + #endregion + public void t谺。縺ォ遘サ蜍() + { + TJAPlayer3.Skin.sound繧ォ繝シ繧ス繝ォ遘サ蜍暮浹.t蜀咲函縺吶k(); + if( this.b隕∫エ蛟、縺ォ繝輔か繝シ繧ォ繧ケ荳ュ ) + { + this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ].t鬆逶ョ蛟、繧貞燕縺ク遘サ蜍(); + t隕∫エ蛟、繧剃ク贋ク九↓螟画峩荳ュ縺ョ蜃ヲ逅(); + } + else + { + this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ += 100; + } + } + public void t蜑阪↓遘サ蜍() + { + TJAPlayer3.Skin.sound繧ォ繝シ繧ス繝ォ遘サ蜍暮浹.t蜀咲函縺吶k(); + if( this.b隕∫エ蛟、縺ォ繝輔か繝シ繧ォ繧ケ荳ュ ) + { + this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ].t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍(); + t隕∫エ蛟、繧剃ク贋ク九↓螟画峩荳ュ縺ョ蜃ヲ逅(); + } + else + { + this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ -= 100; + } + } + private void t隕∫エ蛟、繧剃ク贋ク九↓螟画峩荳ュ縺ョ蜃ヲ逅() + { + //if ( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iSystemMasterVolume ) // #33700 2014.4.26 yyagi + //{ + // CDTXMania.Sound邂。逅.nMasterVolume = this.iSystemMasterVolume.n迴セ蝨ィ縺ョ蛟、; + //} + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + if( this.b豢サ諤ァ蛹悶@縺ヲ繧 ) + return; + + this.list鬆逶ョ繝ェ繧ケ繝 = new List(); + this.e繝。繝九Η繝シ遞ョ蛻・ = E繝。繝九Η繝シ遞ョ蛻・.Unknown; + + #region [ 繧ケ繧ュ繝ウ驕ク謚櫁い縺ィ縲∫樟蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ュ繝ウ(index)縺ョ貅門y #28195 2012.5.2 yyagi ] + int ns = ( TJAPlayer3.Skin.strSystemSkinSubfolders == null ) ? 0 : TJAPlayer3.Skin.strSystemSkinSubfolders.Length; + int nb = ( TJAPlayer3.Skin.strBoxDefSkinSubfolders == null ) ? 0 : TJAPlayer3.Skin.strBoxDefSkinSubfolders.Length; + skinSubFolders = new string[ ns + nb ]; + for ( int i = 0; i < ns; i++ ) + { + skinSubFolders[ i ] = TJAPlayer3.Skin.strSystemSkinSubfolders[ i ]; + } + for ( int i = 0; i < nb; i++ ) + { + skinSubFolders[ ns + i ] = TJAPlayer3.Skin.strBoxDefSkinSubfolders[ i ]; + } + skinSubFolder_org = TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName( true ); + Array.Sort( skinSubFolders ); + skinNames = CSkin.GetSkinName( skinSubFolders ); + nSkinIndex = Array.BinarySearch( skinSubFolders, skinSubFolder_org ); + if ( nSkinIndex < 0 ) // 蠢オ縺ョ縺溘a + { + nSkinIndex = 0; + } + nSkinSampleIndex = -1; + #endregion + + if ( !string.IsNullOrEmpty(TJAPlayer3.ConfigIni.FontName)) + this.prvFont = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), 20 ); // t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳 縺ョ蜑阪↓蠢隕 + else + this.prvFont = new CPrivateFastFont(new FontFamily("MS UI Gothic"), 20); + + // this.listMenu = new List(); + + this.t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟Drums(); // + this.t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟System(); // 鬆逡ェ縺ィ縺励※縲∵怙蠕後↓System繧呈戟縺」縺ヲ縺上k縺薙→縲りィュ螳壻ク隕ァ縺ョ蛻晄悄菴咲スョ縺郡ystem縺ョ縺溘a縲 + this.b隕∫エ蛟、縺ォ繝輔か繝シ繧ォ繧ケ荳ュ = false; + this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ = 0; + this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ = 0; + this.n繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槫、 = -1; + this.ct荳芽ァ堤泙蜊ー繧「繝九Γ = new CCounter(); + + this.iSystemSoundType_initial = this.iSystemSoundType.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ; // CONFIG縺ォ蜈・縺」縺溘→縺阪ョ蛟、繧剃ソ晄戟縺励※縺翫¥ + this.iSystemWASAPIBufferSizeMs_initial = this.iSystemWASAPIBufferSizeMs.n迴セ蝨ィ縺ョ蛟、; // CONFIG閼ア蜃コ譎ゅ↓縺薙ョ蛟、縺九i螟画峩縺輔l縺ヲ縺繧九h縺縺ェ繧 + // this.iSystemASIOBufferSizeMs_initial = this.iSystemASIOBufferSizeMs.n迴セ蝨ィ縺ョ蛟、; // 繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ繧貞肴ァ狗ッ峨☆繧 + this.iSystemASIODevice_initial = this.iSystemASIODevice.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ; // + this.iSystemSoundTimerType_initial = this.iSystemSoundTimerType.GetIndex(); // + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return; + + this.tConfigIni縺ク險倬鹸縺吶k(); + this.list鬆逶ョ繝ェ繧ケ繝.Clear(); + this.ct荳芽ァ堤泙蜊ー繧「繝九Γ = null; + + prvFont.Dispose(); + base.On髱樊エサ諤ァ蛹(); + #region [ Skin螟画峩 ] + if ( TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName( true ) != this.skinSubFolder_org ) + { + TJAPlayer3.app.RefleshSkin(); + } + #endregion + + // #24820 2013.1.22 yyagi CONFIG縺ァWASAPI/ASIO/DirectSound髢「騾」縺ョ險ュ螳壹r螟画峩縺励◆蝣エ蜷医√し繧ヲ繝ウ繝峨ョ繝舌う繧ケ繧貞肴ァ狗ッ峨☆繧九 + // #33689 2014.6.17 yyagi CONFIG縺ァSoundTimerType縺ョ險ュ螳壹r螟画峩縺励◆蝣エ蜷医b縲√し繧ヲ繝ウ繝峨ョ繝舌う繧ケ繧貞肴ァ狗ッ峨☆繧九 + #region [ 繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ螟画峩 ] + if ( this.iSystemSoundType_initial != this.iSystemSoundType.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ || + this.iSystemWASAPIBufferSizeMs_initial != this.iSystemWASAPIBufferSizeMs.n迴セ蝨ィ縺ョ蛟、 || + // this.iSystemASIOBufferSizeMs_initial != this.iSystemASIOBufferSizeMs.n迴セ蝨ィ縺ョ蛟、 || + this.iSystemASIODevice_initial != this.iSystemASIODevice.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ || + this.iSystemSoundTimerType_initial != this.iSystemSoundTimerType.GetIndex() ) + { + ESoundDeviceType soundDeviceType; + switch ( this.iSystemSoundType.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ ) + { + case 0: + soundDeviceType = ESoundDeviceType.DirectSound; + break; + case 1: + soundDeviceType = ESoundDeviceType.ASIO; + break; + case 2: + soundDeviceType = ESoundDeviceType.ExclusiveWASAPI; + break; + default: + soundDeviceType = ESoundDeviceType.Unknown; + break; + } + TJAPlayer3.Sound邂。逅.t蛻晄悄蛹( soundDeviceType, + this.iSystemWASAPIBufferSizeMs.n迴セ蝨ィ縺ョ蛟、, + 0, + // this.iSystemASIOBufferSizeMs.n迴セ蝨ィ縺ョ蛟、, + this.iSystemASIODevice.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ, + this.iSystemSoundTimerType.bON ); + TJAPlayer3.app.ShowWindowTitleWithSoundType(); + TJAPlayer3.Skin.ReloadSkin();// 髻ウ螢ー縺ョ蜀崎ェュ縺ソ霎シ縺ソ繧偵☆繧九%縺ィ縺ォ繧医▲縺ヲ縲髻ウ驥上ョ蛻晄悄蛹悶r髦イ縺 + } + #endregion + #region [ 繧オ繧ヲ繝ウ繝峨ョ繧ソ繧、繝繧ケ繝医Ξ繝繝√Δ繝シ繝牙、画峩 ] + FDK.CSound邂。逅.bIsTimeStretch = this.iSystemTimeStretch.bON; + #endregion + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return; + + //this.tx騾壼クク鬆逶ョ陦後ヱ繝阪Ν = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\4_itembox.png" ), false ); + //this.tx縺昴ョ莉夜逶ョ陦後ヱ繝阪Ν = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\4_itembox other.png" ), false ); + //this.tx荳芽ァ堤泙蜊ー = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\4_triangle arrow.png" ), false ); + this.txSkinSample1 = null; // 繧ケ繧ュ繝ウ驕ク謚樊凾縺ォ蜍慕噪縺ォ險ュ螳壹☆繧九◆繧√√%縺薙〒縺ッ蛻晄悄蛹悶@縺ェ縺 + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return; + + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txSkinSample1 ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx騾壼クク鬆逶ョ陦後ヱ繝阪Ν ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx縺昴ョ莉夜逶ョ陦後ヱ繝阪Ν ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx荳芽ァ堤泙蜊ー ); + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + private void OnListMenu縺ョ蛻晄悄蛹() + { + OnListMenu縺ョ隗」謾セ(); + this.listMenu = new stMenuItemRight[ this.list鬆逶ョ繝ェ繧ケ繝.Count ]; + } + + /// + /// 莠句燕縺ォ繝ャ繝ウ繝繝ェ繝ウ繧ー縺励※縺翫>縺溘ユ繧ッ繧ケ繝√Ε繧定ァ」謾セ縺吶k縲 + /// + private void OnListMenu縺ョ隗」謾セ() + { + if ( listMenu != null ) + { + for ( int i = 0; i < listMenu.Length; i++ ) + { + if ( listMenu[ i ].txParam != null ) + { + listMenu[ i ].txParam.Dispose(); + } + if ( listMenu[ i ].txMenuItemRight != null ) + { + listMenu[ i ].txMenuItemRight.Dispose(); + } + } + this.listMenu = null; + } + } + public override int On騾イ陦梧緒逕サ() + { + throw new InvalidOperationException( "t騾イ陦梧緒逕サ(bool)縺ョ縺サ縺繧剃スソ逕ィ縺励※縺上□縺輔>縲" ); + } + public int t騾イ陦梧緒逕サ( bool b鬆逶ョ繝ェ繧ケ繝亥エ縺ォ繝輔か繝シ繧ォ繧ケ縺後≠繧 ) + { + if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return 0; + + // 騾イ陦 + + #region [ 蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ] + //----------------- + if( base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + this.n繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槫、 = (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + this.ct荳芽ァ堤泙蜊ー繧「繝九Γ.t髢句ァ( 0, 9, 50, TJAPlayer3.Timer ); + + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + //----------------- + #endregion + + this.b鬆逶ョ繝ェ繧ケ繝亥エ縺ォ繝輔か繝シ繧ォ繧ケ縺後≠繧 = b鬆逶ョ繝ェ繧ケ繝亥エ縺ォ繝輔か繝シ繧ォ繧ケ縺後≠繧; // 險俶カ + + #region [ 鬆逶ョ繧ケ繧ッ繝ュ繝シ繝ォ縺ョ騾イ陦 ] + //----------------- + long n迴セ蝨ィ譎ょ綾 = TJAPlayer3.Timer.n迴セ蝨ィ譎ょ綾; + if( n迴セ蝨ィ譎ょ綾 < this.n繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槫、 ) this.n繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槫、 = n迴セ蝨ィ譎ょ綾; + + const int INTERVAL = 2; // [ms] + while( ( n迴セ蝨ィ譎ょ綾 - this.n繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槫、 ) >= INTERVAL ) + { + int n逶ョ讓咎逶ョ縺セ縺ァ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ驥 = Math.Abs( (int) ( this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ - this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ ) ); + int n蜉騾溷コヲ = 0; + + #region [ n蜉騾溷コヲ縺ョ豎コ螳夲シ帷岼讓吶∪縺ァ驕縺縺サ縺ゥ蜉騾溘☆繧九] + //----------------- + if( n逶ョ讓咎逶ョ縺セ縺ァ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ驥 <= 100 ) + { + n蜉騾溷コヲ = 2; + } + else if( n逶ョ讓咎逶ョ縺セ縺ァ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ驥 <= 300 ) + { + n蜉騾溷コヲ = 3; + } + else if( n逶ョ讓咎逶ョ縺セ縺ァ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ驥 <= 500 ) + { + n蜉騾溷コヲ = 4; + } + else + { + n蜉騾溷コヲ = 8; + } + //----------------- + #endregion + #region [ this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ縺ォ n蜉騾溷コヲ 繧貞刈貂帷ョ励] + //----------------- + if( this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ < this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ ) + { + this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ += n蜉騾溷コヲ; + if( this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ > this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ ) + { + // 逶ョ讓吶r雜縺医◆繧臥岼讓吝、縺ァ蛛懈ュ「縲 + this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ = this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ; + } + } + else if( this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ > this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ ) + { + this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ -= n蜉騾溷コヲ; + if( this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ < this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ ) + { + // 逶ョ讓吶r雜縺医◆繧臥岼讓吝、縺ァ蛛懈ュ「縲 + this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ = this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ; + } + } + //----------------- + #endregion + #region [ 陦瑚カ縺亥ヲ逅縲√↑繧峨ウ縺ォ逶ョ讓吩ス咲スョ縺ォ蛻ー驕斐@縺溘i繧ケ繧ッ繝ュ繝シ繝ォ繧貞●豁「縺励※鬆逶ョ螟画峩騾夂衍繧堤匱陦後] + //----------------- + if( this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ >= 100 ) + { + this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ = this.t谺。縺ョ鬆逶ョ( this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ); + this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ -= 100; + this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ -= 100; + if( this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ == 0 ) + { + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.t鬆逶ョ螟画峩騾夂衍(); + } + } + else if( this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ <= -100 ) + { + this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ = this.t蜑阪ョ鬆逶ョ( this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ); + this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ += 100; + this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ += 100; + if( this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ == 0 ) + { + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.t鬆逶ョ螟画峩騾夂衍(); + } + } + //----------------- + #endregion + + this.n繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槫、 += INTERVAL; + } + //----------------- + #endregion + + #region [ 笆イ蜊ー繧「繝九Γ縺ョ騾イ陦 ] + //----------------- + if( this.b鬆逶ョ繝ェ繧ケ繝亥エ縺ォ繝輔か繝シ繧ォ繧ケ縺後≠繧 && ( this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ == 0 ) ) + this.ct荳芽ァ堤泙蜊ー繧「繝九Γ.t騾イ陦鍬oop(); + //----------------- + #endregion + + + // 謠冗判 + + this.pt繝代ロ繝ォ縺ョ蝓コ譛ャ蠎ァ讓兌 4 ].X = this.b鬆逶ョ繝ェ繧ケ繝亥エ縺ォ繝輔か繝シ繧ォ繧ケ縺後≠繧 ? 0x228 : 0x25a; // 繝。繝九Η繝シ縺ォ繝輔か繝シ繧ォ繧ケ縺後≠繧九↑繧峨鬆逶ョ繝ェ繧ケ繝医ョ荳ュ螟ョ縺ッ鬆ュ繧貞コ縺輔↑縺縲 + + #region [ 險11蛟九ョ鬆逶ョ繝代ロ繝ォ繧呈緒逕サ縺吶k縲] + //----------------- + int nItem = this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ; + for( int i = 0; i < 4; i++ ) + nItem = this.t蜑阪ョ鬆逶ョ( nItem ); + + for( int n陦檎分蜿キ = -4; n陦檎分蜿キ < 6; n陦檎分蜿キ++ ) // n陦檎分蜿キ == 0 縺後ヵ繧ゥ繝シ繧ォ繧ケ縺輔l縺ヲ縺繧矩逶ョ繝代ロ繝ォ縲 + { + #region [ 莉翫∪縺輔↓逕サ髱「螟悶↓鬟帙ウ縺縺昴≧縺ィ縺励※縺繧矩逶ョ繝代ロ繝ォ縺ッ謠冗判縺励↑縺縲] + //----------------- + if( ( ( n陦檎分蜿キ == -4 ) && ( this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ > 0 ) ) || // 荳翫↓鬟帙ウ蜃コ縺昴≧縺ィ縺励※縺繧 + ( ( n陦檎分蜿キ == +5 ) && ( this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ < 0 ) ) ) // 荳九↓鬟帙ウ蜃コ縺昴≧縺ィ縺励※縺繧 + { + nItem = this.t谺。縺ョ鬆逶ョ( nItem ); + continue; + } + //----------------- + #endregion + + int n遘サ蜍募縺ョ陦後ョ蝓コ譛ャ菴咲スョ = n陦檎分蜿キ + 4; + int n遘サ蜍募医ョ陦後ョ蝓コ譛ャ菴咲スョ = ( this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ <= 0 ) ? ( ( n遘サ蜍募縺ョ陦後ョ蝓コ譛ャ菴咲スョ + 1 ) % 10 ) : ( ( ( n遘サ蜍募縺ョ陦後ョ蝓コ譛ャ菴咲スョ - 1 ) + 10 ) % 10 ); + int x = this.pt繝代ロ繝ォ縺ョ蝓コ譛ャ蠎ァ讓兌 n遘サ蜍募縺ョ陦後ョ蝓コ譛ャ菴咲スョ ].X + ( (int) ( ( this.pt繝代ロ繝ォ縺ョ蝓コ譛ャ蠎ァ讓兌 n遘サ蜍募医ョ陦後ョ蝓コ譛ャ菴咲スョ ].X - this.pt繝代ロ繝ォ縺ョ蝓コ譛ャ蠎ァ讓兌 n遘サ蜍募縺ョ陦後ョ蝓コ譛ャ菴咲スョ ].X ) * ( ( (double) Math.Abs( this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ ) ) / 100.0 ) ) ); + int y = this.pt繝代ロ繝ォ縺ョ蝓コ譛ャ蠎ァ讓兌 n遘サ蜍募縺ョ陦後ョ蝓コ譛ャ菴咲スョ ].Y + ( (int) ( ( this.pt繝代ロ繝ォ縺ョ蝓コ譛ャ蠎ァ讓兌 n遘サ蜍募医ョ陦後ョ蝓コ譛ャ菴咲スョ ].Y - this.pt繝代ロ繝ォ縺ョ蝓コ譛ャ蠎ァ讓兌 n遘サ蜍募縺ョ陦後ョ蝓コ譛ャ菴咲スョ ].Y ) * ( ( (double) Math.Abs( this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ ) ) / 100.0 ) ) ); + + #region [ 迴セ蝨ィ縺ョ陦後ョ鬆逶ョ繝代ロ繝ォ譫繧呈緒逕サ縲] + //----------------- + switch( this.list鬆逶ョ繝ェ繧ケ繝[ nItem ].e繝代ロ繝ォ遞ョ蛻・ ) + { + case CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク: + case CItemBase.E繝代ロ繝ォ遞ョ蛻・.縺昴ョ莉: + if ( TJAPlayer3.Tx.Config_ItemBox != null ) + TJAPlayer3.Tx.Config_ItemBox.t2D謠冗判( TJAPlayer3.app.Device, x, y ); + break; + } + //----------------- + #endregion + #region [ 迴セ蝨ィ縺ョ陦後ョ鬆逶ョ蜷阪r謠冗判縲] + //----------------- + if ( listMenu[ nItem ].txMenuItemRight != null ) // 閾ェ蜑阪ョ繧ュ繝」繝繧キ繝・縺ォ蜷ォ縺セ繧後※縺繧九h縺縺ェ繧峨∝阪Ξ繝ウ繝繝ェ繝ウ繧ー縺帙★繧ュ繝」繝繧キ繝・繧剃スソ逕ィ + { + listMenu[nItem].txMenuItemRight.t2D謠冗判(TJAPlayer3.app.Device, x + 20 + TJAPlayer3.Skin.Config_ItemText_Correction_X, y + 12 + TJAPlayer3.Skin.Config_ItemText_Correction_Y); + } + else + { + using (var bmpItem = prvFont.DrawPrivateFont( this.list鬆逶ョ繝ェ繧ケ繝[ nItem ].str鬆逶ョ蜷, Color.White, Color.Black )) + { + listMenu[ nItem ].txMenuItemRight = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmpItem ); + // ctItem.t2D謠冗判( CDTXMania.app.Device, ( x + 0x12 ) * Scale.X, ( y + 12 ) * Scale.Y - 20 ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref ctItem ); + } + } + //CDTXMania.stage繧ウ繝ウ繝輔ぅ繧ー.actFont.t譁蟄怜玲緒逕サ( x + 0x12, y + 12, this.list鬆逶ョ繝ェ繧ケ繝[ nItem ].str鬆逶ョ蜷 ); + //----------------- + #endregion + #region [ 迴セ蝨ィ縺ョ陦後ョ鬆逶ョ縺ョ隕∫エ繧呈緒逕サ縲] + //----------------- + string strParam = null; + bool b蠑キ隱ソ = false; + switch ( this.list鬆逶ョ繝ェ繧ケ繝[ nItem ].e遞ョ蛻・ ) + { + case CItemBase.E遞ョ蛻・.ONorOFF繝医げ繝ォ: + #region [ *** ] + //----------------- + //CDTXMania.stage繧ウ繝ウ繝輔ぅ繧ー.actFont.t譁蟄怜玲緒逕サ( x + 210, y + 12, ( (CItemToggle) this.list鬆逶ョ繝ェ繧ケ繝[ nItem ] ).bON ? "ON" : "OFF" ); + strParam = ( (CItemToggle) this.list鬆逶ョ繝ェ繧ケ繝[ nItem ] ).bON ? "ON" : "OFF"; + break; + //----------------- + #endregion + + case CItemBase.E遞ョ蛻・.ONorOFFor荳榊ョ壹せ繝ェ繝シ繧ケ繝繝シ繝: + #region [ *** ] + //----------------- + switch ( ( (CItemThreeState) this.list鬆逶ョ繝ェ繧ケ繝[ nItem ] ).e迴セ蝨ィ縺ョ迥カ諷 ) + { + case CItemThreeState.E迥カ諷.ON: + strParam = "ON"; + break; + + case CItemThreeState.E迥カ諷.荳榊ョ: + strParam = "- -"; + break; + + default: + strParam = "OFF"; + break; + } + //CDTXMania.stage繧ウ繝ウ繝輔ぅ繧ー.actFont.t譁蟄怜玲緒逕サ( x + 210, y + 12, "ON" ); + break; + //----------------- + #endregion + + case CItemBase.E遞ョ蛻・.謨エ謨ー: // #24789 2011.4.8 yyagi: add PlaySpeed supports (copied them from OPTION) + #region [ *** ] + //----------------- + if ( this.list鬆逶ョ繝ェ繧ケ繝[ nItem ] == this.iCommonPlaySpeed ) + { + double d = ( (double) ( (CItemInteger) this.list鬆逶ョ繝ェ繧ケ繝[ nItem ] ).n迴セ蝨ィ縺ョ蛟、 ) / 20.0; + //CDTXMania.stage繧ウ繝ウ繝輔ぅ繧ー.actFont.t譁蟄怜玲緒逕サ( x + 210, y + 12, d.ToString( "0.000" ), ( n陦檎分蜿キ == 0 ) && this.b隕∫エ蛟、縺ォ繝輔か繝シ繧ォ繧ケ荳ュ ); + strParam = d.ToString( "0.000" ); + } + else if ( this.list鬆逶ョ繝ェ繧ケ繝[ nItem ] == this.iDrumsScrollSpeed) + { + float f = ( ( (CItemInteger) this.list鬆逶ョ繝ェ繧ケ繝[ nItem ] ).n迴セ蝨ィ縺ョ蛟、 + 1 ) * 0.5f; + //CDTXMania.stage繧ウ繝ウ繝輔ぅ繧ー.actFont.t譁蟄怜玲緒逕サ( x + 210, y + 12, f.ToString( "x0.0" ), ( n陦檎分蜿キ == 0 ) && this.b隕∫エ蛟、縺ォ繝輔か繝シ繧ォ繧ケ荳ュ ); + strParam = f.ToString( "x0.0" ); + } + else + { + //CDTXMania.stage繧ウ繝ウ繝輔ぅ繧ー.actFont.t譁蟄怜玲緒逕サ( x + 210, y + 12, ( (CItemInteger) this.list鬆逶ョ繝ェ繧ケ繝[ nItem ] ).n迴セ蝨ィ縺ョ蛟、.ToString(), ( n陦檎分蜿キ == 0 ) && this.b隕∫エ蛟、縺ォ繝輔か繝シ繧ォ繧ケ荳ュ ); + strParam = ( (CItemInteger) this.list鬆逶ョ繝ェ繧ケ繝[ nItem ] ).n迴セ蝨ィ縺ョ蛟、.ToString(); + } + b蠑キ隱ソ = ( n陦檎分蜿キ == 0 ) && this.b隕∫エ蛟、縺ォ繝輔か繝シ繧ォ繧ケ荳ュ; + break; + //----------------- + #endregion + + case CItemBase.E遞ョ蛻・.繝ェ繧ケ繝: // #28195 2012.5.2 yyagi: add Skin supports + #region [ *** ] + //----------------- + { + CItemList list = (CItemList) this.list鬆逶ョ繝ェ繧ケ繝[ nItem ]; + //CDTXMania.stage繧ウ繝ウ繝輔ぅ繧ー.actFont.t譁蟄怜玲緒逕サ( x + 210, y + 12, list.list鬆逶ョ蛟、[ list.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ ] ); + strParam = list.list鬆逶ョ蛟、[ list.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ ]; + + #region [ 蠢隕√↑蝣エ蜷医↓縲ヾkin縺ョ繧オ繝ウ繝励Ν繧堤函謌舌サ謠冗判縺吶k縲#28195 2012.5.2 yyagi ] + if ( this.list鬆逶ョ繝ェ繧ケ繝[ this.n迴セ蝨ィ縺ョ驕ク謚樣逶ョ ] == this.iSystemSkinSubfolder ) + { + tGenerateSkinSample(); // 譛蛻昴↓Skin縺ョ驕ク謚櫁い縺ォ縺阪◆縺ィ縺(Enter繧呈款縺吝燕)縺ォ髯舌j縲√し繝ウ繝励Ν逕滓舌′逋コ逕溘☆繧九 + if ( txSkinSample1 != null ) + { + txSkinSample1.t2D謠冗判( TJAPlayer3.app.Device, 124, 449 ); + txSkinSample1.t2D謠冗判( TJAPlayer3.app.Device, 124, 449 ); + } + } + #endregion + break; + } + //----------------- + #endregion + } + if ( b蠑キ隱ソ ) + { + using (var bmpStr = prvFont.DrawPrivateFont(strParam, Color.Black, Color.White, Color.Yellow, Color.OrangeRed)) + { + using (var txStr = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmpStr, false )) + { + txStr.t2D謠冗判( TJAPlayer3.app.Device, x + 400 + TJAPlayer3.Skin.Config_ItemText_Correction_X, y + 12 + TJAPlayer3.Skin.Config_ItemText_Correction_Y ); + } + } + } + else + { + int nIndex = this.list鬆逶ョ繝ェ繧ケ繝[ nItem ].GetIndex(); + if ( listMenu[ nItem ].nParam != nIndex || listMenu[ nItem ].txParam == null ) + { + stMenuItemRight stm = listMenu[ nItem ]; + stm.nParam = nIndex; + object o = this.list鬆逶ョ繝ェ繧ケ繝[ nItem ].obj迴セ蝨ィ蛟、(); + stm.strParam = ( o == null ) ? "" : o.ToString(); + + using (var bmpStr = prvFont.DrawPrivateFont( strParam, Color.White, Color.Black )) + { + stm.txParam = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmpStr, false ); + } + + listMenu[ nItem ] = stm; + } + listMenu[ nItem ].txParam.t2D謠冗判( TJAPlayer3.app.Device, x + 400 + TJAPlayer3.Skin.Config_ItemText_Correction_X, y + 12 + TJAPlayer3.Skin.Config_ItemText_Correction_Y ); + } + //----------------- + #endregion + + nItem = this.t谺。縺ョ鬆逶ョ( nItem ); + } + //----------------- + #endregion + + #region [ 鬆逶ョ繝ェ繧ケ繝医↓繝輔か繝シ繧ォ繧ケ縺後≠縺」縺ヲ縲√°縺、繧ケ繧ッ繝ュ繝シ繝ォ縺悟●豁「縺励※縺繧九↑繧峨√ヱ繝阪Ν縺ョ荳贋ク九↓笆イ蜊ー繧呈緒逕サ縺吶k縲] + //----------------- + if( this.b鬆逶ョ繝ェ繧ケ繝亥エ縺ォ繝輔か繝シ繧ォ繧ケ縺後≠繧 && ( this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ == 0 ) ) + { + int x; + int y_upper; + int y_lower; + + // 菴咲スョ豎コ螳壹 + + if( this.b隕∫エ蛟、縺ォ繝輔か繝シ繧ォ繧ケ荳ュ ) + { + x = 552; // 隕∫エ蛟、縺ョ荳贋ク九≠縺溘j縲 + y_upper = 0x117 - this.ct荳芽ァ堤泙蜊ー繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、; + y_lower = 0x17d + this.ct荳芽ァ堤泙蜊ー繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、; + } + else + { + x = 552; // 鬆逶ョ蜷阪ョ荳贋ク九≠縺溘j縲 + y_upper = 0x129 - this.ct荳芽ァ堤泙蜊ー繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、; + y_lower = 0x16b + this.ct荳芽ァ堤泙蜊ー繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、; + } + + // 謠冗判縲 + + if( TJAPlayer3.Tx.Config_Arrow != null ) + { + TJAPlayer3.Tx.Config_Arrow.t2D謠冗判( TJAPlayer3.app.Device, x, y_upper, new Rectangle( 0, 0, 0x40, 0x18 ) ); + TJAPlayer3.Tx.Config_Arrow.t2D謠冗判( TJAPlayer3.app.Device, x, y_lower, new Rectangle( 0, 0x18, 0x40, 0x18 ) ); + } + } + //----------------- + #endregion + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private enum E繝。繝九Η繝シ遞ョ蛻・ + { + System, + Drums, + KeyAssignSystem, // #24609 2011.4.12 yyagi: 逕サ髱「繧ュ繝」繝励メ繝」繧ュ繝シ縺ョ繧「繧オ繧、繝ウ + KeyAssignDrums, + Unknown + + } + + private bool b鬆逶ョ繝ェ繧ケ繝亥エ縺ォ繝輔か繝シ繧ォ繧ケ縺後≠繧; + private bool b隕∫エ蛟、縺ォ繝輔か繝シ繧ォ繧ケ荳ュ; + private CCounter ct荳芽ァ堤泙蜊ー繧「繝九Γ; + private E繝。繝九Η繝シ遞ョ蛻・ e繝。繝九Η繝シ遞ョ蛻・; + #region [ 繧ュ繝シ繧ウ繝ウ繝輔ぅ繧ー ] + private CItemBase iKeyAssignSystemCapture; // #24609 + private CItemBase iKeyAssignSystemReturnToMenu; // #24609 + private CItemBase iKeyAssignDrumsReturnToMenu; + + private CItemBase iKeyAssignTaikoLRed; + private CItemBase iKeyAssignTaikoRRed; + private CItemBase iKeyAssignTaikoLBlue; + private CItemBase iKeyAssignTaikoRBlue; + private CItemBase iKeyAssignTaikoLRed2P; + private CItemBase iKeyAssignTaikoRRed2P; + private CItemBase iKeyAssignTaikoLBlue2P; + private CItemBase iKeyAssignTaikoRBlue2P; + + #endregion + private CItemToggle iLogOutputLog; + private CItemToggle iSystemApplyLoudnessMetadata; + private CItemInteger iSystemTargetLoudness; + private CItemToggle iSystemApplySongVol; + private CItemInteger iSystemSoundEffectLevel; + private CItemInteger iSystemVoiceLevel; + private CItemInteger iSystemSongPlaybackLevel; + private CItemInteger iSystemKeyboardSoundLevelIncrement; + private CItemToggle iSystemAVI; + private CItemToggle iSystemBGA; + private CItemInteger iSystemBGAlpha; + private CItemToggle iSystemBGMSound; + private CItemToggle iSystemDebugInfo; + private CItemToggle iSystemFullscreen; + private CItemInteger iSystemMinComboDrums; + private CItemInteger iSystemPreviewImageWait; + private CItemInteger iSystemPreviewSoundWait; + private CItemToggle iSystemRandomFromSubBox; + private CItemBase iSystemReturnToMenu; + private CItemToggle iSystemSaveScore; + private CItemToggle iSystemStageFailed; + private CItemToggle iSystemVSyncWait; + private CItemToggle iSystemAutoResultCapture; // #25399 2011.6.9 yyagi + private CItemToggle SendDiscordPlayingInformation; + private CItemToggle iSystemBufferedInput; + private CItemInteger iSystemRisky; // #23559 2011.7.27 yyagi + private CItemList iSystemSoundType; // #24820 2013.1.3 yyagi + private CItemInteger iSystemWASAPIBufferSizeMs; // #24820 2013.1.15 yyagi +// private CItemInteger iSystemASIOBufferSizeMs; // #24820 2013.1.3 yyagi + private CItemList iSystemASIODevice; // #24820 2013.1.17 yyagi + + private int iSystemSoundType_initial; + private int iSystemWASAPIBufferSizeMs_initial; +// private int iSystemASIOBufferSizeMs_initial; + private int iSystemASIODevice_initial; + private CItemToggle iSystemSoundTimerType; // #33689 2014.6.17 yyagi + private int iSystemSoundTimerType_initial; // #33689 2014.6.17 yyagi + + private CItemToggle iSystemTimeStretch; // #23664 2013.2.24 yyagi + + private List list鬆逶ョ繝ェ繧ケ繝; + private long n繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槫、; + private int n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ; + private int n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ; + private Point[] pt繝代ロ繝ォ縺ョ蝓コ譛ャ蠎ァ讓 = new Point[] { new Point(0x25a, 4), new Point(0x25a, 0x4f), new Point(0x25a, 0x9a), new Point(0x25a, 0xe5), new Point(0x228, 0x130), new Point(0x25a, 0x17b), new Point(0x25a, 0x1c6), new Point(0x25a, 0x211), new Point(0x25a, 0x25c), new Point(0x25a, 0x2a7) }; + //private CTexture tx縺昴ョ莉夜逶ョ陦後ヱ繝阪Ν; + //private CTexture tx荳芽ァ堤泙蜊ー; + //private CTexture tx騾壼クク鬆逶ョ陦後ヱ繝阪Ν; + + private CPrivateFastFont prvFont; + //private List list鬆逶ョ繝ェ繧ケ繝_str譛邨よ緒逕サ蜷; + private struct stMenuItemRight + { + // public string strMenuItem; + public CTexture txMenuItemRight; + public int nParam; + public string strParam; + public CTexture txParam; + } + private stMenuItemRight[] listMenu; + + private CTexture txSkinSample1; // #28195 2012.5.2 yyagi + private string[] skinSubFolders; // + private string[] skinNames; // + private string skinSubFolder_org; // + private int nSkinSampleIndex; // + private int nSkinIndex; // + + private CItemBase iDrumsGoToKeyAssign; + private CItemBase iSystemGoToKeyAssign; // #24609 + private CItemInteger iCommonPlaySpeed; + private CItemBase iDrumsReturnToMenu; + private CItemInteger iDrumsScrollSpeed; + private CItemToggle iDrumsTight; + private CItemToggle iTaikoAutoPlay; + private CItemToggle iTaikoAutoPlay2P; + private CItemToggle iTaikoAutoRoll; + private CItemToggle iTaikoBranchGuide; + private CItemList iTaikoDefaultCourse; //2017.01.30 DD 繝繝輔か繝ォ繝医〒繧ォ繝シ繧ス繝ォ繧偵≠繧上○繧矩屮譏灘コヲ + private CItemList iTaikoScoreMode; + private CItemList iTaikoBranchAnime; + private CItemToggle iTaikoNoInfo; + private CItemList iTaikoRandom; + private CItemList iTaikoStealth; + private CItemList iTaikoGameMode; + private CItemToggle iTaikoJust; + private CItemToggle iTaikoJudgeCountDisp; + private CItemToggle iTaikoBigNotesJudge; + private CItemInteger iTaikoPlayerCount; + CItemToggle ShowChara; + CItemToggle ShowDancer; + CItemToggle ShowRunner; + CItemToggle ShowMob; + CItemToggle ShowFooter; + CItemToggle ShowPuchiChara; + CItemToggle ShinuchiMode; + CItemToggle FastRender; + CItemInteger MusicPreTimeMs; + + private CItemInteger iInputAdjustTimeMs; + private CItemList iSystemSkinSubfolder; // #28195 2012.5.2 yyagi + private CItemBase iSystemReloadDTX; // #32081 2013.10.21 yyagi + //private CItemInteger iSystemMasterVolume; // #33700 2014.4.26 yyagi + + private int t蜑阪ョ鬆逶ョ( int nItem ) + { + if( --nItem < 0 ) + { + nItem = this.list鬆逶ョ繝ェ繧ケ繝.Count - 1; + } + return nItem; + } + private int t谺。縺ョ鬆逶ョ( int nItem ) + { + if( ++nItem >= this.list鬆逶ョ繝ェ繧ケ繝.Count ) + { + nItem = 0; + } + return nItem; + } + private void tConfigIni縺ク險倬鹸縺吶k() + { + switch( this.e繝。繝九Η繝シ遞ョ蛻・ ) + { + case E繝。繝九Η繝シ遞ョ蛻・.System: + this.tConfigIni縺ク險倬鹸縺吶k_System(); + return; + + case E繝。繝九Η繝シ遞ョ蛻・.Drums: + this.tConfigIni縺ク險倬鹸縺吶k_Drums(); + return; + } + } + private void tConfigIni縺ク險倬鹸縺吶k_System() + { + //CDTXMania.ConfigIni.eDark = (E繝繝シ繧ッ繝「繝シ繝) this.iCommonDark.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ; + TJAPlayer3.ConfigIni.n貍泌・城溷コヲ = this.iCommonPlaySpeed.n迴セ蝨ィ縺ョ蛟、; + + TJAPlayer3.ConfigIni.b蜈ィ逕サ髱「繝「繝シ繝 = this.iSystemFullscreen.bON; + TJAPlayer3.ConfigIni.bSTAGEFAILED譛牙柑 = this.iSystemStageFailed.bON; + TJAPlayer3.ConfigIni.b繝ゥ繝ウ繝繝繧サ繝ャ繧ッ繝医〒蟄殖OX繧呈、懃エ「蟇セ雎。縺ィ縺吶k = this.iSystemRandomFromSubBox.bON; + + //CDTXMania.ConfigIni.bWave蜀咲函菴咲スョ閾ェ蜍戊ェソ謨エ讖溯ス譛牙柑 = this.iSystemAdjustWaves.bON; + TJAPlayer3.ConfigIni.b蝙ら峩蟶ー邱壼セ縺。繧定。後≧ = this.iSystemVSyncWait.bON; + TJAPlayer3.ConfigIni.b繝舌ャ繝輔ぃ蜈・蜉帙r陦後≧ = this.iSystemBufferedInput.bON; + TJAPlayer3.ConfigIni.bAVI譛牙柑 = this.iSystemAVI.bON; + TJAPlayer3.ConfigIni.bBGA譛牙柑 = this.iSystemBGA.bON; +// CDTXMania.ConfigIni.bGraph譛牙柑 = this.iSystemGraph.bON;#24074 2011.01.23 comment-out ikanick 繧ェ繝励す繝ァ繝ウ(Drums)縺ク遘サ陦 + TJAPlayer3.ConfigIni.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ髻ウ縺碁ウエ繧九∪縺ァ縺ョ繧ヲ繧ァ繧、繝ms = this.iSystemPreviewSoundWait.n迴セ蝨ィ縺ョ蛟、; + TJAPlayer3.ConfigIni.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ逕サ蜒上′陦ィ遉コ髢句ァ九&繧後k縺セ縺ァ縺ョ繧ヲ繧ァ繧、繝ms = this.iSystemPreviewImageWait.n迴セ蝨ィ縺ョ蛟、; + TJAPlayer3.ConfigIni.b貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k = this.iSystemDebugInfo.bON; + TJAPlayer3.ConfigIni.n閭梧勹縺ョ騾城℃蠎ヲ = this.iSystemBGAlpha.n迴セ蝨ィ縺ョ蛟、; + TJAPlayer3.ConfigIni.bBGM髻ウ繧堤匱螢ー縺吶k = this.iSystemBGMSound.bON; + //CDTXMania.ConfigIni.b豁灘」ー繧堤匱螢ー縺吶k = this.iSystemAudienceSound.bON; + //CDTXMania.ConfigIni.e繝繝。繝シ繧ク繝ャ繝吶Ν = (E繝繝。繝シ繧ク繝ャ繝吶Ν) this.iSystemDamageLevel.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ; + TJAPlayer3.ConfigIni.bScoreIni繧貞コ蜉帙☆繧 = this.iSystemSaveScore.bON; + + TJAPlayer3.ConfigIni.ApplyLoudnessMetadata = this.iSystemApplyLoudnessMetadata.bON; + TJAPlayer3.ConfigIni.TargetLoudness = this.iSystemTargetLoudness.n迴セ蝨ィ縺ョ蛟、 / 10.0; + TJAPlayer3.ConfigIni.ApplySongVol = this.iSystemApplySongVol.bON; + TJAPlayer3.ConfigIni.SoundEffectLevel = this.iSystemSoundEffectLevel.n迴セ蝨ィ縺ョ蛟、; + TJAPlayer3.ConfigIni.VoiceLevel = this.iSystemVoiceLevel.n迴セ蝨ィ縺ョ蛟、; + TJAPlayer3.ConfigIni.SongPlaybackLevel = this.iSystemSongPlaybackLevel.n迴セ蝨ィ縺ョ蛟、; + TJAPlayer3.ConfigIni.KeyboardSoundLevelIncrement = this.iSystemKeyboardSoundLevelIncrement.n迴セ蝨ィ縺ョ蛟、; + TJAPlayer3.ConfigIni.MusicPreTimeMs = this.MusicPreTimeMs.n迴セ蝨ィ縺ョ蛟、; + + TJAPlayer3.ConfigIni.b繝ュ繧ー蜃コ蜉 = this.iLogOutputLog.bON; + //CDTXMania.ConfigIni.b繧ケ繝医う繝繧ッ繝「繝シ繝 = this.iSystemStoicMode.bON; + + //CDTXMania.ConfigIni.nShowLagType = this.iSystemShowLag.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ; // #25370 2011.6.3 yyagi + TJAPlayer3.ConfigIni.bIsAutoResultCapture = this.iSystemAutoResultCapture.bON; // #25399 2011.6.9 yyagi + TJAPlayer3.ConfigIni.SendDiscordPlayingInformation = this.SendDiscordPlayingInformation.bON; + + TJAPlayer3.ConfigIni.nRisky = this.iSystemRisky.n迴セ蝨ィ縺ョ蛟、; // #23559 2011.7.27 yyagi + + TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName = skinSubFolders[ nSkinIndex ]; // #28195 2012.5.2 yyagi + TJAPlayer3.Skin.SetCurrentSkinSubfolderFullName( TJAPlayer3.ConfigIni.strSystemSkinSubfolderFullName, true ); + + TJAPlayer3.ConfigIni.nSoundDeviceType = this.iSystemSoundType.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ; // #24820 2013.1.3 yyagi + TJAPlayer3.ConfigIni.nWASAPIBufferSizeMs = this.iSystemWASAPIBufferSizeMs.n迴セ蝨ィ縺ョ蛟、; // #24820 2013.1.15 yyagi +// CDTXMania.ConfigIni.nASIOBufferSizeMs = this.iSystemASIOBufferSizeMs.n迴セ蝨ィ縺ョ蛟、; // #24820 2013.1.3 yyagi + TJAPlayer3.ConfigIni.nASIODevice = this.iSystemASIODevice.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ; // #24820 2013.1.17 yyagi + TJAPlayer3.ConfigIni.bUseOSTimer = this.iSystemSoundTimerType.bON; // #33689 2014.6.17 yyagi + + TJAPlayer3.ConfigIni.bTimeStretch = this.iSystemTimeStretch.bON; // #23664 2013.2.24 yyagi +//Trace.TraceInformation( "saved" ); +//Trace.TraceInformation( "Skin迴セ蝨ィCurrent : " + CDTXMania.Skin.GetCurrentSkinSubfolderFullName(true) ); +//Trace.TraceInformation( "Skin迴セ蝨ィSystem : " + CSkin.strSystemSkinSubfolderFullName ); +//Trace.TraceInformation( "Skin迴セ蝨ィBoxDef : " + CSkin.strBoxDefSkinSubfolderFullName ); + //CDTXMania.ConfigIni.nMasterVolume = this.iSystemMasterVolume.n迴セ蝨ィ縺ョ蛟、; // #33700 2014.4.26 yyagi + //CDTXMania.ConfigIni.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ = (E蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ) this.iSystemJudgeDispPriority.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ; + TJAPlayer3.ConfigIni.ShowChara = this.ShowChara.bON; + TJAPlayer3.ConfigIni.ShowDancer = this.ShowDancer.bON; + TJAPlayer3.ConfigIni.ShowRunner = this.ShowRunner.bON; + TJAPlayer3.ConfigIni.ShowMob = this.ShowMob.bON; + TJAPlayer3.ConfigIni.ShowFooter = this.ShowFooter.bON; + TJAPlayer3.ConfigIni.ShowPuchiChara = this.ShowPuchiChara.bON; + TJAPlayer3.ConfigIni.nPlayerCount = this.iTaikoPlayerCount.n迴セ蝨ィ縺ョ蛟、; + TJAPlayer3.ConfigIni.FastRender = this.FastRender.bON; + } + private void tConfigIni縺ク險倬鹸縺吶k_Drums() + { + TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay = this.iTaikoAutoPlay.bON; + TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay2P = this.iTaikoAutoPlay2P.bON; + TJAPlayer3.ConfigIni.bAuto蜈育函縺ョ騾」謇 = this.iTaikoAutoRoll.bON; + + TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums = this.iDrumsScrollSpeed.n迴セ蝨ィ縺ョ蛟、; + //CDTXMania.ConfigIni.b繝峨Λ繝繧ウ繝ウ繝懆。ィ遉コ = this.iDrumsComboDisp.bON; + // "Sudden" || "Sud+Hid" + //CDTXMania.ConfigIni.bSudden.Drums = ( this.iDrumsSudHid.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ == 1 || this.iDrumsSudHid.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ == 3 ) ? true : false; + // "Hidden" || "Sud+Hid" + //CDTXMania.ConfigIni.bHidden.Drums = ( this.iDrumsSudHid.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ == 2 || this.iDrumsSudHid.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ == 3 ) ? true : false; + //if ( this.iDrumsSudHid.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ == 4 ) CDTXMania.ConfigIni.eInvisible.Drums = EInvisible.SEMI; // "S-Invisible" + //else if ( this.iDrumsSudHid.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ == 5 ) CDTXMania.ConfigIni.eInvisible.Drums = EInvisible.FULL; // "F-Invisible" + //else CDTXMania.ConfigIni.eInvisible.Drums = EInvisible.OFF; + //CDTXMania.ConfigIni.bReverse.Drums = this.iDrumsReverse.bON; + //CDTXMania.ConfigIni.蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ.Drums = (E蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ) this.iDrumsPosition.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ; + TJAPlayer3.ConfigIni.bTight = this.iDrumsTight.bON; + + TJAPlayer3.ConfigIni.nInputAdjustTimeMs = this.iInputAdjustTimeMs.n迴セ蝨ィ縺ョ蛟、; + + TJAPlayer3.ConfigIni.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚.Drums = this.iSystemMinComboDrums.n迴セ蝨ィ縺ョ蛟、; + TJAPlayer3.ConfigIni.nRisky = this.iSystemRisky.n迴セ蝨ィ縺ョ蛟、; // #23559 2911.7.27 yyagi + //CDTXMania.ConfigIni.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ.Drums = (E蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ) this.iDrumsJudgeDispPriority.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ; + + TJAPlayer3.ConfigIni.bBranchGuide = this.iTaikoBranchGuide.bON; + TJAPlayer3.ConfigIni.nDefaultCourse = this.iTaikoDefaultCourse.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ; + TJAPlayer3.ConfigIni.nScoreMode = this.iTaikoScoreMode.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ; + TJAPlayer3.ConfigIni.ShinuchiMode = this.ShinuchiMode.bON; + TJAPlayer3.ConfigIni.nBranchAnime = this.iTaikoBranchAnime.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ; + //CDTXMania.ConfigIni.bHispeedRandom = this.iTaikoHispeedRandom.bON; + TJAPlayer3.ConfigIni.bNoInfo = this.iTaikoNoInfo.bON; + TJAPlayer3.ConfigIni.eRandom.Taiko = (E繝ゥ繝ウ繝繝繝「繝シ繝)this.iTaikoRandom.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ; + TJAPlayer3.ConfigIni.eSTEALTH = (E繧ケ繝繝ォ繧ケ繝「繝シ繝)this.iTaikoStealth.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ; + TJAPlayer3.ConfigIni.eGameMode = (EGame)this.iTaikoGameMode.n迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ逡ェ蜿キ; + TJAPlayer3.ConfigIni.bJust = this.iTaikoJust.bON; + TJAPlayer3.ConfigIni.bJudgeCountDisplay = this.iTaikoJudgeCountDisp.bON; + TJAPlayer3.ConfigIni.b螟ァ髻ウ隨ヲ蛻、螳 = this.iTaikoBigNotesJudge.bON; + } + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/04.Config/CStage繧ウ繝ウ繝輔ぅ繧ー.cs b/TJAPlayer3/Stages/04.Config/CStage繧ウ繝ウ繝輔ぅ繧ー.cs new file mode 100644 index 00000000..2348f231 --- /dev/null +++ b/TJAPlayer3/Stages/04.Config/CStage繧ウ繝ウ繝輔ぅ繧ー.cs @@ -0,0 +1,632 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Globalization; +using System.Runtime.InteropServices; +using System.Drawing; +using System.Diagnostics; +using FDK; + +namespace TJAPlayer3 +{ + internal class CStage繧ウ繝ウ繝輔ぅ繧ー : CStage + { + // 繝励Ο繝代ユ繧」 + + public CActDFPFont actFont { get; private set; } + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CStage繧ウ繝ウ繝輔ぅ繧ー() + { + CActDFPFont font; + base.e繧ケ繝繝シ繧クID = CStage.E繧ケ繝繝シ繧ク.繧ウ繝ウ繝輔ぅ繧ー; + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷; + this.actFont = font = new CActDFPFont(); + base.list蟄植ctivities.Add( font ); + base.list蟄植ctivities.Add( this.actFIFO = new CActFIFOWhite() ); + base.list蟄植ctivities.Add( this.actList = new CActConfigList() ); + base.list蟄植ctivities.Add( this.actKeyAssign = new CActConfigKeyAssign() ); + base.list蟄植ctivities.Add( this.act繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ = new CAct繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ() ); + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // 繝。繧ス繝繝 + + public void t繧「繧オ繧、繝ウ螳御コ騾夂衍() // CONFIG縺ォ縺ョ縺ソ蟄伜惠 + { // + this.eItemPanel繝「繝シ繝 = EItemPanel繝「繝シ繝.繝代ャ繝我ク隕ァ; // + } // + public void t繝代ャ繝蛾∈謚樣夂衍( EKeyConfigPart part, EKeyConfigPad pad ) // + { // + this.actKeyAssign.t髢句ァ( part, pad, this.actList.ib迴セ蝨ィ縺ョ驕ク謚樣逶ョ.str鬆逶ョ蜷 ); // + this.eItemPanel繝「繝シ繝 = EItemPanel繝「繝シ繝.繧ュ繝シ繧ウ繝シ繝我ク隕ァ; // + } // + public void t鬆逶ョ螟画峩騾夂衍() // OPTION縺ィ蜈ア騾 + { // + this.t隱ャ譏取枚繝代ロ繝ォ縺ォ迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ縺ョ隱ャ譏弱r謠冗判縺吶k(); // + } // + + + // CStage 螳溯」 + + public override void On豢サ諤ァ蛹() + { + Trace.TraceInformation( "繧ウ繝ウ繝輔ぅ繧ー繧ケ繝繝シ繧ク繧呈エサ諤ァ蛹悶@縺セ縺吶" ); + Trace.Indent(); + try + { + this.n迴セ蝨ィ縺ョ繝。繝九Η繝シ逡ェ蜿キ = 0; // + if (!string.IsNullOrEmpty(TJAPlayer3.ConfigIni.FontName)) + { + this.ft繝輔か繝ウ繝 = new Font(TJAPlayer3.ConfigIni.FontName, 18.0f, FontStyle.Bold, GraphicsUnit.Pixel); + } + else + { + this.ft繝輔か繝ウ繝 = new Font("MS UI Gothic", 18.0f, FontStyle.Bold, GraphicsUnit.Pixel); + } + for( int i = 0; i < 4; i++ ) // + { // + this.ct繧ュ繝シ蜿榊セゥ逕ィ[ i ] = new CCounter( 0, 0, 0, TJAPlayer3.Timer ); // + } // + this.b繝。繝九Η繝シ縺ォ繝輔か繝シ繧ォ繧ケ荳ュ = true; // 縺薙%縺セ縺ァOPTION縺ィ蜈ア騾 + this.eItemPanel繝「繝シ繝 = EItemPanel繝「繝シ繝.繝代ャ繝我ク隕ァ; + } + finally + { + Trace.TraceInformation( "繧ウ繝ウ繝輔ぅ繧ー繧ケ繝繝シ繧ク縺ョ豢サ諤ァ蛹悶r螳御コ縺励∪縺励◆縲" ); + Trace.Unindent(); + } + base.On豢サ諤ァ蛹(); // 2011.3.14 yyagi: On豢サ諤ァ蛹()繧稚ry縺ョ荳ュ縺九i螟悶↓遘サ蜍 + } + public override void On髱樊エサ諤ァ蛹() + { + Trace.TraceInformation( "繧ウ繝ウ繝輔ぅ繧ー繧ケ繝繝シ繧ク繧帝撼豢サ諤ァ蛹悶@縺セ縺吶" ); + Trace.Indent(); + try + { + TJAPlayer3.ConfigIni.t譖ク縺榊コ縺( TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 + "Config.ini" ); // CONFIG縺縺 + if( this.ft繝輔か繝ウ繝 != null ) // 莉・荳軌PTION縺ィ蜈ア騾 + { + this.ft繝輔か繝ウ繝.Dispose(); + this.ft繝輔か繝ウ繝 = null; + } + for( int i = 0; i < 4; i++ ) + { + this.ct繧ュ繝シ蜿榊セゥ逕ィ[ i ] = null; + } + base.On髱樊エサ諤ァ蛹(); + } + catch ( UnauthorizedAccessException e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "繝輔ぃ繧、繝ォ縺瑚ェュ縺ソ蜿悶j蟆ら畑縺ォ縺ェ縺」縺ヲ縺縺ェ縺縺九∫ョ。逅閠讓ゥ髯舌′縺ェ縺縺ィ譖ク縺崎セシ繧√↑縺上↑縺」縺ヲ縺縺ェ縺縺狗ュ峨r遒コ隱阪@縺ヲ荳九&縺" ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (7a61f01b-1703-4aad-8d7d-08bd88ae8760)" ); + } + catch ( Exception e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (83f0d93c-bb04-4a19-a596-bc32de39f496)" ); + } + finally + { + Trace.TraceInformation( "繧ウ繝ウ繝輔ぅ繧ー繧ケ繝繝シ繧ク縺ョ髱樊エサ諤ァ蛹悶r螳御コ縺励∪縺励◆縲" ); + Trace.Unindent(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() // OPTION縺ィ逕サ蜒丈サ・螟門ア騾 + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + ctBackgroundAnime = new CCounter(0, 1280, 20, TJAPlayer3.Timer); + //this.tx閭梧勹 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\4_background.jpg" ), false ); + //this.tx荳企Κ繝代ロ繝ォ = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\4_header panel.png" ) ); + //this.tx荳矩Κ繝代ロ繝ォ = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\4_footer panel.png" ) ); + //this.txMenu繧ォ繝シ繧ス繝ォ = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\ScreenConfig menu cursor.png" ) ); + string[] strMenuItem = {"System", "Drums", "Exit"}; + txMenuItemLeft = new CTexture[strMenuItem.Length, 2]; + using (var prvFont = new CPrivateFastFont(CSkin.Path(@"mplus-1p-heavy.ttf"), 20)) + { + for (int i = 0; i < strMenuItem.Length; i++) + { + using (var bmpStr = prvFont.DrawPrivateFont(strMenuItem[i], Color.White, Color.Black)) + { + txMenuItemLeft[i, 0] = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(bmpStr, false); + } + using (var bmpStr = prvFont.DrawPrivateFont(strMenuItem[i], Color.White, Color.Black, Color.Yellow, Color.OrangeRed)) + { + txMenuItemLeft[i, 1] = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(bmpStr, false); + } + } + } + + if( this.b繝。繝九Η繝シ縺ォ繝輔か繝シ繧ォ繧ケ荳ュ ) + { + this.t隱ャ譏取枚繝代ロ繝ォ縺ォ迴セ蝨ィ驕ク謚槭&繧後※縺繧九Γ繝九Η繝シ縺ョ隱ャ譏弱r謠冗判縺吶k(); + } + else + { + this.t隱ャ譏取枚繝代ロ繝ォ縺ォ迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ縺ョ隱ャ譏弱r謠冗判縺吶k(); + } + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() // OPTION縺ィ蜷後§(COnfig.ini縺ョ譖ク縺榊コ縺励ち繧、繝溘Φ繧ー縺ョ縺ソ逡ー縺ェ繧九′縲∫┌隕悶@縺ヲ濶ッ縺) + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx閭梧勹 ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx荳企Κ繝代ロ繝ォ ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx荳矩Κ繝代ロ繝ォ ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txMenu繧ォ繝シ繧ス繝ォ ); + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx隱ャ譏取枚繝代ロ繝ォ ); + for ( int i = 0; i < txMenuItemLeft.GetLength( 0 ); i++ ) + { + txMenuItemLeft[ i, 0 ].Dispose(); + txMenuItemLeft[ i, 0 ] = null; + txMenuItemLeft[ i, 1 ].Dispose(); + txMenuItemLeft[ i, 1 ] = null; + } + txMenuItemLeft = null; + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return 0; + + if( base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨う繝ウ; + this.actFIFO.t繝輔ぉ繝シ繝峨う繝ウ髢句ァ(); + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + + ctBackgroundAnime.t騾イ陦鍬oop(); + + // 謠冗判 + + #region [ 閭梧勹 ] + //--------------------- + for(int i = 0; i < 2; i++) + if (TJAPlayer3.Tx.Config_Background != null ) + TJAPlayer3.Tx.Config_Background.t2D謠冗判( TJAPlayer3.app.Device, 0 + -(1280 * i) + ctBackgroundAnime.n迴セ蝨ィ縺ョ蛟、, 0 ); + if(TJAPlayer3.Tx.Config_Header != null ) + TJAPlayer3.Tx.Config_Header.t2D謠冗判( TJAPlayer3.app.Device, 0, 0 ); + //--------------------- + #endregion + #region [ 繝。繝九Η繝シ繧ォ繝シ繧ス繝ォ ] + //--------------------- + if( TJAPlayer3.Tx.Config_Cursor != null ) + { + Rectangle rectangle; + TJAPlayer3.Tx.Config_Cursor.Opacity = this.b繝。繝九Η繝シ縺ォ繝輔か繝シ繧ォ繧ケ荳ュ ? 255 : 128; + int x = 110; + int y = (int)( 145.5 + ( this.n迴セ蝨ィ縺ョ繝。繝九Η繝シ逡ェ蜿キ * 37.5 ) ); + int num3 = 340; + TJAPlayer3.Tx.Config_Cursor.t2D謠冗判( TJAPlayer3.app.Device, x, y, new Rectangle( 0, 0, 32, 48 ) ); + TJAPlayer3.Tx.Config_Cursor.t2D謠冗判( TJAPlayer3.app.Device, ( x + num3 ) - 32, y, new Rectangle( 20, 0, 32, 48 ) ); + x += 32; + for( num3 -= 64; num3 > 0; num3 -= rectangle.Width ) + { + rectangle = new Rectangle( 16, 0, 32, 48 ); + if( num3 < 32 ) + { + rectangle.Width -= 32 - num3; + } + TJAPlayer3.Tx.Config_Cursor.t2D謠冗判( TJAPlayer3.app.Device, x, y, rectangle ); + x += rectangle.Width; + } + } + //--------------------- + #endregion + #region [ 繝。繝九Η繝シ ] + //--------------------- + int menuY = 162 - 22; + int stepY = 39; + for ( int i = 0; i < txMenuItemLeft.GetLength( 0 ); i++ ) + { + //Bitmap bmpStr = (this.n迴セ蝨ィ縺ョ繝。繝九Η繝シ逡ェ蜿キ == i) ? + // prvFont.DrawPrivateFont( strMenuItem[ i ], Color.White, Color.Black, Color.Yellow, Color.OrangeRed ) : + // prvFont.DrawPrivateFont( strMenuItem[ i ], Color.White, Color.Black ); + //txMenuItemLeft = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmpStr, false ); + int flag = ( this.n迴セ蝨ィ縺ョ繝。繝九Η繝シ逡ェ蜿キ == i ) ? 1 : 0; + int num4 = txMenuItemLeft[ i, flag ].sz逕サ蜒上し繧、繧コ.Width; + txMenuItemLeft[i, flag].t2D謠冗判(TJAPlayer3.app.Device, 282 - (num4 / 2) + TJAPlayer3.Skin.Config_ItemText_Correction_X, menuY + TJAPlayer3.Skin.Config_ItemText_Correction_Y ); //55 + //txMenuItem.Dispose(); + menuY += stepY; + } + //--------------------- + #endregion + #region [ 隱ャ譏取枚繝代ロ繝ォ ] + //--------------------- + if( this.tx隱ャ譏取枚繝代ロ繝ォ != null ) + this.tx隱ャ譏取枚繝代ロ繝ォ.t2D謠冗判( TJAPlayer3.app.Device, 67, 382 ); + //--------------------- + #endregion + #region [ 繧「繧、繝繝 ] + //--------------------- + switch( this.eItemPanel繝「繝シ繝 ) + { + case EItemPanel繝「繝シ繝.繝代ャ繝我ク隕ァ: + this.actList.t騾イ陦梧緒逕サ( !this.b繝。繝九Η繝シ縺ォ繝輔か繝シ繧ォ繧ケ荳ュ ); + break; + + case EItemPanel繝「繝シ繝.繧ュ繝シ繧ウ繝シ繝我ク隕ァ: + this.actKeyAssign.On騾イ陦梧緒逕サ(); + break; + } + //--------------------- + #endregion + //#region [ 荳企Κ繝代ロ繝ォ ] + ////--------------------- + //if( this.tx荳企Κ繝代ロ繝ォ != null ) + // this.tx荳企Κ繝代ロ繝ォ.t2D謠冗判( CDTXMania.app.Device, 0, 0 ); + ////--------------------- + //#endregion + //#region [ 荳矩Κ繝代ロ繝ォ ] + ////--------------------- + //if( this.tx荳矩Κ繝代ロ繝ォ != null ) + // this.tx荳矩Κ繝代ロ繝ォ.t2D謠冗判( CDTXMania.app.Device, 0, 720 - this.tx荳矩Κ繝代ロ繝ォ.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height ); + ////--------------------- + //#endregion + #region [ 繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ ] + //--------------------- + //this.act繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.On騾イ陦梧緒逕サ(); + //--------------------- + #endregion + #region [ 繝輔ぉ繝シ繝峨う繝ウ_繧「繧ヲ繝 ] + //--------------------- + switch( base.e繝輔ぉ繝シ繧コID ) + { + case CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨う繝ウ: + if( this.actFIFO.On騾イ陦梧緒逕サ() != 0 ) + { + TJAPlayer3.Skin.bgm繧ウ繝ウ繝輔ぅ繧ー逕サ髱「.t蜀咲函縺吶k(); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷; + } + break; + + case CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝: + if( this.actFIFO.On騾イ陦梧緒逕サ() == 0 ) + { + break; + } + return 1; + } + //--------------------- + #endregion + + #region [ Enumerating Songs ] + // CActEnumSongs蛛エ縺ァ陦ィ遉コ縺吶k + #endregion + + // 繧ュ繝シ蜈・蜉 + + if( ( base.e繝輔ぉ繝シ繧コID != CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷 ) + || this.actKeyAssign.b繧ュ繝シ蜈・蜉帛セ縺。縺ョ譛荳ュ縺ァ縺ゅk + || TJAPlayer3.act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ != null ) + return 0; + + // 譖イ繝繝シ繧ソ縺ョ荳隕ァ蜿門セ嶺クュ縺ッ縲√く繝シ蜈・蜉帙r辟。蜉ケ蛹悶☆繧 + if ( !TJAPlayer3.EnumSongs.IsEnumerating || TJAPlayer3.actEnumSongs.b繧ウ繝槭Φ繝峨〒縺ョ譖イ繝繝シ繧ソ蜿門セ != true ) + { + if ( ( TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.Escape ) || TJAPlayer3.Pad.b謚シ縺輔l縺( E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.FT ) ) || TJAPlayer3.Pad.b謚シ縺輔l縺檬B( E繝代ャ繝.FT ) ) + { + TJAPlayer3.Skin.sound蜿匁カ磯浹.t蜀咲函縺吶k(); + if ( !this.b繝。繝九Η繝シ縺ォ繝輔か繝シ繧ォ繧ケ荳ュ ) + { + if ( this.eItemPanel繝「繝シ繝 == EItemPanel繝「繝シ繝.繧ュ繝シ繧ウ繝シ繝我ク隕ァ ) + { + TJAPlayer3.stage繧ウ繝ウ繝輔ぅ繧ー.t繧「繧オ繧、繝ウ螳御コ騾夂衍(); + return 0; + } + if ( !this.actList.bIsKeyAssignSelected && !this.actList.bIsFocusingParameter ) // #24525 2011.3.15 yyagi, #32059 2013.9.17 yyagi + { + this.b繝。繝九Η繝シ縺ォ繝輔か繝シ繧ォ繧ケ荳ュ = true; + } + this.t隱ャ譏取枚繝代ロ繝ォ縺ォ迴セ蝨ィ驕ク謚槭&繧後※縺繧九Γ繝九Η繝シ縺ョ隱ャ譏弱r謠冗判縺吶k(); + this.actList.tEsc謚シ荳(); // #24525 2011.3.15 yyagi ESC謚シ荳区凾縺ョ蜿ウ繝。繝九Η繝シ謠冗判逕ィ + } + else + { + this.actFIFO.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝; + } + } + else if ( ( TJAPlayer3.Pad.b謚シ縺輔l縺櫂GB( E繝代ャ繝.CY ) || TJAPlayer3.Pad.b謚シ縺輔l縺( E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RD ) ) || ( TJAPlayer3.Pad.b謚シ縺輔l縺( E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LC ) || ( TJAPlayer3.ConfigIni.bEnter縺後く繝シ蜑イ繧雁ス薙※縺ョ縺ゥ縺薙↓繧ゆスソ逕ィ縺輔l縺ヲ縺縺ェ縺 && TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.Return ) ) ) ) + { + if ( this.n迴セ蝨ィ縺ョ繝。繝九Η繝シ逡ェ蜿キ == 2 ) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + this.actFIFO.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝; + } + else if ( this.b繝。繝九Η繝シ縺ォ繝輔か繝シ繧ォ繧ケ荳ュ ) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + this.b繝。繝九Η繝シ縺ォ繝輔か繝シ繧ォ繧ケ荳ュ = false; + this.t隱ャ譏取枚繝代ロ繝ォ縺ォ迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ縺ョ隱ャ譏弱r謠冗判縺吶k(); + } + else + { + switch ( this.eItemPanel繝「繝シ繝 ) + { + case EItemPanel繝「繝シ繝.繝代ャ繝我ク隕ァ: + bool bIsKeyAssignSelectedBeforeHitEnter = this.actList.bIsKeyAssignSelected; // #24525 2011.3.15 yyagi + this.actList.tEnter謚シ荳(); + if ( this.actList.b迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ縺ッReturnToMenu縺ァ縺ゅk ) + { + this.t隱ャ譏取枚繝代ロ繝ォ縺ォ迴セ蝨ィ驕ク謚槭&繧後※縺繧九Γ繝九Η繝シ縺ョ隱ャ譏弱r謠冗判縺吶k(); + if ( bIsKeyAssignSelectedBeforeHitEnter == false ) // #24525 2011.3.15 yyagi + { + this.b繝。繝九Η繝シ縺ォ繝輔か繝シ繧ォ繧ケ荳ュ = true; + } + } + break; + + case EItemPanel繝「繝シ繝.繧ュ繝シ繧ウ繝シ繝我ク隕ァ: + this.actKeyAssign.tEnter謚シ荳(); + break; + } + } + } + this.ct繧ュ繝シ蜿榊セゥ逕ィ.Up.t繧ュ繝シ蜿榊セゥ( TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( (int)SlimDXKeys.Key.UpArrow ), new CCounter.DG繧ュ繝シ蜃ヲ逅( this.t繧ォ繝シ繧ス繝ォ繧剃ク翫∈遘サ蜍輔☆繧 ) ); + this.ct繧ュ繝シ蜿榊セゥ逕ィ.R.t繧ュ繝シ蜿榊セゥ( TJAPlayer3.Pad.b謚シ縺輔l縺ヲ縺繧季B( E繝代ャ繝.HH ), new CCounter.DG繧ュ繝シ蜃ヲ逅( this.t繧ォ繝シ繧ス繝ォ繧剃ク翫∈遘サ蜍輔☆繧 ) ); + if ( TJAPlayer3.Pad.b謚シ縺輔l縺( E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.SD ) ) + { + this.t繧ォ繝シ繧ス繝ォ繧剃ク翫∈遘サ蜍輔☆繧(); + } + this.ct繧ュ繝シ蜿榊セゥ逕ィ.Down.t繧ュ繝シ蜿榊セゥ( TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( (int)SlimDXKeys.Key.DownArrow ), new CCounter.DG繧ュ繝シ蜃ヲ逅( this.t繧ォ繝シ繧ス繝ォ繧剃ク九∈遘サ蜍輔☆繧 ) ); + this.ct繧ュ繝シ蜿榊セゥ逕ィ.B.t繧ュ繝シ蜿榊セゥ( TJAPlayer3.Pad.b謚シ縺輔l縺ヲ縺繧季B( E繝代ャ繝.BD ), new CCounter.DG繧ュ繝シ蜃ヲ逅( this.t繧ォ繝シ繧ス繝ォ繧剃ク九∈遘サ蜍輔☆繧 ) ); + if ( TJAPlayer3.Pad.b謚シ縺輔l縺( E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LT ) ) + { + this.t繧ォ繝シ繧ス繝ォ繧剃ク九∈遘サ蜍輔☆繧(); + } + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private enum EItemPanel繝「繝シ繝 + { + 繝代ャ繝我ク隕ァ, + 繧ュ繝シ繧ウ繝シ繝我ク隕ァ + } + + [StructLayout( LayoutKind.Sequential )] + private struct ST繧ュ繝シ蜿榊セゥ逕ィ繧ォ繧ヲ繝ウ繧ソ + { + public CCounter Up; + public CCounter Down; + public CCounter R; + public CCounter B; + public CCounter this[ int index ] + { + get + { + switch( index ) + { + case 0: + return this.Up; + + case 1: + return this.Down; + + case 2: + return this.R; + + case 3: + return this.B; + } + throw new IndexOutOfRangeException(); + } + set + { + switch( index ) + { + case 0: + this.Up = value; + return; + + case 1: + this.Down = value; + return; + + case 2: + this.R = value; + return; + + case 3: + this.B = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + + private CCounter ctBackgroundAnime; + private CActFIFOWhite actFIFO; + private CActConfigKeyAssign actKeyAssign; + private CActConfigList actList; + private CAct繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ act繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ; + private bool b繝。繝九Η繝シ縺ォ繝輔か繝シ繧ォ繧ケ荳ュ; + private ST繧ュ繝シ蜿榊セゥ逕ィ繧ォ繧ヲ繝ウ繧ソ ct繧ュ繝シ蜿榊セゥ逕ィ; + private const int DESC_H = 0x80; + private const int DESC_W = 220; + private EItemPanel繝「繝シ繝 eItemPanel繝「繝シ繝; + private Font ft繝輔か繝ウ繝; + private int n迴セ蝨ィ縺ョ繝。繝九Η繝シ逡ェ蜿キ; + //private CTexture txMenu繧ォ繝シ繧ス繝ォ; + //private CTexture tx荳矩Κ繝代ロ繝ォ; + //private CTexture tx荳企Κ繝代ロ繝ォ; + private CTexture tx隱ャ譏取枚繝代ロ繝ォ; + //private CTexture tx閭梧勹; + private CTexture[ , ] txMenuItemLeft; + + private void t繧ォ繝シ繧ス繝ォ繧剃ク九∈遘サ蜍輔☆繧() + { + if( !this.b繝。繝九Η繝シ縺ォ繝輔か繝シ繧ォ繧ケ荳ュ ) + { + switch( this.eItemPanel繝「繝シ繝 ) + { + case EItemPanel繝「繝シ繝.繝代ャ繝我ク隕ァ: + this.actList.t谺。縺ォ遘サ蜍(); + return; + + case EItemPanel繝「繝シ繝.繧ュ繝シ繧ウ繝シ繝我ク隕ァ: + this.actKeyAssign.t谺。縺ォ遘サ蜍(); + return; + } + } + else + { + TJAPlayer3.Skin.sound繧ォ繝シ繧ス繝ォ遘サ蜍暮浹.t蜀咲函縺吶k(); + this.n迴セ蝨ィ縺ョ繝。繝九Η繝シ逡ェ蜿キ = ( this.n迴セ蝨ィ縺ョ繝。繝九Η繝シ逡ェ蜿キ + 1 ) % 3; + switch( this.n迴セ蝨ィ縺ョ繝。繝九Η繝シ逡ェ蜿キ ) + { + case 0: + this.actList.t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟System(); + break; + + case 1: + this.actList.t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟Drums(); + break; + + case 2: + this.actList.t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟Exit(); + break; + } + this.t隱ャ譏取枚繝代ロ繝ォ縺ォ迴セ蝨ィ驕ク謚槭&繧後※縺繧九Γ繝九Η繝シ縺ョ隱ャ譏弱r謠冗判縺吶k(); + } + } + private void t繧ォ繝シ繧ス繝ォ繧剃ク翫∈遘サ蜍輔☆繧() + { + if( !this.b繝。繝九Η繝シ縺ォ繝輔か繝シ繧ォ繧ケ荳ュ ) + { + switch( this.eItemPanel繝「繝シ繝 ) + { + case EItemPanel繝「繝シ繝.繝代ャ繝我ク隕ァ: + this.actList.t蜑阪↓遘サ蜍(); + return; + + case EItemPanel繝「繝シ繝.繧ュ繝シ繧ウ繝シ繝我ク隕ァ: + this.actKeyAssign.t蜑阪↓遘サ蜍(); + return; + } + } + else + { + TJAPlayer3.Skin.sound繧ォ繝シ繧ス繝ォ遘サ蜍暮浹.t蜀咲函縺吶k(); + this.n迴セ蝨ィ縺ョ繝。繝九Η繝シ逡ェ蜿キ = ((this.n迴セ蝨ィ縺ョ繝。繝九Η繝シ逡ェ蜿キ - 1) + 3) % 3; + switch ( this.n迴セ蝨ィ縺ョ繝。繝九Η繝シ逡ェ蜿キ ) + { + case 0: + this.actList.t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟System(); + break; + + case 1: + this.actList.t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟Drums(); + break; + + case 2: + this.actList.t鬆逶ョ繝ェ繧ケ繝医ョ險ュ螳喟Exit(); + break; + } + this.t隱ャ譏取枚繝代ロ繝ォ縺ォ迴セ蝨ィ驕ク謚槭&繧後※縺繧九Γ繝九Η繝シ縺ョ隱ャ譏弱r謠冗判縺吶k(); + } + } + private void t隱ャ譏取枚繝代ロ繝ォ縺ォ迴セ蝨ィ驕ク謚槭&繧後※縺繧九Γ繝九Η繝シ縺ョ隱ャ譏弱r謠冗判縺吶k() + { + try + { + var image = new Bitmap( 440, 288 ); // 隱ャ譏取枚鬆伜沺繧オ繧、繧コ縺ョ邵ヲ讓ェ 2 蛟阪ゑシ域緒逕サ譎ゅ↓ 0.5 蛟阪〒陦ィ遉コ縺吶k縲ゑシ + var graphics = Graphics.FromImage( image ); + graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; + graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; + + string[,] str = new string[ 2, 2 ]; + switch( this.n迴セ蝨ィ縺ョ繝。繝九Η繝シ逡ェ蜿キ ) + { + case 0: + str[ 0, 0 ] = "繧キ繧ケ繝繝縺ォ髢「菫ゅ☆繧矩逶ョ繧定ィュ螳壹@縺セ縺吶"; + str[ 0, 1 ] = ""; + str[ 1, 0 ] = "Settings for an overall systems."; + break; + + case 1: + str[ 0, 0 ] = "繝峨Λ繝縺ョ貍泌・上↓髢「縺吶k鬆逶ョ繧定ィュ螳壹@縺セ縺吶"; + str[ 0, 1 ] = ""; + str[ 1, 0 ] = "Settings to play the drums."; + str[ 1, 1 ] = ""; + break; + + case 2: + str[ 0, 0 ] = "險ュ螳壹r菫晏ュ倥@縲√さ繝ウ繝輔ぅ繧ー逕サ髱「繧堤オゆコ縺励∪縺吶"; + str[ 0, 1 ] = ""; + str[ 1, 0 ] = "Save the settings and exit from"; + str[ 1, 1 ] = "CONFIGURATION menu."; + break; + } + + int c = (CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "ja") ? 0 : 1; + for (int i = 0; i < 2; i++) + { + graphics.DrawString( str[ c, i ], this.ft繝輔か繝ウ繝, Brushes.White, new PointF( 8f, ( i * 30 ) * 1.5f ) ); + } + graphics.Dispose(); + if( this.tx隱ャ譏取枚繝代ロ繝ォ != null ) + { + this.tx隱ャ譏取枚繝代ロ繝ォ.Dispose(); + } + this.tx隱ャ譏取枚繝代ロ繝ォ = new CTexture( TJAPlayer3.app.Device, image, TJAPlayer3.TextureFormat ); + image.Dispose(); + } + catch( CTextureCreateFailedException e) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "隱ャ譏取枚繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲" ); + this.tx隱ャ譏取枚繝代ロ繝ォ = null; + } + } + private void t隱ャ譏取枚繝代ロ繝ォ縺ォ迴セ蝨ィ驕ク謚槭&繧後※縺繧矩逶ョ縺ョ隱ャ譏弱r謠冗判縺吶k() + { + try + { + var image = new Bitmap( 440, 288 ); // 隱ャ譏取枚鬆伜沺繧オ繧、繧コ縺ョ邵ヲ讓ェ 2 蛟阪ゑシ域緒逕サ譎ゅ↓ 0.5 蛟阪〒陦ィ遉コ縺吶k___縺ョ縺ッ荳ュ豁「縲ょヲ逅騾溷コヲ蜷台ク翫ョ縺溘a縲ゑシ + var graphics = Graphics.FromImage( image ); + graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; + graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; + + CItemBase item = this.actList.ib迴セ蝨ィ縺ョ驕ク謚樣逶ョ; + if( ( item.str隱ャ譏取枚 != null ) && ( item.str隱ャ譏取枚.Length > 0 ) ) + { + graphics.DrawString( item.str隱ャ譏取枚, this.ft繝輔か繝ウ繝, Brushes.White, new RectangleF( 8f, 0, 630, 430 ) ); + } + graphics.Dispose(); + if( this.tx隱ャ譏取枚繝代ロ繝ォ != null ) + { + this.tx隱ャ譏取枚繝代ロ繝ォ.Dispose(); + } + this.tx隱ャ譏取枚繝代ロ繝ォ = new CTexture( TJAPlayer3.app.Device, image, TJAPlayer3.TextureFormat ); + image.Dispose(); + } + catch( CTextureCreateFailedException e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "隱ャ譏取枚繝代ロ繝ォ繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲" ); + this.tx隱ャ譏取枚繝代ロ繝ォ = null; + } + } + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/05.DaniSelect/CActSelect谿オ菴阪Μ繧ケ繝.cs b/TJAPlayer3/Stages/05.DaniSelect/CActSelect谿オ菴阪Μ繧ケ繝.cs new file mode 100644 index 00000000..00f73e6b --- /dev/null +++ b/TJAPlayer3/Stages/05.DaniSelect/CActSelect谿オ菴阪Μ繧ケ繝.cs @@ -0,0 +1,376 @@ +サソusing System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using FDK; +using static TJAPlayer3.CActSelect譖イ繝ェ繧ケ繝; + +namespace TJAPlayer3 +{ + class CActSelect谿オ菴阪Μ繧ケ繝 : CStage + { + public CActSelect谿オ菴阪Μ繧ケ繝() + { + for(int i = 0; i < 10; i++) + { + stLevel[i].ch = i.ToString().ToCharArray()[0]; + stLevel[i].pt = new Point(i * 14, 0); + + stSoulNumber[i].ch = i.ToString().ToCharArray()[0]; + stSoulNumber[i].pt = new Point(i * 23, 0); + + stExamNumber[i].ch = i.ToString().ToCharArray()[0]; + stExamNumber[i].pt = new Point(i * 19, 0); + } + } + + public bool b繧ケ繧ッ繝ュ繝シ繝ォ荳ュ + { + get + { + return ctDaniMoveAnime.b騾イ陦御クュ; + } + } + + public override void On豢サ諤ァ蛹() + { + if (this.b豢サ諤ァ蛹悶@縺ヲ繧) + return; + + DaniInAnime = false; + + ctDaniMoveAnime = new CCounter(); + ctDanAnimeIn = new CCounter(); + ctDaniIn = new CCounter(0, 3000, 1, TJAPlayer3.Timer); + + st繝舌シ諠蝣ア = new ST繝舌シ諠蝣ア[TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝_Dan.Count]; + + if (!string.IsNullOrEmpty(TJAPlayer3.ConfigIni.FontName)) + pfDanSong = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), 24); + else + pfDanSong = new CPrivateFastFont(new FontFamily("MS UI Gothic"), 16); + + //荳蠢懊メ繧ァ繝繧ッ縺励※縺翫¥縲 + if(TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝_Dan.Count > 0) + this.t繝舌シ縺ョ蛻晄悄蛹(); + + base.On豢サ諤ァ蛹(); + } + + public override void On髱樊エサ諤ァ蛹() + { + base.On髱樊エサ諤ァ蛹(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + public override int On騾イ陦梧緒逕サ() + { + ctDaniMoveAnime.t騾イ陦(); + ctDaniIn.t騾イ陦(); + ctDanAnimeIn.t騾イ陦(); + + if (ctDaniIn.n迴セ蝨ィ縺ョ蛟、 == 3000) + { + if(!DaniInAnime) + { + ctDanAnimeIn.t髢句ァ(0, 90, 2f, TJAPlayer3.Timer); + DaniInAnime = true; + } + } + + #region [ 繝舌シ陦ィ遉コ ] + + if (st繝舌シ諠蝣ア.Length != 0) + { + TJAPlayer3.Tx.DanC_ExamType.vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.81f; + TJAPlayer3.Tx.DanC_ExamType.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.81f; + + float Anime = ctDanAnimeIn.n迴セ蝨ィ縺ョ蛟、 == 90 ? bLeftMove ? (float)Math.Sin(ctDaniMoveAnime.n迴セ蝨ィ縺ョ蛟、 * (Math.PI / 180)) * 1280 : -((float)Math.Sin(ctDaniMoveAnime.n迴セ蝨ィ縺ョ蛟、 * (Math.PI / 180)) * 1280) : 1280 - (float)Math.Sin(ctDanAnimeIn.n迴セ蝨ィ縺ョ蛟、 * (Math.PI / 180)) * 1280; + + #region [ 荳ュ螟ョ繝舌シ縺ョ陦ィ遉コ ] + + if (st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.txBarCenter != null) st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.txBarCenter?.t2D謠冗判(TJAPlayer3.app.Device, Anime, 0); + else TJAPlayer3.Tx.Dani_Bar_Center.t2D謠冗判(TJAPlayer3.app.Device, Anime, 0); + if (st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.txDanPlate != null) st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.txDanPlate.Opacity = 255; + st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.txDanPlate?.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 173 + Anime, 301); + + if (st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.List_DanSongs[0].Dan_C[0] != null) + tSoulDraw(370 + Anime, 462, st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.List_DanSongs[0].Dan_C[0].Value[0].ToString()); + + for (int i = 0; i < st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.ttk繧ソ繧、繝医Ν.Length; i++) + TJAPlayer3.stage驕ク譖イ.act譖イ繝ェ繧ケ繝.ResolveTitleTexture(st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.ttk繧ソ繧、繝医Ν[i]).t2D謠冗判(TJAPlayer3.app.Device, 401 + Anime, 173 + i * 73); + for (int i = 0; i < st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.n譖イ髮」譏灘コヲ.Length; i++) + TJAPlayer3.Tx.Dani_Difficulty_Cymbol.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 377 + Anime, 180 + i * 73, new Rectangle(st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.n譖イ髮」譏灘コヲ[i] * 53, 0, 53, 53)); + for (int i = 0; i < st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.n譖イ繝ャ繝吶Ν.Length; i++) + this.tLevelNumberDraw(383 + Anime, 207 + i * 73, st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.n譖イ繝ャ繝吶Ν[i].ToString()); + + for (int j = 1; j < 4; j++) //谿オ菴肴擅莉カ縺ョ繝ォ繝シ繝(鬲ゅご繝シ繧ク繧帝勁縺) 邵ヲ(y) + { + if (st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.List_DanSongs[0].Dan_C[j] != null) + { + TJAPlayer3.Tx.DanC_ExamType?.t2D謠冗判(TJAPlayer3.app.Device, 515 + Anime, 412 + (j - 1) * 88, new Rectangle(0, TJAPlayer3.Skin.Game_DanC_ExamType_Size[1] * (int)st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.List_DanSongs[0].Dan_C[j].GetExamType(), TJAPlayer3.Skin.Game_DanC_ExamType_Size[0], TJAPlayer3.Skin.Game_DanC_ExamType_Size[1])); + } + + for (int i = 0; i < st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.List_DanSongs.Count; i++) //譖イ縺斐→縺ョ繝ォ繝シ繝(鬲ゅご繝シ繧ク繧帝勁縺) 讓ェ(x) + { + if (st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.List_DanSongs[i].Dan_C[j] != null) + { + if (st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.List_DanSongs[st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.List_DanSongs.Count - 1].Dan_C[j] != null) //蛟句挨縺ョ譚。莉カ縺後≠繧翫∪縺吶h繝シ + { + tExamDraw(590 + Anime + i * 220, 455 + (j - 1) * 88, st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.List_DanSongs[i].Dan_C[j].Value[0].ToString(), st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.List_DanSongs[i].Dan_C[j].GetExamRange()); + } + else //蜈ィ菴薙ョ譚。莉カ縺ァ縺吶h繝シ + { + tExamDraw(590 + Anime, 455 + (j - 1) * 88, st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.List_DanSongs[0].Dan_C[j].Value[0].ToString(), st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。珪.List_DanSongs[0].Dan_C[j].GetExamRange()); + } + } + } + } + + #endregion + + if (bLeftMove && n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1 >= 0) + { + #region [ 蟾ヲ繝舌シ縺ョ陦ィ遉コ ] + + if (st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].txBarCenter != null) st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].txBarCenter?.t2D謠冗判(TJAPlayer3.app.Device, -1280 + Anime, 0); + else TJAPlayer3.Tx.Dani_Bar_Center.t2D謠冗判(TJAPlayer3.app.Device, -1280 + Anime, 0); + + if (st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].txDanPlate != null) st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].txDanPlate.Opacity = 255; + st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].txDanPlate?.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, -1280 + 173 + Anime, 301); + + if (st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].List_DanSongs[0].Dan_C[0] != null) + tSoulDraw(-1280 + 370 + Anime, 462, st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].List_DanSongs[0].Dan_C[0].Value[0].ToString()); + + for (int i = 0; i < st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].ttk繧ソ繧、繝医Ν.Length; i++) + TJAPlayer3.stage驕ク譖イ.act譖イ繝ェ繧ケ繝.ResolveTitleTexture(st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].ttk繧ソ繧、繝医Ν[i]).t2D謠冗判(TJAPlayer3.app.Device, -879 + Anime, 173 + i * 73); + for (int i = 0; i < st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].n譖イ髮」譏灘コヲ.Length; i++) + TJAPlayer3.Tx.Dani_Difficulty_Cymbol.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, -1280 + 377 + +Anime, 180 + i * 73, new Rectangle(st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].n譖イ髮」譏灘コヲ[i] * 53, 0, 53, 53)); + for (int i = 0; i < st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].n譖イ繝ャ繝吶Ν.Length; i++) + this.tLevelNumberDraw(-1280 + 383 + Anime, 207 + i * 73, st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].n譖イ繝ャ繝吶Ν[i].ToString()); + + for (int j = 1; j < 4; j++) //谿オ菴肴擅莉カ縺ョ繝ォ繝シ繝(鬲ゅご繝シ繧ク繧帝勁縺) 邵ヲ(y) + { + if (st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].List_DanSongs[0].Dan_C[j] != null) + { + TJAPlayer3.Tx.DanC_ExamType?.t2D謠冗判(TJAPlayer3.app.Device, -1280 + 515 + Anime, 412 + (j - 1) * 88, new Rectangle(0, TJAPlayer3.Skin.Game_DanC_ExamType_Size[1] * (int)st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].List_DanSongs[0].Dan_C[j].GetExamType(), TJAPlayer3.Skin.Game_DanC_ExamType_Size[0], TJAPlayer3.Skin.Game_DanC_ExamType_Size[1])); + } + + for (int i = 0; i < st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].List_DanSongs.Count; i++) //譖イ縺斐→縺ョ繝ォ繝シ繝(鬲ゅご繝シ繧ク繧帝勁縺) 讓ェ(x) + { + if (st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].List_DanSongs[i].Dan_C[j] != null) + { + if (st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].List_DanSongs[st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].List_DanSongs.Count - 1].Dan_C[j] != null) //蛟句挨縺ョ譚。莉カ縺後≠繧翫∪縺吶h繝シ + { + tExamDraw(-1280 + 590 + Anime + i * 220, 455 + (j - 1) * 88, st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].List_DanSongs[i].Dan_C[j].Value[0].ToString(), st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].List_DanSongs[i].Dan_C[j].GetExamRange()); + } + else //蜈ィ菴薙ョ譚。莉カ縺ァ縺吶h繝シ + { + tExamDraw(-1280 + 590 + Anime, 455 + (j - 1) * 88, st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].List_DanSongs[0].Dan_C[j].Value[0].ToString(), st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1].List_DanSongs[0].Dan_C[j].GetExamRange()); + } + } + } + } + + #endregion + } + if (!bLeftMove && n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1 <= st繝舌シ諠蝣ア.Length - 1) + { + #region [ 蜿ウ繝舌シ縺ョ陦ィ遉コ ] + + if (st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].txBarCenter != null) st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].txBarCenter?.t2D謠冗判(TJAPlayer3.app.Device, 1280 + Anime, 0); + else TJAPlayer3.Tx.Dani_Bar_Center.t2D謠冗判(TJAPlayer3.app.Device, 1280 + Anime, 0); + + if(st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].txDanPlate != null) st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].txDanPlate.Opacity = 255; + st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].txDanPlate?.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 1280 + 173 + Anime, 301); + + if (st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].List_DanSongs[0].Dan_C[0] != null) + tSoulDraw(1280 + 370 + Anime, 462, st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].List_DanSongs[0].Dan_C[0].Value[0].ToString()); + + for (int i = 0; i < st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].ttk繧ソ繧、繝医Ν.Length; i++) + TJAPlayer3.stage驕ク譖イ.act譖イ繝ェ繧ケ繝.ResolveTitleTexture(st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].ttk繧ソ繧、繝医Ν[i]).t2D謠冗判(TJAPlayer3.app.Device, 1280 + 401 + Anime, 173 + i * 73); + for (int i = 0; i < st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].n譖イ髮」譏灘コヲ.Length; i++) + TJAPlayer3.Tx.Dani_Difficulty_Cymbol.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 1280 + 377 + Anime, 180 + i * 73, new Rectangle(st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].n譖イ髮」譏灘コヲ[i] * 53, 0, 53, 53)); + for (int i = 0; i < st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].n譖イ繝ャ繝吶Ν.Length; i++) + this.tLevelNumberDraw(1280 + 383 + Anime, 207 + i * 73, st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].n譖イ繝ャ繝吶Ν[i].ToString()); + + for (int j = 1; j < 4; j++) //谿オ菴肴擅莉カ縺ョ繝ォ繝シ繝(鬲ゅご繝シ繧ク繧帝勁縺) 邵ヲ(y) + { + if (st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].List_DanSongs[0].Dan_C[j] != null) + { + TJAPlayer3.Tx.DanC_ExamType?.t2D謠冗判(TJAPlayer3.app.Device, 1280 + 515 + Anime, 412 + (j - 1) * 88, new Rectangle(0, TJAPlayer3.Skin.Game_DanC_ExamType_Size[1] * (int)st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].List_DanSongs[0].Dan_C[j].GetExamType(), TJAPlayer3.Skin.Game_DanC_ExamType_Size[0], TJAPlayer3.Skin.Game_DanC_ExamType_Size[1])); + } + + for (int i = 0; i < st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].List_DanSongs.Count; i++) //譖イ縺斐→縺ョ繝ォ繝シ繝(鬲ゅご繝シ繧ク繧帝勁縺) 讓ェ(x) + { + if (st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].List_DanSongs[i].Dan_C[j] != null) + { + if (st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].List_DanSongs[st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].List_DanSongs.Count - 1].Dan_C[j] != null) //蛟句挨縺ョ譚。莉カ縺後≠繧翫∪縺吶h繝シ + { + tExamDraw(1280 + 590 + Anime + i * 220, 455 + (j - 1) * 88, st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].List_DanSongs[i].Dan_C[j].Value[0].ToString(), st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].List_DanSongs[i].Dan_C[j].GetExamRange()); + } + else //蜈ィ菴薙ョ譚。莉カ縺ァ縺吶h繝シ + { + tExamDraw(1280 + 590 + Anime, 455 + (j - 1) * 88, st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].List_DanSongs[0].Dan_C[j].Value[0].ToString(), st繝舌シ諠蝣ア[n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1].List_DanSongs[0].Dan_C[j].GetExamRange()); + } + } + } + } + #endregion + } + } + + #endregion + + #region [ 繝舌シ遘サ蜍 ] + + if (ctDaniMoveAnime.n迴セ蝨ィ縺ョ蛟、 == 90) + { + if (bLeftMove) + { + this.n迴セ蝨ィ縺ョ驕ク謚櫁。 -= n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1 >= 0 ? 1 : 0; + } + else + { + this.n迴セ蝨ィ縺ョ驕ク謚櫁。 += n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1 < this.st繝舌シ諠蝣ア.Length ? 1 : 0; + } + ctDaniMoveAnime.t蛛懈ュ「(); + ctDaniMoveAnime.n迴セ蝨ィ縺ョ蛟、 = 0; + } + + #endregion + + return 0; + } + + private bool DaniInAnime; + public CCounter ctDaniIn; + + private CCounter ctDanAnimeIn; + + private CCounter ctDaniMoveAnime; + public int n迴セ蝨ィ縺ョ驕ク謚櫁。; + + private bool bLeftMove; + + private CPrivateFastFont pfDanSong; + + private CStage驕ク譖イ.STNumber[] stLevel = new CStage驕ク譖イ.STNumber[10]; + private CStage驕ク譖イ.STNumber[] stSoulNumber = new CStage驕ク譖イ.STNumber[10]; + private CStage驕ク譖イ.STNumber[] stExamNumber = new CStage驕ク譖イ.STNumber[10]; + + public ST繝舌シ諠蝣ア[] st繝舌シ諠蝣ア; + + public struct ST繝舌シ諠蝣ア + { + public TitleTextureKey[] ttk繧ソ繧、繝医Ν; + public int[] n譖イ髮」譏灘コヲ; + public int[] n譖イ繝ャ繝吶Ν; + public List List_DanSongs; + public CTexture txBarCenter; + public CTexture txDanPlate; + } + + private void t繝舌シ縺ョ蛻晄悄蛹() + { + for(int i = 0; i < st繝舌シ諠蝣ア.Length; i++) + { + st繝舌シ諠蝣ア[i].ttk繧ソ繧、繝医Ν = new TitleTextureKey[TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝_Dan[i].DanSongs.Count]; + st繝舌シ諠蝣ア[i].n譖イ髮」譏灘コヲ = new int[TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝_Dan[i].DanSongs.Count]; + st繝舌シ諠蝣ア[i].n譖イ繝ャ繝吶Ν = new int[TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝_Dan[i].DanSongs.Count]; + for (int j = 0; j < TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝_Dan[i].DanSongs.Count; j++) + { + var song = TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝_Dan[i]; + + st繝舌シ諠蝣ア[i].ttk繧ソ繧、繝医Ν[j] = new TitleTextureKey(song.DanSongs[j].bTitleShow ? "???" : song.DanSongs[j].Title, pfDanSong, Color.White, Color.Black, 700); + st繝舌シ諠蝣ア[i].n譖イ髮」譏灘コヲ[j] = song.DanSongs[j].Difficulty; + st繝舌シ諠蝣ア[i].n譖イ繝ャ繝吶Ν[j] = song.DanSongs[j].Level; + st繝舌シ諠蝣ア[i].List_DanSongs = song.DanSongs; + st繝舌シ諠蝣ア[i].txBarCenter = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(Path.GetDirectoryName(song.ar繧ケ繧ウ繧「[6].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ) + @"\Bar_Center.png"); + st繝舌シ諠蝣ア[i].txDanPlate = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(Path.GetDirectoryName(song.ar繧ケ繧ウ繧「[6].繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ) + @"\Dan_Plate.png"); + } + } + } + + public void t蜿ウ縺ォ遘サ蜍() + { + if(n迴セ蝨ィ縺ョ驕ク謚櫁。 < st繝舌シ諠蝣ア.Length - 1) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + this.bLeftMove = false; + this.ctDaniMoveAnime.t髢句ァ(0, 90, 2f, TJAPlayer3.Timer); + } + } + + public void t蟾ヲ縺ォ遘サ蜍() + { + if (n迴セ蝨ィ縺ョ驕ク謚櫁。 > 0) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + this.bLeftMove = true; + this.ctDaniMoveAnime.t髢句ァ(0, 90, 2f, TJAPlayer3.Timer); + } + } + + public void tLevelNumberDraw(float x, float y, string str) + { + for (int j = 0; j < str.Length; j++) + { + for (int i = 0; i < 10; i++) + { + if (str[j] == stLevel[i].ch) + { + TJAPlayer3.Tx.Dani_Level_Number.t2D謠冗判(TJAPlayer3.app.Device, x - (str.Length * 14 + 10 * str.Length - str.Length * 14) / 2 + 14 / 2, (float)y - 18 / 2, new RectangleF(stLevel[i].pt.X, stLevel[i].pt.Y, 14, 18)); + x += 10; + } + } + } + } + + public void tSoulDraw(float x, float y, string str) + { + TJAPlayer3.Tx.Dani_Soul_Number.t2D謠冗判(TJAPlayer3.app.Device, x + 16 * str.Length, y - 30 / 2, new RectangleF(0, 30, 80, 30)); + + for (int j = 0; j < str.Length; j++) + { + for (int i = 0; i < 10; i++) + { + if (str[j] == stSoulNumber[i].ch) + { + TJAPlayer3.Tx.Dani_Soul_Number.t2D謠冗判(TJAPlayer3.app.Device, x - (str.Length * 23 + 18 * str.Length - str.Length * 23) / 2 + 23 / 2, (float)y - 30 / 2, new RectangleF(stSoulNumber[i].pt.X, stSoulNumber[i].pt.Y, 23, 30)); + x += 16; + } + } + } + } + + public void tExamDraw(float x, float y, string str, Exam.Range Range) + { + TJAPlayer3.Tx.Dani_Exam_Number.t2D謠冗判(TJAPlayer3.app.Device, x + 19 * str.Length, y - 24 / 2, new RectangleF(45 * (int)Range, 24, 45, 24)); + + for (int j = 0; j < str.Length; j++) + { + for (int i = 0; i < 10; i++) + { + if (str[j] == stExamNumber[i].ch) + { + TJAPlayer3.Tx.Dani_Exam_Number.t2D謠冗判(TJAPlayer3.app.Device, x, (float)y - 24 / 2, new RectangleF(stExamNumber[i].pt.X, stExamNumber[i].pt.Y, 19, 24)); + x += 16; + } + } + } + } + } +} diff --git a/TJAPlayer3/Stages/05.DaniSelect/CActSelect谿オ菴肴倦謌ヲ驕ク謚樒判髱「.cs b/TJAPlayer3/Stages/05.DaniSelect/CActSelect谿オ菴肴倦謌ヲ驕ク謚樒判髱「.cs new file mode 100644 index 00000000..684c0007 --- /dev/null +++ b/TJAPlayer3/Stages/05.DaniSelect/CActSelect谿オ菴肴倦謌ヲ驕ク謚樒判髱「.cs @@ -0,0 +1,89 @@ +サソusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using FDK; +using SlimDX.DirectInput; + +namespace TJAPlayer3 +{ + class CActSelect谿オ菴肴倦謌ヲ驕ク謚樒判髱「 : CActivity + { + public override void On豢サ諤ァ蛹() + { + ctBarIn = new CCounter(); + ctBarOut = new CCounter(); + ctBarOut.n迴セ蝨ィ縺ョ蛟、 = 255; + TJAPlayer3.stage谿オ菴埼∈謚.bDifficultyIn = false; + + base.On豢サ諤ァ蛹(); + } + + public override void On髱樊エサ諤ァ蛹() + { + base.On髱樊エサ諤ァ蛹(); + } + + public override int On騾イ陦梧緒逕サ() + { + if(TJAPlayer3.stage谿オ菴埼∈謚.bDifficultyIn || ctBarOut.n迴セ蝨ィ縺ョ蛟、 < ctBarOut.n邨ゆコ蛟、) + { + ctBarIn.t騾イ陦(); + ctBarOut.t騾イ陦(); + + TJAPlayer3.Tx.Challenge_Select[0].Opacity = TJAPlayer3.stage谿オ菴埼∈謚.bDifficultyIn ? ctBarIn.n迴セ蝨ィ縺ョ蛟、 : 255 - ctBarOut.n迴セ蝨ィ縺ョ蛟、; + TJAPlayer3.Tx.Challenge_Select[1].Opacity = TJAPlayer3.stage谿オ菴埼∈謚.bDifficultyIn ? ctBarIn.n迴セ蝨ィ縺ョ蛟、 : 255 - ctBarOut.n迴セ蝨ィ縺ョ蛟、; + TJAPlayer3.Tx.Challenge_Select[0].t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + TJAPlayer3.Tx.Challenge_Select[1].t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + + if (ctBarIn.b邨ゆコ蛟、縺ォ驕斐@縺 && !TJAPlayer3.stage谿オ菴埼∈謚.b驕ク謚槭@縺) + { + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)Key.RightArrow) || + TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RBlue)) + { + if (n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1 >= 0) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + n迴セ蝨ィ縺ョ驕ク謚櫁。--; + } + } + + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)Key.LeftArrow) || + TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LBlue)) + { + if (n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1 <= 2) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + n迴セ蝨ィ縺ョ驕ク謚櫁。++; + } + } + + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)Key.Return) || + TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LRed) || + TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RRed)) + { + if (n迴セ蝨ィ縺ョ驕ク謚櫁。 == 0) + { + this.ctBarOut.t髢句ァ(0, 255, 0.5f, TJAPlayer3.Timer); + TJAPlayer3.Skin.sound蜿匁カ磯浹.t蜀咲函縺吶k(); + TJAPlayer3.stage谿オ菴埼∈謚.bDifficultyIn = false; + } + else if (n迴セ蝨ィ縺ョ驕ク謚櫁。 == 1) + { + TJAPlayer3.Skin.soundDanSongSelect.t蜀咲函縺吶k(); + TJAPlayer3.stage谿オ菴埼∈謚.ct蠕讖.t髢句ァ(0, 3000, 1, TJAPlayer3.Timer); + } + } + } + } + + return base.On騾イ陦梧緒逕サ(); + } + + public CCounter ctBarIn; + public CCounter ctBarOut; + + private int n迴セ蝨ィ縺ョ驕ク謚櫁。; + } +} diff --git a/TJAPlayer3/Stages/05.DaniSelect/CStage谿オ菴埼∈謚.cs b/TJAPlayer3/Stages/05.DaniSelect/CStage谿オ菴埼∈謚.cs new file mode 100644 index 00000000..0a287236 --- /dev/null +++ b/TJAPlayer3/Stages/05.DaniSelect/CStage谿オ菴埼∈謚.cs @@ -0,0 +1,200 @@ +サソusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using FDK; +using SlimDX.DirectInput; + +namespace TJAPlayer3 +{ + class CStage谿オ菴埼∈謚 : CStage + { + public CStage谿オ菴埼∈謚() + { + base.e繧ケ繝繝シ繧クID = E繧ケ繝繝シ繧ク.谿オ菴埼∈謚; + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷; + + base.list蟄植ctivities.Add(this.谿オ菴阪Μ繧ケ繝 = new CActSelect谿オ菴阪Μ繧ケ繝()); + base.list蟄植ctivities.Add(this.actFOtoNowLoading = new CActFIFOStart()); + base.list蟄植ctivities.Add(this.谿オ菴肴倦謌ヲ驕ク謚樒判髱「 = new CActSelect谿オ菴肴倦謌ヲ驕ク謚樒判髱「()); + base.list蟄植ctivities.Add(this.actFOtoTitle = new CActFIFOBlack()); + } + + public override void On豢サ諤ァ蛹() + { + if (base.b豢サ諤ァ蛹悶@縺ヲ繧) + return; + + this.b驕ク謚槭@縺 = false; + + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷; + this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、 = E謌サ繧雁、.邯咏カ; + + ct蠕讖 = new CCounter(); + ctDonchan_In = new CCounter(); + ctDonchan_Normal = new CCounter(0, TJAPlayer3.Tx.SongSelect_Donchan_Normal.Length - 1, 1000 / 45, TJAPlayer3.Timer); + + base.On豢サ諤ァ蛹(); + } + + public override void On髱樊エサ諤ァ蛹() + { + base.On髱樊エサ諤ァ蛹(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + public override int On騾イ陦梧緒逕サ() + { + ctDonchan_Normal.t騾イ陦鍬oop(); + ctDonchan_In.t騾イ陦(); + ct蠕讖.t騾イ陦(); + + TJAPlayer3.Tx.Dani_Background.t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + + this.谿オ菴阪Μ繧ケ繝.On騾イ陦梧緒逕サ(); + + if(this.谿オ菴阪Μ繧ケ繝.ctDaniIn.n迴セ蝨ィ縺ョ蛟、 == 3000) + { + if (!ctDonchan_In.b髢句ァ九@縺) + { + TJAPlayer3.Skin.soundDanSelectStart.t蜀咲函縺吶k(); + TJAPlayer3.Skin.soundDanSelectBGM.t蜀咲函縺吶k(); + ctDonchan_In.t髢句ァ(0, 180, 1.25f, TJAPlayer3.Timer); + } + + TJAPlayer3.NamePlate.tNamePlateDraw(TJAPlayer3.Skin.SongSelect_NamePlate_X[0], TJAPlayer3.Skin.SongSelect_NamePlate_Y[0] + 5, 0); + + #region [ 繧ュ繝シ髢「騾」 ] + + if (!this.谿オ菴阪Μ繧ケ繝.b繧ケ繧ッ繝ュ繝シ繝ォ荳ュ && !b驕ク謚槭@縺 && !bDifficultyIn) + { + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)Key.RightArrow) || + TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RBlue)) + { + this.谿オ菴阪Μ繧ケ繝.t蜿ウ縺ォ遘サ蜍(); + } + + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)Key.LeftArrow) || + TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LBlue)) + { + this.谿オ菴阪Μ繧ケ繝.t蟾ヲ縺ォ遘サ蜍(); + } + + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)Key.Return) || + TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LRed) || + TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RRed)) + { + //this.t谿オ菴阪r驕ク謚槭☆繧(); + TJAPlayer3.Skin.soundDanSongSelectCheck.t蜀咲函縺吶k(); + this.bDifficultyIn = true; + this.谿オ菴肴倦謌ヲ驕ク謚樒判髱「.ctBarIn.t髢句ァ(0, 255, 1, TJAPlayer3.Timer); + } + + if(TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)Key.Escape)) + { + TJAPlayer3.Skin.soundDanSelectBGM.t蛛懈ュ「縺吶k(); + TJAPlayer3.Skin.sound蜿匁カ磯浹.t蜀咲函縺吶k(); + this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、 = E謌サ繧雁、.繧ソ繧、繝医Ν縺ォ謌サ繧; + this.actFOtoTitle.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝; + return 0; + } + } + + #endregion + + #region [ 縺ゥ繧薙■繧繧馴未騾」 ] + + if(ctDonchan_In.n迴セ蝨ィ縺ョ蛟、 != 90) + { + float DonchanX = 0f, DonchanY = 0f; + + DonchanX = (float)Math.Sin(ctDonchan_In.n迴セ蝨ィ縺ョ蛟、 / 2 * (Math.PI / 180)) * 200f; + DonchanY = ((float)Math.Sin((90 + (ctDonchan_In.n迴セ蝨ィ縺ョ蛟、 / 2)) * (Math.PI / 180)) * 150f); + + TJAPlayer3.Tx.SongSelect_Donchan_Normal[ctDonchan_Normal.n迴セ蝨ィ縺ョ蛟、].Opacity = ctDonchan_In.n迴セ蝨ィ縺ョ蛟、 * 2; + TJAPlayer3.Tx.SongSelect_Donchan_Normal[ctDonchan_Normal.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, -200 + DonchanX, 336 - DonchanY); + } + + #endregion + + this.谿オ菴肴倦謌ヲ驕ク謚樒判髱「.On騾イ陦梧緒逕サ(); + } + + if(ct蠕讖.n迴セ蝨ィ縺ョ蛟、 >= 3000) + { + TJAPlayer3.stage谿オ菴埼∈謚.t谿オ菴阪r驕ク謚槭☆繧(); + ct蠕讖.n迴セ蝨ィ縺ョ蛟、 = 0; + ct蠕讖.t蛛懈ュ「(); + } + + switch (base.e繝輔ぉ繝シ繧コID) + { + case CStage.E繝輔ぉ繝シ繧コ.驕ク譖イ_NowLoading逕サ髱「縺ク縺ョ繝輔ぉ繝シ繝峨い繧ヲ繝: + if (this.actFOtoNowLoading.On騾イ陦梧緒逕サ() == 0) + { + break; + } + return (int)this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、; + + case CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝: + if (this.actFOtoTitle.On騾イ陦梧緒逕サ() == 0) + { + break; + } + return (int)this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、; + + } + + return 0; + } + + public enum E謌サ繧雁、 : int + { + 邯咏カ, + 繧ソ繧、繝医Ν縺ォ謌サ繧, + 驕ク譖イ縺励◆ + } + + public void t谿オ菴阪r驕ク謚槭☆繧() + { + this.b驕ク謚槭@縺 = true; + TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ = TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝_Dan[谿オ菴阪Μ繧ケ繝.n迴セ蝨ィ縺ョ驕ク謚櫁。珪; + TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「 = TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝_Dan[谿オ菴阪Μ繧ケ繝.n迴セ蝨ィ縺ョ驕ク謚櫁。珪.ar繧ケ繧ウ繧「[(int)Difficulty.Dan]; + TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] = (int)Difficulty.Dan; + TJAPlayer3.stage驕ク譖イ.str遒コ螳壹&繧後◆譖イ縺ョ繧ク繝」繝ウ繝ォ = TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝_Dan[谿オ菴阪Μ繧ケ繝.n迴セ蝨ィ縺ョ驕ク謚櫁。珪.str繧ク繝」繝ウ繝ォ; + if ((TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ != null) && (TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「 != null)) + { + this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、 = E謌サ繧雁、.驕ク譖イ縺励◆; + this.actFOtoNowLoading.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(); // #27787 2012.3.10 yyagi 譖イ豎コ螳壽凾縺ョ逕サ髱「繝輔ぉ繝シ繝峨い繧ヲ繝医ョ逵∫払 + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.驕ク譖イ_NowLoading逕サ髱「縺ク縺ョ繝輔ぉ繝シ繝峨い繧ヲ繝; + } + TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「.t蛛懈ュ「縺吶k(); + } + + public CCounter ct蠕讖; + + public bool b驕ク謚槭@縺; + public bool bDifficultyIn; + + private CCounter ctDonchan_In; + private CCounter ctDonchan_Normal; + + public E謌サ繧雁、 e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、; + + public CActFIFOStart actFOtoNowLoading; + public CActFIFOBlack actFOtoTitle; + public CActSelect谿オ菴阪Μ繧ケ繝 谿オ菴阪Μ繧ケ繝; + public CActSelect谿オ菴肴倦謌ヲ驕ク謚樒判髱「 谿オ菴肴倦謌ヲ驕ク謚樒判髱「; + } +} diff --git a/TJAPlayer3/Stages/05.SongSelect/CActPlayOption.cs b/TJAPlayer3/Stages/05.SongSelect/CActPlayOption.cs new file mode 100644 index 00000000..5d073e95 --- /dev/null +++ b/TJAPlayer3/Stages/05.SongSelect/CActPlayOption.cs @@ -0,0 +1,350 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActPlayOption : CActivity + { + public CActPlayOption() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + public override void On豢サ諤ァ蛹() + { + if (this.b豢サ諤ァ蛹悶@縺ヲ繧) + return; + + ctOpen = new CCounter(); + ctClose = new CCounter(); + + for (int i = 0; i < OptionType.Length; i++) + OptionType[i] = new CTexture(); + + #region [ Speed ] + + txSpeed[0] = OptionTypeTx("0.5", Color.White, Color.Black); + txSpeed[1] = OptionTypeTx("1.0", Color.White, Color.Black); + txSpeed[2] = OptionTypeTx("1.1", Color.White, Color.Black); + txSpeed[3] = OptionTypeTx("1.2", Color.White, Color.Black); + txSpeed[4] = OptionTypeTx("1.3", Color.White, Color.Black); + txSpeed[5] = OptionTypeTx("1.4", Color.White, Color.Black); + txSpeed[6] = OptionTypeTx("1.5", Color.White, Color.Black); + txSpeed[7] = OptionTypeTx("1.6", Color.White, Color.Black); + txSpeed[8] = OptionTypeTx("1.7", Color.White, Color.Black); + txSpeed[9] = OptionTypeTx("1.8", Color.White, Color.Black); + txSpeed[10] = OptionTypeTx("1.9", Color.White, Color.Black); + txSpeed[11] = OptionTypeTx("2.0", Color.White, Color.Black); + txSpeed[12] = OptionTypeTx("2.5", Color.White, Color.Black); + txSpeed[13] = OptionTypeTx("3.0", Color.White, Color.Black); + txSpeed[14] = OptionTypeTx("3.5", Color.White, Color.Black); + txSpeed[15] = OptionTypeTx("4.0", Color.White, Color.Black); + + #endregion + + txSwitch[0] = OptionTypeTx("縺励↑縺", Color.White, Color.Black); + txSwitch[1] = OptionTypeTx("縺吶k", Color.White, Color.Black); + + txRandom[0] = OptionTypeTx("縺ェ縺", Color.White, Color.Black); + txRandom[1] = OptionTypeTx("縺阪∪縺舌l", Color.White, Color.Black); + txRandom[2] = OptionTypeTx("縺ァ縺溘i繧", Color.White, Color.Black); + + txGameMode[0] = OptionTypeTx("縺ェ縺", Color.White, Color.Black); + txGameMode[1] = OptionTypeTx("迚ケ險薙Δ繝シ繝", Color.White, Color.Black); + + txNone = OptionTypeTx("菴ソ逕ィ荳榊庄" ,Color.White, Color.Black); + + OptionType[0] = OptionTypeTx("縺ッ繧縺", Color.White, Color.Black); + OptionType[1] = OptionTypeTx("繝峨Ο繝ウ", Color.White, Color.Black); + OptionType[2] = OptionTypeTx("縺ゅ∋縺薙∋", Color.White, Color.Black); + OptionType[3] = OptionTypeTx("繝ゥ繝ウ繝繝", Color.White, Color.Black); + OptionType[4] = OptionTypeTx("繧イ繝シ繝繝「繝シ繝", Color.White, Color.Black); + OptionType[5] = OptionTypeTx("繧ェ繝シ繝", Color.White, Color.Black); + OptionType[6] = OptionTypeTx("繝懊う繧ケ", Color.White, Color.Black); + OptionType[7] = OptionTypeTx("髻ウ濶イ", Color.White, Color.Black); + + for (int i = 0; i < OptionType.Length; i++) + OptionType[i].vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.96f; + + base.On豢サ諤ァ蛹(); + } + + public override void On髱樊エサ諤ァ蛹() + { + + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if (this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + return; + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + public int On騾イ陦梧緒逕サ(int player) + { + if (this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + return 0; + + ctOpen.t騾イ陦(); + ctClose.t騾イ陦(); + + if (!ctOpen.b騾イ陦御クュ) ctOpen.t髢句ァ(0, 50, 6, TJAPlayer3.Timer); + + var act髮」譏灘コヲ = TJAPlayer3.stage驕ク譖イ.act髮」譏灘コヲ驕ク謚樒判髱「; + + #region [ Open & Close ] + + float oy1 = ctOpen.n迴セ蝨ィ縺ョ蛟、 * 18; + float oy2 = (ctOpen.n迴セ蝨ィ縺ョ蛟、 - 30) * 4; + float oy3 = ctOpen.n迴セ蝨ィ縺ョ蛟、 < 30 ? 410 - oy1 : -80 + oy2; + + float cy1 = ctClose.n迴セ蝨ィ縺ョ蛟、 * 3; + float cy2 = (ctClose.n迴セ蝨ィ縺ョ蛟、 - 20) * 16; + float cy3 = ctClose.n迴セ蝨ィ縺ョ蛟、 < 20 ? 0 - cy1 : 20 + cy2; + + float y = oy3 + cy3; + + #endregion + + TJAPlayer3.Tx.Difficulty_Option.t2D謠冗判(TJAPlayer3.app.Device, 0, y); + + TJAPlayer3.Tx.Difficulty_Option_Select.t2D謠冗判(TJAPlayer3.app.Device, 0, y + NowCount * 40.7f); + + + for (int i = 0; i < OptionType.Length; i++) + { + OptionType[i].t2D謠冗判(TJAPlayer3.app.Device, 16, 379 + i * 40.8f + y); + } + + txSpeed[nSpeedCount].t2D諡。螟ァ邇閠諷ョ謠冗判(TJAPlayer3.app.Device, CTexture.RefPnt.Up, 200, 375 + y); + txSwitch[nStealth].t2D諡。螟ァ邇閠諷ョ謠冗判(TJAPlayer3.app.Device, CTexture.RefPnt.Up, 200, 375 + y + 1 * 40.7f); + txSwitch[nAbekobe].t2D諡。螟ァ邇閠諷ョ謠冗判(TJAPlayer3.app.Device, CTexture.RefPnt.Up, 200, 375 + y + 2 * 40.7f); + txRandom[nRandom].t2D諡。螟ァ邇閠諷ョ謠冗判(TJAPlayer3.app.Device, CTexture.RefPnt.Up, 200, 375 + y + 3 * 40.7f); + txGameMode[nGameMode].t2D諡。螟ァ邇閠諷ョ謠冗判(TJAPlayer3.app.Device, CTexture.RefPnt.Up, 200, 375 + y + 4 * 40.7f); + txSwitch[nAutoMode].t2D諡。螟ァ邇閠諷ョ謠冗判(TJAPlayer3.app.Device, CTexture.RefPnt.Up, 200, 375 + y + 5 * 40.7f); + + for (int i = 6; i < 8; i++) + { + txNone.t2D諡。螟ァ邇閠諷ョ謠冗判(TJAPlayer3.app.Device, CTexture.RefPnt.Up, 200, 375 + y + i * 40.7f); + } + + if (ctClose.n迴セ蝨ィ縺ョ蛟、 >= 50) + { + Decision(); + NowCount = 0; + ctOpen.t蛛懈ュ「(); + ctOpen.n迴セ蝨ィ縺ョ蛟、 = 0; + ctClose.t蛛懈ュ「(); + ctClose.n迴セ蝨ィ縺ョ蛟、 = 0; + bEnd = false; + act髮」譏灘コヲ.bOption[player] = false; + } + + #region [ Key ] + + if (!ctClose.b騾イ陦御クュ) + { + if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LBlue)) { OptionSelect(true); TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); }; + if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RBlue)) { OptionSelect(false); TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); }; + + if ((TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LRed) || TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RRed)) && ctOpen.n迴セ蝨ィ縺ョ蛟、 >= ctOpen.n邨ゆコ蛟、) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + if (NowCount < 7) + { + NowCount++; + } + else if (NowCount >= 7 && !bEnd) + { + bEnd = true; + ctClose.t髢句ァ(0, 50, 6, TJAPlayer3.Timer); + } + } + } + + + #endregion + return 0; + } + + + public CCounter ctOpen; + public CCounter ctClose; + public CTexture[] OptionType = new CTexture[8]; + + public int NowCount; + public int[] NowCountType = new int[8]; + + public bool bEnd; + + public CTexture[] txSpeed = new CTexture[16]; + public int nSpeedCount = 1; + + public int nStealth = 0; + public int nAbekobe = 0; + + public CTexture[] txRandom = new CTexture[3]; + public int nRandom = 0; + + public CTexture[] txGameMode = new CTexture[2]; + public int nGameMode; + + public CTexture[] txAutoMode = new CTexture[2]; + public int nAutoMode = 0; + public CTexture txNone = new CTexture(); + + public CTexture[] txSwitch = new CTexture[2]; + + public CTexture OptionTypeTx(string str譁蟄, Color forecolor, Color backcolor) + { + using (var bmp = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), 13).DrawPrivateFont(str譁蟄, forecolor, backcolor)) + { + return TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(bmp); + } + } + + public void OptionSelect(bool left) + { + switch (NowCount) + { + case 0: + if (left) + { + if (nSpeedCount > 0) nSpeedCount--; + else nSpeedCount = 15; + } + else + { + if (nSpeedCount < 15) nSpeedCount++; + else nSpeedCount = 0; + } + break; + case 1: + if (nStealth == 0) nStealth = 1; + else nStealth = 0; + break; + case 2: + if (nAbekobe == 0) nAbekobe = 1; + else nAbekobe = 0; + break; + case 3: + if (left) + { + if (nRandom > 0) nRandom--; + else nRandom = 2; + } + else + { + if (nRandom < 2) nRandom++; + else nRandom = 0; + } + break; + case 4: + if (nGameMode == 0) nGameMode = 1; + else nGameMode = 0; + break; + case 5: + if (nAutoMode == 0) nAutoMode = 1; + else nAutoMode = 0; + break; + + } + } + public void Decision() + { + #region [ Speed ] + + if (nSpeedCount == 0) + { + TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[0] = 4; + } + else if (nSpeedCount > 0 && nSpeedCount <= 11) + { + TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[0] = nSpeedCount + 8; + } + else if (nSpeedCount == 12) + { + TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[0] = 20 + 4; + } + else if (nSpeedCount == 13) + { + TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[0] = 20 + 9; + } + else if (nSpeedCount == 14) + { + TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[0] = 20 + 14; + } + else if (nSpeedCount == 15) + { + TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[0] = 20 + 19; + } + + #endregion + #region [ Doron ] + if (nStealth == 0) + { + TJAPlayer3.ConfigIni.eSTEALTH = E繧ケ繝繝ォ繧ケ繝「繝シ繝.OFF; + } + else + { + TJAPlayer3.ConfigIni.eSTEALTH = E繧ケ繝繝ォ繧ケ繝「繝シ繝.DORON; + } + #endregion + #region [ Random ] + if(nRandom == 2 && nAbekobe == 1) + { + TJAPlayer3.ConfigIni.eRandom.Taiko = E繝ゥ繝ウ繝繝繝「繝シ繝.HYPERRANDOM; + } + else if (nRandom == 2 && nAbekobe == 0) + { + TJAPlayer3.ConfigIni.eRandom.Taiko = E繝ゥ繝ウ繝繝繝「繝シ繝.SUPERRANDOM; + } + else if (nRandom == 1 && nAbekobe == 1) + { + TJAPlayer3.ConfigIni.eRandom.Taiko = E繝ゥ繝ウ繝繝繝「繝シ繝.RANDOM; + } + else if (nRandom == 1 && nAbekobe == 0) + { + TJAPlayer3.ConfigIni.eRandom.Taiko = E繝ゥ繝ウ繝繝繝「繝シ繝.RANDOM; + } + else if (nRandom == 0 && nAbekobe == 1) + { + TJAPlayer3.ConfigIni.eRandom.Taiko = E繝ゥ繝ウ繝繝繝「繝シ繝.MIRROR; + } + else if (nRandom == 0 && nAbekobe == 0) + { + TJAPlayer3.ConfigIni.eRandom.Taiko = E繝ゥ繝ウ繝繝繝「繝シ繝.OFF; + } + #endregion + #region [ GameMode ] + if(nGameMode == 0) + { + TJAPlayer3.ConfigIni.bTokkunMode = false; + } + else + { + TJAPlayer3.ConfigIni.bTokkunMode = true; + } + #endregion + #region [ AutoMode ] + if(nAutoMode == 1) + { + TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay = true; + } + else + { + TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay = false; + } + #endregion + } + + } +} diff --git a/TJAPlayer3/Stages/05.SongSelect/CActSelectArtistComment.cs b/TJAPlayer3/Stages/05.SongSelect/CActSelectArtistComment.cs new file mode 100644 index 00000000..f136cfb8 --- /dev/null +++ b/TJAPlayer3/Stages/05.SongSelect/CActSelectArtistComment.cs @@ -0,0 +1,236 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Diagnostics; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActSelectArtistComment : CActivity + { + // 繝。繧ス繝繝 + + public CActSelectArtistComment() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + public void t驕ク謚樊峇縺悟、画峩縺輔l縺() + { + C繧ケ繧ウ繧「 c繧ケ繧ウ繧「 = TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「; + if( c繧ケ繧ウ繧「 != null ) + { + Bitmap image = new Bitmap( 1, 1 ); + TJAPlayer3.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( TJAPlayer3.app.Device, bitmap2, TJAPlayer3.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; + } + } + TJAPlayer3.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繝繧ッ繧ケ繝√Ε縺ョ譛螟ァ蟷 = TJAPlayer3.app.Device.Capabilities.MaxTextureWidth; + int maxTextureHeight = TJAPlayer3.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( TJAPlayer3.app.Device, bitmap4, TJAPlayer3.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, TJAPlayer3.Timer ); + } + } + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + this.ft謠冗判逕ィ繝輔か繝ウ繝 = new Font("MS UI Gothic", 26f, GraphicsUnit.Pixel ); + this.txArtist = null; + this.txComment = null; + this.strArtist = ""; + this.strComment = ""; + this.nComment譛邨り。後ョ蟷 = 0; + this.nComment陦梧焚 = 0; + this.n繝繧ッ繧ケ繝√Ε縺ョ譛螟ァ蟷 = 0; + this.ctComment = new CCounter(); + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txArtist ); + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txComment ); + if( this.ft謠冗判逕ィ繝輔か繝ウ繝 != null ) + { + this.ft謠冗判逕ィ繝輔か繝ウ繝.Dispose(); + this.ft謠冗判逕ィ繝輔か繝ウ繝 = null; + } + this.ctComment = null; + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + this.t驕ク謚樊峇縺悟、画峩縺輔l縺(); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txArtist ); + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txComment ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + if( this.ctComment.b騾イ陦御クュ ) + { + this.ctComment.t騾イ陦鍬oop(); + } + if( this.txArtist != null ) + { + int x = 1260 - ( (int) ( this.txArtist.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width * this.txArtist.vc諡。螟ァ邵ョ蟆丞咲紫.X ) ); // #27648 2012.3.14 yyagi: -12 for scrollbar + int y = 322; + this.txArtist.t2D謠冗判( TJAPlayer3.app.Device, x, y ); + } + if( ( this.txComment != null ) && ( ( this.ctComment.n迴セ蝨ィ縺ョ蛟、 + 750 ) >= 0 ) ) + { + int num3 = 510; + int num4 = 342; + Rectangle rectangle = new Rectangle( this.ctComment.n迴セ蝨ィ縺ョ蛟、, 0, 750, (int) this.ft謠冗判逕ィ繝輔か繝ウ繝.Size ); + if( rectangle.X < 0 ) + { + num3 += -rectangle.X; + rectangle.Width -= -rectangle.X; + rectangle.X = 0; + } + int num5 = ( (int) ( ( (float) rectangle.X ) / this.txComment.vc諡。螟ァ邵ョ蟆丞咲紫.X ) ) / this.n繝繧ッ繧ケ繝√Ε縺ョ譛螟ァ蟷; + Rectangle rectangle2 = new Rectangle(); + while( rectangle.Width > 0 ) + { + rectangle2.X = ( (int) ( ( (float) rectangle.X ) / this.txComment.vc諡。螟ァ邵ョ蟆丞咲紫.X ) ) % this.n繝繧ッ繧ケ繝√Ε縺ョ譛螟ァ蟷; + rectangle2.Y = num5 * ( (int) this.ft謠冗判逕ィ繝輔か繝ウ繝.Size ); + int num6 = ( ( num5 + 1 ) == this.nComment陦梧焚 ) ? this.nComment譛邨り。後ョ蟷 : this.n繝繧ッ繧ケ繝√Ε縺ョ譛螟ァ蟷; + int num7 = num6 - rectangle2.X; + rectangle2.Width = num7; + rectangle2.Height = (int) this.ft謠冗判逕ィ繝輔か繝ウ繝.Size; + this.txComment.t2D謠冗判( TJAPlayer3.app.Device, num3, num4, rectangle2 ); + if( ++num5 == this.nComment陦梧焚 ) + { + break; + } + int num8 = (int) ( rectangle2.Width * this.txComment.vc諡。螟ァ邵ョ蟆丞咲紫.X ); + rectangle.X += num8; + rectangle.Width -= num8; + num3 += num8; + } + } + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private CCounter ctComment; + private Font ft謠冗判逕ィ繝輔か繝ウ繝; + private int nComment陦梧焚; + private int nComment譛邨り。後ョ蟷; + private const int nComment陦ィ遉コ蟷 = 750; + private int n繝繧ッ繧ケ繝√Ε縺ョ譛螟ァ蟷; + private string strArtist; + private string strComment; + private CTexture txArtist; + private CTexture txComment; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/05.SongSelect/CActSelectInformation.cs b/TJAPlayer3/Stages/05.SongSelect/CActSelectInformation.cs new file mode 100644 index 00000000..00c9d096 --- /dev/null +++ b/TJAPlayer3/Stages/05.SongSelect/CActSelectInformation.cs @@ -0,0 +1,151 @@ +サソusing System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActSelectInformation : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CActSelectInformation() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + this.n逕サ蜒終ndex荳 = -1; + this.n逕サ蜒終ndex荳 = 0; + + this.bFirst = true; + this.ct騾イ陦檎畑 = new CCounter( 0, 3000, 3, TJAPlayer3.Timer ); + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + this.ct繧ケ繧ッ繝ュ繝シ繝ォ逕ィ = null; + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + this.txInfo_Back = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_information_BG.png" ) ); + this.txInfo[ 0 ] = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_information.png" ) ); + this.txInfo[ 1 ] = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_information2.png" ) ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txInfo_Back ); + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txInfo[ 0 ] ); + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txInfo[ 1 ] ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + if( base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + + if( this.txInfo_Back != null ) + this.txInfo_Back.t2D謠冗判( TJAPlayer3.app.Device, 340, 600 ); + + + this.ct騾イ陦檎畑.t騾イ陦鍬oop(); + if( this.bFirst ) + { + this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、 = 300; + } + + #region[ 騾乗主コヲ蛻カ蠕。 ] + if( this.txInfo[ 0 ] != null && this.txInfo[ 1 ] != null ) + { + if( this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、 < 255 ) + { + this.txInfo[ 0 ].Opacity = this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、; + this.txInfo[ 1 ].Opacity = 255 - this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、; + } + else if( this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、 >= 255 && this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、 < 1245 ) + { + this.bFirst = false; + this.txInfo[ 0 ].Opacity = 255; + this.txInfo[ 1 ].Opacity = 0; + } + else if( this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、 >= 1245 && this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、 < 1500 ) + { + this.txInfo[ 0 ].Opacity = 255 - ( this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、 - 1245 ); + this.txInfo[ 1 ].Opacity = this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、 - 1245; + } + else if( this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、 >= 1500 && this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、 <= 3000 ) + { + this.txInfo[ 0 ].Opacity = 0; + this.txInfo[ 1 ].Opacity = 255; + } + + this.txInfo[ 0 ].t2D謠冗判( TJAPlayer3.app.Device, 340, 600 ); + this.txInfo[ 1 ].t2D謠冗判( TJAPlayer3.app.Device, 340, 600 ); + } + + #endregion + + + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + [StructLayout( LayoutKind.Sequential )] + private struct STINFO + { + public int nTexture逡ェ蜿キ; + public Point pt蟾ヲ荳雁コァ讓; + public STINFO( int nTexture逡ェ蜿キ, int x, int y ) + { + this.nTexture逡ェ蜿キ = nTexture逡ェ蜿キ; + this.pt蟾ヲ荳雁コァ讓 = new Point( x, y ); + } + } + + private CCounter ct繧ケ繧ッ繝ュ繝シ繝ォ逕ィ; + private int n逕サ蜒終ndex荳; + private int n逕サ蜒終ndex荳; + private readonly STINFO[] stInfo = new STINFO[] { + new STINFO( 0, 0, 0 ), + new STINFO( 0, 0, 49 ), + new STINFO( 0, 0, 97 ), + new STINFO( 0, 0, 147 ), + new STINFO( 0, 0, 196 ), + new STINFO( 1, 0, 0 ), + new STINFO( 1, 0, 49 ), + new STINFO( 1, 0, 97 ), + new STINFO( 1, 0, 147 ) + }; + private CTexture txInfo_Back; + private CTexture[] txInfo = new CTexture[ 2 ]; + private bool bFirst; + private CCounter ct騾イ陦檎畑; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/05.SongSelect/CActSelectPopupMenu.cs b/TJAPlayer3/Stages/05.SongSelect/CActSelectPopupMenu.cs new file mode 100644 index 00000000..3866250c --- /dev/null +++ b/TJAPlayer3/Stages/05.SongSelect/CActSelectPopupMenu.cs @@ -0,0 +1,494 @@ +サソusing System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using System.IO; +using FDK; + + +namespace TJAPlayer3 +{ + internal class CActSelectPopupMenu : CActivity + { + + // 繝励Ο繝代ユ繧」 + + + public int GetIndex(int pos) + { + return lciMenuItems[ pos ].cItem.GetIndex(); + } + public object GetObj迴セ蝨ィ蛟、( int pos ) + { + return lciMenuItems[ pos ].cItem.obj迴セ蝨ィ蛟、(); + } + public bool bGotoDetailConfig + { + get; + internal set; + } + + /// + /// 繧ス繝シ繝医Γ繝九Η繝シ讖溯ス繧剃スソ逕ィ荳ュ縺九←縺縺九ょ、夜Κ縺九i縺薙l繧稚rue縺ォ縺吶k縺ィ縲√た繝シ繝医Γ繝九Η繝シ縺悟コ迴セ縺吶k縲Galse縺ォ縺吶k縺ィ豸医∴繧九 + /// + public bool bIsActivePopupMenu + { + get; + private set; + } + public virtual void tActivatePopupMenu( E讌ス蝎ィ繝代シ繝 einst ) + { + nItemSelecting = -1; // #24757 2011.4.1 yyagi: Clear sorting status in each stating menu. + this.eInst = einst; + this.bIsActivePopupMenu = true; + this.bIsSelectingIntItem = false; + this.bGotoDetailConfig = false; + } + public virtual void tDeativatePopupMenu() + { + this.bIsActivePopupMenu = false; + } + + + protected void Initialize( List menulist, bool showAllItems, string title ) + { + Initialize( menulist, showAllItems, title, 0 ); + } + + protected void Initialize( List menulist, bool showAllItems, string title, int defaultPos ) + { + ConditionallyInitializePrvFont(); + + b驕ク謚槭@縺 = false; + stqMenuTitle = new stQuickMenuItem(); + stqMenuTitle.cItem = new CItemBase(); + stqMenuTitle.cItem.str鬆逶ョ蜷 = title; + using (var bitmap = prvFont.DrawPrivateFont( title, Color.White, Color.Black )) + { + stqMenuTitle.txName = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bitmap, false ); + stqMenuTitle.rectName = prvFont.RectStrings; + } + lciMenuItems = new stQuickMenuItem[ menulist.Count ]; + for (int i = 0; i < menulist.Count; i++ ) + { + stQuickMenuItem stqm = new stQuickMenuItem(); + stqm.cItem = menulist[ i ]; + using (var bitmap = prvFont.DrawPrivateFont( menulist[ i ].str鬆逶ョ蜷, Color.White, Color.Black )) + { + stqm.txName = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bitmap, false ); + stqm.rectName = prvFont.RectStrings; + } + lciMenuItems[ i ] = stqm; + } + + bShowAllItems = showAllItems; + n迴セ蝨ィ縺ョ驕ク謚櫁。 = defaultPos; + } + + private void ConditionallyInitializePrvFont() + { + if (prvFont == null) + { + prvFont = new CPrivateFastFont(CSkin.Path(@"Graphics\ipag.ttf"), 18); + } + } + + public void tEnter謚シ荳() + { + if ( this.b繧ュ繝シ蜈・蜉帛セ縺。 ) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + + if ( this.n迴セ蝨ィ縺ョ驕ク謚櫁。 != lciMenuItems.Length - 1 ) + { + if ( lciMenuItems[ n迴セ蝨ィ縺ョ驕ク謚櫁。 ].cItem.e遞ョ蛻・ == CItemBase.E遞ョ蛻・.繝ェ繧ケ繝 || + lciMenuItems[ n迴セ蝨ィ縺ョ驕ク謚櫁。 ].cItem.e遞ョ蛻・ == CItemBase.E遞ョ蛻・.ONorOFF繝医げ繝ォ || + lciMenuItems[ n迴セ蝨ィ縺ョ驕ク謚櫁。 ].cItem.e遞ョ蛻・ == CItemBase.E遞ョ蛻・.ONorOFFor荳榊ョ壹せ繝ェ繝シ繧ケ繝繝シ繝 ) + { + lciMenuItems[ n迴セ蝨ィ縺ョ驕ク謚櫁。 ].cItem.t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍(); + } + else if ( lciMenuItems[ n迴セ蝨ィ縺ョ驕ク謚櫁。 ].cItem.e遞ョ蛻・ == CItemBase.E遞ョ蛻・.謨エ謨ー ) + { + bIsSelectingIntItem = !bIsSelectingIntItem; // 驕ク謚樒憾諷/驕ク謚櫁ァ」髯、迥カ諷九r蜿崎サ「縺吶k + } + else if ( lciMenuItems[ n迴セ蝨ィ縺ョ驕ク謚櫁。 ].cItem.e遞ョ蛻・ == CItemBase.E遞ョ蛻・.蛻譖ソ繝ェ繧ケ繝 ) + { + // 迚ケ縺ォ菴輔b縺励↑縺 + } + else + { + throw new ArgumentException(); + } + nItemSelecting = n迴セ蝨ィ縺ョ驕ク謚櫁。; + } + tEnter謚シ荳貴ain( (int) lciMenuItems[ n迴セ蝨ィ縺ョ驕ク謚櫁。 ].cItem.GetIndex() ); + + this.b繧ュ繝シ蜈・蜉帛セ縺。 = true; + } + } + + /// + /// Decide謚シ荳区凾縺ョ蜃ヲ逅繧偵∫カ呎価蜈医〒險倩ソー縺吶k縲 + /// + /// CItemBase縺ョ迴セ蝨ィ縺ョ險ュ螳壼、縺ョindex + public virtual void tEnter謚シ荳貴ain( int val ) + { + } + /// + /// Cancel謚シ荳区凾縺ョ霑ス蜉蜃ヲ逅縺後≠繧後ー縲∫カ呎価蜈医〒險倩ソー縺吶k縲 + /// + public virtual void tCancel() + { + } + /// + /// 霑ス蜉縺ョ謠冗判蜃ヲ逅縲ょソ隕√↓蠢懊§縺ヲ縲∫カ呎価蜈医〒險倩ソー縺吶k縲 + /// + public virtual void t騾イ陦梧緒逕サsub() + { + } + + public void t谺。縺ォ遘サ蜍() + { + if ( this.b繧ュ繝シ蜈・蜉帛セ縺。 ) + { + TJAPlayer3.Skin.sound繧ォ繝シ繧ス繝ォ遘サ蜍暮浹.t蜀咲函縺吶k(); + if ( bIsSelectingIntItem ) + { + lciMenuItems[ n迴セ蝨ィ縺ョ驕ク謚櫁。 ].cItem.t鬆逶ョ蛟、繧貞燕縺ク遘サ蜍(); // 鬆逶ョ遘サ蜍輔→謨ー蛟、荳贋ク九ッ譁ケ蜷代′騾縺ォ縺ェ繧九ョ縺ァ豕ィ諢 + } + else + { + if ( ++this.n迴セ蝨ィ縺ョ驕ク謚櫁。 >= this.lciMenuItems.Length ) + { + this.n迴セ蝨ィ縺ョ驕ク謚櫁。 = 0; + } + } + } + } + public void t蜑阪↓遘サ蜍() + { + if ( this.b繧ュ繝シ蜈・蜉帛セ縺。 ) + { + TJAPlayer3.Skin.sound繧ォ繝シ繧ス繝ォ遘サ蜍暮浹.t蜀咲函縺吶k(); + if ( bIsSelectingIntItem ) + { + lciMenuItems[ n迴セ蝨ィ縺ョ驕ク謚櫁。 ].cItem.t鬆逶ョ蛟、繧呈ャ。縺ク遘サ蜍(); // 鬆逶ョ遘サ蜍輔→謨ー蛟、荳贋ク九ッ譁ケ蜷代′騾縺ォ縺ェ繧九ョ縺ァ豕ィ諢 + } + else + { + if ( --this.n迴セ蝨ィ縺ョ驕ク謚櫁。 < 0 ) + { + this.n迴セ蝨ィ縺ョ驕ク謚櫁。 = this.lciMenuItems.Length - 1; + } + } + } + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + // this.n迴セ蝨ィ縺ョ驕ク謚櫁。 = 0; + this.b繧ュ繝シ蜈・蜉帛セ縺。 = true; + for ( int i = 0; i < 4; i++ ) + { + this.ct繧ュ繝シ蜿榊セゥ逕ィ[ i ] = new CCounter( 0, 0, 0, TJAPlayer3.Timer ); + } + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + b驕ク謚槭@縺 = false; + this.bIsActivePopupMenu = false; + this.font = new CActDFPFont(); + base.list蟄植ctivities.Add( this.font ); + nItemSelecting = -1; + + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + if ( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + base.list蟄植ctivities.Remove( this.font ); + this.font.On髱樊エサ諤ァ蛹(); + this.font = null; + + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txCursor ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txPopupMenuBackground ); + for ( int i = 0; i < 4; i++ ) + { + this.ct繧ュ繝シ蜿榊セゥ逕ィ[ i ] = null; + } + base.On髱樊エサ諤ァ蛹(); + } + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + + ConditionallyInitializePrvFont(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if ( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txPopupMenuBackground ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txCursor ); + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k( ref this.prvFont ); + } + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + public override int On騾イ陦梧緒逕サ() + { + throw new InvalidOperationException( "t騾イ陦梧緒逕サ(bool)縺ョ縺サ縺繧剃スソ逕ィ縺励※縺上□縺輔>縲" ); + } + + public int t騾イ陦梧緒逕サ() + { + if ( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 && this.bIsActivePopupMenu ) + { + if ( this.b繧ュ繝シ蜈・蜉帛セ縺。 ) + { + #region [ Shift-F1: CONFIG逕サ髱「 ] + if ( ( TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( (int)SlimDXKeys.Key.RightShift ) || TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( (int)SlimDXKeys.Key.LeftShift ) ) && + TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.F1 ) ) + { // [SHIFT] + [F1] CONFIG + TJAPlayer3.Skin.sound蜿匁カ磯浹.t蜀咲函縺吶k(); + tCancel(); + this.bGotoDetailConfig = true; + } + #endregion + #region [ 繧ュ繝シ蜈・蜉: 繧ュ繝」繝ウ繧サ繝ォ ] + else if ( ( TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.Escape ) + || TJAPlayer3.Pad.b謚シ縺輔l縺( E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.FT ) + || TJAPlayer3.Pad.b謚シ縺輔l縺檬B( E繝代ャ繝.Cancel ) ) + && this.bEsc譛牙柑 ) + { // 繧ュ繝」繝ウ繧サ繝ォ + TJAPlayer3.Skin.sound蜿匁カ磯浹.t蜀咲函縺吶k(); + tCancel(); + this.bIsActivePopupMenu = false; + } + #endregion + + if (!b驕ク謚槭@縺) + { + #region [ 繧ュ繝シ蜈・蜉: 豎コ螳 ] + // E讌ス蝎ィ繝代シ繝 eInst = E讌ス蝎ィ繝代シ繝.UNKNOWN; + ESortAction eAction = ESortAction.END; + if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.GUITAR, E繝代ャ繝.Decide)) + { + eInst = E讌ス蝎ィ繝代シ繝.GUITAR; + eAction = ESortAction.Decide; + } + else if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.BASS, E繝代ャ繝.Decide)) + { + eInst = E讌ス蝎ィ繝代シ繝.BASS; + eAction = ESortAction.Decide; + } + else if ( + TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.Decide) // #24756 2011.4.1 yyagi: Add condition "Drum-Decide" to enable CY in Sort Menu. + || TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RD) + || TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LC) + || TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LRed) + || TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RRed) + || (TJAPlayer3.ConfigIni.bEnter縺後く繝シ蜑イ繧雁ス薙※縺ョ縺ゥ縺薙↓繧ゆスソ逕ィ縺輔l縺ヲ縺縺ェ縺 && TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.Return))) + { + eInst = E讌ス蝎ィ繝代シ繝.DRUMS; + eAction = ESortAction.Decide; + } + if (eAction == ESortAction.Decide) // 豎コ螳 + { + this.tEnter謚シ荳(); + } + #endregion + #region [ 繧ュ繝シ蜈・蜉: 蜑阪↓遘サ蜍 ] + this.ct繧ュ繝シ蜿榊セゥ逕ィ.Up.t繧ュ繝シ蜿榊セゥ(TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧((int)SlimDXKeys.Key.UpArrow), new CCounter.DG繧ュ繝シ蜃ヲ逅(this.t蜑阪↓遘サ蜍)); + this.ct繧ュ繝シ蜿榊セゥ逕ィ.R.t繧ュ繝シ蜿榊セゥ(TJAPlayer3.Pad.b謚シ縺輔l縺ヲ縺繧季B(E繝代ャ繝.R), new CCounter.DG繧ュ繝シ蜃ヲ逅(this.t蜑阪↓遘サ蜍)); + if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.SD) || TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LBlue)) + { + this.t蜑阪↓遘サ蜍(); + } + #endregion + #region [ 繧ュ繝シ蜈・蜉: 谺。縺ォ遘サ蜍 ] + this.ct繧ュ繝シ蜿榊セゥ逕ィ.Down.t繧ュ繝シ蜿榊セゥ(TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧((int)SlimDXKeys.Key.DownArrow), new CCounter.DG繧ュ繝シ蜃ヲ逅(this.t谺。縺ォ遘サ蜍)); + this.ct繧ュ繝シ蜿榊セゥ逕ィ.B.t繧ュ繝シ蜿榊セゥ(TJAPlayer3.Pad.b謚シ縺輔l縺ヲ縺繧季B(E繝代ャ繝.B), new CCounter.DG繧ュ繝シ蜃ヲ逅(this.t谺。縺ォ遘サ蜍)); + if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LT) || TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RBlue)) + { + this.t谺。縺ォ遘サ蜍(); + } + #endregion + } + } + #region [ 繝昴ャ繝励い繝繝励Γ繝九Η繝シ 閭梧勹謠冗判 ] + if ( TJAPlayer3.Tx.Menu_Title != null ) + { + TJAPlayer3.Tx.Menu_Title.t2D謠冗判( TJAPlayer3.app.Device, 160, 40 ); + } + #endregion + #region [ 繧ス繝シ繝医Γ繝九Η繝シ繧ソ繧、繝医Ν謠冗判 ] + int x = 240, y = 44; + stqMenuTitle.txName.t2D謠冗判( TJAPlayer3.app.Device, x, y ); + #endregion + #region [ 繧ォ繝シ繧ス繝ォ謠冗判 ] + if ( TJAPlayer3.Tx.Menu_Highlight != null ) + { + int height = 32; + int curX = 180; + int curY = 46 + ( height * ( this.n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1 ) ); + TJAPlayer3.Tx.Menu_Highlight.t2D謠冗判( TJAPlayer3.app.Device, curX, curY, new Rectangle( 0, 0, 16, 32 ) ); + curX += 0x10; + Rectangle rectangle = new Rectangle( 8, 0, 0x10, 0x20 ); + for ( int j = 0; j < 16; j++ ) + { + TJAPlayer3.Tx.Menu_Highlight.t2D謠冗判( TJAPlayer3.app.Device, curX, curY, rectangle ); + curX += 16; + } + TJAPlayer3.Tx.Menu_Highlight.t2D謠冗判( TJAPlayer3.app.Device, curX, curY, new Rectangle( 0x10, 0, 16, 32 ) ); + } + #endregion + #region [ 繧ス繝シ繝亥呵」懈枚蟄怜玲緒逕サ ] + for ( int i = 0; i < lciMenuItems.Length; i++ ) + { + bool bItemBold = ( i == nItemSelecting && !bShowAllItems ) ? true : false; + //font.t譁蟄怜玲緒逕サ( 190, 80 + i * 32, lciMenuItems[ i ].cItem.str鬆逶ョ蜷, bItemBold, 1.0f ); + if ( lciMenuItems[ i ].txName != null ) + { + int height = lciMenuItems[ i ].rectName.Height; + lciMenuItems[ i ].txName.t2D謠冗判( TJAPlayer3.app.Device, 180, 77 + i * 32 ); + } + + bool bValueBold = (bItemBold || (i == nItemSelecting && bIsSelectingIntItem)) ? true : false; + if (bItemBold || bShowAllItems) + { + string s; + switch (lciMenuItems[i].cItem.str鬆逶ョ蜷) + { + case "貍泌・城溷コヲ": + { + double d = (double)((int)lciMenuItems[i].cItem.obj迴セ蝨ィ蛟、() / 20.0); + s = "x" + d.ToString("0.000"); + } + break; + case "縺ー縺縺昴¥": + { + double d = (double)((((int)lciMenuItems[i].cItem.obj迴セ蝨ィ蛟、()) + 1) / 10.0); + s = "x" + d.ToString("0.0"); + } + break; + + default: + s = lciMenuItems[i].cItem.obj迴セ蝨ィ蛟、().ToString(); + break; + } + //font.t譁蟄怜玲緒逕サ( (int)(340 * Scale.X), (int)(80 + i * 32), s, bValueBold, 1.0f * Scale.Y); + using (var bmpStr = bValueBold ? + prvFont.DrawPrivateFont(s, Color.White, Color.Black, Color.Yellow, Color.OrangeRed) : + prvFont.DrawPrivateFont(s, Color.White, Color.Black)) + { + using (var ctStr = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(bmpStr, false)) + { + ctStr.t2D謠冗判(TJAPlayer3.app.Device, 330, 77 + i * 32); + } + } + } + } + #endregion + t騾イ陦梧緒逕サsub(); + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private bool b繧ュ繝シ蜈・蜉帛セ縺。; + protected bool bEsc譛牙柑; + + internal int n迴セ蝨ィ縺ョ驕ク謚櫁。; + internal E讌ス蝎ィ繝代シ繝 eInst = E讌ス蝎ィ繝代シ繝.UNKNOWN; + + //private CTexture txPopupMenuBackground; + //private CTexture txCursor; + private CActDFPFont font; + CPrivateFastFont prvFont; + + internal struct stQuickMenuItem + { + internal CItemBase cItem; + internal CTexture txName; + internal Rectangle rectName; + } + private stQuickMenuItem[] lciMenuItems; + private stQuickMenuItem stqMenuTitle; + private string strMenuTitle; + private bool bShowAllItems; + private bool bIsSelectingIntItem; + public static bool b驕ク謚槭@縺; + [StructLayout( LayoutKind.Sequential )] + private struct ST繧ュ繝シ蜿榊セゥ逕ィ繧ォ繧ヲ繝ウ繧ソ + { + public CCounter Up; + public CCounter Down; + public CCounter R; + public CCounter B; + public CCounter this[ int index ] + { + get + { + switch ( index ) + { + case 0: + return this.Up; + + case 1: + return this.Down; + + case 2: + return this.R; + + case 3: + return this.B; + } + throw new IndexOutOfRangeException(); + } + set + { + switch ( index ) + { + case 0: + this.Up = value; + return; + + case 1: + this.Down = value; + return; + + case 2: + this.R = value; + return; + + case 3: + this.B = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + private ST繧ュ繝シ蜿榊セゥ逕ィ繧ォ繧ヲ繝ウ繧ソ ct繧ュ繝シ蜿榊セゥ逕ィ; + + private enum ESortAction : int + { + Cancel, Decide, Previous, Next, END + } + private int nItemSelecting; // 縲系迴セ蝨ィ縺ョ驕ク謚櫁。後阪→縺ッ蛻・縺ォ險ュ縺代k縲Tort縺ァ繝。繝九Η繝シ陦ィ遉コ逶エ蠕後↓繧「繧、繝繝縺ョ荳ュ霄ォ繧定。ィ遉コ縺励↑縺繧医≧縺ォ縺吶k縺溘a + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/05.SongSelect/CActSelectPreimage繝代ロ繝ォ.cs b/TJAPlayer3/Stages/05.SongSelect/CActSelectPreimage繝代ロ繝ォ.cs new file mode 100644 index 00000000..8bf51c1c --- /dev/null +++ b/TJAPlayer3/Stages/05.SongSelect/CActSelectPreimage繝代ロ繝ォ.cs @@ -0,0 +1,585 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.IO; +using System.Diagnostics; +using SlimDX; +using SlimDX.Direct3D9; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActSelectPreimage繝代ロ繝ォ : CActivity + { + // 繝。繧ス繝繝 + + public CActSelectPreimage繝代ロ繝ォ() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + public void t驕ク謚樊峇縺悟、画峩縺輔l縺() + { + this.ct驕蟒カ陦ィ遉コ = new CCounter( -TJAPlayer3.ConfigIni.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ逕サ蜒上′陦ィ遉コ髢句ァ九&繧後k縺セ縺ァ縺ョ繧ヲ繧ァ繧、繝ms, 100, 1, TJAPlayer3.Timer ); + this.b譁ー縺励>繝励Ξ繝薙Η繝シ繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧薙□ = false; + } + + public bool bIsPlayingPremovie // #27060 + { + get + { + return (this.avi != null); + } + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + this.n譛ャ菴店 = 8; + this.n譛ャ菴添 = 0x39; + this.r陦ィ遉コ縺吶k繝励Ξ繝薙Η繝シ逕サ蜒 = this.tx繝励Ξ繝薙Η繝シ逕サ蜒上′縺ェ縺縺ィ縺阪ョ逕サ蜒; + this.str迴セ蝨ィ縺ョ繝輔ぃ繧、繝ォ蜷 = ""; + this.b譁ー縺励>繝励Ξ繝薙Η繝シ繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧薙□ = false; + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + this.ct逋サ蝣エ繧「繝九Γ逕ィ = null; + this.ct驕蟒カ陦ィ遉コ = null; + if( this.avi != null ) + { + this.avi.Dispose(); + this.avi = null; + } + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + this.tx繝代ロ繝ォ譛ャ菴 = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_preimage panel.png" ), false ); + this.tx繧サ繝ウ繧オ = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_sensor.png" ), false ); + //this.tx繧サ繝ウ繧オ蜈 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_sensor light.png" ), false ); + this.tx繝励Ξ繝薙Η繝シ逕サ蜒 = null; + this.tx繝励Ξ繝薙Η繝シ逕サ蜒上′縺ェ縺縺ィ縺阪ョ逕サ蜒 = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_preimage default.png" ), false ); + this.sfAVI逕サ蜒 = Surface.CreateOffscreenPlain( TJAPlayer3.app.Device.UnderlyingDevice, 0xcc, 0x10d, TJAPlayer3.app.GraphicsDeviceManager.CurrentSettings.BackBufferFormat, Pool.SystemMemory ); + this.nAVI蜀咲函髢句ァ区凾蛻サ = -1; + this.n蜑榊屓謠冗判縺励◆繝輔Ξ繝シ繝逡ェ蜿キ = -1; + this.b蜍慕判繝輔Ξ繝シ繝繧剃ス懈舌@縺 = false; + this.pAVIBmp = IntPtr.Zero; + this.t繝励Ξ繝薙Η繝シ逕サ蜒柔蜍慕判縺ョ螟画峩(); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繝代ロ繝ォ譛ャ菴 ); + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧サ繝ウ繧オ ); + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧サ繝ウ繧オ蜈 ); + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繝励Ξ繝薙Η繝シ逕サ蜒 ); + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繝励Ξ繝薙Η繝シ逕サ蜒上′縺ェ縺縺ィ縺阪ョ逕サ蜒 ); + if( this.sfAVI逕サ蜒 != null ) + { + this.sfAVI逕サ蜒.Dispose(); + this.sfAVI逕サ蜒 = null; + } + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + if( base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + this.ct逋サ蝣エ繧「繝九Γ逕ィ = new CCounter( 0, 100, 5, TJAPlayer3.Timer ); + this.ct繧サ繝ウ繧オ蜈 = new CCounter( 0, 100, 30, TJAPlayer3.Timer ); + this.ct繧サ繝ウ繧オ蜈.n迴セ蝨ィ縺ョ蛟、 = 70; + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + this.ct逋サ蝣エ繧「繝九Γ逕ィ.t騾イ陦(); + this.ct繧サ繝ウ繧オ蜈.t騾イ陦鍬oop(); + if( ( !TJAPlayer3.stage驕ク譖イ.b繧ケ繧ッ繝ュ繝シ繝ォ荳ュ && ( this.ct驕蟒カ陦ィ遉コ != null ) ) && this.ct驕蟒カ陦ィ遉コ.b騾イ陦御クュ ) + { + this.ct驕蟒カ陦ィ遉コ.t騾イ陦(); + if ( ( this.ct驕蟒カ陦ィ遉コ.n迴セ蝨ィ縺ョ蛟、 >= 0 ) && this.b譁ー縺励>繝励Ξ繝薙Η繝シ繝輔ぃ繧、繝ォ繧偵∪縺隱ュ縺ソ霎シ繧薙〒縺縺ェ縺 ) + { + this.t繝励Ξ繝薙Η繝シ逕サ蜒柔蜍慕判縺ョ螟画峩(); + TJAPlayer3.Timer.t譖エ譁ー(); + this.ct驕蟒カ陦ィ遉コ.n迴セ蝨ィ縺ョ邨碁℃譎る俣ms = TJAPlayer3.Timer.n迴セ蝨ィ譎ょ綾; + this.b譁ー縺励>繝励Ξ繝薙Η繝シ繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧薙□ = true; + } + else if ( this.ct驕蟒カ陦ィ遉コ.b邨ゆコ蛟、縺ォ驕斐@縺 && this.ct驕蟒カ陦ィ遉コ.b騾イ陦御クュ ) + { + this.ct驕蟒カ陦ィ遉コ.t蛛懈ュ「(); + } + } + else if( ( ( this.avi != null ) && ( this.sfAVI逕サ蜒 != null ) ) && ( this.nAVI蜀咲函髢句ァ区凾蛻サ != -1 ) ) + { + int time = (int) ( ( TJAPlayer3.Timer.n迴セ蝨ィ譎ょ綾 - this.nAVI蜀咲函髢句ァ区凾蛻サ ) * ( ( (double) TJAPlayer3.ConfigIni.n貍泌・城溷コヲ ) / 20.0 ) ); + int frameNoFromTime = this.avi.GetFrameNoFromTime( time ); + if( frameNoFromTime >= this.avi.GetMaxFrameCount() ) + { + this.nAVI蜀咲函髢句ァ区凾蛻サ = TJAPlayer3.Timer.n迴セ蝨ィ譎ょ綾; + } + else if( ( this.n蜑榊屓謠冗判縺励◆繝輔Ξ繝シ繝逡ェ蜿キ != frameNoFromTime ) && !this.b蜍慕判繝輔Ξ繝シ繝繧剃ス懈舌@縺 ) + { + this.b蜍慕判繝輔Ξ繝シ繝繧剃ス懈舌@縺 = true; + this.n蜑榊屓謠冗判縺励◆繝輔Ξ繝シ繝逡ェ蜿キ = frameNoFromTime; + this.pAVIBmp = this.avi.GetFramePtr( frameNoFromTime ); + } + } + this.t謠冗判蜃ヲ逅_繝代ロ繝ォ譛ャ菴(); + //this.t謠冗判蜃ヲ逅_繧ク繝」繝ウ繝ォ譁蟄怜(); + this.t謠冗判蜃ヲ逅_繝励Ξ繝薙Η繝シ逕サ蜒(); + //this.t謠冗判蜃ヲ逅_繧サ繝ウ繧オ蜈(); + //this.t謠冗判蜃ヲ逅_繧サ繝ウ繧オ譛ャ菴(); + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private CAvi avi; + private bool b蜍慕判繝輔Ξ繝シ繝繧剃ス懈舌@縺; + private CCounter ct繧サ繝ウ繧オ蜈; + private CCounter ct驕蟒カ陦ィ遉コ; + private CCounter ct逋サ蝣エ繧「繝九Γ逕ィ; + private long nAVI蜀咲函髢句ァ区凾蛻サ; + private int n蜑榊屓謠冗判縺励◆繝輔Ξ繝シ繝逡ェ蜿キ; + private int n譛ャ菴店; + private int n譛ャ菴添; + private IntPtr pAVIBmp; + private readonly Rectangle rc繧サ繝ウ繧オ蜈 = new Rectangle( 0, 0xc0, 0x40, 0x40 ); + private readonly Rectangle rc繧サ繝ウ繧オ譛ャ菴謎ク句濠蛻 = new Rectangle( 0x40, 0, 0x40, 0x80 ); + private readonly Rectangle rc繧サ繝ウ繧オ譛ャ菴謎ク雁濠蛻 = new Rectangle( 0, 0, 0x40, 0x80 ); + private CTexture r陦ィ遉コ縺吶k繝励Ξ繝薙Η繝シ逕サ蜒; + private Surface sfAVI逕サ蜒; + private string str迴セ蝨ィ縺ョ繝輔ぃ繧、繝ォ蜷; + private CTexture tx繧サ繝ウ繧オ; + private CTexture tx繧サ繝ウ繧オ蜈; + private CTexture tx繝代ロ繝ォ譛ャ菴; + private CTexture tx繝励Ξ繝薙Η繝シ逕サ蜒; + private CTexture tx繝励Ξ繝薙Η繝シ逕サ蜒上′縺ェ縺縺ィ縺阪ョ逕サ蜒; + private bool b譁ー縺励>繝励Ξ繝薙Η繝シ繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧薙□; + private bool b譁ー縺励>繝励Ξ繝薙Η繝シ繝輔ぃ繧、繝ォ繧偵∪縺隱ュ縺ソ霎シ繧薙〒縺縺ェ縺 + { + get + { + return !this.b譁ー縺励>繝励Ξ繝薙Η繝シ繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧薙□; + } + set + { + this.b譁ー縺励>繝励Ξ繝薙Η繝シ繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧薙□ = !value; + } + } + + private unsafe void t繧オ繝シ繝輔ぉ繧、繧ケ繧偵け繝ェ繧「縺吶k( Surface sf ) + { + DataRectangle rectangle = sf.LockRectangle( LockFlags.None ); + DataStream data = rectangle.Data; + switch( ( rectangle.Pitch / sf.Description.Width ) ) + { + case 4: + { + uint* numPtr = (uint*) data.DataPointer.ToPointer(); + for( int i = 0; i < sf.Description.Height; i++ ) + { + for( int j = 0; j < sf.Description.Width; j++ ) + { + ( numPtr + ( i * sf.Description.Width ) )[ j ] = 0; + } + } + break; + } + case 2: + { + ushort* numPtr2 = (ushort*) data.DataPointer.ToPointer(); + for( int k = 0; k < sf.Description.Height; k++ ) + { + for( int m = 0; m < sf.Description.Width; m++ ) + { + ( numPtr2 + ( k * sf.Description.Width ) )[ m ] = 0; + } + } + break; + } + } + sf.UnlockRectangle(); + } + private void t繝励Ξ繝薙Η繝シ逕サ蜒柔蜍慕判縺ョ螟画峩() + { + if( this.avi != null ) + { + this.avi.Dispose(); + this.avi = null; + } + this.pAVIBmp = IntPtr.Zero; + this.nAVI蜀咲函髢句ァ区凾蛻サ = -1; + if( !TJAPlayer3.ConfigIni.b繧ケ繝医う繝繧ッ繝「繝シ繝 ) + { + if( this.t繝励Ξ繝薙Η繝シ蜍慕判縺ョ謖螳壹′縺ゅl縺ー讒狗ッ峨☆繧() ) + { + return; + } + if( this.t繝励Ξ繝薙Η繝シ逕サ蜒上ョ謖螳壹′縺ゅl縺ー讒狗ッ峨☆繧() ) + { + return; + } + if( this.t閭梧勹逕サ蜒上′縺ゅl縺ー縺昴ョ荳驛ィ縺九i繝励Ξ繝薙Η繝シ逕サ蜒上r讒狗ッ峨☆繧() ) + { + return; + } + } + this.r陦ィ遉コ縺吶k繝励Ξ繝薙Η繝シ逕サ蜒 = this.tx繝励Ξ繝薙Η繝シ逕サ蜒上′縺ェ縺縺ィ縺阪ョ逕サ蜒; + this.str迴セ蝨ィ縺ョ繝輔ぃ繧、繝ォ蜷 = ""; + } + private bool t繝励Ξ繝薙Η繝シ逕サ蜒上ョ謖螳壹′縺ゅl縺ー讒狗ッ峨☆繧() + { + C繧ケ繧ウ繧「 c繧ケ繧ウ繧「 = TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「; + if( ( c繧ケ繧ウ繧「 == null ) || string.IsNullOrEmpty( c繧ケ繧ウ繧「.隴憺擇諠蝣ア.Preimage ) ) + { + return false; + } + string str = c繧ケ繧ウ繧「.繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.Preimage; + if( !str.Equals( this.str迴セ蝨ィ縺ョ繝輔ぃ繧、繝ォ蜷 ) ) + { + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繝励Ξ繝薙Η繝シ逕サ蜒 ); + this.str迴セ蝨ィ縺ョ繝輔ぃ繧、繝ォ蜷 = str; + if( !File.Exists( this.str迴セ蝨ィ縺ョ繝輔ぃ繧、繝ォ蜷 ) ) + { + Trace.TraceWarning( "繝輔ぃ繧、繝ォ縺悟ュ伜惠縺励∪縺帙s縲({0})", new object[] { this.str迴セ蝨ィ縺ョ繝輔ぃ繧、繝ォ蜷 } ); + return false; + } + this.tx繝励Ξ繝薙Η繝シ逕サ蜒 = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( this.str迴セ蝨ィ縺ョ繝輔ぃ繧、繝ォ蜷, false ); + if( this.tx繝励Ξ繝薙Η繝シ逕サ蜒 != null ) + { + this.r陦ィ遉コ縺吶k繝励Ξ繝薙Η繝シ逕サ蜒 = this.tx繝励Ξ繝薙Η繝シ逕サ蜒; + } + else + { + this.r陦ィ遉コ縺吶k繝励Ξ繝薙Η繝シ逕サ蜒 = this.tx繝励Ξ繝薙Η繝シ逕サ蜒上′縺ェ縺縺ィ縺阪ョ逕サ蜒; + } + } + return true; + } + private bool t繝励Ξ繝薙Η繝シ蜍慕判縺ョ謖螳壹′縺ゅl縺ー讒狗ッ峨☆繧() + { + C繧ケ繧ウ繧「 c繧ケ繧ウ繧「 = TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「; + if( ( TJAPlayer3.ConfigIni.bAVI譛牙柑 && ( c繧ケ繧ウ繧「 != null ) ) && !string.IsNullOrEmpty( c繧ケ繧ウ繧「.隴憺擇諠蝣ア.Premovie ) ) + { + string filename = c繧ケ繧ウ繧「.繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.Premovie; + if( filename.Equals( this.str迴セ蝨ィ縺ョ繝輔ぃ繧、繝ォ蜷 ) ) + { + return true; + } + if( this.avi != null ) + { + this.avi.Dispose(); + this.avi = null; + } + this.str迴セ蝨ィ縺ョ繝輔ぃ繧、繝ォ蜷 = filename; + if( !File.Exists( this.str迴セ蝨ィ縺ョ繝輔ぃ繧、繝ォ蜷 ) ) + { + Trace.TraceWarning( "繝輔ぃ繧、繝ォ縺悟ュ伜惠縺励∪縺帙s縲({0})", new object[] { this.str迴セ蝨ィ縺ョ繝輔ぃ繧、繝ォ蜷 } ); + return false; + } + try + { + this.avi = new CAvi( filename ); + this.nAVI蜀咲函髢句ァ区凾蛻サ = TJAPlayer3.Timer.n迴セ蝨ィ譎ょ綾; + this.n蜑榊屓謠冗判縺励◆繝輔Ξ繝シ繝逡ェ蜿キ = -1; + this.b蜍慕判繝輔Ξ繝シ繝繧剃ス懈舌@縺 = false; + this.t繧オ繝シ繝輔ぉ繧、繧ケ繧偵け繝ェ繧「縺吶k( this.sfAVI逕サ蜒 ); + Trace.TraceInformation( "蜍慕判繧堤函謌舌@縺セ縺励◆縲({0})", new object[] { filename } ); + } + catch (Exception e) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "蜍慕判縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲({0})", new object[] { filename } ); + this.avi = null; + this.nAVI蜀咲函髢句ァ区凾蛻サ = -1; + } + } + return false; + } + private bool t閭梧勹逕サ蜒上′縺ゅl縺ー縺昴ョ荳驛ィ縺九i繝励Ξ繝薙Η繝シ逕サ蜒上r讒狗ッ峨☆繧() + { + C繧ケ繧ウ繧「 c繧ケ繧ウ繧「 = TJAPlayer3.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( "繝輔ぃ繧、繝ォ縺悟ュ伜惠縺励∪縺帙s縲({0})", new object[] { path } ); + return false; + } + TJAPlayer3.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( TJAPlayer3.app.Device, bitmap3, TJAPlayer3.TextureFormat ); + this.r陦ィ遉コ縺吶k繝励Ξ繝薙Η繝シ逕サ蜒 = this.tx繝励Ξ繝薙Η繝シ逕サ蜒; + } + catch (Exception e) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "閭梧勹逕サ蜒上ョ隱ュ縺ソ霎シ縺ソ縺ォ螟ア謨励@縺セ縺励◆縲({0})", new object[] { this.str迴セ蝨ィ縺ョ繝輔ぃ繧、繝ォ蜷 } ); + this.r陦ィ遉コ縺吶k繝励Ξ繝薙Η繝シ逕サ蜒 = this.tx繝励Ξ繝薙Η繝シ逕サ蜒上′縺ェ縺縺ィ縺阪ョ逕サ蜒; + return false; + } + finally + { + if( image != null ) + { + image.Dispose(); + } + if( bitmap2 != null ) + { + bitmap2.Dispose(); + } + if( bitmap3 != null ) + { + bitmap3.Dispose(); + } + } + } + return true; + } + /// + /// 荳譎ら噪縺ォ菴ソ逕ィ遖∵ュ「縲 + /// + private void t謠冗判蜃ヲ逅_繧ク繝」繝ウ繝ォ譁蟄怜() + { + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 = TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ; + C繧ケ繧ウ繧「 c繧ケ繧ウ繧「 = TJAPlayer3.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; + } + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( this.n譛ャ菴店 + 0x12, this.n譛ャ菴添 - 1, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.襍、邏ー, str ); + } + } + private void t謠冗判蜃ヲ逅_繧サ繝ウ繧オ蜈() + { + int num = (int)this.ct繧サ繝ウ繧オ蜈.n迴セ蝨ィ縺ョ蛟、; + if( num < 12 ) + { + int x = this.n譛ャ菴店 + 0xcc; + int y = this.n譛ャ菴添 + 0x7b; + if( this.tx繧サ繝ウ繧オ蜈 != null ) + { + this.tx繧サ繝ウ繧オ蜈.vc諡。螟ァ邵ョ蟆丞咲紫 = new Vector3( 1f, 1f, 1f ); + this.tx繧サ繝ウ繧オ蜈.Opacity = 0xff; + this.tx繧サ繝ウ繧オ蜈.t2D謠冗判( TJAPlayer3.app.Device, x, y, new Rectangle( ( num % 4 ) * 0x40, ( num / 4 ) * 0x40, 0x40, 0x40 ) ); + } + } + else if( num < 0x18 ) + { + int num4 = num - 11; + double num5 = ( (double) num4 ) / 11.0; + double num6 = 1.0 + ( num5 * 0.5 ); + int num7 = (int) ( 64.0 * num6 ); + int num8 = (int) ( 64.0 * num6 ); + int num9 = ( ( this.n譛ャ菴店 + 0xcc ) + 0x20 ) - ( num7 / 2 ); + int num10 = ( ( this.n譛ャ菴添 + 0x7b ) + 0x20 ) - ( num8 / 2 ); + if( this.tx繧サ繝ウ繧オ蜈 != null ) + { + this.tx繧サ繝ウ繧オ蜈.vc諡。螟ァ邵ョ蟆丞咲紫 = new Vector3( (float) num6, (float) num6, 1f ); + this.tx繧サ繝ウ繧オ蜈.Opacity = (int) ( 255.0 * ( 1.0 - num5 ) ); + this.tx繧サ繝ウ繧オ蜈.t2D謠冗判( TJAPlayer3.app.Device, num9, num10, this.rc繧サ繝ウ繧オ蜈 ); + } + } + } + private void t謠冗判蜃ヲ逅_繧サ繝ウ繧オ譛ャ菴() + { + int x = this.n譛ャ菴店 + 0xcd; + int y = this.n譛ャ菴添 - 4; + if( this.tx繧サ繝ウ繧オ != null ) + { + this.tx繧サ繝ウ繧オ.t2D謠冗判( TJAPlayer3.app.Device, x, y, this.rc繧サ繝ウ繧オ譛ャ菴謎ク雁濠蛻 ); + y += 0x80; + this.tx繧サ繝ウ繧オ.t2D謠冗判( TJAPlayer3.app.Device, x, y, this.rc繧サ繝ウ繧オ譛ャ菴謎ク句濠蛻 ); + } + } + private void t謠冗判蜃ヲ逅_繝代ロ繝ォ譛ャ菴() + { + if( this.ct逋サ蝣エ繧「繝九Γ逕ィ.b邨ゆコ蛟、縺ォ驕斐@縺 || ( this.tx繝代ロ繝ォ譛ャ菴 != null ) ) + { + this.n譛ャ菴店 = 16; + this.n譛ャ菴添 = 86; + } + else + { + double num = ( (double) this.ct逋サ蝣エ繧「繝九Γ逕ィ.n迴セ蝨ィ縺ョ蛟、 ) / 100.0; + double num2 = Math.Cos( ( 1.5 + ( 0.5 * num ) ) * Math.PI ); + this.n譛ャ菴店 = 8; + this.n譛ャ菴添 = 0x39 - ( (int) ( this.tx繝代ロ繝ォ譛ャ菴.sz逕サ蜒上し繧、繧コ.Height * ( 1.0 - ( num2 * num2 ) ) ) ); + } + if( this.tx繝代ロ繝ォ譛ャ菴 != null ) + { + this.tx繝代ロ繝ォ譛ャ菴.t2D謠冗判( TJAPlayer3.app.Device, this.n譛ャ菴店, this.n譛ャ菴添 ); + } + } + private unsafe void t謠冗判蜃ヲ逅_繝励Ξ繝薙Η繝シ逕サ蜒() + { + if( !TJAPlayer3.stage驕ク譖イ.b繧ケ繧ッ繝ュ繝シ繝ォ荳ュ && ( ( ( this.ct驕蟒カ陦ィ遉コ != null ) && ( this.ct驕蟒カ陦ィ遉コ.n迴セ蝨ィ縺ョ蛟、 > 0 ) ) && !this.b譁ー縺励>繝励Ξ繝薙Η繝シ繝輔ぃ繧、繝ォ繧偵∪縺隱ュ縺ソ霎シ繧薙〒縺縺ェ縺 ) ) + { + int x = this.n譛ャ菴店 + 0x12; + int y = this.n譛ャ菴添 + 0x10; + float num3 = ( (float) this.ct驕蟒カ陦ィ遉コ.n迴セ蝨ィ縺ョ蛟、 ) / 100f; + float num4 = 0.9f + ( 0.1f * num3 ); + if( ( this.nAVI蜀咲函髢句ァ区凾蛻サ != -1 ) && ( this.sfAVI逕サ蜒 != null ) ) + { + if( this.b蜍慕判繝輔Ξ繝シ繝繧剃ス懈舌@縺 && ( this.pAVIBmp != IntPtr.Zero ) ) + { + DataRectangle rectangle = this.sfAVI逕サ蜒.LockRectangle( LockFlags.None ); + DataStream data = rectangle.Data; + int num5 = rectangle.Pitch / this.sfAVI逕サ蜒.Description.Width; + BitmapUtil.BITMAPINFOHEADER* pBITMAPINFOHEADER = (BitmapUtil.BITMAPINFOHEADER*) this.pAVIBmp.ToPointer(); + if( pBITMAPINFOHEADER->biBitCount == 0x18 ) + { + switch( num5 ) + { + case 2: + this.avi.tBitmap24ToGraphicsStreamR5G6B5( pBITMAPINFOHEADER, data, this.sfAVI逕サ蜒.Description.Width, this.sfAVI逕サ蜒.Description.Height ); + break; + + case 4: + this.avi.tBitmap24ToGraphicsStreamX8R8G8B8( pBITMAPINFOHEADER, data, this.sfAVI逕サ蜒.Description.Width, this.sfAVI逕サ蜒.Description.Height ); + break; + } + } + this.sfAVI逕サ蜒.UnlockRectangle(); + this.b蜍慕判繝輔Ξ繝シ繝繧剃ス懈舌@縺 = false; + } + using( Surface surface = TJAPlayer3.app.Device.GetBackBuffer( 0, 0 ) ) + { + try + { + TJAPlayer3.app.Device.UpdateSurface( this.sfAVI逕サ蜒, new Rectangle( 0, 0, this.sfAVI逕サ蜒.Description.Width, this.sfAVI逕サ蜒.Description.Height ), surface, new Point( x, y ) ); + } + catch( Exception e ) // #32335 2013.10.26 yyagi: codec縺後↑縺縺ィ縲.3DERR_INVALIDCALL縺檎匱逕溘☆繧句エ蜷医′縺ゅk + { + Trace.TraceError( "codec縺後↑縺縺ィ縲.3DERR_INVALIDCALL縺檎匱逕溘☆繧句エ蜷医′縺ゅk" ); + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (ba21ae56-afaa-47b9-a5c7-1a6bb21085eb)" ); + } + return; + } + } + if( this.r陦ィ遉コ縺吶k繝励Ξ繝薙Η繝シ逕サ蜒 != null ) + { + int width = this.r陦ィ遉コ縺吶k繝励Ξ繝薙Η繝シ逕サ蜒.sz逕サ蜒上し繧、繧コ.Width; + int height = this.r陦ィ遉コ縺吶k繝励Ξ繝薙Η繝シ逕サ蜒.sz逕サ蜒上し繧、繧コ.Height; + if( width > 400 ) + { + width = 400; + } + if( height > 400 ) + { + height = 400; + } + x += ( 400 - ( (int) ( width * num4 ) ) ) / 2; + y += ( 400 - ( (int) ( height * num4 ) ) ) / 2; + this.r陦ィ遉コ縺吶k繝励Ξ繝薙Η繝シ逕サ蜒.Opacity = (int) ( 255f * num3 ); + this.r陦ィ遉コ縺吶k繝励Ξ繝薙Η繝シ逕サ蜒.vc諡。螟ァ邵ョ蟆丞咲紫.X = num4; + this.r陦ィ遉コ縺吶k繝励Ξ繝薙Η繝シ逕サ蜒.vc諡。螟ァ邵ョ蟆丞咲紫.Y = num4; + this.r陦ィ遉コ縺吶k繝励Ξ繝薙Η繝シ逕サ蜒.t2D謠冗判( TJAPlayer3.app.Device, x + 22, y + 12, new Rectangle( 0, 0, width, height ) ); + } + } + } + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/05.SongSelect/CActSelectPresound.cs b/TJAPlayer3/Stages/05.SongSelect/CActSelectPresound.cs new file mode 100644 index 00000000..92f77aba --- /dev/null +++ b/TJAPlayer3/Stages/05.SongSelect/CActSelectPresound.cs @@ -0,0 +1,235 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using FDK; +using System.Windows.Forms.VisualStyles; + +namespace TJAPlayer3 +{ + internal class CActSelectPresound : CActivity + { + // 繝。繧ス繝繝 + + public CActSelectPresound() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + public void t繧オ繧ヲ繝ウ繝牙●豁「() + { + if( this.sound != null ) + { + this.sound.t蜀咲函繧貞●豁「縺吶k(); + TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r遐エ譽縺吶k( this.sound ); + this.sound = null; + } + } + public void t驕ク謚樊峇縺悟、画峩縺輔l縺() + { + C繧ケ繧ウ繧「 c繧ケ繧ウ繧「 = TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「; + + if( ( c繧ケ繧ウ繧「 != null ) && ( ( !( c繧ケ繧ウ繧「.繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.strBGM繝輔ぃ繧、繝ォ蜷 ).Equals( this.str迴セ蝨ィ縺ョ繝輔ぃ繧、繝ォ蜷 ) || ( this.sound == null ) ) || !this.sound.b蜀咲函荳ュ ) ) + { + this.t繧オ繧ヲ繝ウ繝牙●豁「(); + this.tBGM繝輔ぉ繝シ繝峨う繝ウ髢句ァ(); + this.long蜀咲函菴咲スョ = -1; + if( ( c繧ケ繧ウ繧「.隴憺擇諠蝣ア.strBGM繝輔ぃ繧、繝ォ蜷 != null ) && ( c繧ケ繧ウ繧「.隴憺擇諠蝣ア.strBGM繝輔ぃ繧、繝ォ蜷.Length > 0 ) ) + { + //this.ct蜀咲函蠕縺。繧ヲ繧ァ繧、繝 = new CCounter( 0, CDTXMania.ConfigIni.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ髻ウ縺碁ウエ繧九∪縺ァ縺ョ繧ヲ繧ァ繧、繝ms, 1, CDTXMania.Timer ); + if(TJAPlayer3.Sound邂。逅.GetCurrentSoundDeviceType() != "DirectSound") + { + this.ct蜀咲函蠕縺。繧ヲ繧ァ繧、繝 = new CCounter(0, 1, 270, TJAPlayer3.Timer); + } else + { + this.ct蜀咲函蠕縺。繧ヲ繧ァ繧、繝 = new CCounter(0, 1, 500, TJAPlayer3.Timer); + } + } + } + + //if( ( c繧ケ繧ウ繧「 != null ) && ( ( !( c繧ケ繧ウ繧「.繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.Presound ).Equals( this.str迴セ蝨ィ縺ョ繝輔ぃ繧、繝ォ蜷 ) || ( this.sound == null ) ) || !this.sound.b蜀咲函荳ュ ) ) + //{ + // this.t繧オ繧ヲ繝ウ繝牙●豁「(); + // this.tBGM繝輔ぉ繝シ繝峨う繝ウ髢句ァ(); + // if( ( c繧ケ繧ウ繧「.隴憺擇諠蝣ア.Presound != null ) && ( c繧ケ繧ウ繧「.隴憺擇諠蝣ア.Presound.Length > 0 ) ) + // { + // this.ct蜀咲函蠕縺。繧ヲ繧ァ繧、繝 = new CCounter( 0, CDTXMania.ConfigIni.n譖イ縺碁∈謚槭&繧後※縺九i繝励Ξ繝薙Η繝シ髻ウ縺碁ウエ繧九∪縺ァ縺ョ繧ヲ繧ァ繧、繝ms, 1, CDTXMania.Timer ); + // } + //} + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + this.sound = null; + this.str迴セ蝨ィ縺ョ繝輔ぃ繧、繝ォ蜷 = ""; + this.ct蜀咲函蠕縺。繧ヲ繧ァ繧、繝 = null; + this.ctBGM繝輔ぉ繝シ繝峨い繧ヲ繝育畑 = null; + this.ctBGM繝輔ぉ繝シ繝峨う繝ウ逕ィ = null; + this.long蜀咲函菴咲スョ = -1; + this.long蜀咲函髢句ァ区凾縺ョ繧キ繧ケ繝繝譎ょ綾 = -1; + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + this.t繧オ繧ヲ繝ウ繝牙●豁「(); + this.ct蜀咲函蠕縺。繧ヲ繧ァ繧、繝 = null; + this.ctBGM繝輔ぉ繝シ繝峨う繝ウ逕ィ = null; + this.ctBGM繝輔ぉ繝シ繝峨い繧ヲ繝育畑 = null; + base.On髱樊エサ諤ァ蛹(); + } + public override int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + if( ( this.ctBGM繝輔ぉ繝シ繝峨う繝ウ逕ィ != null ) && this.ctBGM繝輔ぉ繝シ繝峨う繝ウ逕ィ.b騾イ陦御クュ ) + { + this.ctBGM繝輔ぉ繝シ繝峨う繝ウ逕ィ.t騾イ陦(); + TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「.nAutomationLevel_迴セ蝨ィ縺ョ繧オ繧ヲ繝ウ繝 = this.ctBGM繝輔ぉ繝シ繝峨う繝ウ逕ィ.n迴セ蝨ィ縺ョ蛟、; + if( this.ctBGM繝輔ぉ繝シ繝峨う繝ウ逕ィ.b邨ゆコ蛟、縺ォ驕斐@縺 ) + { + this.ctBGM繝輔ぉ繝シ繝峨う繝ウ逕ィ.t蛛懈ュ「(); + } + } + if( ( this.ctBGM繝輔ぉ繝シ繝峨い繧ヲ繝育畑 != null ) && this.ctBGM繝輔ぉ繝シ繝峨い繧ヲ繝育畑.b騾イ陦御クュ ) + { + this.ctBGM繝輔ぉ繝シ繝峨い繧ヲ繝育畑.t騾イ陦(); + TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「.nAutomationLevel_迴セ蝨ィ縺ョ繧オ繧ヲ繝ウ繝 = CSound.MaximumAutomationLevel - this.ctBGM繝輔ぉ繝シ繝峨い繧ヲ繝育畑.n迴セ蝨ィ縺ョ蛟、; + if( this.ctBGM繝輔ぉ繝シ繝峨い繧ヲ繝育畑.b邨ゆコ蛟、縺ォ驕斐@縺 ) + { + this.ctBGM繝輔ぉ繝シ繝峨い繧ヲ繝育畑.t蛛懈ュ「(); + } + } + this.t騾イ陦悟ヲ逅_繝励Ξ繝薙Η繝シ繧オ繧ヲ繝ウ繝(); + + if (this.sound != null) + { + C繧ケ繧ウ繧「 c繧ケ繧ウ繧「 = TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「; + if (long蜀咲函菴咲スョ == -1) + { + this.long蜀咲函髢句ァ区凾縺ョ繧キ繧ケ繝繝譎ょ綾 = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms; + this.long蜀咲函菴咲スョ = c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝繝「BGM繧ェ繝輔そ繝繝; + this.sound.t蜀咲函菴咲スョ繧貞、画峩縺吶k(c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝繝「BGM繧ェ繝輔そ繝繝); + } + else + { + this.long蜀咲函菴咲スョ = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms - this.long蜀咲函髢句ァ区凾縺ョ繧キ繧ケ繝繝譎ょ綾; + if (this.long蜀咲函菴咲スョ >= this.sound.n邱乗シ泌・乗凾髢杜s - c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝繝「BGM繧ェ繝輔そ繝繝) //2020.04.18 Mr-Ojii #DEMOSTART縺九i菴募コヲ繧ょ咲函縺吶k縺溘a縺ォ霑ス蜉 + this.long蜀咲函菴咲スョ = -1; + } + //if (this.long蜀咲函菴咲スョ >= (this.sound.n邱乗シ泌・乗凾髢杜s - c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝繝「BGM繧ェ繝輔そ繝繝) - 1 && this.long蜀咲函菴咲スョ <= (this.sound.n邱乗シ泌・乗凾髢杜s - c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝繝「BGM繧ェ繝輔そ繝繝) + 0) + //this.long蜀咲函菴咲スョ = -1; + + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 0, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.long蜀咲函菴咲スョ.ToString() ); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 0, 20, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, (this.sound.n邱乗シ泌・乗凾髢杜s - c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝繝「BGM繧ェ繝輔そ繝繝).ToString() ); + } + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private CCounter ctBGM繝輔ぉ繝シ繝峨い繧ヲ繝育畑; + private CCounter ctBGM繝輔ぉ繝シ繝峨う繝ウ逕ィ; + private CCounter ct蜀咲函蠕縺。繧ヲ繧ァ繧、繝; + private long long蜀咲函菴咲スョ; + private long long蜀咲函髢句ァ区凾縺ョ繧キ繧ケ繝繝譎ょ綾; + private CSound sound; + private string str迴セ蝨ィ縺ョ繝輔ぃ繧、繝ォ蜷; + + private void tBGM繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋() + { + if( this.ctBGM繝輔ぉ繝シ繝峨う繝ウ逕ィ != null ) + { + this.ctBGM繝輔ぉ繝シ繝峨う繝ウ逕ィ.t蛛懈ュ「(); + } + this.ctBGM繝輔ぉ繝シ繝峨い繧ヲ繝育畑 = new CCounter( 0, 100, 10, TJAPlayer3.Timer ); + this.ctBGM繝輔ぉ繝シ繝峨い繧ヲ繝育畑.n迴セ蝨ィ縺ョ蛟、 = 100 - TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「.nAutomationLevel_迴セ蝨ィ縺ョ繧オ繧ヲ繝ウ繝; + } + private void tBGM繝輔ぉ繝シ繝峨う繝ウ髢句ァ() + { + if( this.ctBGM繝輔ぉ繝シ繝峨い繧ヲ繝育畑 != null ) + { + this.ctBGM繝輔ぉ繝シ繝峨い繧ヲ繝育畑.t蛛懈ュ「(); + } + this.ctBGM繝輔ぉ繝シ繝峨う繝ウ逕ィ = new CCounter( 0, 100, 20, TJAPlayer3.Timer ); + this.ctBGM繝輔ぉ繝シ繝峨う繝ウ逕ィ.n迴セ蝨ィ縺ョ蛟、 = TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「.nAutomationLevel_迴セ蝨ィ縺ョ繧オ繧ヲ繝ウ繝; + } + private void t繝励Ξ繝薙Η繝シ繧オ繧ヲ繝ウ繝峨ョ菴懈() + { + C繧ケ繧ウ繧「 c繧ケ繧ウ繧「 = TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「; + if( ( c繧ケ繧ウ繧「 != null ) && !string.IsNullOrEmpty( c繧ケ繧ウ繧「.隴憺擇諠蝣ア.strBGM繝輔ぃ繧、繝ォ蜷 ) && TJAPlayer3.stage驕ク譖イ.e繝輔ぉ繝シ繧コID != CStage.E繝輔ぉ繝シ繧コ.驕ク譖イ_NowLoading逕サ髱「縺ク縺ョ繝輔ぉ繝シ繝峨い繧ヲ繝 ) + { + string strPreviewFilename = c繧ケ繧ウ繧「.繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.Presound; + try + { + strPreviewFilename = c繧ケ繧ウ繧「.繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.strBGM繝輔ぃ繧、繝ォ蜷; + if(TJAPlayer3.ConfigIni.bBGM髻ウ繧堤匱螢ー縺吶k) + this.sound = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧( strPreviewFilename, ESoundGroup.SongPlayback ); + + // 2018-08-27 twopointzero - DO attempt to load (or queue scanning) loudness metadata here. + // Initialization, song enumeration, and/or interactions may have + // caused background scanning and the metadata may now be available. + // If is not yet available then we wish to queue scanning. + var loudnessMetadata = c繧ケ繧ウ繧「.隴憺擇諠蝣ア.SongLoudnessMetadata + ?? LoudnessMetadataScanner.LoadForAudioPath(strPreviewFilename); + TJAPlayer3.SongGainController.Set( c繧ケ繧ウ繧「.隴憺擇諠蝣ア.SongVol, loudnessMetadata, this.sound ); + + this.sound.t蜀咲函繧帝幕蟋九☆繧( true ); + + if( long蜀咲函菴咲スョ == -1 ) + { + this.long蜀咲函髢句ァ区凾縺ョ繧キ繧ケ繝繝譎ょ綾 = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms; + this.long蜀咲函菴咲スョ = c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝繝「BGM繧ェ繝輔そ繝繝; + this.sound.t蜀咲函菴咲スョ繧貞、画峩縺吶k( c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝繝「BGM繧ェ繝輔そ繝繝 ); + this.long蜀咲函菴咲スョ = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms - this.long蜀咲函髢句ァ区凾縺ョ繧キ繧ケ繝繝譎ょ綾; + } + //if( long蜀咲函菴咲スョ == this.sound.n邱乗シ泌・乗凾髢杜s - 10 ) + // this.long蜀咲函菴咲スョ = -1; + + this.str迴セ蝨ィ縺ョ繝輔ぃ繧、繝ォ蜷 = strPreviewFilename; + this.tBGM繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(); + Trace.TraceInformation( "繝励Ξ繝薙Η繝シ繧オ繧ヲ繝ウ繝峨r逕滓舌@縺セ縺励◆縲({0})", strPreviewFilename ); + #region[ DTXMania(繧ウ繝。繝ウ繝医い繧ヲ繝) ] + //this.sound = CDTXMania.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧( strPreviewFilename ); + //this.sound.t蜀咲函繧帝幕蟋九☆繧( true ); + //this.str迴セ蝨ィ縺ョ繝輔ぃ繧、繝ォ蜷 = strPreviewFilename; + //this.tBGM繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(); + //Trace.TraceInformation( "繝励Ξ繝薙Η繝シ繧オ繧ヲ繝ウ繝峨r逕滓舌@縺セ縺励◆縲({0})", strPreviewFilename ); + #endregion + } + catch (Exception e) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "繝励Ξ繝薙Η繝シ繧オ繧ヲ繝ウ繝峨ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲({0})", strPreviewFilename ); + if( this.sound != null ) + { + this.sound.Dispose(); + } + this.sound = null; + } + } + } + private void t騾イ陦悟ヲ逅_繝励Ξ繝薙Η繝シ繧オ繧ヲ繝ウ繝() + { + if( ( this.ct蜀咲函蠕縺。繧ヲ繧ァ繧、繝 != null ) && !this.ct蜀咲函蠕縺。繧ヲ繧ァ繧、繝.b蛛懈ュ「荳ュ ) + { + this.ct蜀咲函蠕縺。繧ヲ繧ァ繧、繝.t騾イ陦(); + if( !this.ct蜀咲函蠕縺。繧ヲ繧ァ繧、繝.b邨ゆコ蛟、縺ォ驕斐@縺ヲ縺ェ縺 ) + { + this.ct蜀咲函蠕縺。繧ヲ繧ァ繧、繝.t蛛懈ュ「(); + if( !TJAPlayer3.stage驕ク譖イ.b繧ケ繧ッ繝ュ繝シ繝ォ荳ュ ) + { + this.t繝励Ξ繝薙Η繝シ繧オ繧ヲ繝ウ繝峨ョ菴懈(); + } + } + } + } + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/05.SongSelect/CActSelectQuickConfig.cs b/TJAPlayer3/Stages/05.SongSelect/CActSelectQuickConfig.cs new file mode 100644 index 00000000..0d94d716 --- /dev/null +++ b/TJAPlayer3/Stages/05.SongSelect/CActSelectQuickConfig.cs @@ -0,0 +1,273 @@ +サソusing System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using System.Drawing; +using System.IO; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActSelectQuickConfig : CActSelectPopupMenu + { + private readonly string QuickCfgTitle = "Quick Config"; + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CActSelectQuickConfig() + { + CActSelectQuickConfigMain(); + } + + private void CActSelectQuickConfigMain() + { +/* +窶「Target: Drums/Guitar/Bass +窶「Auto Mode: All ON/All OFF/CUSTOM +窶「Auto Lane: +窶「Scroll Speed: +窶「Play Speed: +窶「Risky: +窶「Hidden/Sudden: None/Hidden/Sudden/Both +窶「Conf SET: SET-1/SET-2/SET-3 +窶「More... +窶「EXIT +*/ + lci = new List>>(); // 縺薙ョ逕サ髱「縺ォ譚・繧句コヲ縺ォ縲√Γ繝九Η繝シ繧剃ス懊j逶エ縺吶 + for ( int nConfSet = 0; nConfSet < 3; nConfSet++ ) + { + lci.Add( new List>() ); // ConfSet逕ィ縺ョ3縺、蛻縺ョ譫縲 + for ( int nInst = 0; nInst < 3; nInst++ ) + { + lci[ nConfSet ].Add( null ); // Drum/Guitar/Bass縺ァ3縺、蛻縲∵棧繧剃ス懊▲縺ヲ縺翫¥ + lci[ nConfSet ][ nInst ] = MakeListCItemBase( nConfSet, nInst ); + } + } + base.Initialize( lci[ nCurrentConfigSet ][ 0 ], true, QuickCfgTitle, 0 ); // ConfSet=0, nInst=Drums + } + + private List MakeListCItemBase( int nConfigSet, int nInst ) + { + List l = new List(); + + #region [ 蜈ア騾 Target/AutoMode/AutoLane ] + #endregion + #region [ 蛟句挨 ScrollSpeed ] + l.Add( new CItemInteger( "縺ー縺縺昴¥", 0, 1999, TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ nInst ], + "貍泌・乗凾縺ョ繝峨Λ繝隴憺擇縺ョ繧ケ繧ッ繝ュ繝シ繝ォ縺ョ\n" + + "騾溷コヲ繧呈欠螳壹@縺セ縺吶\n" + + "x0.1 ス x200.0 繧呈欠螳壼庄閭ス縺ァ縺吶", + "To change the scroll speed for the\n" + + "drums lanes.\n" + + "You can set it from x0.5 to x1000.0.\n" + + "(ScrollSpeed=x0.5 means half speed)" ) ); + #endregion + #region [ 蜈ア騾 Dark/Risky/PlaySpeed ] + l.Add( new CItemInteger( "貍泌・城溷コヲ", 5, 400, TJAPlayer3.ConfigIni.n貍泌・城溷コヲ, + "譖イ縺ョ貍泌・城溷コヲ繧偵騾溘¥縺励◆繧企≦縺上@縺歃n" + + "繧翫☆繧九%縺ィ縺後〒縺阪∪縺吶\n" + + "シ遺サ荳驛ィ縺ョ繧オ繧ヲ繝ウ繝峨き繝シ繝峨〒縺ッ豁」縺励¥\n" + + "蜀咲函縺ァ縺阪↑縺蜿ッ閭ス諤ァ縺後≠繧翫∪縺吶ゑシ", + "It changes the song speed.\n" + + "For example, you can play in half\n" + + " speed by setting PlaySpeed = 0.500\n" + + " for your practice.\n" + + "Note: It also changes the songs' pitch." ) ); + #endregion + #region [ 蛟句挨 Sud/Hid ] + l.Add( new CItemList( "繝ゥ繝ウ繝繝", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, (int) TJAPlayer3.ConfigIni.eRandom.Taiko, + "縺繧上f繧九Λ繝ウ繝繝縲\n RANDOM: 縺。繧縺」縺ィ螟峨o繧欺n MIRROR: 縺ゅ∋縺薙∋ \n SUPER: 縺昴%縺昴%繝、繝舌>\n HYPER: 邨先ァ九Ζ繝舌>\n縺ェ縺翫∝ョ溯」縺ッ驕ゥ蠖薙↑讓。讒", + "Guitar chips come randomly.\n\n Part: swapping lanes randomly for each\n measures.\n Super: swapping chip randomly\n Hyper: swapping randomly\n (number of lanes also changes)", + new string[] { "OFF", "RANDOM", "縺ゅ∋縺薙∋", "SUPER", "HYPER" } ) ); + l.Add( new CItemList( "繝峨Ο繝ウ", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, (int) TJAPlayer3.ConfigIni.eSTEALTH, + "", + new string[] { "OFF", "繝峨Ο繝ウ", "繧ケ繝繝ォ繧ケ" } ) ); + l.Add( new CItemList( "繧イ繝シ繝", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, (int)TJAPlayer3.ConfigIni.eGameMode, + "繧イ繝シ繝繝「繝シ繝噂n" + + "TYPE-A: 螳瑚オー!蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ!\n" + + "TYPE-B: 螳瑚オー!蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ!(豼霎)\n" + + " \n", + " \n" + + " \n" + + " ", + new string[] { "OFF", "螳瑚オー!", "螳瑚オー!豼霎" }) ); + + l.Add(new CItemList(nameof(TJAPlayer3.ConfigIni.ShinuchiMode), CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, TJAPlayer3.ConfigIni.ShinuchiMode ? 1 : 0, "", "", new string[] { "OFF", "ON" })); + + #endregion + #region [ 蜈ア騾 SET蛻繧頑崛縺/More/Return ] + l.Add(new CItemInteger("PlayerCount", 1, 2, TJAPlayer3.ConfigIni.nPlayerCount, "繝励Ξ繧、繝、繝シ縺ョ莠コ謨ー繧呈欠螳壹@縺セ縺吶" ,"Set a player count.")); + l.Add( new CSwitchItemList( "More...", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, 0, "", "", new string[] { "" } ) ); + l.Add( new CSwitchItemList( "謌サ繧", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, 0, "", "", new string[] { "", "" } ) ); + #endregion + + return l; + } + + // 繝。繧ス繝繝 + public override void tActivatePopupMenu( E讌ス蝎ィ繝代シ繝 einst ) + { + this.CActSelectQuickConfigMain(); + base.tActivatePopupMenu( einst ); + } + //public void tDeativatePopupMenu() + //{ + // base.tDeativatePopupMenu(); + //} + + public override void t騾イ陦梧緒逕サsub() + { + + } + + public override void tEnter謚シ荳貴ain( int nSortOrder ) + { + switch ( n迴セ蝨ィ縺ョ驕ク謚櫁。 ) + { + case (int) EOrder.ScrollSpeed: + TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ nCurrentTarget ] = (int) GetObj迴セ蝨ィ蛟、( (int) EOrder.ScrollSpeed ); + break; + + case (int) EOrder.PlaySpeed: + TJAPlayer3.ConfigIni.n貍泌・城溷コヲ = (int) GetObj迴セ蝨ィ蛟、( (int) EOrder.PlaySpeed ); + break; + case (int) EOrder.Random: + TJAPlayer3.ConfigIni.eRandom.Taiko = (E繝ゥ繝ウ繝繝繝「繝シ繝)GetIndex( (int)EOrder.Random ); + break; + case (int) EOrder.Stealth: + TJAPlayer3.ConfigIni.eSTEALTH = (E繧ケ繝繝ォ繧ケ繝「繝シ繝)GetIndex( (int)EOrder.Stealth ); + break; + case (int) EOrder.GameMode: + EGame game = EGame.OFF; + switch( (int) GetIndex( (int) EOrder.GameMode ) ) + { + case 0: game = EGame.OFF; break; + case 1: game = EGame.螳瑚オー蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ; break; + case 2: game = EGame.螳瑚オー蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ豼霎; break; + } + TJAPlayer3.ConfigIni.eGameMode = game; + break; + case (int)EOrder.ShinuchiMode: + TJAPlayer3.ConfigIni.ShinuchiMode = !TJAPlayer3.ConfigIni.ShinuchiMode; + break; + case (int)EOrder.PlayerCount: + TJAPlayer3.ConfigIni.nPlayerCount = (int)GetObj迴セ蝨ィ蛟、((int) EOrder.PlayerCount ); + break; + case (int) EOrder.More: + SetAutoParameters(); // 邁。譏鼎ONFIG繝。繝九Η繝シ閼ア蜃コ縺ォ莨エ縺縲∫ー。譏鼎ONFIG蜀縺ョAUTO縺ョ險ュ螳壹rConfigIni繧ッ繝ゥ繧ケ縺ォ蜿肴丐縺吶k + this.bGotoDetailConfig = true; + this.tDeativatePopupMenu(); + break; + + case (int) EOrder.Return: + SetAutoParameters(); // 邁。譏鼎ONFIG繝。繝九Η繝シ閼ア蜃コ縺ォ莨エ縺縲∫ー。譏鼎ONFIG蜀縺ョAUTO縺ョ險ュ螳壹rConfigIni繧ッ繝ゥ繧ケ縺ォ蜿肴丐縺吶k + this.tDeativatePopupMenu(); + break; + default: + break; + } + } + + public override void tCancel() + { + SetAutoParameters(); + // Auto縺ョ險ュ螳壼、菫晄戟縺ョ繝ュ繧ク繝繧ッ繧呈嶌縺上%縺ィシ + // (Auto縺ョ繝代Λ繝。繝シ繧ソ蛻繧頑崛縺域凾縺ッ螳滄圀縺ォ蛟、險ュ螳壹@縺ヲ縺縺ェ縺縺溘a縲√く繝」繝ウ繧サ繝ォ縺セ縺溘ッRetern, More...譎ゅ↓蛟、險ュ螳壹☆繧句ソ隕∵怏繧) + } + + /// + /// 1縺、縺ョ蛟、繧偵∝ィtarget縺ォ驕ゥ逕ィ縺吶k縲3isky繧Дark縺ェ縺ゥ縲∝ィtatget縺ァ蜈ア騾壹ョ險ュ螳壹→縺ェ繧九b縺ョ縺ァ菴ソ縺縲 + /// + /// 險ュ螳夐逶ョ繝ェ繧ケ繝医ョ鬆逡ェ + /// 險ュ螳壼、(index) + private void SetValueToAllTarget( int order, int index ) + { + for ( int i = 0; i < 3; i++ ) + { + lci[ nCurrentConfigSet ][ i ][ order ].SetIndex( index ); + } + } + + + /// + /// ConfigIni.bAutoPlay縺ォ邁。譏鼎ONFIG縺ョ迥カ諷九r蜿肴丐縺吶k + /// + private void SetAutoParameters() + { + for ( int target = 0; target < 3; target++ ) + { + int[] pa = { (int) E繝ャ繝シ繝ウ.LC, (int) E繝ャ繝シ繝ウ.GtR, (int) E繝ャ繝シ繝ウ.BsR }; + int start = pa[ target ]; + } + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + this.ft陦ィ遉コ逕ィ繝輔か繝ウ繝 = new Font( "Arial", 26f, FontStyle.Bold, GraphicsUnit.Pixel ); + base.On豢サ諤ァ蛹(); + this.bGotoDetailConfig = false; + } + public override void On髱樊エサ諤ァ蛹() + { + if ( this.ft陦ィ遉コ逕ィ繝輔か繝ウ繝 != null ) + { + this.ft陦ィ遉コ逕ィ繝輔か繝ウ繝.Dispose(); + this.ft陦ィ遉コ逕ィ繝輔か繝ウ繝 = null; + } + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //string path繝代ロ繝ォ譛ャ菴 = CSkin.Path( @"Graphics\ScreenSelect popup auto settings.png" ); + //if ( File.Exists( path繝代ロ繝ォ譛ャ菴 ) ) + //{ + // this.tx繝代ロ繝ォ譛ャ菴 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( path繝代ロ繝ォ譛ャ菴, true ); + //} + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if ( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繝代ロ繝ォ譛ャ菴 ); + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx譁蟄怜励ヱ繝阪Ν ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + + #region [ private ] + //----------------- + private int nCurrentTarget = 0; + private int nCurrentConfigSet = 0; + private List>> lci; // DrGtBs, ConfSet, 驕ク謚櫁い荳隕ァ縲るス蜷医3谺。縺ョList縺ィ縺ェ繧九 + private enum EOrder : int + { + ScrollSpeed = 0, + PlaySpeed, + Random, + Stealth, + GameMode, + ShinuchiMode, + PlayerCount, + More, + Return, + END, + Default = 99 + }; + + private Font ft陦ィ遉コ逕ィ繝輔か繝ウ繝; + //private CTexture tx繝代ロ繝ォ譛ャ菴; + private CTexture tx譁蟄怜励ヱ繝阪Ν; + private CTexture tx隱ャ譏取枚1; + //----------------- + #endregion + } + + +} diff --git a/TJAPlayer3/Stages/05.SongSelect/CActSelectShowCurrentPosition.cs b/TJAPlayer3/Stages/05.SongSelect/CActSelectShowCurrentPosition.cs new file mode 100644 index 00000000..714adb6a --- /dev/null +++ b/TJAPlayer3/Stages/05.SongSelect/CActSelectShowCurrentPosition.cs @@ -0,0 +1,90 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Diagnostics; +using System.IO; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActSelectShowCurrentPosition : CActivity + { + // 繝。繧ス繝繝 + + public CActSelectShowCurrentPosition() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + if ( this.b豢サ諤ァ蛹悶@縺ヲ繧 ) + return; + + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if ( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + string pathScrollBar = CSkin.Path( @"Graphics\5_scrollbar.png" ); + string pathScrollPosition = CSkin.Path( @"Graphics\5_scrollbar.png" ); + if ( File.Exists( pathScrollBar ) ) + { + this.txScrollBar = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( pathScrollBar, false ); + } + if ( File.Exists( pathScrollPosition ) ) + { + this.txScrollPosition = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( pathScrollPosition, false ); + } + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if ( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k( ref this.txScrollBar ); + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k( ref this.txScrollPosition ); + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if ( this.txScrollBar != null ) + { + #region [ 繧ケ繧ッ繝ュ繝シ繝ォ繝舌シ縺ョ謠冗判 #27648 ] + //this.txScrollBar.t2D謠冗判( CDTXMania.app.Device, (int)(1280 - ((429.0f / 100.0f ) * CDTXMania.stage驕ク譖イ.ct逋サ蝣エ譎ゅい繝九Γ逕ィ蜈ア騾.n迴セ蝨ィ縺ョ蛟、)), 164, new Rectangle( 0, 0, 352, 26 ) ); //遘サ蜍募セ後ョx縺ッ851 + #endregion + #region [ 繧ケ繧ッ繝ュ繝シ繝ォ蝨ー轤ケ縺ョ謠冗判 (險育ョ励ッCActSelect譖イ繝ェ繧ケ繝医〒陦後≧縲ゅせ繧ッ繝ュ繝シ繝ォ菴咲スョ縺ィ驕ク譖イ鬆逶ョ縺ョ蜷梧悄縺ョ縺溘a縲)#27648 ] + int py = TJAPlayer3.stage驕ク譖イ.n繧ケ繧ッ繝ュ繝シ繝ォ繝舌シ逶ク蟇セy蠎ァ讓; + if( py <= 336 && py >= 0 ) + { + //this.txScrollBar.t2D謠冗判( CDTXMania.app.Device, (int)( 1280 - 4 - (( 424.0f / 100.0f ) * CDTXMania.stage驕ク譖イ.ct逋サ蝣エ譎ゅい繝九Γ逕ィ蜈ア騾.n迴セ蝨ィ縺ョ蛟、 ) ) + py, 164, new Rectangle( 352, 0, 26, 26 ) );//856 + } + #endregion + } + + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private CTexture txScrollPosition; + private CTexture txScrollBar; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/05.SongSelect/CActSelect繧ケ繝繝シ繧ソ繧ケ繝代ロ繝ォ.cs b/TJAPlayer3/Stages/05.SongSelect/CActSelect繧ケ繝繝シ繧ソ繧ケ繝代ロ繝ォ.cs new file mode 100644 index 00000000..833563d1 --- /dev/null +++ b/TJAPlayer3/Stages/05.SongSelect/CActSelect繧ケ繝繝シ繧ソ繧ケ繝代ロ繝ォ.cs @@ -0,0 +1,69 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActSelect繧ケ繝繝シ繧ソ繧ケ繝代ロ繝ォ : CActivity + { + // 繝。繧ス繝繝 + + public CActSelect繧ケ繝繝シ繧ソ繧ケ繝代ロ繝ォ() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + public void t驕ク謚樊峇縺悟、画峩縺輔l縺() + { + + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/05.SongSelect/CActSelect譖イ繝ェ繧ケ繝.cs b/TJAPlayer3/Stages/05.SongSelect/CActSelect譖イ繝ェ繧ケ繝.cs new file mode 100644 index 00000000..eb169cbb --- /dev/null +++ b/TJAPlayer3/Stages/05.SongSelect/CActSelect譖イ繝ェ繧ケ繝.cs @@ -0,0 +1,2300 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Globalization; +using System.Runtime.InteropServices; +using System.Drawing; +using System.Drawing.Imaging; +using System.Diagnostics; +using System.Drawing.Text; +using SlimDX; +using FDK; +using System.Linq; + +namespace TJAPlayer3 +{ + internal class CActSelect譖イ繝ェ繧ケ繝 : CActivity + { + // 繝励Ο繝代ユ繧」 + + public bool bIsEnumeratingSongs + { + get; + set; + } + public bool b繧ケ繧ッ繝ュ繝シ繝ォ荳ュ + { + get + { + if( this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ == 0 ) + { + return ( this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ != 0 ); + } + return true; + } + } + public int n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν + { + get; + private set; + } + public int n迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ縺ョ迴セ蝨ィ縺ョ髮」譏灘コヲ繝ャ繝吶Ν + { + get + { + return this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν縺ォ譛繧りソ代>髮」譏灘コヲ繝ャ繝吶Ν繧定ソ斐☆( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ ); + } + } + public C繧ケ繧ウ繧「 r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「 + { + get + { + if( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ != null ) + { + return this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.ar繧ケ繧ウ繧「[ this.n迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ縺ョ迴セ蝨ィ縺ョ髮」譏灘コヲ繝ャ繝吶Ν ]; + } + return null; + } + } + public C譖イ繝ェ繧ケ繝医ヮ繝シ繝 r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ + { + get; + private set; + } + + public int n繧ケ繧ッ繝ュ繝シ繝ォ繝舌シ逶ク蟇セy蠎ァ讓 + { + get; + private set; + } + + // t驕ク謚樊峇縺悟、画峩縺輔l縺()蜀縺ァ菴ソ縺縲∫峩蜑阪ョ驕ク譖イ縺ョ菫晄戟 + // (蜑阪→蜷後§譖イ縺ェ繧蛾∈謚樊峇螟画峩縺ォ謗帙°繧句崎ィ育ョ励r逵∫払縺励※鬮倬溷喧縺吶k縺溘a) + private C譖イ繝ェ繧ケ繝医ヮ繝シ繝 song_last = null; + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CActSelect譖イ繝ェ繧ケ繝() + { + #region[ 繝ャ繝吶Ν謨ー蟄 ] + ST繝ャ繝吶Ν謨ー蟄夕] st繝ャ繝吶Ν謨ー蟄輸r = new ST繝ャ繝吶Ν謨ー蟄夕10]; + ST繝ャ繝吶Ν謨ー蟄 st謨ー蟄0 = new ST繝ャ繝吶Ν謨ー蟄(); + ST繝ャ繝吶Ν謨ー蟄 st謨ー蟄1 = new ST繝ャ繝吶Ν謨ー蟄(); + ST繝ャ繝吶Ν謨ー蟄 st謨ー蟄2 = new ST繝ャ繝吶Ν謨ー蟄(); + ST繝ャ繝吶Ν謨ー蟄 st謨ー蟄3 = new ST繝ャ繝吶Ν謨ー蟄(); + ST繝ャ繝吶Ν謨ー蟄 st謨ー蟄4 = new ST繝ャ繝吶Ν謨ー蟄(); + ST繝ャ繝吶Ν謨ー蟄 st謨ー蟄5 = new ST繝ャ繝吶Ν謨ー蟄(); + ST繝ャ繝吶Ν謨ー蟄 st謨ー蟄6 = new ST繝ャ繝吶Ν謨ー蟄(); + ST繝ャ繝吶Ν謨ー蟄 st謨ー蟄7 = new ST繝ャ繝吶Ν謨ー蟄(); + ST繝ャ繝吶Ν謨ー蟄 st謨ー蟄8 = new ST繝ャ繝吶Ν謨ー蟄(); + ST繝ャ繝吶Ν謨ー蟄 st謨ー蟄9 = new ST繝ャ繝吶Ν謨ー蟄(); + + st謨ー蟄0.ch = '0'; + st謨ー蟄1.ch = '1'; + st謨ー蟄2.ch = '2'; + st謨ー蟄3.ch = '3'; + st謨ー蟄4.ch = '4'; + st謨ー蟄5.ch = '5'; + st謨ー蟄6.ch = '6'; + st謨ー蟄7.ch = '7'; + st謨ー蟄8.ch = '8'; + st謨ー蟄9.ch = '9'; + st謨ー蟄0.ptX = 0; + st謨ー蟄1.ptX = 21; + st謨ー蟄2.ptX = 42; + st謨ー蟄3.ptX = 63; + st謨ー蟄4.ptX = 84; + st謨ー蟄5.ptX = 105; + st謨ー蟄6.ptX = 126; + st謨ー蟄7.ptX = 147; + st謨ー蟄8.ptX = 168; + st謨ー蟄9.ptX = 189; + + st繝ャ繝吶Ν謨ー蟄輸r[0] = st謨ー蟄0; + st繝ャ繝吶Ν謨ー蟄輸r[1] = st謨ー蟄1; + st繝ャ繝吶Ν謨ー蟄輸r[2] = st謨ー蟄2; + st繝ャ繝吶Ν謨ー蟄輸r[3] = st謨ー蟄3; + st繝ャ繝吶Ν謨ー蟄輸r[4] = st謨ー蟄4; + st繝ャ繝吶Ν謨ー蟄輸r[5] = st謨ー蟄5; + st繝ャ繝吶Ν謨ー蟄輸r[6] = st謨ー蟄6; + st繝ャ繝吶Ν謨ー蟄輸r[7] = st謨ー蟄7; + st繝ャ繝吶Ν謨ー蟄輸r[8] = st謨ー蟄8; + st繝ャ繝吶Ν謨ー蟄輸r[9] = st謨ー蟄9; + this.st蟆乗枚蟄嶺ス咲スョ = st繝ャ繝吶Ν謨ー蟄輸r; + #endregion + + this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ = null; + this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν = TJAPlayer3.ConfigIni.nDefaultCourse; + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + this.bIsEnumeratingSongs = false; + } + + + // 繝。繧ス繝繝 + + public int n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν縺ォ譛繧りソ代>髮」譏灘コヲ繝ャ繝吶Ν繧定ソ斐☆( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 song ) + { + // 莠句燕繝√ぉ繝繧ッ縲 + + if( song == null ) + return this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν; // 譖イ縺後∪縺」縺溘¥縺ェ縺繧 + + if( song.ar繧ケ繧ウ繧「[ this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν ] != null ) + return this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν; // 髮」譏灘コヲ縺エ縺」縺溘j縺ョ譖イ縺後≠縺」縺溘h + + if( ( song.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX ) || ( song.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BACKBOX ) ) + return 0; // BOX 縺ィ BACKBOX 縺ッ髢「菫ら┌縺繧 + + + // 迴セ蝨ィ縺ョ繧「繝ウ繧ォ繝ャ繝吶Ν縺九i縲髮」譏灘コヲ荳雁髄縺阪↓讀懃エ「髢句ァ九 + + int n譛繧りソ代>繝ャ繝吶Ν = this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν; + + for( int i = 0; i < (int)Difficulty.Total; i++ ) + { + if( song.ar繧ケ繧ウ繧「[ n譛繧りソ代>繝ャ繝吶Ν ] != null ) + break; // 譖イ縺後≠縺」縺溘 + + n譛繧りソ代>繝ャ繝吶Ν = ( n譛繧りソ代>繝ャ繝吶Ν + 1 ) % (int)Difficulty.Total; // 譖イ縺後↑縺九▲縺溘ョ縺ァ谺。縺ョ髮」譏灘コヲ繝ャ繝吶Ν縺クGo縲ゑシ5莉・荳翫↓縺ェ縺」縺溘i0縺ォ謌サ繧九ゑシ + } + + + // 隕九▽縺九▲縺滓峇縺後い繝ウ繧ォ繧医j荳九ョ繝ャ繝吶Ν縺縺」縺溷エ蜷遺ヲ窶ヲ + // 繧「繝ウ繧ォ縺九i荳句髄縺阪↓讀懃エ「縺吶l縺ー縲√b縺」縺ィ繧「繝ウ繧ォ縺ォ霑代>譖イ縺後≠繧九s縺倥c縺ュシ + + if( n譛繧りソ代>繝ャ繝吶Ν < this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν ) + { + // 迴セ蝨ィ縺ョ繧「繝ウ繧ォ繝ャ繝吶Ν縺九i縲髮」譏灘コヲ荳句髄縺阪↓讀懃エ「髢句ァ九 + + n譛繧りソ代>繝ャ繝吶Ν = this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν; + + for( int i = 0; i < (int)Difficulty.Total; i++ ) + { + if( song.ar繧ケ繧ウ繧「[ n譛繧りソ代>繝ャ繝吶Ν ] != null ) + break; // 譖イ縺後≠縺」縺溘 + + n譛繧りソ代>繝ャ繝吶Ν = ( ( n譛繧りソ代>繝ャ繝吶Ν - 1 ) + (int)Difficulty.Total) % (int)Difficulty.Total; // 譖イ縺後↑縺九▲縺溘ョ縺ァ谺。縺ョ髮」譏灘コヲ繝ャ繝吶Ν縺クGo縲ゑシ0譛ェ貅縺ォ縺ェ縺」縺溘i4縺ォ謌サ繧九ゑシ + } + } + + return n譛繧りソ代>繝ャ繝吶Ν; + } + public C譖イ繝ェ繧ケ繝医ヮ繝シ繝 r謖螳壹&繧後◆譖イ縺悟ュ伜惠縺吶k繝ェ繧ケ繝医ョ蜈磯ュ縺ョ譖イ( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 song ) + { + List songList = GetSongListWithinMe( song ); + return ( songList == null ) ? null : songList[ 0 ]; + } + public C譖イ繝ェ繧ケ繝医ヮ繝シ繝 r謖螳壹&繧後◆譖イ縺悟ュ伜惠縺吶k繝ェ繧ケ繝医ョ譛ォ蟆セ縺ョ譖イ( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 song ) + { + List songList = GetSongListWithinMe( song ); + return ( songList == null ) ? null : songList[ songList.Count - 1 ]; + } + + private List GetSongListWithinMe( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 song ) + { + if ( song.r隕ェ繝弱シ繝 == null ) // root髫主ア、縺ョ繝弱シ繝医□縺」縺溘i + { + return TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝; // root縺ョ繝ェ繧ケ繝医r霑斐☆ + } + else + { + if ( ( song.r隕ェ繝弱シ繝.list蟄舌Μ繧ケ繝 != null ) && ( song.r隕ェ繝弱シ繝.list蟄舌Μ繧ケ繝.Count > 0 ) ) + { + return song.r隕ェ繝弱シ繝.list蟄舌Μ繧ケ繝; + } + else + { + return null; + } + } + } + + + public delegate void DGSortFunc( List songList, E讌ス蝎ィ繝代シ繝 eInst, int order, params object[] p); + /// + /// 荳サ縺ォCSong邂。逅.cs蜀縺ォ縺ゅk繧ス繝シ繝域ゥ溯ス繧偵‥elegate縺ァ蜻シ縺ウ蜃コ縺吶 + /// + /// 繧ス繝シ繝育畑縺ォ蜻シ縺ウ蜃コ縺吶Γ繧ス繝繝 + /// 繧ス繝シ繝亥渕貅悶→縺吶k讌ス蝎ィ + /// -1=髯埼, 1=譏鬆 + public void t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝( DGSortFunc sf, E讌ス蝎ィ繝代シ繝 eInst, int order, params object[] p ) + { + List songList = GetSongListWithinMe( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ ); + if ( songList == null ) + { + // 菴輔b縺励↑縺; + } + else + { +// CDTXMania.Songs邂。逅.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝3_貍泌・丞屓謨ー縺ョ螟壹>鬆( songList, eInst, order ); + sf( songList, eInst, order, p ); +// this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ = CDTXMania + this.t迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ繧貞縺ォ譖イ繝舌シ繧貞肴ァ区舌☆繧(); + } + } + + public bool tBOX縺ォ蜈・繧() + { + //Trace.TraceInformation( "box enter" ); + //Trace.TraceInformation( "Skin迴セ蝨ィCurrent : " + CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ); + //Trace.TraceInformation( "Skin迴セ蝨ィSystem : " + CSkin.strSystemSkinSubfolderFullName ); + //Trace.TraceInformation( "Skin迴セ蝨ィBoxDef : " + CSkin.strBoxDefSkinSubfolderFullName ); + //Trace.TraceInformation( "Skin迴セ蝨ィ: " + CSkin.GetSkinName( CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ) ); + //Trace.TraceInformation( "Skin迴セpt: " + CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ); + //Trace.TraceInformation( "Skin謖螳: " + CSkin.GetSkinName( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strSkinPath ) ); + //Trace.TraceInformation( "Skinpath: " + this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strSkinPath ); + bool ret = false; + if (CSkin.GetSkinName(TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName(false)) != CSkin.GetSkinName(this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strSkinPath) + && CSkin.bUseBoxDefSkin) + { + ret = true; + // BOX縺ォ蜈・繧九→縺阪ッ縲√せ繧ュ繝ウ螟画峩逋コ逕滓凾縺ョ縺ソboxdef繧ケ繧ュ繝ウ險ュ螳壹ョ譖エ譁ー繧定。後≧ + TJAPlayer3.Skin.SetCurrentSkinSubfolderFullName( + TJAPlayer3.Skin.GetSkinSubfolderFullNameFromSkinName(CSkin.GetSkinName(this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strSkinPath)), false); + } + + //Trace.TraceInformation( "Skin螟画峩: " + CSkin.GetSkinName( CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ) ); + //Trace.TraceInformation( "Skin螟画峩Current : "+ CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ); + //Trace.TraceInformation( "Skin螟画峩System : "+ CSkin.strSystemSkinSubfolderFullName ); + //Trace.TraceInformation( "Skin螟画峩BoxDef : "+ CSkin.strBoxDefSkinSubfolderFullName ); + if(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.list蟄舌Μ繧ケ繝.Count != 1) + { + List list = TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝; + list.InsertRange(list.IndexOf(this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ) + 1, this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.list蟄舌Μ繧ケ繝); + int n蝗樊焚 = this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.Openindex; + for (int index = 0; index <= n蝗樊焚; index++) + this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ = this.r谺。縺ョ譖イ(this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ); + list.RemoveAt(list.IndexOf(this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.r隕ェ繝弱シ繝)); + this.t迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ繧貞縺ォ譖イ繝舌シ繧貞肴ァ区舌☆繧(); + this.t驕ク謚樊峇縺悟、画峩縺輔l縺(false); + TJAPlayer3.stage驕ク譖イ.t驕ク謚樊峇螟画峩騾夂衍(); // #27648 鬆逶ョ謨ー螟画峩繧貞渚譏縺輔○繧 + this.b驕ク謚樊峇縺悟、画峩縺輔l縺 = true; + TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「.t蛛懈ュ「縺吶k(); + } + return ret; + } + public bool tBOX繧貞コ繧() + { +//Trace.TraceInformation( "box exit" ); +//Trace.TraceInformation( "Skin迴セ蝨ィCurrent : " + CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ); +//Trace.TraceInformation( "Skin迴セ蝨ィSystem : " + CSkin.strSystemSkinSubfolderFullName ); +//Trace.TraceInformation( "Skin迴セ蝨ィBoxDef : " + CSkin.strBoxDefSkinSubfolderFullName ); +//Trace.TraceInformation( "Skin迴セ蝨ィ: " + CSkin.GetSkinName( CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ) ); +//Trace.TraceInformation( "Skin迴セpt: " + CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ); +//Trace.TraceInformation( "Skin謖螳: " + CSkin.GetSkinName( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strSkinPath ) ); +//Trace.TraceInformation( "Skinpath: " + this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strSkinPath ); + bool ret = false; + if ( CSkin.GetSkinName( TJAPlayer3.Skin.GetCurrentSkinSubfolderFullName( false ) ) != CSkin.GetSkinName( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strSkinPath ) + && CSkin.bUseBoxDefSkin ) + { + ret = true; + } + // 繧ケ繧ュ繝ウ螟画峩縺檎匱逕溘@縺ェ縺上※繧ゅ|oxdef蝨丞、悶↓蜃コ繧句エ蜷医ッ縲|oxdef繧ケ繧ュ繝ウ險ュ螳壹ョ譖エ譁ー縺悟ソ隕 + // (繝ヲ繝シ繧カ繝シ縺恵oxdef繧ケ繧ュ繝ウ繧辰onfig謖螳壹@縺ヲ縺繧句エ蜷医∈縺ョ蟇セ蠢懊ョ縺溘a縺ォ蠢隕) + // tBox縺ォ蜈・繧()縺ィ縺ッ蜃ヲ逅縺悟セョ螯吶↓逡ー縺ェ繧九ョ縺ァ豕ィ諢 + TJAPlayer3.Skin.SetCurrentSkinSubfolderFullName( + ( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strSkinPath == "" ) ? "" : TJAPlayer3.Skin.GetSkinSubfolderFullNameFromSkinName( CSkin.GetSkinName( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strSkinPath ) ), false ); + //Trace.TraceInformation( "SKIN螟画峩: " + CSkin.GetSkinName( CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ) ); + //Trace.TraceInformation( "SKIN螟画峩Current : "+ CDTXMania.Skin.GetCurrentSkinSubfolderFullName(false) ); + //Trace.TraceInformation( "SKIN螟画峩System : "+ CSkin.strSystemSkinSubfolderFullName ); + //Trace.TraceInformation( "SKIN螟画峩BoxDef : "+ CSkin.strBoxDefSkinSubfolderFullName ); + + List list = TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝; + list.Insert(list.IndexOf(this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ) + 1, this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.r隕ェ繝弱シ繝); + this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.r隕ェ繝弱シ繝.Openindex = r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.r隕ェ繝弱シ繝.list蟄舌Μ繧ケ繝.IndexOf(this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ); + this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ = this.r谺。縺ョ譖イ(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ); + for (int index = 0; index < list.Count; index++) + { + if (this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.list蟄舌Μ繧ケ繝.Contains(list[index])) + { + list.RemoveAt(index); + index--; + } + } + this.t迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ繧貞縺ォ譖イ繝舌シ繧貞肴ァ区舌☆繧(); + this.t驕ク謚樊峇縺悟、画峩縺輔l縺(false); // #27648 鬆逶ョ謨ー螟画峩繧貞渚譏縺輔○繧 + this.b驕ク謚樊峇縺悟、画峩縺輔l縺 = true; + + return ret; + } + public void t迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ繧貞縺ォ譖イ繝舌シ繧貞肴ァ区舌☆繧() + { + this.t繝舌シ縺ョ蛻晄悄蛹(); + } + public void t谺。縺ォ遘サ蜍() + { + if( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ != null ) + { + ctScoreFrameAnime.t蛛懈ュ「(); + ctScoreFrameAnime.n迴セ蝨ィ縺ョ蛟、 = 0; + ctBarOpen.t蛛懈ュ「(); + ctBarOpen.n迴セ蝨ィ縺ョ蛟、 = 0; + this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ += 100; + } + this.b驕ク謚樊峇縺悟、画峩縺輔l縺 = true; + } + public void t蜑阪↓遘サ蜍() + { + if( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ != null ) + { + ctScoreFrameAnime.t蛛懈ュ「(); + ctScoreFrameAnime.n迴セ蝨ィ縺ョ蛟、 = 0; + ctBarOpen.t蛛懈ュ「(); + ctBarOpen.n迴セ蝨ィ縺ョ蛟、 = 0; + this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ -= 100; + } + this.b驕ク謚樊峇縺悟、画峩縺輔l縺 = true; + } + public void t髮」譏灘コヲ繝ャ繝吶Ν繧偵イ縺ィ縺、騾イ繧√k() + { + if( ( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ == null ) || ( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.n繧ケ繧ウ繧「謨ー <= 1 ) ) + return; // 譖イ縺ォ繧ケ繧ウ繧「縺鯉シ撰ス橸シ大九@縺九↑縺縺ェ繧蛾イ繧√k諢丞袖縺ェ縺励 + + + // 髮」譏灘コヲ繝ャ繝吶Ν繧抵シ具シ代@縲∫樟蝨ィ驕ク譖イ荳ュ縺ョ繧ケ繧ウ繧「繧貞、画峩縺吶k縲 + + this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν = this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν縺ォ譛繧りソ代>髮」譏灘コヲ繝ャ繝吶Ν繧定ソ斐☆( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ ); + + for( int i = 0; i < (int)Difficulty.Total; i++ ) + { + this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν = ( this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν + 1 ) % (int)Difficulty.Total; // シ穂サ・荳翫↓縺ェ縺」縺溘iシ舌↓謌サ繧九 + if( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.ar繧ケ繧ウ繧「[ this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν ] != null ) // 譖イ縺悟ュ伜惠縺励※繧九↑繧峨%縺薙〒邨ゆコ縲ょュ伜惠縺励※縺ェ縺縺ェ繧画ャ。縺ョ繝ャ繝吶Ν縺クGo縲 + break; + } + + + // 譖イ豈弱↓陦ィ遉コ縺励※縺繧九せ繧ュ繝ォ蛟、繧偵∵眠縺励>髮」譏灘コヲ繝ャ繝吶Ν縺ォ蜷医o縺帙※蜿門セ励@逶エ縺吶ゑシ郁。ィ遉コ縺輔l縺ヲ縺繧13譖イ蜈ィ驛ィ縲ゑシ + + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 song = this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ; + for( int i = 0; i < 4; i++ ) + song = this.r蜑阪ョ譖イ( song ); + + for( int i = this.n迴セ蝨ィ縺ョ驕ク謚櫁。 - 4; i < ( ( this.n迴セ蝨ィ縺ョ驕ク謚櫁。 - 4 ) + 9 ); i++ ) + { + int index = ( i + 9 ) % 9; + for( int m = 0; m < 3; m++ ) + { + this.st繝舌シ諠蝣ア[ index ].n繧ケ繧ュ繝ォ蛟、[ m ] = (int) song.ar繧ケ繧ウ繧「[ this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν縺ォ譛繧りソ代>髮」譏灘コヲ繝ャ繝吶Ν繧定ソ斐☆( song ) ].隴憺擇諠蝣ア.譛螟ァ繧ケ繧ュ繝ォ[ m ]; + } + song = this.r谺。縺ョ譖イ( song ); + } + + + // 驕ク譖イ繧ケ繝繝シ繧ク縺ォ螟画峩騾夂衍繧堤匱蜃コ縺励髢「菫Activity縺ョ蟇セ蠢懊r陦後▲縺ヲ繧ゅi縺縲 + + TJAPlayer3.stage驕ク譖イ.t驕ク謚樊峇螟画峩騾夂衍(); + } + /// + /// 荳堺セソ縺縺」縺溘°繧我ス懊▲縺溘 + /// + public void t髮」譏灘コヲ繝ャ繝吶Ν繧偵イ縺ィ縺、謌サ縺() + { + if( ( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ == null ) || ( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.n繧ケ繧ウ繧「謨ー <= 1 ) ) + return; // 譖イ縺ォ繧ケ繧ウ繧「縺鯉シ撰ス橸シ大九@縺九↑縺縺ェ繧蛾イ繧√k諢丞袖縺ェ縺励 + + + // 髮」譏灘コヲ繝ャ繝吶Ν繧抵シ具シ代@縲∫樟蝨ィ驕ク譖イ荳ュ縺ョ繧ケ繧ウ繧「繧貞、画峩縺吶k縲 + + this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν = this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν縺ォ譛繧りソ代>髮」譏灘コヲ繝ャ繝吶Ν繧定ソ斐☆( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ ); + + this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν--; + if( this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν < 0 ) // 0繧医j荳九↓縺ェ縺」縺溘i4縺ォ謌サ縺吶 + { + this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν = 4; + } + + //2016.08.13 kairera0467 縺九s縺溘s隴憺擇縺檎┌縺隴憺擇(縺オ縺、縺縲√縺壹°縺励>縺ョ縺ソ)縺ァ縲髮」譏灘コヲ繧呈怙荳贋ス阪↓謌サ縺帙↑縺荳榊キ蜷医ョ菫ョ豁」縲 + bool bLabel0NotFound = true; + for( int i = this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν; i >= 0; i-- ) + { + if( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.ar繧ケ繧ウ繧「[ i ] != null ) + { + this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν = i; + bLabel0NotFound = false; + break; + } + } + if( bLabel0NotFound ) + { + for( int i = 4; i >= 0; i-- ) + { + if( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.ar繧ケ繧ウ繧「[ i ] != null ) + { + this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν = i; + break; + } + } + } + + // 譖イ豈弱↓陦ィ遉コ縺励※縺繧九せ繧ュ繝ォ蛟、繧偵∵眠縺励>髮」譏灘コヲ繝ャ繝吶Ν縺ォ蜷医o縺帙※蜿門セ励@逶エ縺吶ゑシ郁。ィ遉コ縺輔l縺ヲ縺繧13譖イ蜈ィ驛ィ縲ゑシ + + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 song = this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ; + for( int i = 0; i < 4; i++ ) + song = this.r蜑阪ョ譖イ( song ); + + for( int i = this.n迴セ蝨ィ縺ョ驕ク謚櫁。 - 4; i < ( ( this.n迴セ蝨ィ縺ョ驕ク謚櫁。 - 4 ) + 9 ); i++ ) + { + int index = ( i + 9 ) % 9; + for( int m = 0; m < 3; m++ ) + { + this.st繝舌シ諠蝣ア[ index ].n繧ケ繧ュ繝ォ蛟、[ m ] = (int) song.ar繧ケ繧ウ繧「[ this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν縺ォ譛繧りソ代>髮」譏灘コヲ繝ャ繝吶Ν繧定ソ斐☆( song ) ].隴憺擇諠蝣ア.譛螟ァ繧ケ繧ュ繝ォ[ m ]; + } + song = this.r谺。縺ョ譖イ( song ); + } + + + // 驕ク譖イ繧ケ繝繝シ繧ク縺ォ螟画峩騾夂衍繧堤匱蜃コ縺励髢「菫Activity縺ョ蟇セ蠢懊r陦後▲縺ヲ繧ゅi縺縲 + + TJAPlayer3.stage驕ク譖イ.t驕ク謚樊峇螟画峩騾夂衍(); + } + + + /// + /// 譖イ繝ェ繧ケ繝医r繝ェ繧サ繝繝医☆繧 + /// + /// + public void Refresh(CSongs邂。逅 cs, bool bRemakeSongTitleBar ) // #26070 2012.2.28 yyagi + { +// this.On髱樊エサ諤ァ蛹(); + + if ( cs != null && cs.list譖イ繝ォ繝シ繝.Count > 0 ) // 譁ー縺励>譖イ繝ェ繧ケ繝医r讀懃エ「縺励※縲1譖イ莉・荳翫≠縺」縺 + { + TJAPlayer3.Songs邂。逅 = cs; + + if ( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ != null ) // r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ==null 縺ィ縺ッ縲√梧怙蛻捏onglist.db縺檎┌縺九▲縺 or 讀懃エ「縺励◆縺1譖イ繧ゅ↑縺縲 + { + this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ = searchCurrentBreadcrumbsPosition( TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝, this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strBreadcrumbs ); + if ( bRemakeSongTitleBar ) // 驕ク譖イ逕サ髱「莉・螟悶↓螻繧九→縺阪↓縺ッ蜀肴ァ区舌@縺ェ縺 (髱樊エサ諤ァ蛹悶@縺ヲ縺繧九→縺阪↓螳溯。後☆繧九→萓句、悶→縺ェ繧) + { + this.t迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ繧貞縺ォ譖イ繝舌シ繧貞肴ァ区舌☆繧(); + } + return; + } + } + if (this.b豢サ諤ァ蛹悶@縺ヲ繧) + { + this.On髱樊エサ諤ァ蛹(); + this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ = null; + this.On豢サ諤ァ蛹(); + } + } + + + /// + /// 迴セ蝨ィ驕ク譖イ縺励※縺繧倶ス咲スョ繧呈、懃エ「縺吶k + /// (譖イ荳隕ァ繧ッ繝ゥ繧ケ繧呈眠縺励>繧ゅョ縺ォ蜈・繧梧崛縺医k髫帙↓逕ィ縺繧) + /// + /// 讀懃エ「蟇セ雎。縺ョList + /// 讀懃エ「縺吶k繝代Φ縺上★繝ェ繧ケ繝(譁蟄怜) + /// + private C譖イ繝ェ繧ケ繝医ヮ繝シ繝 searchCurrentBreadcrumbsPosition( List ln, string bc ) + { + foreach (C譖イ繝ェ繧ケ繝医ヮ繝シ繝 n in ln) + { + if ( n.strBreadcrumbs == bc ) + { + return n; + } + else if ( n.list蟄舌Μ繧ケ繝 != null && n.list蟄舌Μ繧ケ繝.Count > 0 ) // 蟄舌Μ繧ケ繝医′蟄伜惠縺吶k縺ェ繧峨∝榊クー縺ァ謗「縺 + { + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 r = searchCurrentBreadcrumbsPosition( n.list蟄舌Μ繧ケ繝, bc ); + if ( r != null ) return r; + } + } + return null; + } + + /// + /// BOX縺ョ繧「繧、繝繝謨ー縺ィ縲∽サ贋ス慕分逶ョ繧帝∈謚槭@縺ヲ縺繧九°繧偵そ繝繝医☆繧 + /// + public void t驕ク謚樊峇縺悟、画峩縺輔l縺( bool bForce ) // #27648 + { + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 song = TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ; + if ( song == null ) + return; + if ( song == song_last && bForce == false ) + return; + + song_last = song; + List list =TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝; + int index = list.IndexOf( song ) + 1; + if ( index <= 0 ) + { + nCurrentPosition = nNumOfItems = 0; + } + else + { + nCurrentPosition = index; + nNumOfItems = list.Count; + } + TJAPlayer3.stage驕ク譖イ.act貍泌・丞ア・豁エ繝代ロ繝ォ.tSongChange(); + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + if( this.b豢サ諤ァ蛹悶@縺ヲ繧 ) + return; + + if (!bFirstCrownLoad) + { + + for (int i = 0; i < ScoreRankCount.Length; i++) + ScoreRankCount[i] = 0; + + for (int i = 0; i < CrownCount.Length; i++) + CrownCount[i] = 0; + + foreach (var song in TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝) + { + if (song.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX) + { + for (int i = 0; i < ScoreRankCount.Length; i++) + { + ScoreRankCount[i] += song.list蟄舌Μ繧ケ繝.Where(a => a.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE && a.ar繧ケ繧ウ繧「[3] != null && a.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[3] == (i + 1)).Count(); + ScoreRankCount[i] += song.list蟄舌Μ繧ケ繝.Where(a => a.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE && a.ar繧ケ繧ウ繧「[3] != null && a.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[4] == (i + 1)).Count(); + } + for (int i = 0; i < CrownCount.Length; i++) + { + CrownCount[i] += song.list蟄舌Μ繧ケ繝.Where(a => a.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE && a.ar繧ケ繧ウ繧「[3] != null && a.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ッ繝ェ繧「[3] == (i + 1)).Count(); + CrownCount[i] += song.list蟄舌Μ繧ケ繝.Where(a => a.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE && a.ar繧ケ繧ウ繧「[3] != null && a.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ッ繝ェ繧「[4] == (i + 1)).Count(); + } + } + else + { + if (song.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE) + { + for (int i = 0; i < ScoreRankCount.Length; i++) + { + ScoreRankCount[i] += TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝.Where(a => a.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE && a.ar繧ケ繧ウ繧「[3] != null && a.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[3] == (i + 1)).Count(); + ScoreRankCount[i] += TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝.Where(a => a.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE && a.ar繧ケ繧ウ繧「[3] != null && a.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[4] == (i + 1)).Count(); + } + for (int i = 0; i < CrownCount.Length; i++) + { + CrownCount[i] += TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝.Where(a => a.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE && a.ar繧ケ繧ウ繧「[3] != null && a.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ッ繝ェ繧「[3] == (i + 1)).Count(); + CrownCount[i] += TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝.Where(a => a.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE && a.ar繧ケ繧ウ繧「[3] != null && a.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ッ繝ェ繧「[4] == (i + 1)).Count(); + } + } + } + } + + bFirstCrownLoad = true; + + } + + TJAPlayer3.IsPerformingCalibration = false; + + TJAPlayer3.stage驕ク譖イ.act髮」譏灘コヲ驕ク謚樒判髱「.bIsDifficltSelect = false; + + if (!string.IsNullOrEmpty(TJAPlayer3.ConfigIni.FontName)) + { + this.pfBoxName = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), 28); + this.pfMusicName = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), 22); + this.pfSubtitle = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), 13); + } + else + { + this.pfBoxName = new CPrivateFastFont(new FontFamily("MS UI Gothic"), 28); + this.pfMusicName = new CPrivateFastFont(new FontFamily("MS UI Gothic"), 22); + this.pfSubtitle = new CPrivateFastFont(new FontFamily("MS UI Gothic"), 13); + } + + if(!string.IsNullOrEmpty(TJAPlayer3.ConfigIni.BoxFontName)) + this.pfBoxText = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.BoxFontName), 14); + else + this.pfBoxText = new CPrivateFastFont(new FontFamily("MS UI Gothic"), 14); + + + this.b逋サ蝣エ繧「繝九Γ蜈ィ驛ィ螳御コ = false; + this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ = 0; + this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ = 0; + this.n繧ケ繧ッ繝ュ繝シ繝ォ繧ソ繧、繝 = -1; + + // 繝輔か繝ウ繝井ス懈舌 + // 譖イ繝ェ繧ケ繝域枚蟄励ッシ貞搾シ磯擇遨搾シ泌搾シ峨〒繝繧ッ繧ケ繝√Ε縺ォ謠冗判縺励※縺九i邵ョ蟆剰。ィ遉コ縺吶k縺ョ縺ァ縲√ヵ繧ゥ繝ウ繝医し繧、繧コ縺ッシ貞阪→縺吶k縲 + + FontStyle regular = FontStyle.Regular; + this.ft譖イ繝ェ繧ケ繝育畑繝輔か繝ウ繝 = new Font( TJAPlayer3.ConfigIni.FontName, 40f, regular, GraphicsUnit.Pixel ); + + // 迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ縺後↑縺シ茨シ昴ッ縺倥a縺ヲ縺ョ豢サ諤ァ蛹厄シ峨↑繧峨∫樟蝨ィ驕ク謚樔クュ縺ョ譖イ繧偵Ν繝シ繝医ョ蜈磯ュ繝弱シ繝峨↓險ュ螳壹☆繧九 + + if( ( this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ == null ) && ( TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝.Count > 0 ) ) + this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ = TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝[ 0 ]; + + this.t繝舌シ縺ョ蛻晄悄蛹(); + + this.ctBarOpen = new CCounter(); + this.ctBoxOpen = new CCounter(); + this.ctDifficultyIn = new CCounter(); + + this.ct荳芽ァ堤泙蜊ー繧「繝九Γ = new CCounter(); + + this.ctBarFlash = new CCounter(); + + this.ctScoreFrameAnime = new CCounter(); + + if (this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ != null) + { + for (int i = 0; i < 3; i++) + { + using (var texture = pfBoxText.DrawPrivateFont(this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strBoxText[i], r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.ForeColor, r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.BackColor, 26)) + { + this.txBoxText[i] = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(texture); + this.strBoxText = this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strBoxText[0] + this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strBoxText[1] + this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strBoxText[2]; + } + } + } + else + { + strBoxText = "null"; + } + + base.On豢サ諤ァ蛹(); + + this.t驕ク謚樊峇縺悟、画峩縺輔l縺(true); // #27648 2012.3.31 yyagi 驕ク譖イ逕サ髱「縺ォ蜈・縺」縺溽峩蠕後ョ 迴セ蝨ィ菴咲スョ/蜈ィ繧「繧、繝繝謨ー 縺ョ陦ィ遉コ繧呈ュ」縺励¥陦後≧縺溘a + } + public override void On髱樊エサ諤ァ蛹() + { + if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return; + + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k(ref pfBoxName); + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k(ref pfMusicName); + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k(ref pfSubtitle); + + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k( ref this.ft譖イ繝ェ繧ケ繝育畑繝輔か繝ウ繝 ); + + this.ct荳芽ァ堤泙蜊ー繧「繝九Γ = null; + + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return; + + for( int i = 0; i < 9; i++ ) + { + this.st繝舌シ諠蝣ア[ i ].ttk繧ソ繧、繝医Ν = this.ttk譖イ蜷阪ユ繧ッ繧ケ繝√Ε繧堤函謌舌☆繧( this.st繝舌シ諠蝣ア[ i ].str繧ソ繧、繝医Ν譁蟄怜, this.st繝舌シ諠蝣ア[i].ForeColor, this.st繝舌シ諠蝣ア[i].BackColor, st繝舌シ諠蝣ア[i].e繝舌シ遞ョ蛻・ == E繝舌シ遞ョ蛻・.Box ? this.pfBoxName : this.pfMusicName); + } + + int c = ( CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "ja" ) ? 0 : 1; + + #region [ Songs not found逕サ蜒 ] + try + { + using( Bitmap image = new Bitmap( 640, 128 ) ) + using( Graphics graphics = Graphics.FromImage( image ) ) + { + string[] s1 = { "譖イ繝繝シ繧ソ縺瑚ヲ九▽縺九j縺セ縺帙s縲", "Songs not found." }; + string[] s2 = { "譖イ繝繝シ繧ソ繧奪TXManiaGR.exe莉・荳九ョ", "You need to install songs." }; + string[] s3 = { "繝輔か繝ォ繝縺ォ繧、繝ウ繧ケ繝医シ繝ォ縺励※荳九&縺縲", "" }; + graphics.DrawString( s1[c], this.ft譖イ繝ェ繧ケ繝育畑繝輔か繝ウ繝, Brushes.DarkGray, (float) 2f, (float) 2f ); + graphics.DrawString( s1[c], this.ft譖イ繝ェ繧ケ繝育畑繝輔か繝ウ繝, Brushes.White, (float) 0f, (float) 0f ); + graphics.DrawString( s2[c], this.ft譖イ繝ェ繧ケ繝育畑繝輔か繝ウ繝, Brushes.DarkGray, (float) 2f, (float) 44f ); + graphics.DrawString( s2[c], this.ft譖イ繝ェ繧ケ繝育畑繝輔か繝ウ繝, Brushes.White, (float) 0f, (float) 42f ); + graphics.DrawString( s3[c], this.ft譖イ繝ェ繧ケ繝育畑繝輔か繝ウ繝, Brushes.DarkGray, (float) 2f, (float) 86f ); + graphics.DrawString( s3[c], this.ft譖イ繝ェ繧ケ繝育畑繝輔か繝ウ繝, Brushes.White, (float) 0f, (float) 84f ); + + this.txSongNotFound = new CTexture( TJAPlayer3.app.Device, image, TJAPlayer3.TextureFormat ); + + this.txSongNotFound.vc諡。螟ァ邵ョ蟆丞咲紫 = new Vector3( 0.5f, 0.5f, 1f ); // 蜊雁縺ョ繧オ繧、繧コ縺ァ陦ィ遉コ縺吶k縲 + } + } + catch( CTextureCreateFailedException e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "SoungNotFound繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲" ); + this.txSongNotFound = null; + } + #endregion + #region [ "譖イ繝繝シ繧ソ繧呈、懃エ「縺励※縺縺セ縺"逕サ蜒 ] + try + { + using ( Bitmap image = new Bitmap( 640, 96 ) ) + using ( Graphics graphics = Graphics.FromImage( image ) ) + { + string[] s1 = { "譖イ繝繝シ繧ソ繧呈、懃エ「縺励※縺縺セ縺吶", "Now enumerating songs." }; + string[] s2 = { "縺昴ョ縺セ縺セ縺励ー繧峨¥縺雁セ縺。荳九&縺縲", "Please wait..." }; + graphics.DrawString( s1[c], this.ft譖イ繝ェ繧ケ繝育畑繝輔か繝ウ繝, Brushes.DarkGray, (float) 2f, (float) 2f ); + graphics.DrawString( s1[c], this.ft譖イ繝ェ繧ケ繝育畑繝輔か繝ウ繝, Brushes.White, (float) 0f, (float) 0f ); + graphics.DrawString( s2[c], this.ft譖イ繝ェ繧ケ繝育畑繝輔か繝ウ繝, Brushes.DarkGray, (float) 2f, (float) 44f ); + graphics.DrawString( s2[c], this.ft譖イ繝ェ繧ケ繝育畑繝輔か繝ウ繝, Brushes.White, (float) 0f, (float) 42f ); + + this.txEnumeratingSongs = new CTexture( TJAPlayer3.app.Device, image, TJAPlayer3.TextureFormat ); + + this.txEnumeratingSongs.vc諡。螟ァ邵ョ蟆丞咲紫 = new Vector3( 0.5f, 0.5f, 1f ); // 蜊雁縺ョ繧オ繧、繧コ縺ァ陦ィ遉コ縺吶k縲 + } + } + catch ( CTextureCreateFailedException e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "txEnumeratingSongs繝繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲" ); + this.txEnumeratingSongs = null; + } + #endregion + #region [ 譖イ謨ー陦ィ遉コ ] + //this.tx繧「繧、繝繝謨ー謨ー蟄 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\ScreenSelect skill number on gauge etc.png" ), false ); + #endregion + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return; + + for( int i = 0; i < 9; i++ ) + { + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.st繝舌シ諠蝣ア[ i ].tx繧ソ繧、繝医Ν蜷 ); + this.st繝舌シ諠蝣ア[ i ].ttk繧ソ繧、繝医Ν = null; + } + + ClearTitleTextureCache(); + + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txEnumeratingSongs ); + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txSongNotFound ); + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + public override int On騾イ陦梧緒逕サ() + { + if (this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + return 0; + + #region [ 蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ] + //----------------- + if (this.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ) + { + this.n繧ケ繧ッ繝ュ繝シ繝ォ繧ソ繧、繝 = (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + TJAPlayer3.stage驕ク譖イ.t驕ク謚樊峇螟画峩騾夂衍(); + + ctBarOpen.t髢句ァ(0, 260, 2, TJAPlayer3.Timer); + this.ct荳芽ァ堤泙蜊ー繧「繝九Γ.t髢句ァ(0, 1000, 1, TJAPlayer3.Timer); + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + //----------------- + #endregion + + ctBarFlash.t騾イ陦(); + ctBoxOpen.t騾イ陦(); + ctBarOpen.t騾イ陦(); + ctDifficultyIn.t騾イ陦(); + + int BarAnimeCount = this.ctBarOpen.n迴セ蝨ィ縺ョ蛟、 <= 200 ? 0 : (int)(Math.Sin(((this.ctBarOpen.n迴セ蝨ィ縺ョ蛟、 - 200) * 1.5f) * (Math.PI / 180)) * 62.0f); + + if (BarAnimeCount == 62) + ctScoreFrameAnime.t騾イ陦鍬oop(); + + // 縺セ縺驕ク謚樔クュ縺ョ譖イ縺梧アコ縺セ縺」縺ヲ縺ェ縺代l縺ー縲∵峇繝繝ェ繝シ繝ォ繝シ繝医ョ譛蛻昴ョ譖イ縺ォ繧サ繝繝医☆繧九 + + if ((this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ == null) && (TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝.Count > 0)) + this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ = TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝[0]; + + // 謠冗判縲 + if (this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ == null) + { + #region [ 譖イ縺鯉シ代▽繧ゅ↑縺縺ェ繧峨郡ongs not found.縲阪r陦ィ遉コ縺励※縺薙%縺ァ蟶ー繧後] + //----------------- + if (bIsEnumeratingSongs) + { + if (this.txEnumeratingSongs != null) + { + this.txEnumeratingSongs.t2D謠冗判(TJAPlayer3.app.Device, 320, 160); + } + } + else + { + if (this.txSongNotFound != null) + this.txSongNotFound.t2D謠冗判(TJAPlayer3.app.Device, 320, 160); + } + //----------------- + #endregion + + return 0; + } + + // 譛ャ繧ケ繝繝シ繧ク縺ッ縲(1)逋サ蝣エ繧「繝九Γ繝輔ぉ繝シ繧コ 竊 (2)騾壼クク繝輔ぉ繝シ繧コ縲縺ィ莠梧ョオ髫弱↓繧上¢縺ヲ騾イ繧縲 + + if (strBoxText != r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strBoxText[0] + r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strBoxText[1] + r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strBoxText[2]) + { + for (int i = 0; i < 3; i++) + { + using (var texture = pfBoxText.DrawPrivateFont(this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strBoxText[i], r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.ForeColor, r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.BackColor, 26)) + { + this.txBoxText[i] = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(texture); + this.strBoxText = this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strBoxText[0] + this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strBoxText[1] + this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.strBoxText[2]; + } + } + } + + + // 騾イ陦後 + if (n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ == 0) ct荳芽ァ堤泙蜊ー繧「繝九Γ.t騾イ陦鍬oop(); + else ct荳芽ァ堤泙蜊ー繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、 = 0; + + { + #region [ (2) 騾壼クク繝輔ぉ繝シ繧コ縺ョ騾イ陦後] + //----------------- + long n迴セ蝨ィ譎ょ綾 = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾; + + if (n迴セ蝨ィ譎ょ綾 < this.n繧ケ繧ッ繝ュ繝シ繝ォ繧ソ繧、繝) // 蠢オ縺ョ縺溘a + this.n繧ケ繧ッ繝ュ繝シ繝ォ繧ソ繧、繝 = n迴セ蝨ィ譎ょ綾; + + const int n繧「繝九Γ髢馴囈 = 2; + while ((n迴セ蝨ィ譎ょ綾 - this.n繧ケ繧ッ繝ュ繝シ繝ォ繧ソ繧、繝) >= n繧「繝九Γ髢馴囈) + { + int n蜉騾溷コヲ = 1; + int n谿玖キ晞屬 = Math.Abs((int)(this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ - this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ)); + + #region [ 谿玖キ晞屬縺碁□縺縺サ縺ゥ繧ケ繧ッ繝ュ繝シ繝ォ繧帝溘¥縺吶kシ茨シ拵蜉騾溷コヲ繧貞、壹¥縺吶kシ峨] + //----------------- + if (n谿玖キ晞屬 <= 10) + { + n蜉騾溷コヲ = 1; + } + else if (n谿玖キ晞屬 <= 100) + { + n蜉騾溷コヲ = 2; + } + else if (n谿玖キ晞屬 <= 300) + { + n蜉騾溷コヲ = 3; + } + else if (n谿玖キ晞屬 <= 500) + { + n蜉騾溷コヲ = 4; + } + else + { + n蜉騾溷コヲ = 650; + } + //----------------- + #endregion + + #region [ 蜉騾溷コヲ繧貞刈邂励@縲∫樟蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ繧堤岼讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ縺セ縺ァ霑代▼縺代k縲 ] + //----------------- + if (this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ < this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ) // (A) 豁」縺ョ譁ケ蜷代↓譛ェ驕斐ョ蝣エ蜷茨シ + { + this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ += n蜉騾溷コヲ; // 繧ォ繧ヲ繝ウ繧ソ繧呈ュ」譁ケ蜷代↓遘サ蜍輔☆繧九 + + if (this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ > this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ) + this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ = this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ; // 蛻ー逹シ√せ繧ッ繝ュ繝シ繝ォ蛛懈ュ「シ + } + + else if (this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ > this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ) // (B) 雋縺ョ譁ケ蜷代↓譛ェ驕斐ョ蝣エ蜷茨シ + { + this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ -= n蜉騾溷コヲ; // 繧ォ繧ヲ繝ウ繧ソ繧定イ譁ケ蜷代↓遘サ蜍輔☆繧九 + + if (this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ < this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ) // 蛻ー逹シ√せ繧ッ繝ュ繝シ繝ォ蛛懈ュ「シ + this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ = this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ; + } + //----------------- + #endregion + + if (this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ >= 100) // シ題。鯉シ100繧ォ繧ヲ繝ウ繝医 + { + #region [ 繝代ロ繝ォ繧抵シ題。御ク翫↓繧キ繝輔ヨ縺吶k縲] + //----------------- + + // 驕ク謚樊峇縺ィ驕ク謚櫁。後rシ代▽荳九ョ陦後↓遘サ蜍輔 + + this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ = this.r谺。縺ョ譖イ(this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ); + this.n迴セ蝨ィ縺ョ驕ク謚櫁。 = (this.n迴セ蝨ィ縺ョ驕ク謚櫁。 + 1) % 9; + + // 驕ク謚樊峇縺九iシ励▽荳九ョ繝代ロ繝ォシ茨シ晄眠縺励¥譛荳矩Κ縺ォ陦ィ遉コ縺輔l繧九ヱ繝阪Ν縲よカ医∴縺ヲ縺励∪縺荳逡ェ荳翫ョ繝代ロ繝ォ繧貞榊茜逕ィ縺吶kシ峨↓縲∵眠縺励>譖イ縺ョ諠蝣ア繧定ィ倩シ峨☆繧九 + + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 song = this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ; + for (int i = 0; i < 4; i++) + song = this.r谺。縺ョ譖イ(song); + + int index = (this.n迴セ蝨ィ縺ョ驕ク謚櫁。 + 4) % 9; // 譁ー縺励¥譛荳矩Κ縺ォ陦ィ遉コ縺輔l繧九ヱ繝阪Ν縺ョ繧、繝ウ繝繝繧ッ繧ケシ0ス12シ峨 + this.st繝舌シ諠蝣ア[index].str繧ソ繧、繝医Ν譁蟄怜 = song.str繧ソ繧、繝医Ν; + this.st繝舌シ諠蝣ア[index].ForeColor = song.ForeColor; + this.st繝舌シ諠蝣ア[index].BackColor = song.BackColor; + this.st繝舌シ諠蝣ア[index].str繧ク繝」繝ウ繝ォ = song.str繧ク繝」繝ウ繝ォ; + this.st繝舌シ諠蝣ア[index].str繧オ繝悶ち繧、繝医Ν = song.str繧オ繝悶ち繧、繝医Ν; + this.st繝舌シ諠蝣ア[index].ar髮」譏灘コヲ = song.nLevel; + for (int f = 0; f < (int)Difficulty.Total; f++) + { + if (song.ar繧ケ繧ウ繧「[f] != null) + this.st繝舌シ諠蝣ア[index].b蛻蟯 = song.ar繧ケ繧ウ繧「[f].隴憺擇諠蝣ア.b隴憺擇蛻蟯; + } + + if (st繝舌シ諠蝣ア[index].n繧ッ繝ェ繧「 == null) + this.st繝舌シ諠蝣ア[index].n繧ッ繝ェ繧「 = new int[5]; + if (st繝舌シ諠蝣ア[index].n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ == null) + this.st繝舌シ諠蝣ア[index].n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ = new int[5]; + + if (song.ar繧ケ繧ウ繧「[3] != null) + { + this.st繝舌シ諠蝣ア[index].n繧ッ繝ェ繧「 = song.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ッ繝ェ繧「; + this.st繝舌シ諠蝣ア[index].n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ = song.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ; + } + + // st繝舌シ諠蝣ア[] 縺ョ蜀螳ケ繧1陦後★縺、縺壹i縺吶 + + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 song2 = this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ; + for (int i = 0; i < 4; i++) + song2 = this.r蜑阪ョ譖イ(song2); + + for (int i = 0; i < 9; i++) + { + int n = (((this.n迴セ蝨ィ縺ョ驕ク謚櫁。 - 4) + i) + 9) % 9; + this.st繝舌シ諠蝣ア[n].e繝舌シ遞ョ蛻・ = this.e譖イ縺ョ繝舌シ遞ョ蛻・繧定ソ斐☆(song2); + song2 = this.r谺。縺ョ譖イ(song2); + this.st繝舌シ諠蝣ア[n].ttk繧ソ繧、繝医Ν = this.ttk譖イ蜷阪ユ繧ッ繧ケ繝√Ε繧堤函謌舌☆繧(this.st繝舌シ諠蝣ア[n].str繧ソ繧、繝医Ν譁蟄怜, this.st繝舌シ諠蝣ア[n].ForeColor, this.st繝舌シ諠蝣ア[n].BackColor, st繝舌シ諠蝣ア[n].e繝舌シ遞ョ蛻・ == E繝舌シ遞ョ蛻・.Box ? this.pfBoxName : this.pfMusicName); + } + + + // 譁ー縺励¥譛荳矩Κ縺ォ陦ィ遉コ縺輔l繧九ヱ繝阪Ν逕ィ縺ョ繧ケ繧ュ繝ォ蛟、繧貞叙蠕励 + + for (int i = 0; i < 3; i++) + this.st繝舌シ諠蝣ア[index].n繧ケ繧ュ繝ォ蛟、[i] = (int)song.ar繧ケ繧ウ繧「[this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν縺ォ譛繧りソ代>髮」譏灘コヲ繝ャ繝吶Ν繧定ソ斐☆(song)].隴憺擇諠蝣ア.譛螟ァ繧ケ繧ュ繝ォ[i]; + + + // 1陦(100繧ォ繧ヲ繝ウ繝)遘サ蜍募ョ御コ縲 + + this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ -= 100; + this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ -= 100; + + this.t驕ク謚樊峇縺悟、画峩縺輔l縺(false); // 繧ケ繧ッ繝ュ繝シ繝ォ繝舌シ逕ィ縺ォ莉贋ス慕分逶ョ繧帝∈謚槭@縺ヲ縺繧九°繧呈峩譁ー + + + + if (this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ == 0) + { + TJAPlayer3.stage驕ク譖イ.t驕ク謚樊峇螟画峩騾夂衍(); // 繧ケ繧ッ繝ュ繝シ繝ォ螳御コシ晞∈謚樊峇螟画峩シ + ctBarOpen.t髢句ァ(0, 260, 2, TJAPlayer3.Timer); + TJAPlayer3.stage驕ク譖イ.NowGenre = this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ; + ctScoreFrameAnime.t髢句ァ(0, 6000, 1, TJAPlayer3.Timer); + } + + //----------------- + #endregion + } + else if (this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ <= -100) + { + #region [ 繝代ロ繝ォ繧抵シ題。御ク九↓繧キ繝輔ヨ縺吶k縲] + //----------------- + + // 驕ク謚樊峇縺ィ驕ク謚櫁。後rシ代▽荳翫ョ陦後↓遘サ蜍輔 + + this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ = this.r蜑阪ョ譖イ(this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ); + this.n迴セ蝨ィ縺ョ驕ク謚櫁。 = ((this.n迴セ蝨ィ縺ョ驕ク謚櫁。 - 1) + 9) % 9; + + + // 驕ク謚樊峇縺九iシ輔▽荳翫ョ繝代ロ繝ォシ茨シ晄眠縺励¥譛荳企Κ縺ォ陦ィ遉コ縺輔l繧九ヱ繝阪Ν縲よカ医∴縺ヲ縺励∪縺荳逡ェ荳九ョ繝代ロ繝ォ繧貞榊茜逕ィ縺吶kシ峨↓縲∵眠縺励>譖イ縺ョ諠蝣ア繧定ィ倩シ峨☆繧九 + + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 song = this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ; + for (int i = 0; i < 4; i++) + song = this.r蜑阪ョ譖イ(song); + + int index = ((this.n迴セ蝨ィ縺ョ驕ク謚櫁。 - 4) + 9) % 9; // 譁ー縺励¥譛荳企Κ縺ォ陦ィ遉コ縺輔l繧九ヱ繝阪Ν縺ョ繧、繝ウ繝繝繧ッ繧ケシ0ス12シ峨 + this.st繝舌シ諠蝣ア[index].str繧ソ繧、繝医Ν譁蟄怜 = song.str繧ソ繧、繝医Ν; + this.st繝舌シ諠蝣ア[index].ForeColor = song.ForeColor; + this.st繝舌シ諠蝣ア[index].BackColor = song.BackColor; + this.st繝舌シ諠蝣ア[index].str繧オ繝悶ち繧、繝医Ν = song.str繧オ繝悶ち繧、繝医Ν; + this.st繝舌シ諠蝣ア[index].str繧ク繝」繝ウ繝ォ = song.str繧ク繝」繝ウ繝ォ; + this.st繝舌シ諠蝣ア[index].ar髮」譏灘コヲ = song.nLevel; + for (int f = 0; f < (int)Difficulty.Total; f++) + { + if (song.ar繧ケ繧ウ繧「[f] != null) + this.st繝舌シ諠蝣ア[index].b蛻蟯 = song.ar繧ケ繧ウ繧「[f].隴憺擇諠蝣ア.b隴憺擇蛻蟯; + } + + if (st繝舌シ諠蝣ア[index].n繧ッ繝ェ繧「 == null) + this.st繝舌シ諠蝣ア[index].n繧ッ繝ェ繧「 = new int[5]; + if (st繝舌シ諠蝣ア[index].n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ == null) + this.st繝舌シ諠蝣ア[index].n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ = new int[5]; + + if (song.ar繧ケ繧ウ繧「[3] != null) + { + this.st繝舌シ諠蝣ア[index].n繧ッ繝ェ繧「 = song.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ッ繝ェ繧「; + this.st繝舌シ諠蝣ア[index].n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ = song.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ; + } + + // st繝舌シ諠蝣ア[] 縺ョ蜀螳ケ繧1陦後★縺、縺壹i縺吶 + + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 song2 = this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ; + for (int i = 0; i < 4; i++) + song2 = this.r蜑阪ョ譖イ(song2); + + for (int i = 0; i < 9; i++) + { + int n = (((this.n迴セ蝨ィ縺ョ驕ク謚櫁。 - 4) + i) + 9) % 9; + this.st繝舌シ諠蝣ア[n].e繝舌シ遞ョ蛻・ = this.e譖イ縺ョ繝舌シ遞ョ蛻・繧定ソ斐☆(song2); + song2 = this.r谺。縺ョ譖イ(song2); + this.st繝舌シ諠蝣ア[n].ttk繧ソ繧、繝医Ν = this.ttk譖イ蜷阪ユ繧ッ繧ケ繝√Ε繧堤函謌舌☆繧(this.st繝舌シ諠蝣ア[n].str繧ソ繧、繝医Ν譁蟄怜, this.st繝舌シ諠蝣ア[n].ForeColor, this.st繝舌シ諠蝣ア[n].BackColor, st繝舌シ諠蝣ア[n].e繝舌シ遞ョ蛻・ == E繝舌シ遞ョ蛻・.Box ? this.pfBoxName : this.pfMusicName); + } + + + // 譁ー縺励¥譛荳企Κ縺ォ陦ィ遉コ縺輔l繧九ヱ繝阪Ν逕ィ縺ョ繧ケ繧ュ繝ォ蛟、繧貞叙蠕励 + + for (int i = 0; i < 3; i++) + this.st繝舌シ諠蝣ア[index].n繧ケ繧ュ繝ォ蛟、[i] = (int)song.ar繧ケ繧ウ繧「[this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν縺ォ譛繧りソ代>髮」譏灘コヲ繝ャ繝吶Ν繧定ソ斐☆(song)].隴憺擇諠蝣ア.譛螟ァ繧ケ繧ュ繝ォ[i]; + + + // 1陦(100繧ォ繧ヲ繝ウ繝)遘サ蜍募ョ御コ縲 + + this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ += 100; + this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ += 100; + + this.t驕ク謚樊峇縺悟、画峩縺輔l縺(false); // 繧ケ繧ッ繝ュ繝シ繝ォ繝舌シ逕ィ縺ォ莉贋ス慕分逶ョ繧帝∈謚槭@縺ヲ縺繧九°繧呈峩譁ー + + this.ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ譖イ蜷 = null; + this.ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ繧オ繝悶ち繧、繝医Ν = null; + + if (this.n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ == 0) + { + TJAPlayer3.stage驕ク譖イ.t驕ク謚樊峇螟画峩騾夂衍(); // 繧ケ繧ッ繝ュ繝シ繝ォ螳御コシ晞∈謚樊峇螟画峩シ + ctBarOpen.t髢句ァ(0, 260, 2, TJAPlayer3.Timer); + TJAPlayer3.stage驕ク譖イ.NowGenre = this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ; + ctScoreFrameAnime.t髢句ァ(0, 6000, 1, TJAPlayer3.Timer); + } + //----------------- + #endregion + } + + if (this.b驕ク謚樊峇縺悟、画峩縺輔l縺 && n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ == 0) + { + if (this.ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ譖イ蜷 != null) + { + this.ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ譖イ蜷 = null; + this.b驕ク謚樊峇縺悟、画峩縺輔l縺 = false; + } + if (this.ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ繧オ繝悶ち繧、繝医Ν != null) + { + this.ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ繧オ繝悶ち繧、繝医Ν = null; + this.b驕ク謚樊峇縺悟、画峩縺輔l縺 = false; + } + } + this.n繧ケ繧ッ繝ュ繝シ繝ォ繧ソ繧、繝 += n繧「繝九Γ髢馴囈; + } + //----------------- + #endregion + } + + int i驕ク譖イ繝舌シX蠎ァ讓 = 673; //驕ク譖イ繝舌シ縺ョ蠎ァ讓咏畑 + int i驕ク謚樊峇繝舌シX蠎ァ讓 = 665; //驕ク謚樊峇繝舌シ縺ョ蠎ァ讓咏畑 + + #region [ (2) 騾壼クク繝輔ぉ繝シ繧コ縺ョ謠冗判縲] + //----------------- + for (int i = 0; i < 9; i++) // 繝代ロ繝ォ縺ッ蜈ィ13譫壹 + { + if ((i == 0 && this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ > 0) || // 譛荳願。後ッ縲∽ク翫↓遘サ蜍穂クュ縺ェ繧芽。ィ遉コ縺励↑縺縲 + (i == 8 && this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ < 0)) // 譛荳玖。後ッ縲∽ク九↓遘サ蜍穂クュ縺ェ繧芽。ィ遉コ縺励↑縺縲 + continue; + + int n繝代ロ繝ォ逡ェ蜿キ = (((this.n迴セ蝨ィ縺ョ驕ク謚櫁。 - 4) + i) + 9) % 9; + int n隕九◆逶ョ縺ョ陦檎分蜿キ = i; + int n谺。縺ョ繝代ロ繝ォ逡ェ蜿キ = (this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ <= 0) ? ((i + 1) % 9) : (((i - 1) + 9) % 9); + int x = i驕ク譖イ繝舌シX蠎ァ讓; + int xAnime = this.pt繝舌シ縺ョ蠎ァ讓兌n隕九◆逶ョ縺ョ陦檎分蜿キ].X + ((int)((this.pt繝舌シ縺ョ蠎ァ讓兌n谺。縺ョ繝代ロ繝ォ逡ェ蜿キ].X - this.pt繝舌シ縺ョ蠎ァ讓兌n隕九◆逶ョ縺ョ陦檎分蜿キ].X) * (((double)Math.Abs(this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ)) / 100.0))); + int y = this.pt繝舌シ縺ョ蠎ァ讓兌n隕九◆逶ョ縺ョ陦檎分蜿キ].Y + ((int)((this.pt繝舌シ縺ョ蠎ァ讓兌n谺。縺ョ繝代ロ繝ォ逡ェ蜿キ].Y - this.pt繝舌シ縺ョ蠎ァ讓兌n隕九◆逶ョ縺ョ陦檎分蜿キ].Y) * (((double)Math.Abs(this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ)) / 100.0))); + + // (B) 繧ケ繧ッ繝ュ繝シ繝ォ荳ュ縺ョ驕ク謚樊峇繝舌シ縲√∪縺溘ッ縺昴ョ莉悶ョ繝舌シ縺ョ謠冗判縲 + + float Box = 0; + + #region [ BoxOpenAnime ] + + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 560 + 1000) + { + if (i == 1) + { + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 1000 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 360 + 1000) + Box = 400.0f - (float)Math.Sin(((ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1000) / 4 + 90) * (Math.PI / 180)) * 400.0f; + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 360 + 1000) + Box = 400.0f; + } + if (i == 2) + { + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 75 + 1000 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 435 + 1000) + Box = 500.0f - (float)Math.Sin(((ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1075) / 4 + 90) * (Math.PI / 180)) * 500.0f; + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 435 + 1000) + Box = 500.0f; + } + if (i == 3) + { + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 150 + 1000 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 510 + 1000) + Box = 600.0f - (float)Math.Sin(((ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1150) / 4 + 90) * (Math.PI / 180)) * 600.0f; + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 510 + 1000) + Box = 600.0f; + } + if (i == 5) + { + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 150 + 1000 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 510 + 1000) + Box = -600.0f + (float)Math.Sin(((ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1150) / 4 + 90) * (Math.PI / 180)) * 600.0f; + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 510 + 1000) + Box = 600.0f; + } + if (i == 6) + { + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 75 + 1000 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 435 + 1000) + Box = -500.0f + (float)Math.Sin(((ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1075) / 4 + 90) * (Math.PI / 180)) * 500.0f; + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 435 + 1000) + Box = 500.0f; + } + if (i == 7) + { + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 1000 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 360 + 1000) + Box = -400.0f + (float)Math.Sin(((ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1000) / 4 + 90) * (Math.PI / 180)) * 400.0f; + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 360 + 1000) + Box = 400.0f; + } + } + + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 > 1300 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 < 1940) + { + ctBoxOpen.t髢馴囈蛟、螟画峩(0.65); + if (i == 1) + Box = 600.0f; + if (i == 2) + Box = 600.0f; + if (i == 3) + Box = 600.0f; + if (i == 5) + Box = -600.0f; + if (i == 6) + Box = -600.0f; + if (i == 7) + Box = -600.0f; + } + + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 1840 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 560 + 1840) + { + ctBoxOpen.t髢馴囈蛟、螟画峩(1.3); + if (i == 1) + { + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 100 + 1840 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 460 + 1840) + Box = 600.0f - (float)Math.Sin(((ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1940) / 4) * (Math.PI / 180)) * 600.0f; + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 < 100 + 1840) + Box = 600.0f; + } + if (i == 2) + { + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 50 + 1840 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 410 + 1840) + Box = 500.0f - (float)Math.Sin(((ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1890) / 4) * (Math.PI / 180)) * 500.0f; + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 < 50 + 1840) + Box = 600.0f; + } + if (i == 3) + { + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 1840 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 360 + 1840) + Box = 400.0f - (float)Math.Sin(((ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1840) / 4) * (Math.PI / 180)) * 400.0f; + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 < 1840) + Box = 600.0f; + } + if (i == 5) + { + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 1840 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 360 + 1840) + Box = -400.0f + (float)Math.Sin(((ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1840) / 4) * (Math.PI / 180)) * 400.0f; + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 < 1840) + Box = -600.0f; + } + if (i == 6) + { + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 50 + 1840 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 410 + 1840) + Box = -500.0f + (float)Math.Sin(((ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1890) / 4) * (Math.PI / 180)) * 500.0f; + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 < 50 + 1840) + Box = -600.0f; + } + if (i == 7) + { + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 100 + 1840 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 460 + 1840) + Box = -600.0f + (float)Math.Sin(((ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1940) / 4) * (Math.PI / 180)) * 600.0f; + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 < 100 + 1840) + Box = -600.0f; + } + } + + #endregion + + + #region [ 繝舌シ繝繧ッ繧ケ繝√Ε繧呈緒逕サ縲] + //----------------- + TJAPlayer3.Tx.SongSelect_Bar_Genre[nStr繧ク繝」繝ウ繝ォtoNum(st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].str繧ク繝」繝ウ繝ォ)].vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + TJAPlayer3.Tx.SongSelect_Bar_Genre_Back.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + + if (n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ != 0) + this.t繧ク繝」繝ウ繝ォ蛻・驕ク謚槭&繧後※縺縺ェ縺譖イ繝舌シ縺ョ謠冗判(xAnime - (int)Box, y - ((int)Box * 3), this.st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].str繧ク繝」繝ウ繝ォ, st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].e繝舌シ遞ョ蛻・, st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].n繧ッ繝ェ繧「, st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ); + else if (n隕九◆逶ョ縺ョ陦檎分蜿キ != 4) + this.t繧ク繝」繝ウ繝ォ蛻・驕ク謚槭&繧後※縺縺ェ縺譖イ繝舌シ縺ョ謠冗判(xAnime - (int)Box, y - ((int)Box * 3), this.st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].str繧ク繝」繝ウ繝ォ, st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].e繝舌シ遞ョ蛻・, st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].n繧ッ繝ェ繧「, st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ); + //----------------- + #endregion + + #region [ 繧ソ繧、繝医Ν蜷阪ユ繧ッ繧ケ繝√Ε繧呈緒逕サ縲] + if (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 >= 1000 && TJAPlayer3.stage驕ク譖イ.act髮」譏灘コヲ驕ク謚樒判髱「.bIsDifficltSelect) + ResolveTitleTexture(this.st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].ttk繧ソ繧、繝医Ν).Opacity = (int)255.0f - (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1000); + else + ResolveTitleTexture(this.st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].ttk繧ソ繧、繝医Ν).Opacity = 255; + + if (n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ != 0) + ResolveTitleTexture(this.st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].ttk繧ソ繧、繝医Ν).t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, xAnime + 316 - Box + TJAPlayer3.Skin.SongSelect_Title_X, y + 59 - (Box * 3) + TJAPlayer3.Skin.SongSelect_Title_Y); + else if (n隕九◆逶ョ縺ョ陦檎分蜿キ != 4) + ResolveTitleTexture(this.st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].ttk繧ソ繧、繝医Ν).t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, xAnime + 316 - Box + TJAPlayer3.Skin.SongSelect_Title_X, y + 62 - (Box * 3) + TJAPlayer3.Skin.SongSelect_Title_Y); + #endregion + + //----------------- + } + #endregion + + if (this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ == 0) + { + #region [ Draw BarCenter ] + + #region [ Bar_Select ] + + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 1300 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 1940) + TJAPlayer3.Tx.SongSelect_Bar_Select.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f - (float)Math.Sin(((ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1300) * 0.28125f) * (Math.PI / 180)) * 1.0f; + else + TJAPlayer3.Tx.SongSelect_Bar_Select.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + + + if (ctBarFlash.b邨ゆコ蛟、縺ォ驕斐@縺 && !TJAPlayer3.stage驕ク譖イ.act髮」譏灘コヲ驕ク謚樒判髱「.bIsDifficltSelect) + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(BarAnimeCount * 4.25f); + else + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.n迴セ蝨ィ縺ョ蛟、 - 700) * 2.55f); + + TJAPlayer3.Tx.SongSelect_Bar_Select.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 322 - BarAnimeCount, new Rectangle(0, 0, 662, 40)); + + TJAPlayer3.Tx.SongSelect_Bar_Select.vc諡。螟ァ邵ョ蟆丞咲紫.Y = BarAnimeCount == 0 ? 0.2f : 0.2f + (float)(BarAnimeCount * 0.012f); + TJAPlayer3.Tx.SongSelect_Bar_Select.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 360, new Rectangle(0, 40, 662, 172)); + TJAPlayer3.Tx.SongSelect_Bar_Select.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + + TJAPlayer3.Tx.SongSelect_Bar_Select.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 398 + BarAnimeCount, new Rectangle(0, 208, 662, 43)); + + #region [ BarFlash ] + + if (ctBarFlash.n迴セ蝨ィ縺ョ蛟、 <= 100) + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(ctBarFlash.n迴セ蝨ィ縺ョ蛟、 * 2.55f); + else if (ctBarFlash.n迴セ蝨ィ縺ョ蛟、 <= 200) + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.n迴セ蝨ィ縺ョ蛟、 - 100) * 2.55f); + else if (ctBarFlash.n迴セ蝨ィ縺ョ蛟、 <= 300) + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)((ctBarFlash.n迴セ蝨ィ縺ョ蛟、 - 200) * 2.55f); + else if (ctBarFlash.n迴セ蝨ィ縺ョ蛟、 <= 400) + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.n迴セ蝨ィ縺ョ蛟、 - 300) * 2.55f); + else if (ctBarFlash.n迴セ蝨ィ縺ョ蛟、 <= 500) + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)((ctBarFlash.n迴セ蝨ィ縺ョ蛟、 - 400) * 2.55f); + else if (ctBarFlash.n迴セ蝨ィ縺ョ蛟、 <= 600) + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.n迴セ蝨ィ縺ョ蛟、 - 500) * 2.55f); + else if (ctBarFlash.n迴セ蝨ィ縺ョ蛟、 <= 700) + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)((ctBarFlash.n迴セ蝨ィ縺ョ蛟、 - 600) * 2.55f); + else if (ctBarFlash.n迴セ蝨ィ縺ョ蛟、 <= 800) + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = (int)(255 - (ctBarFlash.n迴セ蝨ィ縺ョ蛟、 - 700) * 2.55f); + else + TJAPlayer3.Tx.SongSelect_Bar_Select.Opacity = 0; + + TJAPlayer3.Tx.SongSelect_Bar_Select.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 360, new Rectangle(0, 251, 662, 251)); + + #endregion + + #endregion + + if (r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE) + { + #region [ Score ] + + #region [ Bar ] + + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 1300 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 1940) + { + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f - (float)Math.Sin(((ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1300) * 0.28125f) * (Math.PI / 180)) * 1.0f; + TJAPlayer3.Tx.SongSelect_Bar_Genre[nStr繧ク繝」繝ウ繝ォtoNum(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f - (float)Math.Sin(((ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1300) * 0.28125f) * (Math.PI / 180)) * 1.0f; + } + else + { + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + TJAPlayer3.Tx.SongSelect_Bar_Genre[nStr繧ク繝」繝ウ繝ォtoNum(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + } + + TJAPlayer3.Tx.SongSelect_Bar_Genre[nStr繧ク繝」繝ウ繝ォtoNum(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 326 - BarAnimeCount, new Rectangle(0, 0, 632, 21)); + + TJAPlayer3.Tx.SongSelect_Bar_Genre[nStr繧ク繝」繝ウ繝ォtoNum(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].vc諡。螟ァ邵ョ蟆丞咲紫.Y = BarAnimeCount == 0 ? 1.0f : 1.0f + (float)(BarAnimeCount) / 23.6f; + TJAPlayer3.Tx.SongSelect_Bar_Genre[nStr繧ク繝」繝ウ繝ォtoNum(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 360, new Rectangle(0, 21, 632, 48)); + TJAPlayer3.Tx.SongSelect_Bar_Genre[nStr繧ク繝」繝ウ繝ォtoNum(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + + TJAPlayer3.Tx.SongSelect_Bar_Genre[nStr繧ク繝」繝ウ繝ォtoNum(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 394 + BarAnimeCount, new Rectangle(0, 69, 632, 23)); + + if (BarAnimeCount != 0) + { + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 326 - BarAnimeCount, new Rectangle(0, 0, 632, 21)); + + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.vc諡。螟ァ邵ョ蟆丞咲紫.Y = BarAnimeCount == 0 ? 1.0f : 1.0f + (float)(BarAnimeCount) / 24.5f; + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 359, new Rectangle(0, 21, 632, 48)); + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 394 + BarAnimeCount, new Rectangle(0, 69, 632, 23)); + } + else + { + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 360, new Rectangle(0, 0, 632, 92)); + } + #endregion + + #region [ Crown and ScoreRank ] + + if (this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.ar繧ケ繧ウ繧「[3] != null) + { + var 繧ッ繝ェ繧「 = this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ッ繝ェ繧「; + var 繧ケ繧ウ繧「繝ゥ繝ウ繧ッ = this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ; + + TJAPlayer3.Tx.SongSelect_Crown.vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.8f + BarAnimeCount / 620f; + TJAPlayer3.Tx.SongSelect_Crown.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.8f + BarAnimeCount / 620f; + TJAPlayer3.Tx.SongSelect_ScoreRank.vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.8f + BarAnimeCount / 620f; + TJAPlayer3.Tx.SongSelect_ScoreRank.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.8f + BarAnimeCount / 620f; + + if (繧ッ繝ェ繧「[3] != 0) + TJAPlayer3.Tx.SongSelect_Crown.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 354, 344 - BarAnimeCount / 1.1f, new RectangleF(9 * 43.2f + (繧ッ繝ェ繧「[3] - 1) * 43.2f, 0, 43.2f, 39)); + else if (繧ッ繝ェ繧「[4] != 0) + TJAPlayer3.Tx.SongSelect_Crown.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 354, 344 - BarAnimeCount / 1.1f, new RectangleF(12 * 43.2f + (繧ッ繝ェ繧「[4] - 1) * 43.2f, 0, 43.2f, 39)); + + if (繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[3] != 0) + TJAPlayer3.Tx.SongSelect_ScoreRank.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 354, 374 - BarAnimeCount / 1.15f, new RectangleF(0, (繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[3] - 1) * 42.71f, 50, 42.71f)); + else if (繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[4] != 0) + TJAPlayer3.Tx.SongSelect_ScoreRank.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 354, 374 - BarAnimeCount / 1.15f, new RectangleF(0, (繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[4] - 1) * 42.71f, 50, 42.71f)); + } + + #endregion + + #endregion + } + if (r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX) + { + #region [ Box ] + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 1300 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 1940) + { + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f - (float)Math.Sin(((ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1300) * 0.28125f) * (Math.PI / 180)) * 1.0f; + TJAPlayer3.Tx.SongSelect_Bar_Genre[nStr繧ク繝」繝ウ繝ォtoNum(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f - (float)Math.Sin(((ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1300) * 0.28125f) * (Math.PI / 180)) * 1.0f; + } + else + { + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + TJAPlayer3.Tx.SongSelect_Bar_Genre[nStr繧ク繝」繝ウ繝ォtoNum(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + } + + TJAPlayer3.Tx.SongSelect_Bar_Genre[nStr繧ク繝」繝ウ繝ォtoNum(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 326 - BarAnimeCount, new Rectangle(0, 0, 632, 21)); + + TJAPlayer3.Tx.SongSelect_Bar_Genre[nStr繧ク繝」繝ウ繝ォtoNum(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].vc諡。螟ァ邵ョ蟆丞咲紫.Y = BarAnimeCount == 0 ? 1.0f : 1.0f + (float)(BarAnimeCount) / 23.6f; + TJAPlayer3.Tx.SongSelect_Bar_Genre[nStr繧ク繝」繝ウ繝ォtoNum(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 360, new Rectangle(0, 21, 632, 48)); + TJAPlayer3.Tx.SongSelect_Bar_Genre[nStr繧ク繝」繝ウ繝ォtoNum(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + + TJAPlayer3.Tx.SongSelect_Bar_Genre[nStr繧ク繝」繝ウ繝ォtoNum(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 394 + BarAnimeCount, new Rectangle(0, 69, 632, 23)); + + if (BarAnimeCount != 0) + { + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 326, new Rectangle(0, 0, 632, 21)); + + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.vc諡。螟ァ邵ョ蟆丞咲紫.Y = BarAnimeCount == 0 ? 1.0f : 1.0f + (float)(BarAnimeCount) / 50; + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.t2D諡。螟ァ邇閠諷ョ荳贋クュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 336, new Rectangle(0, 21, 632, 48)); + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 394 + BarAnimeCount, new Rectangle(0, 69, 632, 23)); + } + else + { + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 360, new Rectangle(0, 0, 632, 92)); + } + #endregion + } + if(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BACKBOX) + { + #region [ BackBox ] + + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 1300 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 1940) + TJAPlayer3.Tx.SongSelect_Bar_Genre_Back.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f - (float)Math.Sin(((ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1300) * 0.28125f) * (Math.PI / 180)) * 1.0f; + else + TJAPlayer3.Tx.SongSelect_Bar_Genre_Back.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + + TJAPlayer3.Tx.SongSelect_Bar_Genre_Back.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 326 - BarAnimeCount, new Rectangle(0, 0, 632, 21)); + + TJAPlayer3.Tx.SongSelect_Bar_Genre_Back.vc諡。螟ァ邵ョ蟆丞咲紫.Y = BarAnimeCount == 0 ? 1.0f : 1.0f + (float)(BarAnimeCount) / 23.6f; + TJAPlayer3.Tx.SongSelect_Bar_Genre_Back.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 360, new Rectangle(0, 21, 632, 48)); + TJAPlayer3.Tx.SongSelect_Bar_Genre_Back.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + + TJAPlayer3.Tx.SongSelect_Bar_Genre_Back.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 394 + BarAnimeCount, new Rectangle(0, 69, 632, 23)); + + #endregion + } + + #endregion + + switch (r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.e繝弱シ繝臥ィョ蛻・) + { + case C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE: + { + if (TJAPlayer3.Tx.SongSelect_Frame_Score != null) + { + // 髮」譏灘コヲ縺卦ower縲.an縺ァ縺ッ縺ェ縺 + if (TJAPlayer3.stage驕ク譖イ.n迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ縺ョ髮」譏灘コヲ != (int)Difficulty.Tower && TJAPlayer3.stage驕ク譖イ.n迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ縺ョ髮」譏灘コヲ != (int)Difficulty.Dan) + { + for (int i = 0; i < (int)Difficulty.Edit + 1; i++) + { + if (ctBarOpen.n迴セ蝨ィ縺ョ蛟、 >= 100) + { + if (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[i] >= 0) + { + TJAPlayer3.Tx.SongSelect_Frame_Score.color4 = new Color4(1f, 1f, 1f); + + int opacity = 0; + + if(BarAnimeCount == 62) + { + if (ctScoreFrameAnime.n迴セ蝨ィ縺ョ蛟、 <= 3000 - 255) + opacity = 0; + else if (ctScoreFrameAnime.n迴セ蝨ィ縺ョ蛟、 <= 3000) + opacity = ctScoreFrameAnime.n迴セ蝨ィ縺ョ蛟、 - (3000 - 255); + else if (ctScoreFrameAnime.n迴セ蝨ィ縺ョ蛟、 <= 6000 - 255) + opacity = 255; + else + opacity = 255 - (ctScoreFrameAnime.n迴セ蝨ィ縺ョ蛟、 - (6000 - 255)); + } + + if (i == 4) + { + if (!TJAPlayer3.stage驕ク譖イ.act髮」譏灘コヲ驕ク謚樒判髱「.bIsDifficltSelect) + TJAPlayer3.Tx.SongSelect_Frame_Score.Opacity = BarAnimeCount < 62 ? 0 : opacity; + else if (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 >= 1000) + TJAPlayer3.Tx.SongSelect_Frame_Score.Opacity = (int)255.0f - (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1000); + + TJAPlayer3.Tx.SongSelect_Frame_Score.t2D荳倶クュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 494 + (3 * 122) - 31, TJAPlayer3.Skin.SongSelect_Overall_Y + 465, new Rectangle(122 * i, 0, 122, 360)); + } + else if (i != 4) + { + if (!TJAPlayer3.stage驕ク譖イ.act髮」譏灘コヲ驕ク謚樒判髱「.bIsDifficltSelect) + TJAPlayer3.Tx.SongSelect_Frame_Score.Opacity = (int)(BarAnimeCount * 4.25f); + else if (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 >= 1000) + TJAPlayer3.Tx.SongSelect_Frame_Score.Opacity = (int)255.0f - (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1000); + + TJAPlayer3.Tx.SongSelect_Frame_Score.t2D荳倶クュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 494 + (i * 122) - 31, TJAPlayer3.Skin.SongSelect_Overall_Y + 465, new Rectangle(122 * i, 0, 122, 360)); + } + + if (i == 4) + { + if (!TJAPlayer3.stage驕ク譖イ.act髮」譏灘コヲ驕ク謚樒判髱「.bIsDifficltSelect) + TJAPlayer3.Tx.SongSelect_Level_Number.Opacity = BarAnimeCount < 62 ? 0 : opacity; + else if (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 >= 1000) + TJAPlayer3.Tx.SongSelect_Level_Number.Opacity = (int)255.0f - (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1000); + + t蟆乗枚蟄苓。ィ遉コ(TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[4] < 10 ? 497 + (3 * 122) - 5 : 492 + (3 * 122) - 5, TJAPlayer3.Skin.SongSelect_Overall_Y + 277, TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[4].ToString()); + } + else if (i != 4) + { + if (!TJAPlayer3.stage驕ク譖イ.act髮」譏灘コヲ驕ク謚樒判髱「.bIsDifficltSelect) + TJAPlayer3.Tx.SongSelect_Level_Number.Opacity = (int)(BarAnimeCount * 4.25f); + else if (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 >= 1000) + TJAPlayer3.Tx.SongSelect_Level_Number.Opacity = (int)255.0f - (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1000); + + t蟆乗枚蟄苓。ィ遉コ(TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[i] < 10 ? 497 + (i * 122) - 5 : 492 + (i * 122) - 5, TJAPlayer3.Skin.SongSelect_Overall_Y + 277, TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[i].ToString()); + } + + } + else + { + // 繝ャ繝吶Ν縺0譛ェ貅 = 隴憺擇縺後↑縺縺ィ縺ソ縺ェ縺 + TJAPlayer3.Tx.SongSelect_Frame_Score.color4 = new Color4(0.5f, 0.5f, 0.5f); + if (i == 4 && TJAPlayer3.stage驕ク譖イ.n迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ縺ョ髮」譏灘コヲ == 4) + { + if (!TJAPlayer3.stage驕ク譖イ.act髮」譏灘コヲ驕ク謚樒判髱「.bIsDifficltSelect) + TJAPlayer3.Tx.SongSelect_Level_Number.Opacity = (int)(BarAnimeCount * 4.25f); + else if (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 >= 1000) + TJAPlayer3.Tx.SongSelect_Level_Number.Opacity = (int)255.0f - (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1000); + // 繧ィ繝繧」繝繝 + TJAPlayer3.Tx.SongSelect_Frame_Score.t2D荳倶クュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 494 + (3 * 122) - 31, TJAPlayer3.Skin.SongSelect_Overall_Y + 465, new Rectangle(122 * i, 0, 122, 360)); + } + else if (i != 4) + { + if (!TJAPlayer3.stage驕ク譖イ.act髮」譏灘コヲ驕ク謚樒判髱「.bIsDifficltSelect) + TJAPlayer3.Tx.SongSelect_Level_Number.Opacity = (int)(BarAnimeCount * 4.25f); + else if (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 >= 1000) + TJAPlayer3.Tx.SongSelect_Level_Number.Opacity = (int)255.0f - (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1000); + + TJAPlayer3.Tx.SongSelect_Frame_Score.t2D荳倶クュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 494 + (i * 122) - 31, TJAPlayer3.Skin.SongSelect_Overall_Y + 465, new Rectangle(122 * i, 0, 122, 360)); + } + } + } + } + } + else + { + if (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[TJAPlayer3.stage驕ク譖イ.n迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ縺ョ髮」譏灘コヲ] >= 0) + { + // 隴憺擇縺後≠繧翫∪縺吶ュ + TJAPlayer3.Tx.SongSelect_Frame_Score.color4 = new Color4(1f, 1f, 1f); + TJAPlayer3.Tx.SongSelect_Frame_Score.t2D荳倶クュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 494 + (3 * 122) - 31, TJAPlayer3.Skin.SongSelect_Overall_Y + 465, new Rectangle(0, 360 + (360 * (TJAPlayer3.stage驕ク譖イ.n迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ縺ョ髮」譏灘コヲ - (int)Difficulty.Tower)), TJAPlayer3.Tx.SongSelect_Frame_Score.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, 360)); + } + else + { + // 縺ェ縺縺ァ縺吶ュ + TJAPlayer3.Tx.SongSelect_Frame_Score.color4 = new Color4(0.5f, 0.5f, 0.5f); + TJAPlayer3.Tx.SongSelect_Frame_Score.t2D荳倶クュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 494 + (3 * 122) - 31, TJAPlayer3.Skin.SongSelect_Overall_Y + 465, new Rectangle(0, 360 + (360 * (TJAPlayer3.stage驕ク譖イ.n迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ縺ョ髮」譏灘コヲ - (int)Difficulty.Tower)), TJAPlayer3.Tx.SongSelect_Frame_Score.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, 360)); + } + } + } + } + break; + + case C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX: + { + for (int j = 0; j < 3; j++) + { + if (!ctBoxOpen.b邨ゆコ蛟、縺ォ驕斐@縺 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 != 0) + { + if (txBoxText[j] != null) + this.txBoxText[j].Opacity = (int)(ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 1200 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 1620 ? 255 - (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1200) * 2.55f : + ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 2000 ? (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 2000) * 2.55f : ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 1200 ? 255 : 0); + } + else + if (txBoxText[j] != null) + this.txBoxText[j].Opacity = (int)(BarAnimeCount * 4.25f); + + if (this.txBoxText[j].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width >= 510) + this.txBoxText[j].vc諡。螟ァ邵ョ蟆丞咲紫.X = 510f / this.txBoxText[j].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + + this.txBoxText[j].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640 + TJAPlayer3.Skin.SongSelect_BoxExplanation_X, 360 + j * TJAPlayer3.Skin.SongSelect_BoxExplanation_Interval + TJAPlayer3.Skin.SongSelect_BoxExplanation_Y); + } + + if (!ctBoxOpen.b邨ゆコ蛟、縺ォ驕斐@縺) + TJAPlayer3.Tx.SongSelect_Box_Chara[this.nStr繧ク繝」繝ウ繝ォtoNumBox(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].Opacity = (int)(ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 1200 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 1620 ? 255 - (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1200) * 2.55f : + ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 2000 ? (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 2000) * 2.55f : ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 1200 ? 255 : 0); + else + { + if (!TJAPlayer3.stage驕ク譖イ.act髮」譏灘コヲ驕ク謚樒判髱「.bIsDifficltSelect) + TJAPlayer3.Tx.SongSelect_Box_Chara[this.nStr繧ク繝」繝ウ繝ォtoNumBox(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].Opacity = (int)(BarAnimeCount * 4.25f); + else if (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 >= 1000) + TJAPlayer3.Tx.SongSelect_Box_Chara[this.nStr繧ク繝」繝ウ繝ォtoNumBox(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].Opacity = (int)255.0f - (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1000); + } + + float anime = 0; + + if(BarAnimeCount <= 45) + anime = BarAnimeCount * 3.333333333f; + else + anime = 150 - (BarAnimeCount - 45) * 2.11764705f; + + TJAPlayer3.Tx.SongSelect_Box_Chara[this.nStr繧ク繝」繝ウ繝ォtoNumBox(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640 - TJAPlayer3.Tx.SongSelect_Box_Chara[this.nStr繧ク繝」繝ウ繝ォtoNumBox(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 4 + 114 - anime, 360, + new Rectangle(0, 0, TJAPlayer3.Tx.SongSelect_Box_Chara[this.nStr繧ク繝」繝ウ繝ォtoNumBox(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Tx.SongSelect_Box_Chara[this.nStr繧ク繝」繝ウ繝ォtoNumBox(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + + TJAPlayer3.Tx.SongSelect_Box_Chara[this.nStr繧ク繝」繝ウ繝ォtoNumBox(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640 + TJAPlayer3.Tx.SongSelect_Box_Chara[this.nStr繧ク繝」繝ウ繝ォtoNumBox(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 4 - 114 + anime, 360, + new Rectangle(TJAPlayer3.Tx.SongSelect_Box_Chara[this.nStr繧ク繝」繝ウ繝ォtoNumBox(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, 0, TJAPlayer3.Tx.SongSelect_Box_Chara[this.nStr繧ク繝」繝ウ繝ォtoNumBox(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Tx.SongSelect_Box_Chara[this.nStr繧ク繝」繝ウ繝ォtoNumBox(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + } + break; + + case C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BACKBOX: + if (TJAPlayer3.Tx.SongSelect_Frame_BackBox != null) + TJAPlayer3.Tx.SongSelect_Frame_BackBox.t2D謠冗判(TJAPlayer3.app.Device, 450, TJAPlayer3.Skin.SongSelect_Overall_Y); + break; + + case C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.RANDOM: + if (TJAPlayer3.Tx.SongSelect_Frame_Random != null) + TJAPlayer3.Tx.SongSelect_Frame_Random.t2D謠冗判(TJAPlayer3.app.Device, 450, TJAPlayer3.Skin.SongSelect_Overall_Y); + break; + } + + if (TJAPlayer3.Tx.SongSelect_Branch_Text != null && TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.b隴憺擇蛻蟯深TJAPlayer3.stage驕ク譖イ.n迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ縺ョ髮」譏灘コヲ]) + TJAPlayer3.Tx.SongSelect_Branch_Text.t2D謠冗判(TJAPlayer3.app.Device, 483, TJAPlayer3.Skin.SongSelect_Overall_Y + 21); + + } + + if (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 1620) + { + if (bBoxOpen) + { + this.tBOX縺ォ蜈・繧(); + bBoxOpen = false; + } + if (bBoxClose) + { + this.tBOX繧貞コ繧(); + TJAPlayer3.stage驕ク譖イ.bBGM蜀咲函貂医∩ = false; + if (TJAPlayer3.ConfigIni.bBGM髻ウ繧堤匱螢ー縺吶k) + TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「繧、繝ウ.t蜀咲函縺吶k(); + TJAPlayer3.stage驕ク譖イ.bBGMIn蜀咲函縺励◆ = true; + bBoxClose = false; + } + } + + if(ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 >= ctDifficultyIn.n邨ゆコ蛟、) + { + ctDifficultyIn.t蛛懈ュ「(); + } + + for (int i = 0; i < 9; i++) // 繝代ロ繝ォ縺ッ蜈ィ13譫壹 + { + if ((i == 0 && this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ > 0) || // 譛荳願。後ッ縲∽ク翫↓遘サ蜍穂クュ縺ェ繧芽。ィ遉コ縺励↑縺縲 + (i == 8 && this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ < 0)) // 譛荳玖。後ッ縲∽ク九↓遘サ蜍穂クュ縺ェ繧芽。ィ遉コ縺励↑縺縲 + continue; + + int n繝代ロ繝ォ逡ェ蜿キ = (((this.n迴セ蝨ィ縺ョ驕ク謚櫁。 - 4) + i) + 9) % 9; + int n隕九◆逶ョ縺ョ陦檎分蜿キ = i; + int n谺。縺ョ繝代ロ繝ォ逡ェ蜿キ = (this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ <= 0) ? ((i + 1) % 9) : (((i - 1) + 9) % 9); + //int x = this.pt繝舌シ縺ョ蝓コ譛ャ蠎ァ讓兌 n隕九◆逶ョ縺ョ陦檎分蜿キ ].X + ( (int) ( ( this.pt繝舌シ縺ョ蝓コ譛ャ蠎ァ讓兌 n谺。縺ョ繝代ロ繝ォ逡ェ蜿キ ].X - this.pt繝舌シ縺ョ蝓コ譛ャ蠎ァ讓兌 n隕九◆逶ョ縺ョ陦檎分蜿キ ].X ) * ( ( (double) Math.Abs( this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ ) ) / 100.0 ) ) ); + int x = i驕ク譖イ繝舌シX蠎ァ讓; + int xAnime = this.pt繝舌シ縺ョ蠎ァ讓兌n隕九◆逶ョ縺ョ陦檎分蜿キ].X + ((int)((this.pt繝舌シ縺ョ蠎ァ讓兌n谺。縺ョ繝代ロ繝ォ逡ェ蜿キ].X - this.pt繝舌シ縺ョ蠎ァ讓兌n隕九◆逶ョ縺ョ陦檎分蜿キ].X) * (((double)Math.Abs(this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ)) / 100.0))); + int y = this.pt繝舌シ縺ョ蠎ァ讓兌n隕九◆逶ョ縺ョ陦檎分蜿キ].Y + ((int)((this.pt繝舌シ縺ョ蠎ァ讓兌n谺。縺ョ繝代ロ繝ォ逡ェ蜿キ].Y - this.pt繝舌シ縺ョ蠎ァ讓兌n隕九◆逶ョ縺ョ陦檎分蜿キ].Y) * (((double)Math.Abs(this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ)) / 100.0))); + if ((i == 4) && (this.n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ == 0)) + { + CTexture tx驕ク謚槭@縺ヲ縺繧区峇縺ョ繧オ繝悶ち繧、繝医Ν = null; + + // (A) 繧ケ繧ッ繝ュ繝シ繝ォ縺悟●豁「縺励※縺繧九→縺阪ョ驕ク謚樊峇繝舌シ縺ョ謠冗判縲 + + #region [ 繧ソ繧、繝医Ν蜷阪ユ繧ッ繧ケ繝√Ε繧呈緒逕サ縲] + //----------------- + if (this.st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].str繧ソ繧、繝医Ν譁蟄怜 != "" && this.ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ譖イ蜷 == null) + this.ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ譖イ蜷 = this.ttk譖イ蜷阪ユ繧ッ繧ケ繝√Ε繧堤函謌舌☆繧(this.st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].str繧ソ繧、繝医Ν譁蟄怜, this.st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].ForeColor, this.st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].BackColor, st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].e繝舌シ遞ョ蛻・ == E繝舌シ遞ョ蛻・.Box ? this.pfBoxName : this.pfMusicName); + if (this.st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].str繧オ繝悶ち繧、繝医Ν != "" && this.ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ繧オ繝悶ち繧、繝医Ν == null) + this.ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ繧オ繝悶ち繧、繝医Ν = this.ttk繧オ繝悶ち繧、繝医Ν繝繧ッ繧ケ繝√Ε繧堤函謌舌☆繧(this.st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].str繧オ繝悶ち繧、繝医Ν, this.st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].ForeColor, this.st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].BackColor); + + if (this.ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ繧オ繝悶ち繧、繝医Ν != null) + tx驕ク謚槭@縺ヲ縺繧区峇縺ョ繧オ繝悶ち繧、繝医Ν = ResolveTitleTexture(ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ繧オ繝悶ち繧、繝医Ν); + + //繧オ繝悶ち繧、繝医Ν縺後≠縺」縺溘i700 + + if (ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ譖イ蜷 != null) + { + if (!ctBoxOpen.b邨ゆコ蛟、縺ォ驕斐@縺) + ResolveTitleTexture(this.ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ譖イ蜷).Opacity = (int)(ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 1200 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 1620 ? 255 - (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1200) * 2.55f : + ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 2000 ? (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 2000) * 2.55f : ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 1200 ? 255 : 0); + else + { + if (!TJAPlayer3.stage驕ク譖イ.act髮」譏灘コヲ驕ク謚樒判髱「.bIsDifficltSelect) + ResolveTitleTexture(this.ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ譖イ蜷).Opacity = 255; + else if (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 >= 1000) + ResolveTitleTexture(this.ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ譖イ蜷).Opacity = (int)255.0f - (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1000); + } + } + + if (this.ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ繧オ繝悶ち繧、繝医Ν != null) + { + if (!ctBoxOpen.b邨ゆコ蛟、縺ォ驕斐@縺) + tx驕ク謚槭@縺ヲ縺繧区峇縺ョ繧オ繝悶ち繧、繝医Ν.Opacity = (int)(ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 1200 && ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 1620 ? 255 - (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 1200) * 2.55f : + ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 >= 2000 ? (ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 - 2000) * 2.55f : ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 <= 1200 ? 255 : 0); + else + { + if (!TJAPlayer3.stage驕ク譖イ.act髮」譏灘コヲ驕ク謚樒判髱「.bIsDifficltSelect) + tx驕ク謚槭@縺ヲ縺繧区峇縺ョ繧オ繝悶ち繧、繝医Ν.Opacity = (int)(BarAnimeCount * 4.25f); + else if (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 >= 1000) + tx驕ク謚槭@縺ヲ縺繧区峇縺ョ繧オ繝悶ち繧、繝医Ν.Opacity = (int)255.0f - (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1000); + } + + tx驕ク謚槭@縺ヲ縺繧区峇縺ョ繧オ繝悶ち繧、繝医Ν.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640 + TJAPlayer3.Skin.SongSelect_Title_X, y + 90 - (this.st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].e繝舌シ遞ョ蛻・ == E繝舌シ遞ョ蛻・.Box ? BarAnimeCount : BarAnimeCount / 1.1f) + TJAPlayer3.Skin.SongSelect_Title_Y); + if (this.ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ譖イ蜷 != null) + { + ResolveTitleTexture(this.ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ譖イ蜷).t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640 + TJAPlayer3.Skin.SongSelect_Title_X, y + 61 - (r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.e繝弱シ繝臥ィョ蛻・ != C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BACKBOX ? (this.st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].e繝舌シ遞ョ蛻・ == E繝舌シ遞ョ蛻・.Box ? BarAnimeCount : BarAnimeCount / 1.1f) : 0) + TJAPlayer3.Skin.SongSelect_Title_Y); + } + } + else + { + if (this.ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ譖イ蜷 != null) + { + ResolveTitleTexture(this.ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ譖イ蜷).t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640 + TJAPlayer3.Skin.SongSelect_Title_X, y + 61 - (r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.e繝弱シ繝臥ィョ蛻・ != C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BACKBOX ? (this.st繝舌シ諠蝣ア[n繝代ロ繝ォ逡ェ蜿キ].e繝舌シ遞ョ蛻・ == E繝舌シ遞ョ蛻・.Box ? BarAnimeCount : BarAnimeCount / 1.1f) : 0) + TJAPlayer3.Skin.SongSelect_Title_Y); + } + } + //----------------- + #endregion + } + } + //----------------- + + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private enum E繝舌シ遞ョ蛻・ { Score, Box, Other, BackBox } + + public int[] ScoreRankCount = new int[7]; + public int[] CrownCount = new int[3]; + + private struct ST繝舌シ + { + public CTexture Score; + public CTexture Box; + public CTexture Other; + public CTexture this[ int index ] + { + get + { + switch( index ) + { + case 0: + return this.Score; + + case 1: + return this.Box; + + case 2: + return this.Other; + } + throw new IndexOutOfRangeException(); + } + set + { + switch( index ) + { + case 0: + this.Score = value; + return; + + case 1: + this.Box = value; + return; + + case 2: + this.Other = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + + private struct ST繝舌シ諠蝣ア + { + public CActSelect譖イ繝ェ繧ケ繝.E繝舌シ遞ョ蛻・ e繝舌シ遞ョ蛻・; + public string str繧ソ繧、繝医Ν譁蟄怜; + public CTexture tx繧ソ繧、繝医Ν蜷; + public STDGBVALUE n繧ケ繧ュ繝ォ蛟、; + public Color col譁蟄苓牡; + public Color ForeColor; + public Color BackColor; + public int[] ar髮」譏灘コヲ; + public bool[] b蛻蟯; + public string str繧ク繝」繝ウ繝ォ; + public string str繧オ繝悶ち繧、繝医Ν; + public TitleTextureKey ttk繧ソ繧、繝医Ν; + public int[] n繧ッ繝ェ繧「; + public int[] n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ; + } + + private bool bFirstCrownLoad; + + public CCounter ctBarFlash; + public CCounter ctDifficultyIn; + + private CCounter ctScoreFrameAnime; + + public CCounter ctBarOpen; + public CCounter ctBoxOpen; + public bool bBoxOpen; + public bool bBoxClose; + + public bool b驕ク謚樊峇縺悟、画峩縺輔l縺 = true; + private bool b逋サ蝣エ繧「繝九Γ蜈ィ驛ィ螳御コ; + private CCounter[] ct逋サ蝣エ繧「繝九Γ逕ィ = new CCounter[ 13 ]; + private CCounter ct荳芽ァ堤泙蜊ー繧「繝九Γ; + private CPrivateFastFont pfMusicName; + private CPrivateFastFont pfSubtitle; + private CPrivateFastFont pfBoxName; + + private string strBoxText; + private CPrivateFastFont pfBoxText; + private CTexture[] txBoxText = new CTexture[3]; + + private readonly Dictionary _titledictionary + = new Dictionary(); + + private Font ft譖イ繝ェ繧ケ繝育畑繝輔か繝ウ繝; + private long n繧ケ繧ッ繝ュ繝シ繝ォ繧ソ繧、繝; + private int n迴セ蝨ィ縺ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ; + private int n迴セ蝨ィ縺ョ驕ク謚櫁。; + private int n逶ョ讓吶ョ繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ; + private readonly Point[] pt繝舌シ縺ョ蠎ァ讓 = new Point[] { + new Point(214, -127),new Point(239, -36), new Point(263, 55), new Point(291, 145), + new Point(324, 314), + new Point(358, 485), new Point(386, 574), new Point(411, 665), new Point(436, 756) }; + + private ST繝舌シ諠蝣ア[] st繝舌シ諠蝣ア = new ST繝舌シ諠蝣ア[ 9 ]; + private CTexture txSongNotFound, txEnumeratingSongs; + + private TitleTextureKey ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ譖イ蜷; + private TitleTextureKey ttk驕ク謚槭@縺ヲ縺繧区峇縺ョ繧オ繝悶ち繧、繝医Ν; + + private CTexture[] tx譖イ繝舌シ_髮」譏灘コヲ = new CTexture[ 5 ]; + + private int nCurrentPosition = 0; + private int nNumOfItems = 0; + + private E繝舌シ遞ョ蛻・ e譖イ縺ョ繝舌シ遞ョ蛻・繧定ソ斐☆( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 song ) + { + if( song != null ) + { + switch( song.e繝弱シ繝臥ィョ蛻・ ) + { + case C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE: + case C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE_MIDI: + return E繝舌シ遞ョ蛻・.Score; + + case C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX: + return E繝舌シ遞ョ蛻・.Box; + + case C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BACKBOX: + return E繝舌シ遞ョ蛻・.BackBox; + } + } + return E繝舌シ遞ョ蛻・.Other; + } + public C譖イ繝ェ繧ケ繝医ヮ繝シ繝 r谺。縺ョ譖イ( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 song ) + { + if( song == null ) + return null; + + List list = TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝; + + int index = list.IndexOf( song ); + + if( index < 0 ) + return null; + + if( index == ( list.Count - 1 ) ) + return list[ 0 ]; + + return list[ index + 1 ]; + } + public C譖イ繝ェ繧ケ繝医ヮ繝シ繝 r蜑阪ョ譖イ( C譖イ繝ェ繧ケ繝医ヮ繝シ繝 song ) + { + if( song == null ) + return null; + + List list = TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝; + + int index = list.IndexOf( song ); + + if( index < 0 ) + return null; + + if( index == 0 ) + return list[ list.Count - 1 ]; + + return list[ index - 1 ]; + } + private void t繧ケ繧ュ繝ォ蛟、縺ョ謠冗判( int x, int y, int n繧ケ繧ュ繝ォ蛟、 ) + { + if( n繧ケ繧ュ繝ォ蛟、 <= 0 || n繧ケ繧ュ繝ォ蛟、 > 100 ) // 繧ケ繧ュ繝ォ蛟、 0 シ 譛ェ繝励Ξ繧、 縺ェ縺ョ縺ァ陦ィ遉コ縺励↑縺縲 + return; + + int color = ( n繧ケ繧ュ繝ォ蛟、 == 100 ) ? 3 : ( n繧ケ繧ュ繝ォ蛟、 / 25 ); + + int n逋セ縺ョ菴 = n繧ケ繧ュ繝ォ蛟、 / 100; + int n蜊√ョ菴 = ( n繧ケ繧ュ繝ォ蛟、 % 100 ) / 10; + int n荳縺ョ菴 = ( n繧ケ繧ュ繝ォ蛟、 % 100 ) % 10; + + + // 逋セ縺ョ菴阪ョ謠冗判縲 + + if( n逋セ縺ョ菴 > 0 ) + this.t繧ケ繧ュ繝ォ蛟、縺ョ謠冗判_シ第。∵緒逕サ( x, y, n逋セ縺ョ菴, color ); + + + // 蜊√ョ菴阪ョ謠冗判縲 + + if( n逋セ縺ョ菴 != 0 || n蜊√ョ菴 != 0 ) + this.t繧ケ繧ュ繝ォ蛟、縺ョ謠冗判_シ第。∵緒逕サ( x + 7, y, n蜊√ョ菴, color ); + + + // 荳縺ョ菴阪ョ謠冗判縲 + + this.t繧ケ繧ュ繝ォ蛟、縺ョ謠冗判_シ第。∵緒逕サ( x + 14, y, n荳縺ョ菴, color ); + } + private void t繧ケ繧ュ繝ォ蛟、縺ョ謠冗判_シ第。∵緒逕サ( int x, int y, int n謨ー蛟、, int color ) + { + //int dx = ( n謨ー蛟、 % 5 ) * 9; + //int dy = ( n謨ー蛟、 / 5 ) * 12; + + //switch( color ) + //{ + // case 0: + // if( this.tx繧ケ繧ュ繝ォ謨ー蟄 != null ) + // this.tx繧ケ繧ュ繝ォ謨ー蟄.t2D謠冗判( CDTXMania.app.Device, x, y, new Rectangle( 45 + dx, 24 + dy, 9, 12 ) ); + // break; + + // case 1: + // if( this.tx繧ケ繧ュ繝ォ謨ー蟄 != null ) + // this.tx繧ケ繧ュ繝ォ謨ー蟄.t2D謠冗判( CDTXMania.app.Device, x, y, new Rectangle( 45 + dx, dy, 9, 12 ) ); + // break; + + // case 2: + // if( this.tx繧ケ繧ュ繝ォ謨ー蟄 != null ) + // this.tx繧ケ繧ュ繝ォ謨ー蟄.t2D謠冗判( CDTXMania.app.Device, x, y, new Rectangle( dx, 24 + dy, 9, 12 ) ); + // break; + + // case 3: + // if( this.tx繧ケ繧ュ繝ォ謨ー蟄 != null ) + // this.tx繧ケ繧ュ繝ォ謨ー蟄.t2D謠冗判( CDTXMania.app.Device, x, y, new Rectangle( dx, dy, 9, 12 ) ); + // break; + //} + } + private void t繝舌シ縺ョ蛻晄悄蛹() + { + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 song = this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ; + + if( song == null ) + return; + + for( int i = 0; i < 4; i++ ) + song = this.r蜑阪ョ譖イ( song ); + + for( int i = 0; i < 9; i++ ) + { + this.st繝舌シ諠蝣ア[ i ].str繧ソ繧、繝医Ν譁蟄怜 = song.str繧ソ繧、繝医Ν; + this.st繝舌シ諠蝣ア[ i ].str繧ク繝」繝ウ繝ォ = song.str繧ク繝」繝ウ繝ォ; + this.st繝舌シ諠蝣ア[ i ].col譁蟄苓牡 = song.col譁蟄苓牡; + this.st繝舌シ諠蝣ア[i].ForeColor = song.ForeColor; + this.st繝舌シ諠蝣ア[i].BackColor = song.BackColor; + this.st繝舌シ諠蝣ア[ i ].e繝舌シ遞ョ蛻・ = this.e譖イ縺ョ繝舌シ遞ョ蛻・繧定ソ斐☆( song ); + this.st繝舌シ諠蝣ア[ i ].str繧オ繝悶ち繧、繝医Ν = song.str繧オ繝悶ち繧、繝医Ν; + this.st繝舌シ諠蝣ア[ i ].ar髮」譏灘コヲ = song.nLevel; + + for( int f = 0; f < (int)Difficulty.Total; f++ ) + { + if( song.ar繧ケ繧ウ繧「[ f ] != null ) + this.st繝舌シ諠蝣ア[ i ].b蛻蟯 = song.ar繧ケ繧ウ繧「[ f ].隴憺擇諠蝣ア.b隴憺擇蛻蟯; + } + + + if (st繝舌シ諠蝣ア[i].n繧ッ繝ェ繧「 == null) + this.st繝舌シ諠蝣ア[i].n繧ッ繝ェ繧「 = new int[5]; + if (st繝舌シ諠蝣ア[i].n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ == null) + this.st繝舌シ諠蝣ア[i].n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ = new int[5]; + + if(this.st繝舌シ諠蝣ア[i].e繝舌シ遞ョ蛻・ == E繝舌シ遞ョ蛻・.Score) + { + if (song.ar繧ケ繧ウ繧「[3] != null) + { + this.st繝舌シ諠蝣ア[i].n繧ッ繝ェ繧「 = song.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ッ繝ェ繧「; + this.st繝舌シ諠蝣ア[i].n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ = song.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ; + } + } + + for ( int j = 0; j < 3; j++ ) + this.st繝舌シ諠蝣ア[ i ].n繧ケ繧ュ繝ォ蛟、[ j ] = (int) song.ar繧ケ繧ウ繧「[ this.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν縺ォ譛繧りソ代>髮」譏灘コヲ繝ャ繝吶Ν繧定ソ斐☆( song ) ].隴憺擇諠蝣ア.譛螟ァ繧ケ繧ュ繝ォ[ j ]; + + this.st繝舌シ諠蝣ア[ i ].ttk繧ソ繧、繝医Ν = this.ttk譖イ蜷阪ユ繧ッ繧ケ繝√Ε繧堤函謌舌☆繧( this.st繝舌シ諠蝣ア[ i ].str繧ソ繧、繝医Ν譁蟄怜, this.st繝舌シ諠蝣ア[i].ForeColor, this.st繝舌シ諠蝣ア[i].BackColor, st繝舌シ諠蝣ア[i].e繝舌シ遞ョ蛻・ == E繝舌シ遞ョ蛻・.Box ? this.pfBoxName : this.pfMusicName); + + song = this.r谺。縺ョ譖イ( song ); + } + + this.n迴セ蝨ィ縺ョ驕ク謚櫁。 = 4; + } + + private void t繧ク繝」繝ウ繝ォ蛻・驕ク謚槭&繧後※縺縺ェ縺譖イ繝舌シ縺ョ謠冗判(int x, int y, string str繧ク繝」繝ウ繝ォ, E繝舌シ遞ョ蛻・ e繝舌シ遞ョ蛻・, int[] 繧ッ繝ェ繧「, int[] 繧ケ繧ウ繧「繝ゥ繝ウ繧ッ) + { + if (x >= SampleFramework.GameWindowSize.Width || y >= SampleFramework.GameWindowSize.Height) + return; + + var rc = new Rectangle(0, 48, 128, 48); + + for (int i = 0; i < TJAPlayer3.Skin.SongSelect_Bar_Genre_Count; i++) + { + if (TJAPlayer3.stage驕ク譖イ.act髮」譏灘コヲ驕ク謚樒判髱「.bIsDifficltSelect) + { + if (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 >= 1000) + { + if (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 <= 1255) + { + TJAPlayer3.Tx.SongSelect_Crown.Opacity = (int)255.0f - (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1000); + TJAPlayer3.Tx.SongSelect_ScoreRank.Opacity = (int)255.0f - (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1000); + TJAPlayer3.Tx.SongSelect_Bar_Genre[i].Opacity = (int)255.0f - (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1000); + TJAPlayer3.Tx.SongSelect_Bar_Genre_Back.Opacity = (int)255.0f - (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1000); + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.Opacity = (int)255.0f - (ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1000); + } + else + { + TJAPlayer3.Tx.SongSelect_ScoreRank.Opacity = 0; + } + } + } + else + { + TJAPlayer3.Tx.SongSelect_Crown.Opacity = (int)255.0f; + TJAPlayer3.Tx.SongSelect_ScoreRank.Opacity = (int)255.0f; + TJAPlayer3.Tx.SongSelect_Bar_Genre[i].Opacity = (int)255.0f; + TJAPlayer3.Tx.SongSelect_Bar_Genre_Back.Opacity = (int)255.0f; + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.Opacity = (int)255.0f; + } + } + + if (e繝舌シ遞ョ蛻・ != E繝舌シ遞ョ蛻・.BackBox) + { + if (this.nStr繧ク繝」繝ウ繝ォtoNum(str繧ク繝」繝ウ繝ォ) == 0) + { + if (TJAPlayer3.Tx.SongSelect_Bar_Genre[0] != null) + TJAPlayer3.Tx.SongSelect_Bar_Genre[0].t2D謠冗判(TJAPlayer3.app.Device, x, y); + } + else + { + for (int i = 0; i < TJAPlayer3.Skin.SongSelect_GenreName.Length; i++) + { + if (TJAPlayer3.Skin.SongSelect_GenreName[i] == str繧ク繝」繝ウ繝ォ) + { + if (i + 1 >= TJAPlayer3.Skin.SongSelect_Bar_Genre_Count) + { + if (TJAPlayer3.Tx.SongSelect_Bar_Genre[0] != null) + TJAPlayer3.Tx.SongSelect_Bar_Genre[0].t2D謠冗判(TJAPlayer3.app.Device, x, y); + break; + } + else + { + if (TJAPlayer3.Tx.SongSelect_Bar_Genre[i + 1] != null) + TJAPlayer3.Tx.SongSelect_Bar_Genre[i + 1].t2D謠冗判(TJAPlayer3.app.Device, x, y); + break; + } + } + } + } + + if (TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay != null) + TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.t2D謠冗判(TJAPlayer3.app.Device, x, y); + } + else + { + TJAPlayer3.Tx.SongSelect_Bar_Genre_Back.t2D謠冗判(TJAPlayer3.app.Device, x, y); + } + + if (e繝舌シ遞ョ蛻・ == E繝舌シ遞ョ蛻・.Score) + { + TJAPlayer3.Tx.SongSelect_Crown.vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.8f; + TJAPlayer3.Tx.SongSelect_Crown.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.8f; + TJAPlayer3.Tx.SongSelect_ScoreRank.vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.8f; + TJAPlayer3.Tx.SongSelect_ScoreRank.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.8f; + + if (繧ッ繝ェ繧「[3] != 0 && 繧ッ繝ェ繧「[4] == 0) + TJAPlayer3.Tx.SongSelect_Crown.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x + 30, y + 30, new RectangleF(9 * 43.2f + (繧ッ繝ェ繧「[3] - 1) * 43.2f, 0, 43.2f, 39)); + if (繧ッ繝ェ繧「[4] != 0) + TJAPlayer3.Tx.SongSelect_Crown.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x + 30, y + 30, new RectangleF(12 * 43.2f + (繧ッ繝ェ繧「[4] - 1) * 43.2f, 0, 43.2f, 39)); + + if (繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[3] != 0 && 繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[4] == 0) + TJAPlayer3.Tx.SongSelect_ScoreRank.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x + 30, y + 60, new RectangleF(0, (繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[3] - 1) * 42.71f, 50, 42.71f)); + if (繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[4] != 0) + TJAPlayer3.Tx.SongSelect_ScoreRank.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x + 30, y + 60, new RectangleF(0, (繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[4] - 1) * 42.71f, 50, 42.71f)); + } + } + + public int nStr繧ク繝」繝ウ繝ォtoNum(string str繧ク繝」繝ウ繝ォ) + { + int nGenre = 8; + for (int i = 0; i < TJAPlayer3.Skin.SongSelect_GenreName.Length; i++) + { + if (TJAPlayer3.Skin.SongSelect_GenreName[i] == str繧ク繝」繝ウ繝ォ) + { + if (i + 1 >= TJAPlayer3.Skin.SongSelect_Bar_Genre_Count) + { + nGenre = 0; + } + else + { + nGenre = i + 1; + } + break; + } + else + { + nGenre = 0; + } + } + return nGenre; + } + + public int nStr繧ク繝」繝ウ繝ォtoNumBox(string str繧ク繝」繝ウ繝ォ) + { + int nGenre = 8; + for (int i = 0; i < TJAPlayer3.Skin.SongSelect_GenreName.Length; i++) + { + if (TJAPlayer3.Skin.SongSelect_GenreName[i] == str繧ク繝」繝ウ繝ォ) + { + if (i + 1 >= TJAPlayer3.Skin.SongSelect_Box_Chara_Count) + { + nGenre = 0; + } + else + { + nGenre = i + 1; + } + break; + } + else + { + nGenre = 0; + } + } + return nGenre; + } + + private TitleTextureKey ttk譖イ蜷阪ユ繧ッ繧ケ繝√Ε繧堤函謌舌☆繧( string str譁蟄, Color forecolor, Color backcolor, CPrivateFastFont pf) + { + return new TitleTextureKey(str譁蟄, pf, forecolor, backcolor, 550); + } + + private TitleTextureKey ttk繧オ繝悶ち繧、繝医Ν繝繧ッ繧ケ繝√Ε繧堤函謌舌☆繧( string str譁蟄, Color forecolor, Color backcolor) + { + return new TitleTextureKey(str譁蟄, pfSubtitle, forecolor, backcolor, 510); + } + + public CTexture ResolveTitleTexture(TitleTextureKey titleTextureKey) + { + if (!_titledictionary.TryGetValue(titleTextureKey, out var texture)) + { + texture = GenerateTitleTexture(titleTextureKey); + _titledictionary.Add(titleTextureKey, texture); + } + + return texture; + } + + private static CTexture GenerateTitleTexture(TitleTextureKey titleTextureKey) + { + using (var bmp = new Bitmap(titleTextureKey.cPrivateFastFont.DrawPrivateFont( + titleTextureKey.str譁蟄, titleTextureKey.forecolor, titleTextureKey.backcolor))) + { + CTexture tx譁蟄励ユ繧ッ繧ケ繝√Ε = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(bmp, false); + if (tx譁蟄励ユ繧ッ繧ケ繝√Ε.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width > titleTextureKey.maxWidth) + { + tx譁蟄励ユ繧ッ繧ケ繝√Ε.vc諡。螟ァ邵ョ蟆丞咲紫.X = (float) (((double) titleTextureKey.maxWidth) / tx譁蟄励ユ繧ッ繧ケ繝√Ε.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width); + tx譁蟄励ユ繧ッ繧ケ繝√Ε.vc諡。螟ァ邵ョ蟆丞咲紫.Y = (float) (((double) titleTextureKey.maxWidth) / tx譁蟄励ユ繧ッ繧ケ繝√Ε.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width); + } + + return tx譁蟄励ユ繧ッ繧ケ繝√Ε; + } + } + + private void ClearTitleTextureCache() + { + foreach (var titleTexture in _titledictionary.Values) + { + titleTexture.Dispose(); + } + + _titledictionary.Clear(); + } + + public sealed class TitleTextureKey + { + public readonly string str譁蟄; + public readonly CPrivateFastFont cPrivateFastFont; + public readonly Color forecolor; + public readonly Color backcolor; + public readonly int maxWidth; + + public TitleTextureKey(string str譁蟄, CPrivateFastFont cPrivateFastFont, Color forecolor, Color backcolor, int maxHeight) + { + this.str譁蟄 = str譁蟄; + this.cPrivateFastFont = cPrivateFastFont; + this.forecolor = forecolor; + this.backcolor = backcolor; + this.maxWidth = maxHeight; + } + + private bool Equals(TitleTextureKey other) + { + return string.Equals(str譁蟄, other.str譁蟄) && + cPrivateFastFont.Equals(other.cPrivateFastFont) && + forecolor.Equals(other.forecolor) && + backcolor.Equals(other.backcolor) && + maxWidth == other.maxWidth; + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj is TitleTextureKey other && Equals(other); + } + + public override int GetHashCode() + { + unchecked + { + var hashCode = str譁蟄.GetHashCode(); + hashCode = (hashCode * 397) ^ cPrivateFastFont.GetHashCode(); + hashCode = (hashCode * 397) ^ forecolor.GetHashCode(); + hashCode = (hashCode * 397) ^ backcolor.GetHashCode(); + hashCode = (hashCode * 397) ^ maxWidth; + return hashCode; + } + } + + public static bool operator ==(TitleTextureKey left, TitleTextureKey right) + { + return Equals(left, right); + } + + public static bool operator !=(TitleTextureKey left, TitleTextureKey right) + { + return !Equals(left, right); + } + } + + private void t繧「繧、繝繝謨ー縺ョ謠冗判() + { + string s = nCurrentPosition.ToString() + "/" + nNumOfItems.ToString(); + int x = 639 - 8 - 12; + int y = 362; + + for ( int p = s.Length - 1; p >= 0; p-- ) + { + t繧「繧、繝繝謨ー縺ョ謠冗判_シ第。∵緒逕サ( x, y, s[ p ] ); + x -= 8; + } + } + private void t繧「繧、繝繝謨ー縺ョ謠冗判_シ第。∵緒逕サ( int x, int y, char s謨ー蛟、 ) + { + int dx, dy; + if ( s謨ー蛟、 == '/' ) + { + dx = 48; + dy = 0; + } + else + { + int n = (int) s謨ー蛟、 - (int) '0'; + dx = ( n % 6 ) * 8; + dy = ( n / 6 ) * 12; + } + //if ( this.tx繧「繧、繝繝謨ー謨ー蟄 != null ) + //{ + // this.tx繧「繧、繝繝謨ー謨ー蟄.t2D謠冗判( CDTXMania.app.Device, x, y, new Rectangle( dx, dy, 8, 12 ) ); + //} + } + + + //謨ー蟄励ヵ繧ゥ繝ウ繝 + private CTexture tx繝ャ繝吶Ν謨ー蟄励ヵ繧ゥ繝ウ繝; + [StructLayout( LayoutKind.Sequential )] + private struct ST繝ャ繝吶Ν謨ー蟄 + { + public char ch; + public int ptX; + } + private ST繝ャ繝吶Ν謨ー蟄夕] st蟆乗枚蟄嶺ス咲スョ = new ST繝ャ繝吶Ν謨ー蟄夕 10 ]; + private void t蟆乗枚蟄苓。ィ遉コ(int x, int y, string str) + { + foreach (char ch in str) + { + for (int i = 0; i < this.st蟆乗枚蟄嶺ス咲スョ.Length; i++) + { + if (this.st蟆乗枚蟄嶺ス咲スョ[i].ch == ch) + { + Rectangle rectangle = new Rectangle(this.st蟆乗枚蟄嶺ス咲スョ[i].ptX, 0, 21, 25); + if (TJAPlayer3.Tx.SongSelect_Level_Number != null) + { + if (str.Length > 1) TJAPlayer3.Tx.SongSelect_Level_Number.vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.8f; + else TJAPlayer3.Tx.SongSelect_Level_Number.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + TJAPlayer3.Tx.SongSelect_Level_Number.t2D謠冗判(TJAPlayer3.app.Device, x, y, rectangle); + } + break; + } + } + x += 11; + } + } + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/05.SongSelect/CActSelect貍泌・丞ア・豁エ繝代ロ繝ォ.cs b/TJAPlayer3/Stages/05.SongSelect/CActSelect貍泌・丞ア・豁エ繝代ロ繝ォ.cs new file mode 100644 index 00000000..a7afaa13 --- /dev/null +++ b/TJAPlayer3/Stages/05.SongSelect/CActSelect貍泌・丞ア・豁エ繝代ロ繝ォ.cs @@ -0,0 +1,225 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using System.Drawing; +using System.Runtime.InteropServices; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActSelect貍泌・丞ア・豁エ繝代ロ繝ォ : CActivity + { + // 繝。繧ス繝繝 + + public CActSelect貍泌・丞ア・豁エ繝代ロ繝ォ() + { + ST譁蟄嶺ス咲スョ[] st譁蟄嶺ス咲スョArray = new ST譁蟄嶺ス咲スョ[10]; + + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ.ch = '0'; + st譁蟄嶺ス咲スョ.pt = new Point(0, 0); + st譁蟄嶺ス咲スョArray[0] = st譁蟄嶺ス咲スョ; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ2 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ2.ch = '1'; + st譁蟄嶺ス咲スョ2.pt = new Point(26, 0); + st譁蟄嶺ス咲スョArray[1] = st譁蟄嶺ス咲スョ2; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ3 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ3.ch = '2'; + st譁蟄嶺ス咲スョ3.pt = new Point(52, 0); + st譁蟄嶺ス咲スョArray[2] = st譁蟄嶺ス咲スョ3; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ4 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ4.ch = '3'; + st譁蟄嶺ス咲スョ4.pt = new Point(78, 0); + st譁蟄嶺ス咲スョArray[3] = st譁蟄嶺ス咲スョ4; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ5 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ5.ch = '4'; + st譁蟄嶺ス咲スョ5.pt = new Point(104, 0); + st譁蟄嶺ス咲スョArray[4] = st譁蟄嶺ス咲スョ5; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ6 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ6.ch = '5'; + st譁蟄嶺ス咲スョ6.pt = new Point(130, 0); + st譁蟄嶺ス咲スョArray[5] = st譁蟄嶺ス咲スョ6; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ7 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ7.ch = '6'; + st譁蟄嶺ス咲スョ7.pt = new Point(156, 0); + st譁蟄嶺ス咲スョArray[6] = st譁蟄嶺ス咲スョ7; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ8 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ8.ch = '7'; + st譁蟄嶺ス咲スョ8.pt = new Point(182, 0); + st譁蟄嶺ス咲スョArray[7] = st譁蟄嶺ス咲スョ8; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ9 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ9.ch = '8'; + st譁蟄嶺ス咲スョ9.pt = new Point(208, 0); + st譁蟄嶺ス咲スョArray[8] = st譁蟄嶺ス咲スョ9; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ10 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ10.ch = '9'; + st譁蟄嶺ス咲スョ10.pt = new Point(234, 0); + st譁蟄嶺ス咲スョArray[9] = st譁蟄嶺ス咲スョ10; + this.st蟆乗枚蟄嶺ス咲スョ = st譁蟄嶺ス咲スョArray; + + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + public void t驕ク謚樊峇縺悟、画峩縺輔l縺() + { + C繧ケ繧ウ繧「 c繧ケ繧ウ繧「 = TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「; + if( ( c繧ケ繧ウ繧「 != null ) && !TJAPlayer3.stage驕ク譖イ.b繧ケ繧ッ繝ュ繝シ繝ォ荳ュ ) + { + try + { + Bitmap image = new Bitmap( 800, 240 ); + Graphics graphics = Graphics.FromImage( image ); + graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; + for ( int i = 0; i < (int)Difficulty.Total; i++ ) + { + if( ( c繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞ア・豁エ[ i ] != null ) && ( c繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞ア・豁エ[ i ].Length > 0 ) ) + { + graphics.DrawString( c繧ケ繧ウ繧「.隴憺擇諠蝣ア.貍泌・丞ア・豁エ[ i ], this.ft陦ィ遉コ逕ィ繝輔か繝ウ繝, Brushes.Yellow, (float) 0f, (float) ( i * 36f ) ); + } + } + graphics.Dispose(); + if( this.tx譁蟄怜励ヱ繝阪Ν != null ) + { + this.tx譁蟄怜励ヱ繝阪Ν.Dispose(); + } + this.tx譁蟄怜励ヱ繝阪Ν = new CTexture( TJAPlayer3.app.Device, image, TJAPlayer3.TextureFormat ); + this.tx譁蟄怜励ヱ繝阪Ν.vc諡。螟ァ邵ョ蟆丞咲紫 = new Vector3( 0.5f, 0.5f, 1f ); + image.Dispose(); + } + catch( CTextureCreateFailedException e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "貍泌・丞ア・豁エ譁蟄怜励ユ繧ッ繧ケ繝√Ε縺ョ菴懈舌↓螟ア謨励@縺セ縺励◆縲" ); + this.tx譁蟄怜励ヱ繝阪Ν = null; + } + } + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + this.n譛ャ菴店 = 810; + this.n譛ャ菴添 = 558; + this.ft陦ィ遉コ逕ィ繝輔か繝ウ繝 = new Font( "Arial", 30f, FontStyle.Bold, GraphicsUnit.Pixel ); + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + if( this.ft陦ィ遉コ逕ィ繝輔か繝ウ繝 != null ) + { + this.ft陦ィ遉コ逕ィ繝輔か繝ウ繝.Dispose(); + this.ft陦ィ遉コ逕ィ繝輔か繝ウ繝 = null; + } + this.ct逋サ蝣エ繧「繝九Γ逕ィ = null; + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //this.tx繝代ロ繝ォ譛ャ菴 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_play history panel.png" ) ); + //this.tx繧ケ繧ウ繧「繝懊シ繝閏0] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_scoreboard_0.png" ) ); + //this.tx繧ケ繧ウ繧「繝懊シ繝閏1] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_scoreboard_1.png" ) ); + //this.tx繧ケ繧ウ繧「繝懊シ繝閏2] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_scoreboard_2.png" ) ); + //this.tx繧ケ繧ウ繧「繝懊シ繝閏3] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_scoreboard_3.png" ) ); + //this.tx譁蟄 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_scoreboard_number.png" ) ); + this.t驕ク謚樊峇縺悟、画峩縺輔l縺(); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繝代ロ繝ォ譛ャ菴 ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx譁蟄怜励ヱ繝阪Ν ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧ケ繧ウ繧「繝懊シ繝閏0] ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧ケ繧ウ繧「繝懊シ繝閏1] ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧ケ繧ウ繧「繝懊シ繝閏2] ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧ケ繧ウ繧「繝懊シ繝閏3] ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx譁蟄 ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + if( base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + this.ct逋サ蝣エ繧「繝九Γ逕ィ = new CCounter( 0, 3000, 1, TJAPlayer3.Timer ); + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + this.ct逋サ蝣エ繧「繝九Γ逕ィ.t騾イ陦(); + int x = 980; + int y = 350; + if (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「 != null && this.ct逋サ蝣エ繧「繝九Γ逕ィ.n迴セ蝨ィ縺ョ蛟、 >= 2000 && TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE) + { + //CDTXMania.Tx.SongSelect_ScoreWindow_Text.n騾乗主コヲ = ct逋サ蝣エ繧「繝九Γ逕ィ.n迴セ蝨ィ縺ョ蛟、 - 1745; + if (TJAPlayer3.Tx.SongSelect_ScoreWindow[TJAPlayer3.stage驕ク譖イ.n迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ縺ョ髮」譏灘コヲ] != null) + { + //CDTXMania.Tx.SongSelect_ScoreWindow[CDTXMania.stage驕ク譖イ.n迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ縺ョ髮」譏灘コヲ].n騾乗主コヲ = ct逋サ蝣エ繧「繝九Γ逕ィ.n迴セ蝨ィ縺ョ蛟、 - 1745; + TJAPlayer3.Tx.SongSelect_ScoreWindow[TJAPlayer3.stage驕ク譖イ.n迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ縺ョ髮」譏灘コヲ].t2D謠冗判(TJAPlayer3.app.Device, x, y); + this.t蟆乗枚蟄苓。ィ遉コ(x + 56, y + 160, string.Format("{0,7:######0}", TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝上う繧ケ繧ウ繧「[TJAPlayer3.stage驕ク譖イ.n迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ縺ョ髮」譏灘コヲ].ToString())); + TJAPlayer3.Tx.SongSelect_ScoreWindow_Text.t2D謠冗判(TJAPlayer3.app.Device, x + 236, y + 166, new Rectangle(0, 36, 32, 30)); + } + } + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private CCounter ct逋サ蝣エ繧「繝九Γ逕ィ; + private CCounter ct繧ケ繧ウ繧「繝懊シ繝臥匳蝣エ繧「繝九Γ; + private Font ft陦ィ遉コ逕ィ繝輔か繝ウ繝; + private int n譛ャ菴店; + private int n譛ャ菴添; + //private CTexture tx繝代ロ繝ォ譛ャ菴; + private CTexture tx譁蟄怜励ヱ繝阪Ν; + // private CTexture[] tx繧ケ繧ウ繧「繝懊シ繝 = new CTexture[4]; + // private CTexture tx譁蟄; + //----------------- + + [StructLayout(LayoutKind.Sequential)] + private struct ST譁蟄嶺ス咲スョ + { + public char ch; + public Point pt; + } + private readonly ST譁蟄嶺ス咲スョ[] st蟆乗枚蟄嶺ス咲スョ; + private void t蟆乗枚蟄苓。ィ遉コ(int x, int y, string str) + { + foreach (char ch in str) + { + for (int i = 0; i < this.st蟆乗枚蟄嶺ス咲スョ.Length; i++) + { + if (this.st蟆乗枚蟄嶺ス咲スョ[i].ch == ch) + { + Rectangle rectangle = new Rectangle( this.st蟆乗枚蟄嶺ス咲スョ[i].pt.X, this.st蟆乗枚蟄嶺ス咲スョ[i].pt.Y, 26, 36 ); + if (TJAPlayer3.Tx.SongSelect_ScoreWindow_Text != null) + { + TJAPlayer3.Tx.SongSelect_ScoreWindow_Text.t2D謠冗判(TJAPlayer3.app.Device, x, y, rectangle); + } + break; + } + } + x += 26; + } + } + + public void tSongChange() + { + this.ct逋サ蝣エ繧「繝九Γ逕ィ = new CCounter( 0, 3000, 1, TJAPlayer3.Timer ); + } + + + #endregion + } +} diff --git a/TJAPlayer3/Stages/05.SongSelect/CActSelect髮」譏灘コヲ驕ク謚樒判髱「.cs b/TJAPlayer3/Stages/05.SongSelect/CActSelect髮」譏灘コヲ驕ク謚樒判髱「.cs new file mode 100644 index 00000000..86f51f82 --- /dev/null +++ b/TJAPlayer3/Stages/05.SongSelect/CActSelect髮」譏灘コヲ驕ク謚樒判髱「.cs @@ -0,0 +1,490 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Globalization; +using System.Runtime.InteropServices; +using System.Drawing; +using System.Drawing.Imaging; +using System.Diagnostics; +using System.Drawing.Text; + +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + /// + /// 髮」譏灘コヲ驕ク謚樒判髱「縲 + /// 縺薙ョ髮」譏灘コヲ驕ク謚樒判髱「縺ッAC7ス暸C14縺ョ繧医≧縺ェ譁ケ蠑上〒縺ゅj縲仝ii縺セ縺溘ッAC15遘サ陦後ョ譁ケ蠑上→縺ッ逡ー縺ェ繧九 + /// + internal class CActSelect髮」譏灘コヲ驕ク謚樒判髱「 : CActivity + { + // 繝励Ο繝代ユ繧」 + + public bool bIsDifficltSelect; + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CActSelect髮」譏灘コヲ驕ク謚樒判髱「() + { + for(int i = 0; i < 10; i++) + { + st蟆乗枚蟄嶺ス咲スョ[i].ptX = i * 18; + st蟆乗枚蟄嶺ス咲スョ[i].ch = i.ToString().ToCharArray()[0]; + } + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + public void t谺。縺ォ遘サ蜍(int player) + { + if (n迴セ蝨ィ縺ョ驕ク謚櫁。啓player] < 5) + { + ctBarAnime[player].t髢句ァ(0, 180, 1, TJAPlayer3.Timer); + if (!b陬剰ュ憺擇) + { + n迴セ蝨ィ縺ョ驕ク謚櫁。啓player]++; + } + else + { + if (n迴セ蝨ィ縺ョ驕ク謚櫁。啓player] == 4) + { + n迴セ蝨ィ縺ョ驕ク謚櫁。啓player] += 2; + } + else + { + n迴セ蝨ィ縺ョ驕ク謚櫁。啓player]++; + } + } + } + else if (n迴セ蝨ィ縺ョ驕ク謚櫁。啓player] >= 5) + { + if (n繧ケ繧、繝繝√き繧ヲ繝ウ繝 < 0 && TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[4] >= 0) + { + n繧ケ繧、繝繝√き繧ヲ繝ウ繝++; + } + else if (n繧ケ繧、繝繝√き繧ヲ繝ウ繝 == 0 && TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[4] >= 0) + { + for(int i = 0; i < 2; i++) + { + if(!bSelect[i]) + { + if (n迴セ蝨ィ縺ョ驕ク謚櫁。啓i] == 5) + { + n迴セ蝨ィ縺ョ驕ク謚櫁。啓i] = 6; + } + else if (n迴セ蝨ィ縺ョ驕ク謚櫁。啓i] == 6) + { + n迴セ蝨ィ縺ョ驕ク謚櫁。啓i] = 5; + } + } + } + + b陬剰ュ憺擇 = !b陬剰ュ憺擇; + n繧ケ繧、繝繝√き繧ヲ繝ウ繝 = 0; + } + } + } + + public void t蜑阪↓遘サ蜍(int player) + { + if(n迴セ蝨ィ縺ョ驕ク謚櫁。啓player] - 1 >= 0) + { + ctBarAnime[player].t髢句ァ(0, 180, 1, TJAPlayer3.Timer); + n繧ケ繧、繝繝√き繧ヲ繝ウ繝 = 0; + if(n迴セ蝨ィ縺ョ驕ク謚櫁。啓player] == 6) + n迴セ蝨ィ縺ョ驕ク謚櫁。啓player] -= 2; + else + n迴セ蝨ィ縺ョ驕ク謚櫁。啓player]--; + } + } + + public void t驕ク謚樒判髱「蛻晄悄蛹() + { + if (!string.IsNullOrEmpty(TJAPlayer3.ConfigIni.FontName)) + { + this.pfTitle = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), 28); + this.pfSubTitle = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), 16); + } + else + { + this.pfTitle = new CPrivateFastFont(new FontFamily("MS UI Gothic"), 28); + this.pfSubTitle = new CPrivateFastFont(new FontFamily("MS UI Gothic"), 16); + } + + this.txTitle = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(pfTitle.DrawPrivateFont(TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ソ繧、繝医Ν, Color.White, Color.Black )); + this.txSubTitle = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(pfSubTitle.DrawPrivateFont(TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧オ繝悶ち繧、繝医Ν, Color.White, Color.Black)); + + this.n迴セ蝨ィ縺ョ驕ク謚櫁。 = new int[2]; + this.bSelect[0] = false; + this.bSelect[1] = false; + this.b陬剰ュ憺擇 = false; + + this.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = true; + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + if( this.b豢サ諤ァ蛹悶@縺ヲ繧 ) + return; + ctBarAnime = new CCounter[2]; + ctBarAnime[0] = new CCounter(); + ctBarAnime[1] = new CCounter(); + + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return; + + ctBarAnime = null; + + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return; + + // this.soundSelectAnnounce = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧( CSkin.Path( @"Sounds\DiffSelect.ogg" ), ESoundGroup.SoundEffect ); + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return; + + // TJAPlayer3.t螳牙ィ縺ォDispose縺吶k( ref this.soundSelectAnnounce ); + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + public override int On騾イ陦梧緒逕サ() + { + if (this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + return 0; + + #region [ 蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ] + //----------------- + if (this.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ) + { + ctBarAnimeIn = new CCounter(0, 170, 4, TJAPlayer3.Timer); + // this.soundSelectAnnounce?.t繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k(); + TJAPlayer3.Skin.soundSelectAnnounce.t蜀咲函縺吶k(); + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + //----------------- + #endregion + + ctBarAnimeIn.t騾イ陦(); + ctBarAnime[0].t騾イ陦(); + ctBarAnime[1].t騾イ陦(); + + #region [ 繧ュ繝シ蜈・蜉 ] + + if (this.ctBarAnimeIn.b邨ゆコ蛟、縺ォ驕斐@縺) + { + if (!bSelect[0] && !bOption[0]) + { + if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RBlue) || TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.RightArrow)) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + this.t谺。縺ォ遘サ蜍(0); + } + else if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LBlue) || TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.LeftArrow)) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + this.t蜑阪↓遘サ蜍(0); + } + if (TJAPlayer3.Pad.b謚シ縺輔l縺櫂GB(E繝代ャ繝.Decide) || TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LRed) || TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RRed) || + (TJAPlayer3.ConfigIni.bEnter縺後く繝シ蜑イ繧雁ス薙※縺ョ縺ゥ縺薙↓繧ゆスソ逕ィ縺輔l縺ヲ縺縺ェ縺 && TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.Return))) + { + if (n迴セ蝨ィ縺ョ驕ク謚櫁。啓0] == 0) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + TJAPlayer3.stage驕ク譖イ.act譖イ繝ェ繧ケ繝.ctBarOpen.t髢句ァ(100, 260, 2, TJAPlayer3.Timer); + this.bIsDifficltSelect = false; + } + else if (n迴セ蝨ィ縺ョ驕ク謚櫁。啓0] == 1) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + bOption[0] = true; + } + else + { + if (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[n迴セ蝨ィ縺ョ驕ク謚櫁。啓0] - 2] > 0) + { + TJAPlayer3.stage驕ク譖イ.ctDonchan_Jump[0].t髢句ァ(0, TJAPlayer3.Tx.SongSelect_Donchan_Jump.Length - 1, 1000 / 45, TJAPlayer3.Timer); + this.bSelect[0] = true; + TJAPlayer3.Skin.sound譖イ豎コ螳夐浹.t蜀咲函縺吶k(); + + if(TJAPlayer3.ConfigIni.nPlayerCount == 2) + { + if (bSelect[1]) + { + TJAPlayer3.stage驕ク譖イ.t譖イ繧帝∈謚槭☆繧(n迴セ蝨ィ縺ョ驕ク謚櫁。啓0] - 2, 0); + TJAPlayer3.stage驕ク譖イ.t譖イ繧帝∈謚槭☆繧(n迴セ蝨ィ縺ョ驕ク謚櫁。啓1] - 2, 1); + } + } + else + { + TJAPlayer3.stage驕ク譖イ.t譖イ繧帝∈謚槭☆繧(n迴セ蝨ィ縺ョ驕ク謚櫁。啓0] - 2, 0); + } + } + } + } + } + + if (!bSelect[1] && !bOption[1]) + { + if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RBlue2P)) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + this.t谺。縺ォ遘サ蜍(1); + } + else if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LBlue2P)) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + this.t蜑阪↓遘サ蜍(1); + } + if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LRed2P) || TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RRed2P)) + { + if (n迴セ蝨ィ縺ョ驕ク謚櫁。啓1] == 0) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + TJAPlayer3.stage驕ク譖イ.act譖イ繝ェ繧ケ繝.ctBarOpen.t髢句ァ(100, 260, 2, TJAPlayer3.Timer); + this.bIsDifficltSelect = false; + } + else if (n迴セ蝨ィ縺ョ驕ク謚櫁。啓1] == 1) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + bOption[1] = true; + } + else + { + if (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[n迴セ蝨ィ縺ョ驕ク謚櫁。啓1] - 2] > 0) + { + TJAPlayer3.stage驕ク譖イ.ctDonchan_Jump[1].t髢句ァ(0, TJAPlayer3.Tx.SongSelect_Donchan_Jump.Length - 1, 1000 / 45, TJAPlayer3.Timer); + this.bSelect[1] = true; + TJAPlayer3.Skin.sound譖イ豎コ螳夐浹.t蜀咲函縺吶k(); + + if (bSelect[0]) + { + TJAPlayer3.stage驕ク譖イ.t譖イ繧帝∈謚槭☆繧(n迴セ蝨ィ縺ョ驕ク謚櫁。啓0] - 2, 0); + TJAPlayer3.stage驕ク譖イ.t譖イ繧帝∈謚槭☆繧(n迴セ蝨ィ縺ョ驕ク謚櫁。啓1] - 2, 1); + } + } + } + } + } + } + + #endregion + + #region [ 逕サ蜒乗緒逕サ ] + + TJAPlayer3.Tx.Difficulty_Back[nStr繧ク繝」繝ウ繝ォtoNum(TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].Opacity = + (TJAPlayer3.stage驕ク譖イ.act譖イ繝ェ繧ケ繝.ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1255); + TJAPlayer3.Tx.Difficulty_Bar.Opacity = (TJAPlayer3.stage驕ク譖イ.act譖イ繝ェ繧ケ繝.ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1255); + TJAPlayer3.Tx.Difficulty_Number.Opacity = (TJAPlayer3.stage驕ク譖イ.act譖イ繝ェ繧ケ繝.ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1255); + TJAPlayer3.Tx.Difficulty_Crown.Opacity = (TJAPlayer3.stage驕ク譖イ.act譖イ繝ェ繧ケ繝.ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1255); + TJAPlayer3.Tx.SongSelect_ScoreRank.vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.65f; + TJAPlayer3.Tx.SongSelect_ScoreRank.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.65f; + TJAPlayer3.Tx.SongSelect_ScoreRank.Opacity = (TJAPlayer3.stage驕ク譖イ.act譖イ繝ェ繧ケ繝.ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1255); + TJAPlayer3.Tx.Difficulty_Star.Opacity = (TJAPlayer3.stage驕ク譖イ.act譖イ繝ェ繧ケ繝.ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 - 1255); + + TJAPlayer3.Tx.Difficulty_Back[nStr繧ク繝」繝ウ繝ォtoNum(TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ)].t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640, 290); + + for(int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + TJAPlayer3.Tx.Difficulty_Select_Bar[i].Opacity = (int)(ctBarAnimeIn.n迴セ蝨ィ縺ョ蛟、 >= 80 ? (ctBarAnimeIn.n迴セ蝨ィ縺ョ蛟、 - 80) * 2.84f : 0); + TJAPlayer3.Tx.Difficulty_Select_Bar[i].t2D謠冗判(TJAPlayer3.app.Device, (float)this.BarX[n迴セ蝨ィ縺ョ驕ク謚櫁。啓i]], 242, new RectangleF(0, (n迴セ蝨ィ縺ョ驕ク謚櫁。啓i] >= 2 ? 114 : 387), 259, 275 - (n迴セ蝨ィ縺ョ驕ク謚櫁。啓i] >= 2 ? 0 : 164))); + } + + TJAPlayer3.Tx.Difficulty_Bar.color4 = new Color4(1.0f, 1.0f, 1.0f); + TJAPlayer3.Tx.Difficulty_Bar.t2D謠冗判(TJAPlayer3.app.Device, 255, 270, new RectangleF(0, 0, 171, 236)); //髢峨§繧九∵シ泌・上が繝励す繝ァ繝ウ + + for (int i = 0; i < 3; i++) + { + if(TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[i] > 0) + TJAPlayer3.Tx.Difficulty_Bar.color4 = new Color4(1.0f, 1.0f, 1.0f); + else + TJAPlayer3.Tx.Difficulty_Bar.color4 = new Color4(0.5f, 0.5f, 0.5f); + + TJAPlayer3.Tx.Difficulty_Bar.t2D謠冗判(TJAPlayer3.app.Device, 255 + 171 + 143 * i, 270, new RectangleF(171 + 143 * i, 0, 143, 236)); //髢峨§繧具ス樣屮縺励>縺セ縺ァ + + TJAPlayer3.Tx.Difficulty_Crown.t2D謠冗判(TJAPlayer3.app.Device, 445 + i * 144, 284, new RectangleF(TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ッ繝ェ繧「[i] * 24.5f, 0, 24.5f, 26)); + + if(TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[i] != 0) + TJAPlayer3.Tx.SongSelect_ScoreRank.t2D謠冗判(TJAPlayer3.app.Device, 467 + i * 144, 281, new RectangleF(0, (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[i] - 1) * 42.71f, 50, 42.71f)); + + if (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[i] > 0) + t蟆乗枚蟄苓。ィ遉コ(TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[i].ToString(), 498 + i * 144, 434.5f); + + + + for (int g = 0; g < 10; g++) + { + if (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[i] > g + 10) + TJAPlayer3.Tx.Difficulty_Star_Red.t2D謠冗判(TJAPlayer3.app.Device, 444 + i * 143 + g * 10, 459); + else if (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[i] > g) + TJAPlayer3.Tx.Difficulty_Star.t2D謠冗判(TJAPlayer3.app.Device, 444 + i * 143 + g * 10, 459); + } + } + + if (b陬剰ュ憺擇) + { + if (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[4] > 0) + TJAPlayer3.Tx.Difficulty_Bar.color4 = new Color4(1.0f, 1.0f, 1.0f); + else + TJAPlayer3.Tx.Difficulty_Bar.color4 = new Color4(0.5f, 0.5f, 0.5f); + + TJAPlayer3.Tx.Difficulty_Bar.t2D謠冗判(TJAPlayer3.app.Device, 855, 270, new RectangleF(743, 0, 138, 236)); + + TJAPlayer3.Tx.Difficulty_Crown.t2D謠冗判(TJAPlayer3.app.Device, 445 + 3 * 144, 284, new RectangleF(TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ッ繝ェ繧「[4] * 24.5f, 0, 24.5f, 26)); + + if (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[4] != 0) + TJAPlayer3.Tx.SongSelect_ScoreRank.t2D謠冗判(TJAPlayer3.app.Device, 467 + 3 * 144, 281, new RectangleF(0, (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[4] - 1) * 42.71f, 50, 42.71f)); + + if (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[4] > 0) + t蟆乗枚蟄苓。ィ遉コ(TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[4].ToString(), 498 + 3 * 143, 434.5f); + + for (int g = 0; g < 10; g++) + { + if (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[4] > g + 10) + TJAPlayer3.Tx.Difficulty_Star_Red.t2D謠冗判(TJAPlayer3.app.Device, 444 + 3 * 143 + g * 10, 459); + else if (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[4] > g) + TJAPlayer3.Tx.Difficulty_Star.t2D謠冗判(TJAPlayer3.app.Device, 444 + 3 * 143 + g * 10, 459); + } + + } + else + { + if (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[3] > 0) + TJAPlayer3.Tx.Difficulty_Bar.color4 = new Color4(1.0f, 1.0f, 1.0f); + else + TJAPlayer3.Tx.Difficulty_Bar.color4 = new Color4(0.5f, 0.5f, 0.5f); + + TJAPlayer3.Tx.Difficulty_Bar.t2D謠冗判(TJAPlayer3.app.Device, 855, 270, new RectangleF(600, 0, 143, 236)); + + TJAPlayer3.Tx.Difficulty_Crown.t2D謠冗判(TJAPlayer3.app.Device, 445 + 3 * 144, 284, new RectangleF(TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ッ繝ェ繧「[3] * 24.5f, 0, 24.5f, 26)); + + if (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[3] != 0) + TJAPlayer3.Tx.SongSelect_ScoreRank.t2D謠冗判(TJAPlayer3.app.Device, 467 + 3 * 144, 281, new RectangleF(0, (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.ar繧ケ繧ウ繧「[3].隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[3] - 1) * 42.71f, 50, 42.71f)); + + if (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[3] > 0) + t蟆乗枚蟄苓。ィ遉コ(TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[3].ToString(), 498 + 3 * 143, 434.5f); + + for (int g = 0; g < 10; g++) + { + if (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[3] > g + 10) + TJAPlayer3.Tx.Difficulty_Star_Red.t2D謠冗判(TJAPlayer3.app.Device, 444 + 3 * 143 + g * 10, 459); + else if (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝ャ繝吶Ν[3] > g) + TJAPlayer3.Tx.Difficulty_Star.t2D謠冗判(TJAPlayer3.app.Device, 444 + 3 * 143 + g * 10, 459); + } + } + + this.txTitle.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640 + TJAPlayer3.Skin.SongSelect_Title_X, 140 + TJAPlayer3.Skin.SongSelect_Title_Y); + this.txSubTitle.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 640 + TJAPlayer3.Skin.SongSelect_Title_X, 180 + TJAPlayer3.Skin.SongSelect_Title_Y); + + #region [ 繝舌シ縺ョ謠冗判 ] + + for(int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + TJAPlayer3.Tx.Difficulty_Select_Bar[i].t2D謠冗判(TJAPlayer3.app.Device, + TJAPlayer3.ConfigIni.nPlayerCount == 2 ? n迴セ蝨ィ縺ョ驕ク謚櫁。啓0] != n迴セ蝨ィ縺ョ驕ク謚櫁。啓1] ? (float)this.BarX[n迴セ蝨ィ縺ョ驕ク謚櫁。啓i]] : i == 0 ? (float)this.BarX[n迴セ蝨ィ縺ョ驕ク謚櫁。啓i]] - 25 : (float)this.BarX[n迴セ蝨ィ縺ョ驕ク謚櫁。啓i]] + 25 : (float)this.BarX[n迴セ蝨ィ縺ョ驕ク謚櫁。啓i]], + 126 + ((float)Math.Sin((float)(ctBarAnimeIn.n迴セ蝨ィ縺ョ蛟、 >= 80 ? (ctBarAnimeIn.n迴セ蝨ィ縺ョ蛟、 - 80) : 0) * (Math.PI / 180)) * 50) + (float)Math.Sin((float)ctBarAnime[i].n迴セ蝨ィ縺ョ蛟、 * (Math.PI / 180)) * 10, + new RectangleF(0, 0, 259, 114)); + } + + #endregion + + #endregion + + return 0; + } + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + + public bool[] bSelect = new bool[2]; + public bool[] bOption = new bool[2]; + + private CPrivateFastFont pfTitle; + private CPrivateFastFont pfSubTitle; + private CTexture txTitle; + private CTexture txSubTitle; + + private CCounter ctBarAnimeIn; + private CCounter[] ctBarAnime = new CCounter[2]; + + //0 髢峨§繧 1 貍泌・上が繝励す繝ァ繝ウ 2~ 髮」譏灘コヲ + private int[] n迴セ蝨ィ縺ョ驕ク謚櫁。; + private int n繧ケ繧、繝繝√き繧ヲ繝ウ繝; + + private bool b陬剰ュ憺擇; + //176 + private int[] BarX = new int[] { 163, 251, 367, 510, 653, 797, 797 }; + + private CSound soundSelectAnnounce; + + [StructLayout(LayoutKind.Sequential)] + private struct ST繝ャ繝吶Ν謨ー蟄 + { + public char ch; + public int ptX; + } + private ST繝ャ繝吶Ν謨ー蟄夕] st蟆乗枚蟄嶺ス咲スョ = new ST繝ャ繝吶Ν謨ー蟄夕10]; + + private void t蟆乗枚蟄苓。ィ遉コ(string str, float x, float y) + { + foreach (char ch in str) + { + for (int i = 0; i < this.st蟆乗枚蟄嶺ス咲スョ.Length; i++) + { + if (this.st蟆乗枚蟄嶺ス咲スョ[i].ch == ch) + { + Rectangle rectangle = new Rectangle(this.st蟆乗枚蟄嶺ス咲スョ[i].ptX, 0, 18, 23); + if (TJAPlayer3.Tx.Difficulty_Number != null) + { + TJAPlayer3.Tx.Difficulty_Number.t2D謠冗判(TJAPlayer3.app.Device, x, y, rectangle); + } + break; + } + } + x += 11; + } + } + + public int nStr繧ク繝」繝ウ繝ォtoNum(string str繧ク繝」繝ウ繝ォ) + { + int nGenre = 8; + for (int i = 0; i < TJAPlayer3.Skin.SongSelect_GenreName.Length; i++) + { + if (TJAPlayer3.Skin.SongSelect_GenreName[i] == str繧ク繝」繝ウ繝ォ) + { + if (i + 1 >= TJAPlayer3.Skin.SongSelect_Difficulty_Background_Count) + { + nGenre = 0; + } + else + { + nGenre = i + 1; + } + break; + } + else + { + nGenre = 0; + } + } + return nGenre; + } + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/05.SongSelect/CActSortSongs.cs b/TJAPlayer3/Stages/05.SongSelect/CActSortSongs.cs new file mode 100644 index 00000000..052bdfa6 --- /dev/null +++ b/TJAPlayer3/Stages/05.SongSelect/CActSortSongs.cs @@ -0,0 +1,165 @@ +サソusing System.Collections.Generic; + +namespace TJAPlayer3 +{ + internal class CActSortSongs : CActSelectPopupMenu + { + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CActSortSongs() + { + List lci = new List(); + lci.Add( new CItemList( "邨カ蟇セ繝代せ", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, 0, "", "", new string[] { "Z,Y,X,...", "A,B,C,..." } ) ); + lci.Add( new CItemList( "譖イ蜷", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, 0, "", "", new string[] { "Z,Y,X,...", "A,B,C,..." } ) ); + //lci.Add( new CItemList( "Level", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, 0, "", "", new string[] { "99,98,97,...", "1,2,3,..." } ) ); + //lci.Add( new CItemList( "Best Rank", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, 0, "", "", new string[] { "E,D,C,...", "SS,S,A,..." } ) ); + //lci.Add( new CItemList( "PlayCount", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, 0, "", "", new string[] { "10,9,8,...", "1,2,3,..." } ) ); + //lci.Add( new CItemList( "Author", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, 0, "", "", new string[] { "Z,Y,X,...", "A,B,C,..." } ) ); + //lci.Add( new CItemList( "SkillPoint", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, 0, "", "", new string[] { "100,99,98,...", "1,2,3,..." } ) ); +#if TEST_SORTBGM + lci.Add( new CItemList( "BPM", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, 0, "", "", new string[] { "300,200,...", "70,80,90,..." } ) ); +#endif + lci.Add( new CItemList( "繧ク繝」繝ウ繝ォ", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, 0, "", "", new string[] { "AC15", "AC8-14" } ) ); + lci.Add( new CItemList( "謌サ繧", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, 0, "", "", new string[] { "", "" } ) ); + + base.Initialize( lci, false, "SORT MENU" ); + } + + + // 繝。繧ス繝繝 + public void tActivatePopupMenu( E讌ス蝎ィ繝代シ繝 einst, ref CActSelect譖イ繝ェ繧ケ繝 ca ) + { + this.act譖イ繝ェ繧ケ繝 = ca; + base.tActivatePopupMenu( einst ); + } + //public void tDeativatePopupMenu() + //{ + // base.tDeativatePopupMenu(); + //} + + + public override void tEnter謚シ荳貴ain( int nSortOrder ) + { + nSortOrder *= 2; // 0,1 => -1, 1 + nSortOrder -= 1; + switch ( (EOrder)n迴セ蝨ィ縺ョ驕ク謚櫁。 ) + { + case EOrder.Path: + this.act譖イ繝ェ繧ケ繝.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝( + CSongs邂。逅.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝1_邨カ蟇セ繝代せ鬆, eInst, nSortOrder + ); + this.act譖イ繝ェ繧ケ繝.t驕ク謚樊峇縺悟、画峩縺輔l縺(true); + break; + case EOrder.Title: + this.act譖イ繝ェ繧ケ繝.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝( + CSongs邂。逅.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝2_繧ソ繧、繝医Ν鬆, eInst, nSortOrder + ); + this.act譖イ繝ェ繧ケ繝.t驕ク謚樊峇縺悟、画峩縺輔l縺(true); + break; + //case (int) EOrder.Level: + // this.act譖イ繝ェ繧ケ繝.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝( + // CSongs邂。逅.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝4_LEVEL鬆, eInst, nSortOrder, + // this.act譖イ繝ェ繧ケ繝.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν + // ); + // this.act譖イ繝ェ繧ケ繝.t驕ク謚樊峇縺悟、画峩縺輔l縺( true ); + // break; + //case (int) EOrder.BestRank: + // this.act譖イ繝ェ繧ケ繝.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝( + // CSongs邂。逅.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝5_BestRank鬆, eInst, nSortOrder, + // this.act譖イ繝ェ繧ケ繝.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν + // ); + // break; + //case (int) EOrder.PlayCount: + // // this.act譖イ繝ェ繧ケ繝.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝3_貍泌・丞屓謨ー縺ョ螟壹>鬆( eInst, nSortOrder ); + // this.act譖イ繝ェ繧ケ繝.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝( + // CSongs邂。逅.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝3_貍泌・丞屓謨ー縺ョ螟壹>鬆, eInst, nSortOrder, + // this.act譖イ繝ェ繧ケ繝.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν + // ); + // this.act譖イ繝ェ繧ケ繝.t驕ク謚樊峇縺悟、画峩縺輔l縺( true ); + // break; + //case (int) EOrder.Author: + // this.act譖イ繝ェ繧ケ繝.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝( + // CSongs邂。逅.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝8_繧「繝シ繝繧」繧ケ繝亥錐鬆, eInst, nSortOrder, + // this.act譖イ繝ェ繧ケ繝.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν + // ); + // this.act譖イ繝ェ繧ケ繝.t驕ク謚樊峇縺悟、画峩縺輔l縺( true ); + // break; + //case (int) EOrder.SkillPoint: + // this.act譖イ繝ェ繧ケ繝.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝( + // CSongs邂。逅.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝6_SkillPoint鬆, eInst, nSortOrder, + // this.act譖イ繝ェ繧ケ繝.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν + // ); + // this.act譖イ繝ェ繧ケ繝.t驕ク謚樊峇縺悟、画峩縺輔l縺( true ); + // break; +#if TEST_SORTBGM + case (int) ESortItem.BPM: + this.act譖イ繝ェ繧ケ繝.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝( + CSongs邂。逅.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝9_BPM鬆, eInst, nSortOrder, + this.act譖イ繝ェ繧ケ繝.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν + ); + this.act譖イ繝ェ繧ケ繝.t驕ク謚樊峇縺悟、画峩縺輔l縺(true); + break; +#endif + //繧ク繝」繝ウ繝ォ鬆 + case EOrder.Genre: + this.act譖イ繝ェ繧ケ繝.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝( + //CDTXMania.Songs邂。逅.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝7_譖エ譁ー譌・譎る, eInst, nSortOrder, + //this.act譖イ繝ェ繧ケ繝.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν + CSongs邂。逅.t譖イ繝ェ繧ケ繝医ョ繧ス繝シ繝9_繧ク繝」繝ウ繝ォ鬆, eInst, nSortOrder, 0 + ); + this.act譖イ繝ェ繧ケ繝.t驕ク謚樊峇縺悟、画峩縺輔l縺( true ); + break; + case EOrder.Return: + this.tDeativatePopupMenu(); + break; + default: + break; + } + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + //this.e迴セ蝨ィ縺ョ繧ス繝シ繝 = EOrder.Title; + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + base.On髱樊エサ諤ァ蛹(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + #region [ private ] + //----------------- + + private CActSelect譖イ繝ェ繧ケ繝 act譖イ繝ェ繧ケ繝; + + private enum EOrder : int + { + Path = 0, + Title = 1, + Genre = 2, + Return = 3 + } + + //----------------- + #endregion + } + + +} diff --git a/TJAPlayer3/Stages/05.SongSelect/CStage驕ク譖イ.cs b/TJAPlayer3/Stages/05.SongSelect/CStage驕ク譖イ.cs new file mode 100644 index 00000000..88e3f02a --- /dev/null +++ b/TJAPlayer3/Stages/05.SongSelect/CStage驕ク譖イ.cs @@ -0,0 +1,1297 @@ +サソusing FDK; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Runtime.InteropServices; +using System.Text; + +namespace TJAPlayer3 +{ + internal class CStage驕ク譖イ : CStage + { + // 繝励Ο繝代ユ繧」 + public int n繧ケ繧ッ繝ュ繝シ繝ォ繝舌シ逶ク蟇セy蠎ァ讓 + { + get + { + if (act譖イ繝ェ繧ケ繝 != null) + { + return act譖イ繝ェ繧ケ繝.n繧ケ繧ッ繝ュ繝シ繝ォ繝舌シ逶ク蟇セy蠎ァ讓; + } + else + { + return 0; + } + } + } + public bool bIsEnumeratingSongs + { + get + { + return act譖イ繝ェ繧ケ繝.bIsEnumeratingSongs; + } + set + { + act譖イ繝ェ繧ケ繝.bIsEnumeratingSongs = value; + } + } + public bool bIsPlayingPremovie + { + get + { + return this.actPreimage繝代ロ繝ォ.bIsPlayingPremovie; + } + } + public bool b繧ケ繧ッ繝ュ繝シ繝ォ荳ュ + { + get + { + return this.act譖イ繝ェ繧ケ繝.b繧ケ繧ッ繝ュ繝シ繝ォ荳ュ; + } + } + public int[] n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ = new int[2]; + + public string str遒コ螳壹&繧後◆譖イ縺ョ繧ク繝」繝ウ繝ォ + { + get; + set; + } + public C繧ケ繧ウ繧「 r遒コ螳壹&繧後◆繧ケ繧ウ繧「 + { + get; + set; + } + public C譖イ繝ェ繧ケ繝医ヮ繝シ繝 r遒コ螳壹&繧後◆譖イ + { + get; + set; + } + public int n迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ縺ョ髮」譏灘コヲ + { + get + { + return this.act譖イ繝ェ繧ケ繝.n迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ縺ョ迴セ蝨ィ縺ョ髮」譏灘コヲ繝ャ繝吶Ν; + } + } + public C繧ケ繧ウ繧「 r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「 + { + get + { + return this.act譖イ繝ェ繧ケ繝.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「; + } + } + public C譖イ繝ェ繧ケ繝医ヮ繝シ繝 r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ + { + get + { + return this.act譖イ繝ェ繧ケ繝.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ; + } + } + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + public CStage驕ク譖イ() + { + base.e繧ケ繝繝シ繧クID = CStage.E繧ケ繝繝シ繧ク.驕ク譖イ; + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷; + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + base.list蟄植ctivities.Add(this.act繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ = new CAct繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ()); + base.list蟄植ctivities.Add(this.actFIFO = new CActFIFOBlack()); + base.list蟄植ctivities.Add(this.actFIfrom邨先棡逕サ髱「 = new CActFIFOBlack()); + //base.list蟄植ctivities.Add( this.actFOtoNowLoading = new CActFIFOBlack() ); + base.list蟄植ctivities.Add(this.actFOtoNowLoading = new CActFIFOStart()); + base.list蟄植ctivities.Add(this.act譖イ繝ェ繧ケ繝 = new CActSelect譖イ繝ェ繧ケ繝()); + base.list蟄植ctivities.Add(this.act繧ケ繝繝シ繧ソ繧ケ繝代ロ繝ォ = new CActSelect繧ケ繝繝シ繧ソ繧ケ繝代ロ繝ォ()); + base.list蟄植ctivities.Add(this.act貍泌・丞ア・豁エ繝代ロ繝ォ = new CActSelect貍泌・丞ア・豁エ繝代ロ繝ォ()); + base.list蟄植ctivities.Add(this.actPreimage繝代ロ繝ォ = new CActSelectPreimage繝代ロ繝ォ()); + base.list蟄植ctivities.Add(this.actPresound = new CActSelectPresound()); + base.list蟄植ctivities.Add(this.actArtistComment = new CActSelectArtistComment()); + base.list蟄植ctivities.Add(this.actInformation = new CActSelectInformation()); + base.list蟄植ctivities.Add(this.actSortSongs = new CActSortSongs()); + base.list蟄植ctivities.Add(this.actShowCurrentPosition = new CActSelectShowCurrentPosition()); + base.list蟄植ctivities.Add(this.actQuickConfig = new CActSelectQuickConfig()); + base.list蟄植ctivities.Add(this.act髮」譏灘コヲ驕ク謚樒判髱「 = new CActSelect髮」譏灘コヲ驕ク謚樒判髱「()); + base.list蟄植ctivities.Add(this.actPlayOption = new CActPlayOption()); + + for(int i = 0; i < 10; i++) + { + stTimer[i].ch = i.ToString().ToCharArray()[0]; + stTimer[i].pt = new Point(46 * i, 0); + } + + for(int i = 0; i < 10; i++) + { + stSongNumber[i].ch = i.ToString().ToCharArray()[0]; + stSongNumber[i].pt = new Point(27 * i, 0); + } + + for(int i = 0; i < 10; i++) + { + stBoardNumber[i].ch = i.ToString().ToCharArray()[0]; + stBoardNumber[i].pt = new Point(15 * i, 0); + } + + this.CommandHistory = new CCommandHistory(); // #24063 2011.1.16 yyagi + } + + + // 繝。繧ス繝繝 + + public void t驕ク謚樊峇螟画峩騾夂衍() + { + this.actPreimage繝代ロ繝ォ.t驕ク謚樊峇縺悟、画峩縺輔l縺(); + this.actPresound.t驕ク謚樊峇縺悟、画峩縺輔l縺(); + this.act貍泌・丞ア・豁エ繝代ロ繝ォ.t驕ク謚樊峇縺悟、画峩縺輔l縺(); + this.act繧ケ繝繝シ繧ソ繧ケ繝代ロ繝ォ.t驕ク謚樊峇縺悟、画峩縺輔l縺(); + this.actArtistComment.t驕ク謚樊峇縺悟、画峩縺輔l縺(); + + #region [ 繝励Λ繧ー繧、繝ウ縺ォ繧る夂衍縺吶kシBOX, RANDOM, BACK 縺ェ繧蛾夂衍縺励↑縺シ云 + //--------------------- + if (TJAPlayer3.app != null) + { + var c譖イ繝ェ繧ケ繝医ヮ繝シ繝 = TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ; + var c繧ケ繧ウ繧「 = TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「; + + if (c譖イ繝ェ繧ケ繝医ヮ繝シ繝 != null && c繧ケ繧ウ繧「 != null && c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE) + { + string str驕ク謚樊峇繝輔ぃ繧、繝ォ蜷 = c繧ケ繧ウ繧「.繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ; + int n譖イ逡ェ蜿キin繝悶Ο繝繧ッ = TJAPlayer3.stage驕ク譖イ.act譖イ繝ェ繧ケ繝.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν縺ォ譛繧りソ代>髮」譏灘コヲ繝ャ繝吶Ν繧定ソ斐☆(c譖イ繝ェ繧ケ繝医ヮ繝シ繝); + + foreach (TJAPlayer3.STPlugin stPlugin in TJAPlayer3.app.list繝励Λ繧ー繧、繝ウ) + { + Directory.SetCurrentDirectory(stPlugin.str繝励Λ繧ー繧、繝ウ繝輔か繝ォ繝); + stPlugin.plugin.On驕ク謚樊峇螟画峩(str驕ク謚樊峇繝輔ぃ繧、繝ォ蜷, n譖イ逡ェ蜿キin繝悶Ο繝繧ッ); + Directory.SetCurrentDirectory(TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝); + } + } + } + //--------------------- + #endregion + } + + // CStage 螳溯」 + + /// + /// 譖イ繝ェ繧ケ繝医r繝ェ繧サ繝繝医☆繧 + /// + /// + public void Refresh(CSongs邂。逅 cs, bool bRemakeSongTitleBar) + { + this.act譖イ繝ェ繧ケ繝.Refresh(cs, bRemakeSongTitleBar); + } + + public override void On豢サ諤ァ蛹() + { + Trace.TraceInformation("驕ク譖イ繧ケ繝繝シ繧ク繧呈エサ諤ァ蛹悶@縺セ縺吶"); + Trace.Indent(); + try + { + n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ = new int[2]; + this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、 = E謌サ繧雁、.邯咏カ; + this.bBGM蜀咲函貂医∩ = false; + this.ft繝輔か繝ウ繝 = new Font("MS UI Gothic", 26f, GraphicsUnit.Pixel); + for (int i = 0; i < 2; i++) + this.ct繧ュ繝シ蜿榊セゥ逕ィ[i] = new CCounter(0, 0, 0, TJAPlayer3.Timer); + + ctDonchan_Normal = new CCounter(0, TJAPlayer3.Tx.SongSelect_Donchan_Normal.Length - 1, 1000 / 45, TJAPlayer3.Timer); + ctDonchan_Select = new CCounter(); + ctDonchan_Jump[0] = new CCounter(); + ctDonchan_Jump[1] = new CCounter(); + ctBackgroundFade = new CCounter(); + ctCreditAnime = new CCounter(0, 4500, 1, TJAPlayer3.Timer); + ctTimer = new CCounter(0, 100, 1000, TJAPlayer3.Timer); + + + ctBackgroundFade.n迴セ蝨ィ縺ョ蛟、 = 600; + + if(TJAPlayer3.ConfigIni.bBGM髻ウ繧堤匱螢ー縺吶k) + TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「繧、繝ウ.t蜀咲函縺吶k(); + + for (int i = 0; i < 3; i++) + r[i] = new Random(); + + //this.act髮」譏灘コヲ驕ク謚樒判髱「.bIsDifficltSelect = true; + base.On豢サ諤ァ蛹(); + + this.act繧ケ繝繝シ繧ソ繧ケ繝代ロ繝ォ.t驕ク謚樊峇縺悟、画峩縺輔l縺(); // 譛螟ァ繝ゥ繝ウ繧ッ繧呈峩譁ー + // Discord Presence縺ョ譖エ譁ー + Discord.UpdatePresence("", Properties.Discord.Stage_SongSelect, TJAPlayer3.StartupTime); + + + + if(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ != null) + NowGenre = r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ; + } + finally + { + TJAPlayer3.ConfigIni.eScrollMode = EScrollMode.Normal; + TJAPlayer3.ConfigIni.b繧ケ繧ッ繝ュ繝シ繝ォ繝「繝シ繝峨r荳頑嶌縺 = false; + Trace.TraceInformation("驕ク譖イ繧ケ繝繝シ繧ク縺ョ豢サ諤ァ蛹悶r螳御コ縺励∪縺励◆縲"); + Trace.Unindent(); + } + } + public override void On髱樊エサ諤ァ蛹() + { + Trace.TraceInformation("驕ク譖イ繧ケ繝繝シ繧ク繧帝撼豢サ諤ァ蛹悶@縺セ縺吶"); + Trace.Indent(); + try + { + if (this.ft繝輔か繝ウ繝 != null) + { + this.ft繝輔か繝ウ繝.Dispose(); + this.ft繝輔か繝ウ繝 = null; + } + for (int i = 0; i < 2; i++) + { + this.ct繧ュ繝シ蜿榊セゥ逕ィ[i] = null; + } + base.On髱樊エサ諤ァ蛹(); + } + finally + { + Trace.TraceInformation("驕ク譖イ繧ケ繝繝シ繧ク縺ョ髱樊エサ諤ァ蛹悶r螳御コ縺励∪縺励◆縲"); + Trace.Unindent(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + //this.tx閭梧勹 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_background.jpg" ), false ); + //this.tx荳企Κ繝代ロ繝ォ = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_header_panel.png" ), false ); + //this.tx荳矩Κ繝代ロ繝ォ = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_footer panel.png" ) ); + + //this.txFLIP = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_skill number on gauge etc.png" ), false ); + //this.tx髮」譏灘コヲ蜷 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_difficulty name.png" ) ); + //this.tx繧ク繝」繝ウ繝ォ蛻・閭梧勹[0] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_background_Anime.png" ) ); + //this.tx繧ク繝」繝ウ繝ォ蛻・閭梧勹[1] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_background_JPOP.png" ) ); + //this.tx繧ク繝」繝ウ繝ォ蛻・閭梧勹[2] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_background_Game.png" ) ); + //this.tx繧ク繝」繝ウ繝ォ蛻・閭梧勹[3] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_background_Namco.png" ) ); + //this.tx繧ク繝」繝ウ繝ォ蛻・閭梧勹[4] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_background_Classic.png" ) ); + //this.tx繧ク繝」繝ウ繝ォ蛻・閭梧勹[5] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_background_Child.png" ) ); + //this.tx繧ク繝」繝ウ繝ォ蛻・閭梧勹[6] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_background_Variety.png" ) ); + //this.tx繧ク繝」繝ウ繝ォ蛻・閭梧勹[7] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_background_VOCALID.png" ) ); + //this.tx繧ク繝」繝ウ繝ォ蛻・閭梧勹[8] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_background_Other.png" ) ); + + //this.tx髮」譏灘コヲ蛻・閭梧勹[0] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_background_Easy.png" ) ); + //this.tx髮」譏灘コヲ蛻・閭梧勹[1] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_background_Normal.png" ) ); + //this.tx髮」譏灘コヲ蛻・閭梧勹[2] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_background_Hard.png" ) ); + //this.tx髮」譏灘コヲ蛻・閭梧勹[3] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_background_Master.png" ) ); + //this.tx髮」譏灘コヲ蛻・閭梧勹[4] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_background_Edit.png" ) ); + //this.tx荳矩Κ繝繧ュ繧ケ繝 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\5_footer text.png" ) ); + this.ct閭梧勹繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ = new CCounter(0, TJAPlayer3.Tx.SongSelect_Background.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, 30, TJAPlayer3.Timer); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx閭梧勹 ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx荳企Κ繝代ロ繝ォ ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx荳矩Κ繝代ロ繝ォ ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txFLIP ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx髮」譏灘コヲ蜷 ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx荳矩Κ繝繧ュ繧ケ繝 ); + //for( int j = 0; j < 9; j++ ) + //{ + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧ク繝」繝ウ繝ォ蛻・閭梧勹[ j ] ); + //} + //for( int j = 0; j < 5; j++ ) + //{ + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx髮」譏灘コヲ蛻・閭梧勹[ j ] ); + //} + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + this.ct閭梧勹繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ.t騾イ陦鍬oop(); + #region [ 蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ] + //--------------------- + if (base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ) + { + this.ct逋サ蝣エ譎ゅい繝九Γ逕ィ蜈ア騾 = new CCounter(0, 100, 3, TJAPlayer3.Timer); + if (TJAPlayer3.r逶エ蜑阪ョ繧ケ繝繝シ繧ク == TJAPlayer3.stage邨先棡) + { + this.actFIfrom邨先棡逕サ髱「.t繝輔ぉ繝シ繝峨う繝ウ髢句ァ(); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.驕ク譖イ_邨先棡逕サ髱「縺九i縺ョ繝輔ぉ繝シ繝峨う繝ウ; + } + else + { + this.actFIFO.t繝輔ぉ繝シ繝峨う繝ウ髢句ァ(); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨う繝ウ; + } + this.t驕ク謚樊峇螟画峩騾夂衍(); + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + //--------------------- + #endregion + + + ctTimer.t騾イ陦(); + ctCreditAnime.t騾イ陦鍬oop(); + ctBackgroundFade.t騾イ陦(); + ctDonchan_Select.t騾イ陦(); + ctDonchan_Jump[0].t騾イ陦(); + ctDonchan_Jump[1].t騾イ陦(); + ctDonchan_Normal.t騾イ陦鍬oop(); + + this.ct逋サ蝣エ譎ゅい繝九Γ逕ィ蜈ア騾.t騾イ陦(); + + if (TJAPlayer3.Tx.SongSelect_Background != null) + TJAPlayer3.Tx.SongSelect_Background.t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + + if (this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ != null) + { + if (this.nStr繧ク繝」繝ウ繝ォtoNum(this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ) != 0 || r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX || r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE) + { + nGenreBack = this.nStr繧ク繝」繝ウ繝ォtoNum(this.NowGenre); + nOldGenreBack = this.nStr繧ク繝」繝ウ繝ォtoNum(this.OldGenre); + } + if (TJAPlayer3.Tx.SongSelect_GenreBack[nGenreBack] != null) + { + for (int i = 0; i < (1280 / TJAPlayer3.Tx.SongSelect_Background.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width) + 2; i++) + { + if (TJAPlayer3.Tx.SongSelect_GenreBack[nGenreBack] != null) + { + TJAPlayer3.Tx.SongSelect_GenreBack[nGenreBack].Opacity = 255; + TJAPlayer3.Tx.SongSelect_GenreBack[nGenreBack].t2D謠冗判(TJAPlayer3.app.Device, -(int)ct閭梧勹繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ.n迴セ蝨ィ縺ョ蛟、 + TJAPlayer3.Tx.SongSelect_Background.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width * i, 0); + } + if (TJAPlayer3.Tx.SongSelect_GenreBack[nOldGenreBack] != null) + { + TJAPlayer3.Tx.SongSelect_GenreBack[nOldGenreBack].Opacity = 600 - ctBackgroundFade.n迴セ蝨ィ縺ョ蛟、; + TJAPlayer3.Tx.SongSelect_GenreBack[nOldGenreBack].t2D謠冗判(TJAPlayer3.app.Device, -(int)ct閭梧勹繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ.n迴セ蝨ィ縺ョ蛟、 + TJAPlayer3.Tx.SongSelect_Background.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width * i, 0); + } + } + } + } + + this.act譖イ繝ェ繧ケ繝.On騾イ陦梧緒逕サ(); + int y = 0; + if (this.ct逋サ蝣エ譎ゅい繝九Γ逕ィ蜈ア騾.b騾イ陦御クュ) + { + double db逋サ蝣エ蜑イ蜷 = ((double)this.ct逋サ蝣エ譎ゅい繝九Γ逕ィ蜈ア騾.n迴セ蝨ィ縺ョ蛟、) / 100.0; // 100縺梧怙邨ょ、 + double dbY陦ィ遉コ蜑イ蜷 = Math.Sin(Math.PI / 2 * db逋サ蝣エ蜑イ蜷); + y = ((int)(TJAPlayer3.Tx.SongSelect_Header.sz逕サ蜒上し繧、繧コ.Height * dbY陦ィ遉コ蜑イ蜷)) - TJAPlayer3.Tx.SongSelect_Header.sz逕サ蜒上し繧、繧コ.Height; + } + if (TJAPlayer3.Tx.SongSelect_Header != null) + TJAPlayer3.Tx.SongSelect_Header.t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + + tTimerDraw((100 - ctTimer.n迴セ蝨ィ縺ョ蛟、).ToString()); + + tSongNumberDraw(1097, 167, NowSong.ToString()); + tSongNumberDraw(1190, 167, MaxSong.ToString()); + + this.actInformation.On騾イ陦梧緒逕サ(); + + #region [ 繝阪シ繝繝励Ξ繝シ繝 ] + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + TJAPlayer3.NamePlate.tNamePlateDraw(TJAPlayer3.Skin.SongSelect_NamePlate_X[i], TJAPlayer3.Skin.SongSelect_NamePlate_Y[i], i); + } + #endregion + + #region[ 荳矩Κ繝繧ュ繧ケ繝 ] + + if (TJAPlayer3.Tx.SongSelect_Auto != null) + { + if (TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay) + { + TJAPlayer3.Tx.SongSelect_Auto.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.SongSelect_Auto_X[0], TJAPlayer3.Skin.SongSelect_Auto_Y[0]); + } + if (TJAPlayer3.ConfigIni.nPlayerCount > 1 && TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay2P) + { + TJAPlayer3.Tx.SongSelect_Auto.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.SongSelect_Auto_X[1], TJAPlayer3.Skin.SongSelect_Auto_Y[1]); + } + } + if (TJAPlayer3.ConfigIni.bTokkunMode) + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, "GAME: TRAINING MODE"); + if (TJAPlayer3.ConfigIni.eGameMode == EGame.螳瑚オー蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ) + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 16, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, "GAME: SURVIVAL"); + if (TJAPlayer3.ConfigIni.eGameMode == EGame.螳瑚オー蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ豼霎) + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 16, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, "GAME: SURVIVAL HARD"); + if (TJAPlayer3.ConfigIni.bSuperHard) + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 32, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.襍、, "SUPER HARD MODE : ON"); + if (TJAPlayer3.ConfigIni.eScrollMode == EScrollMode.BMSCROLL) + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 48, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.襍、, "BMSCROLL : ON"); + else if (TJAPlayer3.ConfigIni.eScrollMode == EScrollMode.HBSCROLL) + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 48, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.襍、, "HBSCROLL : ON"); + + #endregion + + this.actPresound.On騾イ陦梧緒逕サ(); + + this.act貍泌・丞ア・豁エ繝代ロ繝ォ.On騾イ陦梧緒逕サ(); + + this.actShowCurrentPosition.On騾イ陦梧緒逕サ(); // #27648 2011.3.28 yyagi + + if (TJAPlayer3.ConfigIni.bBGM髻ウ繧堤匱螢ー縺吶k && !this.bBGM蜀咲函貂医∩ && (base.e繝輔ぉ繝シ繧コID == CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷) && !TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「繧、繝ウ.b蜀咲函荳ュ) + { + TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「.t蜀咲函縺吶k(); + this.bBGM蜀咲函貂医∩ = true; + } + + + if (this.ctDiffSelect遘サ蜍募セ縺。 != null) + this.ctDiffSelect遘サ蜍募セ縺。.t騾イ陦(); + + + + // 繧ュ繝シ蜈・蜉 + if (base.e繝輔ぉ繝シ繧コID == CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷 + && TJAPlayer3.act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ == null) + { + #region [ 邁。譏鼎ONFIG縺ァMore縲√∪縺溘ッShift+F1: 隧ウ邏ーCONFIG蜻シ縺ウ蜃コ縺 ] + if (actQuickConfig.bGotoDetailConfig) + { // 隧ウ邏ーCONFIG蜻シ縺ウ蜃コ縺 + actQuickConfig.tDeativatePopupMenu(); + this.actPresound.t繧オ繧ヲ繝ウ繝牙●豁「(); + this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、 = E謌サ繧雁、.繧ウ繝ウ繝輔ぅ繧ー蜻シ縺ウ蜃コ縺; // #24525 2011.3.16 yyagi: [SHIFT]-[F1]縺ァCONFIG蜻シ縺ウ蜃コ縺 + this.actFIFO.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝; + TJAPlayer3.Skin.sound蜿匁カ磯浹.t蜀咲函縺吶k(); + return 0; + } + #endregion + if (!this.actSortSongs.bIsActivePopupMenu && !this.actQuickConfig.bIsActivePopupMenu && !this.act髮」譏灘コヲ驕ク謚樒判髱「.bIsDifficltSelect) + { + #region [ ESC ] + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.Escape) && (this.act譖イ繝ェ繧ケ繝.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ != null))// && ( ) ) ) + if (this.act譖イ繝ェ繧ケ繝.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.r隕ェ繝弱シ繝 == null) + { // [ESC] + TJAPlayer3.Skin.sound蜿匁カ磯浹.t蜀咲函縺吶k(); + this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、 = E謌サ繧雁、.繧ソ繧、繝医Ν縺ォ謌サ繧; + this.actFIFO.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝; + return 0; + } + else + { + if (this.act譖イ繝ェ繧ケ繝.ctBoxOpen.b邨ゆコ蛟、縺ォ驕斐@縺 || this.act譖イ繝ェ繧ケ繝.ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 == 0) + { + TJAPlayer3.Skin.sound蜿匁カ磯浹.t蜀咲函縺吶k(); + this.act譖イ繝ェ繧ケ繝.ctBarFlash.t髢句ァ(0, 2700, 1, TJAPlayer3.Timer); + this.act譖イ繝ェ繧ケ繝.ctBoxOpen.t髢句ァ(200, 2700, 1.3f, TJAPlayer3.Timer); + this.act譖イ繝ェ繧ケ繝.bBoxClose = true; + this.ctDonchan_Select.t髢句ァ(0, TJAPlayer3.Tx.SongSelect_Donchan_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); + } + } + #endregion + #region [ Shift-F1: CONFIG逕サ髱「 ] + if ((TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧((int)SlimDXKeys.Key.RightShift) || TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧((int)SlimDXKeys.Key.LeftShift)) && + TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.F1)) + { // [SHIFT] + [F1] CONFIG + this.actPresound.t繧オ繧ヲ繝ウ繝牙●豁「(); + this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、 = E謌サ繧雁、.繧ウ繝ウ繝輔ぅ繧ー蜻シ縺ウ蜃コ縺; // #24525 2011.3.16 yyagi: [SHIFT]-[F1]縺ァCONFIG蜻シ縺ウ蜃コ縺 + this.actFIFO.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝; + TJAPlayer3.Skin.sound蜿匁カ磯浹.t蜀咲函縺吶k(); + return 0; + } + #endregion + #region [ F2 邁。譏薙が繝励す繝ァ繝ウ ] + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.F2)) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + this.actQuickConfig.tActivatePopupMenu(E讌ス蝎ィ繝代シ繝.DRUMS); + } + #endregion + #region [ F3 1P繧ェ繝シ繝ON/OFF ] + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.F3)) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + C蜈ア騾.bToggleBoolian(ref TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay); + } + #endregion + #region [ F4 2P繧ェ繝シ繝ON/OFF ] + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.F4)) + { + if (TJAPlayer3.ConfigIni.nPlayerCount > 1) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + C蜈ア騾.bToggleBoolian(ref TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay2P); + } + } + #endregion + #region [ F5 繧ケ繝シ繝代シ繝上シ繝 ] + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.F5)) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + C蜈ア騾.bToggleBoolian(ref TJAPlayer3.ConfigIni.bSuperHard); + } + #endregion + #region [ F6 SCROLL ] + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.F6)) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + TJAPlayer3.ConfigIni.b繧ケ繧ッ繝ュ繝シ繝ォ繝「繝シ繝峨r荳頑嶌縺 = true; + switch ((int)TJAPlayer3.ConfigIni.eScrollMode) + { + case 0: + TJAPlayer3.ConfigIni.eScrollMode = EScrollMode.BMSCROLL; + break; + case 1: + TJAPlayer3.ConfigIni.eScrollMode = EScrollMode.HBSCROLL; + break; + case 2: + TJAPlayer3.ConfigIni.eScrollMode = EScrollMode.Normal; + TJAPlayer3.ConfigIni.b繧ケ繧ッ繝ュ繝シ繝ォ繝「繝シ繝峨r荳頑嶌縺 = false; + break; + } + } + #endregion + #region [ F7 TokkunMode ] + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.F7)) + { + if (TJAPlayer3.ConfigIni.nPlayerCount != 2) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + C蜈ア騾.bToggleBoolian(ref TJAPlayer3.ConfigIni.bTokkunMode); + } + } + #endregion + #region [ F8 繝ゥ繝ウ繝繝驕ク譖イ ] + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.F8)) + { + if (TJAPlayer3.Skin.sound譖イ豎コ螳夐浹.b隱ュ縺ソ霎シ縺ソ謌仙粥) + TJAPlayer3.Skin.sound譖イ豎コ螳夐浹.t蜀咲函縺吶k(); + else + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + this.t譖イ繧偵Λ繝ウ繝繝驕ク謚槭☆繧(); + } + #endregion + + if (this.act譖イ繝ェ繧ケ繝.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ != null) + { + if (this.act譖イ繝ェ繧ケ繝.ctBoxOpen.b邨ゆコ蛟、縺ォ驕斐@縺 || this.act譖イ繝ェ繧ケ繝.ctBoxOpen.n迴セ蝨ィ縺ョ蛟、 == 0) + { + if (!this.b繧ケ繧ッ繝ュ繝シ繝ォ荳ュ) + { + #region [ Decide ] + if ((TJAPlayer3.Pad.b謚シ縺輔l縺櫂GB(E繝代ャ繝.Decide) || (TJAPlayer3.Pad.b謚シ縺輔l縺櫂GB(E繝代ャ繝.LRed) || TJAPlayer3.Pad.b謚シ縺輔l縺櫂GB(E繝代ャ繝.RRed)) || + ((TJAPlayer3.ConfigIni.bEnter縺後く繝シ蜑イ繧雁ス薙※縺ョ縺ゥ縺薙↓繧ゆスソ逕ィ縺輔l縺ヲ縺縺ェ縺 && TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.Return))))) + { + if (this.act譖イ繝ェ繧ケ繝.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ != null) + { + switch (this.act譖イ繝ェ繧ケ繝.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.e繝弱シ繝臥ィョ蛻・) + { + case C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE: + { + if (this.n迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ縺ョ髮」譏灘コヲ == (int)Difficulty.Dan) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + this.t譖イ繧帝∈謚槭☆繧(); + } + else + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + this.act髮」譏灘コヲ驕ク謚樒判髱「.bIsDifficltSelect = true; + this.act髮」譏灘コヲ驕ク謚樒判髱「.t驕ク謚樒判髱「蛻晄悄蛹(); + this.act譖イ繝ェ繧ケ繝.ctBarFlash.t髢句ァ(0, 2700, 1, TJAPlayer3.Timer); + this.act譖イ繝ェ繧ケ繝.ctDifficultyIn.t髢句ァ(0, 3200, 1, TJAPlayer3.Timer); + this.ctDonchan_Select.t髢句ァ(0, TJAPlayer3.Tx.SongSelect_Donchan_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); + } + } + break; + case C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX: + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + this.act譖イ繝ェ繧ケ繝.ctBarFlash.t髢句ァ(0, 2700, 1, TJAPlayer3.Timer); + this.act譖イ繝ェ繧ケ繝.ctBoxOpen.t髢句ァ(200, 2700, 1.3f, TJAPlayer3.Timer); + this.act譖イ繝ェ繧ケ繝.bBoxOpen = true; + this.ctDonchan_Select.t髢句ァ(0, TJAPlayer3.Tx.SongSelect_Donchan_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); + } + break; + case C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BACKBOX: + { + TJAPlayer3.Skin.sound蜿匁カ磯浹.t蜀咲函縺吶k(); + this.act譖イ繝ェ繧ケ繝.ctBarFlash.t髢句ァ(0, 2700, 1, TJAPlayer3.Timer); + this.act譖イ繝ェ繧ケ繝.ctBoxOpen.t髢句ァ(200, 2700, 1.3f, TJAPlayer3.Timer); + this.act譖イ繝ェ繧ケ繝.bBoxClose = true; + this.ctDonchan_Select.t髢句ァ(0, TJAPlayer3.Tx.SongSelect_Donchan_Select.Length - 1, 1000 / 45, TJAPlayer3.Timer); + } + break; + } + } + } + #endregion + } + #region [ Up ] + if (!this.b繧ケ繧ッ繝ュ繝シ繝ォ荳ュ) + { + this.ct繧ュ繝シ蜿榊セゥ逕ィ.Up.t繧ュ繝シ蜿榊セゥ(TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧((int)SlimDXKeys.Key.LeftArrow), new CCounter.DG繧ュ繝シ蜃ヲ逅(this.t繧ォ繝シ繧ス繝ォ繧剃ク翫∈遘サ蜍輔☆繧)); + //this.ct繧ュ繝シ蜿榊セゥ逕ィ.Up.t繧ュ繝シ蜿榊セゥ( CDTXMania.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( (int) SlimDXKeys.Key.UpArrow ) || CDTXMania.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( (int) SlimDXKeys.Key.LeftArrow ), new CCounter.DG繧ュ繝シ蜃ヲ逅( this.t繧ォ繝シ繧ス繝ォ繧剃ク翫∈遘サ蜍輔☆繧 ) ); + if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LBlue)) + { + this.t繧ォ繝シ繧ス繝ォ繧剃ク翫∈遘サ蜍輔☆繧(); + } + } + else + { + if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LBlue)) + { + this.ctDonchan_Jump[0].t髢句ァ(0, TJAPlayer3.Tx.SongSelect_Donchan_Jump.Length + 8, 1000 / 45, TJAPlayer3.Timer); + this.ctDonchan_Jump[1].t髢句ァ(0, TJAPlayer3.Tx.SongSelect_Donchan_Jump.Length + 8, 1000 / 45, TJAPlayer3.Timer); + for (int i = 0; i < 7; i++) t繧ォ繝シ繧ス繝ォ繧ケ繧ュ繝繝(true); + } + } + #endregion + #region [ Down ] + if (!this.b繧ケ繧ッ繝ュ繝シ繝ォ荳ュ) + { + this.ct繧ュ繝シ蜿榊セゥ逕ィ.Down.t繧ュ繝シ蜿榊セゥ(TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧((int)SlimDXKeys.Key.RightArrow), new CCounter.DG繧ュ繝シ蜃ヲ逅(this.t繧ォ繝シ繧ス繝ォ繧剃ク九∈遘サ蜍輔☆繧)); + //this.ct繧ュ繝シ蜿榊セゥ逕ィ.Down.t繧ュ繝シ蜿榊セゥ( CDTXMania.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( (int) SlimDXKeys.Key.DownArrow ) || CDTXMania.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( (int) SlimDXKeys.Key.RightArrow ), new CCounter.DG繧ュ繝シ蜃ヲ逅( this.t繧ォ繝シ繧ス繝ォ繧剃ク九∈遘サ蜍輔☆繧 ) ); + if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RBlue)) + { + this.t繧ォ繝シ繧ス繝ォ繧剃ク九∈遘サ蜍輔☆繧(); + } + } + else + { + if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RBlue)) + { + this.ctDonchan_Jump[0].t髢句ァ(0, TJAPlayer3.Tx.SongSelect_Donchan_Jump.Length + 8, 1000 / 45, TJAPlayer3.Timer); + this.ctDonchan_Jump[1].t髢句ァ(0, TJAPlayer3.Tx.SongSelect_Donchan_Jump.Length + 8, 1000 / 45, TJAPlayer3.Timer); + for (int i = 0; i < 7; i++) t繧ォ繝シ繧ス繝ォ繧ケ繧ュ繝繝(false); + } + } + #endregion + } + #region [ Upstairs ] + if (((this.act譖イ繝ェ繧ケ繝.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ != null) && (this.act譖イ繝ェ繧ケ繝.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.r隕ェ繝弱シ繝 != null)) && (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.FT) || TJAPlayer3.Pad.b謚シ縺輔l縺檬B(E繝代ャ繝.Cancel))) + { + this.actPresound.t繧オ繧ヲ繝ウ繝牙●豁「(); + TJAPlayer3.Skin.sound蜿匁カ磯浹.t蜀咲函縺吶k(); + this.act譖イ繝ェ繧ケ繝.tBOX繧貞コ繧(); + this.t驕ク謚樊峇螟画峩騾夂衍(); + } + #endregion + #region [ BDx2: 邁。譏鼎ONFIG ] + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.Space)) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + this.actSortSongs.tActivatePopupMenu(E讌ス蝎ィ繝代シ繝.DRUMS, ref this.act譖イ繝ェ繧ケ繝); + } + #endregion + #region [ HHx2: 髮」譏灘コヲ螟画峩 ] + if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.HH) || TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.HHO)) + { // [HH]x2 髮」譏灘コヲ螟画峩 + CommandHistory.Add(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝宇lag.HH); + E繝代ャ繝宇lag[] comChangeDifficulty = new E繝代ャ繝宇lag[] { E繝代ャ繝宇lag.HH, E繝代ャ繝宇lag.HH }; + if (CommandHistory.CheckCommand(comChangeDifficulty, E讌ス蝎ィ繝代シ繝.DRUMS)) + { + Debug.WriteLine("繝峨Λ繝繧ケ髮」譏灘コヲ螟画峩"); + this.act譖イ繝ェ繧ケ繝.t髮」譏灘コヲ繝ャ繝吶Ν繧偵イ縺ィ縺、騾イ繧√k(); + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + } + } + #endregion + } + } + + #region [ Minus & Equals Sound Group Level ] + KeyboardSoundGroupLevelControlHandler.Handle( + TJAPlayer3.Input邂。逅.Keyboard, TJAPlayer3.SoundGroupLevelController, TJAPlayer3.Skin, true); + #endregion + + this.actSortSongs.t騾イ陦梧緒逕サ(); + this.actQuickConfig.t騾イ陦梧緒逕サ(); + } + + //------------------------------ + if (this.act髮」譏灘コヲ驕ク謚樒判髱「.bIsDifficltSelect) + { + if (this.act譖イ繝ェ繧ケ繝.ctDifficultyIn.n迴セ蝨ィ縺ョ蛟、 >= 1255) + { + this.act髮」譏灘コヲ驕ク謚樒判髱「.On騾イ陦梧緒逕サ(); + } + } + //------------------------------ + + + + + if (TJAPlayer3.ConfigIni.nPlayerCount == 1) + { + var opacity = 0; + + if (ctCreditAnime.n迴セ蝨ィ縺ョ蛟、 <= 510) + opacity = ctCreditAnime.n迴セ蝨ィ縺ョ蛟、 / 2; + else if (ctCreditAnime.n迴セ蝨ィ縺ョ蛟、 <= 4500 - 510) + opacity = 255; + else + opacity = 255 - ((ctCreditAnime.n迴セ蝨ィ縺ョ蛟、 - (4500 - 510)) / 2); + + TJAPlayer3.Tx.SongSelect_Credit.Opacity = opacity; + + TJAPlayer3.Tx.SongSelect_Credit.t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + } + for(int i = 0; i < 2; i++) + { + if (this.ctDonchan_Jump[i].n迴セ蝨ィ縺ョ蛟、 >= this.ctDonchan_Jump[i].n邨ゆコ蛟、) + { + this.ctDonchan_Jump[i].t蛛懈ュ「(); + + if (!this.act髮」譏灘コヲ驕ク謚樒判髱「.bIsDifficltSelect) + { + this.ctDonchan_Jump[i].n迴セ蝨ィ縺ョ蛟、 = 0; + } + } + } + + if (this.ctDonchan_Select.b邨ゆコ蛟、縺ォ驕斐@縺ヲ縺ェ縺) + { + if (TJAPlayer3.ConfigIni.nPlayerCount == 2) + TJAPlayer3.Tx.SongSelect_Donchan_Select[ctDonchan_Select.n迴セ蝨ィ縺ョ蛟、].t2D蟾ヲ蜿ウ蜿崎サ「謠冗判(TJAPlayer3.app.Device, 981, 330); + + TJAPlayer3.Tx.SongSelect_Donchan_Select[ctDonchan_Select.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, 0, 330); + } + else + { + if (TJAPlayer3.ConfigIni.nPlayerCount == 2) + { + if (this.ctDonchan_Jump[1].n迴セ蝨ィ縺ョ蛟、 > 0) + { + TJAPlayer3.Tx.SongSelect_Donchan_Jump[ctDonchan_Jump[1].n迴セ蝨ィ縺ョ蛟、 >= 17 ? 17 : ctDonchan_Jump[1].n迴セ蝨ィ縺ョ蛟、].t2D蟾ヲ蜿ウ蜿崎サ「謠冗判(TJAPlayer3.app.Device, 981, 330); + } + else + { + TJAPlayer3.Tx.SongSelect_Donchan_Normal[ctDonchan_Normal.n迴セ蝨ィ縺ョ蛟、].t2D蟾ヲ蜿ウ蜿崎サ「謠冗判(TJAPlayer3.app.Device, 981, 330); + } + } + if (this.ctDonchan_Jump[0].n迴セ蝨ィ縺ョ蛟、 > 0) + { + TJAPlayer3.Tx.SongSelect_Donchan_Jump[ctDonchan_Jump[0].n迴セ蝨ィ縺ョ蛟、 >= 17 ? 17 : ctDonchan_Jump[0].n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, 0, 330); + } + else + { + TJAPlayer3.Tx.SongSelect_Donchan_Normal[ctDonchan_Normal.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, 0, 330); + } + } + + + for (int i = 0; i < 10; i++) + { + tBoardNumberDraw(this.ptBoardNumber[i].X - 10, this.ptBoardNumber[i].Y, i < 7 ? this.act譖イ繝ェ繧ケ繝.ScoreRankCount[i].ToString() : this.act譖イ繝ェ繧ケ繝.CrownCount[i - 7].ToString()); + } + + if (act髮」譏灘コヲ驕ク謚樒判髱「.bOption[0]) actPlayOption.On騾イ陦梧緒逕サ(0); + if (act髮」譏灘コヲ驕ク謚樒判髱「.bOption[1]) actPlayOption.On騾イ陦梧緒逕サ(1); + + switch (base.e繝輔ぉ繝シ繧コID) + { + case CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨う繝ウ: + if (this.actFIFO.On騾イ陦梧緒逕サ() != 0) + { + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷; + } + break; + + case CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝: + if (this.actFIFO.On騾イ陦梧緒逕サ() == 0) + { + break; + } + return (int)this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、; + + case CStage.E繝輔ぉ繝シ繧コ.驕ク譖イ_邨先棡逕サ髱「縺九i縺ョ繝輔ぉ繝シ繝峨う繝ウ: + if (this.actFIfrom邨先棡逕サ髱「.On騾イ陦梧緒逕サ() != 0) + { + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷; + } + break; + + case CStage.E繝輔ぉ繝シ繧コ.驕ク譖イ_NowLoading逕サ髱「縺ク縺ョ繝輔ぉ繝シ繝峨い繧ヲ繝: + if (this.actFOtoNowLoading.On騾イ陦梧緒逕サ() == 0) + { + break; + } + return (int)this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、; + } + } + return 0; + } + public enum E謌サ繧雁、 : int + { + 邯咏カ, + 繧ソ繧、繝医Ν縺ォ謌サ繧, + 驕ク譖イ縺励◆, + 繧ェ繝励す繝ァ繝ウ蜻シ縺ウ蜃コ縺, + 繧ウ繝ウ繝輔ぅ繧ー蜻シ縺ウ蜃コ縺, + 繧ケ繧ュ繝ウ螟画峩 + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + [StructLayout(LayoutKind.Sequential)] + private struct ST繧ュ繝シ蜿榊セゥ逕ィ繧ォ繧ヲ繝ウ繧ソ + { + public CCounter Up; + public CCounter Down; + public CCounter this[int index] + { + get + { + switch (index) + { + case 0: + return this.Up; + + case 1: + return this.Down; + } + throw new IndexOutOfRangeException(); + } + set + { + switch (index) + { + case 0: + this.Up = value; + return; + + case 1: + this.Down = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + private CCounter ctTimer; + private CCounter ctCreditAnime; + private Random[] r = new Random[3]; + public CCounter ctBackgroundFade; + public string NowGenre; + public string OldGenre; + private CActSelectArtistComment actArtistComment; + private CActFIFOBlack actFIFO; + private CActFIFOBlack actFIfrom邨先棡逕サ髱「; + //private CActFIFOBlack actFOtoNowLoading; + public CActFIFOStart actFOtoNowLoading; + private CActSelectInformation actInformation; + private CActSelectPreimage繝代ロ繝ォ actPreimage繝代ロ繝ォ; + public CActSelectPresound actPresound; + private CAct繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ act繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ; + private CActSelect繧ケ繝繝シ繧ソ繧ケ繝代ロ繝ォ act繧ケ繝繝シ繧ソ繧ケ繝代ロ繝ォ; + public CActSelect貍泌・丞ア・豁エ繝代ロ繝ォ act貍泌・丞ア・豁エ繝代ロ繝ォ; + public CActSelect譖イ繝ェ繧ケ繝 act譖イ繝ェ繧ケ繝; + private CActSelectShowCurrentPosition actShowCurrentPosition; + public CActSelect髮」譏灘コヲ驕ク謚樒判髱「 act髮」譏灘コヲ驕ク謚樒判髱「; + public CActPlayOption actPlayOption; + + public CActSortSongs actSortSongs; + private CActSelectQuickConfig actQuickConfig; + + private const int MaxSong = 3; + public int NowSong = 1; + + private CCounter ctDonchan_Normal; + private CCounter ctDonchan_Select; + public CCounter[] ctDonchan_Jump = new CCounter[2]; + private int nGenreBack; + private int nOldGenreBack; + public bool bBGM蜀咲函貂医∩; + public bool bBGMIn蜀咲函縺励◆; + private ST繧ュ繝シ蜿榊セゥ逕ィ繧ォ繧ヲ繝ウ繧ソ ct繧ュ繝シ蜿榊セゥ逕ィ; + public CCounter ct逋サ蝣エ譎ゅい繝九Γ逕ィ蜈ア騾; + private CCounter ct閭梧勹繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ; + private E謌サ繧雁、 e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、; + private Font ft繝輔か繝ウ繝; + //private CTexture tx荳矩Κ繝代ロ繝ォ; + //private CTexture tx荳企Κ繝代ロ繝ォ; + //private CTexture tx閭梧勹; + // private CTexture[] tx繧ク繝」繝ウ繝ォ蛻・閭梧勹 = new CTexture[9]; + // private CTexture[] tx髮」譏灘コヲ蛻・閭梧勹 = new CTexture[5]; + // private CTexture tx髮」譏灘コヲ蜷; + // private CTexture tx荳矩Κ繝繧ュ繧ケ繝; + private CCounter ctDiffSelect遘サ蜍募セ縺。; + + private STNumber[] stTimer = new STNumber[10]; + private STNumber[] stSongNumber = new STNumber[10]; + private STNumber[] stBoardNumber = new STNumber[10]; + + public struct STNumber + { + public char ch; + public Point pt; + } + private struct STCommandTime // #24063 2011.1.16 yyagi 繧ウ繝槭Φ繝牙・蜉帶凾蛻サ縺ョ險倬鹸逕ィ + { + public E讌ス蝎ィ繝代シ繝 eInst; // 菴ソ逕ィ讌ス蝎ィ + public E繝代ャ繝宇lag ePad; // 謚シ縺輔l縺溘さ繝槭Φ繝(蜷梧凾謚シ縺励ッOR貍皮ョ励〒蛻玲嫌縺吶k) + public long time; // 繧ウ繝槭Φ繝牙・蜉帶凾蛻サ + } + + private Point[] ptBoardNumber = + { new Point(72, 283), new Point(135, 283), new Point(200, 283), new Point(72, 258), new Point(135, 258), new Point(200, 258), new Point(200, 233), new Point(72, 311), new Point(135, 311), new Point(200, 311) }; + + public void tBoardNumberDraw(int x, int y, string str) + { + for (int j = 0; j < str.Length; j++) + { + for (int i = 0; i < 10; i++) + { + if (str[j] == stSongNumber[i].ch) + { + TJAPlayer3.Tx.SongSelect_BoardNumber.t2D謠冗判(TJAPlayer3.app.Device, x - (str.Length * 15 + 9 * str.Length - str.Length * 15) / 2 + 15 / 2, (float)y - 17 / 2, new RectangleF(stBoardNumber[i].pt.X, stBoardNumber[i].pt.Y, 15, 17)); + x += 9; + } + } + } + } + + private void tSongNumberDraw(int x, int y, string str) + { + for (int j = 0; j < str.Length; j++) + { + for (int i = 0; i < 10; i++) + { + if (str[j] == stSongNumber[i].ch) + { + TJAPlayer3.Tx.SongSelect_Song_Number.t2D謠冗判(TJAPlayer3.app.Device, x - (str.Length * 27 + 27 * str.Length - str.Length * 27) / 2 + 27 / 2, (float)y, new RectangleF(stSongNumber[i].pt.X, stSongNumber[i].pt.Y, 27, 29)); + x += str.Length >= 2 ? 16 : 27; + } + } + } + } + + private void tTimerDraw(string str) + { + int x = 1171, y = 57; + + for (int j = 0; j < str.Length; j++) + { + for (int i = 0; i < 10; i++) + { + if (TJAPlayer3.ConfigIni.bEnableCountdownTimer) + { + if (str[j] == stTimer[i].ch) + { + TJAPlayer3.Tx.SongSelect_Timer.t2D謠冗判(TJAPlayer3.app.Device, x - (str.Length * 46 + 46 * str.Length - str.Length * 46) / 2 + 46 / 2, (float)y, new RectangleF(stTimer[i].pt.X, stTimer[i].pt.Y, 46, 64)); + x += str.Length >= 3 ? 40 : 46; + } + } + } + } + } + + private class CCommandHistory // #24063 2011.1.16 yyagi 繧ウ繝槭Φ繝牙・蜉帛ア・豁エ繧剃ソ晄戟_遒コ隱阪☆繧九け繝ゥ繧ケ + { + readonly int buffersize = 16; + private List stct; + + public CCommandHistory() // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + { + stct = new List(buffersize); + } + + /// + /// 繧ウ繝槭Φ繝牙・蜉帛ア・豁エ縺ク縺ョ繧ウ繝槭Φ繝芽ソス蜉 + /// + /// 讌ス蝎ィ縺ョ遞ョ鬘 + /// 蜈・蜉帙さ繝槭Φ繝(蜷梧凾謚シ縺励ッOR貍皮ョ励〒蛻玲嫌縺吶k縺薙→) + public void Add(E讌ス蝎ィ繝代シ繝 _eInst, E繝代ャ繝宇lag _ePad) + { + STCommandTime _stct = new STCommandTime + { + eInst = _eInst, + ePad = _ePad, + time = TJAPlayer3.Timer.n迴セ蝨ィ譎ょ綾 + }; + + if (stct.Count >= buffersize) + { + stct.RemoveAt(0); + } + stct.Add(_stct); + //Debug.WriteLine( "CMDHIS: 讌ス蝎ィ=" + _stct.eInst + ", CMD=" + _stct.ePad + ", time=" + _stct.time ); + } + public void RemoveAt(int index) + { + stct.RemoveAt(index); + } + + /// + /// 繧ウ繝槭Φ繝牙・蜉帙↓謌仙粥縺励※縺繧九°隱ソ縺ケ繧 + /// + /// 蜈・蜉帙′謌仙粥縺励◆縺玖ェソ縺ケ縺溘>繧ウ繝槭Φ繝 + /// 蟇セ雎。讌ス蝎ィ + /// 繧ウ繝槭Φ繝牙・蜉帶仙粥譎Urue + public bool CheckCommand(E繝代ャ繝宇lag[] _ePad, E讌ス蝎ィ繝代シ繝 _eInst) + { + int targetCount = _ePad.Length; + int stciCount = stct.Count; + if (stciCount < targetCount) + { + //Debug.WriteLine("NOT start checking...stciCount=" + stciCount + ", targetCount=" + targetCount); + return false; + } + + long curTime = TJAPlayer3.Timer.n迴セ蝨ィ譎ょ綾; + //Debug.WriteLine("Start checking...targetCount=" + targetCount); + for (int i = targetCount - 1, j = stciCount - 1; i >= 0; i--, j--) + { + if (_ePad[i] != stct[j].ePad) + { + //Debug.WriteLine( "CMD隗」譫: false targetCount=" + targetCount + ", i=" + i + ", j=" + j + ": ePad[]=" + _ePad[i] + ", stci[j] = " + stct[j].ePad ); + return false; + } + if (stct[j].eInst != _eInst) + { + //Debug.WriteLine( "CMD隗」譫: false " + i ); + return false; + } + if (curTime - stct[j].time > 500) + { + //Debug.WriteLine( "CMD隗」譫: false " + i + "; over 500ms" ); + return false; + } + curTime = stct[j].time; + } + + //Debug.Write( "CMD隗」譫: 謌仙粥!(" + _ePad.Length + ") " ); + //for ( int i = 0; i < _ePad.Length; i++ ) Debug.Write( _ePad[ i ] + ", " ); + //Debug.WriteLine( "" ); + //stct.RemoveRange( 0, targetCount ); // #24396 2011.2.13 yyagi + stct.Clear(); // #24396 2011.2.13 yyagi Clear all command input history in case you succeeded inputting some command + + return true; + } + } + private CCommandHistory CommandHistory; + + private void t繧ォ繝シ繧ス繝ォ繧剃ク九∈遘サ蜍輔☆繧() + { + if ((this.act譖イ繝ェ繧ケ繝.r谺。縺ョ譖イ(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ).e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE) || this.act譖イ繝ェ繧ケ繝.r谺。縺ョ譖イ(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ).e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BACKBOX) + { + TJAPlayer3.stage驕ク譖イ.bBGMIn蜀咲函縺励◆ = false; + TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「繧、繝ウ.n菴咲スョ_迴セ蝨ィ縺ョ繧オ繧ヲ繝ウ繝 = 0; + TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「.n菴咲スョ_迴セ蝨ィ縺ョ繧オ繧ヲ繝ウ繝 = 0; + TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「繧、繝ウ.t蛛懈ュ「縺吶k(); + TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「.t蛛懈ュ「縺吶k(); + } + else + { + if (!bBGMIn蜀咲函縺励◆) + { + TJAPlayer3.stage驕ク譖イ.bBGM蜀咲函貂医∩ = false; + if (TJAPlayer3.ConfigIni.bBGM髻ウ繧堤匱螢ー縺吶k) + TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「繧、繝ウ.t蜀咲函縺吶k(); + bBGMIn蜀咲函縺励◆ = true; + } + } + this.ctBackgroundFade.t髢句ァ(0, 600, 1, TJAPlayer3.Timer); + if (this.act譖イ繝ェ繧ケ繝.ctBarOpen.n迴セ蝨ィ縺ョ蛟、 >= 200 || this.ctBackgroundFade.n迴セ蝨ィ縺ョ蛟、 >= 600 - 255) + TJAPlayer3.stage驕ク譖イ.OldGenre = this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ; + this.act譖イ繝ェ繧ケ繝.t谺。縺ォ遘サ蜍(); + TJAPlayer3.Skin.sound繧ォ繝シ繧ス繝ォ遘サ蜍暮浹.t蜀咲函縺吶k(); + } + private void t繧ォ繝シ繧ス繝ォ繧剃ク翫∈遘サ蜍輔☆繧() + { + if ((this.act譖イ繝ェ繧ケ繝.r蜑阪ョ譖イ(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ).e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE) || this.act譖イ繝ェ繧ケ繝.r蜑阪ョ譖イ(r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ).e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BACKBOX) + { + TJAPlayer3.stage驕ク譖イ.bBGMIn蜀咲函縺励◆ = false; + TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「.t蛛懈ュ「縺吶k(); + TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「繧、繝ウ.t蛛懈ュ「縺吶k(); + } + else + { + if (!bBGMIn蜀咲函縺励◆) + { + TJAPlayer3.stage驕ク譖イ.bBGM蜀咲函貂医∩ = false; + if (TJAPlayer3.ConfigIni.bBGM髻ウ繧堤匱螢ー縺吶k) + TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「繧、繝ウ.t蜀咲函縺吶k(); + bBGMIn蜀咲函縺励◆ = true; + } + } + this.ctBackgroundFade.t髢句ァ(0, 600, 1, TJAPlayer3.Timer); + if (this.act譖イ繝ェ繧ケ繝.ctBarOpen.n迴セ蝨ィ縺ョ蛟、 >= 200 || this.ctBackgroundFade.n迴セ蝨ィ縺ョ蛟、 >= 600 - 255) + TJAPlayer3.stage驕ク譖イ.OldGenre = this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ; + this.act譖イ繝ェ繧ケ繝.t蜑阪↓遘サ蜍(); + TJAPlayer3.Skin.sound繧ォ繝シ繧ス繝ォ遘サ蜍暮浹.t蜀咲函縺吶k(); + } + private void t繧ォ繝シ繧ス繝ォ繧ケ繧ュ繝繝(bool Up) + { + this.ctBackgroundFade.t髢句ァ(0, 600, 1, TJAPlayer3.Timer); + if (this.act譖イ繝ェ繧ケ繝.ctBarOpen.n迴セ蝨ィ縺ョ蛟、 >= 200 || this.ctBackgroundFade.n迴セ蝨ィ縺ョ蛟、 >= 600 - 255) + TJAPlayer3.stage驕ク譖イ.OldGenre = this.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.str繧ク繝」繝ウ繝ォ; + if (Up) this.act譖イ繝ェ繧ケ繝.t蜑阪↓遘サ蜍(); + else this.act譖イ繝ェ繧ケ繝.t谺。縺ォ遘サ蜍(); + + TJAPlayer3.Skin.soundSkip.t蜀咲函縺吶k(); + } + + private void t譖イ繧偵Λ繝ウ繝繝驕ク謚槭☆繧() + { + C譖イ繝ェ繧ケ繝医ヮ繝シ繝 song = this.act譖イ繝ェ繧ケ繝.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ; + if ((song.stack繝ゥ繝ウ繝繝貍泌・冗分蜿キ.Count == 0) || (song.list繝ゥ繝ウ繝繝逕ィ繝弱シ繝峨Μ繧ケ繝 == null)) + { + if (song.list繝ゥ繝ウ繝繝逕ィ繝弱シ繝峨Μ繧ケ繝 == null) + { + song.list繝ゥ繝ウ繝繝逕ィ繝弱シ繝峨Μ繧ケ繝 = this.t謖螳壹&繧後◆譖イ縺悟ュ伜惠縺吶k蝣エ謇縺ョ譖イ繧貞玲嫌縺吶k_蟄舌Μ繧ケ繝亥性繧(song); + } + int count = song.list繝ゥ繝ウ繝繝逕ィ繝弱シ繝峨Μ繧ケ繝.Count; + if (count == 0) + { + return; + } + int[] numArray = new int[count]; + for (int i = 0; i < count; i++) + { + numArray[i] = i; + } + for (int j = 0; j < (count * 1.5); j++) + { + int index = TJAPlayer3.Random.Next(count); + int num5 = TJAPlayer3.Random.Next(count); + int num6 = numArray[num5]; + numArray[num5] = numArray[index]; + numArray[index] = num6; + } + for (int k = 0; k < count; k++) + { + song.stack繝ゥ繝ウ繝繝貍泌・冗分蜿キ.Push(numArray[k]); + } + if (TJAPlayer3.ConfigIni.bLogDTX隧ウ邏ー繝ュ繧ー蜃コ蜉) + { + StringBuilder builder = new StringBuilder(0x400); + builder.Append(string.Format("繝ゥ繝ウ繝繝繧、繝ウ繝繝繧ッ繧ケ繝ェ繧ケ繝医r菴懈舌@縺セ縺励◆: {0}譖イ: ", song.stack繝ゥ繝ウ繝繝貍泌・冗分蜿キ.Count)); + for (int m = 0; m < count; m++) + { + builder.Append(string.Format("{0} ", numArray[m])); + } + Trace.TraceInformation(builder.ToString()); + } + } + this.r遒コ螳壹&繧後◆譖イ = song.list繝ゥ繝ウ繝繝逕ィ繝弱シ繝峨Μ繧ケ繝[song.stack繝ゥ繝ウ繝繝貍泌・冗分蜿キ.Pop()]; + this.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] = this.act譖イ繝ェ繧ケ繝.n迴セ蝨ィ縺ョ繧「繝ウ繧ォ髮」譏灘コヲ繝ャ繝吶Ν縺ォ譛繧りソ代>髮」譏灘コヲ繝ャ繝吶Ν繧定ソ斐☆(this.r遒コ螳壹&繧後◆譖イ); + this.r遒コ螳壹&繧後◆繧ケ繧ウ繧「 = this.r遒コ螳壹&繧後◆譖イ.ar繧ケ繧ウ繧「[this.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]]; + this.str遒コ螳壹&繧後◆譖イ縺ョ繧ク繝」繝ウ繝ォ = this.r遒コ螳壹&繧後◆譖イ.str繧ク繝」繝ウ繝ォ; + this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、 = E謌サ繧雁、.驕ク譖イ縺励◆; + this.actFOtoNowLoading.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(); // #27787 2012.3.10 yyagi 譖イ豎コ螳壽凾縺ョ逕サ髱「繝輔ぉ繝シ繝峨い繧ヲ繝医ョ逵∫払 + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.驕ク譖イ_NowLoading逕サ髱「縺ク縺ョ繝輔ぉ繝シ繝峨い繧ヲ繝; + if (TJAPlayer3.ConfigIni.bLogDTX隧ウ邏ー繝ュ繧ー蜃コ蜉) + { + int[] numArray2 = song.stack繝ゥ繝ウ繝繝貍泌・冗分蜿キ.ToArray(); + StringBuilder builder2 = new StringBuilder(0x400); + builder2.Append("繝ゥ繝ウ繝繝繧、繝ウ繝繝繧ッ繧ケ繝ェ繧ケ繝域ョ九j: "); + if (numArray2.Length > 0) + { + for (int n = 0; n < numArray2.Length; n++) + { + builder2.Append(string.Format("{0} ", numArray2[n])); + } + } + else + { + builder2.Append("(縺ェ縺)"); + } + Trace.TraceInformation(builder2.ToString()); + } + TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「.t蛛懈ュ「縺吶k(); + } + private void t譖イ繧帝∈謚槭☆繧() + { + this.r遒コ螳壹&繧後◆譖イ = this.act譖イ繝ェ繧ケ繝.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ; + this.r遒コ螳壹&繧後◆繧ケ繧ウ繧「 = this.act譖イ繝ェ繧ケ繝.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「; + this.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] = this.act譖イ繝ェ繧ケ繝.n迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ縺ョ迴セ蝨ィ縺ョ髮」譏灘コヲ繝ャ繝吶Ν; + this.str遒コ螳壹&繧後◆譖イ縺ョ繧ク繝」繝ウ繝ォ = this.r遒コ螳壹&繧後◆譖イ.str繧ク繝」繝ウ繝ォ; + if ((this.r遒コ螳壹&繧後◆譖イ != null) && (this.r遒コ螳壹&繧後◆繧ケ繧ウ繧「 != null)) + { + this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、 = E謌サ繧雁、.驕ク譖イ縺励◆; + this.actFOtoNowLoading.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(); // #27787 2012.3.10 yyagi 譖イ豎コ螳壽凾縺ョ逕サ髱「繝輔ぉ繝シ繝峨い繧ヲ繝医ョ逵∫払 + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.驕ク譖イ_NowLoading逕サ髱「縺ク縺ョ繝輔ぉ繝シ繝峨い繧ヲ繝; + } + TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「.t蛛懈ュ「縺吶k(); + } + public void t譖イ繧帝∈謚槭☆繧(int nCurrentLevel, int player) + { + this.r遒コ螳壹&繧後◆譖イ = this.act譖イ繝ェ繧ケ繝.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ; + this.r遒コ螳壹&繧後◆繧ケ繧ウ繧「 = this.act譖イ繝ェ繧ケ繝.r迴セ蝨ィ驕ク謚樔クュ縺ョ繧ケ繧ウ繧「; + this.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[player] = nCurrentLevel; + this.str遒コ螳壹&繧後◆譖イ縺ョ繧ク繝」繝ウ繝ォ = this.r遒コ螳壹&繧後◆譖イ.str繧ク繝」繝ウ繝ォ; + if ((this.r遒コ螳壹&繧後◆譖イ != null) && (this.r遒コ螳壹&繧後◆繧ケ繧ウ繧「 != null)) + { + this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、 = E謌サ繧雁、.驕ク譖イ縺励◆; + this.actFOtoNowLoading.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(); // #27787 2012.3.10 yyagi 譖イ豎コ螳壽凾縺ョ逕サ髱「繝輔ぉ繝シ繝峨い繧ヲ繝医ョ逵∫払 + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.驕ク譖イ_NowLoading逕サ髱「縺ク縺ョ繝輔ぉ繝シ繝峨い繧ヲ繝; + } + + TJAPlayer3.Skin.bgm驕ク譖イ逕サ髱「.t蛛懈ュ「縺吶k(); + } + private List t謖螳壹&繧後◆譖イ縺悟ュ伜惠縺吶k蝣エ謇縺ョ譖イ繧貞玲嫌縺吶k_蟄舌Μ繧ケ繝亥性繧(C譖イ繝ェ繧ケ繝医ヮ繝シ繝 song) + { + List list = new List(); + song = song.r隕ェ繝弱シ繝; + if ((song == null) && (TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝.Count > 0)) + { + foreach (C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 in TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝) + { + if ((c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE) || (c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE_MIDI)) + { + list.Add(c譖イ繝ェ繧ケ繝医ヮ繝シ繝); + } + if ((c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝 != null) && TJAPlayer3.ConfigIni.b繝ゥ繝ウ繝繝繧サ繝ャ繧ッ繝医〒蟄殖OX繧呈、懃エ「蟇セ雎。縺ィ縺吶k) + { + this.t謖螳壹&繧後◆譖イ縺ョ蟄舌Μ繧ケ繝医ョ譖イ繧貞玲嫌縺吶k_蟄ォ繝ェ繧ケ繝亥性繧(c譖イ繝ェ繧ケ繝医ヮ繝シ繝, ref list); + } + } + return list; + } + this.t謖螳壹&繧後◆譖イ縺ョ蟄舌Μ繧ケ繝医ョ譖イ繧貞玲嫌縺吶k_蟄ォ繝ェ繧ケ繝亥性繧(song, ref list); + return list; + } + private void t謖螳壹&繧後◆譖イ縺ョ蟄舌Μ繧ケ繝医ョ譖イ繧貞玲嫌縺吶k_蟄ォ繝ェ繧ケ繝亥性繧(C譖イ繝ェ繧ケ繝医ヮ繝シ繝 r隕ェ, ref List list) + { + if ((r隕ェ != null) && (r隕ェ.list蟄舌Μ繧ケ繝 != null)) + { + foreach (C譖イ繝ェ繧ケ繝医ヮ繝シ繝 c譖イ繝ェ繧ケ繝医ヮ繝シ繝 in r隕ェ.list蟄舌Μ繧ケ繝) + { + if ((c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE) || (c譖イ繝ェ繧ケ繝医ヮ繝シ繝.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.SCORE_MIDI)) + { + list.Add(c譖イ繝ェ繧ケ繝医ヮ繝シ繝); + } + if ((c譖イ繝ェ繧ケ繝医ヮ繝シ繝.list蟄舌Μ繧ケ繝 != null) && TJAPlayer3.ConfigIni.b繝ゥ繝ウ繝繝繧サ繝ャ繧ッ繝医〒蟄殖OX繧呈、懃エ「蟇セ雎。縺ィ縺吶k) + { + this.t謖螳壹&繧後◆譖イ縺ョ蟄舌Μ繧ケ繝医ョ譖イ繧貞玲嫌縺吶k_蟄ォ繝ェ繧ケ繝亥性繧(c譖イ繝ェ繧ケ繝医ヮ繝シ繝, ref list); + } + } + } + } + + public int nStr繧ク繝」繝ウ繝ォtoNum(string str繧ク繝」繝ウ繝ォ) + { + int nGenre = 8; + for(int i = 0; i < TJAPlayer3.Skin.SongSelect_GenreName.Length; i++) + { + if(TJAPlayer3.Skin.SongSelect_GenreName[i] == str繧ク繝」繝ウ繝ォ) + { + if (i + 1 >= TJAPlayer3.Skin.SongSelect_Genre_Background_Count) + { + nGenre = 0; + } + else + { + nGenre = i + 1; + } + break; + } + else + { + nGenre = 0; + } + } + return nGenre; + } + //----------------- + #endregion + } +} \ No newline at end of file diff --git a/TJAPlayer3/Stages/06.SongLoading/CStage譖イ隱ュ縺ソ霎シ縺ソ.cs b/TJAPlayer3/Stages/06.SongLoading/CStage譖イ隱ュ縺ソ霎シ縺ソ.cs new file mode 100644 index 00000000..54de732a --- /dev/null +++ b/TJAPlayer3/Stages/06.SongLoading/CStage譖イ隱ュ縺ソ霎シ縺ソ.cs @@ -0,0 +1,645 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using SlimDX; +using System.Drawing.Text; +using FDK; + +namespace TJAPlayer3 +{ + internal class CStage譖イ隱ュ縺ソ霎シ縺ソ : CStage + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CStage譖イ隱ュ縺ソ霎シ縺ソ() + { + base.e繧ケ繝繝シ繧クID = CStage.E繧ケ繝繝シ繧ク.譖イ隱ュ縺ソ霎シ縺ソ; + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷; + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + //base.list蟄植ctivities.Add( this.actFI = new CActFIFOBlack() ); // #27787 2012.3.10 yyagi 譖イ隱ュ縺ソ霎シ縺ソ逕サ髱「縺ョ繝輔ぉ繝シ繝峨う繝ウ縺ョ逵∫払 + //base.list蟄植ctivities.Add( this.actFO = new CActFIFOBlack() ); + } + + + // CStage 螳溯」 + + public override void On豢サ諤ァ蛹() + { + Trace.TraceInformation( "譖イ隱ュ縺ソ霎シ縺ソ繧ケ繝繝シ繧ク繧呈エサ諤ァ蛹悶@縺セ縺吶" ); + Trace.Indent(); + try + { + this.str譖イ繧ソ繧、繝医Ν = ""; + this.strSTAGEFILE = ""; + if( !string.IsNullOrEmpty( TJAPlayer3.ConfigIni.FontName ) ) + { + this.pfTITLE = new CPrivateFastFont( new FontFamily( TJAPlayer3.ConfigIni.FontName ), TJAPlayer3.Skin.SongLoading_Title_FontSize ); + this.pfSUBTITLE = new CPrivateFastFont( new FontFamily( TJAPlayer3.ConfigIni.FontName ), TJAPlayer3.Skin.SongLoading_SubTitle_FontSize); + } + else + { + this.pfTITLE = new CPrivateFastFont( new FontFamily("MS UI Gothic"), TJAPlayer3.Skin.SongLoading_Title_FontSize); + this.pfSUBTITLE = new CPrivateFastFont( new FontFamily("MS UI Gothic" ), TJAPlayer3.Skin.SongLoading_SubTitle_FontSize); + } + this.nBGM蜀咲函髢句ァ区凾蛻サ = -1; + this.nBGM縺ョ邱丞咲函譎る俣ms = 0; + if( this.sd隱ュ縺ソ霎シ縺ソ髻ウ != null ) + { + TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r遐エ譽縺吶k( this.sd隱ュ縺ソ霎シ縺ソ髻ウ ); + this.sd隱ュ縺ソ霎シ縺ソ髻ウ = null; + } + + if (TJAPlayer3.b繧ウ繝ウ繝代け繝医Δ繝シ繝) + { + string strDTX繝輔ぃ繧、繝ォ繝代せ = TJAPlayer3.str繧ウ繝ウ繝代け繝医Δ繝シ繝峨ヵ繧。繧、繝ォ; + + CDTX cdtx = new CDTX( strDTX繝輔ぃ繧、繝ォ繝代せ, true, 1.0, 0, 0 ); + if( File.Exists( cdtx.str繝輔か繝ォ繝蜷 + @"set.def" ) ) + cdtx = new CDTX( strDTX繝輔ぃ繧、繝ォ繝代せ, true, 1.0, 0, 1 ); + + this.str譖イ繧ソ繧、繝医Ν = cdtx.TITLE; + this.str繧オ繝悶ち繧、繝医Ν = cdtx.SUBTITLE; + + cdtx.On髱樊エサ諤ァ蛹(); + } + else + { + string strDTX繝輔ぃ繧、繝ォ繝代せ = TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ; + + var str繝輔か繝ォ繝蜷 = Path.GetDirectoryName(strDTX繝輔ぃ繧、繝ォ繝代せ) + @"\"; + + if (File.Exists(str繝輔か繝ォ繝蜷 + @"set.def")) + { + var cdtx = new CDTX(strDTX繝輔ぃ繧、繝ォ繝代せ, true, 1.0, 0, 1); + + this.str譖イ繧ソ繧、繝医Ν = cdtx.TITLE; + this.str繧オ繝悶ち繧、繝医Ν = cdtx.SUBTITLE; + + cdtx.On髱樊エサ諤ァ蛹(); + } + else + { + var 隴憺擇諠蝣ア = TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.隴憺擇諠蝣ア; + this.str譖イ繧ソ繧、繝医Ν = 隴憺擇諠蝣ア.繧ソ繧、繝医Ν; + this.str繧オ繝悶ち繧、繝医Ν = 隴憺擇諠蝣ア.str繧オ繝悶ち繧、繝医Ν; + } + } + + // For the moment, detect that we are performing + // calibration via there being an actual single + // player and the special song title and subtitle + // of the .tja used to perform input calibration + TJAPlayer3.IsPerformingCalibration = + !TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay && + TJAPlayer3.ConfigIni.nPlayerCount == 1 && + str譖イ繧ソ繧、繝医Ν == "Input Calibration" && + str繧オ繝悶ち繧、繝医Ν == "TJAPlayer3 Developers"; + + this.strSTAGEFILE = CSkin.Path(@"Graphics\4_SongLoading\Background.png"); + + base.On豢サ諤ァ蛹(); + } + finally + { + Trace.TraceInformation( "譖イ隱ュ縺ソ霎シ縺ソ繧ケ繝繝シ繧ク縺ョ豢サ諤ァ蛹悶r螳御コ縺励∪縺励◆縲" ); + Trace.Unindent(); + } + } + public override void On髱樊エサ諤ァ蛹() + { + Trace.TraceInformation( "譖イ隱ュ縺ソ霎シ縺ソ繧ケ繝繝シ繧ク繧帝撼豢サ諤ァ蛹悶@縺セ縺吶" ); + Trace.Indent(); + try + { + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k(ref this.pfTITLE); + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k(ref this.pfSUBTITLE); + base.On髱樊エサ諤ァ蛹(); + } + finally + { + Trace.TraceInformation( "譖イ隱ュ縺ソ霎シ縺ソ繧ケ繝繝シ繧ク縺ョ髱樊エサ諤ァ蛹悶r螳御コ縺励∪縺励◆縲" ); + Trace.Unindent(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + this.tx閭梧勹 = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( this.strSTAGEFILE, false ); + //this.txSongnamePlate = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\6_SongnamePlate.png" ) ); + this.ct蠕讖 = new CCounter( 0, TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan ? 1000 : 600, 5, TJAPlayer3.Timer ); + this.ct譖イ蜷崎。ィ遉コ = new CCounter( 1, 30, 30, TJAPlayer3.Timer ); + try + { + // When performing calibration, inform the player that + // calibration is about to begin, rather than + // displaying the song title and subtitle as usual. + + var 繧ソ繧、繝医Ν = TJAPlayer3.IsPerformingCalibration + ? "Input calibration is about to begin." + : this.str譖イ繧ソ繧、繝医Ν; + + var 繧オ繝悶ち繧、繝医Ν = TJAPlayer3.IsPerformingCalibration + ? "Please play as accurately as possible." + : this.str繧オ繝悶ち繧、繝医Ν; + + if( !string.IsNullOrEmpty(繧ソ繧、繝医Ν) ) + { + //this.tx繧ソ繧、繝医Ν = new CTexture( CDTXMania.app.Device, image, CDTXMania.TextureFormat ); + //this.tx繧ソ繧、繝医Ν.vc諡。螟ァ邵ョ蟆丞咲紫 = new Vector3( 0.5f, 0.5f, 1f ); + + + using (var bmpSongTitle = this.pfTITLE.DrawPrivateFont( 繧ソ繧、繝医Ν, TJAPlayer3.Skin.SongLoading_Title_ForeColor, TJAPlayer3.Skin.SongLoading_Title_BackColor )) + + { + this.tx繧ソ繧、繝医Ν = new CTexture( TJAPlayer3.app.Device, bmpSongTitle, TJAPlayer3.TextureFormat, false ); + tx繧ソ繧、繝医Ν.vc諡。螟ァ邵ョ蟆丞咲紫.X = TJAPlayer3.GetSongNameXScaling(ref tx繧ソ繧、繝医Ν, 710); + } + + using (var bmpSongSubTitle = this.pfSUBTITLE.DrawPrivateFont( 繧オ繝悶ち繧、繝医Ν, TJAPlayer3.Skin.SongLoading_SubTitle_ForeColor, TJAPlayer3.Skin.SongLoading_SubTitle_BackColor )) + + + { + this.tx繧オ繝悶ち繧、繝医Ν = new CTexture( TJAPlayer3.app.Device, bmpSongSubTitle, TJAPlayer3.TextureFormat, false ); + } + } + else + { + this.tx繧ソ繧、繝医Ν = null; + this.tx繧オ繝悶ち繧、繝医Ν = null; + } + + } + catch ( CTextureCreateFailedException e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "繝繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲({0})", new object[] { this.strSTAGEFILE } ); + this.tx繧ソ繧、繝医Ν = null; + this.tx繧オ繝悶ち繧、繝医Ν = null; + this.tx閭梧勹 = null; + } + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx閭梧勹 ); + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧ソ繧、繝医Ν ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txSongnamePlate ); + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧オ繝悶ち繧、繝医Ν ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + string str; + + if( base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + return 0; + + #region [ 蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ] + //----------------------------- + if( base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + C繧ケ繧ウ繧「 c繧ケ繧ウ繧「1 = TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「; + if( this.sd隱ュ縺ソ霎シ縺ソ髻ウ != null ) + { + if( TJAPlayer3.Skin.sound譖イ隱ュ霎シ髢句ァ矩浹.b謗剃サ && ( CSkin.C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.r譛蠕後↓蜀咲函縺励◆謗剃サ悶す繧ケ繝繝繧オ繧ヲ繝ウ繝 != null ) ) + { + CSkin.C繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝.r譛蠕後↓蜀咲函縺励◆謗剃サ悶す繧ケ繝繝繧オ繧ヲ繝ウ繝.t蛛懈ュ「縺吶k(); + } + this.sd隱ュ縺ソ霎シ縺ソ髻ウ.t蜀咲函繧帝幕蟋九☆繧(); + this.nBGM蜀咲函髢句ァ区凾蛻サ = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾; + this.nBGM縺ョ邱丞咲函譎る俣ms = this.sd隱ュ縺ソ霎シ縺ソ髻ウ.n邱乗シ泌・乗凾髢杜s; + } + else + { + TJAPlayer3.Skin.sound譖イ隱ュ霎シ髢句ァ矩浹.t蜀咲函縺吶k(); + this.nBGM蜀咲函髢句ァ区凾蛻サ = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾; + this.nBGM縺ョ邱丞咲函譎る俣ms = TJAPlayer3.Skin.sound譖イ隱ュ霎シ髢句ァ矩浹.n髟キ縺廟迴セ蝨ィ縺ョ繧オ繧ヲ繝ウ繝; + } + //this.actFI.t繝輔ぉ繝シ繝峨う繝ウ髢句ァ(); // #27787 2012.3.10 yyagi 譖イ隱ュ縺ソ霎シ縺ソ逕サ髱「縺ョ繝輔ぉ繝シ繝峨う繝ウ縺ョ逵∫払 + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨う繝ウ; + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = 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繧オ繧ヲ繝ウ繝峨r蛛懈ュ「縺吶k(); + this.sd隱ュ縺ソ霎シ縺ソ髻ウ.t隗」謾セ縺吶k(); + } + return (int) E譖イ隱ュ霎シ逕サ髱「縺ョ謌サ繧雁、.隱ュ霎シ荳ュ豁「; + } + #endregion + + if(TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Dan) + { + #region [ 閭梧勹縲髻ウ隨ヲシ九ち繧、繝医Ν陦ィ遉コ ] + //----------------------------- + this.ct譖イ蜷崎。ィ遉コ.t騾イ陦(); + if (TJAPlayer3.Tx.SongLoading_BgWait != null) TJAPlayer3.Tx.SongLoading_BgWait.t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + if (TJAPlayer3.Tx.SongLoading_Chara != null) TJAPlayer3.Tx.SongLoading_Chara.t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 0, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.轣ー, this.ct譖イ蜷崎。ィ遉コ.n迴セ蝨ィ縺ョ蛟、.ToString() ); + + if (TJAPlayer3.Tx.SongLoading_Plate != null) + { + TJAPlayer3.Tx.SongLoading_Plate.b繧ケ繧ッ繝ェ繝シ繝ウ蜷域 = TJAPlayer3.Skin.SongLoading_Plate_ScreenBlend; //縺ゅ∪繧翫↓繧ょコ逡ェ縺檎┌縺 + TJAPlayer3.Tx.SongLoading_Plate.Opacity = 255; + if (TJAPlayer3.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Left) + { + TJAPlayer3.Tx.SongLoading_Plate.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.SongLoading_Plate_X, TJAPlayer3.Skin.SongLoading_Plate_Y - (TJAPlayer3.Tx.SongLoading_Plate.sz逕サ蜒上し繧、繧コ.Height / 2)); + } + else if (TJAPlayer3.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Right) + { + TJAPlayer3.Tx.SongLoading_Plate.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.SongLoading_Plate_X - TJAPlayer3.Tx.SongLoading_Plate.sz逕サ蜒上し繧、繧コ.Width, TJAPlayer3.Skin.SongLoading_Plate_Y - (TJAPlayer3.Tx.SongLoading_Plate.sz逕サ蜒上し繧、繧コ.Height / 2)); + } + else + { + TJAPlayer3.Tx.SongLoading_Plate.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.SongLoading_Plate_X - (TJAPlayer3.Tx.SongLoading_Plate.sz逕サ蜒上し繧、繧コ.Width / 2), TJAPlayer3.Skin.SongLoading_Plate_Y - (TJAPlayer3.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(TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.隴憺擇諠蝣ア.str繧オ繝悶ち繧、繝医Ν) ? 15 : 0; + + this.tx繧ソ繧、繝医Ν.Opacity = 255; + if (TJAPlayer3.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Left) + { + this.tx繧ソ繧、繝医Ν.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.SongLoading_Title_X, TJAPlayer3.Skin.SongLoading_Title_Y - (this.tx繧ソ繧、繝医Ν.sz逕サ蜒上し繧、繧コ.Height / 2) + n繧オ繝悶ち繧、繝医Ν陬懈ュ」); + } + else if (TJAPlayer3.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right) + { + this.tx繧ソ繧、繝医Ν.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.SongLoading_Title_X - (this.tx繧ソ繧、繝医Ν.sz逕サ蜒上し繧、繧コ.Width * tx繧ソ繧、繝医Ν.vc諡。螟ァ邵ョ蟆丞咲紫.X), TJAPlayer3.Skin.SongLoading_Title_Y - (this.tx繧ソ繧、繝医Ν.sz逕サ蜒上し繧、繧コ.Height / 2) + n繧オ繝悶ち繧、繝医Ν陬懈ュ」); + } + else + { + this.tx繧ソ繧、繝医Ν.t2D謠冗判(TJAPlayer3.app.Device, (TJAPlayer3.Skin.SongLoading_Title_X - ((this.tx繧ソ繧、繝医Ν.sz逕サ蜒上し繧、繧コ.Width * tx繧ソ繧、繝医Ν.vc諡。螟ァ邵ョ蟆丞咲紫.X) / 2)), TJAPlayer3.Skin.SongLoading_Title_Y - (this.tx繧ソ繧、繝医Ν.sz逕サ蜒上し繧、繧コ.Height / 2) + n繧オ繝悶ち繧、繝医Ν陬懈ュ」); + } + } + if (this.tx繧オ繝悶ち繧、繝医Ν != null) + { + this.tx繧オ繝悶ち繧、繝医Ν.Opacity = 255; + if (TJAPlayer3.Skin.SongLoading_SubTitle_ReferencePoint == CSkin.ReferencePoint.Left) + { + this.tx繧オ繝悶ち繧、繝医Ν.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.SongLoading_SubTitle_X, TJAPlayer3.Skin.SongLoading_SubTitle_Y - (this.tx繧オ繝悶ち繧、繝医Ν.sz逕サ蜒上し繧、繧コ.Height / 2)); + } + else if (TJAPlayer3.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right) + { + this.tx繧オ繝悶ち繧、繝医Ν.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.SongLoading_SubTitle_X - (this.tx繧オ繝悶ち繧、繝医Ν.sz逕サ蜒上し繧、繧コ.Width * tx繧ソ繧、繝医Ν.vc諡。螟ァ邵ョ蟆丞咲紫.X), TJAPlayer3.Skin.SongLoading_SubTitle_Y - (this.tx繧オ繝悶ち繧、繝医Ν.sz逕サ蜒上し繧、繧コ.Height / 2)); + } + else + { + this.tx繧オ繝悶ち繧、繝医Ν.t2D謠冗判(TJAPlayer3.app.Device, (TJAPlayer3.Skin.SongLoading_SubTitle_X - ((this.tx繧オ繝悶ち繧、繝医Ν.sz逕サ蜒上し繧、繧コ.Width * tx繧オ繝悶ち繧、繝医Ν.vc諡。螟ァ邵ョ蟆丞咲紫.X) / 2)), TJAPlayer3.Skin.SongLoading_SubTitle_Y - (this.tx繧オ繝悶ち繧、繝医Ν.sz逕サ蜒上し繧、繧コ.Height / 2)); + } + } + //----------------------------- + #endregion + } + else + { + #region [ 谿オ菴肴凾縺ョ譖イ隱ュ縺ソ霎シ縺ソ逕サ髱「縲] + + TJAPlayer3.Tx.SongLoading_Bg_Dan.t2D謠冗判(TJAPlayer3.app.Device, 0, 0 - (ct蠕讖.n迴セ蝨ィ縺ョ蛟、 <= 600 ? ct蠕讖.n迴セ蝨ィ縺ョ蛟、 / 10f : 60)); + if(TJAPlayer3.stage谿オ菴埼∈謚.谿オ菴阪Μ繧ケ繝.st繝舌シ諠蝣ア[TJAPlayer3.stage谿オ菴埼∈謚.谿オ菴阪Μ繧ケ繝.n迴セ蝨ィ縺ョ驕ク謚櫁。珪.txDanPlate != null) TJAPlayer3.stage谿オ菴埼∈謚.谿オ菴阪Μ繧ケ繝.st繝舌シ諠蝣ア[TJAPlayer3.stage谿オ菴埼∈謚.谿オ菴阪Μ繧ケ繝.n迴セ蝨ィ縺ョ驕ク謚櫁。珪.txDanPlate.Opacity = (int)(ct蠕讖.n迴セ蝨ィ縺ョ蛟、 <= 51 ? ( ct蠕讖.n迴セ蝨ィ縺ョ蛟、 / 0.2f) : 255 - (this.ct蠕讖.n迴セ蝨ィ縺ョ蛟、 - 949) / 0.2); + TJAPlayer3.stage谿オ菴埼∈謚.谿オ菴阪Μ繧ケ繝.st繝舌シ諠蝣ア[TJAPlayer3.stage谿オ菴埼∈謚.谿オ菴阪Μ繧ケ繝.n迴セ蝨ィ縺ョ驕ク謚櫁。珪.txDanPlate?.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 1121, 213); + + if (TJAPlayer3.Tx.Tile_Black != null) + { + TJAPlayer3.Tx.Tile_Black.Opacity = (int)(ct蠕讖.n迴セ蝨ィ縺ョ蛟、 <= 51 ? (255 - ct蠕讖.n迴セ蝨ィ縺ョ蛟、 / 0.2f) : (this.ct蠕讖.n迴セ蝨ィ縺ョ蛟、 - 949) / 0.2); + for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / 64); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size + { + for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / 64); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size + { + TJAPlayer3.Tx.Tile_Black.t2D謠冗判(TJAPlayer3.app.Device, i * 64, j * 64); + } + } + } + + #endregion + } + + switch ( base.e繝輔ぉ繝シ繧コID ) + { + case CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨う繝ウ: + //if( this.actFI.On騾イ陦梧緒逕サ() != 0 ) // #27787 2012.3.10 yyagi 譖イ隱ュ縺ソ霎シ縺ソ逕サ髱「縺ョ繝輔ぉ繝シ繝峨う繝ウ縺ョ逵∫払 + // 蠢縺壻ク蠎ヲ縲靴Staeg.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨う繝ウ縲阪ヵ繧ァ繝シ繧コ繧堤オ檎罰縺輔○繧九%縺ィ縲 + // 縺輔b縺ェ縺縺ィ縲∵峇隱ュ縺ソ霎シ縺ソ縺悟ョ御コ縺吶k縺セ縺ァ縲∵峇隱ュ縺ソ霎シ縺ソ逕サ髱「縺梧緒逕サ縺輔l縺ェ縺縲 + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.NOWLOADING_DTX繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧; + return (int) E譖イ隱ュ霎シ逕サ髱「縺ョ謌サ繧雁、.邯咏カ; + + case CStage.E繝輔ぉ繝シ繧コ.NOWLOADING_DTX繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧: + { + timeBeginLoad = DateTime.Now; + TimeSpan span; + str = null; + if( !TJAPlayer3.b繧ウ繝ウ繝代け繝医Δ繝シ繝 ) + str = TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.繝輔ぃ繧、繝ォ諠蝣ア.繝輔ぃ繧、繝ォ縺ョ邨カ蟇セ繝代せ; + else + str = TJAPlayer3.str繧ウ繝ウ繝代け繝医Δ繝シ繝峨ヵ繧。繧、繝ォ; + + CScoreIni ini = new CScoreIni( str + ".score.ini" ); + ini.t蜈ィ貍泌・剰ィ倬鹸繧サ繧ッ繧キ繝ァ繝ウ縺ョ謨エ蜷域ァ繧偵メ繧ァ繝繧ッ縺嶺ク肴紛蜷医′縺ゅl縺ー繝ェ繧サ繝繝医☆繧(); + + if( ( TJAPlayer3.DTX != null ) && TJAPlayer3.DTX.b豢サ諤ァ蛹悶@縺ヲ繧 ) + TJAPlayer3.DTX.On髱樊エサ諤ァ蛹(); + + //if( CDTXMania.DTX == null ) + { + TJAPlayer3.DTX = new CDTX(str, false, 1.0, ini.st繝輔ぃ繧、繝ォ.BGMAdjust, 0, 0, true, TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]); + if ( TJAPlayer3.ConfigIni.nPlayerCount == 2 ) + TJAPlayer3.DTX_2P = new CDTX(str, false, 1.0, ini.st繝輔ぃ繧、繝ォ.BGMAdjust, 0, 1, true, TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[1]); + if ( File.Exists( TJAPlayer3.DTX.str繝輔か繝ォ繝蜷 + @"\\set.def" ) ) + { + TJAPlayer3.DTX_2P = new CDTX(str, false, 1.0, ini.st繝輔ぃ繧、繝ォ.BGMAdjust, 0, 1, true, TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]); + if ( TJAPlayer3.ConfigIni.nPlayerCount == 2 ) + TJAPlayer3.DTX_2P = new CDTX(str, false, 1.0, ini.st繝輔ぃ繧、繝ォ.BGMAdjust, 0, 1, true, TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[1]); + } + + Trace.TraceInformation( "----譖イ諠蝣ア-----------------" ); + Trace.TraceInformation( "TITLE: {0}", TJAPlayer3.DTX.TITLE ); + Trace.TraceInformation( "FILE: {0}", TJAPlayer3.DTX.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ ); + Trace.TraceInformation( "---------------------------" ); + + span = (TimeSpan) ( DateTime.Now - timeBeginLoad ); + Trace.TraceInformation( "DTX隱ュ霎シ謇隕∵凾髢: {0}", span.ToString() ); + + // 谿オ菴崎ェ榊ョ壹Δ繝シ繝臥畑縲 + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan && TJAPlayer3.DTX.List_DanSongs != null) + { + var pfTitle = new CPrivateFont(); + var pfSubTitle = new CPrivateFont(); + if (!string.IsNullOrEmpty(TJAPlayer3.ConfigIni.FontName)) + { + pfTitle = new CPrivateFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), 30); + pfSubTitle = new CPrivateFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), 22); + } + else + { + pfTitle = new CPrivateFont(new FontFamily("MS UI Gothic"), 30); + pfSubTitle = new CPrivateFont(new FontFamily("MS UI Gothic"), 22); + } + + var titleForeColor = TJAPlayer3.Skin.Game_DanC_Title_ForeColor; + var titleBackColor = TJAPlayer3.Skin.Game_DanC_Title_BackColor; + var subtitleForeColor = TJAPlayer3.Skin.Game_DanC_SubTitle_ForeColor; + var subtitleBackColor = TJAPlayer3.Skin.Game_DanC_SubTitle_BackColor; + + for (int i = 0; i < TJAPlayer3.DTX.List_DanSongs.Count; i++) + { + if (!string.IsNullOrEmpty(TJAPlayer3.DTX.List_DanSongs[i].Title)) + { + using (var bmpSongTitle = pfTitle.DrawPrivateFont(TJAPlayer3.DTX.List_DanSongs[i].Title, titleForeColor, titleBackColor)) + { + TJAPlayer3.DTX.List_DanSongs[i].TitleTex = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(bmpSongTitle, false); + TJAPlayer3.DTX.List_DanSongs[i].TitleTex.vc諡。螟ァ邵ョ蟆丞咲紫.X = TJAPlayer3.GetSongNameXScaling(ref TJAPlayer3.DTX.List_DanSongs[i].TitleTex, 710); + } + } + + if (!string.IsNullOrEmpty(TJAPlayer3.DTX.List_DanSongs[i].SubTitle)) + { + using (var bmpSongSubTitle = pfSubTitle.DrawPrivateFont(TJAPlayer3.DTX.List_DanSongs[i].SubTitle, subtitleForeColor, subtitleBackColor)) + { + TJAPlayer3.DTX.List_DanSongs[i].SubTitleTex = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(bmpSongSubTitle, false); + TJAPlayer3.DTX.List_DanSongs[i].SubTitleTex.vc諡。螟ァ邵ョ蟆丞咲紫.X = TJAPlayer3.GetSongNameXScaling(ref TJAPlayer3.DTX.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 && TJAPlayer3.DTX.listWAV.Count > 0 ) // #28934 2012.7.7 yyagi (added checking Count) + { + ShowProgressByFilename( TJAPlayer3.DTX.listWAV[ nWAVcount ].str繝輔ぃ繧、繝ォ蜷 ); + } + int looptime = (TJAPlayer3.ConfigIni.b蝙ら峩蟶ー邱壼セ縺。繧定。後≧)? 3 : 1; // VSyncWait=ON譎ゅッ1frame(1/60s)縺ゅ◆繧3縺、隱ュ繧繧医≧縺ォ縺吶k + for ( int i = 0; i < looptime && nWAVcount <= TJAPlayer3.DTX.listWAV.Count; i++ ) + { + if ( TJAPlayer3.DTX.listWAV[ nWAVcount ].list縺薙ョWAV繧剃スソ逕ィ縺吶k繝√Ε繝ウ繝阪Ν逡ェ蜿キ縺ョ髮蜷.Count > 0 ) // #28674 2012.5.8 yyagi + { + TJAPlayer3.DTX.tWAV縺ョ隱ュ縺ソ霎シ縺ソ( TJAPlayer3.DTX.listWAV[ nWAVcount ] ); + } + nWAVcount++; + } + if ( nWAVcount <= TJAPlayer3.DTX.listWAV.Count ) + { + ShowProgressByFilename( TJAPlayer3.DTX.listWAV[ nWAVcount ].str繝輔ぃ繧、繝ォ蜷 ); + } + if ( nWAVcount > TJAPlayer3.DTX.listWAV.Count ) + { + TimeSpan span = ( TimeSpan ) ( DateTime.Now - timeBeginLoadWAV ); + Trace.TraceInformation( "WAV隱ュ霎シ謇隕∵凾髢({0,4}): {1}", TJAPlayer3.DTX.listWAV.Count, span.ToString() ); + timeBeginLoadWAV = DateTime.Now; + + if ( TJAPlayer3.ConfigIni.bDynamicBassMixerManagement ) + { + TJAPlayer3.DTX.PlanToAddMixerChannel(); + } + TJAPlayer3.DTX.t螟ェ鮠薙メ繝繝励ョ繝ゥ繝ウ繝繝蛹( TJAPlayer3.ConfigIni.eRandom.Taiko ); + + TJAPlayer3.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 ( TJAPlayer3.ConfigIni.bAVI譛牙柑 ) + TJAPlayer3.DTX.tAVI縺ョ隱ュ縺ソ霎シ縺ソ(); + span = ( TimeSpan ) ( DateTime.Now - timeBeginLoadBMPAVI ); + + span = ( TimeSpan ) ( DateTime.Now - timeBeginLoad ); + Trace.TraceInformation( "邱剰ェュ霎シ譎る俣: {0}", span.ToString() ); + + if(TJAPlayer3.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; + } + TJAPlayer3.Timer.t譖エ譁ー(); + //CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.t譖エ譁ー(); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.NOWLOADING_繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝隠GM縺ョ螳御コ繧貞セ縺、; + return (int) E譖イ隱ュ霎シ逕サ髱「縺ョ謌サ繧雁、.邯咏カ; + } + + case CStage.E繝輔ぉ繝シ繧コ.NOWLOADING_繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝隠GM縺ョ螳御コ繧貞セ縺、: + { + long nCurrentTime = TJAPlayer3.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 ( !TJAPlayer3.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隗」謾セ縺吶k(); + } + return (int) E譖イ隱ュ霎シ逕サ髱「縺ョ謌サ繧雁、.隱ュ霎シ螳御コ; + } + return (int) E譖イ隱ュ霎シ逕サ髱「縺ョ謌サ繧雁、.邯咏カ; + } + + /// + /// ESC謚シ荳区凾縲》rue繧定ソ斐☆ + /// + /// + protected bool t繧ュ繝シ蜈・蜉() + { + IInputDevice keyboard = TJAPlayer3.Input邂。逅.Keyboard; + if ( keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.Escape ) ) // escape (exit) + { + return true; + } + return false; + } + + + private void ShowProgressByFilename(string str繝輔ぃ繧、繝ォ蜷 ) + { + if ( graphicsFilename != null && ftFilename != null ) + { + graphicsFilename.Clear( Color.Transparent ); + graphicsFilename.DrawString( str繝輔ぃ繧、繝ォ蜷, ftFilename, Brushes.White, new RectangleF( 0, 0, 640, 24 ) ); + if ( txFilename != null ) + { + txFilename.Dispose(); + } + txFilename = new CTexture( TJAPlayer3.app.Device, bitmapFilename, TJAPlayer3.TextureFormat ); + txFilename.vc諡。螟ァ邵ョ蟆丞咲紫 = new Vector3( 0.5f, 0.5f, 1f ); + txFilename.t2D謠冗判( TJAPlayer3.app.Device, 0, 720 - 16 ); + } + } + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + //private CActFIFOBlack actFI; + //private CActFIFOBlack actFO; + private long nBGM縺ョ邱丞咲函譎る俣ms; + private long nBGM蜀咲函髢句ァ区凾蛻サ; + private CSound sd隱ュ縺ソ霎シ縺ソ髻ウ; + private string strSTAGEFILE; + private string str譖イ繧ソ繧、繝医Ν; + private string str繧オ繝悶ち繧、繝医Ν; + private CTexture tx繧ソ繧、繝医Ν; + private CTexture tx繧オ繝悶ち繧、繝医Ν; + private CTexture tx閭梧勹; + //private CTexture txSongnamePlate; + private DateTime timeBeginLoad; + private DateTime timeBeginLoadWAV; + private int nWAVcount; + private CTexture txFilename; + private Bitmap bitmapFilename; + private Graphics graphicsFilename; + private Font ftFilename; + private CCounter ct蠕讖; + private CCounter ct譖イ蜷崎。ィ遉コ; + + private CPrivateFastFont pfTITLE; + private CPrivateFastFont pfSUBTITLE; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/06.SongLoading/FastRender.cs b/TJAPlayer3/Stages/06.SongLoading/FastRender.cs new file mode 100644 index 00000000..2ef61480 --- /dev/null +++ b/TJAPlayer3/Stages/06.SongLoading/FastRender.cs @@ -0,0 +1,90 @@ +サソusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FDK; + +namespace TJAPlayer3 +{ + class FastRender + { + public FastRender() + { + + } + + public void Render() + { + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_10combo; i++) + { + NullCheckAndRender(ref TJAPlayer3.Tx.Chara_10Combo[i]); + } + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_10combo_Max; i++) + { + NullCheckAndRender(ref TJAPlayer3.Tx.Chara_10Combo_Maxed[i]); + } + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart; i++) + { + NullCheckAndRender(ref TJAPlayer3.Tx.Chara_GoGoStart[i]); + } + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart_Max; i++) + { + NullCheckAndRender(ref TJAPlayer3.Tx.Chara_GoGoStart_Maxed[i]); + } + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_Normal; i++) + { + NullCheckAndRender(ref TJAPlayer3.Tx.Chara_Normal[i]); + } + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_Clear; i++) + { + NullCheckAndRender(ref TJAPlayer3.Tx.Chara_Normal_Cleared[i]); + } + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_ClearIn; i++) + { + NullCheckAndRender(ref TJAPlayer3.Tx.Chara_Become_Cleared[i]); + } + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_SoulIn; i++) + { + NullCheckAndRender(ref TJAPlayer3.Tx.Chara_Become_Maxed[i]); + } + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Breaking; i++) + { + NullCheckAndRender(ref TJAPlayer3.Tx.Chara_Balloon_Breaking[i]); + } + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Broke; i++) + { + NullCheckAndRender(ref TJAPlayer3.Tx.Chara_Balloon_Broke[i]); + } + for (int i = 0; i < TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Miss; i++) + { + NullCheckAndRender(ref TJAPlayer3.Tx.Chara_Balloon_Miss[i]); + } + + for (int i = 0; i < 5; i++) + { + for (int k = 0; k < TJAPlayer3.Skin.Game_Dancer_Ptn; k++) + { + NullCheckAndRender(ref TJAPlayer3.Tx.Dancer[i][k]); + } + } + + NullCheckAndRender(ref TJAPlayer3.Tx.Effects_GoGoSplash); + NullCheckAndRender(ref TJAPlayer3.Tx.Runner); + for (int i = 0; i < TJAPlayer3.Skin.Game_Mob_Ptn; i++) + { + NullCheckAndRender(ref TJAPlayer3.Tx.Mob[i]); + } + + NullCheckAndRender(ref TJAPlayer3.Tx.PuchiChara); + + } + + private void NullCheckAndRender(ref CTexture tx) + { + if (tx == null) return; + tx.Opacity = 0; + tx.t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + tx.Opacity = 255; + } + } +} diff --git a/TJAPlayer3/Stages/07.Game/CAct貍泌・就VI.cs b/TJAPlayer3/Stages/07.Game/CAct貍泌・就VI.cs new file mode 100644 index 00000000..36355be0 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/CAct貍泌・就VI.cs @@ -0,0 +1,610 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using SlimDX; +using SlimDX.Direct3D9; +using FDK; +using DirectShowLib; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・就VI : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CAct貍泌・就VI() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // 繝。繧ス繝繝 + + public void Start( int n繝√Ε繝ウ繝阪Ν逡ェ蜿キ, CDTX.CAVI rAVI, CDTX.CDirectShow dsBGV, int n髢句ァ九し繧、繧コW, int n髢句ァ九し繧、繧コH, int n邨ゆコ繧オ繧、繧コW, int n邨ゆコ繧オ繧、繧コH, int n逕サ蜒丞エ髢句ァ倶ス咲スョX, int n逕サ蜒丞エ髢句ァ倶ス咲スョY, int n逕サ蜒丞エ邨ゆコ菴咲スョX, int n逕サ蜒丞エ邨ゆコ菴咲スョY, int n陦ィ遉コ蛛エ髢句ァ倶ス咲スョX, int n陦ィ遉コ蛛エ髢句ァ倶ス咲スョY, int n陦ィ遉コ蛛エ邨ゆコ菴咲スョX, int n陦ィ遉コ蛛エ邨ゆコ菴咲スョY, int n邱冗ァサ蜍墓凾髢杜s, int n遘サ蜍暮幕蟋区凾蛻サms ) + { + if ( ( n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x54 || n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x5A ) && TJAPlayer3.ConfigIni.bAVI譛牙柑 ) + { + this.rAVI = rAVI; + this.dsBGV = dsBGV; + if (this.dsBGV != null && this.dsBGV.dshow != null) + { + this.framewidth = (uint)this.dsBGV.dshow.n蟷px; + this.frameheight = (uint)this.dsBGV.dshow.n鬮倥&px; + float f諡。螟ァ邇x; + float f諡。螟ァ邇y; + this.fAVI繧「繧ケ繝壹け繝域ッ = ((float)this.framewidth) / ((float)this.frameheight); + + if ( fAVI繧「繧ケ繝壹け繝域ッ < 1.77f ) + { + #region[ 譌ァ隕乗シ繧ッ繝ェ繝繝玲凾縺ョ蜃ヲ逅縲らオ先棡逧縺ォ縺ッ髱「蛟偵↑蜃ヲ逅縺ェ繧薙□繧医↑____ ] + this.n髢句ァ九し繧、繧コW = n髢句ァ九し繧、繧コW; + this.n髢句ァ九し繧、繧コH = n髢句ァ九し繧、繧コH; + this.n邨ゆコ繧オ繧、繧コW = n邨ゆコ繧オ繧、繧コW; + this.n邨ゆコ繧オ繧、繧コH = n邨ゆコ繧オ繧、繧コH; + this.n逕サ蜒丞エ髢句ァ倶ス咲スョX = n逕サ蜒丞エ髢句ァ倶ス咲スョX; + this.n逕サ蜒丞エ髢句ァ倶ス咲スョY = n逕サ蜒丞エ髢句ァ倶ス咲スョY; + this.n逕サ蜒丞エ邨ゆコ菴咲スョX = n逕サ蜒丞エ邨ゆコ菴咲スョX; + this.n逕サ蜒丞エ邨ゆコ菴咲スョY = n逕サ蜒丞エ邨ゆコ菴咲スョY; + this.n陦ィ遉コ蛛エ髢句ァ倶ス咲スョX = n陦ィ遉コ蛛エ髢句ァ倶ス咲スョX; + this.n陦ィ遉コ蛛エ髢句ァ倶ス咲スョY = n陦ィ遉コ蛛エ髢句ァ倶ス咲スョY; + this.n陦ィ遉コ蛛エ邨ゆコ菴咲スョX = n陦ィ遉コ蛛エ邨ゆコ菴咲スョX; + this.n陦ィ遉コ蛛エ邨ゆコ菴咲スョY = n陦ィ遉コ蛛エ邨ゆコ菴咲スョY; + this.n邱冗ァサ蜍墓凾髢杜s = n邱冗ァサ蜍墓凾髢杜s; + this.n遘サ蜍暮幕蟋区凾蛻サms = (n遘サ蜍暮幕蟋区凾蛻サms != -1) ? n遘サ蜍暮幕蟋区凾蛻サms : (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + this.n蜑榊屓陦ィ遉コ縺励◆繝輔Ξ繝シ繝逡ェ蜿キ = -1; + + this.vclip = new Vector3(1.42f, 1.42f, 1f); + this.dsBGV = null; + #endregion + } + if (this.tx謠冗判逕ィ == null) + { + this.tx謠冗判逕ィ = new CTexture(TJAPlayer3.app.Device, (int)this.framewidth, (int)this.frameheight, TJAPlayer3.app.GraphicsDeviceManager.CurrentSettings.BackBufferFormat, Pool.Managed); + } + + #region[ 繝ェ繧オ繧、繧コ蜃ヲ逅 ] + if (fAVI繧「繧ケ繝壹け繝域ッ < 1.77f) + { + //譌ァ莨∫判繧ッ繝ェ繝繝励□縺」縺溷エ蜷 + this.ratio1 = 720f / ((float)this.frameheight); + this.position = (int)((1280f - (this.framewidth * this.ratio1)) / 2f); + int num = (int)(this.framewidth * this.ratio1); + if (num <= 565) + { + this.position = 295 + ((int)((565f - (this.framewidth * this.ratio1)) / 2f)); + this.i1 = 0; + this.i2 = (int)this.framewidth; + this.rec = new Rectangle(0, 0, 0, 0); + this.rec3 = new Rectangle(0, 0, 0, 0); + this.rec2 = new Rectangle(0, 0, (int)this.framewidth, (int)this.frameheight); + } + else + { + this.position = 295 - ((int)(((this.framewidth * this.ratio1) - 565f) / 2f)); + this.i1 = (int)(((float)(295 - this.position)) / this.ratio1); + this.i2 = (int)((565f / ((float)num)) * this.framewidth); + this.rec = new Rectangle(0, 0, this.i1, (int)this.frameheight); + this.rec3 = new Rectangle(this.i1 + this.i2, 0, (((int)this.framewidth) - this.i1) - this.i2, (int)this.frameheight); + this.rec2 = new Rectangle(this.i1, 0, this.i2, (int)this.frameheight); + } + this.tx謠冗判逕ィ.vc諡。螟ァ邵ョ蟆丞咲紫.X = this.ratio1; + this.tx謠冗判逕ィ.vc諡。螟ァ邵ョ蟆丞咲紫.Y = this.ratio1; + } + else + { + //繝ッ繧、繝峨け繝ェ繝繝励ョ蜃ヲ逅 + this.ratio1 = 1280f / ((float)this.framewidth); + this.position = (int)((720f - (this.frameheight * this.ratio1)) / 2f); + this.i1 = (int)(this.framewidth * 0.23046875); + this.i2 = (int)(this.framewidth * 0.44140625); + this.rec = new Rectangle(0, 0, this.i1, (int)this.frameheight); + this.rec2 = new Rectangle(this.i1, 0, this.i2, (int)this.frameheight); + this.rec3 = new Rectangle(this.i1 + this.i2, 0, (((int)this.framewidth) - this.i1) - this.i2, (int)this.frameheight); + this.tx謠冗判逕ィ.vc諡。螟ァ邵ョ蟆丞咲紫.X = this.ratio1; + this.tx謠冗判逕ィ.vc諡。螟ァ邵ョ蟆丞咲紫.Y = this.ratio1; + } + + + if (this.framewidth > 420) + { + f諡。螟ァ邇x = 420f / ((float)this.framewidth); + } + else + { + f諡。螟ァ邇x = 1f; + } + if (this.frameheight > 580) + { + f諡。螟ァ邇y = 580f / ((float)this.frameheight); + } + else + { + f諡。螟ァ邇y = 1f; + } + if (f諡。螟ァ邇x > f諡。螟ァ邇y) + { + f諡。螟ァ邇x = f諡。螟ァ邇y; + } + else + { + f諡。螟ァ邇y = f諡。螟ァ邇x; + } + + this.smallvc = new Vector3(f諡。螟ァ邇x, f諡。螟ァ邇y, 1f); + #endregion + } + + if ( fAVI繧「繧ケ繝壹け繝域ッ > 1.77f && this.dsBGV != null && this.dsBGV.dshow != null ) + { + this.dsBGV.dshow.t蜀咲函髢句ァ(); + this.bDShow繧ッ繝ェ繝繝励r蜀咲函縺励※縺繧 = true; + this.b蜀咲函繝医げ繝ォ = true; + } + } + } + public void SkipStart( int n遘サ蜍暮幕蟋区凾蛻サms ) + { + foreach ( CDTX.CChip chip in TJAPlayer3.DTX.listChip ) + { + if ( chip.n逋コ螢ー譎ょ綾ms > n遘サ蜍暮幕蟋区凾蛻サms ) + { + break; + } + switch ( chip.eAVI遞ョ蛻・ ) + { + case EAVI遞ョ蛻・.AVI: + { + if ( chip.rAVI != null ) + { + this.Start( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ, chip.rAVI, chip.rDShow, 1280, 720, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, chip.n逋コ螢ー譎ょ綾ms ); + } + continue; + } + } + } + } + public void Stop() + { + if ( ( this.rAVI != null ) && ( this.rAVI.avi != null ) ) + { + this.n遘サ蜍暮幕蟋区凾蛻サms = -1; + } + + if( this.dsBGV != null ) + { + if( this.dsBGV.dshow != null ) + this.dsBGV.dshow.MediaCtrl.Stop(); + this.bDShow繧ッ繝ェ繝繝励r蜀咲函縺励※縺繧 = false; + } + } + public void Cont( int n蜀埼幕譎ょ綾ms ) + { + if ( ( this.rAVI != null ) && ( this.rAVI.avi != null ) ) + { + this.n遘サ蜍暮幕蟋区凾蛻サms = n蜀埼幕譎ょ綾ms; + } + } + public unsafe int t騾イ陦梧緒逕サ( int x, int y ) + { + if ( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + Rectangle rectangle; + Rectangle rectangle2; + if( !this.bDShow繧ッ繝ェ繝繝励r蜀咲函縺励※縺繧 || ( this.dsBGV.dshow == null || this.dsBGV == null ) ) + { + if( ( ( this.n遘サ蜍暮幕蟋区凾蛻サms == -1 ) || ( this.rAVI == null ) ) || ( this.rAVI.avi == null ) ) + { + return 0; + } + } + if ( this.tx謠冗判逕ィ == null ) + { + return 0; + } + int time = (int) ( ( CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 - this.n遘サ蜍暮幕蟋区凾蛻サms ) * ( ( (double) TJAPlayer3.ConfigIni.n貍泌・城溷コヲ ) / 20.0 ) ); + int frameNoFromTime = 0; + + #region[ frameNoFromTime ] + if ( (this.dsBGV != null) ) + { + if ( this.fAVI繧「繧ケ繝壹け繝域ッ > 1.77f ) + { + this.dsBGV.dshow.MediaSeeking.GetPositions(out this.lDshowPosition, out this.lStopPosition); + frameNoFromTime = (int)lDshowPosition; + } + else + { + frameNoFromTime = this.rAVI.avi.GetFrameNoFromTime(time); + } + } + #endregion + + if ( ( this.n邱冗ァサ蜍墓凾髢杜s != 0 ) && ( this.n邱冗ァサ蜍墓凾髢杜s < time ) ) + { + this.n邱冗ァサ蜍墓凾髢杜s = 0; + this.n遘サ蜍暮幕蟋区凾蛻サms = -1; + return 0; + } + + //2014.11.17 kairera0467 AVI縺檎┌縺迥カ諷九〒AVI縺ョ繝輔Ξ繝シ繝繧ォ繧ヲ繝ウ繝医r縺輔○繧九→繧ィ繝ゥ繝シ繧貞瑞縺上◆繧√√°縺ェ繧企尅縺ァ縺ッ縺ゅk縺悟ッセ遲悶 + if( ( this.n邱冗ァサ蜍墓凾髢杜s == 0 ) && this.rAVI.avi != null ? ( frameNoFromTime >= this.rAVI.avi.GetMaxFrameCount() ) : false ) + { + this.n遘サ蜍暮幕蟋区凾蛻サms = -1L; + } + if((((this.n蜑榊屓陦ィ遉コ縺励◆繝輔Ξ繝シ繝逡ェ蜿キ != frameNoFromTime) || !this.b繝輔Ξ繝シ繝繧剃ス懈舌@縺)) && (fAVI繧「繧ケ繝壹け繝域ッ < 1.77f )) + { + this.pBmp = this.rAVI.avi.GetFramePtr(frameNoFromTime); + this.n蜑榊屓陦ィ遉コ縺励◆繝輔Ξ繝シ繝逡ェ蜿キ = frameNoFromTime; + this.b繝輔Ξ繝シ繝繧剃ス懈舌@縺 = true; + } + + //繝ォ繝シ繝鈴亟豁「 + if ( this.lDshowPosition >= this.lStopPosition && this.dsBGV != null ) + { + this.dsBGV.dshow.MediaSeeking.SetPositions( + DsLong.FromInt64((long)(0)), + AMSeekingSeekingFlags.AbsolutePositioning, + null, + AMSeekingSeekingFlags.NoPositioning); + this.dsBGV.dshow.MediaCtrl.Stop(); + this.bDShow繧ッ繝ェ繝繝励r蜀咲函縺励※縺繧 = false; + } + + #region[ 繝輔Ξ繝シ繝蟷 ] + //uint縺倥c縺ェ縺上※int縲DTXHD縺ァ縺ッ辟。鬧縺ォ螟画鋤縺励※縺溘ュ縲 + int n繝輔Ξ繝シ繝蟷 = 0; + int n繝輔Ξ繝シ繝鬮倥& = 0; + + if( this.dsBGV != null ) + { + n繝輔Ξ繝シ繝蟷 = this.dsBGV.dshow.n蟷px; + n繝輔Ξ繝シ繝鬮倥& = this.dsBGV.dshow.n鬮倥&px; + } + else if( this.rAVI != null || this.rAVI.avi != null ) + { + n繝輔Ξ繝シ繝蟷 = (int)this.rAVI.avi.n繝輔Ξ繝シ繝蟷; + n繝輔Ξ繝シ繝鬮倥& = (int)this.rAVI.avi.n繝輔Ξ繝シ繝鬮倥&; + } + #endregion + + //2014.11.17 kairera0467 繝輔Ξ繝シ繝蟷繧池AVI縺九i蜿らァ縺励※縺縺溘◆繧√∝医↓繝ュ繝シ繧ォ繝ォ髢「謨ー縺ァ豎コ繧√k繧医≧螟画峩縲 + Size sz繝輔Ξ繝シ繝蟷 = new Size( n繝輔Ξ繝シ繝蟷, n繝輔Ξ繝シ繝鬮倥& ); + Size sz譛螟ァ繝輔Ξ繝シ繝蟷 = new Size( 1280, 720 ); + Size size3 = new Size( this.n髢句ァ九し繧、繧コW, this.n髢句ァ九し繧、繧コH ); + Size size4 = new Size( this.n邨ゆコ繧オ繧、繧コW, this.n邨ゆコ繧オ繧、繧コH ); + Point location = new Point( this.n逕サ蜒丞エ髢句ァ倶ス咲スョX, this.n逕サ蜒丞エ邨ゆコ菴咲スョY ); + Point point2 = new Point( this.n逕サ蜒丞エ邨ゆコ菴咲スョX, this.n逕サ蜒丞エ邨ゆコ菴咲スョY ); + Point point3 = new Point( this.n陦ィ遉コ蛛エ髢句ァ倶ス咲スョX, this.n陦ィ遉コ蛛エ髢句ァ倶ス咲スョY ); + Point point4 = new Point( this.n陦ィ遉コ蛛エ邨ゆコ菴咲スョX, this.n陦ィ遉コ蛛エ邨ゆコ菴咲スョY ); + long num3 = this.n邱冗ァサ蜍墓凾髢杜s; + long num4 = this.n遘サ蜍暮幕蟋区凾蛻サms; + if ((CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) < num4) + { + num4 = (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + } + time = (int)(((CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) - num4)); + if ( num3 == 0 ) + { + rectangle = new Rectangle( location, size3 ); + rectangle2 = new Rectangle( point3, size3 ); + } + else + { + double num5 = ( (double) time ) / ( (double) num3 ); + Size size5 = new Size( size3.Width + ( (int) ( ( size4.Width - size3.Width ) * num5 ) ), size3.Height + ( (int) ( ( size4.Height - size3.Height ) * num5 ) ) ); + rectangle = new Rectangle( (int) ( ( point2.X - location.X ) * num5 ), (int) ( ( point2.Y - location.Y ) * num5 ), ( (int) ( ( point2.X - location.X ) * num5 ) ) + size5.Width, ( (int) ( ( point2.Y - location.Y ) * num5 ) ) + size5.Height ); + rectangle2 = new Rectangle( (int) ( ( point4.X - point3.X ) * num5 ), (int) ( ( point4.Y - point3.Y ) * num5 ), ( (int) ( ( point4.X - point3.X ) * num5 ) ) + size5.Width, ( (int) ( ( point4.Y - point3.Y ) * num5 ) ) + size5.Height ); + if ( ( ( rectangle.Right <= 0 ) || ( rectangle.Bottom <= 0 ) ) || ( ( rectangle.Left >= sz繝輔Ξ繝シ繝蟷.Width ) || ( rectangle.Top >= sz繝輔Ξ繝シ繝蟷.Height ) ) ) + { + return 0; + } + if ( ( ( rectangle2.Right <= 0 ) || ( rectangle2.Bottom <= 0 ) ) || ( ( rectangle2.Left >= sz譛螟ァ繝輔Ξ繝シ繝蟷.Width ) || ( rectangle2.Top >= sz譛螟ァ繝輔Ξ繝シ繝蟷.Height ) ) ) + { + return 0; + } + if ( rectangle.X < 0 ) + { + int num6 = -rectangle.X; + rectangle2.X += num6; + rectangle2.Width -= num6; + rectangle.X = 0; + rectangle.Width -= num6; + } + if ( rectangle.Y < 0 ) + { + int num7 = -rectangle.Y; + rectangle2.Y += num7; + rectangle2.Height -= num7; + rectangle.Y = 0; + rectangle.Height -= num7; + } + if ( rectangle.Right > sz繝輔Ξ繝シ繝蟷.Width ) + { + int num8 = rectangle.Right - sz繝輔Ξ繝シ繝蟷.Width; + rectangle2.Width -= num8; + rectangle.Width -= num8; + } + if ( rectangle.Bottom > sz繝輔Ξ繝シ繝蟷.Height ) + { + int num9 = rectangle.Bottom - sz繝輔Ξ繝シ繝蟷.Height; + rectangle2.Height -= num9; + rectangle.Height -= num9; + } + if ( rectangle2.X < 0 ) + { + int num10 = -rectangle2.X; + rectangle.X += num10; + rectangle.Width -= num10; + rectangle2.X = 0; + rectangle2.Width -= num10; + } + if ( rectangle2.Y < 0 ) + { + int num11 = -rectangle2.Y; + rectangle.Y += num11; + rectangle.Height -= num11; + rectangle2.Y = 0; + rectangle2.Height -= num11; + } + if ( rectangle2.Right > sz譛螟ァ繝輔Ξ繝シ繝蟷.Width ) + { + int num12 = rectangle2.Right - sz譛螟ァ繝輔Ξ繝シ繝蟷.Width; + rectangle.Width -= num12; + rectangle2.Width -= num12; + } + if ( rectangle2.Bottom > sz譛螟ァ繝輔Ξ繝シ繝蟷.Height ) + { + int num13 = rectangle2.Bottom - sz譛螟ァ繝輔Ξ繝シ繝蟷.Height; + rectangle.Height -= num13; + rectangle2.Height -= num13; + } + if ( ( rectangle.X >= rectangle.Right ) || ( rectangle.Y >= rectangle.Bottom ) ) + { + return 0; + } + if ( ( rectangle2.X >= rectangle2.Right ) || ( rectangle2.Y >= rectangle2.Bottom ) ) + { + return 0; + } + if ( ( ( rectangle.Right < 0 ) || ( rectangle.Bottom < 0 ) ) || ( ( rectangle.X > sz繝輔Ξ繝シ繝蟷.Width ) || ( rectangle.Y > sz繝輔Ξ繝シ繝蟷.Height ) ) ) + { + return 0; + } + if ( ( ( rectangle2.Right < 0 ) || ( rectangle2.Bottom < 0 ) ) || ( ( rectangle2.X > sz譛螟ァ繝輔Ξ繝シ繝蟷.Width ) || ( rectangle2.Y > sz譛螟ァ繝輔Ξ繝シ繝蟷.Height ) ) ) + { + return 0; + } + } + if( ( this.tx謠冗判逕ィ != null )) + { + if ( ( this.bDShow繧ッ繝ェ繝繝励r蜀咲函縺励※縺繧 == true ) && this.dsBGV.dshow != null ) + { + #region[ 繝ッ繧、繝峨け繝ェ繝繝 ] + this.dsBGV.dshow.t迴セ譎らせ縺ォ縺翫¢繧区怙譁ー縺ョ繧ケ繝翫ャ繝励う繝。繝シ繧ク繧探exture縺ォ霆「蜀吶☆繧( this.tx謠冗判逕ィ ); + this.dsBGV.dshow.t迴セ譎らせ縺ォ縺翫¢繧区怙譁ー縺ョ繧ケ繝翫ャ繝励う繝。繝シ繧ク繧探exture縺ォ霆「蜀吶☆繧( this.tx遯捺緒逕サ逕ィ ); + + if( TJAPlayer3.ConfigIni.eClipDispType == EClipDispType.閭梧勹縺ョ縺ソ || TJAPlayer3.ConfigIni.eClipDispType == EClipDispType.荳。譁ケ ) + { + if( this.dsBGV.dshow.b荳贋ク句渚霆「 ) + this.tx謠冗判逕ィ.t2D荳贋ク句渚霆「謠冗判( TJAPlayer3.app.Device, x, y ); + else + this.tx謠冗判逕ィ.t2D謠冗判( TJAPlayer3.app.Device, x, y ); + } + #endregion + } + } + else if ( ( this.tx謠冗判逕ィ != null ) && ( this.n邱冗ァサ蜍墓凾髢杜s != -1 ) ) + { + if ( this.b繝輔Ξ繝シ繝繧剃ス懈舌@縺 && ( this.pBmp != IntPtr.Zero ) ) + { + DataRectangle rectangle3 = this.tx謠冗判逕ィ.texture.LockRectangle( 0, LockFlags.None ); + DataStream data = rectangle3.Data; + int num14 = rectangle3.Pitch / this.tx謠冗判逕ィ.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + BitmapUtil.BITMAPINFOHEADER* pBITMAPINFOHEADER = (BitmapUtil.BITMAPINFOHEADER*) this.pBmp.ToPointer(); + if ( pBITMAPINFOHEADER->biBitCount == 0x18 ) + { + switch ( num14 ) + { + case 2: + this.rAVI.avi.tBitmap24ToGraphicsStreamR5G6B5( pBITMAPINFOHEADER, data, this.tx謠冗判逕ィ.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, this.tx謠冗判逕ィ.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height ); + break; + + case 4: + this.rAVI.avi.tBitmap24ToGraphicsStreamX8R8G8B8( pBITMAPINFOHEADER, data, this.tx謠冗判逕ィ.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, this.tx謠冗判逕ィ.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height ); + break; + } + } + this.tx謠冗判逕ィ.texture.UnlockRectangle( 0 ); + this.b繝輔Ξ繝シ繝繧剃ス懈舌@縺 = false; + } + double dbAVI豈皮紫 = this.rAVI.avi.n繝輔Ξ繝シ繝蟷 / this.rAVI.avi.n繝輔Ξ繝シ繝鬮倥&; + + //縺ィ繧翫≠縺医★16:9莉・螟悶ッ蜀咲函縺励↑縺縲 + if( dbAVI豈皮紫 < 1.77 ) + this.tx謠冗判逕ィ.t2D謠冗判( TJAPlayer3.app.Device, 0, 0 ); + } + } + return 0; + } + + public void t遯楢。ィ遉コ() + { + //return; + + if( ( this.bDShow繧ッ繝ェ繝繝励r蜀咲函縺励※縺繧 == true ) && this.dsBGV.dshow != null ) + { + #region[ 繝ッ繧、繝峨け繝ェ繝繝 ] + float fRet = this.dsBGV.dshow.n蟷px / this.dsBGV.dshow.n鬮倥&px; + + //讓ェ蟷,邵ヲ蟷,X,Y + float[] fRatio = new float[] { 320.0f, 180.0f, 6, 450 }; //蟾ヲ荳玖。ィ遉コ + if( this.tx遯捺緒逕サ逕ィ != null && fRet == 1.0 ) + { + //if( ) + { + fRatio = new float[] { 640.0f - 4.0f, 360.0f - 4.0f, 322, 362 }; //荳ュ螟ョ荳玖。ィ遉コ + } + // + + this.tx遯捺緒逕サ逕ィ.vc諡。螟ァ邵ョ蟆丞咲紫.X = (float)( fRatio[ 0 ] / this.dsBGV.dshow.n蟷px ); + this.tx遯捺緒逕サ逕ィ.vc諡。螟ァ邵ョ蟆丞咲紫.Y = (float)( fRatio[ 1 ] / this.dsBGV.dshow.n鬮倥&px ); + if( this.dsBGV.dshow.b荳贋ク句渚霆「 ) + this.tx遯捺緒逕サ逕ィ.t2D荳贋ク句渚霆「謠冗判( TJAPlayer3.app.Device, (int)fRatio[ 2 ], (int)fRatio[ 3 ] ); + else + this.tx遯捺緒逕サ逕ィ.t2D謠冗判( TJAPlayer3.app.Device, (int)fRatio[ 2 ], (int)fRatio[ 3 ] ); + } + + #endregion + } + } + + public void tPauseControl() + { + if( this.b蜀咲函繝医げ繝ォ == true ) + { + if( this.dsBGV != null ) + { + if( this.dsBGV.dshow != null ) + this.dsBGV.dshow.MediaCtrl.Pause(); + } + this.b蜀咲函繝医げ繝ォ = false; + } + else if( this.b蜀咲函繝医げ繝ォ == false ) + { + if(this.dsBGV != null ) + { + if( this.dsBGV.dshow != null ) + this.dsBGV.dshow.MediaCtrl.Run(); + } + this.b蜀咲函繝医げ繝ォ = true; + } + } + + public void tReset() + { + if( this.dsBGV != null ) + { + if( this.dsBGV.dshow != null ) + { + this.dsBGV.dshow.MediaSeeking.SetPositions( + DsLong.FromInt64((long)(0)), + AMSeekingSeekingFlags.AbsolutePositioning, + null, + AMSeekingSeekingFlags.NoPositioning); + this.dsBGV.dshow.MediaCtrl.Stop(); + } + } + if( this.tx謠冗判逕ィ != null && this.tx遯捺緒逕サ逕ィ != null ) + { + //2016.12.22 kairera0467 隗」謾セ竊堤函謌舌→縺縺縺ョ繧ゅ←縺縺ェ縺ョ縺繧阪≧縺... + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k( ref this.tx謠冗判逕ィ ); + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k( ref this.tx遯捺緒逕サ逕ィ ); + + this.tx謠冗判逕ィ = new CTexture( TJAPlayer3.app.Device, 1280, 720, TJAPlayer3.app.GraphicsDeviceManager.CurrentSettings.BackBufferFormat, Pool.Managed ); + this.tx遯捺緒逕サ逕ィ = new CTexture( TJAPlayer3.app.Device, 1280, 720, TJAPlayer3.app.GraphicsDeviceManager.CurrentSettings.BackBufferFormat, Pool.Managed ); + } + + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + this.rAVI = null; + this.n遘サ蜍暮幕蟋区凾蛻サms = -1; + this.n蜑榊屓陦ィ遉コ縺励◆繝輔Ξ繝シ繝逡ェ蜿キ = -1; + this.b繝輔Ξ繝シ繝繧剃ス懈舌@縺 = false; + this.pBmp = IntPtr.Zero; + base.On豢サ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if ( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { +#if TEST_Direct3D9Ex + this.tx謠冗判逕ィ = new CTexture( CDTXMania.app.Device, 320, 355, CDTXMania.app.GraphicsDeviceManager.CurrentSettings.BackBufferFormat, Pool.Default, Usage.Dynamic ); +#else + this.tx謠冗判逕ィ = new CTexture( TJAPlayer3.app.Device, 1280, 720, TJAPlayer3.app.GraphicsDeviceManager.CurrentSettings.BackBufferFormat, Pool.Managed ); + this.tx遯捺緒逕サ逕ィ = new CTexture( TJAPlayer3.app.Device, 1280, 720, TJAPlayer3.app.GraphicsDeviceManager.CurrentSettings.BackBufferFormat, Pool.Managed ); +#endif + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if ( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + if ( this.tx謠冗判逕ィ != null ) + { + this.tx謠冗判逕ィ.Dispose(); + this.tx謠冗判逕ィ = null; + } + if( this.tx遯捺緒逕サ逕ィ != null ) + { + this.tx遯捺緒逕サ逕ィ.Dispose(); + this.tx遯捺緒逕サ逕ィ = null; + } + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + throw new InvalidOperationException( "t騾イ陦梧緒逕サ(int,int)縺ョ縺サ縺繧剃スソ逕ィ縺励※縺上□縺輔>縲" ); + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private bool b繝輔Ξ繝シ繝繧剃ス懈舌@縺; + private long n遘サ蜍暮幕蟋区凾蛻サms; + private int n逕サ蜒丞エ髢句ァ倶ス咲スョX; + private int n逕サ蜒丞エ髢句ァ倶ス咲スョY; + private int n逕サ蜒丞エ邨ゆコ菴咲スョX; + private int n逕サ蜒丞エ邨ゆコ菴咲スョY; + private int n髢句ァ九し繧、繧コH; + private int n髢句ァ九し繧、繧コW; + private int n邨ゆコ繧オ繧、繧コH; + private int n邨ゆコ繧オ繧、繧コW; + private int n蜑榊屓陦ィ遉コ縺励◆繝輔Ξ繝シ繝逡ェ蜿キ; + private int n邱冗ァサ蜍墓凾髢杜s; + private int n陦ィ遉コ蛛エ髢句ァ倶ス咲スョX; + private int n陦ィ遉コ蛛エ髢句ァ倶ス咲スョY; + private int n陦ィ遉コ蛛エ邨ゆコ菴咲スョX; + private int n陦ィ遉コ蛛エ邨ゆコ菴咲スョY; + + public float fAVI繧「繧ケ繝壹け繝域ッ; + private uint frameheight; + private uint framewidth; + private int i1; + private int i2; + private int position; + private int position2; + private float ratio1; + private float ratio2; + private Rectangle rec; + private Rectangle rec2; + private Rectangle rec3; + public Vector3 smallvc; + private Vector3 vclip; + public Vector3 vector; + + private IntPtr pBmp; + private CDTX.CAVI rAVI; + private CTexture tx謠冗判逕ィ; + private CTexture tx遯捺緒逕サ逕ィ; + + //DirectShow逕ィ + private bool b蜀咲函繝医げ繝ォ; + private bool bDShow繧ッ繝ェ繝繝励r蜀咲函縺励※縺繧; + private long lDshowPosition; + private long lStopPosition; + + public CDTX.CDirectShow dsBGV; + + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/CAct貍泌・修ombo蜈ア騾.cs b/TJAPlayer3/Stages/07.Game/CAct貍泌・修ombo蜈ア騾.cs new file mode 100644 index 00000000..ec56d17f --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/CAct貍泌・修ombo蜈ア騾.cs @@ -0,0 +1,777 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・修ombo蜈ア騾 : CActivity + { + // 繝励Ο繝代ユ繧」 + + public STCOMBO n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚; + public struct STCOMBO + { + public CAct貍泌・修ombo蜈ア騾 act; + + public int this[int index] + { + get + { + switch (index) + { + case 0: + return this.P1; + + case 1: + return this.P2; + + case 2: + return this.P3; + + case 3: + return this.P4; + } + throw new IndexOutOfRangeException(); + } + set + { + switch (index) + { + case 0: + this.P1 = value; + return; + + case 1: + this.P2 = value; + return; + + case 2: + this.P3 = value; + return; + + case 3: + this.P4 = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + public int P1 + { + get + { + return this.p1; + } + set + { + this.p1 = value; + if (this.p1 > this.譛鬮伜、[0]) + { + this.譛鬮伜、[0] = this.p1; + } + this.act.status.P1.nCOMBO蛟、 = this.p1; + this.act.status.P1.n譛鬮呂OMBO蛟、 = this.譛鬮伜、[0]; + } + } + public int P2 + { + get + { + return this.p2; + } + set + { + this.p2 = value; + if (this.p2 > this.譛鬮伜、[1]) + { + this.譛鬮伜、[1] = this.p2; + } + this.act.status.P2.nCOMBO蛟、 = this.p2; + this.act.status.P2.n譛鬮呂OMBO蛟、 = this.譛鬮伜、[1]; + } + } + public int P3 + { + get + { + return this.p3; + } + set + { + this.p3 = value; + if (this.p3 > this.譛鬮伜、[2]) + { + this.譛鬮伜、[2] = this.p3; + } + this.act.status.P3.nCOMBO蛟、 = this.p3; + this.act.status.P3.n譛鬮呂OMBO蛟、 = this.譛鬮伜、[2]; + } + } + public int P4 + { + get + { + return this.p4; + } + set + { + this.p4 = value; + if (this.p4 > this.譛鬮伜、[3]) + { + this.譛鬮伜、[3] = this.p4; + } + this.act.status.P4.nCOMBO蛟、 = this.p4; + this.act.status.P4.n譛鬮呂OMBO蛟、 = this.譛鬮伜、[3]; + } + } + public int[] 譛鬮伜、 { get; set; } + + private int p1; + private int p2; + private int p3; + private int p4; + } + public C貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓吝ア騾 貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓 + { + get; + set; + } + + protected enum EEvent { 髱櫁。ィ遉コ, 謨ー蛟、譖エ譁ー, 蜷御ク謨ー蛟、, 繝溘せ騾夂衍 } + protected enum EMode { 髱櫁。ィ遉コ荳ュ, 騾イ陦瑚。ィ遉コ荳ュ, 谿句ワ陦ィ遉コ荳ュ } + protected const int n繝峨Λ繝繧ウ繝ウ繝懊ョCOMBO譁蟄励ョ鬮倥& = 32; + protected const int n繝峨Λ繝繧ウ繝ウ繝懊ョCOMBO譁蟄励ョ蟷 = 90; + protected const int n繝峨Λ繝繧ウ繝ウ繝懊ョ鬮倥& = 115; + protected const int n繝峨Λ繝繧ウ繝ウ繝懊ョ蟷 = 90; + protected const int n繝峨Λ繝繧ウ繝ウ繝懊ョ譁蟄鈴俣髫 = -6; + protected int[] n繧ク繝」繝ウ繝怜キョ蛻蛟、 = new int[180]; + protected CSTATUS status; + //protected CTexture txCOMBO螟ェ鮠; + //protected CTexture txCOMBO螟ェ鮠点縺ァ縺九>繧縺、; + //protected CTexture tx繧ウ繝ウ繝懊Λ繝。; + public CCounter[] ct繧ウ繝ウ繝懷刈邂; + public CCounter ct繧ウ繝ウ繝懊Λ繝。; + + protected float[,] n繧ウ繝ウ繝懈僑螟ァ邇_蠎ァ讓 = new float[,]{ + {1.11f,-7}, + {1.22f,-14}, + {1.2f,-12}, + {1.15f,-9}, + {1.13f,-8}, + {1.11f,-7}, + {1.06f,-3}, + {1.04f,-2}, + {1.0f,0}, + }; + protected float[,] n繧ウ繝ウ繝懈僑螟ァ邇_蠎ァ讓兩100combo = new float[,]{ + {0.81f,-7}, + {0.92f,-14}, + {0.9f,-12}, + {0.85f,-9}, + {0.83f,-8}, + {0.81f,-7}, + {0.78f,-3}, + {0.74f,-2}, + {0.7f,0}, + }; + protected float[,] n繧ウ繝ウ繝懈僑螟ァ邇_蠎ァ讓兩1000combo = new float[,]{ + {1.11f,-7}, + {1.22f,-14}, + {1.2f,-12}, + {1.15f,-9}, + {1.13f,-8}, + {1.11f,-7}, + {1.06f,-3}, + {1.04f,-2}, + {1.0f,0}, + }; + + + private float[] ComboScale = new float[] + { + 0.000f, + 0.042f, + 0.120f, + 0.160f, + 0.180f, + 0.120f, + 0.110f, + 0.095f, + 0.086f, + 0.044f, + 0.032f, + 0.011f, + 0.000f + }; + private float[,] ComboScale_Ex = new float[,] + { + { 0.000f, 0}, + { 0.042f, 0}, + { 0.120f, 0}, + { 0.160f, 0}, + { 0.180f, 0}, + { 0.120f, 0}, + { 0.110f, 0}, + { 0.095f, 0}, + { 0.086f, 0}, + { 0.044f, 0}, + { 0.032f, 0}, + { 0.011f, 0}, + { 0.000f, 0}, + }; + // 蜀驛ィ繧ッ繝ゥ繧ケ + + protected class CSTATUS + { + public CSTAT P1 = new CSTAT(); + public CSTAT P2 = new CSTAT(); + public CSTAT P3 = new CSTAT(); + public CSTAT P4 = new CSTAT(); + public CSTAT this[int index] + { + get + { + switch (index) + { + case 0: + return this.P1; + + case 1: + return this.P2; + + case 2: + return this.P3; + + case 3: + return this.P4; + } + throw new IndexOutOfRangeException(); + } + set + { + switch (index) + { + case 0: + this.P1 = value; + return; + + case 1: + this.P2 = value; + return; + + case 2: + this.P3 = value; + return; + + case 3: + this.P4 = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + + public class CSTAT + { + public CAct貍泌・修ombo蜈ア騾.EMode e迴セ蝨ィ縺ョ繝「繝シ繝; + public int nCOMBO蛟、; + public long n繧ウ繝ウ繝懊′蛻繧後◆譎ょ綾; + public int n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ蛟、; + public int n迴セ蝨ィ陦ィ遉コ荳ュ縺ョCOMBO蛟、; + public int n譛鬮呂OMBO蛟、; + public int n谿句ワ陦ィ遉コ荳ュ縺ョCOMBO蛟、; + public long n蜑榊屓縺ョ譎ょ綾_繧ク繝」繝ウ繝礼畑; + } + } + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CAct貍泌・修ombo蜈ア騾() + { + this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + + // 180蠎ヲ蛻縺ョ繧ク繝」繝ウ繝雄蠎ァ讓吝キョ蛻繧貞叙蠕励(0蠎ヲ: 0 竊 90蠎ヲ:-15 竊 180蠎ヲ: 0) + for (int i = 0; i < 180; i++) + this.n繧ク繝」繝ウ繝怜キョ蛻蛟、[i] = (int)(-15.0 * Math.Sin((Math.PI * i) / 180.0)); + 貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓 = new C貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓吝ア騾(); + } + + + // 繝。繧ス繝繝 + + protected virtual void t繧ウ繝ウ繝懆。ィ遉コ_繝峨Λ繝(int nCombo蛟、, int n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ) + { + } + + protected virtual void t繧ウ繝ウ繝懆。ィ遉コ_螟ェ鮠(int nCombo蛟、, int n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ, int nPlayer) + { + //繝繧ケ繝育畑繧ウ繝ウ繝懈焚 + //nCombo蛟、 = 72; + #region [ 莠句燕繝√ぉ繝繧ッ縲] + //----------------- + //if( CDTXMania.ConfigIni.b繝峨Λ繝繧ウ繝ウ繝懆。ィ遉コ == false ) + // return; // 陦ィ遉コOFF縲 + + if (nCombo蛟、 == 0) + return; // 繧ウ繝ウ繝懊ぞ繝ュ縺ッ陦ィ遉コ縺励↑縺縲 + //----------------- + #endregion + + int[] n菴阪ョ謨ー = new int[10]; // 陦ィ遉コ縺ッ10譯√b縺ゅl縺ー雜ウ繧翫k縺繧阪≧ + + this.ct繧ウ繝ウ繝懊Λ繝。.t騾イ陦鍬oop(); + this.ct繧ウ繝ウ繝懷刈邂夕nPlayer].t騾イ陦(); + + #region [ nCombo蛟、繧呈。∵焚縺斐→縺ォ n菴阪ョ謨ー[] 縺ォ譬シ邏阪☆繧九ゑシ井セ具シ嗜Combo蛟、=125 縺ョ縺ィ縺 n菴阪ョ謨ー = { 5,2,1,0,0,0,0,0,0,0 } シ ] + //----------------- + int n = nCombo蛟、; + int n譯∵焚 = 0; + while ((n > 0) && (n譯∵焚 < 10)) + { + n菴阪ョ謨ー[n譯∵焚] = n % 10; // 1縺ョ菴阪r譬シ邏 + n = (n - (n % 10)) / 10; // 蜿ウ縺ク繧キ繝輔ヨシ井セ: 12345 竊 1234 シ + n譯∵焚++; + } + //----------------- + #endregion + + #region [ n菴阪ョ謨ー[] 繧偵"COMBO" 竊 1縺ョ菴 竊 10縺ョ菴 窶ヲ 縺ョ鬆縺ォ縲∝承縺九i蟾ヲ縺ク蜷代°縺」縺ヲ鬆逡ェ縺ォ陦ィ遉コ縺吶k縲] + //----------------- + const int n1譯√#縺ィ縺ョ繧ク繝」繝ウ繝励ョ驕繧 = 30; // 1譯√↓縺、縺 50 繧、繝ウ繝繝繧ッ繧ケ驕繧後k + + + //X蜿ウ蠎ァ讓吶r蜈縺ォ縺励※縲∝承蠎ァ讓 - ( 繧ウ繝ウ繝懊ョ蟷 * 譯∵焚 ) 縺ァX蠎ァ讓吶r豎ゅa縺ヲ縺縺? + + int nY荳願セコ菴咲スョpx = TJAPlayer3.ConfigIni.bReverse.Drums ? 350 : 10; + int n謨ー蟄励→COMBO繧貞粋繧上○縺溽判蜒上ョ蜈ィ髟キpx = ((44) * n譯∵焚); + int x = 245 + (n謨ー蟄励→COMBO繧貞粋繧上○縺溽判蜒上ョ蜈ィ髟キpx / 2); + //int y = 212; + //int y = CDTXMania.Skin.nComboNumberY[ nPlayer ]; + + #region[ 繧ウ繝ウ繝懈枚蟄 ] + if (n譯∵焚 <= 2) + { + TJAPlayer3.Tx.Taiko_Combo_Text?.t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_Combo_Text_X[nPlayer], TJAPlayer3.Skin.Game_Taiko_Combo_Text_Y[nPlayer]); + } + else + { + TJAPlayer3.Tx.Taiko_Combo_Text?.t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_Combo_Text_X[nPlayer], TJAPlayer3.Skin.Game_Taiko_Combo_Text_Y[nPlayer]); + } + #endregion + + int rightX = 0; + #region 荳逡ェ蜿ウ縺ョ謨ー蟄励ョ蠎ァ讓吶ョ豎コ螳 + if (n譯∵焚 == 1) + { + // 荳譯√↑繧峨◎縺ョ縺セ縺セSkinConfig縺ョ蠎ァ讓吶r菴ソ逕ィ縺吶k縲 + rightX = TJAPlayer3.Skin.Game_Taiko_Combo_X[nPlayer]; + } + else if (n譯∵焚 == 2) + { + // 莠梧。√↑繧唄kinConfig縺ョ蠎ァ讓+繝代ョ繧」繝ウ繧ー/2繧剃スソ逕ィ縺吶k + rightX = TJAPlayer3.Skin.Game_Taiko_Combo_X[nPlayer] + TJAPlayer3.Skin.Game_Taiko_Combo_Padding[0] / 2; + } + else if (n譯∵焚 == 3) + { + // 荳画。√↑繧唄kinConfig縺ョ蠎ァ讓+繝代ョ繧」繝ウ繧ー繧剃スソ逕ィ縺吶k + rightX = TJAPlayer3.Skin.Game_Taiko_Combo_Ex_X[nPlayer] + TJAPlayer3.Skin.Game_Taiko_Combo_Padding[1]; + } + else if (n譯∵焚 == 4) + { + // 蝗帶。√↑繧唄kinconfig縺ョ蠎ァ讓+繝代ョ繧」繝ウ繧ー/2 + 繝代ョ繧」繝ウ繧ー繧剃スソ逕ィ縺吶k + rightX = TJAPlayer3.Skin.Game_Taiko_Combo_Ex4_X[nPlayer] + TJAPlayer3.Skin.Game_Taiko_Combo_Padding[2] / 2 + TJAPlayer3.Skin.Game_Taiko_Combo_Padding[2]; + } + else + { + // 莠疲。∽サ・荳翫ョ蝣エ蜷 + int rightDigit = 0; + switch (n譯∵焚 % 2) + { + case 0: + // 2縺ァ蜑イ繧雁繧後k + // 繝代ョ繧」繝ウ繧ー/2繧定カウ縺吝ソ隕√′縺ゅk + // 蜿ウ縺ォ陦ィ遉コ縺輔l繧区。∵焚繧呈アゅa縲-1縺吶k + rightDigit = n譯∵焚 / 2 - 1; + rightX = TJAPlayer3.Skin.Game_Taiko_Combo_Ex4_X[nPlayer] + TJAPlayer3.Skin.Game_Taiko_Combo_Padding[2] / 2 + TJAPlayer3.Skin.Game_Taiko_Combo_Padding[2] * rightDigit; + break; + case 1: + // 2縺ァ蜑イ繧九→縺ゅ∪繧翫′蜃コ繧 + // 縺昴ョ縺セ縺セ繝代ョ繧」繝ウ繧ー繧定カウ縺励※縺縺 + // 蜿ウ縺ォ陦ィ遉コ縺輔l繧区。∵焚繧呈アゅa繧(荳ュ螟ョ髯、縺 -1) + rightDigit = (n譯∵焚 - 1) / 2; + rightX = TJAPlayer3.Skin.Game_Taiko_Combo_Ex4_X[nPlayer] + TJAPlayer3.Skin.Game_Taiko_Combo_Padding[2] * rightDigit; + break; + default: + break; + } + } + #endregion + + + for (int i = 0; i < n譯∵焚; i++) + { + + TJAPlayer3.Tx.Taiko_Combo[0].Opacity = 255; + TJAPlayer3.Tx.Taiko_Combo[1].Opacity = 255; + + if (n譯∵焚 <= 1) + { + if (TJAPlayer3.Tx.Taiko_Combo[0] != null) + { + var yScalling = ComboScale[this.ct繧ウ繝ウ繝懷刈邂夕nPlayer].n迴セ蝨ィ縺ョ蛟、]; + TJAPlayer3.Tx.Taiko_Combo[0].vc諡。螟ァ邵ョ蟆丞咲紫.Y = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[0] + yScalling; + TJAPlayer3.Tx.Taiko_Combo[0].vc諡。螟ァ邵ョ蟆丞咲紫.X = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[0]; + TJAPlayer3.Tx.Taiko_Combo[0].t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, rightX, TJAPlayer3.Skin.Game_Taiko_Combo_Y[nPlayer], new Rectangle(n菴阪ョ謨ー[i] * TJAPlayer3.Skin.Game_Taiko_Combo_Size[0], 0, TJAPlayer3.Skin.Game_Taiko_Combo_Size[0], TJAPlayer3.Skin.Game_Taiko_Combo_Size[1])); + } + } + else if (n譯∵焚 <= 2) + { + //int[] arComboX = { CDTXMania.Skin.Game_Taiko_Combo_X[nPlayer] + CDTXMania.Skin.Game_Taiko_Combo_Padding[0], CDTXMania.Skin.Game_Taiko_Combo_X[nPlayer] - CDTXMania.Skin.Game_Taiko_Combo_Padding[0] }; + if (nCombo蛟、 < 50) + { + if (TJAPlayer3.Tx.Taiko_Combo[0] != null) + { + var yScalling = ComboScale[this.ct繧ウ繝ウ繝懷刈邂夕nPlayer].n迴セ蝨ィ縺ョ蛟、]; + TJAPlayer3.Tx.Taiko_Combo[0].vc諡。螟ァ邵ョ蟆丞咲紫.Y = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[0] + yScalling; + TJAPlayer3.Tx.Taiko_Combo[0].vc諡。螟ァ邵ョ蟆丞咲紫.X = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[0]; + TJAPlayer3.Tx.Taiko_Combo[0].t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[0] * i, TJAPlayer3.Skin.Game_Taiko_Combo_Y[nPlayer], new Rectangle(n菴阪ョ謨ー[i] * TJAPlayer3.Skin.Game_Taiko_Combo_Size[0], 0, TJAPlayer3.Skin.Game_Taiko_Combo_Size[0], TJAPlayer3.Skin.Game_Taiko_Combo_Size[1])); + } + } + else + { + if (TJAPlayer3.Tx.Taiko_Combo[2] != null) + { + var yScalling = ComboScale[this.ct繧ウ繝ウ繝懷刈邂夕nPlayer].n迴セ蝨ィ縺ョ蛟、]; + TJAPlayer3.Tx.Taiko_Combo[2].vc諡。螟ァ邵ョ蟆丞咲紫.Y = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[0] + yScalling; + TJAPlayer3.Tx.Taiko_Combo[2].vc諡。螟ァ邵ョ蟆丞咲紫.X = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[0]; + TJAPlayer3.Tx.Taiko_Combo[2].t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[0] * i, TJAPlayer3.Skin.Game_Taiko_Combo_Y[nPlayer], new Rectangle(n菴阪ョ謨ー[i] * TJAPlayer3.Skin.Game_Taiko_Combo_Size[0], 0, TJAPlayer3.Skin.Game_Taiko_Combo_Size[0], TJAPlayer3.Skin.Game_Taiko_Combo_Size[1])); + } + if (TJAPlayer3.Tx.Taiko_Combo_Effect != null) + { + if (ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 13) // First + { + // 縺セ繧薙↑縺 + #region[騾乗主コヲ蛻カ蠕。] + //if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 252) TJAPlayer3.Tx.Taiko_Combo_Effect.Opacity = 255; + //else if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 >= 22 && this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 30) TJAPlayer3.Tx.Taiko_Combo_Effect.Opacity = (int)(204 - (6 * this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、)); + #endregion + TJAPlayer3.Tx.Taiko_Combo_Effect.t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, (rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[0] * i), TJAPlayer3.Skin.Game_Taiko_Combo_Ex_Y[nPlayer] - ((TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[1] / 4) * TJAPlayer3.Skin.Game_Taiko_Combo_Scale[0]) - (int)(1.05 * this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、) - 13); + } + if (ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 >= 8 && ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 23) // Unko + { + // 縺ソ縺 + #region[騾乗主コヲ蛻カ蠕。] + //if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 11) TJAPlayer3.Tx.Taiko_Combo_Effect.Opacity = 255; + //else if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 >= 11 && this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 24) TJAPlayer3.Tx.Taiko_Combo_Effect.Opacity = (int)(204 - (12 * this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、)); + #endregion + TJAPlayer3.Tx.Taiko_Combo_Effect.t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, (rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[0] * i) + ((TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[0] / 4) * TJAPlayer3.Skin.Game_Taiko_Combo_Scale[0]), TJAPlayer3.Skin.Game_Taiko_Combo_Ex_Y[nPlayer] - ((TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[1] / 4) * TJAPlayer3.Skin.Game_Taiko_Combo_Scale[0]) - (int)(1.05 * (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 - 10)) - 3); + + } + if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 >= 17 && this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 32) // Tintin + { + // 縺イ縺繧 + #region[騾乗主コヲ蛻カ蠕。] + //if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 7) TJAPlayer3.Tx.Taiko_Combo_Effect.Opacity = 255; + //else if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 >= 7 && this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 14) TJAPlayer3.Tx.Taiko_Combo_Effect.Opacity = (int)(204 - (24 * this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、)); + #endregion + TJAPlayer3.Tx.Taiko_Combo_Effect.t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, (rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[0] * i) - ((TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[0] / 4) * TJAPlayer3.Skin.Game_Taiko_Combo_Scale[0]), TJAPlayer3.Skin.Game_Taiko_Combo_Ex_Y[nPlayer] - ((TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[1] / 4) * TJAPlayer3.Skin.Game_Taiko_Combo_Scale[0]) - (int)(1.05 * this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 - 20) - 8); + } + } + } + } + else if (n譯∵焚 == 3) + { + if (TJAPlayer3.Tx.Taiko_Combo[1] != null) + { + var yScalling = ComboScale_Ex[this.ct繧ウ繝ウ繝懷刈邂夕nPlayer].n迴セ蝨ィ縺ョ蛟、, 0]; + TJAPlayer3.Tx.Taiko_Combo[1].vc諡。螟ァ邵ョ蟆丞咲紫.Y = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[1] + yScalling; + TJAPlayer3.Tx.Taiko_Combo[1].vc諡。螟ァ邵ョ蟆丞咲紫.X = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[1]; + var yJumping = TJAPlayer3.Skin.Game_Taiko_Combo_Ex_IsJumping ? (int)ComboScale_Ex[this.ct繧ウ繝ウ繝懷刈邂夕nPlayer].n迴セ蝨ィ縺ョ蛟、, 1] : 0; + TJAPlayer3.Tx.Taiko_Combo[1].t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[1] * i, TJAPlayer3.Skin.Game_Taiko_Combo_Ex_Y[nPlayer] + yJumping, new Rectangle(n菴阪ョ謨ー[i] * TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[0], 0, TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[0], TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[1])); + } + if (TJAPlayer3.Tx.Taiko_Combo_Effect != null) + { + if (ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 13) // First + { + // 縺セ繧薙↑縺 + #region[騾乗主コヲ蛻カ蠕。] + //if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 252) TJAPlayer3.Tx.Taiko_Combo_Effect.Opacity = 255; + //else if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 >= 22 && this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 30) TJAPlayer3.Tx.Taiko_Combo_Effect.Opacity = (int)(204 - (6 * this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、)); + #endregion + TJAPlayer3.Tx.Taiko_Combo_Effect.t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, (rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[1] * i), TJAPlayer3.Skin.Game_Taiko_Combo_Ex_Y[nPlayer] - ((TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[1] / 4) * TJAPlayer3.Skin.Game_Taiko_Combo_Scale[1]) - (int)(1.05 * this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、) - 13); + } + if (ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 >= 8 && ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 23) // Unko + { + // 縺ソ縺 + #region[騾乗主コヲ蛻カ蠕。] + //if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 11) TJAPlayer3.Tx.Taiko_Combo_Effect.Opacity = 255; + //else if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 >= 11 && this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 24) TJAPlayer3.Tx.Taiko_Combo_Effect.Opacity = (int)(204 - (12 * this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、)); + #endregion + TJAPlayer3.Tx.Taiko_Combo_Effect.t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, (rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[1] * i) + ((TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[0] / 4) * TJAPlayer3.Skin.Game_Taiko_Combo_Scale[1]), TJAPlayer3.Skin.Game_Taiko_Combo_Ex_Y[nPlayer] - ((TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[1] / 4) * TJAPlayer3.Skin.Game_Taiko_Combo_Scale[1]) - (int)(1.05 * (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 - 10)) - 3); + + } + if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 >= 17 && this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 32) // Tintin + { + // 縺イ縺繧 + #region[騾乗主コヲ蛻カ蠕。] + //if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 7) TJAPlayer3.Tx.Taiko_Combo_Effect.Opacity = 255; + //else if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 >= 7 && this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 14) TJAPlayer3.Tx.Taiko_Combo_Effect.Opacity = (int)(204 - (24 * this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、)); + #endregion + TJAPlayer3.Tx.Taiko_Combo_Effect.t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, (rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[1] * i) - ((TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[0] / 4) * TJAPlayer3.Skin.Game_Taiko_Combo_Scale[1]), TJAPlayer3.Skin.Game_Taiko_Combo_Ex_Y[nPlayer] - ((TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[1] / 4) * TJAPlayer3.Skin.Game_Taiko_Combo_Scale[1]) - (int)(1.05 * this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 - 20) - 8); + } + } + } + else + { + if (TJAPlayer3.Tx.Taiko_Combo[1] != null) + { + var yScalling = ComboScale_Ex[this.ct繧ウ繝ウ繝懷刈邂夕nPlayer].n迴セ蝨ィ縺ョ蛟、, 0]; + TJAPlayer3.Tx.Taiko_Combo[1].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f + yScalling; + TJAPlayer3.Tx.Taiko_Combo[1].vc諡。螟ァ邵ョ蟆丞咲紫.X = TJAPlayer3.Skin.Game_Taiko_Combo_Scale[2]; + var yJumping = TJAPlayer3.Skin.Game_Taiko_Combo_Ex_IsJumping ? (int)ComboScale_Ex[this.ct繧ウ繝ウ繝懷刈邂夕nPlayer].n迴セ蝨ィ縺ョ蛟、, 1] : 0; + TJAPlayer3.Tx.Taiko_Combo[1].t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[2] * i, TJAPlayer3.Skin.Game_Taiko_Combo_Ex4_Y[nPlayer] + yJumping, new Rectangle(n菴阪ョ謨ー[i] * TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[0], 0, TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[0], TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[1])); + } + if (TJAPlayer3.Tx.Taiko_Combo_Effect != null) + { + if (ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 13) // First + { + // 縺セ繧薙↑縺 + #region[騾乗主コヲ蛻カ蠕。] + //if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 252) TJAPlayer3.Tx.Taiko_Combo_Effect.Opacity = 255; + //else if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 >= 22 && this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 30) TJAPlayer3.Tx.Taiko_Combo_Effect.Opacity = (int)(204 - (6 * this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、)); + #endregion + TJAPlayer3.Tx.Taiko_Combo_Effect.t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, (rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[2] * i), TJAPlayer3.Skin.Game_Taiko_Combo_Ex_Y[nPlayer] - ((TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[1] / 4) * TJAPlayer3.Skin.Game_Taiko_Combo_Scale[2]) - (int)(1.05 * this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、) - 13); + } + if (ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 >= 8 && ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 23) // Unko + { + // 縺ソ縺 + #region[騾乗主コヲ蛻カ蠕。] + //if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 11) TJAPlayer3.Tx.Taiko_Combo_Effect.Opacity = 255; + //else if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 >= 11 && this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 24) TJAPlayer3.Tx.Taiko_Combo_Effect.Opacity = (int)(204 - (12 * this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、)); + #endregion + TJAPlayer3.Tx.Taiko_Combo_Effect.t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, (rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[2] * i) + ((TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[0] / 4) * TJAPlayer3.Skin.Game_Taiko_Combo_Scale[2]), TJAPlayer3.Skin.Game_Taiko_Combo_Ex_Y[nPlayer] - ((TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[1] / 4) * TJAPlayer3.Skin.Game_Taiko_Combo_Scale[2]) - (int)(1.05 * (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 - 10)) - 3); + + } + if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 >= 17 && this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 32) // Tintin + { + // 縺イ縺繧 + #region[騾乗主コヲ蛻カ蠕。] + //if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 7) TJAPlayer3.Tx.Taiko_Combo_Effect.Opacity = 255; + //else if (this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 >= 7 && this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 < 14) TJAPlayer3.Tx.Taiko_Combo_Effect.Opacity = (int)(204 - (24 * this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、)); + #endregion + TJAPlayer3.Tx.Taiko_Combo_Effect.t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, (rightX - TJAPlayer3.Skin.Game_Taiko_Combo_Padding[2] * i) - ((TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[0] / 4) * TJAPlayer3.Skin.Game_Taiko_Combo_Scale[2]), TJAPlayer3.Skin.Game_Taiko_Combo_Ex_Y[nPlayer] - ((TJAPlayer3.Skin.Game_Taiko_Combo_Size_Ex[1] / 4) * TJAPlayer3.Skin.Game_Taiko_Combo_Scale[2]) - (int)(1.05 * this.ct繧ウ繝ウ繝懊Λ繝。.n迴セ蝨ィ縺ョ蛟、 - 20) - 8); + } + } + + } + } + + //----------------- + #endregion + } + + protected virtual void t繧ウ繝ウ繝懆。ィ遉コ_繧ョ繧ソ繝シ(int nCombo蛟、, int n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ) + { + } + protected virtual void t繧ウ繝ウ繝懆。ィ遉コ_繝吶シ繧ケ(int nCombo蛟、, int n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ) + { + } + protected void t繧ウ繝ウ繝懆。ィ遉コ_繧ョ繧ソ繝シ(int nCombo蛟、, int n陦ィ遉コ荳ュ螟ョX, int n陦ィ遉コ荳ュ螟ョY, int n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ) + { + + } + protected void t繧ウ繝ウ繝懆。ィ遉コ_繝吶シ繧ケ(int nCombo蛟、, int n陦ィ遉コ荳ュ螟ョX, int n陦ィ遉コ荳ュ螟ョY, int n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ) + { + + } + protected void t繧ウ繝ウ繝懆。ィ遉コ_繧ョ繧ソ繝シ繝吶シ繧ケ(int nCombo蛟、, int n陦ィ遉コ荳ュ螟ョX, int n陦ィ遉コ荳ュ螟ョY, int n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ) + { + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + this.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚 = new STCOMBO() { act = this }; + this.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.譛鬮伜、 = new int[4]; + this.status = new CSTATUS(); + this.ct繧ウ繝ウ繝懷刈邂 = new CCounter[4]; + for (int i = 0; i < 4; i++) + { + this.status[i].e迴セ蝨ィ縺ョ繝「繝シ繝 = EMode.髱櫁。ィ遉コ荳ュ; + this.status[i].nCOMBO蛟、 = 0; + this.status[i].n譛鬮呂OMBO蛟、 = 0; + this.status[i].n迴セ蝨ィ陦ィ遉コ荳ュ縺ョCOMBO蛟、 = 0; + this.status[i].n谿句ワ陦ィ遉コ荳ュ縺ョCOMBO蛟、 = 0; + this.status[i].n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ蛟、 = 99999; + this.status[i].n蜑榊屓縺ョ譎ょ綾_繧ク繝」繝ウ繝礼畑 = -1; + this.status[i].n繧ウ繝ウ繝懊′蛻繧後◆譎ょ綾 = -1; + this.ct繧ウ繝ウ繝懷刈邂夕i] = new CCounter(0, 12, 12, TJAPlayer3.Timer); + } + this.ct繧ウ繝ウ繝懊Λ繝。 = new CCounter(0, 35, 16, TJAPlayer3.Timer); + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + if (this.status != null) + this.status = null; + + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if (this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + return; + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if (this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + return; + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + public override int On騾イ陦梧緒逕サ() + { + if (this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + return 0; + + for (int i = 0; i < 4; i++) + { + EEvent e莉雁屓縺ョ迥カ諷矩キ遘サ繧、繝吶Φ繝; + + #region [ 蜑榊屓縺ィ莉雁屓縺ョ COMBO 蛟、縺九i縲‘莉雁屓縺ョ迥カ諷矩キ遘サ繧、繝吶Φ繝医r豎コ螳壹☆繧九] + //----------------- + if (this.status[i].n迴セ蝨ィ陦ィ遉コ荳ュ縺ョCOMBO蛟、 == this.status[i].nCOMBO蛟、) + { + e莉雁屓縺ョ迥カ諷矩キ遘サ繧、繝吶Φ繝 = EEvent.蜷御ク謨ー蛟、; + } + else if (this.status[i].n迴セ蝨ィ陦ィ遉コ荳ュ縺ョCOMBO蛟、 > this.status[i].nCOMBO蛟、) + { + e莉雁屓縺ョ迥カ諷矩キ遘サ繧、繝吶Φ繝 = EEvent.繝溘せ騾夂衍; + } + else if ((this.status[i].n迴セ蝨ィ陦ィ遉コ荳ュ縺ョCOMBO蛟、 < TJAPlayer3.ConfigIni.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚.Drums) && (this.status[i].nCOMBO蛟、 < TJAPlayer3.ConfigIni.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚.Drums)) + { + e莉雁屓縺ョ迥カ諷矩キ遘サ繧、繝吶Φ繝 = EEvent.髱櫁。ィ遉コ; + } + else + { + e莉雁屓縺ョ迥カ諷矩キ遘サ繧、繝吶Φ繝 = EEvent.謨ー蛟、譖エ譁ー; + } + //----------------- + #endregion + + #region [ n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ蛟、 縺ョ騾イ陦後] + //----------------- + if (this.status[i].n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ蛟、 < 360) + { + if ((this.status[i].n蜑榊屓縺ョ譎ょ綾_繧ク繝」繝ウ繝礼畑 == -1) || (TJAPlayer3.Timer.n迴セ蝨ィ譎ょ綾 < this.status[i].n蜑榊屓縺ョ譎ょ綾_繧ク繝」繝ウ繝礼畑)) + this.status[i].n蜑榊屓縺ョ譎ょ綾_繧ク繝」繝ウ繝礼畑 = TJAPlayer3.Timer.n迴セ蝨ィ譎ょ綾; + + const long INTERVAL = 2; + while ((TJAPlayer3.Timer.n迴セ蝨ィ譎ょ綾 - this.status[i].n蜑榊屓縺ョ譎ょ綾_繧ク繝」繝ウ繝礼畑) >= INTERVAL) + { + if (this.status[i].n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ蛟、 < 2000) + this.status[i].n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ蛟、 += 3; + + this.status[i].n蜑榊屓縺ョ譎ょ綾_繧ク繝」繝ウ繝礼畑 += INTERVAL; + } + } + //----------------- + #endregion + + Retry: // 繝「繝シ繝峨′螟牙喧縺励◆蝣エ蜷医ッ縺薙%縺九i繝ェ繝医Λ繧、縺吶k縲 + + switch (this.status[i].e迴セ蝨ィ縺ョ繝「繝シ繝) + { + case EMode.髱櫁。ィ遉コ荳ュ: + #region [ *** ] + //----------------- + + if (e莉雁屓縺ョ迥カ諷矩キ遘サ繧、繝吶Φ繝 == EEvent.謨ー蛟、譖エ譁ー) + { + // 繝「繝シ繝牙、画峩 + this.status[i].e迴セ蝨ィ縺ョ繝「繝シ繝 = EMode.騾イ陦瑚。ィ遉コ荳ュ; + this.status[i].n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ蛟、 = 0; + this.status[i].n蜑榊屓縺ョ譎ょ綾_繧ク繝」繝ウ繝礼畑 = TJAPlayer3.Timer.n迴セ蝨ィ譎ょ綾; + goto Retry; + } + + this.status[i].n迴セ蝨ィ陦ィ遉コ荳ュ縺ョCOMBO蛟、 = this.status[i].nCOMBO蛟、; + break; + //----------------- + #endregion + + case EMode.騾イ陦瑚。ィ遉コ荳ュ: + #region [ *** ] + //----------------- + + if ((e莉雁屓縺ョ迥カ諷矩キ遘サ繧、繝吶Φ繝 == EEvent.髱櫁。ィ遉コ) || (e莉雁屓縺ョ迥カ諷矩キ遘サ繧、繝吶Φ繝 == EEvent.繝溘せ騾夂衍)) + { + // 繝「繝シ繝牙、画峩 + this.status[i].e迴セ蝨ィ縺ョ繝「繝シ繝 = EMode.谿句ワ陦ィ遉コ荳ュ; + this.status[i].n谿句ワ陦ィ遉コ荳ュ縺ョCOMBO蛟、 = this.status[i].n迴セ蝨ィ陦ィ遉コ荳ュ縺ョCOMBO蛟、; + this.status[i].n繧ウ繝ウ繝懊′蛻繧後◆譎ょ綾 = TJAPlayer3.Timer.n迴セ蝨ィ譎ょ綾; + goto Retry; + } + + if (e莉雁屓縺ョ迥カ諷矩キ遘サ繧、繝吶Φ繝 == EEvent.謨ー蛟、譖エ譁ー) + { + this.status[i].n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ蛟、 = 0; + this.status[i].n蜑榊屓縺ョ譎ょ綾_繧ク繝」繝ウ繝礼畑 = TJAPlayer3.Timer.n迴セ蝨ィ譎ょ綾; + } + + this.status[i].n迴セ蝨ィ陦ィ遉コ荳ュ縺ョCOMBO蛟、 = this.status[i].nCOMBO蛟、; + switch (i) + { + case 0: + this.t繧ウ繝ウ繝懆。ィ遉コ_螟ェ鮠(this.status[i].nCOMBO蛟、, this.status[i].n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ蛟、, 0); + break; + + case 1: + this.t繧ウ繝ウ繝懆。ィ遉コ_螟ェ鮠(this.status[i].nCOMBO蛟、, this.status[i].n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ蛟、, 1); + break; + + case 2: + this.t繧ウ繝ウ繝懆。ィ遉コ_繝吶シ繧ケ(this.status[i].nCOMBO蛟、, this.status[i].n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ蛟、); + break; + + case 3: + this.t繧ウ繝ウ繝懆。ィ遉コ_繝峨Λ繝(this.status[i].nCOMBO蛟、, this.status[i].n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ蛟、); + break; + } + break; + //----------------- + #endregion + + case EMode.谿句ワ陦ィ遉コ荳ュ: + #region [ *** ] + //----------------- + if (e莉雁屓縺ョ迥カ諷矩キ遘サ繧、繝吶Φ繝 == EEvent.謨ー蛟、譖エ譁ー) + { + // 繝「繝シ繝牙、画峩シ + this.status[i].e迴セ蝨ィ縺ョ繝「繝シ繝 = EMode.騾イ陦瑚。ィ遉コ荳ュ; + goto Retry; + } + if ((TJAPlayer3.Timer.n迴セ蝨ィ譎ょ綾 - this.status[i].n繧ウ繝ウ繝懊′蛻繧後◆譎ょ綾) > 1000) + { + // 繝「繝シ繝牙、画峩シ + this.status[i].e迴セ蝨ィ縺ョ繝「繝シ繝 = EMode.髱櫁。ィ遉コ荳ュ; + goto Retry; + } + this.status[i].n迴セ蝨ィ陦ィ遉コ荳ュ縺ョCOMBO蛟、 = this.status[i].nCOMBO蛟、; + break; + //----------------- + #endregion + } + } + + return 0; + } + } +} \ No newline at end of file diff --git a/TJAPlayer3/Stages/07.Game/CAct貍泌・修ombo髻ウ螢ー.cs b/TJAPlayer3/Stages/07.Game/CAct貍泌・修ombo髻ウ螢ー.cs new file mode 100644 index 00000000..a63d2b20 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/CAct貍泌・修ombo髻ウ螢ー.cs @@ -0,0 +1,143 @@ +サソusing System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・修ombo髻ウ螢ー : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CAct貍泌・修ombo髻ウ螢ー() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + // 繝。繧ス繝繝 + public void t蜀咲函( int nCombo, int player ) + { + if(VoiceIndex[player] < ListCombo[player].Count) + { + + var index = ListCombo[player][VoiceIndex[player]]; + if (nCombo == index.nCombo) + { + index.soundComboVoice.t蜀咲函繧帝幕蟋九☆繧(); + VoiceIndex[player]++; + } + + } + } + + /// + /// 繧ォ繝シ繧ス繝ォ繧呈綾縺吶 + /// 繧ウ繝ウ繝懊′蛻繧後◆譎ゅ↓菴ソ縺縲 + /// + public void tReset(int nPlayer) + { + VoiceIndex[nPlayer] = 0; + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + for (int i = 0; i < 2; i++) + { + ListCombo[i] = new List(); + } + VoiceIndex = new int[] { 0, 0 }; + base.On豢サ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + // 繝輔か繝ォ繝蜀繧定オー譟サ縺励※繧ウ繝ウ繝懊懊う繧ケ繧鱈ist縺ォ蜈・繧後※縺縺 + // 1P縲2P 繧ウ繝ウ繝懊懊う繧ケ + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + var currentDir = CSkin.Path(string.Format(@"Sounds\Combo_{0}P\", i + 1)); + if (Directory.Exists(currentDir)) + { + foreach (var item in Directory.GetFiles(currentDir)) + { + var comboVoice = new CComboVoice(); + comboVoice.bFileFound = true; + comboVoice.nPlayer = i; + comboVoice.strFilePath = item; + comboVoice.soundComboVoice = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧(item, ESoundGroup.Voice); + if (TJAPlayer3.ConfigIni.nPlayerCount >= 2) //2020.05.06 Mr-Ojii 蟾ヲ蜿ウ縺ォ蜃コ縺励◆縺九▲縺溘°繧芽ソス蜉縲 + { + if (i == 0) + comboVoice.soundComboVoice.n菴咲スョ = -100; + else + comboVoice.soundComboVoice.n菴咲スョ = 100; + } + comboVoice.nCombo = int.Parse(Path.GetFileNameWithoutExtension(item)); + ListCombo[i].Add(comboVoice); + } + if(ListCombo[i].Count > 0) + { + ListCombo[i].Sort(); + } + } + } + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + for (int i = 0; i < 2; i++) + { + foreach (var item in ListCombo[i]) + { + TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r遐エ譽縺吶k(item.soundComboVoice); + } + ListCombo[i].Clear(); + } + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + + #region [ private ] + //----------------- + int[] VoiceIndex; + readonly List[] ListCombo = new List[2]; + //----------------- + #endregion + } + + public class CComboVoice : IComparable + { + public bool bFileFound; + public int nCombo; + public int nPlayer; + public string strFilePath; + public CSound soundComboVoice; + + public CComboVoice() + { + bFileFound = false; + nCombo = 0; + nPlayer = 0; + strFilePath = ""; + soundComboVoice = null; + } + + public int CompareTo( CComboVoice other ) + { + if( this.nCombo > other.nCombo ) return 1; + else if( this.nCombo < other.nCombo ) return -1; + + return 0; + } + } +} diff --git a/TJAPlayer3/Stages/07.Game/CAct貍泌・愁anger蜈ア騾.cs b/TJAPlayer3/Stages/07.Game/CAct貍泌・愁anger蜈ア騾.cs new file mode 100644 index 00000000..7b8ce7b1 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/CAct貍泌・愁anger蜈ア騾.cs @@ -0,0 +1,63 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using FDK; + +namespace TJAPlayer3 +{ + internal abstract class CAct貍泌・愁anger蜈ア騾 : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CAct貍泌・愁anger蜈ア騾() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + for ( int i = 0; i < 3; i++ ) + { + this.bDanger荳ュ[i] = false; + } +// this.ct遘サ蜍慕畑 = new CCounter(); +// this.ct騾乗主コヲ逕ィ = new CCounter(); + this.ct遘サ蜍慕畑 = null; + this.ct騾乗主コヲ逕ィ = null; + + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + this.ct遘サ蜍慕畑 = null; + this.ct騾乗主コヲ逕ィ = null; + base.On髱樊エサ諤ァ蛹(); + } + + /// + /// DANGER謠冗判 + /// + /// Drums縺轡anger縺ェ繧液rue + /// Guitar縺轡anger縺ェ繧液rue + /// Bass縺轡anger縺ェ繧液rue + /// + public abstract int t騾イ陦梧緒逕サ( bool bIsDangerDrums, bool bIsDamgerGuitar, bool bIsDangerBass ); + + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + protected bool[] bDanger荳ュ = { false, false, false}; + protected CCounter ct遘サ蜍慕畑; + protected CCounter ct騾乗主コヲ逕ィ; + //----------------- + #endregion + + } +} diff --git a/TJAPlayer3/Stages/07.Game/CAct貍泌・襲auseMenu.cs b/TJAPlayer3/Stages/07.Game/CAct貍泌・襲auseMenu.cs new file mode 100644 index 00000000..8d38ff82 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/CAct貍泌・襲auseMenu.cs @@ -0,0 +1,186 @@ +サソusing System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using System.Drawing; +using System.IO; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・襲auseMenu : CActSelectPopupMenu + { + private readonly string QuickCfgTitle = "繝昴シ繧コ"; + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CAct貍泌・襲auseMenu() + { + CAct貍泌・襲auseMenuMain(); + } + + private void CAct貍泌・襲auseMenuMain() + { + this.bEsc譛牙柑 = false; + lci = new List>>(); // 縺薙ョ逕サ髱「縺ォ譚・繧句コヲ縺ォ縲√Γ繝九Η繝シ繧剃ス懊j逶エ縺吶 + for ( int nConfSet = 0; nConfSet < (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Dan ? 3 : 2); nConfSet++ ) + { + lci.Add( new List>() ); // ConfSet逕ィ縺ョ3縺、蛻縺ョ譫縲 + for ( int nInst = 0; nInst < 3; nInst++ ) + { + lci[ nConfSet ].Add( null ); // Drum/Guitar/Bass縺ァ3縺、蛻縲∵棧繧剃ス懊▲縺ヲ縺翫¥ + lci[ nConfSet ][ nInst ] = MakeListCItemBase( nConfSet, nInst ); + } + } + base.Initialize( lci[ nCurrentConfigSet ][ 0 ], true, QuickCfgTitle, 0 ); // ConfSet=0, nInst=Drums + } + + private List MakeListCItemBase( int nConfigSet, int nInst ) + { + List l = new List(); + + #region [ 蜈ア騾 SET蛻繧頑崛縺/More/Return ] + l.Add( new CSwitchItemList( "邯壹¢繧", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, 0, "", "", new string[] { "" } ) ); + if(TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Dan) l.Add( new CSwitchItemList( "繧繧顔峩縺", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, 0, "", "", new string[] { "" } ) ); + l.Add( new CSwitchItemList( "貍泌・丈クュ豁「", CItemBase.E繝代ロ繝ォ遞ョ蛻・.騾壼クク, 0, "", "", new string[] { "", "" } ) ); + #endregion + + return l; + } + + // 繝。繧ス繝繝 + public override void tActivatePopupMenu( E讌ス蝎ィ繝代シ繝 einst ) + { + this.CAct貍泌・襲auseMenuMain(); + CActSelectPopupMenu.b驕ク謚槭@縺 = false; + this.b繧繧顔峩縺励r驕ク謚槭@縺 = false; + base.tActivatePopupMenu( einst ); + } + //public void tDeativatePopupMenu() + //{ + // base.tDeativatePopupMenu(); + //} + + public override void t騾イ陦梧緒逕サsub() + { + if( this.b繧繧顔峩縺励r驕ク謚槭@縺 ) + { + if( !sw.IsRunning ) + this.sw = Stopwatch.StartNew(); + if( sw.ElapsedMilliseconds > 1500 ) + { + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bPAUSE = false; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.t貍泌・上d繧翫↑縺翫@(); + + this.tDeativatePopupMenu(); + this.sw.Reset(); + } + } + } + + public override void tEnter謚シ荳貴ain( int nSortOrder ) + { + switch ( n迴セ蝨ィ縺ョ驕ク謚櫁。 ) + { + case (int) EOrder.Continue: + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bPAUSE = false; + + CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.t蜀埼幕(); + TJAPlayer3.Timer.t蜀埼幕(); + TJAPlayer3.DTX.t蜈ィ繝√ャ繝励ョ蜀咲函蜀埼幕(); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actAVI.tPauseControl(); + CActSelectPopupMenu.b驕ク謚槭@縺 = true; + this.tDeativatePopupMenu(); + break; + + case (int) EOrder.Redoing: + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Dan) + { + this.b繧繧顔峩縺励r驕ク謚槭@縺 = true; + CActSelectPopupMenu.b驕ク謚槭@縺 = true; + } + else + { + CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.t蜀埼幕(); + TJAPlayer3.Timer.t蜀埼幕(); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.t貍泌・丈クュ豁「(); + CActSelectPopupMenu.b驕ク謚槭@縺 = true; + this.tDeativatePopupMenu(); + } + break; + + case (int) EOrder.Return: + CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.t蜀埼幕(); + TJAPlayer3.Timer.t蜀埼幕(); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.t貍泌・丈クュ豁「(); + CActSelectPopupMenu.b驕ク謚槭@縺 = true; + this.tDeativatePopupMenu(); + break; + default: + break; + } + } + + public override void tCancel() + { + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + base.On豢サ諤ァ蛹(); + this.bGotoDetailConfig = false; + this.sw = new Stopwatch(); + } + public override void On髱樊エサ諤ァ蛹() + { + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + string path繝代ロ繝ォ譛ャ菴 = CSkin.Path( @"Graphics\ScreenSelect popup auto settings.png" ); + if ( File.Exists( path繝代ロ繝ォ譛ャ菴 ) ) + { + this.tx繝代ロ繝ォ譛ャ菴 = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( path繝代ロ繝ォ譛ャ菴, true ); + } + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if ( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繝代ロ繝ォ譛ャ菴 ); + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx譁蟄怜励ヱ繝阪Ν ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + + #region [ private ] + //----------------- + private int nCurrentTarget = 0; + private int nCurrentConfigSet = 0; + private List>> lci; + private enum EOrder : int + { + Continue, + Redoing, + Return, END, + Default = 99 + }; + + private bool b驕ク謚槭@縺; + private CTexture tx繝代ロ繝ォ譛ャ菴; + private CTexture tx譁蟄怜励ヱ繝阪Ν; + private Stopwatch sw; + private bool b繧繧顔峩縺励r驕ク謚槭@縺; + //----------------- + #endregion + } + + +} diff --git a/TJAPlayer3/Stages/07.Game/CAct貍泌・上ご繝シ繧ク蜈ア騾.cs b/TJAPlayer3/Stages/07.Game/CAct貍泌・上ご繝シ繧ク蜈ア騾.cs new file mode 100644 index 00000000..bd0bf961 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/CAct貍泌・上ご繝シ繧ク蜈ア騾.cs @@ -0,0 +1,527 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using System.Diagnostics; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + /// + /// CAct貍泌・愁rums繧イ繝シ繧ク 縺ィ CAct貍泌・秀utiar繧イ繝シ繧ク 縺ョbase繧ッ繝ゥ繧ケ縲ゅム繝。繝シ繧ク險育ョ励dDanger/Failed蛻、譁ュ繧ゅ%縺ョ繧ッ繝ゥ繧ケ縺ァ陦後≧縲 + /// + /// 隱イ鬘 + /// _STAGE FAILED OFF譎ゅ↓繧イ繝シ繧ク蝗槫セゥ繧呈ュ「繧√k + /// _鮟停帝哩蠎励∪縺ァ縺ョ蟾ョ繧貞、ァ縺阪¥縺吶k縲 + /// + internal class CAct貍泌・上ご繝シ繧ク蜈ア騾 : CActivity + { + // 繝励Ο繝代ユ繧」 + public CActLVLNFont actLVLNFont { get; protected set; } + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + public CAct貍泌・上ご繝シ繧ク蜈ア騾() + { + //actLVLNFont = new CActLVLNFont(); // On豢サ諤ァ蛹()縺ォ遘サ蜍 + //actLVLNFont.On豢サ諤ァ蛹(); + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + for (int i = 0; i < 3; i++) + { + db繧イ繝シ繧ク蠅怜刈驥充i] = new float[2]; + for (int n = 0; n < 3; n++) + { + db繧イ繝シ繧ク蠅怜刈驥柔Branch[i, n] = new float[2]; + } + } + this.DTX[0] = TJAPlayer3.DTX; + this.DTX[1] = TJAPlayer3.DTX_2P; + actLVLNFont = new CActLVLNFont(); + actLVLNFont.On豢サ諤ァ蛹(); + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + actLVLNFont.On髱樊エサ諤ァ蛹(); + actLVLNFont = null; + base.On髱樊エサ諤ァ蛹(); + } + + const double GAUGE_MAX = 100.0; + const double GAUGE_INITIAL = 2.0 / 3; + const double GAUGE_MIN = -0.1; + const double GAUGE_ZERO = 0.0; + const double GAUGE_DANGER = 0.3; + + public bool bRisky // Risky繝「繝シ繝峨°蜷ヲ縺 + { + get; + private set; + } + public int nRiskyTimes_Initial // Risky蛻晄悄蛟、 + { + get; + private set; + } + public int nRiskyTimes // 谿貴iss蝗樊焚 + { + get; + private set; + } + public bool IsFailed(E讌ス蝎ィ繝代シ繝 part) // 髢牙コ礼憾諷九↓縺ェ縺」縺溘°縺ゥ縺縺 + { + if (bRisky) + { + return (nRiskyTimes <= 0); + } + return this.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[(int)part] <= GAUGE_MIN; + } + public bool IsDanger(E讌ス蝎ィ繝代シ繝 part) // DANGER縺九←縺縺 + { + if (bRisky) + { + switch (nRiskyTimes_Initial) + { + case 1: + return false; + case 2: + case 3: + return (nRiskyTimes <= 1); + default: + return (nRiskyTimes <= 2); + } + } + return (this.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[(int)part] <= GAUGE_DANGER); + } + + /// + /// 繧イ繝シ繧ク縺ョ蛻晄悄蛹 + /// + /// Risky縺ョ蛻晄悄蛟、(0縺ァRisky譛ェ菴ソ逕ィ) + public void Init(int nRiskyTimes_InitialVal, int nPlayer) // 繧イ繝シ繧ク蛻晄悄蛹 + { + //繝繝。繝シ繧ク蛟、縺ョ險育ョ励ッ螟ェ鮠薙ョ驕比ココ隴憺擇Wiki縺ョ繧ゅョ繧貞盾閠縺ォ縺励∪縺励◆縲 + + for (int i = 0; i < 4; i++) + { + this.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[i] = 0; + } + + //繧イ繝シ繧ク縺ョMAX縺セ縺ァ縺ョ譛菴弱さ繝ウ繝懈焚繧定ィ育ョ + float dbGaugeMaxComboValue = 0; + float[] dbGaugeMaxComboValue_branch = new float[3]; + float dbDamageRate = 2.0f; + + if (nRiskyTimes_InitialVal > 0) + { + this.bRisky = true; + this.nRiskyTimes = TJAPlayer3.ConfigIni.nRisky; + this.nRiskyTimes_Initial = TJAPlayer3.ConfigIni.nRisky; + } + + switch (this.DTX[nPlayer].LEVELtaiko[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[nPlayer]]) + { + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + { + if (this.DTX[nPlayer].b繝√ャ繝励′縺ゅk.Branch) + { + dbGaugeMaxComboValue = this.DTX[nPlayer].n繝弱シ繝謨ー[3] * (this.fGaugeMaxRate[0] / 100.0f); + for (int i = 0; i < 3; i++) + { + dbGaugeMaxComboValue_branch[i] = this.DTX[nPlayer].n繝弱シ繝謨ー_Branch[i] * (this.fGaugeMaxRate[0] / 100.0f); + } + dbDamageRate = 0.625f; + } + else + { + dbGaugeMaxComboValue = this.DTX[nPlayer].n繝弱シ繝謨ー[3] * (this.fGaugeMaxRate[0] / 100.0f); + dbDamageRate = 0.625f; + } + break; + } + + + case 8: + { + if (this.DTX[nPlayer].b繝√ャ繝励′縺ゅk.Branch) + { + dbGaugeMaxComboValue = this.DTX[nPlayer].n繝弱シ繝謨ー[3] * (this.fGaugeMaxRate[1] / 100.0f); + for (int i = 0; i < 3; i++) + { + dbGaugeMaxComboValue_branch[i] = this.DTX[nPlayer].n繝弱シ繝謨ー_Branch[i] * (this.fGaugeMaxRate[1] / 100.0f); + } + dbDamageRate = 0.625f; + } + else + { + dbGaugeMaxComboValue = this.DTX[nPlayer].n繝弱シ繝謨ー[3] * (this.fGaugeMaxRate[1] / 100.0f); + dbDamageRate = 0.625f; + } + break; + } + + case 9: + case 10: + { + if (this.DTX[nPlayer].b繝√ャ繝励′縺ゅk.Branch) + { + dbGaugeMaxComboValue = this.DTX[nPlayer].n繝弱シ繝謨ー[3] * (this.fGaugeMaxRate[2] / 100.0f); + for (int i = 0; i < 3; i++) + { + dbGaugeMaxComboValue_branch[i] = this.DTX[nPlayer].n繝弱シ繝謨ー_Branch[i] * (this.fGaugeMaxRate[2] / 100.0f); + } + } + else + { + dbGaugeMaxComboValue = this.DTX[nPlayer].n繝弱シ繝謨ー[3] * (this.fGaugeMaxRate[2] / 100.0f); + } + break; + } + + default: + { + if (this.DTX[nPlayer].b繝√ャ繝励′縺ゅk.Branch) + { + dbGaugeMaxComboValue = this.DTX[nPlayer].n繝弱シ繝謨ー[3] * (this.fGaugeMaxRate[2] / 100.0f); + for (int i = 0; i < 3; i++) + { + dbGaugeMaxComboValue_branch[i] = this.DTX[nPlayer].n繝弱シ繝謨ー[i] * (this.fGaugeMaxRate[2] / 100.0f); + } + } + else + { + dbGaugeMaxComboValue = this.DTX[nPlayer].n繝弱シ繝謨ー[3] * (this.fGaugeMaxRate[2] / 100.0f); + } + break; + } + + } + + double nGaugeRankValue = 0D; + double[] nGaugeRankValue_branch = new double[] { 0D, 0D, 0D }; + if (this.DTX[nPlayer].GaugeIncreaseMode == GaugeIncreaseMode.Normal) + { + nGaugeRankValue = Math.Floor(10000.0f / dbGaugeMaxComboValue); + for (int i = 0; i < 3; i++) + { + nGaugeRankValue_branch[i] = Math.Floor(10000.0f / dbGaugeMaxComboValue_branch[i]); + } + } + else + { + nGaugeRankValue = 10000.0f / dbGaugeMaxComboValue; + for (int i = 0; i < 3; i++) + { + nGaugeRankValue_branch[i] = 10000.0f / dbGaugeMaxComboValue_branch[i]; + } + } + + //繧イ繝シ繧ク蛟、險育ョ + //螳滓ゥ溘↓霑代>險育ョ + + this.db繧イ繝シ繧ク蠅怜刈驥充0][nPlayer] = (float)nGaugeRankValue / 100.0f; + this.db繧イ繝シ繧ク蠅怜刈驥充1][nPlayer] = (float)(nGaugeRankValue / 100.0f) * 0.5f; + this.db繧イ繝シ繧ク蠅怜刈驥充2][nPlayer] = (float)(nGaugeRankValue / 100.0f) * dbDamageRate; + + for (int i = 0; i < 3; i++) + { + this.db繧イ繝シ繧ク蠅怜刈驥柔Branch[i, 0][nPlayer] = (float)nGaugeRankValue_branch[i] / 100.0f; + this.db繧イ繝シ繧ク蠅怜刈驥柔Branch[i, 1][nPlayer] = (float)(nGaugeRankValue_branch[i] / 100.0f) * 0.5f; + this.db繧イ繝シ繧ク蠅怜刈驥柔Branch[i, 2][nPlayer] = (float)(nGaugeRankValue_branch[i] / 100.0f) * dbDamageRate; + } + + //this.db繧イ繝シ繧ク蠅怜刈驥充 0 ] = CDTXMania.DTX.b繝√ャ繝励′縺ゅk.Branch ? ( 130.0 / CDTXMania.DTX.n繝弱シ繝謨ー[ 0 ] ) : ( 130.0 / CDTXMania.DTX.n繝弱シ繝謨ー[ 3 ] ); + //this.db繧イ繝シ繧ク蠅怜刈驥充 1 ] = CDTXMania.DTX.b繝√ャ繝励′縺ゅk.Branch ? ( 65.0 / CDTXMania.DTX.n繝弱シ繝謨ー[ 0 ] ) : 65.0 / CDTXMania.DTX.n繝弱シ繝謨ー[ 3 ]; + //this.db繧イ繝シ繧ク蠅怜刈驥充 2 ] = CDTXMania.DTX.b繝√ャ繝励′縺ゅk.Branch ? ( -260.0 / CDTXMania.DTX.n繝弱シ繝謨ー[ 0 ] ) : -260.0 / CDTXMania.DTX.n繝弱シ繝謨ー[ 3 ]; + + //2015.03.26 kairera0467 險育ョ励r蛻晄悄蛹匁凾縺ォ縺吶k繧医≧菫ョ豁」縲 + + #region [ 險育ョ礼オ先棡縺栗nfinty縺縺」縺溷エ蜷医b閠縺医※ ] + float fIsDontInfinty = 0.4f;//驕ゥ蠖薙↓0.4縺ァ + float[] fAddVolume = new float[] { 1.0f, 0.5f, dbDamageRate }; + + for (int i = 0; i < 3; i++) + { + for (int l = 0; l < 3; l++) + { + if (!double.IsInfinity(nGaugeRankValue_branch[i] / 100.0f))//蛟、縺栗nfinty縺九メ繧ァ繝繧ッ + { + fIsDontInfinty = (float)(nGaugeRankValue_branch[i] / 100.0f); + this.db繧イ繝シ繧ク蠅怜刈驥柔Branch[i, l][nPlayer] = fIsDontInfinty * fAddVolume[l]; + } + } + } + for (int i = 0; i < 3; i++) + { + for (int l = 0; l < 3; l++) + { + if (double.IsInfinity(nGaugeRankValue_branch[i] / 100.0f))//蛟、縺栗nfinty縺九メ繧ァ繝繧ッ + { + //Infinty縺縺」縺溷エ蜷医ッInfinty縺ァ縺ッ縺ェ縺蛟、 * 3.0繧偵@縺ヲ縺昴ョ蛟、繧貞茜逕ィ縺吶k縲 + this.db繧イ繝シ繧ク蠅怜刈驥柔Branch[i, l][nPlayer] = (fIsDontInfinty * fAddVolume[l]) * 3f; + } + } + } + #endregion + + #region 繧イ繝シ繧ク縺ョ荳ク繧∝ヲ逅 + var increase = new float[] { db繧イ繝シ繧ク蠅怜刈驥充0][nPlayer], db繧イ繝シ繧ク蠅怜刈驥充1][nPlayer], db繧イ繝シ繧ク蠅怜刈驥充2][nPlayer] }; + var increaseBranch = new float[3, 3]; + for (int i = 0; i < 3; i++) + { + increaseBranch[i, 0] = db繧イ繝シ繧ク蠅怜刈驥柔Branch[i, 0][nPlayer]; + increaseBranch[i, 1] = db繧イ繝シ繧ク蠅怜刈驥柔Branch[i, 1][nPlayer]; + increaseBranch[i, 2] = db繧イ繝シ繧ク蠅怜刈驥柔Branch[i, 0][nPlayer]; + } + switch (this.DTX[nPlayer].GaugeIncreaseMode) + { + case GaugeIncreaseMode.Normal: + case GaugeIncreaseMode.Floor: + // 蛻繧頑昏縺ヲ + for (int i = 0; i < 3; i++) + { + increase[i] = (float)Math.Truncate(increase[i] * 10000.0f) / 10000.0f; + } + for (int i = 0; i < 3; i++) + { + increaseBranch[i, 0] = (float)Math.Truncate(increaseBranch[i, 0] * 10000.0f) / 10000.0f; + increaseBranch[i, 1] = (float)Math.Truncate(increaseBranch[i, 1] * 10000.0f) / 10000.0f; + increaseBranch[i, 2] = (float)Math.Truncate(increaseBranch[i, 2] * 10000.0f) / 10000.0f; + } + break; + case GaugeIncreaseMode.Round: + // 蝗帶昏莠泌・ + for (int i = 0; i < 3; i++) + { + increase[i] = (float)Math.Round(increase[i] * 10000.0f) / 10000.0f; + } + for (int i = 0; i < 3; i++) + { + increaseBranch[i, 0] = (float)Math.Round(increaseBranch[i, 0] * 10000.0f) / 10000.0f; + increaseBranch[i, 1] = (float)Math.Round(increaseBranch[i, 1] * 10000.0f) / 10000.0f; + increaseBranch[i, 2] = (float)Math.Round(increaseBranch[i, 2] * 10000.0f) / 10000.0f; + } + break; + case GaugeIncreaseMode.Ceiling: + // 蛻繧贋ク翫£ + for (int i = 0; i < 3; i++) + { + increase[i] = (float)Math.Ceiling(increase[i] * 10000.0f) / 10000.0f; + } + for (int i = 0; i < 3; i++) + { + increaseBranch[i, 0] = (float)Math.Ceiling(increaseBranch[i, 0] * 10000.0f) / 10000.0f; + increaseBranch[i, 1] = (float)Math.Ceiling(increaseBranch[i, 1] * 10000.0f) / 10000.0f; + increaseBranch[i, 2] = (float)Math.Ceiling(increaseBranch[i, 2] * 10000.0f) / 10000.0f; + } + break; + case GaugeIncreaseMode.NotFix: + default: + // 荳ク繧√↑縺 + break; + } + + for (int i = 0; i < 3; i++) + { + db繧イ繝シ繧ク蠅怜刈驥充i][nPlayer] = increase[i]; + } + for (int i = 0; i < 3; i++) + { + db繧イ繝シ繧ク蠅怜刈驥柔Branch[i, 0][nPlayer] = increaseBranch[i, 0]; + db繧イ繝シ繧ク蠅怜刈驥柔Branch[i, 1][nPlayer] = increaseBranch[i, 1]; + db繧イ繝シ繧ク蠅怜刈驥柔Branch[i, 2][nPlayer] = increaseBranch[i, 2]; + } + #endregion + } + + #region [ DAMAGE ] +#if true // DAMAGELEVELTUNING + #region [ DAMAGELEVELTUNING ] + // ---------------------------------- + public float[,] fDamageGaugeDelta = { // #23625 2011.1.10 ickw_284: tuned damage/recover factors + // drums, guitar, bass + { 0.004f, 0.006f, 0.006f, 0.004f }, + { 0.002f, 0.003f, 0.003f, 0.002f }, + { 0.000f, 0.000f, 0.000f, 0.000f }, + { -0.020f, -0.030f, -0.030f, -0.020f }, + { -0.050f, -0.050f, -0.050f, -0.050f } + }; + public float[] fDamageLevelFactor = { + 0.5f, 1.0f, 1.5f + }; + + public float[][] db繧イ繝シ繧ク蠅怜刈驥 = new float[3][]; + + //隴憺擇繝ャ繝吶Ν, 蛻、螳 + public float[,][] db繧イ繝シ繧ク蠅怜刈驥柔Branch = new float[3, 3][]; + + + public float[] fGaugeMaxRate = + { + 70.7f,//1ス7 + 70f, //8 + 75.0f //9ス10 + };//縺翫♀繧医◎縺ョ蛟、縲 + + // ---------------------------------- + #endregion +#endif + + public void Damage(E讌ス蝎ィ繝代シ繝 screenmode, E讌ス蝎ィ繝代シ繝 part, E蛻、螳 e莉雁屓縺ョ蛻、螳, int nPlayer) + { + float fDamage; + int n繧ウ繝シ繧ケ = (int)TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ[nPlayer]; + + +#if true // DAMAGELEVELTUNING + switch (e莉雁屓縺ョ蛻、螳) + { + case E蛻、螳.Perfect: + case E蛻、螳.Great: + { + if (this.DTX[nPlayer].b繝√ャ繝励′縺ゅk.Branch) + { + fDamage = this.db繧イ繝シ繧ク蠅怜刈驥柔Branch[n繧ウ繝シ繧ケ, 0][nPlayer]; + } + else + fDamage = this.db繧イ繝シ繧ク蠅怜刈驥充0][nPlayer]; + } + break; + case E蛻、螳.Good: + { + if (this.DTX[nPlayer].b繝√ャ繝励′縺ゅk.Branch) + { + fDamage = this.db繧イ繝シ繧ク蠅怜刈驥柔Branch[n繧ウ繝シ繧ケ, 1][nPlayer]; + } + else + fDamage = this.db繧イ繝シ繧ク蠅怜刈驥充1][nPlayer]; + } + break; + case E蛻、螳.Poor: + case E蛻、螳.Miss: + { + if (this.DTX[nPlayer].b繝√ャ繝励′縺ゅk.Branch) + { + fDamage = this.db繧イ繝シ繧ク蠅怜刈驥柔Branch[n繧ウ繝シ繧ケ, 2][nPlayer]; + } + else + fDamage = this.db繧イ繝シ繧ク蠅怜刈驥充2][nPlayer]; + + + if (fDamage >= 0) + { + fDamage = -fDamage; + } + + if (this.bRisky) + { + this.nRiskyTimes--; + } + } + + break; + + + + default: + { + if (nPlayer == 0 ? TJAPlayer3.ConfigIni.bAutoPlay[0] : TJAPlayer3.ConfigIni.bAutoPlay[1]) + { + if (this.DTX[nPlayer].b繝√ャ繝励′縺ゅk.Branch) + { + fDamage = this.db繧イ繝シ繧ク蠅怜刈驥柔Branch[n繧ウ繝シ繧ケ, 0][nPlayer]; + } + else + fDamage = this.db繧イ繝シ繧ク蠅怜刈驥充0][nPlayer]; + } + else + fDamage = 0; + break; + } + + + } +#else // before applying #23625 modifications + switch (e莉雁屓縺ョ蛻、螳) + { + case E蛻、螳.Perfect: + fDamage = ( part == E讌ス蝎ィ繝代シ繝.DRUMS ) ? 0.01 : 0.015; + break; + + case E蛻、螳.Great: + fDamage = ( part == E讌ス蝎ィ繝代シ繝.DRUMS ) ? 0.006 : 0.009; + break; + + case E蛻、螳.Good: + fDamage = ( part == E讌ス蝎ィ繝代シ繝.DRUMS ) ? 0.002 : 0.003; + break; + + case E蛻、螳.Poor: + fDamage = ( part == E讌ス蝎ィ繝代シ繝.DRUMS ) ? 0.0 : 0.0; + break; + + case E蛻、螳.Miss: + fDamage = ( part == E讌ス蝎ィ繝代シ繝.DRUMS ) ? -0.035 : -0.035; + switch( CDTXMania.ConfigIni.e繝繝。繝シ繧ク繝ャ繝吶Ν ) + { + case E繝繝。繝シ繧ク繝ャ繝吶Ν.蟆代↑縺: + fDamage *= 0.6; + break; + + case E繝繝。繝シ繧ク繝ャ繝吶Ν.譎ョ騾: + fDamage *= 1.0; + break; + + case E繝繝。繝シ繧ク繝ャ繝吶Ν.螟ァ縺阪>: + fDamage *= 1.6; + break; + } + break; + + default: + fDamage = 0.0; + break; + } +#endif + + + this.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[nPlayer] = Math.Round(this.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[nPlayer] + fDamage, 5, MidpointRounding.ToEven); + + if (this.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[nPlayer] >= 100.0) + this.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[nPlayer] = 100.0; + else if (this.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[nPlayer] <= 0.0) + this.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[nPlayer] = 0.0; + + + //CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.nGauge = fDamage; + + } + + public virtual void Start(int nLane, E蛻、螳 judge, int player) + { + } + + //----------------- + #endregion + + private CDTX[] DTX = new CDTX[2]; + public double[] db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、 = new double[4]; + protected CCounter ct轤; + protected CCounter ct陌ケ繧「繝九Γ; + protected CCounter ct陌ケ騾乗主コヲ; + protected CTexture[] tx繧イ繝シ繧ク陌ケ = new CTexture[12]; + protected CTexture[] tx繧イ繝シ繧ク陌ケ2P = new CTexture[12]; + } +} diff --git a/TJAPlayer3/Stages/07.Game/CAct貍泌・上せ繧ッ繝ュ繝シ繝ォ騾溷コヲ.cs b/TJAPlayer3/Stages/07.Game/CAct貍泌・上せ繧ッ繝ュ繝シ繝ォ騾溷コヲ.cs new file mode 100644 index 00000000..d285cc0c --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/CAct貍泌・上せ繧ッ繝ュ繝シ繝ォ騾溷コヲ.cs @@ -0,0 +1,87 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・上せ繧ッ繝ュ繝シ繝ォ騾溷コヲ : CActivity + { + // 繝励Ο繝代ユ繧」 + + public STDGBVALUE db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ; + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CAct貍泌・上せ繧ッ繝ュ繝シ繝ォ騾溷コヲ() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + for( int i = 0; i < 3; i++ ) + { + this.db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ i ] = (double) TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ i ]; + this.n騾溷コヲ螟画峩蛻カ蠕。繧ソ繧、繝杣 i ] = -1; + } + base.On豢サ諤ァ蛹(); + } + public override unsafe int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + if( base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + this.n騾溷コヲ螟画峩蛻カ蠕。繧ソ繧、繝.Drums = this.n騾溷コヲ螟画峩蛻カ蠕。繧ソ繧、繝.Guitar = this.n騾溷コヲ螟画峩蛻カ蠕。繧ソ繧、繝.Bass = (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + long n迴セ蝨ィ譎ょ綾 = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾; + for( int i = 0; i < 3; i++ ) + { + double db隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ繧ケ繝斐シ繝 = (double) TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ i ]; + if( n迴セ蝨ィ譎ょ綾 < this.n騾溷コヲ螟画峩蛻カ蠕。繧ソ繧、繝杣 i ] ) + { + this.n騾溷コヲ螟画峩蛻カ蠕。繧ソ繧、繝杣 i ] = n迴セ蝨ィ譎ょ綾; + } + while( ( n迴セ蝨ィ譎ょ綾 - this.n騾溷コヲ螟画峩蛻カ蠕。繧ソ繧、繝杣 i ] ) >= 2 ) // 2ms縺ォ1蝗槭Ν繝シ繝 + { + if( this.db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ i ] < db隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ繧ケ繝斐シ繝 ) // Config.ini縺ョ繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ繧貞、峨∴繧九→縲√◎繧後↓霑ス縺縺、縺上h縺縺ォ螳溽判髱「縺ョ繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ繧貞、峨∴繧 + { + this.db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ i ] += 0.012; + + if( this.db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ i ] > db隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ繧ケ繝斐シ繝 ) + { + this.db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ i ] = db隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ繧ケ繝斐シ繝; + } + } + else if ( this.db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ i ] > db隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ繧ケ繝斐シ繝 ) + { + this.db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ i ] -= 0.012; + + if( this.db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ i ] < db隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ繧ケ繝斐シ繝 ) + { + this.db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ i ] = db隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ繧ケ繝斐シ繝; + } + } + this.n騾溷コヲ螟画峩蛻カ蠕。繧ソ繧、繝杣 i ] += 2; + } + } + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private STDGBVALUE n騾溷コヲ螟画峩蛻カ蠕。繧ソ繧、繝; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/CAct貍泌・上せ繧ウ繧「蜈ア騾.cs b/TJAPlayer3/Stages/07.Game/CAct貍泌・上せ繧ウ繧「蜈ア騾.cs new file mode 100644 index 00000000..29ad1be8 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/CAct貍泌・上せ繧ウ繧「蜈ア騾.cs @@ -0,0 +1,384 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using FDK; +using System.Drawing; +using System.Runtime.InteropServices; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・上せ繧ウ繧「蜈ア騾 : CActivity + { + // 繝励Ο繝代ユ繧」 + + protected STDGBVALUE[] n繧ケ繧ウ繧「縺ョ蠅怜; + protected STDGBVALUE[] n迴セ蝨ィ縺ョ譛ャ蠖薙ョ繧ケ繧ウ繧「; + protected STDGBVALUE[] n迴セ蝨ィ陦ィ遉コ荳ュ縺ョ繧ケ繧ウ繧「; + //protected CTexture txScore; + + // protected CTexture txScore_1P; + protected CCounter ctTimer; + public CCounter[] ct轤ケ謨ー繧「繝九Γ繧ソ繧、繝; + + public CCounter[] ct繝懊シ繝翫せ蜉邂励ち繧、繝; + + protected ST繧ケ繧ウ繧「[] stScore; + protected int n迴セ蝨ィ陦ィ遉コ荳ュ縺ョAddScore; + + [StructLayout( LayoutKind.Sequential )] + protected struct ST繧ケ繧ウ繧「 + { + public bool bAddEnd; + public bool b菴ソ逕ィ荳ュ; + public bool b陦ィ遉コ荳ュ; + public bool bBonusScore; + public CCounter ctTimer; + public int nAddScore; + public int nPlayer; + } + + [StructLayout(LayoutKind.Sequential)] + private struct ST譁蟄嶺ス咲スョ + { + public char ch; + public Point pt; + } + private ST譁蟄嶺ス咲スョ[] stFont; + + + public long GetScore(int player) + { + return n迴セ蝨ィ陦ィ遉コ荳ュ縺ョ繧ケ繧ウ繧「[player].Taiko; + } + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CAct貍泌・上せ繧ウ繧「蜈ア騾() + { + ST譁蟄嶺ス咲スョ[] st譁蟄嶺ス咲スョArray = new ST譁蟄嶺ス咲スョ[11]; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ.ch = '0'; + st譁蟄嶺ス咲スョ.pt = new Point(0, 0); + st譁蟄嶺ス咲スョArray[0] = st譁蟄嶺ス咲スョ; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ2 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ2.ch = '1'; + st譁蟄嶺ス咲スョ2.pt = new Point(24, 0); + st譁蟄嶺ス咲スョArray[1] = st譁蟄嶺ス咲スョ2; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ3 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ3.ch = '2'; + st譁蟄嶺ス咲スョ3.pt = new Point(48, 0); + st譁蟄嶺ス咲スョArray[2] = st譁蟄嶺ス咲スョ3; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ4 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ4.ch = '3'; + st譁蟄嶺ス咲スョ4.pt = new Point(72, 0); + st譁蟄嶺ス咲スョArray[3] = st譁蟄嶺ス咲スョ4; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ5 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ5.ch = '4'; + st譁蟄嶺ス咲スョ5.pt = new Point(96, 0); + st譁蟄嶺ス咲スョArray[4] = st譁蟄嶺ス咲スョ5; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ6 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ6.ch = '5'; + st譁蟄嶺ス咲スョ6.pt = new Point(120, 0); + st譁蟄嶺ス咲スョArray[5] = st譁蟄嶺ス咲スョ6; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ7 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ7.ch = '6'; + st譁蟄嶺ス咲スョ7.pt = new Point(144, 0); + st譁蟄嶺ス咲スョArray[6] = st譁蟄嶺ス咲スョ7; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ8 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ8.ch = '7'; + st譁蟄嶺ス咲スョ8.pt = new Point(168, 0); + st譁蟄嶺ス咲スョArray[7] = st譁蟄嶺ス咲スョ8; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ9 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ9.ch = '8'; + st譁蟄嶺ス咲スョ9.pt = new Point(192, 0); + st譁蟄嶺ス咲スョArray[8] = st譁蟄嶺ス咲スョ9; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ10 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ10.ch = '9'; + st譁蟄嶺ス咲スョ10.pt = new Point(216, 0); + st譁蟄嶺ス咲スョArray[9] = st譁蟄嶺ス咲スョ10; + this.stFont = st譁蟄嶺ス咲スョArray; + + this.stScore = new ST繧ケ繧ウ繧「[ 256 ]; + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // 繝。繧ス繝繝 + + private float[,] n轤ケ謨ー繧「繝九Γ諡。螟ァ邇_蠎ァ讓 = new float[,] + { + { + 1.14f, + -5f + }, + { + 1.2f, + -6f + }, + { + 1.23f, + -8f + }, + { + 1.25f, + -9f + }, + { + 1.23f, + -8f + }, + { + 1.2f, + -6f + }, + { + 1.14f, + -5f + }, + { + 1.08f, + -4f + }, + { + 1.04f, + -2f + }, + { + 1.02f, + -1f + }, + { + 1.01f, + -1f + }, + { + 1f, + 0f + } + }; + + private float[] ScoreScale = new float[] + { + 1f, + 1.050f, + 1.100f, + 1.110f, + 1.120f, + 1.125f, + 1.120f, + 1.080f, + 1.065f, + 1.030f, + 1.015f, + 1f + }; + + public double Get( E讌ス蝎ィ繝代シ繝 part, int player ) + { + return this.n迴セ蝨ィ縺ョ譛ャ蠖薙ョ繧ケ繧ウ繧「[ player ][ (int) part ]; + } + public void Set( E讌ス蝎ィ繝代シ繝 part, double nScore, int player ) + { + //迴セ迥カ縲ゝAIKO繝代シ繝医〒縺ョ貍泌・剰ィ倬鹸繧堤オ先棡繧ケ繝繝シ繧ク縺ォ謖√▲縺ヲ縺縺代↑縺縺ョ縺ァ縲√ラ繝ゥ繝繝代シ繝医↓繧ょ刈邂励☆繧九%縺ィ縺ァ縺願幻繧呈ソ√@縺ヲ縺繧九 + if( part == E讌ス蝎ィ繝代シ繝.TAIKO ) + part = E讌ス蝎ィ繝代シ繝.DRUMS; + + int nPart = (int) part; + if( this.n迴セ蝨ィ縺ョ譛ャ蠖薙ョ繧ケ繧ウ繧「[ player ][ nPart ] != nScore ) + { + this.n迴セ蝨ィ縺ョ譛ャ蠖薙ョ繧ケ繧ウ繧「[ player ][ nPart ] = nScore; + this.n繧ケ繧ウ繧「縺ョ蠅怜[ player ][ nPart ] = (long) ( ( (double) ( this.n迴セ蝨ィ縺ョ譛ャ蠖薙ョ繧ケ繧ウ繧「[ player ][ nPart ] - this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョ繧ケ繧ウ繧「[ player ][ nPart ] ) ) / 20.0 ); + this.n繧ケ繧ウ繧「縺ョ蠅怜[ player ].Guitar = (long) ( ( (double) ( this.n迴セ蝨ィ縺ョ譛ャ蠖薙ョ繧ケ繧ウ繧「[ player ][ nPart ] - this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョ繧ケ繧ウ繧「[ player ][ nPart ] ) ) ); + if( this.n繧ケ繧ウ繧「縺ョ蠅怜[ player ][ nPart ] < 1L ) + { + this.n繧ケ繧ウ繧「縺ョ蠅怜[ player ][ nPart ] = 1L; + } + } + + if( part == E讌ス蝎ィ繝代シ繝.DRUMS ) + part = E讌ス蝎ィ繝代シ繝.TAIKO; + + nPart = (int) part; + if( this.n迴セ蝨ィ縺ョ譛ャ蠖薙ョ繧ケ繧ウ繧「[ player ][ nPart ] != nScore ) + { + this.n迴セ蝨ィ縺ョ譛ャ蠖薙ョ繧ケ繧ウ繧「[ player ][ nPart ] = nScore; + this.n繧ケ繧ウ繧「縺ョ蠅怜[ player ][ nPart ] = (long) ( ( (double) ( this.n迴セ蝨ィ縺ョ譛ャ蠖薙ョ繧ケ繧ウ繧「[ player ][ nPart ] - this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョ繧ケ繧ウ繧「[ player ][ nPart ] ) ) / 20.0 ); + this.n繧ケ繧ウ繧「縺ョ蠅怜[ player ].Guitar = (long) ( ( (double) ( this.n迴セ蝨ィ縺ョ譛ャ蠖薙ョ繧ケ繧ウ繧「[ player ][ nPart ] - this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョ繧ケ繧ウ繧「[ player ][ nPart ] ) ) ); + if( this.n繧ケ繧ウ繧「縺ョ蠅怜[ player ][ nPart ] < 1L ) + { + this.n繧ケ繧ウ繧「縺ョ蠅怜[ player ][ nPart ] = 1L; + } + } + + } + /// + /// 轤ケ謨ー繧貞刈縺医k(蜷遞ョAUTO陬懈ュ」縺、縺) + /// + /// + /// + /// + public void Add( E讌ス蝎ィ繝代シ繝 part, STAUTOPLAY bAutoPlay, long delta, int player ) + { + double rev = 1.0; + switch ( part ) + { + #region [ Unknown ] + case E讌ス蝎ィ繝代シ繝.UNKNOWN: + throw new ArgumentException(); + #endregion + } + this.ctTimer = new CCounter( 0, 400, 1, TJAPlayer3.Timer ); + + for( int sc = 0; sc < 1; sc++ ) + { + for( int i = 0; i < 256; i++ ) + { + if( this.stScore[ i ].b菴ソ逕ィ荳ュ == false ) + { + this.stScore[ i ].b菴ソ逕ィ荳ュ = true; + this.stScore[ i ].b陦ィ遉コ荳ュ = true; + this.stScore[ i ].nAddScore = (int)delta; + this.stScore[ i ].ctTimer = new CCounter( 0, 465, 2, TJAPlayer3.Timer ); + this.stScore[ i ].bBonusScore = false; + this.stScore[ i ].bAddEnd = false; + this.stScore[ i ].nPlayer = player; + this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョAddScore++; + break; + } + } + } + + this.Set( part, this.Get( part, player ) + delta * rev, player ); + } + + public void BonusAdd( int player ) + { + for( int sc = 0; sc < 1; sc++ ) + { + for( int i = 0; i < 256; i++ ) + { + if( this.stScore[ i ].b菴ソ逕ィ荳ュ == false ) + { + this.stScore[ i ].b菴ソ逕ィ荳ュ = true; + this.stScore[ i ].b陦ィ遉コ荳ュ = true; + this.stScore[ i ].nAddScore = 10000; + this.stScore[ i ].ctTimer = new CCounter( 0, 100, 4, TJAPlayer3.Timer ); + this.stScore[ i ].bBonusScore = true; + this.stScore[ i ].bAddEnd = true; + this.stScore[ i ].nPlayer = player; + this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョAddScore++; + break; + } + } + } + + this.Set( E讌ス蝎ィ繝代シ繝.TAIKO, this.Get( E讌ス蝎ィ繝代シ繝.TAIKO, player ) + 10000, player ); + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョ繧ケ繧ウ繧「 = new STDGBVALUE[ 4 ]; + this.n迴セ蝨ィ縺ョ譛ャ蠖薙ョ繧ケ繧ウ繧「 = new STDGBVALUE[ 4 ]; + this.n繧ケ繧ウ繧「縺ョ蠅怜 = new STDGBVALUE[ 4 ]; + for( int i = 0; i < 4; i++ ) + { + this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョ繧ケ繧ウ繧「[ i ][ i ] = 0L; + this.n迴セ蝨ィ縺ョ譛ャ蠖薙ョ繧ケ繧ウ繧「[ i ][ i ] = 0L; + this.n繧ケ繧ウ繧「縺ョ蠅怜[ i ][ i ] = 0L; + } + for( int sc = 0; sc < 256; sc++ ) + { + this.stScore[ sc ].b菴ソ逕ィ荳ュ = false; + this.stScore[ sc ].ctTimer = new CCounter(); + this.stScore[ sc ].nAddScore = 0; + this.stScore[ sc ].bBonusScore = false; + this.stScore[ sc ].bAddEnd = false; + } + + this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョAddScore = 0; + + this.ctTimer = new CCounter(); + + this.ct轤ケ謨ー繧「繝九Γ繧ソ繧、繝 = new CCounter[4]; + for (int i = 0; i < 4; i++) + { + this.ct轤ケ謨ー繧「繝九Γ繧ソ繧、繝杣i] = new CCounter(); + } + this.ct繝懊シ繝翫せ蜉邂励ち繧、繝 = new CCounter[4]; + for (int i = 0; i < 4; i++) + { + this.ct繝懊シ繝翫せ蜉邂励ち繧、繝杣i] = new CCounter(); + } + base.On豢サ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //this.txScore = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_Score_number.png" ) ); + // this.txScore_1P = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_Score_number_1P.png")); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txScore ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.txScore_1P); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + + protected void t蟆乗枚蟄苓。ィ遉コ( int x, int y, string str, int mode , int alpha, int player ) + { + foreach( char ch in str ) + { + for( int i = 0; i < this.stFont.Length; i++ ) + { + if( this.stFont[ i ].ch == ch ) + { + Rectangle rectangle = new Rectangle(TJAPlayer3.Skin.Game_Score_Size[0] * i, 0, TJAPlayer3.Skin.Game_Score_Size[0], TJAPlayer3.Skin.Game_Score_Size[1]); + switch( mode ) + { + case 0: + if( TJAPlayer3.Tx.Taiko_Score[0] != null ) + { + //this.txScore.color4 = new SlimDX.Color4( 1.0f, 1.0f, 1.0f ); + TJAPlayer3.Tx.Taiko_Score[0].Opacity = alpha; + TJAPlayer3.Tx.Taiko_Score[0].vc諡。螟ァ邵ョ蟆丞咲紫.Y = ScoreScale[this.ct轤ケ謨ー繧「繝九Γ繧ソ繧、繝杣player].n迴セ蝨ィ縺ョ蛟、]; + TJAPlayer3.Tx.Taiko_Score[0].t2D諡。螟ァ邇閠諷ョ荳句渕貅匁緒逕サ( TJAPlayer3.app.Device, x , y, rectangle ); + + } + break; + case 1: + if(TJAPlayer3.Tx.Taiko_Score[1] != null ) + { + //this.txScore.color4 = new SlimDX.Color4( 1.0f, 0.5f, 0.4f ); + //this.txScore.color4 = CDTXMania.Skin.cScoreColor1P; + TJAPlayer3.Tx.Taiko_Score[1].Opacity = alpha; + TJAPlayer3.Tx.Taiko_Score[1].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1; + TJAPlayer3.Tx.Taiko_Score[1].t2D諡。螟ァ邇閠諷ョ荳句渕貅匁緒逕サ( TJAPlayer3.app.Device, x, y, rectangle ); + } + break; + case 2: + if(TJAPlayer3.Tx.Taiko_Score[2] != null ) + { + //this.txScore.color4 = new SlimDX.Color4( 0.4f, 0.5f, 1.0f ); + //this.txScore.color4 = CDTXMania.Skin.cScoreColor2P; + TJAPlayer3.Tx.Taiko_Score[2].Opacity = alpha; + TJAPlayer3.Tx.Taiko_Score[2].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1; + TJAPlayer3.Tx.Taiko_Score[2].t2D諡。螟ァ邇閠諷ョ荳句渕貅匁緒逕サ( TJAPlayer3.app.Device, x, y, rectangle ); + } + break; + } + break; + } + } + x += TJAPlayer3.Skin.Game_Score_Padding; + } + } + } +} diff --git a/TJAPlayer3/Stages/07.Game/CAct貍泌・上せ繝繝シ繧ク螟ア謨.cs b/TJAPlayer3/Stages/07.Game/CAct貍泌・上せ繝繝シ繧ク螟ア謨.cs new file mode 100644 index 00000000..087fb579 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/CAct貍泌・上せ繝繝シ繧ク螟ア謨.cs @@ -0,0 +1,256 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.IO; +using System.Runtime.InteropServices; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・上せ繝繝シ繧ク螟ア謨 : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CAct貍泌・上せ繝繝シ繧ク螟ア謨() + { + ST譁蟄嶺ス咲スョ[] st譁蟄嶺ス咲スョArray = new ST譁蟄嶺ス咲スョ[ 11 ]; + + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ.ch = '0'; + st譁蟄嶺ス咲スョ.pt = new Point( 0, 0 ); + st譁蟄嶺ス咲スョArray[ 0 ] = st譁蟄嶺ス咲スョ; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ2 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ2.ch = '1'; + st譁蟄嶺ス咲スョ2.pt = new Point( 62, 0 ); + st譁蟄嶺ス咲スョArray[ 1 ] = st譁蟄嶺ス咲スョ2; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ3 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ3.ch = '2'; + st譁蟄嶺ス咲スョ3.pt = new Point( 124, 0 ); + st譁蟄嶺ス咲スョArray[ 2 ] = st譁蟄嶺ス咲スョ3; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ4 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ4.ch = '3'; + st譁蟄嶺ス咲スョ4.pt = new Point( 186, 0 ); + st譁蟄嶺ス咲スョArray[ 3 ] = st譁蟄嶺ス咲スョ4; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ5 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ5.ch = '4'; + st譁蟄嶺ス咲スョ5.pt = new Point( 248, 0 ); + st譁蟄嶺ス咲スョArray[ 4 ] = st譁蟄嶺ス咲スョ5; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ6 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ6.ch = '5'; + st譁蟄嶺ス咲スョ6.pt = new Point( 310, 0 ); + st譁蟄嶺ス咲スョArray[ 5 ] = st譁蟄嶺ス咲スョ6; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ7 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ7.ch = '6'; + st譁蟄嶺ス咲スョ7.pt = new Point( 372, 0 ); + st譁蟄嶺ス咲スョArray[ 6 ] = st譁蟄嶺ス咲スョ7; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ8 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ8.ch = '7'; + st譁蟄嶺ス咲スョ8.pt = new Point( 434, 0 ); + st譁蟄嶺ス咲スョArray[ 7 ] = st譁蟄嶺ス咲スョ8; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ9 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ9.ch = '8'; + st譁蟄嶺ス咲スョ9.pt = new Point( 496, 0 ); + st譁蟄嶺ス咲スョArray[ 8 ] = st譁蟄嶺ス咲スョ9; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ10 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ10.ch = '9'; + st譁蟄嶺ス咲スョ10.pt = new Point( 558, 0 ); + st譁蟄嶺ス咲スョArray[ 9 ] = st譁蟄嶺ス咲スョ10; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ11 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ11.ch = '%'; + st譁蟄嶺ス咲スョ11.pt = new Point( 558 + 62, 0 ); + st譁蟄嶺ス咲スョArray[ 10 ] = st譁蟄嶺ス咲スョ11; + this.st譁蟄嶺ス咲スョ = st譁蟄嶺ス咲スョArray; + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // 繝。繧ス繝繝 + + public void Start() + { + this.dbFailedTime = TJAPlayer3.Timer.n迴セ蝨ィ譎ょ綾; + this.ct騾イ陦 = new CCounter( 0, 1000, 2, TJAPlayer3.Timer ); + if( TJAPlayer3.ConfigIni.eGameMode != EGame.OFF ) + { + this.ct騾イ陦 = new CCounter( 0, 4000, 2, TJAPlayer3.Timer ); + } + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + this.sd蜉ケ譫憺浹 = null; + this.b蜉ケ譫憺浹蜀咲函貂医∩ = false; + this.ct騾イ陦 = new CCounter(); + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + this.ct騾イ陦 = null; + if( this.sd蜉ケ譫憺浹 != null ) + { + TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r遐エ譽縺吶k( this.sd蜉ケ譫憺浹 ); + this.sd蜉ケ譫憺浹 = null; + } + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + // this.txBlack = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\Tile black 64x64.png" ) ); + //this.txStageFailed = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_stage_failed.jpg" ) ); + //this.txGameFailed = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_GameFailed.png" ) ); + // this.tx謨ー蟄 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_RollNumber.png" ) ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txStageFailed ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txGameFailed ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txBlack ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx謨ー蟄 ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + return 0; + } + if( ( this.ct騾イ陦 == null ) || this.ct騾イ陦.b蛛懈ュ「荳ュ ) + { + return 0; + } + this.ct騾イ陦.t騾イ陦(); + + if (TJAPlayer3.ConfigIni.eGameMode == EGame.螳瑚オー蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ || TJAPlayer3.ConfigIni.eGameMode == EGame.螳瑚オー蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ豼霎) + { + if (TJAPlayer3.Tx.Tile_Black != null) + { + for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / 64); i++) + { + for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / 64); j++) + { + TJAPlayer3.Tx.Tile_Black.t2D謠冗判(TJAPlayer3.app.Device, i * 64, j * 64); + } + } + } + if (this.ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 > 1500) + { + if (TJAPlayer3.Tx.Failed_Game != null) + TJAPlayer3.Tx.Failed_Game.t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + + int num = (TJAPlayer3.DTX.listChip.Count > 0) ? TJAPlayer3.DTX.listChip[TJAPlayer3.DTX.listChip.Count - 1].n逋コ螢ー譎ょ綾ms : 0; + this.t譁蟄苓。ィ遉コ(640, 520, (((this.dbFailedTime) / 1000.0) / (((double)num) / 1000.0) * 100).ToString("##0") + "%"); + } + + //int num = ( CDTXMania.DTX.listChip.Count > 0 ) ? CDTXMania.DTX.listChip[ CDTXMania.DTX.listChip.Count - 1 ].n逋コ螢ー譎ょ綾ms : 0; + //string str = "Time: " + ( ( ( this.dbFailedTime ) / 1000.0 ) ).ToString( "####0.00" ) + " / " + ( ( ( ( double ) num ) / 1000.0 ) ).ToString( "####0.00" ); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 0, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, str ); + + } + else + { + if (this.ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 < 100) + { + int x = (int)(640.0 * Math.Cos((Math.PI / 2 * this.ct騾イ陦.n迴セ蝨ィ縺ョ蛟、) / 100.0)); + if ((x != 640) && (TJAPlayer3.Tx.Failed_Stage != null)) + { + TJAPlayer3.Tx.Failed_Stage.t2D謠冗判(TJAPlayer3.app.Device, 0, 0, new Rectangle(x, 0, 640 - x, 720)); + TJAPlayer3.Tx.Failed_Stage.t2D謠冗判(TJAPlayer3.app.Device, 640 + x, 0, new Rectangle(640, 0, 640 - x, 720)); + } + } + else + { + if (TJAPlayer3.Tx.Failed_Stage != null) + { + TJAPlayer3.Tx.Failed_Stage.t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + } + if (this.ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 <= 250) + { + int num2 = TJAPlayer3.Random.Next(5) - 2; + int y = TJAPlayer3.Random.Next(5) - 2; + if (TJAPlayer3.Tx.Failed_Stage != null) + { + TJAPlayer3.Tx.Failed_Stage.t2D謠冗判(TJAPlayer3.app.Device, num2, y); + } + } + if (!this.b蜉ケ譫憺浹蜀咲函貂医∩) + { + TJAPlayer3.Skin.soundSTAGEFAILED髻ウ.t蜀咲函縺吶k(); + this.b蜉ケ譫憺浹蜀咲函貂医∩ = true; + } + } + } + + if( !this.ct騾イ陦.b邨ゆコ蛟、縺ォ驕斐@縺 ) + { + return 0; + } + return 1; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private bool b蜉ケ譫憺浹蜀咲函貂医∩; + private CCounter ct騾イ陦; + private CSound sd蜉ケ譫憺浹; + //private CTexture txStageFailed; + // private CTexture txGameFailed; + // private CTexture txBlack; + // private CTexture tx謨ー蟄; + private double dbFailedTime; + //----------------- + private ST譁蟄嶺ス咲スョ[] st譁蟄嶺ス咲スョ; + + [StructLayout(LayoutKind.Sequential)] + public struct ST譁蟄嶺ス咲スョ + { + public char ch; + public Point pt; + public ST譁蟄嶺ス咲スョ( char ch, Point pt ) + { + this.ch = ch; + this.pt = pt; + } + } + + private void t譁蟄苓。ィ遉コ( int x, int y, string str ) + { + foreach( char ch in str ) + { + for( int i = 0; i < this.st譁蟄嶺ス咲スョ.Length; i++ ) + { + if( this.st譁蟄嶺ス咲スョ[ i ].ch == ch ) + { + Rectangle rectangle = new Rectangle( this.st譁蟄嶺ス咲スョ[ i ].pt.X, this.st譁蟄嶺ス咲スョ[ i ].pt.Y, 62, 80 ); + if( ch == '%' ) + { + rectangle.Width = 80; + } + if(TJAPlayer3.Tx.Balloon_Number_Roll != null ) + { + TJAPlayer3.Tx.Balloon_Number_Roll.t2D謠冗判( TJAPlayer3.app.Device, x - ( 62 * str.Length / 2 ), y, rectangle ); + } + break; + } + } + x += 62; + } + } + + + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/CAct貍泌・上せ繝繝シ繧ソ繧ケ繝代ロ繝ォ蜈ア騾.cs b/TJAPlayer3/Stages/07.Game/CAct貍泌・上せ繝繝シ繧ソ繧ケ繝代ロ繝ォ蜈ア騾.cs new file mode 100644 index 00000000..50327bc2 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/CAct貍泌・上せ繝繝シ繧ソ繧ケ繝代ロ繝ォ蜈ア騾.cs @@ -0,0 +1,134 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using System.Diagnostics; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・上せ繝繝シ繧ソ繧ケ繝代ロ繝ォ蜈ア騾 : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + public CAct貍泌・上せ繝繝シ繧ソ繧ケ繝代ロ繝ォ蜈ア騾() + { + this.st繝代ロ繝ォ繝槭ャ繝 = new STATUSPANEL[ 12 ]; // yyagi: 莉・荳九∵焔謚懊″縺ョ蛻晄悄蛹悶〒繧ケ繝槭Φ + // { "DTXMANIA", 0 }, { "EXTREME", 1 }, ... 縺ソ縺溘>縺ォ譖ク縺阪◆縺縺契__ + string[] labels = new string[ 12 ] { + "DTXMANIA", "EXTREME", "ADVANCED", "ADVANCE", "BASIC", "RAW", + "REAL", "EASY", "EX-REAL", "ExREAL", "ExpertReal", "NORMAL" + }; + int[] status = new int[ 12 ] { + 0, 1, 2, 2, 3, 4, 5, 6, 7, 7, 7, 8 + }; + + for ( int i = 0; i < 12; i++ ) + { + this.st繝代ロ繝ォ繝槭ャ繝夕 i ] = new STATUSPANEL(); + this.st繝代ロ繝ォ繝槭ャ繝夕 i ].status = status[ i ]; + this.st繝代ロ繝ォ繝槭ャ繝夕 i ].label = labels[ i ]; + } + + #region [ 譌ァ蛻晄悄蛹門ヲ逅(豕ィ驥亥喧) ] + //STATUSPANEL[] statuspanelArray = new STATUSPANEL[ 12 ]; + //STATUSPANEL statuspanel = new STATUSPANEL(); + //statuspanel.status = 0; + //statuspanel.label = "DTXMANIA"; + //statuspanelArray[ 0 ] = statuspanel; + //STATUSPANEL statuspanel2 = new STATUSPANEL(); + //statuspanel2.status = 1; + //statuspanel2.label = "EXTREME"; + //statuspanelArray[ 1 ] = statuspanel2; + //STATUSPANEL statuspanel3 = new STATUSPANEL(); + //statuspanel3.status = 2; + //statuspanel3.label = "ADVANCED"; + //statuspanelArray[ 2 ] = statuspanel3; + //STATUSPANEL statuspanel4 = new STATUSPANEL(); + //statuspanel4.status = 2; + //statuspanel4.label = "ADVANCE"; + //statuspanelArray[ 3 ] = statuspanel4; + //STATUSPANEL statuspanel5 = new STATUSPANEL(); + //statuspanel5.status = 3; + //statuspanel5.label = "BASIC"; + //statuspanelArray[ 4 ] = statuspanel5; + //STATUSPANEL statuspanel6 = new STATUSPANEL(); + //statuspanel6.status = 4; + //statuspanel6.label = "RAW"; + //statuspanelArray[ 5 ] = statuspanel6; + //STATUSPANEL statuspanel7 = new STATUSPANEL(); + //statuspanel7.status = 5; + //statuspanel7.label = "REAL"; + //statuspanelArray[ 6 ] = statuspanel7; + //STATUSPANEL statuspanel8 = new STATUSPANEL(); + //statuspanel8.status = 6; + //statuspanel8.label = "EASY"; + //statuspanelArray[ 7 ] = statuspanel8; + //STATUSPANEL statuspanel9 = new STATUSPANEL(); + //statuspanel9.status = 7; + //statuspanel9.label = "EX-REAL"; + //statuspanelArray[ 8 ] = statuspanel9; + //STATUSPANEL statuspanel10 = new STATUSPANEL(); + //statuspanel10.status = 7; + //statuspanel10.label = "ExREAL"; + //statuspanelArray[ 9 ] = statuspanel10; + //STATUSPANEL statuspanel11 = new STATUSPANEL(); + //statuspanel11.status = 7; + //statuspanel11.label = "ExpertReal"; + //statuspanelArray[ 10 ] = statuspanel11; + //STATUSPANEL statuspanel12 = new STATUSPANEL(); + //statuspanel12.status = 8; + //statuspanel12.label = "NORMAL"; + //statuspanelArray[ 11 ] = statuspanel12; + //this.st繝代ロ繝ォ繝槭ャ繝 = statuspanelArray; + #endregion + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // 繝。繧ス繝繝 + + public void t繝ゥ繝吶Ν蜷阪°繧峨せ繝繝シ繧ソ繧ケ繝代ロ繝ォ繧呈アコ螳壹☆繧( string str繝ゥ繝吶Ν蜷 ) + { + if ( string.IsNullOrEmpty( str繝ゥ繝吶Ν蜷 ) ) + { + this.nStatus = 0; + } + else + { + foreach ( STATUSPANEL statuspanel in this.st繝代ロ繝ォ繝槭ャ繝 ) + { + if ( str繝ゥ繝吶Ν蜷.Equals( statuspanel.label, StringComparison.CurrentCultureIgnoreCase ) ) // #24482 2011.2.17 yyagi ignore case + { + this.nStatus = statuspanel.status; + return; + } + } + this.nStatus = 0; + } + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + this.nStatus = 0; + base.On豢サ諤ァ蛹(); + } + + + #region [ protected ] + //----------------- + [StructLayout( LayoutKind.Sequential )] + protected struct STATUSPANEL + { + public string label; + public int status; + } + + protected int nStatus; + protected STATUSPANEL[] st繝代ロ繝ォ繝槭ャ繝 = null; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/CAct貍泌・上メ繝繝励ヵ繧。繧、繧「GB.cs b/TJAPlayer3/Stages/07.Game/CAct貍泌・上メ繝繝励ヵ繧。繧、繧「GB.cs new file mode 100644 index 00000000..7dcd825c --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/CAct貍泌・上メ繝繝励ヵ繧。繧、繧「GB.cs @@ -0,0 +1,71 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal abstract class CAct貍泌・上メ繝繝励ヵ繧。繧、繧「GB : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CAct貍泌・上メ繝繝励ヵ繧。繧、繧「GB() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // 繝。繧ス繝繝 + + public virtual void Start( int nLane, int n荳ュ螟ョX, int n荳ュ螟ョY, C貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓吝ア騾 貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓 ) + { + } + + public abstract void Start( int nLane, C貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓吝ア騾 貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓 ); +// public abstract void Start( int nLane ); + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + //private STDGBVALUE nJudgeLinePosY_delta = new STDGBVALUE(); + C貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓吝ア騾 _貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓 = new C貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓吝ア騾(); + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/CAct貍泌・上ヱ繝阪Ν譁蟄怜.cs b/TJAPlayer3/Stages/07.Game/CAct貍泌・上ヱ繝阪Ν譁蟄怜.cs new file mode 100644 index 00000000..e7ad7aa1 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/CAct貍泌・上ヱ繝阪Ν譁蟄怜.cs @@ -0,0 +1,338 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Diagnostics; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・上ヱ繝阪Ν譁蟄怜 : CActivity + { + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CAct貍泌・上ヱ繝阪Ν譁蟄怜() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + this.Start(); + } + + + // 繝。繧ス繝繝 + + /// + /// 蜿ウ荳翫ョ譖イ蜷阪∵峇謨ー陦ィ遉コ縺ョ譖エ譁ー繧定。後>縺セ縺吶 + /// + /// 譖イ蜷 + /// 繧ク繝」繝ウ繝ォ蜷 + /// 譖イ謨ー + public void SetPanelString(string songName, string genreName, string stageText = null) + { + if( base.b豢サ諤ァ蛹悶@縺ヲ繧 ) + { + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txPanel ); + if( (songName != null ) && (songName.Length > 0 ) ) + { + try + { + using (var bmpSongTitle = pfMusicName.DrawPrivateFont(songName, TJAPlayer3.Skin.Game_MusicName_ForeColor, TJAPlayer3.Skin.Game_MusicName_BackColor)) + { + this.txMusicName = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmpSongTitle, false ); + } + if (txMusicName != null) + { + this.txMusicName.vc諡。螟ァ邵ョ蟆丞咲紫.X = TJAPlayer3.GetSongNameXScaling(ref txMusicName); + } + + Bitmap bmpDiff; + string strDiff = ""; + if (TJAPlayer3.Skin.eDiffDispMode == E髮」譏灘コヲ陦ィ遉コ繧ソ繧、繝.n譖イ逶ョ縺ォ陦ィ遉コ) + { + switch (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]) + { + case 0: + strDiff = "縺九s縺溘s "; + break; + case 1: + strDiff = "縺オ縺、縺 "; + break; + case 2: + strDiff = "繧縺壹°縺励> "; + break; + case 3: + strDiff = "縺翫↓ "; + break; + case 4: + strDiff = "縺医〒縺縺ィ "; + break; + default: + strDiff = "縺翫↓ "; + break; + } + bmpDiff = pfMusicName.DrawPrivateFont(strDiff + stageText, TJAPlayer3.Skin.Game_StageText_ForeColor, TJAPlayer3.Skin.Game_StageText_BackColor ); + } + else + { + bmpDiff = pfMusicName.DrawPrivateFont(stageText, TJAPlayer3.Skin.Game_StageText_ForeColor, TJAPlayer3.Skin.Game_StageText_BackColor ); + } + + using (bmpDiff) + { + txStage = TJAPlayer3.Tx.TxCGen("Songs"); + } + } + catch( CTextureCreateFailedException e ) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "繝代ロ繝ォ譁蟄怜励ユ繧ッ繧ケ繝√Ε縺ョ逕滓舌↓螟ア謨励@縺セ縺励◆縲" ); + this.txPanel = null; + } + } + if( !string.IsNullOrEmpty(genreName) ) + { + if (genreName.Equals("J-POP")) + { + this.txGENRE = TJAPlayer3.Tx.TxCGen("Pops"); + } + else if (genreName.Equals( "繧「繝九Γ" ) ) + { + this.txGENRE = TJAPlayer3.Tx.TxCGen("Anime"); + } + else if(genreName.Equals( "繧イ繝シ繝繝溘Η繝シ繧ク繝繧ッ" ) ) + { + this.txGENRE = TJAPlayer3.Tx.TxCGen("Game"); + } + else if(genreName.Equals( "繝翫Β繧ウ繧ェ繝ェ繧ク繝翫Ν" ) ) + { + this.txGENRE = TJAPlayer3.Tx.TxCGen("Namco"); + } + else if(genreName.Equals( "繧ッ繝ゥ繧キ繝繧ッ" ) ) + { + this.txGENRE = TJAPlayer3.Tx.TxCGen("Classic"); + } + else if(genreName.Equals( "繝舌Λ繧ィ繝繧」" ) ) + { + this.txGENRE = TJAPlayer3.Tx.TxCGen("Variety"); + } + else if(genreName.Equals( "縺ゥ縺繧医≧" ) ) + { + this.txGENRE = TJAPlayer3.Tx.TxCGen("Child"); + } + else if(genreName.Equals( "繝舌Λ繧ィ繝繧」" ) ) + { + this.txGENRE = TJAPlayer3.Tx.TxCGen("Variety"); + } + else if(genreName.Equals( "繝懊シ繧ォ繝ュ繧、繝" ) || genreName.Equals("Vocaloid") ) + { + this.txGENRE = TJAPlayer3.Tx.TxCGen("Vocaloid"); + } + else + { + using (var bmpDummy = new Bitmap( 1, 1 )) + { + this.txGENRE = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmpDummy, true ); + } + } + } + + this.ct騾イ陦檎畑 = new CCounter( 0, 2000, 2, TJAPlayer3.Timer ); + this.Start(); + + + + } + } + + public void t豁瑚ゥ槭ユ繧ッ繧ケ繝√Ε繧堤函謌舌☆繧( Bitmap bmplyric ) + { + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k(ref this.tx豁瑚ゥ槭ユ繧ッ繧ケ繝√Ε); + this.tx豁瑚ゥ槭ユ繧ッ繧ケ繝√Ε = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( bmplyric ); + } + public void t豁瑚ゥ槭ユ繧ッ繧ケ繝√Ε繧貞炎髯、縺吶k() + { + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.tx豁瑚ゥ槭ユ繧ッ繧ケ繝√Ε); + } + /// + /// 繝ャ繧、繝、繝シ邂。逅縺ョ縺溘a縲^n騾イ陦梧緒逕サ縺九i蛻髮「縲 + /// + public void t豁瑚ゥ槭ユ繧ッ繧ケ繝√Ε繧呈緒逕サ縺吶k() + { + if( this.tx豁瑚ゥ槭ユ繧ッ繧ケ繝√Ε != null ) + { + if (TJAPlayer3.Skin.Game_Lyric_ReferencePoint == CSkin.ReferencePoint.Left) + { + this.tx豁瑚ゥ槭ユ繧ッ繧ケ繝√Ε.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Lyric_X , TJAPlayer3.Skin.Game_Lyric_Y); + } + else if (TJAPlayer3.Skin.Game_Lyric_ReferencePoint == CSkin.ReferencePoint.Right) + { + this.tx豁瑚ゥ槭ユ繧ッ繧ケ繝√Ε.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Lyric_X - this.tx豁瑚ゥ槭ユ繧ッ繧ケ繝√Ε.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, TJAPlayer3.Skin.Game_Lyric_Y); + } + else + { + this.tx豁瑚ゥ槭ユ繧ッ繧ケ繝√Ε.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Lyric_X - (this.tx豁瑚ゥ槭ユ繧ッ繧ケ繝√Ε.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2), TJAPlayer3.Skin.Game_Lyric_Y); + } + } + } + + public void Stop() + { + this.bMute = true; + } + public void Start() + { + this.bMute = false; + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + if( !string.IsNullOrEmpty( TJAPlayer3.ConfigIni.FontName ) ) + { + this.pfMusicName = new CPrivateFastFont( new FontFamily( TJAPlayer3.ConfigIni.FontName), TJAPlayer3.Skin.Game_MusicName_FontSize); + //this.pf邵ヲ譖ク縺阪ユ繧ケ繝 = new CPrivateFastFont( new FontFamily( CDTXMania.ConfigIni.strPrivateFont縺ァ菴ソ縺繝輔か繝ウ繝亥錐 ), 22 ); + } + + this.txPanel = null; + this.ct騾イ陦檎畑 = new CCounter(); + this.Start(); + this.bFirst = true; + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + this.ct騾イ陦檎畑 = null; + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k( ref this.txPanel ); + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k( ref this.txMusicName ); + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k( ref this.txGENRE ); + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k(ref this.txPanel); + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k(ref this.tx豁瑚ゥ槭ユ繧ッ繧ケ繝√Ε); + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k(ref this.pfMusicName); + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k(ref this.pf豁瑚ゥ槭ヵ繧ゥ繝ウ繝); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + throw new InvalidOperationException( "t騾イ陦梧緒逕サ(x,y)縺ョ縺サ縺繧剃スソ逕ィ縺励※縺上□縺輔>縲" ); + } + public int t騾イ陦梧緒逕サ( int x, int y ) + { + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actDan.IsAnimating) return 0; + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 && !this.bMute ) + { + this.ct騾イ陦檎畑.t騾イ陦鍬oop(); + if( this.txGENRE != null ) + this.txGENRE.t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Genre_X, TJAPlayer3.Skin.Game_Genre_Y ); + if( this.txStage != null ) + this.txStage.t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Genre_X, TJAPlayer3.Skin.Game_Genre_Y ); + + if( TJAPlayer3.Skin.b迴セ蝨ィ縺ョ繧ケ繝繝シ繧ク謨ー繧定。ィ遉コ縺励↑縺 ) + { + if( this.txMusicName != null ) + { + float fRate = 660.0f / this.txMusicName.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + if (this.txMusicName.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width <= 660.0f) + fRate = 1.0f; + + this.txMusicName.vc諡。螟ァ邵ョ蟆丞咲紫.X = fRate; + + if (this.txMusicName.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width >= 195) + this.txMusicName.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_MusicName_X - ((this.txMusicName.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width * fRate) / 2) - (this.txMusicName.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2), TJAPlayer3.Skin.Game_MusicName_Y); + else + this.txMusicName.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_MusicName_X - ((this.txMusicName.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width * fRate) / 2), TJAPlayer3.Skin.Game_MusicName_Y); + } + } + else + { + #region[ 騾乗主コヲ蛻カ蠕。 ] + + if( this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、 < 745 ) + { + if( this.txStage != null ) + this.txStage.Opacity = 0; + } + else if( this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、 >= 745 && this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、 < 1000 ) + { + if( this.txStage != null ) + this.txStage.Opacity = ( this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、 - 745 ); + } + else if( this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、 >= 1000 && this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、 <= 1745 ) + { + if( this.txStage != null ) + this.txStage.Opacity = 255; + } + else if( this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、 >= 1745 ) + { + if( this.txStage != null ) + this.txStage.Opacity = 255 - (this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、 - 1745); + } + #endregion + + if( this.txMusicName != null ) + { + if(this.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ) + { + b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + if (this.txMusicName != null) + { + float fRate = 660.0f / this.txMusicName.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + if (this.txMusicName.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width <= 660.0f) + fRate = 1.0f; + + this.txMusicName.vc諡。螟ァ邵ョ蟆丞咲紫.X = fRate; + + if (this.txMusicName.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width >= 195) + this.txMusicName.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_MusicName_X - ((this.txMusicName.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width * fRate) / 2) - ((this.txMusicName.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width - 195) / 2), TJAPlayer3.Skin.Game_MusicName_Y); + else + this.txMusicName.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_MusicName_X - ((this.txMusicName.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width * fRate) / 2), TJAPlayer3.Skin.Game_MusicName_Y); + } + } + } + + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 0, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.ct騾イ陦檎畑.n迴セ蝨ィ縺ョ蛟、.ToString() ); + + //this.txMusicName.t2D謠冗判( CDTXMania.app.Device, 1250 - this.txMusicName.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, 14 ); + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private CCounter ct騾イ陦檎畑; + + private CTexture txPanel; + private bool bMute; + private bool bFirst; + + private CTexture txMusicName; + private CTexture txStage; + private CTexture txGENRE; + private CTexture tx豁瑚ゥ槭ユ繧ッ繧ケ繝√Ε; + private CPrivateFastFont pfMusicName; + private CPrivateFastFont pf豁瑚ゥ槭ヵ繧ゥ繝ウ繝; + //----------------- + #endregion + } +} +縲 diff --git a/TJAPlayer3/Stages/07.Game/CAct貍泌・上Ξ繝シ繝ウ繝輔Λ繝繧キ繝・GB蜈ア騾.cs b/TJAPlayer3/Stages/07.Game/CAct貍泌・上Ξ繝シ繝ウ繝輔Λ繝繧キ繝・GB蜈ア騾.cs new file mode 100644 index 00000000..b0fb7ef7 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/CAct貍泌・上Ξ繝シ繝ウ繝輔Λ繝繧キ繝・GB蜈ア騾.cs @@ -0,0 +1,49 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・上Ξ繝シ繝ウ繝輔Λ繝繧キ繝・GB蜈ア騾 : CActivity + { + // 繝励Ο繝代ユ繧」 + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CAct貍泌・上Ξ繝シ繝ウ繝輔Λ繝繧キ繝・GB蜈ア騾() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // 繝。繧ス繝繝 + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + } +} diff --git a/TJAPlayer3/Stages/07.Game/CAct貍泌・乗シ泌・乗ュ蝣ア.cs b/TJAPlayer3/Stages/07.Game/CAct貍泌・乗シ泌・乗ュ蝣ア.cs new file mode 100644 index 00000000..2225025c --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/CAct貍泌・乗シ泌・乗ュ蝣ア.cs @@ -0,0 +1,82 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using FDK; +using System.Diagnostics; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・乗シ泌・乗ュ蝣ア : CActivity + { + // 繝励Ο繝代ユ繧」 + + public double dbBPM; + public readonly int[] NowMeasure = new int[2]; + public double dbSCROLL; + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CAct貍泌・乗シ泌・乗ュ蝣ア() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + for (int i = 0; i < 2; i++) + { + NowMeasure[i] = 0; + } + this.dbBPM = TJAPlayer3.DTX.BASEBPM; + this.dbSCROLL = 1.0; + base.On豢サ諤ァ蛹(); + } + public override int On騾イ陦梧緒逕サ() + { + throw new InvalidOperationException( "t騾イ陦梧緒逕サ(int x, int y) 縺ョ縺サ縺繧剃スソ逕ィ縺励※縺上□縺輔>縲" ); + } + public void t騾イ陦梧緒逕サ( int x, int y ) + { + if ( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + y += 0x153; + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x, y, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, string.Format( "BGM/Taiko Adj: {0:####0}/{1:####0} ms", TJAPlayer3.DTX.nBGMAdjust, TJAPlayer3.ConfigIni.nInputAdjustTimeMs ) ); + y -= 0x10; + int num = ( TJAPlayer3.DTX.listChip.Count > 0 ) ? TJAPlayer3.DTX.listChip[ TJAPlayer3.DTX.listChip.Count - 1 ].n逋コ螢ー譎ょ綾ms : 0; + string str = "Time: " + ((((double)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))) / 1000.0)).ToString("####0.00") + " / " + ((((double)num) / 1000.0)).ToString("####0.00"); + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x, y, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, str ); + y -= 0x10; + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x, y, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, string.Format( "Part: {0:####0}/{1:####0}", NowMeasure[0], NowMeasure[1] ) ); + y -= 0x10; + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x, y, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, string.Format( "BPM: {0:####0.0000}", this.dbBPM ) ); + y -= 0x10; + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x, y, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, string.Format( "Frame: {0:####0} fps", TJAPlayer3.FPS.n迴セ蝨ィ縺ョFPS ) ); + y -= 0x10; + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x, y, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, string.Format( "NoteN: {0:####0}", TJAPlayer3.DTX.n繝弱シ繝謨ー[0] ) ); + y -= 0x10; + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x, y, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, string.Format( "NoteE: {0:####0}", TJAPlayer3.DTX.n繝弱シ繝謨ー[1] ) ); + y -= 0x10; + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x, y, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, string.Format( "NoteM: {0:####0}", TJAPlayer3.DTX.n繝弱シ繝謨ー[2] ) ); + y -= 0x10; + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x, y, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, string.Format( "NoteC: {0:####0}", TJAPlayer3.DTX.n繝弱シ繝謨ー[3] ) ); + y -= 0x10; + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x, y, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, string.Format( "SCROLL: {0:####0.00}", this.dbSCROLL ) ); + y -= 0x10; + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x, y, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, string.Format( "SCOREMODE: {0:####0}", TJAPlayer3.DTX.nScoreModeTmp ) ); + y -= 0x10; + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x, y, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, string.Format( "SCROLLMODE: {0:####0}", Enum.GetName(typeof(EScrollMode), TJAPlayer3.ConfigIni.eScrollMode ) ) ); + + + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x, y, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, string.Format( "Sound CPU : {0:####0.00}%", CDTXMania.Sound邂。逅.GetCPUusage() ) ); + //y -= 0x10; + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x, y, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, string.Format( "Sound Mixing: {0:####0}", CDTXMania.Sound邂。逅.GetMixingStreams() ) ); + //y -= 0x10; + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x, y, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, string.Format( "Sound Streams: {0:####0}", CDTXMania.Sound邂。逅.GetStreams() ) ); + //y -= 0x10; + } + } + } +} diff --git a/TJAPlayer3/Stages/07.Game/CInvisibleChip.cs b/TJAPlayer3/Stages/07.Game/CInvisibleChip.cs new file mode 100644 index 00000000..a44b1488 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/CInvisibleChip.cs @@ -0,0 +1,196 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using FDK; + +namespace TJAPlayer3 +{ + public class CInvisibleChip : IDisposable + { + /// 繝溘せ蠕瑚。ィ遉コ縺吶k譎る俣(ms) + public int nDisplayTimeMs + { + get; + set; + } + /// 陦ィ遉コ譛滄俣邨ゆコ蠕後√ヵ繧ァ繝シ繝峨い繧ヲ繝医☆繧区凾髢 + public int nFadeoutTimeMs + { + get; + set; + } + /// 讌ス蝎ィ縺斐→縺ョInvisible繝「繝シ繝 + public STDGBVALUE eInvisibleMode; + + + + #region [ 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ ] + public CInvisibleChip() + { + Initialize( 3000, 2000 ); + } + /// + /// 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + /// + /// 繝溘せ譎ょ崎。ィ遉コ縺吶k譎る俣(遘) + /// 蜀崎。ィ遉コ蠕後ヵ繧ァ繝シ繝峨い繧ヲ繝医☆繧区凾髢(遘) + public CInvisibleChip( int _nDisplayTimeMs, int _nFadeoutTimeMs ) + { + Initialize( _nDisplayTimeMs, _nFadeoutTimeMs ); + } + private void Initialize( int _nDisplayTimeMs, int _nFadeoutTimeMs ) + { + nDisplayTimeMs = _nDisplayTimeMs; + nFadeoutTimeMs = _nFadeoutTimeMs; + Reset(); + } + #endregion + + /// + /// 蜀驛ィ迥カ諷九r蛻晄悄蛹悶☆繧 + /// + public void Reset() + { + for ( int i = 0; i < 4; i++ ) + { + ccounter[ i ] = new CCounter(); + b貍泌・上メ繝繝励′シ代▽縺ァ繧ゅヰ繝シ繧帝夐℃縺励◆[ i ] = false; + } + } + + /// + /// 縺セ縺Semi-Invisible繧帝幕蟋九@縺ヲ縺縺ェ縺代l縺ー縲髢句ァ九☆繧 + /// + /// + public void StartSemiInvisible( E讌ス蝎ィ繝代シ繝 eInst ) + { + int nInst = (int) eInst; + if ( !b貍泌・上メ繝繝励′シ代▽縺ァ繧ゅヰ繝シ繧帝夐℃縺励◆[ nInst ] ) + { + b貍泌・上メ繝繝励′シ代▽縺ァ繧ゅヰ繝シ繧帝夐℃縺励◆[ nInst ] = true; + if ( this.eInvisibleMode[ nInst ] == EInvisible.SEMI ) + { + ShowChipTemporally( eInst ); + ccounter[ nInst ].n迴セ蝨ィ縺ョ蛟、 = nDisplayTimeMs; + } + } + } + /// + /// 荳譎ら噪縺ォ繝√ャ繝励r陦ィ遉コ縺吶k繝「繝シ繝峨r髢句ァ九☆繧 + /// + /// 讌ス蝎ィ繝代シ繝 + public void ShowChipTemporally( E讌ス蝎ィ繝代シ繝 eInst ) + { + ccounter[ (int) eInst ].t髢句ァ( 0, nDisplayTimeMs + nFadeoutTimeMs + 1, 1, TJAPlayer3.Timer ); + } + + /// + /// 繝√ャ繝励ョ陦ィ遉コ/髱櫁。ィ遉コ縺ョ迥カ諷 + /// + public enum EChipInvisibleState + { + SHOW, // Miss縺ェ縺ゥ縺励※繝√ャ繝励r陦ィ遉コ荳ュ + FADEOUT, // 陦ィ遉コ譛滄俣邨ゆコ蠕後√ヵ繧ァ繝シ繝峨い繧ヲ繝井クュ + INVISIBLE // 螳悟ィ髱櫁。ィ遉コ + } + + internal EChipInvisibleState SetInvisibleStatus( ref CDTX.CChip cc ) + { + if ( cc.e讌ス蝎ィ繝代シ繝 == E讌ス蝎ィ繝代シ繝.UNKNOWN ) + { + return EChipInvisibleState.SHOW; + } + int nInst = (int) cc.e讌ス蝎ィ繝代シ繝; + EChipInvisibleState retcode = EChipInvisibleState.SHOW; + + ccounter[ nInst ].t騾イ陦(); + + switch ( eInvisibleMode[ nInst ] ) + { + case EInvisible.OFF: + cc.b蜿ッ隕 = true; + retcode = EChipInvisibleState.SHOW; + break; + + case EInvisible.FULL: + cc.b蜿ッ隕 = false; + retcode = EChipInvisibleState.INVISIBLE; + break; + + case EInvisible.SEMI: + if ( !b貍泌・上メ繝繝励′シ代▽縺ァ繧ゅヰ繝シ繧帝夐℃縺励◆[ nInst ] ) // 縺セ縺1縺、繧ゅメ繝繝励′繝舌シ繧帝夐℃縺励※縺縺ェ縺譎ゅッ縲√メ繝繝励r陦ィ遉コ縺吶k + { + cc.b蜿ッ隕 = true; + cc.n騾乗主コヲ = 255; + return EChipInvisibleState.SHOW; + } + + if ( ccounter[ nInst ].n迴セ蝨ィ縺ョ蛟、 <= 0 || ccounter[ nInst ].n迴セ蝨ィ縺ョ蛟、 > nDisplayTimeMs + nFadeoutTimeMs ) + // 縺セ縺荳蠎ヲ繧Miss縺」縺ヲ縺縺ェ縺 or 繝輔ぉ繝シ繝峨い繧ヲ繝医@縺阪▲縺溷セ + { + cc.b蜿ッ隕 = false; + cc.n騾乗主コヲ = 255; + retcode = EChipInvisibleState.INVISIBLE; + } + else if ( ccounter[ nInst ].n迴セ蝨ィ縺ョ蛟、 < nDisplayTimeMs ) // 陦ィ遉コ譛滄俣 + { + cc.b蜿ッ隕 = true; + cc.n騾乗主コヲ = 255; + retcode = EChipInvisibleState.SHOW; + } + else if ( ccounter[ nInst ].n迴セ蝨ィ縺ョ蛟、 < nDisplayTimeMs + nFadeoutTimeMs ) // 繝輔ぉ繝シ繝峨い繧ヲ繝域悄髢 + { + cc.b蜿ッ隕 = true; + cc.n騾乗主コヲ = 255 - (int) ( Convert.ToDouble( ccounter[ nInst ].n迴セ蝨ィ縺ョ蛟、 - nDisplayTimeMs ) / nFadeoutTimeMs * 255.0 ); + retcode = EChipInvisibleState.FADEOUT; + } + break; + default: + cc.b蜿ッ隕 = true; + cc.n騾乗主コヲ = 255; + retcode = EChipInvisibleState.SHOW; + break; + } + return retcode; + } + + #region [ Dispose-Finalize 繝代ち繝シ繝ウ螳溯」 ] + //----------------- + public void Dispose() + { + this.Dispose( true ); + GC.SuppressFinalize( this ); + } + protected void Dispose( bool disposeManagedObjects ) + { + if( this.bDispose螳御コ貂医∩ ) + return; + + if( disposeManagedObjects ) + { + // (A) Managed 繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ + for ( int i = 0; i < 4; i++ ) + { + // ctInvisibleTimer[ i ].Dispose(); + ccounter[ i ].t蛛懈ュ「(); + ccounter[ i ] = null; + } + } + + // (B) Unamanaged 繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ + + this.bDispose螳御コ貂医∩ = true; + } + ~CInvisibleChip() + { + this.Dispose( false ); + } + //----------------- + #endregion + + private STDGBVALUE ccounter; + private bool bDispose螳御コ貂医∩ = false; + private STDGBVALUE b貍泌・上メ繝繝励′シ代▽縺ァ繧ゅヰ繝シ繧帝夐℃縺励◆; + } +} diff --git a/TJAPlayer3/Stages/07.Game/CLagLogger.cs b/TJAPlayer3/Stages/07.Game/CLagLogger.cs new file mode 100644 index 00000000..aac1aeeb --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/CLagLogger.cs @@ -0,0 +1,112 @@ +サソusing System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using FDK.ExtensionMethods; + +namespace TJAPlayer3 +{ + internal static class CLagLogger + { + private const int MaximumLag = 200; + private const int MinimumLag = 0 - MaximumLag; + private const int Offset = 1 - MinimumLag; + + private static readonly List LagValues = new List(2000); + + public static void Add(int nPlayer, CDTX.CChip pChip) + { + if (nPlayer != 0) + { + return; + } + + switch (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ) + { + case 0x15: + case 0x16: + case 0x17: + case 0x18: + case 0x1F: + return; + } + + var pChipNLag = pChip.nLag; + + LagValues.Add(pChipNLag); + } + + public static double? LogAndReturnMeanLag() + { + if (LagValues.Count < 30) + { + return null; + } + + var orderedLagValues = LagValues.OrderBy(x => x).ToList(); + + var mean = orderedLagValues.Average(); + var mid = (orderedLagValues.Count - 1) / 2.0; + var median = (orderedLagValues[(int)(mid)] + orderedLagValues[(int)(mid + 0.5)]) / 2.0; + var groups = orderedLagValues.GroupBy(v => v).ToList(); + var maxCount = groups.Max(g => g.Count()); + var modes = string.Join(",", groups.Where(g => g.Count() == maxCount).Select(o => o.Key.ToString()).ToArray()); + var stdev = Math.Sqrt(orderedLagValues.Select(o => Math.Pow(o - mean, 2)).Average()); + + Trace.TraceInformation( + $"{nameof(CLagLogger)}.{nameof(LogAndReturnMeanLag)}: Mean lag: {mean}. Median lag: {median}. Mode(s) of lag: {modes}. Standard deviation of lag: {stdev}."); + + var hitChipCountsIndexedByOffsetLag = new int[1 + MaximumLag + 1 + MaximumLag + 1]; + foreach (var pChipNLag in LagValues) + { + hitChipCountsIndexedByOffsetLag[pChipNLag.Clamp(MinimumLag - 1, MaximumLag + 1) + Offset]++; + } + + var sbHeader = new StringBuilder(); + var sbData = new StringBuilder(); + + var doneOne = false; + for (var i = 0; i < hitChipCountsIndexedByOffsetLag.Length; i++) + { + var count = hitChipCountsIndexedByOffsetLag[i]; + + if (count != 0) + { + if (doneOne) + { + sbHeader.Append(","); + sbData.Append(","); + } + else + { + doneOne = true; + } + + var lag = i - Offset; + if (lag < MinimumLag) + { + sbHeader.Append($"< {MinimumLag}"); + } + else if (lag > MaximumLag) + { + sbHeader.Append($"> {MaximumLag}"); + } + else + { + sbHeader.Append(lag); + } + + sbData.Append(count); + } + } + + Trace.TraceInformation( + $"{nameof(CLagLogger)}.{nameof(LogAndReturnMeanLag)}: Hit chip counts, indexed by lag in milliseconds:{Environment.NewLine}{sbHeader}{Environment.NewLine}{sbData}"); + + LagValues.Clear(); + + return mean; + } + } +} diff --git a/TJAPlayer3/Stages/07.Game/CStage貍泌・冗判髱「蜈ア騾.cs b/TJAPlayer3/Stages/07.Game/CStage貍泌・冗判髱「蜈ア騾.cs new file mode 100644 index 00000000..c3934342 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/CStage貍泌・冗判髱「蜈ア騾.cs @@ -0,0 +1,4893 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Drawing; +using System.Diagnostics; +using FDK; +using FDK.ExtensionMethods; +using TJAPlayer3; +using System.Linq; + +namespace TJAPlayer3 +{ + /// + /// 貍泌・冗判髱「縺ョ蜈ア騾壹け繝ゥ繧ケ (繝峨Λ繝貍泌・冗判髱「, 繧ョ繧ソ繝シ貍泌・冗判髱「縺ョ邯呎価蜈) + /// + internal abstract class CStage貍泌・冗判髱「蜈ア騾 : CStage + { + // 繝励Ο繝代ユ繧」 + + // 繝。繧ス繝繝 + + #region [ t貍泌・冗オ先棡繧呈シ邏阪☆繧祇繝峨Λ繝() ] + public void t貍泌・冗オ先棡繧呈シ邏阪☆繧祇繝峨Λ繝( out CScoreIni.C貍泌・剰ィ倬鹸 Drums ) + { + Drums = new CScoreIni.C貍泌・剰ィ倬鹸(); + + //if ( ) + { + Drums.n繧ケ繧ウ繧「 = (long) this.actScore.Get( E讌ス蝎ィ繝代シ繝.DRUMS, 0 ); + Drums.db繧イ繝シ繝蝙九せ繧ュ繝ォ蛟、 = CScoreIni.t繧イ繝シ繝蝙九せ繧ュ繝ォ繧定ィ育ョ励@縺ヲ霑斐☆(TJAPlayer3.DTX.LEVEL.Drums, TJAPlayer3.DTX.n蜿ッ隕悶メ繝繝玲焚.Drums, this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Perfect, this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.譛鬮伜、[0], E讌ス蝎ィ繝代シ繝.DRUMS, bIsAutoPlay); + Drums.db貍泌・丞梛繧ケ繧ュ繝ォ蛟、 = CScoreIni.t貍泌・丞梛繧ケ繧ュ繝ォ繧定ィ育ョ励@縺ヲ霑斐☆( TJAPlayer3.DTX.n蜿ッ隕悶メ繝繝玲焚.Drums, this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Perfect, this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Great, this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Good, this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Poor, this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Miss, E讌ス蝎ィ繝代シ繝.DRUMS, bIsAutoPlay ); + Drums.nPerfect謨ー = TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay ? this.n繝偵ャ繝域焚_Auto蜷ォ繧.Drums.Perfect : this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Perfect; + Drums.nGreat謨ー = TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay ? this.n繝偵ャ繝域焚_Auto蜷ォ繧.Drums.Great : this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Great; + Drums.nGood謨ー = TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay ? this.n繝偵ャ繝域焚_Auto蜷ォ繧.Drums.Good : this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Good; + Drums.nPoor謨ー = TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay ? this.n繝偵ャ繝域焚_Auto蜷ォ繧.Drums.Poor : this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Poor; + Drums.nMiss謨ー = TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay ? this.n繝偵ャ繝域焚_Auto蜷ォ繧.Drums.Miss : this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Miss; + Drums.nPerfect謨ー_Auto蜷ォ縺セ縺ェ縺 = this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Perfect; + Drums.nGreat謨ー_Auto蜷ォ縺セ縺ェ縺 = this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Great; + Drums.nGood謨ー_Auto蜷ォ縺セ縺ェ縺 = this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Good; + Drums.nPoor謨ー_Auto蜷ォ縺セ縺ェ縺 = this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Poor; + Drums.nMiss謨ー_Auto蜷ォ縺セ縺ェ縺 = this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Miss; + Drums.n騾」謇捺焚 = this.n蜷郁ィ磯」謇捺焚[ 0 ]; + Drums.n譛螟ァ繧ウ繝ウ繝懈焚 = this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.譛鬮伜、[0]; + Drums.n蜈ィ繝√ャ繝玲焚 = TJAPlayer3.DTX.n蜿ッ隕悶メ繝繝玲焚.Drums; + for ( int i = 0; i < (int) E繝ャ繝シ繝ウ.MAX; i++ ) + { + Drums.bAutoPlay[ i ] = bIsAutoPlay[ i ]; + } + Drums.bTight = TJAPlayer3.ConfigIni.bTight; + for ( int i = 0; i < 3; i++ ) + { + Drums.bSudden[ i ] = TJAPlayer3.ConfigIni.bSudden[ i ]; + Drums.bHidden[ i ] = TJAPlayer3.ConfigIni.bHidden[ i ]; + Drums.eInvisible[ i ] = TJAPlayer3.ConfigIni.eInvisible[ i ]; + Drums.bReverse[ i ] = TJAPlayer3.ConfigIni.bReverse[ i ]; + Drums.eRandom[ i ] = TJAPlayer3.ConfigIni.eRandom[ i ]; + Drums.bLight[ i ] = TJAPlayer3.ConfigIni.bLight[ i ]; + Drums.bLeft[ i ] = TJAPlayer3.ConfigIni.bLeft[ i ]; + Drums.f隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ i ] = ( (float) ( TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ i ] + 1 ) ) * 0.5f; + } + Drums.eDark = TJAPlayer3.ConfigIni.eDark; + Drums.n貍泌・城溷コヲ蛻蟄 = TJAPlayer3.ConfigIni.n貍泌・城溷コヲ; + Drums.n貍泌・城溷コヲ蛻豈 = 20; + Drums.bSTAGEFAILED譛牙柑 = TJAPlayer3.ConfigIni.bSTAGEFAILED譛牙柑; + Drums.e繝繝。繝シ繧ク繝ャ繝吶Ν = TJAPlayer3.ConfigIni.e繝繝。繝シ繧ク繝ャ繝吶Ν; + Drums.b貍泌・上↓繧ュ繝シ繝懊シ繝峨r菴ソ逕ィ縺励◆ = this.b貍泌・上↓繧ュ繝シ繝懊シ繝峨r菴ソ縺」縺; + Drums.b貍泌・上↓MIDI蜈・蜉帙r菴ソ逕ィ縺励◆ = this.b貍泌・上↓MIDI蜈・蜉帙r菴ソ縺」縺; + Drums.b貍泌・上↓繧ク繝ァ繧、繝代ャ繝峨r菴ソ逕ィ縺励◆ = this.b貍泌・上↓繧ク繝ァ繧、繝代ャ繝峨r菴ソ縺」縺; + Drums.b貍泌・上↓繝槭え繧ケ繧剃スソ逕ィ縺励◆ = this.b貍泌・上↓繝槭え繧ケ繧剃スソ縺」縺; + Drums.nPerfect縺ォ縺ェ繧狗ッ蝗イms = TJAPlayer3.nPerfect遽蝗イms; + Drums.nGreat縺ォ縺ェ繧狗ッ蝗イms = TJAPlayer3.nGreat遽蝗イms; + Drums.nGood縺ォ縺ェ繧狗ッ蝗イms = TJAPlayer3.nGood遽蝗イms; + Drums.nPoor縺ォ縺ェ繧狗ッ蝗イms = TJAPlayer3.nPoor遽蝗イms; + Drums.strDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ = TJAPlayer3.VERSION; + Drums.譛邨よ峩譁ー譌・譎 = DateTime.Now.ToString(); + Drums.Hash = CScoreIni.t貍泌・上そ繧ッ繧キ繝ァ繝ウ縺ョMD5繧呈アゅa縺ヲ霑斐☆( Drums ); + Drums.f繧イ繝シ繧ク = (float)this.actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[ 0 ]; + if( !TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay ) + { + Drums.n繝上う繧ケ繧ウ繧「 = TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝上う繧ケ繧ウ繧「; //2015.06.16 kairera0467 莉夜屮譏灘コヲ縺ョ荳頑嶌縺埼亟豁「縲 + if( TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繝上う繧ケ繧ウ繧「[ TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]] < (int)this.actScore.Get( E讌ス蝎ィ繝代シ繝.DRUMS, 0 ) ) + Drums.n繝上う繧ケ繧ウ繧「[ TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]] = (int)this.actScore.Get( E讌ス蝎ィ繝代シ繝.DRUMS, 0 ); + } + var danC = TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actDan.GetExam(); + for (int i = 0; i < danC.Length; i++) + { + Drums.Dan_C[i] = danC[i]; + } + } + } + #endregion + #region [ t貍泌・冗オ先棡繧呈シ邏阪☆繧祇螟ェ鮠() ] + public void t貍泌・冗オ先棡繧呈シ邏阪☆繧祇螟ェ鮠( out CScoreIni.C貍泌・剰ィ倬鹸 Drums ) + { + Drums = new CScoreIni.C貍泌・剰ィ倬鹸(); + + //if ( CDTXMania.DTX.b繝√ャ繝励′縺ゅk.Drums ) + { + Drums.n繧ケ繧ウ繧「 = (long) this.actScore.Get( E讌ス蝎ィ繝代シ繝.DRUMS, 0 ); + Drums.db繧イ繝シ繝蝙九せ繧ュ繝ォ蛟、 = CScoreIni.t繧イ繝シ繝蝙九せ繧ュ繝ォ繧定ィ育ョ励@縺ヲ霑斐☆( TJAPlayer3.DTX.LEVEL.Drums, TJAPlayer3.DTX.n蜿ッ隕悶メ繝繝玲焚.Drums, this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Perfect, this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.P2, E讌ス蝎ィ繝代シ繝.DRUMS, bIsAutoPlay ); + Drums.db貍泌・丞梛繧ケ繧ュ繝ォ蛟、 = CScoreIni.t貍泌・丞梛繧ケ繧ュ繝ォ繧定ィ育ョ励@縺ヲ霑斐☆( TJAPlayer3.DTX.n蜿ッ隕悶メ繝繝玲焚.Drums, this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Perfect, this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Great, this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Good, this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Poor, this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Miss, E讌ス蝎ィ繝代シ繝.DRUMS, bIsAutoPlay ); + Drums.nPerfect謨ー = this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Taiko.Perfect; + Drums.nGreat謨ー = this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Taiko.Great; + Drums.nGood謨ー = this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Taiko.Good; + Drums.nPoor謨ー = this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Taiko.Poor; + Drums.nMiss謨ー = this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Taiko.Miss; + Drums.nPerfect謨ー_Auto蜷ォ縺セ縺ェ縺 = this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Taiko.Perfect; + Drums.nGreat謨ー_Auto蜷ォ縺セ縺ェ縺 = this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Taiko.Great; + Drums.nGood謨ー_Auto蜷ォ縺セ縺ェ縺 = this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Taiko.Good; + Drums.nPoor謨ー_Auto蜷ォ縺セ縺ェ縺 = this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Taiko.Poor; + Drums.nMiss謨ー_Auto蜷ォ縺セ縺ェ縺 = this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Taiko.Miss; + Drums.n騾」謇捺焚 = this.n蜷郁ィ磯」謇捺焚[ 0 ]; + Drums.n譛螟ァ繧ウ繝ウ繝懈焚 = this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.P2; + Drums.n蜈ィ繝√ャ繝玲焚 = TJAPlayer3.DTX.n繝弱シ繝謨ー[ 3 ]; + for ( int i = 0; i < (int) E繝ャ繝シ繝ウ.MAX; i++ ) + { + Drums.bAutoPlay[ i ] = TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay; + } + Drums.bTight = TJAPlayer3.ConfigIni.bTight; + for ( int i = 0; i < 3; i++ ) + { + Drums.bSudden[ i ] = TJAPlayer3.ConfigIni.bSudden[ i ]; + Drums.bHidden[ i ] = TJAPlayer3.ConfigIni.bHidden[ i ]; + Drums.eInvisible[ i ] = TJAPlayer3.ConfigIni.eInvisible[ i ]; + Drums.bReverse[ i ] = TJAPlayer3.ConfigIni.bReverse[ i ]; + Drums.eRandom[ i ] = TJAPlayer3.ConfigIni.eRandom[ i ]; + Drums.bLight[ i ] = TJAPlayer3.ConfigIni.bLight[ i ]; + Drums.bLeft[ i ] = TJAPlayer3.ConfigIni.bLeft[ i ]; + Drums.f隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ i ] = ( (float) ( TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ i ] + 1 ) ) * 0.5f; + } + Drums.eDark = TJAPlayer3.ConfigIni.eDark; + Drums.n貍泌・城溷コヲ蛻蟄 = TJAPlayer3.ConfigIni.n貍泌・城溷コヲ; + Drums.n貍泌・城溷コヲ蛻豈 = 20; + Drums.bSTAGEFAILED譛牙柑 = TJAPlayer3.ConfigIni.bSTAGEFAILED譛牙柑; + Drums.e繝繝。繝シ繧ク繝ャ繝吶Ν = TJAPlayer3.ConfigIni.e繝繝。繝シ繧ク繝ャ繝吶Ν; + Drums.b貍泌・上↓繧ュ繝シ繝懊シ繝峨r菴ソ逕ィ縺励◆ = this.b貍泌・上↓繧ュ繝シ繝懊シ繝峨r菴ソ縺」縺; + Drums.b貍泌・上↓MIDI蜈・蜉帙r菴ソ逕ィ縺励◆ = this.b貍泌・上↓MIDI蜈・蜉帙r菴ソ縺」縺; + Drums.b貍泌・上↓繧ク繝ァ繧、繝代ャ繝峨r菴ソ逕ィ縺励◆ = this.b貍泌・上↓繧ク繝ァ繧、繝代ャ繝峨r菴ソ縺」縺; + Drums.b貍泌・上↓繝槭え繧ケ繧剃スソ逕ィ縺励◆ = this.b貍泌・上↓繝槭え繧ケ繧剃スソ縺」縺; + Drums.nPerfect縺ォ縺ェ繧狗ッ蝗イms = TJAPlayer3.nPerfect遽蝗イms; + Drums.nGreat縺ォ縺ェ繧狗ッ蝗イms = TJAPlayer3.nGreat遽蝗イms; + Drums.nGood縺ォ縺ェ繧狗ッ蝗イms = TJAPlayer3.nGood遽蝗イms; + Drums.nPoor縺ォ縺ェ繧狗ッ蝗イms = TJAPlayer3.nPoor遽蝗イms; + Drums.strDTXMania縺ョ繝舌シ繧ク繝ァ繝ウ = TJAPlayer3.VERSION; + Drums.譛邨よ峩譁ー譌・譎 = DateTime.Now.ToString(); + Drums.Hash = CScoreIni.t貍泌・上そ繧ッ繧キ繝ァ繝ウ縺ョMD5繧呈アゅa縺ヲ霑斐☆( Drums ); + Drums.f繧イ繝シ繧ク = (float)this.actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[ 0 ]; + } + } + #endregion + + // CStage 螳溯」 + + public int[] nNoteCount = new int[2]; + public int[] nBalloonCount = new int[2]; + public double[] nAddScoreNiji = new double[2]; + + public override void On豢サ諤ァ蛹() + { + listChip = new List[ 4 ]; + for( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) + { + switch( i ) + { + case 0: + listChip[i] = TJAPlayer3.DTX.listChip; + break; + case 1: + listChip[i] = TJAPlayer3.DTX_2P.listChip; + break; + } + + int n謨エ謨ー蛟、邂。逅 = 0; + if (r謖螳壽凾蛻サ縺ォ荳逡ェ霑代>譛ェ繝偵ャ繝Chip繧帝℃蜴サ譁ケ蜷大━蜈医〒讀懃エ「縺吶k(0, i) != null) //2020.07.08 Mr-Ojii 譛ェ繝偵ャ繝医メ繝繝励′縺ェ縺縺ィ縺阪ョ萓句、悶ョ逋コ逕溷屓驕ソ <-(KabanFriends)繧ウ繝シ繝牙溘j縺セ縺励◆縺斐a繧薙↑縺輔>(ツエ繝サマ峨サ`) + { + foreach (CDTX.CChip chip in listChip[i]) + { + chip.nList荳翫ョ菴咲スョ = n謨エ謨ー蛟、邂。逅; + if ((chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15 || chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x16) && (n謨エ謨ー蛟、邂。逅 < this.listChip[i].Count - 1)) + { + if (chip.db逋コ螢ー譎ょ綾ms < r謖螳壽凾蛻サ縺ォ荳逡ェ霑代>譛ェ繝偵ャ繝Chip繧帝℃蜴サ譁ケ蜷大━蜈医〒讀懃エ「縺吶k(0, i).db逋コ螢ー譎ょ綾ms) + { + chip.n謠冗判蜆ェ蜈亥コヲ = 1; + } + } + n謨エ謨ー蛟、邂。逅++; + } + } + } + + if(TJAPlayer3.DTX.b繝√ャ繝励′縺ゅk.Branch) + { + for (int i = 0; i < TJAPlayer3.DTX.listChip_Branch[2].Count; i++) + { + nNoteCount[0] = TJAPlayer3.DTX.listChip_Branch[2].Where(num => num.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ > 16 && num.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 21).Count(); + nBalloonCount[0] += TJAPlayer3.DTX.listChip_Branch[2][i].nRollCount; + } + } + else + { + for (int i = 0; i < TJAPlayer3.DTX.listChip.Count; i++) + { + nNoteCount[0] = TJAPlayer3.DTX.listChip.Where(num => num.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ > 16 && num.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 21).Count(); + nBalloonCount[0] += TJAPlayer3.DTX.listChip[i].nRollCount; + } + } + + //nAddScoreNiji = (1000000 - (15 * RollTimems * 100) - (nBalloonCount * 100)) / TJAPlayer3.DTX.listChip.Count; + if(nNoteCount[0] == 0 && nBalloonCount[0] == 0) + { + nAddScoreNiji[0] = 1000000; + } + else + { + nAddScoreNiji[0] = (double)Math.Ceiling((decimal)(1000000 - (nBalloonCount[0] * 100)) / nNoteCount[0] / 10) * 10; + } + + if(TJAPlayer3.ConfigIni.nPlayerCount == 2) + { + if (TJAPlayer3.DTX.b繝√ャ繝励′縺ゅk.Branch) + { + for (int i = 0; i < TJAPlayer3.DTX_2P.listChip_Branch[2].Count; i++) + { + nNoteCount[1] = TJAPlayer3.DTX_2P.listChip_Branch[2].Where(num => num.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ > 16 && num.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 21).Count(); + nBalloonCount[1] += TJAPlayer3.DTX_2P.listChip_Branch[2][i].nRollCount; + } + } + else + { + for (int i = 0; i < TJAPlayer3.DTX_2P.listChip.Count; i++) + { + nNoteCount[1] = TJAPlayer3.DTX_2P.listChip.Where(num => num.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ > 16 && num.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 21).Count(); + nBalloonCount[1] += TJAPlayer3.DTX_2P.listChip[i].nRollCount; + } + } + + //nAddScoreNiji = (1000000 - (15 * RollTimems * 100) - (nBalloonCount * 100)) / TJAPlayer3.DTX.listChip.Count; + if (nNoteCount[1] == 0 && nBalloonCount[1] == 0) + { + nAddScoreNiji[1] = 1000000; + } + else + { + nAddScoreNiji[1] = (double)Math.Ceiling((decimal)(1000000 - (nBalloonCount[1] * 100)) / nNoteCount[1] / 10) * 10; + } + } + + for (int index = TJAPlayer3.DTX.listChip.Count - 1; index >= 0; index--) + { + if (TJAPlayer3.DTX.listChip[index].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01) + { + this.bgmlength = TJAPlayer3.DTX.listChip[index].GetDuration() + TJAPlayer3.DTX.listChip[index].n逋コ螢ー譎ょ綾ms; + break; + } + } + + ctChipAnime = new CCounter[2]; + ctChipAnimeLag = new CCounter[2]; + for (int i = 0; i < 2; i++) + { + ctChipAnime[i] = new CCounter(); + ctChipAnimeLag[i] = new CCounter(); + } + + listWAV = TJAPlayer3.DTX.listWAV; + + this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、 = E貍泌・冗判髱「縺ョ謌サ繧雁、.邯咏カ; + this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip = ( listChip[0].Count > 0 ) ? 0 : -1; + this.L譛蠕後↓蜀咲函縺励◆HH縺ョ螳欷AV逡ェ蜿キ = new List( 16 ); + this.n譛蠕後↓蜀咲函縺励◆HH縺ョ繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0; + this.n譛蠕後↓蜀咲函縺励◆螳欷AV逡ェ蜿キ.Guitar = -1; + this.n譛蠕後↓蜀咲函縺励◆螳欷AV逡ェ蜿キ.Bass = -1; + for ( int i = 0; i < 50; i++ ) + { + this.n譛蠕後↓蜀咲函縺励◆BGM縺ョ螳欷AV逡ェ蜿キ[ i ] = -1; + } + + cInvisibleChip = new CInvisibleChip( TJAPlayer3.ConfigIni.nDisplayTimesMs, TJAPlayer3.ConfigIni.nFadeoutTimeMs ); + this.貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓 = new C貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓吝ア騾(); + for ( int k = 0; k < 4; k++ ) + { + //for ( int n = 0; n < 5; n++ ) + //{ + this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺Ъ k ] = new CHITCOUNTOFRANK(); + this.n繝偵ャ繝域焚_Auto蜷ォ繧[ k ] = new CHITCOUNTOFRANK(); + //} + this.queWailing[ k ] = new Queue(); + this.r迴セ蝨ィ縺ョ豁灘」ーChip[ k ] = null; + cInvisibleChip.eInvisibleMode[ k ] = TJAPlayer3.ConfigIni.eInvisible[ k ]; + if ( TJAPlayer3.DTXVmode.Enabled ) + { + TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ k ] = TJAPlayer3.ConfigIni.nViewerScrollSpeed[ k ]; + } + + //this.nJudgeLinePosY_delta[ k ] = CDTXMania.ConfigIni.nJudgeLinePosOffset[ k ]; // #31602 2013.6.23 yyagi + + this.貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓.n蛻、螳壻ス咲スョ[ k ] = TJAPlayer3.ConfigIni.e蛻、螳壻ス咲スョ[ k ]; + this.貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓.nJudgeLinePosY_delta[ k ] = TJAPlayer3.ConfigIni.nJudgeLinePosOffset[ k ]; + this.bReverse[ k ] = TJAPlayer3.ConfigIni.bReverse[ k ]; // + + } + actCombo.貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓 = 貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓; + + this.b貍泌・上↓繧ュ繝シ繝懊シ繝峨r菴ソ縺」縺 = false; + this.b貍泌・上↓繧ク繝ァ繧、繝代ャ繝峨r菴ソ縺」縺 = false; + this.b貍泌・上↓MIDI蜈・蜉帙r菴ソ縺」縺 = false; + this.b貍泌・上↓繝槭え繧ケ繧剃スソ縺」縺 = false; + + cInvisibleChip.Reset(); + base.On豢サ諤ァ蛹(); + this.t繧ケ繝繝シ繧ソ繧ケ繝代ロ繝ォ縺ョ驕ク謚(); + this.t繝代ロ繝ォ譁蟄怜励ョ險ュ螳(); + //this.貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓(); + this.bIsGOGOTIME = new bool[]{ false, false, false, false }; + this.bUseBranch = new bool[]{ false, false, false, false }; + this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = new CDTX.ECourse[4]; + this.n谺。蝗槭ョ繧ウ繝シ繧ケ = new CDTX.ECourse[4]; + for (int i = 0; i < 2; i++) + { + this.b蠑キ蛻カ逧縺ォ蛻蟯舌&縺帙◆[i] = false; + + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actMtaiko.After[i] = CDTX.ECourse.eNormal; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.stBranch[i].nAfter = CDTX.ECourse.eNormal; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actMtaiko.Before[i] = CDTX.ECourse.eNormal; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.stBranch[i].nBefore = CDTX.ECourse.eNormal; + } + for (int i = 0; i < CBranchScore.Length; i++) + { + this.CBranchScore[i] = new CBRANCHSCORE(); + + //螟ァ髻ウ隨ヲ蛻蟯先凾縺ョ諠蝣ア繧偵∪縺ィ繧√k縺溘a + this.CBranchScore[i].cBigNotes = new CBRANCHSCORE(); + } + this.n繝ャ繝シ繝ウ逕ィ陦ィ遉コ繧ウ繝シ繧ケ = new CDTX.ECourse[4]; + this.b騾」謇謎クュ = new bool[] { false, false, false, false }; + this.n迴セ蝨ィ縺ョ騾」謇捺焚 = new int[]{ 0, 0, 0, 0 }; + this.n蜷郁ィ磯」謇捺焚 = new int[]{ 0, 0, 0, 0 }; + this.n蛻蟯舌@縺溷屓謨ー = new int[ 4 ]; + for (int i = 0; i < 2; i++) + { + ShownLyric[i] = 0; + } + this.nJPOSSCROLL = new int[ 4 ]; + this.bLEVELHOLD = new bool[]{ false, false, false, false }; + + this.bDoublePlay = TJAPlayer3.ConfigIni.nPlayerCount >= 2 ? true : false; + + this.nLoopCount_Clear = 1; + + this.tBranchReset(0); + + this.bIsAutoPlay = TJAPlayer3.ConfigIni.bAutoPlay; // #24239 2011.1.23 yyagi + + //this.bIsAutoPlay.Guitar = CDTXMania.ConfigIni.b繧ョ繧ソ繝シ縺悟ィ驛ィ繧ェ繝シ繝医励Ξ繧、縺ァ縺ゅk; + //this.bIsAutoPlay.Bass = CDTXMania.ConfigIni.b繝吶シ繧ケ縺悟ィ驛ィ繧ェ繝シ繝医励Ξ繧、縺ァ縺ゅk; + // this.nRisky = CDTXMania.ConfigIni.nRisky; // #23559 2011.7.28 yyagi + actGauge.Init( TJAPlayer3.ConfigIni.nRisky, 0 ); // #23559 2011.7.28 yyagi + if(bDoublePlay) actGauge.Init( TJAPlayer3.ConfigIni.nRisky, 1 ); // #23559 2011.7.28 yyagi + this.nPolyphonicSounds = TJAPlayer3.ConfigIni.nPoliphonicSounds; + e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ = TJAPlayer3.ConfigIni.e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ; + + TJAPlayer3.Skin.tRemoveMixerAll(); // 蜉ケ譫憺浹縺ョ繧ケ繝医Μ繝シ繝繧偵Α繧ュ繧オ繝シ縺九i隗」髯、縺励※縺翫¥ + + queueMixerSound = new Queue( 64 ); + bIsDirectSound = ( TJAPlayer3.Sound邂。逅.GetCurrentSoundDeviceType() == "DirectSound" ); + bUseOSTimer = TJAPlayer3.ConfigIni.bUseOSTimer; + this.bPAUSE = false; + if ( TJAPlayer3.DTXVmode.Enabled ) + { + db蜀咲函騾溷コヲ = TJAPlayer3.DTX.dbDTXVPlaySpeed; + TJAPlayer3.ConfigIni.n貍泌・城溷コヲ = (int) (TJAPlayer3.DTX.dbDTXVPlaySpeed * 20 + 0.5 ); + } + else + { + db蜀咲函騾溷コヲ = ( (double) TJAPlayer3.ConfigIni.n貍泌・城溷コヲ ) / 20.0; + } + bValidScore = ( TJAPlayer3.DTXVmode.Enabled ) ? false : true; + + #region [ 貍泌・城幕蟋句燕縺ォmixer逋サ骭イ縺励※縺翫¥縺ケ縺阪し繧ヲ繝ウ繝(髢句ケ輔@縺ヲ縺吶$縺ォ魑エ繧峨☆縺薙→縺ォ縺ェ繧九メ繝繝鈴浹)繧堤匳骭イ縺励※縺翫¥ ] + foreach ( CDTX.CChip pChip in listChip[0] ) + { +// Debug.WriteLine( "CH=" + pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ.ToString( "x2" ) + ", 謨エ謨ー蛟、=" + pChip.n謨エ謨ー蛟、 + ", time=" + pChip.n逋コ螢ー譎ょ綾ms ); + if ( pChip.n逋コ螢ー譎ょ綾ms <= 0 ) + { + if ( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0xDA ) + { + pChip.bHit = true; +// Trace.TraceInformation( "first [DA] BAR=" + pChip.n逋コ螢ー菴咲スョ / 384 + " ch=" + pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ.ToString( "x2" ) + ", wav=" + pChip.n謨エ謨ー蛟、 + ", time=" + pChip.n逋コ螢ー譎ょ綾ms ); + if ( listWAV.TryGetValue( pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, out CDTX.CWAV wc ) ) + { + for ( int i = 0; i < nPolyphonicSounds; i++ ) + { + if ( wc.rSound[ i ] != null ) + { + TJAPlayer3.Sound邂。逅.AddMixer( wc.rSound[ i ], db蜀咲函騾溷コヲ, pChip.b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk ); + //AddMixer( wc.rSound[ i ] ); // 譛蛻昴ッqueue繧剃サ九&縺夂峩謗・繝溘く繧オ繝シ逋サ骭イ縺吶k + } + } + } + } + } + else + { + break; + } + } + #endregion + + if(TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan) + { + n濶ッ = new int[TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs.Count]; + n蜿ッ = new int[TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs.Count]; + n荳榊庄 = new int[TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs.Count]; + n騾」謇 = new int[TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs.Count]; + } + + + this.sw = new Stopwatch(); + // this.sw2 = new Stopwatch(); + // this.gclatencymode = GCSettings.LatencyMode; + // GCSettings.LatencyMode = GCLatencyMode.Batch; // 貍泌・冗判髱「荳ュ縺ッGC繧呈椛豁「縺吶k + this.bIsAlreadyCleared = new bool[2]; + this.bIsAlreadyMaxed = new bool[2]; + + this.ListDan_Number = 0; + this.IsDanFailed = false; + } + public override void On髱樊エサ諤ァ蛹() + { + this.bgmlength = 1; + this.L譛蠕後↓蜀咲函縺励◆HH縺ョ螳欷AV逡ェ蜿キ.Clear(); // #23921 2011.1.4 yyagi + this.L譛蠕後↓蜀咲函縺励◆HH縺ョ螳欷AV逡ェ蜿キ = null; // + this.ct繝√ャ繝玲ィ。讒倥い繝九Γ.Drums = null; + this.ct繝√ャ繝玲ィ。讒倥い繝九Γ.Guitar = null; + this.ct繝√ャ繝玲ィ。讒倥い繝九Γ.Bass = null; + this.ct繝√ャ繝玲ィ。讒倥い繝九Γ.Taiko = null; + + for (int i = 0; i < 2; i++) + { + ctChipAnime[i] = null; + ctChipAnimeLag[i] = null; + } + + listWAV.Clear(); + listWAV = null; + listChip = null; + queueMixerSound.Clear(); + queueMixerSound = null; + cInvisibleChip.Dispose(); + cInvisibleChip = null; +// GCSettings.LatencyMode = this.gclatencymode; + + var meanLag = CLagLogger.LogAndReturnMeanLag(); + + if (TJAPlayer3.IsPerformingCalibration && meanLag != null) + { + var oldInputAdjustTimeMs = TJAPlayer3.ConfigIni.nInputAdjustTimeMs; + var newInputAdjustTimeMs = oldInputAdjustTimeMs - (int) Math.Round(meanLag.Value); + Trace.TraceInformation($"Calibration complete. Updating InputAdjustTime from {oldInputAdjustTimeMs}ms to {newInputAdjustTimeMs}ms."); + TJAPlayer3.ConfigIni.nInputAdjustTimeMs = newInputAdjustTimeMs; + } + this.actDan.IsAnimating = false;// IsAnimating=true縺ョ縺ィ縺阪↓縺昴ョ縺セ縺セ驕ク譖イ逕サ髱「縺ォ謌サ繧九→縲∵枚蟄怜励′謠冗判縺輔l縺ェ縺蝠城。御ソョ豁」逕ィ縲 + + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if ( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + this.t閭梧勹繝繧ッ繧ケ繝√Ε縺ョ逕滓(); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if ( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx閭梧勹 ); + Trace.TraceInformation("CStage貍泌・冗判髱「蜈ア騾 繝ェ繧ス繝シ繧ケ縺ョ髢区叛"); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + + // 縺昴ョ莉 + + #region [ protected ] + //----------------- + public class CHITCOUNTOFRANK + { + // Fields + public int Good; + public int Great; + public int Miss; + public int Perfect; + public int Poor; + + // Properties + public int this[ int index ] + { + get + { + switch ( index ) + { + case 0: + return this.Perfect; + + case 1: + return this.Great; + + case 2: + return this.Good; + + case 3: + return this.Poor; + + case 4: + return this.Miss; + } + throw new IndexOutOfRangeException(); + } + set + { + switch ( index ) + { + case 0: + this.Perfect = value; + return; + + case 1: + this.Great = value; + return; + + case 2: + this.Good = value; + return; + + case 3: + this.Poor = value; + return; + + case 4: + this.Miss = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + + [StructLayout( LayoutKind.Sequential )] + protected struct STKARAUCHI + { + public CDTX.CChip HH; + public CDTX.CChip SD; + public CDTX.CChip BD; + public CDTX.CChip HT; + public CDTX.CChip LT; + public CDTX.CChip FT; + public CDTX.CChip CY; + public CDTX.CChip HHO; + public CDTX.CChip RD; + public CDTX.CChip LC; + public CDTX.CChip LP; + public CDTX.CChip LBD; + public CDTX.CChip this[ int index ] + { + get + { + switch ( index ) + { + case 0: + return this.HH; + + case 1: + return this.SD; + + case 2: + return this.BD; + + case 3: + return this.HT; + + case 4: + return this.LT; + + case 5: + return this.FT; + + case 6: + return this.CY; + + case 7: + return this.HHO; + + case 8: + return this.RD; + + case 9: + return this.LC; + + case 10: + return this.LP; + + case 11: + return this.LBD; + } + throw new IndexOutOfRangeException(); + } + set + { + switch ( index ) + { + case 0: + this.HH = value; + return; + + case 1: + this.SD = value; + return; + + case 2: + this.BD = value; + return; + + case 3: + this.HT = value; + return; + + case 4: + this.LT = value; + return; + + case 5: + this.FT = value; + return; + + case 6: + this.CY = value; + return; + + case 7: + this.HHO = value; + return; + + case 8: + this.RD = value; + return; + + case 9: + this.LC = value; + return; + + case 10: + this.LP = value; + return; + } + throw new IndexOutOfRangeException(); + } + } + } + + protected struct stmixer + { + internal bool bIsAdd; + internal CSound csound; + internal bool b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk; + }; + + /// + /// 蛻蟯千畑縺ョ繧ケ繧ウ繧「繧偵∪縺ィ繧√k繧ッ繝ゥ繧ケ縲 + /// .2020.04.21.akasoko26 + /// + public class CBRANCHSCORE + { + public CBRANCHSCORE cBigNotes;//螟ァ髻ウ隨ヲ蛻蟯先凾縺ョ諠蝣ア繧偵∪縺ィ繧√k縺溘a + public int nRoll; + public int nGreat; + public int nGood; + public int nMiss; + public int nScore; + } + + public CAct貍泌・就VI actAVI; + public Rainbow Rainbow; + protected CAct貍泌・上メ繝繝励ヵ繧。繧、繧「GB actChipFireGB; + public CAct貍泌・修ombo蜈ア騾 actCombo; + protected CAct貍泌・愁anger蜈ア騾 actDANGER; + //protected CActFIFOBlack actFI; + public CActFIFOStart actFI; + protected CActFIFOBlack actFO; + protected CActFIFOResult actFOClear; + public CAct貍泌・上ご繝シ繧ク蜈ア騾 actGauge; + + public CAct貍泌・愁rumsDancer actDancer; + protected CAct貍泌・愁rums蛻、螳壽枚蟄怜 actJudgeString; + public TaikoLaneFlash actTaikoLaneFlash; + protected CAct貍泌・上Ξ繝シ繝ウ繝輔Λ繝繧キ繝・GB蜈ア騾 actLaneFlushGB; + public CAct貍泌・上ヱ繝阪Ν譁蟄怜 actPanel; + public CAct貍泌・乗シ泌・乗ュ蝣ア actPlayInfo; + public CAct貍泌・上せ繧ウ繧「蜈ア騾 actScore; + public CAct貍泌・上せ繝繝シ繧ク螟ア謨 actStageFailed; + protected CAct貍泌・上せ繝繝シ繧ソ繧ケ繝代ロ繝ォ蜈ア騾 actStatusPanels; + protected CAct貍泌・上せ繧ッ繝ュ繝シ繝ォ騾溷コヲ act隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ; + public C貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓吝ア騾 貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓; + protected CAct貍泌・愁rums騾」謇 actRoll; + protected CAct貍泌・愁rums鬚ィ闊ケ actBalloon; + public CAct貍泌・愁rums繧ュ繝」繝ゥ繧ッ繧ソ繝シ actChara; + protected CAct貍泌・愁rums騾」謇薙く繝」繝ゥ actRollChara; + protected CAct貍泌・愁rums繧ウ繝ウ繝懷聖縺榊コ縺 actComboBalloon; + protected CAct貍泌・修ombo髻ウ螢ー actComboVoice; + protected CAct貍泌・襲auseMenu actPauseMenu; + public CAct貍泌・愁rums繝√ャ繝励お繝輔ぉ繧ッ繝 actChipEffects; + public CAct貍泌・愁rumsFooter actFooter; + public CAct貍泌・愁rumsMob actMob; + public Dan_Cert actDan; + public CAct貍泌・愁rums迚ケ險薙Δ繝シ繝 actTokkun; + public bool bPAUSE; + public bool[] bIsAlreadyCleared; + public bool[] bIsAlreadyMaxed; + protected bool b貍泌・上↓MIDI蜈・蜉帙r菴ソ縺」縺; + protected bool b貍泌・上↓繧ュ繝シ繝懊シ繝峨r菴ソ縺」縺; + protected bool b貍泌・上↓繧ク繝ァ繧、繝代ャ繝峨r菴ソ縺」縺; + protected bool b貍泌・上↓繝槭え繧ケ繧剃スソ縺」縺; + protected STDGBVALUE ct繝√ャ繝玲ィ。讒倥い繝九Γ; + public CCounter[] ctChipAnime; + public CCounter[] ctChipAnimeLag; + private int bgmlength = 1; + + protected E貍泌・冗判髱「縺ョ謌サ繧雁、 e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、; + protected readonly int[] n繝√Ε繝ウ繝阪Ν0Ato繝代ャ繝08 = new int[] { 1, 2, 3, 4, 5, 7, 6, 1, 8, 0, 9, 9 }; + protected readonly int[] n繝√Ε繝ウ繝阪Ν0Ato繝ャ繝シ繝ウ07 = new int[] { 1, 2, 3, 4, 5, 7, 6, 1, 9, 0, 8, 8 }; + // RD LC LP RD + protected readonly int[] n繝代ャ繝0Ato繝√Ε繝ウ繝阪Ν0A = new int[] { 0x11, 0x12, 0x13, 0x14, 0x15, 0x17, 0x16, 0x18, 0x19, 0x1a, 0x1b, 0x1c }; + protected readonly int[] n繝代ャ繝0Ato繝代ャ繝08 = new int[] { 1, 2, 3, 4, 5, 6, 7, 1, 8, 0, 9, 9 };// 繝代ャ繝臥判蜒上ョ繝偵ャ繝亥ヲ逅逕ィ + // HH SD BD HT LT FT CY HHO RD LC LP LBD + protected readonly int[] n繝代ャ繝0Ato繝ャ繝シ繝ウ07 = new int[] { 1, 2, 3, 4, 5, 6, 7, 1, 9, 0, 8, 8 }; + public STDGBVALUE n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺; + public STDGBVALUE n繝偵ャ繝域焚_Auto蜷ォ繧; + public int[] n濶ッ; + public int[] n蜿ッ; + public int[] n荳榊庄; + public int[] n騾」謇; + public int n迴セ蝨ィ縺ョ繝医ャ繝佑hip = -1; + protected int[] n譛蠕後↓蜀咲函縺励◆BGM縺ョ螳欷AV逡ェ蜿キ = new int[ 50 ]; + protected int n譛蠕後↓蜀咲函縺励◆HH縺ョ繝√Ε繝ウ繝阪Ν逡ェ蜿キ; + protected List L譛蠕後↓蜀咲函縺励◆HH縺ョ螳欷AV逡ェ蜿キ; // #23921 2011.1.4 yyagi: change "int" to "List", for recording multiple wav No. + protected STLANEVALUE n譛蠕後↓蜀咲函縺励◆螳欷AV逡ェ蜿キ; // #26388 2011.11.8 yyagi: change "n譛蠕後↓蜀咲函縺励◆螳欷AV逡ェ蜿キ.GUITAR" and "n譛蠕後↓蜀咲函縺励◆螳欷AV逡ェ蜿キ.BASS" + // into "n譛蠕後↓蜀咲函縺励◆螳欷AV逡ェ蜿キ"; +// protected int n譛蠕後↓蜀咲函縺励◆螳欷AV逡ェ蜿キ.GUITAR; +// protected int n譛蠕後↓蜀咲函縺励◆螳欷AV逡ェ蜿キ.BASS; + + protected volatile Queue queueMixerSound; // #24820 2013.1.21 yyagi 縺セ縺壹ッ蜊倡エ斐↓Add/Remove繧1蛟九ョ繧ュ繝・繝シ縺ァ縺セ縺ィ繧√※邂。逅縺吶k繧繧頑婿縺ァ險ュ險医☆繧 + protected DateTime dtLastQueueOperation; // + protected bool bIsDirectSound; // + protected double db蜀咲函騾溷コヲ; + protected bool bValidScore; +// protected bool bDTXVmode; + protected STDGBVALUE bReverse; + + protected STDGBVALUE> queWailing; + protected STDGBVALUE r迴セ蝨ィ縺ョ豁灘」ーChip; + protected CTexture tx繝√ャ繝; + protected CTexture tx繝偵ャ繝医ヰ繝シ; + + protected CTexture tx閭梧勹; + + protected STAUTOPLAY bIsAutoPlay; // #24239 2011.1.23 yyagi +// protected int nRisky_InitialVar, nRiskyTime; // #23559 2011.7.28 yyagi 竊 CAct貍泌・上ご繝シ繧ク蜈ア騾壹け繝ゥ繧ケ縺ォ髫阡ス + protected int nPolyphonicSounds; + protected List[] listChip = new List[4]; + protected Dictionary listWAV; + protected CInvisibleChip cInvisibleChip; + protected bool bUseOSTimer; + protected E蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ e蛻、螳夊。ィ遉コ蜆ェ蜈亥コヲ; + + public CBRANCHSCORE[] CBranchScore = new CBRANCHSCORE[6]; + public bool[] bIsGOGOTIME = new bool[4]; + public bool[] bUseBranch = new bool[ 4 ]; + public CDTX.ECourse[] n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ = new CDTX.ECourse[4]; //0:譎ョ騾夊ュ憺擇 1:邇莠コ隴憺擇 2:驕比ココ隴憺擇 + public CDTX.ECourse[] n谺。蝗槭ョ繧ウ繝シ繧ケ = new CDTX.ECourse[4]; + public CDTX.ECourse[] n繝ャ繝シ繝ウ逕ィ陦ィ遉コ繧ウ繝シ繧ケ = new CDTX.ECourse[4]; + protected bool[] b隴憺擇蛻蟯蝉クュ = new bool[] { false, false, false, false }; + protected int[] n蛻蟯舌@縺溷屓謨ー = new int[ 4 ]; + protected int[] nJPOSSCROLL = new int[ 4 ]; + + public bool[] b蠑キ蛻カ逧縺ォ蛻蟯舌&縺帙◆ = new bool[] { false, false, false, false }; + public bool[] bLEVELHOLD = new bool[] { false, false, false, false }; + protected int nListCount; + + private readonly int[] ShownLyric = new int[] { 0, 0 }; + public bool[] b騾」謇謎クュ = new bool[]{ false, false, false, false }; //螂・縺ョ謇 + private int[] n蜷郁ィ磯」謇捺焚 = new int[ 4 ]; + protected int[] n鬚ィ闊ケ谿九j = new int[ 4 ]; + protected int[] n迴セ蝨ィ縺ョ騾」謇捺焚 = new int[ 4 ]; + protected E騾」謇鉄tate eRollState; + + protected int n繧ソ繧、繝樒分蜿キ; + protected int n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ; + + protected int nWaitButton; + + + public CDTX.CChip[] chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝 = new CDTX.CChip[ 4 ]; + + protected const int NOTE_GAP = 25; + public int nLoopCount_Clear; + protected int[] nScore = new int[11]; + protected int[] nHand = new int[4]; + protected CSound soundRed; + protected CSound soundBlue; + protected CSound soundAdlib; + protected CSound soundRed2; + protected CSound soundBlue2; + protected CSound soundAdlib2; + public bool bDoublePlay; // 2016.08.21 kairera0467 陦ィ遉コ縺縺代 + protected Stopwatch sw; // 2011.6.13 譛驕ゥ蛹匁、懆ィ守畑縺ョ繧ケ繝医ャ繝励え繧ゥ繝繝 + public int ListDan_Number; + private bool IsDanFailed; + private bool[] b蠑キ蛻カ蛻蟯占ュ憺擇 = new bool[4]; + private CDTX.E蛻蟯千ィョ鬘 eBranch遞ョ鬘; + public double nBranch譚。莉カ謨ー蛟、A; + public double nBranch譚。莉カ謨ー蛟、B; + private readonly int[] NowProcessingChip = new int[] { 0, 0 }; + + public void AddMixer( CSound cs, bool _b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk ) + { + stmixer stm = new stmixer() + { + bIsAdd = true, + csound = cs, + b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk = _b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk + }; + queueMixerSound.Enqueue( stm ); +// Debug.WriteLine( "笘Queue: add " + Path.GetFileName( stm.csound.str繝輔ぃ繧、繝ォ蜷 )); + } + public void RemoveMixer( CSound cs ) + { + stmixer stm = new stmixer() + { + bIsAdd = false, + csound = cs, + b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk = false + }; + queueMixerSound.Enqueue( stm ); +// Debug.WriteLine( "笘Queue: remove " + Path.GetFileName( stm.csound.str繝輔ぃ繧、繝ォ蜷 )); + } + public void ManageMixerQueue() + { + // 繧ゅ@繧オ繧ヲ繝ウ繝峨ョ逋サ骭イ/蜑企勁縺悟ソ隕√↑繧峨∝ョ溯。後☆繧 + if ( queueMixerSound.Count > 0 ) + { + //Debug.WriteLine( "笘queueLength=" + queueMixerSound.Count ); + DateTime dtnow = DateTime.Now; + TimeSpan ts = dtnow - dtLastQueueOperation; + if ( ts.Milliseconds > 7 ) + { + for ( int i = 0; i < 2 && queueMixerSound.Count > 0; i++ ) + { + dtLastQueueOperation = dtnow; + stmixer stm = queueMixerSound.Dequeue(); + if ( stm.bIsAdd ) + { + TJAPlayer3.Sound邂。逅.AddMixer( stm.csound, db蜀咲函騾溷コヲ, stm.b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk ); + } + else + { + TJAPlayer3.Sound邂。逅.RemoveMixer( stm.csound ); + } + } + } + } + } + + internal E蛻、螳 e謖螳壽凾蛻サ縺九iChip縺ョJUDGE繧定ソ斐☆(long nTime, CDTX.CChip pChip) + { + var e蛻、螳 = e謖螳壽凾蛻サ縺九iChip縺ョJUDGE繧定ソ斐☆Impl(nTime, pChip); + + // When performing calibration, reduce audio distraction from user input. + // For users who play primarily by watching notes cross the judgment position, + // you might think that we want them to see visual judgment feedback during + // calibration, but we do not. Humans are remarkably good at adjusting + // the timing of their own physical movement, even without realizing it. + // We are calibrating their input timing for the purposes of judgment. + // We do not want them subconsciously playing early so as to line up + // their hits with the perfect, good, etc. judgment results based on their + // current (and soon to be replaced) input adjust time values. + // Instead, we want them focused on the sounds of their keyboard, tatacon, + // other controller, etc. and the visuals of notes crossing the judgment position. + if (TJAPlayer3.IsPerformingCalibration) + { + return e蛻、螳 < E蛻、螳.Good ? E蛻、螳.Good : e蛻、螳; + } + else + { + return e蛻、螳; + } + } + + private E蛻、螳 e謖螳壽凾蛻サ縺九iChip縺ョJUDGE繧定ソ斐☆Impl( long nTime, CDTX.CChip pChip ) + { + if ( pChip != null ) + { + pChip.nLag = (int) ( nTime - pChip.n逋コ螢ー譎ょ綾ms ); // #23580 2011.1.3 yyagi: add "nInputAdjustTime" to add input timing adjust feature + int nDeltaTime = Math.Abs( pChip.nLag ); + //Debug.WriteLine("nAbsTime=" + (nTime - pChip.n逋コ螢ー譎ょ綾ms) + ", nDeltaTime=" + (nTime + nInputAdjustTime - pChip.n逋コ螢ー譎ょ綾ms)); + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15 || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x16 ) + { + if ((CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) > pChip.n逋コ螢ー譎ょ綾ms && (CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) < pChip.n繝弱シ繝邨ゆコ譎ょ綾ms) + { + return E蛻、螳.Perfect; + } + } + else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x17 ) + { + if ((CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) >= pChip.n逋コ螢ー譎ょ綾ms - 17 && (CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) < pChip.n繝弱シ繝邨ゆコ譎ょ綾ms) + { + return E蛻、螳.Perfect; + } + } + if (nDeltaTime <= TJAPlayer3.nPerfect遽蝗イms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) + { + return E蛻、螳.Perfect; + } + if (nDeltaTime <= TJAPlayer3.nGood遽蝗イms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) + { + if ( TJAPlayer3.ConfigIni.bJust ) + return E蛻、螳.Poor; + return E蛻、螳.Good; + } + if (nDeltaTime <= TJAPlayer3.nPoor遽蝗イms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) + { + return E蛻、螳.Poor; + } + } + return E蛻、螳.Miss; + } + + protected CDTX.CChip r遨コ縺縺。Chip( E讌ス蝎ィ繝代シ繝 part, E繝代ャ繝 pad ) + { + return null; + } + protected CDTX.CChip r謖螳壽凾蛻サ縺ォ荳逡ェ霑代>Chip_繝偵ャ繝域悴貂亥撫繧上★荳榊庄隕冶諷ョ( long nTime, int nChannel, int nInputAdjustTime, int nPlayer ) + { + //sw2.Start(); +//Trace.TraceInformation( "NTime={0}, nChannel={1:x2}", nTime, nChannel ); + nTime += nInputAdjustTime; // #24239 2011.1.23 yyagi InputAdjust + + int nIndex_InitialPositionSearchingToPast; + if ( this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip == -1 ) // 貍泌・上ョ繝シ繧ソ縺ィ縺励※1蛟九b繝√ャ繝励′縺ェ縺蝣エ蜷医ッ + { + //sw2.Stop(); + return null; + } + int count = listChip[ nPlayer ].Count; + int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip; + if ( this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip >= count ) // 縺昴ョ譎らせ縺ァ貍泌・上☆縺ケ縺阪メ繝繝励′譌「縺ォ蜈ィ驛ィ辟。縺上↑縺」縺ヲ縺縺溘i + { + nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = count - 1; + } + //int nIndex_NearestChip_Future; // = nIndex_InitialPositionSearchingToFuture; + //while ( nIndex_NearestChip_Future < count ) // 譛ェ譚・譁ケ蜷代∈縺ョ讀懃エ「 + for ( ; nIndex_NearestChip_Future < count; nIndex_NearestChip_Future++) + { + CDTX.CChip chip = listChip[ nPlayer ][ nIndex_NearestChip_Future ]; + + if ( ( ( 0x11 <= nChannel ) && ( nChannel <= 0x14 ) ) || nChannel == 0x1F ) + { + if ( ( ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == nChannel ) || ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == ( nChannel ) ) ) ) + { + if ( chip.n逋コ螢ー譎ょ綾ms > nTime ) + { + break; + } + if( chip.n繧ウ繝シ繧ケ != this.n谺。蝗槭ョ繧ウ繝シ繧ケ[ nPlayer ] ) + { + break; + } + nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; + } + continue; // 縺サ繧薙ョ蜒縺九↑縺後i鬮倬溷喧 + } + + // nIndex_NearestChip_Future++; + } + int nIndex_NearestChip_Past = nIndex_InitialPositionSearchingToPast; + //while ( nIndex_NearestChip_Past >= 0 ) // 驕主悉譁ケ蜷代∈縺ョ讀懃エ「 + for ( ; nIndex_NearestChip_Past >= 0; nIndex_NearestChip_Past-- ) + { + CDTX.CChip chip = listChip[ nPlayer ][ nIndex_NearestChip_Past ]; + + if ( ( 0x11 <= nChannel ) && ( nChannel <= 0x14 ) ) + { + if ( ( ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == nChannel ) ) ) + { + break; + } + } + // nIndex_NearestChip_Past--; + } + + if ( nIndex_NearestChip_Future >= count ) + { + if ( nIndex_NearestChip_Past < 0 ) // 讀懃エ「蟇セ雎。縺碁℃蜴サ譛ェ譚・縺ゥ縺。繧峨↓繧りヲ九▽縺九i縺ェ縺九▲縺溷エ蜷 + { + return null; + } + else // 讀懃エ「蟇セ雎。縺梧悴譚・譁ケ蜷代↓縺ッ隕九▽縺九i縺ェ縺九▲縺(縺励°縺鈴℃蜴サ譁ケ蜷代↓縺ッ隕九▽縺九▲縺)蝣エ蜷 + { + //sw2.Stop(); + return listChip[ nPlayer ][ nIndex_NearestChip_Past ]; + } + } + else if ( nIndex_NearestChip_Past < 0 ) // 讀懃エ「蟇セ雎。縺碁℃蜴サ譁ケ蜷代↓縺ッ隕九▽縺九i縺ェ縺九▲縺(縺励°縺玲悴譚・譁ケ蜷代↓縺ッ隕九▽縺九▲縺)蝣エ蜷 + { + //sw2.Stop(); + return listChip[ nPlayer ][ nIndex_NearestChip_Future ]; + } + // 讀懃エ「蟇セ雎。縺碁℃蜴サ譛ェ譚・縺ョ蜿梧婿縺ォ隕九▽縺九▲縺溘↑繧峨√h繧願ソ代>譁ケ繧呈治逕ィ縺吶k + CDTX.CChip nearestChip_Future = listChip[ nPlayer ][ nIndex_NearestChip_Future ]; + CDTX.CChip nearestChip_Past = listChip[ nPlayer ][ nIndex_NearestChip_Past ]; + int nDiffTime_Future = Math.Abs( (int) ( nTime - nearestChip_Future.n逋コ螢ー譎ょ綾ms ) ); + int nDiffTime_Past = Math.Abs( (int) ( nTime - nearestChip_Past.n逋コ螢ー譎ょ綾ms ) ); + if ( nDiffTime_Future >= nDiffTime_Past ) + { + //sw2.Stop(); + return nearestChip_Past; + } + //sw2.Stop(); + return nearestChip_Future; + } + + protected CDTX.CChip r謖螳壽凾蛻サ縺ォ荳逡ェ霑代>騾」謇鼎hip_繝偵ャ繝域悴貂亥撫繧上★荳榊庄隕冶諷ョ( long nTime, int nChannel, int nInputAdjustTime, int nPlayer ) + { + //sw2.Start(); +//Trace.TraceInformation( "NTime={0}, nChannel={1:x2}", nTime, nChannel ); + nTime += nInputAdjustTime; // #24239 2011.1.23 yyagi InputAdjust + + int nIndex_InitialPositionSearchingToPast; + if ( this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip == -1 ) // 貍泌・上ョ繝シ繧ソ縺ィ縺励※1蛟九b繝√ャ繝励′縺ェ縺蝣エ蜷医ッ + { + //sw2.Stop(); + return null; + } + + List playerListChip = listChip[ nPlayer ]; + int count = playerListChip.Count; + int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip; + if ( this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip >= count ) // 縺昴ョ譎らせ縺ァ貍泌・上☆縺ケ縺阪メ繝繝励′譌「縺ォ蜈ィ驛ィ辟。縺上↑縺」縺ヲ縺縺溘i + { + nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = count - 1; + } + //int nIndex_NearestChip_Future; // = nIndex_InitialPositionSearchingToFuture; + //while ( nIndex_NearestChip_Future < count ) // 譛ェ譚・譁ケ蜷代∈縺ョ讀懃エ「 + for ( ; nIndex_NearestChip_Future < count; nIndex_NearestChip_Future++) + { + if ( ( ( 0x11 <= nChannel ) && ( nChannel <= 0x17 ) ) ) + { + CDTX.CChip chip = playerListChip[ nIndex_NearestChip_Future ]; + + if ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == nChannel ) + { + if ( chip.n逋コ螢ー譎ょ綾ms > nTime ) + { + break; + } + if( chip.n繧ウ繝シ繧ケ != this.n谺。蝗槭ョ繧ウ繝シ繧ケ[ nPlayer ] ) + { + break; + } + nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; + } + continue; // 縺サ繧薙ョ蜒縺九↑縺後i鬮倬溷喧 + } + + // nIndex_NearestChip_Future++; + } + int nIndex_NearestChip_Past = nIndex_InitialPositionSearchingToPast; + //while ( nIndex_NearestChip_Past >= 0 ) // 驕主悉譁ケ蜷代∈縺ョ讀懃エ「 + for ( ; nIndex_NearestChip_Past >= 0; nIndex_NearestChip_Past-- ) + { + if ( ( 0x15 <= nChannel ) && ( nChannel <= 0x17 ) ) + { + CDTX.CChip chip = playerListChip[ nIndex_NearestChip_Past ]; + + if ( ( ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == nChannel ) ) ) + { + break; + } + } + // nIndex_NearestChip_Past--; + } + + if ( nIndex_NearestChip_Future >= count ) + { + if ( nIndex_NearestChip_Past < 0 ) // 讀懃エ「蟇セ雎。縺碁℃蜴サ譛ェ譚・縺ゥ縺。繧峨↓繧りヲ九▽縺九i縺ェ縺九▲縺溷エ蜷 + { + return null; + } + else // 讀懃エ「蟇セ雎。縺梧悴譚・譁ケ蜷代↓縺ッ隕九▽縺九i縺ェ縺九▲縺(縺励°縺鈴℃蜴サ譁ケ蜷代↓縺ッ隕九▽縺九▲縺)蝣エ蜷 + { + //sw2.Stop(); + return playerListChip[ nIndex_NearestChip_Past ]; + } + } + else if ( nIndex_NearestChip_Past < 0 ) // 讀懃エ「蟇セ雎。縺碁℃蜴サ譁ケ蜷代↓縺ッ隕九▽縺九i縺ェ縺九▲縺(縺励°縺玲悴譚・譁ケ蜷代↓縺ッ隕九▽縺九▲縺)蝣エ蜷 + { + //sw2.Stop(); + return playerListChip[ nIndex_NearestChip_Future ]; + } + // 讀懃エ「蟇セ雎。縺碁℃蜴サ譛ェ譚・縺ョ蜿梧婿縺ォ隕九▽縺九▲縺溘↑繧峨√h繧願ソ代>譁ケ繧呈治逕ィ縺吶k + CDTX.CChip nearestChip_Future = playerListChip[ nIndex_NearestChip_Future ]; + CDTX.CChip nearestChip_Past = playerListChip[ nIndex_NearestChip_Past ]; + int nDiffTime_Future = Math.Abs( (int) ( nTime - nearestChip_Future.n逋コ螢ー譎ょ綾ms ) ); + int nDiffTime_Past = Math.Abs( (int) ( nTime - nearestChip_Past.n逋コ螢ー譎ょ綾ms ) ); + if ( nDiffTime_Future >= nDiffTime_Past ) + { + //sw2.Stop(); + return nearestChip_Past; + } + //sw2.Stop(); + return nearestChip_Future; + } + protected void t繧オ繧ヲ繝ウ繝牙咲函( CDTX.CChip pChip, int nPlayer ) + { + int index = pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ; + if (index == 0x11 || index == 0x13 || index == 0x1A) + { + if (pChip.nPlayerSide == 0) + { + this.soundRed?.t蜀咲函繧帝幕蟋九☆繧(); + } + else + { + this.soundRed2?.t蜀咲函繧帝幕蟋九☆繧(); + } + } + else if (index == 0x12 || index == 0x14 || index == 0x1B) + { + if (pChip.nPlayerSide == 0) + { + this.soundBlue?.t蜀咲函繧帝幕蟋九☆繧(); + } + else + { + this.soundBlue2?.t蜀咲函繧帝幕蟋九☆繧(); + } + } + else if (index == 0x1F) + { + if (pChip.nPlayerSide == 0) + { + this.soundAdlib?.t蜀咲函繧帝幕蟋九☆繧(); + } + else + { + this.soundAdlib2?.t蜀咲函繧帝幕蟋九☆繧(); + } + } + + if (this.nHand[nPlayer] == 0) + this.nHand[ nPlayer ]++; + else + this.nHand[ nPlayer ] = 0; + } + + protected void t繧ケ繝繝シ繧ソ繧ケ繝代ロ繝ォ縺ョ驕ク謚() + { + if ( TJAPlayer3.b繧ウ繝ウ繝代け繝医Δ繝シ繝 ) + { + this.actStatusPanels.t繝ゥ繝吶Ν蜷阪°繧峨せ繝繝シ繧ソ繧ケ繝代ロ繝ォ繧呈アコ螳壹☆繧( null ); + } + else if ( TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ != null ) + { + this.actStatusPanels.t繝ゥ繝吶Ν蜷阪°繧峨せ繝繝シ繧ソ繧ケ繝代ロ繝ォ繧呈アコ螳壹☆繧( TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.ar髮」譏灘コヲ繝ゥ繝吶Ν[ TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]] ); + } + } + + protected bool tRollProcess( CDTX.CChip pChip, double dbProcess_time, int num, int sort, int Input, int nPlayer ) + { + if (dbProcess_time >= pChip.n逋コ螢ー譎ょ綾ms && dbProcess_time < pChip.n繝弱シ繝邨ゆコ譎ょ綾ms) + { + if( pChip.nRollCount == 0 ) //騾」謇薙き繧ヲ繝ウ繝医′0縺ョ譎 + { + this.actRoll.b陦ィ遉コ[ nPlayer ] = true; + this.n迴セ蝨ィ縺ョ騾」謇捺焚[ nPlayer ] = 0; + this.actRoll.t譫陦ィ遉コ譎る俣蟒カ髟キ(nPlayer, true); + } + else + { + this.actRoll.t譫陦ィ遉コ譎る俣蟒カ髟キ(nPlayer, false); + } + this.b騾」謇謎クュ[ nPlayer ] = true; + if(this.actRoll.ct騾」謇薙い繝九Γ[nPlayer].b邨ゆコ蛟、縺ォ驕斐@縺ヲ縺ェ縺) + { + this.actRoll.ct騾」謇薙い繝九Γ[nPlayer] = new CCounter(0, 9, 14, TJAPlayer3.Timer); + this.actRoll.ct騾」謇薙い繝九Γ[nPlayer].n迴セ蝨ィ縺ョ蛟、 = 1; + } + else + { + this.actRoll.ct騾」謇薙い繝九Γ[nPlayer] = new CCounter(0, 9, 14, TJAPlayer3.Timer); + } + + + pChip.RollEffectLevel += 10; + if(pChip.RollEffectLevel >= 100) + { + pChip.RollEffectLevel = 100; + pChip.RollInputTime = new CCounter(0, 1500, 1, TJAPlayer3.Timer); + pChip.RollDelay?.t蛛懈ュ「(); + } else + { + pChip.RollInputTime = new CCounter(0, 150, 1, TJAPlayer3.Timer); + pChip.RollDelay?.t蛛懈ュ「(); + } + + if ( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15 ) + this.eRollState = E騾」謇鉄tate.roll; + else + this.eRollState = E騾」謇鉄tate.rollB; + + pChip.nRollCount++; + + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan) + this.n騾」謇甜actDan.NowShowingNumber]++; + + this.n迴セ蝨ィ縺ョ騾」謇捺焚[ nPlayer ]++; + this.CBranchScore[ nPlayer ].nRoll++; + this.n蜷郁ィ磯」謇捺焚[ nPlayer ]++; + if(TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Dan) this.actRollChara.Start(nPlayer); + + //2017.01.28 DD CDTX縺九i逶エ謗・蜻シ縺ウ蜃コ縺 + if (pChip.bGOGOTIME && !TJAPlayer3.ConfigIni.ShinuchiMode) //2018.03.11 kairera0467 繝√ャ繝励↓蝓九a霎シ繧薙□繝輔Λ繧ー縺九i隱ュ縺ソ蜿悶k + { + // 譌ァ驟咲せ繝サ譌ァ遲蝉ス馴咲せ + if( TJAPlayer3.DTX.nScoreModeTmp == 0 || TJAPlayer3.DTX.nScoreModeTmp == 1 ) + { + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15 ) + this.actScore.Add( E讌ス蝎ィ繝代シ繝.TAIKO, this.bIsAutoPlay, (long)( 300 * 1.2f ), nPlayer ); + else + this.actScore.Add( E讌ス蝎ィ繝代シ繝.TAIKO, this.bIsAutoPlay, (long)( 360 * 1.2f ), nPlayer ); + } + // 譁ー驟咲せ + else + { + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15 ) + this.actScore.Add( E讌ス蝎ィ繝代シ繝.TAIKO, this.bIsAutoPlay, (long)( 100 * 1.2f ), nPlayer ); + else + this.actScore.Add( E讌ス蝎ィ繝代シ繝.TAIKO, this.bIsAutoPlay, (long)( 200 * 1.2f ), nPlayer ); + } + } + else + { + // 譌ァ驟咲せ繝サ譌ァ遲蝉ス馴咲せ + if( TJAPlayer3.DTX.nScoreModeTmp == 0 || TJAPlayer3.DTX.nScoreModeTmp == 1 ) + { + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15 ) + this.actScore.Add( E讌ス蝎ィ繝代シ繝.TAIKO, this.bIsAutoPlay, 100L, nPlayer ); + else + this.actScore.Add( E讌ス蝎ィ繝代シ繝.TAIKO, this.bIsAutoPlay, 100L, nPlayer ); + } + // 譁ー驟咲せ + else + { + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15 ) + this.actScore.Add( E讌ス蝎ィ繝代シ繝.TAIKO, this.bIsAutoPlay, 100L, nPlayer ); + else + this.actScore.Add( E讌ス蝎ィ繝代シ繝.TAIKO, this.bIsAutoPlay, 100L, nPlayer ); + } + } + + + //襍、縺矩搨縺九ョ蛻蟯 + if( sort == 0 ) + { + if (pChip.nPlayerSide == 0) + this.soundRed?.t蜀咲函繧帝幕蟋九☆繧(); + else + this.soundRed2?.t蜀咲函繧帝幕蟋九☆繧(); + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15) + { + //CDTXMania.Skin.soundRed.t蜀咲函縺吶k(); + //CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChipFireTaiko.Start( 1, nPlayer ); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.FlyingNotes.Start(1, nPlayer, true); + } + else + { + //CDTXMania.Skin.soundRed.t蜀咲函縺吶k(); + //CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChipFireTaiko.Start( 3, nPlayer ); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.FlyingNotes.Start(3, nPlayer, true); + } + } + else + { + if (pChip.nPlayerSide == 0) + this.soundBlue?.t蜀咲函繧帝幕蟋九☆繧(); + else + this.soundBlue2?.t蜀咲函繧帝幕蟋九☆繧(); + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15) + { + //CDTXMania.Skin.soundBlue.t蜀咲函縺吶k(); + //CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChipFireTaiko.Start( 2, nPlayer ); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.FlyingNotes.Start(2, nPlayer, true); + } + else + { + //CDTXMania.Skin.soundBlue.t蜀咲函縺吶k(); + //CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChipFireTaiko.Start( 4, nPlayer ); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.FlyingNotes.Start(4, nPlayer, true); + } + } + + //TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Hit); + } + else + { + this.b騾」謇謎クュ[ nPlayer ] = false; + return true; + } + + return false; + } + + protected bool tBalloonProcess( CDTX.CChip pChip, double dbProcess_time, int player ) + { + //if( dbProcess_time >= pChip.n逋コ螢ー譎ょ綾ms && dbProcess_time < pChip.n繝弱シ繝邨ゆコ譎ょ綾ms ) + if ((int)(long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) >= pChip.n逋コ螢ー譎ょ綾ms && (int)(long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) <= pChip.n繝弱シ繝邨ゆコ譎ょ綾ms) + { + if ( pChip.nRollCount == 0 && this.bPAUSE == false) + { + this.n鬚ィ闊ケ谿九j[ player ] = pChip.nBalloon; + } + + this.b騾」謇謎クュ[ player ] = true; + if(actChara.CharaAction_Balloon_Breaking != null) + { + actChara.繧「繧ッ繧キ繝ァ繝ウ繧ソ繧、繝槭シ繝ェ繧サ繝繝(player); + actChara.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[player] = true; + actChara.CharaAction_Balloon_Breaking[player] = new CCounter(0, TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Breaking - 1, TJAPlayer3.Skin.Game_Chara_Balloon_Timer, TJAPlayer3.Timer); + + } + + if (this.actBalloon.ct鬚ィ闊ケ繧「繝九Γ[player].b邨ゆコ蛟、縺ォ驕斐@縺ヲ縺ェ縺) + { + this.actBalloon.ct鬚ィ闊ケ繧「繝九Γ[player] = new CCounter(0, 9, 14, TJAPlayer3.Timer); + this.actBalloon.ct鬚ィ闊ケ繧「繝九Γ[player].n迴セ蝨ィ縺ョ蛟、 = 1; + } + else + { + this.actBalloon.ct鬚ィ闊ケ繧「繝九Γ[player] = new CCounter(0, 9, 14, TJAPlayer3.Timer); + } + this.eRollState = E騾」謇鉄tate.balloon; + pChip.nRollCount++; + this.n鬚ィ闊ケ谿九j[ player ]--; + + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan) + this.n騾」謇甜actDan.NowShowingNumber]++; + + this.n蜷郁ィ磯」謇捺焚[player]++; // 謌千クセ逋コ陦ィ縺ョ騾」謇捺焚縺ォ鬚ィ闊ケ繧貞性繧√k繧医≧縺ォ (AioiLight) + + //蛻蟯舌ョ縺溘a縺ョ蜃ヲ逅縲ょョ溯」縺励※縺ェ縺縲 + + //襍、縺矩搨縺九ョ蛻蟯 + if ( pChip.nBalloon == pChip.nRollCount ) + { + //セ奇セ滂スァスーセ + TJAPlayer3.Skin.soundBalloon.t蜀咲函縺吶k(); + //CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChipFireTaiko.Start( 3, player ); //縺薙%縺ァ鬟帙ー縺吶る」帙ー縺輔l繧九ョ縺ッ螟ァ髻ウ隨ヲ縺ョ縺ソ縲 + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.FlyingNotes.Start(3, player); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.Rainbow.Start( player ); + //CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChipFireD.Start( 0, player ); + if(pChip.bGOGOTIME && !TJAPlayer3.ConfigIni.ShinuchiMode) + { + this.actScore.Add(E讌ス蝎ィ繝代シ繝.TAIKO, this.bIsAutoPlay, 6000L, player); + } + pChip.bHit = true; + pChip.IsHitted = true; + chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕 player ].bHit = true; + //this.b騾」謇謎クュ = false; + //this.actChara.b鬚ィ闊ケ騾」謇謎クュ = false; + pChip.b蜿ッ隕 = false; + this.actChara.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[player] = false; // 鬚ィ闊ケ邨ゆコ蠕後∝咲函縺輔l縺ヲ縺縺溘い繧ッ繧キ繝ァ繝ウ縺後&繧後↑縺繧医≧縺ォ縺吶k縺溘a縺ォ霑ス蜉縲(AioiLight) + if (actChara.CharaAction_Balloon_Broke != null) + { + actChara.繧「繧ッ繧キ繝ァ繝ウ繧ソ繧、繝槭シ繝ェ繧サ繝繝(player); + actChara.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[player] = true; + actChara.CharaAction_Balloon_Broke[player] = new CCounter(0, TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Broke - 1, TJAPlayer3.Skin.Game_Chara_Balloon_Timer, TJAPlayer3.Timer); + if(actChara.CharaAction_Balloon_Delay != null )actChara.CharaAction_Balloon_Delay[player] = new CCounter(0, TJAPlayer3.Skin.Game_Chara_Balloon_Delay - 1, 1, TJAPlayer3.Timer); + } + this.eRollState = E騾」謇鉄tate.none; + } + else + { + if(pChip.bGOGOTIME && !TJAPlayer3.ConfigIni.ShinuchiMode) + { + this.actScore.Add(E讌ス蝎ィ繝代シ繝.TAIKO, this.bIsAutoPlay, 360L, player); + } else + { + this.actScore.Add(E讌ス蝎ィ繝代シ繝.TAIKO, this.bIsAutoPlay, 100L, player); + } + //CDTXMania.Skin.soundRed.t蜀咲函縺吶k(); + if (pChip.nPlayerSide == 0) + this.soundRed?.t蜀咲函繧帝幕蟋九☆繧(); + else + this.soundRed2?.t蜀咲函繧帝幕蟋九☆繧(); + } + //TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actTaikoLaneFlash.PlayerLane[player].Start(PlayerLane.FlashType.Hit); + } + else + { + if ( chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕 player ] != null ) + chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕 player ].bHit = true; + this.b騾」謇謎クュ[ player ] = false; + this.actChara.b鬚ィ闊ケ騾」謇謎クュ[player] = false; + return false; + } + + + + return true; + } + + protected E蛻、螳 t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅( long nHitTime, CDTX.CChip pChip ) + { + return t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅( nHitTime, pChip, true ); + } + protected abstract E蛻、螳 t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅( long nHitTime, CDTX.CChip pChip, bool bCorrectLane ); + protected E蛻、螳 t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅( long nHitTime, CDTX.CChip pChip, E讌ス蝎ィ繝代シ繝 screenmode ) // E讌ス蝎ィ繝代シ繝 screenmode + { + return t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅( nHitTime, pChip, screenmode, true, 1, 0 ); + } + protected E蛻、螳 t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅( long nHitTime, CDTX.CChip pChip, E讌ス蝎ィ繝代シ繝 screenmode, bool bCorrectLane, int nNowInput ) + { + return t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅( nHitTime, pChip, screenmode, bCorrectLane, nNowInput, 0 ); + } + protected unsafe E蛻、螳 t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅(long nHitTime, CDTX.CChip pChip, E讌ス蝎ィ繝代シ繝 screenmode, bool bCorrectLane, int nNowInput, int nPlayer) + { + //unsafe繧ウ繝シ繝峨↓縺、縺阪√ョ繝舌ャ繧ー荳ュ縺ョ螟画峩蜴ウ遖! + + bool bAutoPlay = false; + switch (nPlayer) + { + case 0: + bAutoPlay = TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay; + break; + case 1: + bAutoPlay = TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay2P; + break; + } + + if (!pChip.b蜿ッ隕) + return E蛻、螳.Auto; + + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x15 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x16 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x17 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x18) + { + if (!pChip.IsMissed)//騾壹j雜翫@縺溘メ繝繝励〒縺ェ縺代l縺ー蛻、螳夲シ + { + pChip.bHit = true; + pChip.IsHitted = true; + } + } + + E蛻、螳 eJudgeResult = E蛻、螳.Auto; + switch (pChip.e讌ス蝎ィ繝代シ繝) + { + case E讌ス蝎ィ繝代シ繝.DRUMS: + case E讌ス蝎ィ繝代シ繝.GUITAR: + case E讌ス蝎ィ繝代シ繝.BASS: + break; + case E讌ス蝎ィ繝代シ繝.TAIKO: + { + //騾」謇薙′遏ュ縺吶℃繧九→逋コ螢ー縺輔l縺ェ縺 + eJudgeResult = (bCorrectLane)? this.e謖螳壽凾蛻サ縺九iChip縺ョJUDGE繧定ソ斐☆( nHitTime, pChip ) : E蛻、螳.Miss; + + if (!bAutoPlay && eJudgeResult != E蛻、螳.Miss) + { + CLagLogger.Add(nPlayer, pChip); + } + + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15 || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x16) + { + #region[ 騾」謇 ] + //--------------------------- + this.b騾」謇謎クュ[nPlayer] = true; + if (bAutoPlay) + { + if (TJAPlayer3.ConfigIni.bAuto蜈育函縺ョ騾」謇 && this.bPAUSE == false) + { + if (((CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) > (pChip.n逋コ螢ー譎ょ綾ms + (1000.0 / 15.0) * pChip.nRollCount)) + { + if (this.nHand[nPlayer] == 0) + this.nHand[nPlayer]++; + else + this.nHand[nPlayer] = 0; + + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM < 0 && (TJAPlayer3.ConfigIni.eScrollMode == EScrollMode.HBSCROLL)) + pChip.fBMSCROLLTime -= TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM * -0.05; + + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Red); + //CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChipFireTaiko.Start( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15 ? 1 : 3, nPlayer ); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.FlyingNotes.Start(pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15 ? 1 : 3, nPlayer, true); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actMtaiko.tMtaikoEvent(pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ, this.nHand[nPlayer], nPlayer); + + + this.tRollProcess(pChip, (CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)), 1, 0, 0, nPlayer); + } + } + } + else + { + this.eRollState = E騾」謇鉄tate.roll; + this.tRollProcess(pChip, (CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)), 1, nNowInput, 0, nPlayer); + } + + //if ((int)CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms >= pChip.n繝弱シ繝邨ゆコ譎ょ綾ms) + //{ + // if (actChara.CharaAction_Balloon_Breaking.b騾イ陦御クュ) + // { + // this.actChara.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ = false; // 鬚ィ闊ケ邨ゆコ蠕後∝咲函縺輔l縺ヲ縺縺溘い繧ッ繧キ繝ァ繝ウ縺後&繧後↑縺繧医≧縺ォ縺吶k縺溘a縺ォ霑ス蜉縲(AioiLight) + // if (actChara.CharaAction_Balloon_Miss != null) + // { + // actChara.繧「繧ッ繧キ繝ァ繝ウ繧ソ繧、繝槭シ繝ェ繧サ繝繝(); + // actChara.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ = true; + // actChara.CharaAction_Balloon_Miss = new CCounter(0, CDTXMania.Skin.Game_Chara_Ptn_Balloon_Miss - 1, CDTXMania.Skin.Game_Chara_Balloon_Timer, CDTXMania.Timer); + // System.Windows.Forms.MessageBox.Show(""); + // } + // } + + //} + + break; + //--------------------------- + #endregion + } + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x17) + { + #region[ 鬚ィ闊ケ ] + this.b騾」謇謎クュ[nPlayer] = true; + this.actChara.b鬚ィ闊ケ騾」謇謎クュ[nPlayer] = true; + + if (bAutoPlay) + { + if (pChip.nBalloon != 0 && this.bPAUSE == false) + { + if ((CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) > (pChip.n逋コ螢ー譎ょ綾ms + ((pChip.n繝弱シ繝邨ゆコ譎ょ綾ms - pChip.n逋コ螢ー譎ょ綾ms) / pChip.nBalloon) * pChip.nRollCount)) + { + if (this.nHand[nPlayer] == 0) + this.nHand[nPlayer]++; + else + this.nHand[nPlayer] = 0; + + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Red); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actMtaiko.tMtaikoEvent(pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ, this.nHand[nPlayer], nPlayer); + + this.tBalloonProcess(pChip, (CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)), nPlayer); + } + } + } + else + { + this.tBalloonProcess(pChip, (CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)), nPlayer); + } + break; + #endregion + } + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x18) + { + if (pChip.n繝弱シ繝邨ゆコ譎ょ綾ms <= (CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))) + { + this.b騾」謇謎クュ[nPlayer] = false; + //this.actChara.b鬚ィ闊ケ騾」謇謎クュ = false; + pChip.bHit = true; + pChip.IsHitted = true; + break; + } + } + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1F) + { + if (eJudgeResult != E蛻、螳.Auto && eJudgeResult != E蛻、螳.Miss) + { + this.actJudgeString.Start(nPlayer, E蛻、螳.Bad); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.Start(0x11, eJudgeResult, true, nPlayer); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChipFireD.Start(0x11, eJudgeResult, nPlayer); + } + break; + } + else + { + if (eJudgeResult != E蛻、螳.Miss) + { + pChip.bShow = false; + } + } + + if (eJudgeResult != E蛻、螳.Auto && eJudgeResult != E蛻、螳.Miss) + { + this.actJudgeString.Start(nPlayer, bAutoPlay ? E蛻、螳.Auto : eJudgeResult); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.Start(pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ, eJudgeResult, true, nPlayer); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChipFireD.Start(pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ, eJudgeResult, nPlayer); + + if (TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay ? true : (nNowInput == 2 || nNowInput == 3)) + { + //if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x13 || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1A ) + // //CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChipFireD.Start( 0, nPlayer ); + //else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x14 || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1B ) + // //CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChipFireD.Start( 1, nPlayer ); + } + } + else if (eJudgeResult != E蛻、螳.Poor && eJudgeResult != E蛻、螳.Bad) + { + //this.actJudgeString.Start( 0,bAutoPlay ? E蛻、螳.Auto : eJudgeResult, pChip.nLag, pChip, nPlayer ); + } + } + break; + } + if ((pChip.e讌ス蝎ィ繝代シ繝 != E讌ス蝎ィ繝代シ繝.UNKNOWN)) + { + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x15 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x16 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x17 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x18 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x1F) + { + actGauge.Damage(screenmode, pChip.e讌ス蝎ィ繝代シ繝, eJudgeResult, nPlayer); + } + } + + if (eJudgeResult != E蛻、螳.Poor && eJudgeResult != E蛻、螳.Miss) + { + double dbUnit = (((60.0 / (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM)))); + + if ((int)actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[nPlayer] >= 100 && this.bIsAlreadyMaxed[nPlayer] == false) + { + if(TJAPlayer3.Skin.Game_Chara_Ptn_SoulIn != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.actChara.繧「繧ッ繧キ繝ァ繝ウ繧ソ繧、繝槭シ繝ェ繧サ繝繝(nPlayer); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX[nPlayer] = new CCounter(0, TJAPlayer3.Skin.Game_Chara_Ptn_SoulIn - 1, (dbUnit / TJAPlayer3.Skin.Game_Chara_Ptn_SoulIn) * 2, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX[nPlayer].t騾イ陦慧b(); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX[nPlayer].n迴セ蝨ィ縺ョ蛟、 = 0; + this.actChara.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[nPlayer] = true; + } + this.bIsAlreadyMaxed[nPlayer] = true; + } + if ((int)actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[nPlayer] >= 80 && this.bIsAlreadyCleared[nPlayer] == false) + { + if(TJAPlayer3.Skin.Game_Chara_Ptn_ClearIn != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.actChara.繧「繧ッ繧キ繝ァ繝ウ繧ソ繧、繝槭シ繝ェ繧サ繝繝(nPlayer); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝杣nPlayer] = new CCounter(0, TJAPlayer3.Skin.Game_Chara_Ptn_ClearIn - 1, (dbUnit / TJAPlayer3.Skin.Game_Chara_Ptn_ClearIn) * 2, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝杣nPlayer].t騾イ陦慧b(); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝杣nPlayer].n迴セ蝨ィ縺ョ蛟、 = 0; + this.actChara.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[nPlayer] = true; + } + this.bIsAlreadyCleared[nPlayer] = true; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actBackground.ClearIn(nPlayer); + } + } + + if ( eJudgeResult == E蛻、螳.Poor || eJudgeResult == E蛻、螳.Miss || eJudgeResult == E蛻、螳.Bad ) + { + //if (actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[nPlayer] < 80.0) + //{ + // CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actBackground.tFadeOut(nPlayer); + //} + if ((int)actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[nPlayer] < 100 && this.bIsAlreadyMaxed[nPlayer] == true) + { + this.bIsAlreadyMaxed[nPlayer] = false; + } + if ((int)actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[nPlayer] < 80 && this.bIsAlreadyCleared[nPlayer] == true) + { + this.bIsAlreadyCleared[nPlayer] = false; + //CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actBackground.ClearIn(nPlayer); + } + cInvisibleChip.ShowChipTemporally( pChip.e讌ス蝎ィ繝代シ繝 ); + } + switch ( pChip.e讌ス蝎ィ繝代シ繝 ) + { + case E讌ス蝎ィ繝代シ繝.DRUMS: + case E讌ス蝎ィ繝代シ繝.GUITAR: + case E讌ス蝎ィ繝代シ繝.BASS: + break; + case E讌ス蝎ィ繝代シ繝.TAIKO: + if( !bAutoPlay ) + { + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15 || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x16 || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x17 || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x18 ) + break; + + switch ( eJudgeResult ) + { + case E蛻、螳.Perfect: + { + this.CBranchScore[nPlayer].nGreat++; + if ( nPlayer == 0 ) this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Perfect++; + this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[nPlayer]++; + + if(TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan) + this.n濶ッ[actDan.NowShowingNumber]++; + + if (this.actCombo.ct繧ウ繝ウ繝懷刈邂夕nPlayer].b邨ゆコ蛟、縺ォ驕斐@縺ヲ縺ェ縺) + { + this.actCombo.ct繧ウ繝ウ繝懷刈邂夕nPlayer].n迴セ蝨ィ縺ョ蛟、 = 1; + } + else + { + this.actCombo.ct繧ウ繝ウ繝懷刈邂夕nPlayer].n迴セ蝨ィ縺ョ蛟、 = 0; + } + } + break; + case E蛻、螳.Great: + case E蛻、螳.Good: + { + this.CBranchScore[nPlayer].nGood++; + if ( nPlayer == 0 ) this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Great++; + this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[ nPlayer ]++; + + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan) + this.n蜿ッ[actDan.NowShowingNumber]++; + //this.actCombo.ct繧ウ繝ウ繝懷刈邂 = new CCounter( 0, 8, 10, CDTXMania.Timer ); + //this.actCombo.ct繧ウ繝ウ繝懷刈邂.t騾イ陦(); + if (this.actCombo.ct繧ウ繝ウ繝懷刈邂夕nPlayer].b邨ゆコ蛟、縺ォ驕斐@縺ヲ縺ェ縺) + { + this.actCombo.ct繧ウ繝ウ繝懷刈邂夕nPlayer].n迴セ蝨ィ縺ョ蛟、 = 1; + } + else + { + this.actCombo.ct繧ウ繝ウ繝懷刈邂夕nPlayer].n迴セ蝨ィ縺ョ蛟、 = 0; + } + + } + break; + case E蛻、螳.Poor: + case E蛻、螳.Miss: + case E蛻、螳.Bad: + { + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1F ) + break; + + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan) + this.n荳榊庄[actDan.NowShowingNumber]++; + this.CBranchScore[nPlayer].nMiss++; + if ( nPlayer == 0 ) this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Miss++; + this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[ nPlayer ] = 0; + this.actComboVoice.tReset(nPlayer); + //for (int i = 0; i < 2; i++) + //{ + // ctChipAnime[i].t蛛懈ュ「(); + //} + } + break; + default: + this.n繝偵ャ繝域焚_Auto蜷ォ繧.Drums[ (int) eJudgeResult ]++; + break; + } + } + else if ( bAutoPlay ) + { + switch ( eJudgeResult ) + { + case E蛻、螳.Perfect: + case E蛻、螳.Great: + case E蛻、螳.Good: + { + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x15 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x16 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x17 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x18 ) + { + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan) + this.n濶ッ[actDan.NowShowingNumber]++; + this.CBranchScore[nPlayer].nGreat++; + if ( nPlayer == 0 ) this.n繝偵ャ繝域焚_Auto蜷ォ繧.Drums.Perfect++; + this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[ nPlayer ]++; + //this.actCombo.ct繧ウ繝ウ繝懷刈邂.t騾イ陦(); + if (this.actCombo.ct繧ウ繝ウ繝懷刈邂夕nPlayer].b邨ゆコ蛟、縺ォ驕斐@縺ヲ縺ェ縺) + { + this.actCombo.ct繧ウ繝ウ繝懷刈邂夕nPlayer].n迴セ蝨ィ縺ョ蛟、 = 1; + } + else + { + this.actCombo.ct繧ウ繝ウ繝懷刈邂夕nPlayer].n迴セ蝨ィ縺ョ蛟、 = 0; + } + } + } + break; + + default: + { + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x15 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x16 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x17 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x18 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x1F ) + { + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan) + this.n荳榊庄[actDan.NowShowingNumber]++; + this.CBranchScore[nPlayer].nMiss++; + this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[ nPlayer ] = 0; + this.actComboVoice.tReset(nPlayer); + //for (int i = 0; i < 2; i++) + //{ + // ctChipAnime[i].t蛛懈ュ「(); + //} + } + } + break; + } + } + actDan.Update(); + + #region[ 繧ウ繝ウ繝憺浹螢ー ] + if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 0x15 || ( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x1A ) ) + { + if((this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[ nPlayer ] % 100 == 0 || this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[nPlayer] == 50) && this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[ nPlayer ] > 0 ) + { + this.actComboBalloon.Start( this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[ nPlayer ], nPlayer ); + } + this.actComboVoice.t蜀咲函( this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[ nPlayer ], nPlayer ); + + double dbUnit = (((60.0 / (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM)))); + dbUnit = (((60.0 / pChip.dbBPM))); + + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(620, 80, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, "BPM: " + dbUnit.ToString()); + + for (int i = 0; i < 2; i++) + { + if (this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[i] == 50 || this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[i] == 300) + { + ctChipAnimeLag[i] = new CCounter(0, 664, 1, TJAPlayer3.Timer); + } + } + + if (this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[nPlayer] % 10 == 0 && this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[nPlayer] > 0) + { + //if (this.actChara.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ == false) + //{ + if (!pChip.bGOGOTIME) //2018.03.11 kairera0467 繝√ャ繝励↓蝓九a霎シ繧薙□繝輔Λ繧ー縺九i隱ュ縺ソ蜿悶k + { + if (TJAPlayer3.Skin.Game_Chara_Ptn_10combo != 0 && !this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝杣nPlayer].b騾イ陦御クュ && actChara.CharaAction_Balloon_Delay[nPlayer].b邨ゆコ蛟、縺ォ驕斐@縺) + { + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[nPlayer] < 100) + { + // 鬲ゅご繝シ繧クMAX縺ァ縺ッ縺ェ縺 + // 繧ク繝」繝ウ繝誉繝弱シ繝槭Ν + this.actChara.繧「繧ッ繧キ繝ァ繝ウ繧ソ繧、繝槭シ繝ェ繧サ繝繝(nPlayer); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝彈nPlayer] = new CCounter(0, TJAPlayer3.Skin.Game_Chara_Ptn_10combo - 1, (dbUnit / TJAPlayer3.Skin.Game_Chara_Ptn_10combo) * 2, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝彈nPlayer].t騾イ陦慧b(); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝彈nPlayer].n迴セ蝨ィ縺ョ蛟、 = 0; + this.actChara.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[nPlayer] = true; + //this.actChara.繝槭う縺ゥ繧点繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝(); + } + } + if (TJAPlayer3.Skin.Game_Chara_Ptn_10combo_Max != 0 && !this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX[nPlayer].b騾イ陦御クュ && actChara.CharaAction_Balloon_Delay[nPlayer].b邨ゆコ蛟、縺ォ驕斐@縺) + { + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[nPlayer] >= 100) + { + // 鬲ゅご繝シ繧クMAX + // 繧ク繝」繝ウ繝誉MAX + this.actChara.繧「繧ッ繧キ繝ァ繝ウ繧ソ繧、繝槭シ繝ェ繧サ繝繝(nPlayer); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝廴AX[nPlayer] = new CCounter(0, TJAPlayer3.Skin.Game_Chara_Ptn_10combo_Max - 1, (dbUnit / TJAPlayer3.Skin.Game_Chara_Ptn_10combo_Max) * 2, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝廴AX[nPlayer].t騾イ陦慧b(); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝廴AX[nPlayer].n迴セ蝨ィ縺ョ蛟、 = 0; + this.actChara.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[nPlayer] = true; + } + } + } + + //} + else + { + // 鬲ゅご繝シ繧クMAX + // 繧ク繝」繝ウ繝誉MAX + //CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChara.繝槭う縺ゥ繧点繧「繧ッ繧キ繝ァ繝ウ_繧ソ繧、繝槭シ繝ェ繧サ繝繝(); + //CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChara.繝槭う縺ゥ繧点繧「繧ッ繧キ繝ァ繝ウ_繧ケ繧ソ繝シ繝(CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChara.n繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝廴AX譫壽焚, 2); + } + + /* + if (CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[0] <= 100) + { + this.actChara.繧「繧ッ繧キ繝ァ繝ウ繧ソ繧、繝槭シ繝ェ繧サ繝繝(); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX = new CCounter(0, CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChara.n繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX譫壽焚 - 1, (dbUnit / CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChara.n繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX譫壽焚) * 2, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX.t騾イ陦慧b(); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX.n迴セ蝨ィ縺ョ蛟、 = 0D; + this.actChara.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ = true; + } else if (CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[0] <= 80) + { + this.actChara.繧「繧ッ繧キ繝ァ繝ウ繧ソ繧、繝槭シ繝ェ繧サ繝繝(); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝 = new CCounter(0, CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChara.n繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝樊椢謨ー - 1, (dbUnit / CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChara.n繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝樊椢謨ー) * 2, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝.t騾イ陦慧b(); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝.n迴セ蝨ィ縺ョ蛟、 = 0D; + this.actChara.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ = true; + } + */ + } + if(this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[0] == 50 || this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[1] == 50) + { + + } + + + this.t邏吝聖髮ェ_髢句ァ(); + } + #endregion + + + break; + + + default: + break; + } + if ( ( ( pChip.e讌ス蝎ィ繝代シ繝 != E讌ス蝎ィ繝代シ繝.UNKNOWN ) ) && ( eJudgeResult != E蛻、螳.Miss ) && ( eJudgeResult != E蛻、螳.Bad ) && ( eJudgeResult != E蛻、螳.Poor ) && ( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x14 || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1A || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1B ) ) + { + int nCombos = this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[nPlayer]; + long nInit = TJAPlayer3.DTX.nScoreInit[0, TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[nPlayer]]; + long nDiff = TJAPlayer3.DTX.nScoreDiff[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[nPlayer]]; + long nAddScore = 0; + + if ( TJAPlayer3.ConfigIni.ShinuchiMode ) //2016.07.04 kairera0467 逵滓遠繝「繝シ繝峨 + { + nAddScore = (long)nAddScoreNiji[nPlayer]; + + if (eJudgeResult == E蛻、螳.Great || eJudgeResult == E蛻、螳.Good) + { + nAddScore = (long)nAddScoreNiji[nPlayer] / 20; + nAddScore = (long)nAddScore * 10; + } + this.actScore.Add( E讌ス蝎ィ繝代シ繝.TAIKO, bIsAutoPlay, (long)nAddScore, nPlayer ); + } + else if( TJAPlayer3.DTX.nScoreModeTmp == 2 ) + { + if( nCombos < 10 ) + { + nAddScore = this.nScore[ 0 ]; + } + else if( nCombos >= 10 && nCombos <= 29 ) + { + nAddScore = this.nScore[ 1 ]; + } + else if( nCombos >= 30 && nCombos <= 49 ) + { + nAddScore = this.nScore[ 2 ]; + } + else if( nCombos >= 50 && nCombos <= 99 ) + { + nAddScore = this.nScore[ 3 ]; + } + else if (nCombos >= 100) + { + nAddScore = this.nScore[ 4 ]; + } + + if (eJudgeResult == E蛻、螳.Great || eJudgeResult == E蛻、螳.Good) + { + nAddScore = nAddScore / 2; + } + + if (pChip.bGOGOTIME) //2018.03.11 kairera0467 繝√ャ繝励↓蝓九a霎シ繧薙□繝輔Λ繧ー縺九i隱ュ縺ソ蜿悶k + { + nAddScore = (int)(nAddScore * 1.2f); + } + + //100繧ウ繝ウ繝懈ッ弱ョ繝懊シ繝翫せ + if (nCombos % 100 == 0 && nCombos > 99) + { + if (this.actScore.ct繝懊シ繝翫せ蜉邂励ち繧、繝杣nPlayer].b騾イ陦御クュ) + { + this.actScore.ct繝懊シ繝翫せ蜉邂励ち繧、繝杣nPlayer].t蛛懈ュ「(); + this.actScore.BonusAdd(nPlayer); + } + this.actScore.ct繝懊シ繝翫せ蜉邂励ち繧、繝杣nPlayer].n迴セ蝨ィ縺ョ蛟、 = 0; + this.actScore.ct繝懊シ繝翫せ蜉邂励ち繧、繝杣nPlayer] = new CCounter(0, 2, 1000, TJAPlayer3.Timer); + + //combot = new System.Timers.Timer(); + //if(nPlayer == 0) + //{ + // combot.Elapsed += new System.Timers.ElapsedEventHandler(combotimer_event_1); + //} else + //{ + // combot.Elapsed += new System.Timers.ElapsedEventHandler(combotimer_event_2); + //} + + //combot.Interval = 2000; // 繝溘Μ遘貞腰菴阪〒謖螳 + //combot.Enabled = true; + } + + nAddScore = (int)(nAddScore / 10); + nAddScore = (int)(nAddScore * 10); + + //螟ァ髻ウ隨ヲ縺ョ繝懊シ繝翫せ + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x13 || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x14 || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1A || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1B) + { + nAddScore = nAddScore * 2; + } + + this.actScore.Add(E讌ス蝎ィ繝代シ繝.TAIKO, bIsAutoPlay, nAddScore, nPlayer); + //this.actScore.Add( E讌ス蝎ィ繝代シ繝.DRUMS, bIsAutoPlay, nAddScore ); + } + else if (TJAPlayer3.DTX.nScoreModeTmp == 1) + { + if (nCombos < 10) + { + nAddScore = this.nScore[0]; + } + else if (nCombos >= 10 && nCombos <= 19) + { + nAddScore = this.nScore[1]; + } + else if (nCombos >= 20 && nCombos <= 29) + { + nAddScore = this.nScore[2]; + } + else if (nCombos >= 30 && nCombos <= 39) + { + nAddScore = this.nScore[3]; + } + else if (nCombos >= 40 && nCombos <= 49) + { + nAddScore = this.nScore[4]; + } + else if (nCombos >= 50 && nCombos <= 59) + { + nAddScore = this.nScore[5]; + } + else if (nCombos >= 60 && nCombos <= 69) + { + nAddScore = this.nScore[6]; + } + else if (nCombos >= 70 && nCombos <= 79) + { + nAddScore = this.nScore[7]; + } + else if (nCombos >= 80 && nCombos <= 89) + { + nAddScore = this.nScore[8]; + } + else if (nCombos >= 90 && nCombos <= 99) + { + nAddScore = this.nScore[9]; + } + else if (nCombos >= 100) + { + nAddScore = this.nScore[10]; + } + + if (eJudgeResult == E蛻、螳.Great || eJudgeResult == E蛻、螳.Good) + { + nAddScore = nAddScore / 2; + } + + if (pChip.bGOGOTIME) //2018.03.11 kairera0467 繝√ャ繝励↓蝓九a霎シ繧薙□繝輔Λ繧ー縺九i隱ュ縺ソ蜿悶k + nAddScore = (int)(nAddScore * 1.2f); + + nAddScore = (int)(nAddScore / 10.0); + nAddScore = (int)(nAddScore * 10); + + //螟ァ髻ウ隨ヲ縺ョ繝懊シ繝翫せ + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x13 || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x14 || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1A || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1B) + { + nAddScore = nAddScore * 2; + } + + this.actScore.Add(E讌ス蝎ィ繝代シ繝.TAIKO, bIsAutoPlay, nAddScore, nPlayer); + } + else + { + if (eJudgeResult == E蛻、螳.Perfect) + { + if (nCombos < 200) + { + nAddScore = 1000; + } + else + { + nAddScore = 2000; + } + } + else if (eJudgeResult == E蛻、螳.Great || eJudgeResult == E蛻、螳.Good) + { + if (nCombos < 200) + { + nAddScore = 500; + } + else + { + nAddScore = 1000; + } + } + + if (pChip.bGOGOTIME) //2018.03.11 kairera0467 繝√ャ繝励↓蝓九a霎シ繧薙□繝輔Λ繧ー縺九i隱ュ縺ソ蜿悶k + nAddScore = (int)(nAddScore * 1.2f); + + + //螟ァ髻ウ隨ヲ縺ョ繝懊シ繝翫せ + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x13 || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x25) + { + nAddScore = nAddScore * 2; + } + + this.actScore.Add(E讌ス蝎ィ繝代シ繝.TAIKO, bIsAutoPlay, nAddScore, nPlayer); + //this.actScore.Add( E讌ス蝎ィ繝代シ繝.DRUMS, bIsAutoPlay, nAddScore ); + } + + //繧ュ繝シ繧呈款縺励◆縺ィ縺阪↓繧ケ繧ウ繧「諠蝣ア + nAddScore繧堤スョ縺肴鋤縺医k讒倥↓ + this.CBranchScore[nPlayer].nScore = (int)(this.actScore.GetScore(nPlayer) + nAddScore); + } + + + return E蛻、螳.Auto; + } + + protected void t蛻蟯千憾豕√メ繧ァ繝繧ッ( int n迴セ蝨ィ譎ょ綾, int nPlayer ) + { + CDTX dTX = TJAPlayer3.DTX; + + switch( nPlayer ) + { + case 1: + dTX = TJAPlayer3.DTX_2P; + break; + default: + break; + } + + for( int i = this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip; i < dTX.listChip.Count; i++ ) + { + if( ( dTX.listChip[ i ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x11 && dTX.listChip[ i ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x18 ) != false ) + { + if( dTX.listChip[ i ].n繧ウ繝シ繧ケ == this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ[ nPlayer ] ) + { + dTX.listChip[i].b蜿ッ隕 = true; + } + else + { + dTX.listChip[i].b蜿ッ隕 = false; + } + } + } + } + + + protected abstract void t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅_Bad縺ェ繧峨ウ縺ォTight譎ゅョMiss(CDTX.ECourse eCourse, E讌ス蝎ィ繝代シ繝 part); + protected abstract void t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅_Bad縺ェ繧峨ウ縺ォTight譎ゅョMiss(CDTX.ECourse eCourse, E讌ス蝎ィ繝代シ繝 part, int nLane); + protected void t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅_Bad縺ェ繧峨ウ縺ォTight譎ゅョMiss(CDTX.ECourse eCourse, E讌ス蝎ィ繝代シ繝 part, E讌ス蝎ィ繝代シ繝 screenmode) + { + this.t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅_Bad縺ェ繧峨ウ縺ォTight譎ゅョMiss(eCourse, part, 0, screenmode); + } + protected void t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅_Bad縺ェ繧峨ウ縺ォTight譎ゅョMiss(CDTX.ECourse eCourse, E讌ス蝎ィ繝代シ繝 part, int nLane, E讌ス蝎ィ繝代シ繝 screenmode) + { + cInvisibleChip.StartSemiInvisible( part ); + cInvisibleChip.ShowChipTemporally( part ); + + //Chip縺ョCourse繧偵吶シ繧ケ縺ォ繧イ繝シ繧ク縺ョ莨ク縺ウ繧定ェソ遽 + actGauge.Damage(screenmode, part, E蛻、螳.Miss, 0); + switch ( part ) + { + case E讌ス蝎ィ繝代シ繝.DRUMS: + case E讌ス蝎ィ繝代シ繝.GUITAR: + case E讌ス蝎ィ繝代シ繝.BASS: + break; + + case E讌ス蝎ィ繝代シ繝.TAIKO: + this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.P1 = 0; + break; + + default: + return; + } + } + + protected CDTX.CChip r謖螳壽凾蛻サ縺ォ荳逡ェ霑代>Chip繧帝℃蜴サ譁ケ蜷大━蜈医〒讀懃エ「縺吶k( long nTime, int nChannel, int nInputAdjustTime, int nPlayer ) + { + //sw2.Start(); + nTime += nInputAdjustTime; + + int nIndex_InitialPositionSearchingToPast; + int nTimeDiff; + int count = listChip[ nPlayer ].Count; + if ( count <= 0 ) // 貍泌・上ョ繝シ繧ソ縺ィ縺励※1蛟九b繝√ャ繝励′縺ェ縺蝣エ蜷医ッ + { + //sw2.Stop(); + return null; + } + + int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip; + if ( this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip >= count ) // 縺昴ョ譎らせ縺ァ貍泌・上☆縺ケ縺阪メ繝繝励′譌「縺ォ蜈ィ驛ィ辟。縺上↑縺」縺ヲ縺縺溘i + { + nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = count - 1; + } + // int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToFuture; +// while ( nIndex_NearestChip_Future < count ) // 譛ェ譚・譁ケ蜷代∈縺ョ讀懃エ「 + for ( ; nIndex_NearestChip_Future < count; nIndex_NearestChip_Future++ ) + { + CDTX.CChip chip = listChip[ nPlayer ][ nIndex_NearestChip_Future ]; + if ( chip.b蜿ッ隕 ) + { + if( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == nChannel ) + { + if ( chip.n逋コ螢ー譎ょ綾ms > nTime ) + { + break; + } + nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; + } + } +// nIndex_NearestChip_Future++; + } + int nIndex_NearestChip_Past = nIndex_InitialPositionSearchingToPast; +// while ( nIndex_NearestChip_Past >= 0 ) // 驕主悉譁ケ蜷代∈縺ョ讀懃エ「 + for ( ; nIndex_NearestChip_Past >= 0; nIndex_NearestChip_Past-- ) + { + CDTX.CChip chip = listChip[ nPlayer ][ nIndex_NearestChip_Past ]; + //if ( (!chip.bHit && chip.b蜿ッ隕 ) && ( ( 0x93 <= chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ ) && ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x99 ) ) ) + if( chip.b蜿ッ隕 && chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == nChannel ) + { + break; + } + } + if ( ( nIndex_NearestChip_Future >= count ) && ( nIndex_NearestChip_Past < 0 ) ) // 讀懃エ「蟇セ雎。縺碁℃蜴サ譛ェ譚・縺ゥ縺。繧峨↓繧りヲ九▽縺九i縺ェ縺九▲縺溷エ蜷 + { + //sw2.Stop(); + return null; + } + CDTX.CChip nearestChip; // = null; // 莉・荳九ョif繝悶Ο繝繧ッ縺ョ縺縺壹l縺九〒蠢縺嗜earestChip縺ォ縺ッ髱柤ull縺御サ」蜈・縺輔l繧九ョ縺ァ縲]ull蛻晄悄蛹悶r蜑企勁 + if ( nIndex_NearestChip_Future >= count ) // 讀懃エ「蟇セ雎。縺梧悴譚・譁ケ蜷代↓縺ッ隕九▽縺九i縺ェ縺九▲縺(縺励°縺鈴℃蜴サ譁ケ蜷代↓縺ッ隕九▽縺九▲縺)蝣エ蜷 + { + nearestChip = listChip[ nPlayer ][ nIndex_NearestChip_Past ]; +// nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n逋コ螢ー譎ょ綾ms ) ); + } + else if ( nIndex_NearestChip_Past < 0 ) // 讀懃エ「蟇セ雎。縺碁℃蜴サ譁ケ蜷代↓縺ッ隕九▽縺九i縺ェ縺九▲縺(縺励°縺玲悴譚・譁ケ蜷代↓縺ッ隕九▽縺九▲縺)蝣エ蜷 + { + nearestChip = listChip[ nPlayer ][ nIndex_NearestChip_Future ]; +// nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n逋コ螢ー譎ょ綾ms ) ); + } + else + { + int nTimeDiff_Future = Math.Abs( (int) ( nTime - listChip[ nPlayer ][ nIndex_NearestChip_Future ].n逋コ螢ー譎ょ綾ms ) ); + int nTimeDiff_Past = Math.Abs( (int) ( nTime - listChip[ nPlayer ][ nIndex_NearestChip_Past ].n逋コ螢ー譎ょ綾ms ) ); + if ( nTimeDiff_Future < nTimeDiff_Past ) + { + if( !listChip[ nPlayer ][ nIndex_NearestChip_Past ].bHit && ( listChip[ nPlayer ][ nIndex_NearestChip_Past ].n逋コ螢ー譎ょ綾ms + ( 108 ) >= nTime ) ) + { + nearestChip = listChip[ nPlayer ][ nIndex_NearestChip_Past ]; + } + else + nearestChip = listChip[ nPlayer ][ nIndex_NearestChip_Future ]; +// nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n逋コ螢ー譎ょ綾ms ) ); + } + else + { + nearestChip = listChip[ nPlayer ][ nIndex_NearestChip_Past ]; +// nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n逋コ螢ー譎ょ綾ms ) ); + } + } + nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n逋コ螢ー譎ょ綾ms ) ); + int n讀懃エ「遽蝗イ譎る俣ms = 0; + if ( ( n讀懃エ「遽蝗イ譎る俣ms > 0 ) && ( nTimeDiff > n讀懃エ「遽蝗イ譎る俣ms ) ) // 繝√ャ繝励ッ隕九▽縺九▲縺溘′縲∵、懃エ「遽蝗イ譎る俣螟悶□縺」縺溷エ蜷 + { + //sw2.Stop(); + return null; + } + //sw2.Stop(); + return nearestChip; + } + + protected CDTX.CChip r謖螳壽凾蛻サ縺ォ荳逡ェ霑代>譛ェ繝偵ャ繝Chip繧帝℃蜴サ譁ケ蜷大━蜈医〒讀懃エ「縺吶k( long nTime, int nPlayer ) + { + //sw2.Start(); + int nIndex_InitialPositionSearchingToPast; + int nTimeDiff; + int count = listChip[ nPlayer ].Count; + if ( count <= 0 ) // 貍泌・上ョ繝シ繧ソ縺ィ縺励※1蛟九b繝√ャ繝励′縺ェ縺蝣エ蜷医ッ + { + //sw2.Stop(); + return null; + } + + int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip; + if ( this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip >= count ) // 縺昴ョ譎らせ縺ァ貍泌・上☆縺ケ縺阪メ繝繝励′譌「縺ォ蜈ィ驛ィ辟。縺上↑縺」縺ヲ縺縺溘i + { + nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = count - 1; + } + + + // int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToFuture; +// while ( nIndex_NearestChip_Future < count ) // 譛ェ譚・譁ケ蜷代∈縺ョ讀懃エ「 + for ( ; nIndex_NearestChip_Future < count; nIndex_NearestChip_Future++ ) + { + if( nIndex_NearestChip_Future < 0 ) + continue; + + CDTX.CChip chip = listChip[ nPlayer ][ nIndex_NearestChip_Future ]; + if ( !chip.bHit && chip.b蜿ッ隕 ) + { + if ( ( ( 0x11 <= chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ ) && ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x18 ) ) || chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1A || chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1B || chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1F ) + { + if ( chip.n逋コ螢ー譎ょ綾ms > nTime ) + { + break; + } + nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; + } + } + if( chip.bHit && chip.b蜿ッ隕 ) // 2015.11.5 kairera0467 騾」謇灘ッセ遲 + { + if( ( 0x15 <= chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ) && ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x17 ) ) + { + if (chip.n繝弱シ繝邨ゆコ譎ょ綾ms > nTime) + { + nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; + break; + } + } + } +// nIndex_NearestChip_Future++; + } + + + int nIndex_NearestChip_Past = nIndex_InitialPositionSearchingToPast; +// while ( nIndex_NearestChip_Past >= 0 ) // 驕主悉譁ケ蜷代∈縺ョ讀懃エ「 + for ( ; nIndex_NearestChip_Past >= 0; nIndex_NearestChip_Past-- ) + { + CDTX.CChip chip = listChip[ nPlayer ][ nIndex_NearestChip_Past ]; + //if ( (!chip.bHit && chip.b蜿ッ隕 ) && ( ( 0x93 <= chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ ) && ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x99 ) ) ) + if ( (!chip.bHit && chip.b蜿ッ隕 ) && ( ( 0x11 <= chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ ) && ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x17 ) ) || chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1A || chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1B || chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1F ) + { + break; + } + //2015.11.5 kairera0467 騾」謇灘ッセ遲 + else if ( ( chip.b蜿ッ隕 ) && ( ( 0x15 <= chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ ) && ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x17 ) ) ) + { + break; + } +// nIndex_NearestChip_Past--; + } + if ( ( nIndex_NearestChip_Future >= count ) && ( nIndex_NearestChip_Past < 0 ) ) // 讀懃エ「蟇セ雎。縺碁℃蜴サ譛ェ譚・縺ゥ縺。繧峨↓繧りヲ九▽縺九i縺ェ縺九▲縺溷エ蜷 + { + //sw2.Stop(); + return null; + } + CDTX.CChip nearestChip; // = null; // 莉・荳九ョif繝悶Ο繝繧ッ縺ョ縺縺壹l縺九〒蠢縺嗜earestChip縺ォ縺ッ髱柤ull縺御サ」蜈・縺輔l繧九ョ縺ァ縲]ull蛻晄悄蛹悶r蜑企勁 + if ( nIndex_NearestChip_Future >= count ) // 讀懃エ「蟇セ雎。縺梧悴譚・譁ケ蜷代↓縺ッ隕九▽縺九i縺ェ縺九▲縺(縺励°縺鈴℃蜴サ譁ケ蜷代↓縺ッ隕九▽縺九▲縺)蝣エ蜷 + { + nearestChip = listChip[ nPlayer ][ nIndex_NearestChip_Past ]; +// nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n逋コ螢ー譎ょ綾ms ) ); + } + else if ( nIndex_NearestChip_Past < 0 ) // 讀懃エ「蟇セ雎。縺碁℃蜴サ譁ケ蜷代↓縺ッ隕九▽縺九i縺ェ縺九▲縺(縺励°縺玲悴譚・譁ケ蜷代↓縺ッ隕九▽縺九▲縺)蝣エ蜷 + { + nearestChip = listChip[ nPlayer ][ nIndex_NearestChip_Future ]; +// nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n逋コ螢ー譎ょ綾ms ) ); + } + else + { + int nTimeDiff_Future = Math.Abs( (int) ( nTime - listChip[ nPlayer ][ nIndex_NearestChip_Future ].n逋コ螢ー譎ょ綾ms ) ); + int nTimeDiff_Past = Math.Abs( (int) ( nTime - listChip[ nPlayer ][ nIndex_NearestChip_Past ].n逋コ螢ー譎ょ綾ms ) ); + if ( nTimeDiff_Future < nTimeDiff_Past ) + { + if( !listChip[ nPlayer ][ nIndex_NearestChip_Past ].bHit && ( listChip[ nPlayer ][ nIndex_NearestChip_Past ].n逋コ螢ー譎ょ綾ms + ( 108 ) >= nTime ) ) + { + nearestChip = listChip[ nPlayer ][ nIndex_NearestChip_Past ]; + } + else + nearestChip = listChip[ nPlayer ][ nIndex_NearestChip_Future ]; +// nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n逋コ螢ー譎ょ綾ms ) ); + } + else + { + nearestChip = listChip[ nPlayer ][ nIndex_NearestChip_Past ]; +// nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n逋コ螢ー譎ょ綾ms ) ); + } + + //2015.11.5 kairera0467縲騾」謇馴浹隨ヲ縺ョ蛻、螳 + if( listChip[ nPlayer ][ nIndex_NearestChip_Future ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x15 && listChip[ nPlayer ][ nIndex_NearestChip_Future ].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x17 ) + { + if( listChip[ nPlayer ][ nIndex_NearestChip_Future ].n逋コ螢ー譎ょ綾ms <= nTime && listChip[ nPlayer ][ nIndex_NearestChip_Future ].n繝弱シ繝邨ゆコ譎ょ綾ms >= nTime ) + { + nearestChip = listChip[ nPlayer ][ nIndex_NearestChip_Future ]; + } + } + } + nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n逋コ螢ー譎ょ綾ms ) ); + int n讀懃エ「遽蝗イ譎る俣ms = 0; + if ( ( n讀懃エ「遽蝗イ譎る俣ms > 0 ) && ( nTimeDiff > n讀懃エ「遽蝗イ譎る俣ms ) ) // 繝√ャ繝励ッ隕九▽縺九▲縺溘′縲∵、懃エ「遽蝗イ譎る俣螟悶□縺」縺溷エ蜷 + { + //sw2.Stop(); + return null; + } + //sw2.Stop(); + return nearestChip; + } + + protected CDTX.CChip r謖螳壽凾蛻サ縺ォ荳逡ェ霑代>譛ェ繝偵ャ繝Chip繧帝℃蜴サ譁ケ蜷大━蜈医〒讀懃エ「縺吶k(long nTime, int nInputAdjustTime, int nPlayer) + { + //sw2.Start(); + nTime += nInputAdjustTime; + + int nIndex_InitialPositionSearchingToPast; + int nTimeDiff; + int count = listChip[nPlayer].Count; + if (count <= 0) // 貍泌・上ョ繝シ繧ソ縺ィ縺励※1蛟九b繝√ャ繝励′縺ェ縺蝣エ蜷医ッ + { + //sw2.Stop(); + return null; + } + #endregion + + int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip; + if (this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip >= count) // 縺昴ョ譎らせ縺ァ貍泌・上☆縺ケ縺阪メ繝繝励′譌「縺ォ蜈ィ驛ィ辟。縺上↑縺」縺ヲ縺縺溘i + { + nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = count - 1; + } + // int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToFuture; + // while ( nIndex_NearestChip_Future < count ) // 譛ェ譚・譁ケ蜷代∈縺ョ讀懃エ「 + for (; nIndex_NearestChip_Future < count; nIndex_NearestChip_Future++) + { + if (nIndex_NearestChip_Future < 0) + continue; + + CDTX.CChip chip = listChip[nPlayer][nIndex_NearestChip_Future]; + if (!chip.bHit && chip.b蜿ッ隕) + { + if (((0x11 <= chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ) && (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x18)) || chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1A || chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1B || chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1F) + { + if (chip.n逋コ螢ー譎ょ綾ms > nTime) + { + break; + } + nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; + } + } + if (chip.bHit && chip.b蜿ッ隕) // 2015.11.5 kairera0467 騾」謇灘ッセ遲 + { + if ((0x15 <= chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ) && (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x17)) + { + if (chip.n繝弱シ繝邨ゆコ譎ょ綾ms > nTime) + { + nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; + break; + } + } + } + // nIndex_NearestChip_Future++; + } + int nIndex_NearestChip_Past = nIndex_InitialPositionSearchingToPast; + // while ( nIndex_NearestChip_Past >= 0 ) // 驕主悉譁ケ蜷代∈縺ョ讀懃エ「 + for (; nIndex_NearestChip_Past >= 0; nIndex_NearestChip_Past--) + { + CDTX.CChip chip = listChip[nPlayer][nIndex_NearestChip_Past]; + //if ( (!chip.bHit && chip.b蜿ッ隕 ) && ( ( 0x93 <= chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ ) && ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x99 ) ) ) + if ((!chip.bHit && chip.b蜿ッ隕) && ((0x11 <= chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ) && (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x17)) || chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1A || chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1B || chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1F) + { + break; + } + //2015.11.5 kairera0467 騾」謇灘ッセ遲 + else if ((chip.b蜿ッ隕) && ((0x15 <= chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ) && (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x17))) + { + break; + } + // nIndex_NearestChip_Past--; + } + if ((nIndex_NearestChip_Future >= count) && (nIndex_NearestChip_Past < 0)) // 讀懃エ「蟇セ雎。縺碁℃蜴サ譛ェ譚・縺ゥ縺。繧峨↓繧りヲ九▽縺九i縺ェ縺九▲縺溷エ蜷 + { + //sw2.Stop(); + return null; + } + CDTX.CChip nearestChip; // = null; // 莉・荳九ョif繝悶Ο繝繧ッ縺ョ縺縺壹l縺九〒蠢縺嗜earestChip縺ォ縺ッ髱柤ull縺御サ」蜈・縺輔l繧九ョ縺ァ縲]ull蛻晄悄蛹悶r蜑企勁 + if (nIndex_NearestChip_Future >= count) // 讀懃エ「蟇セ雎。縺梧悴譚・譁ケ蜷代↓縺ッ隕九▽縺九i縺ェ縺九▲縺(縺励°縺鈴℃蜴サ譁ケ蜷代↓縺ッ隕九▽縺九▲縺)蝣エ蜷 + { + nearestChip = listChip[nPlayer][nIndex_NearestChip_Past]; + // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n逋コ螢ー譎ょ綾ms ) ); + } + else if (nIndex_NearestChip_Past < 0) // 讀懃エ「蟇セ雎。縺碁℃蜴サ譁ケ蜷代↓縺ッ隕九▽縺九i縺ェ縺九▲縺(縺励°縺玲悴譚・譁ケ蜷代↓縺ッ隕九▽縺九▲縺)蝣エ蜷 + { + nearestChip = listChip[nPlayer][nIndex_NearestChip_Future]; + // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n逋コ螢ー譎ょ綾ms ) ); + } + else + { + int nTimeDiff_Future = Math.Abs((int)(nTime - listChip[nPlayer][nIndex_NearestChip_Future].n逋コ螢ー譎ょ綾ms)); + int nTimeDiff_Past = Math.Abs((int)(nTime - listChip[nPlayer][nIndex_NearestChip_Past].n逋コ螢ー譎ょ綾ms)); + if (nTimeDiff_Future < nTimeDiff_Past) + { + if (!listChip[nPlayer][nIndex_NearestChip_Past].bHit && (listChip[nPlayer][nIndex_NearestChip_Past].n逋コ螢ー譎ょ綾ms + (108) >= nTime)) + { + nearestChip = listChip[nPlayer][nIndex_NearestChip_Past]; + } + else + nearestChip = listChip[nPlayer][nIndex_NearestChip_Future]; + // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n逋コ螢ー譎ょ綾ms ) ); + } + else + { + nearestChip = listChip[nPlayer][nIndex_NearestChip_Past]; + // nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n逋コ螢ー譎ょ綾ms ) ); + } + //2015.11.5 kairera0467縲騾」謇馴浹隨ヲ縺ョ蛻、螳 + if (listChip[nPlayer][nIndex_NearestChip_Future].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x15 && listChip[nPlayer][nIndex_NearestChip_Future].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x17) + { + if (listChip[nPlayer][nIndex_NearestChip_Future].n逋コ螢ー譎ょ綾ms <= nTime && listChip[nPlayer][nIndex_NearestChip_Future].n繝弱シ繝邨ゆコ譎ょ綾ms >= nTime) + { + nearestChip = listChip[nPlayer][nIndex_NearestChip_Future]; + } + } + } + nTimeDiff = Math.Abs((int)(nTime - nearestChip.n逋コ螢ー譎ょ綾ms)); + int n讀懃エ「遽蝗イ譎る俣ms = 0; + if ((n讀懃エ「遽蝗イ譎る俣ms > 0) && (nTimeDiff > n讀懃エ「遽蝗イ譎る俣ms)) // 繝√ャ繝励ッ隕九▽縺九▲縺溘′縲∵、懃エ「遽蝗イ譎る俣螟悶□縺」縺溷エ蜷 + { + //sw2.Stop(); + return null; + } + //sw2.Stop(); + return nearestChip; + } + + /// + /// 譛繧ょ愛螳壽棧縺ォ霑代>繝峨Φ繧ォ繝繧定ソ斐@縺セ縺吶 + /// + /// 蛻、螳壽凾縺ョ譎る俣縲 + /// 繝励Ξ繧、繝、繝シ縲 + /// 繝峨Φ縺九←縺縺九 + /// 譛繧ょ愛螳壽棧縺ォ霑代>繝弱シ繝縲 + protected CDTX.CChip GetChipOfNearest(long nowTime, int player, bool don) + { + var nearestChip = new CDTX.CChip(); + var count = listChip[player].Count; + var chips = listChip[player]; + var startPosision = NowProcessingChip[player]; + CDTX.CChip pastChip; // 蛻、螳壹&繧後k縺ケ縺埼℃蜴サ繝弱シ繝 + CDTX.CChip futureChip; // 蛻、螳壹&繧後k縺ケ縺肴悴譚・繝弱シ繝 + var pastJudge = E蛻、螳.Miss; + var futureJudge = E蛻、螳.Miss; + + bool GetDon(CDTX.CChip note) + { + return note.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x11 || note.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x13 || note.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1A || note.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1F; + } + bool GetKatsu(CDTX.CChip note) + { + return note.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x12 || note.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x14 || note.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1B || note.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1F; + } + + if (count <= 0) + { + return null; + } + + if (startPosision >= count) + { + startPosision -= 1; + } + + #region 驕主悉縺ョ繝弱シ繝縺ァ縲√°縺、蜿ッ蛻、螳壻サ・荳翫ョ繝弱シ繝縺ョ豎コ螳 + CDTX.CChip afterChip = null; + for (int pastNote = startPosision - 1; ; pastNote--) + { + if (pastNote < 0) + { + pastChip = afterChip != null ? afterChip : null; // afterChip縺ォ驕主悉縺ョ蛻、螳壹′縺ゅk縺九b縺励l縺ェ縺縺ョ縺ァ + break; + } + var processingChip = chips[pastNote]; + if (!processingChip.IsHitted && processingChip.n繧ウ繝シ繧ケ == n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ[player]) // 縺セ縺蛻、螳壹&繧後※縺ェ縺髻ウ隨ヲ + { + if (don ? GetDon(processingChip) : GetKatsu(processingChip)) // 髻ウ隨ヲ縺ョ繝√Ε繝ウ繝阪Ν縺ァ縺ゅk + { + var thisChipJudge = pastJudge = e謖螳壽凾蛻サ縺九iChip縺ョJUDGE繧定ソ斐☆Impl(nowTime, processingChip); + if (thisChipJudge != E蛻、螳.Miss) + { + // 蛻、螳壹′隕矩℃縺斐@荳榊庄縺ァ縺ッ縺ェ縺(=縺溘◆縺縺ヲ荳榊庄莉・荳) + // 縺昴ョ蜑阪ョ繝弱シ繝医′繧ゅ@縺九@縺溘i蟄伜惠縺励※縲∝庄莉・荳翫ョ蛻、螳壹°繧ゅ@繧後↑縺縺九i縺セ縺蜃ヲ逅繧堤カ夊。後☆繧九 + afterChip = processingChip; + continue; + } + else + { + // 蛻、螳壹′荳榊庄縺縺」縺 + // 縺昴ョ蜑阪ョ繝弱シ繝繧帝℃蜴サ縺ァ蜿ッ莉・荳翫ョ繝弱シ繝(縺、縺セ繧雁愛螳壹&繧後k縺ケ縺阪ヮ繝シ繝)縺ィ縺吶k縲 + pastChip = afterChip; + break; // 讀懃エ「邨ゅo繧 + } + } + } + if (processingChip.IsHitted && processingChip.n繧ウ繝シ繧ケ == n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ[player]) // 騾」謇 + { + if ((0x15 <= processingChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ) && (processingChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x17)) + { + if (processingChip.n繝弱シ繝邨ゆコ譎ょ綾ms > nowTime) + { + pastChip = processingChip; + break; + } + } + } + } + #endregion + + #region 譛ェ譚・縺ョ繝弱シ繝縺ァ縲√°縺、蜿ッ蛻、螳壻サ・荳翫ョ繝弱シ繝縺ョ豎コ螳 + for (int futureNote = startPosision; ; futureNote++) + { + if (futureNote >= count) + { + futureChip = null; + break; + } + var processingChip = chips[futureNote]; + if (!processingChip.IsHitted && processingChip.n繧ウ繝シ繧ケ == n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ[player]) // 縺セ縺蛻、螳壹&繧後※縺ェ縺髻ウ隨ヲ + { + if (don ? GetDon(processingChip) : GetKatsu(processingChip)) // 髻ウ隨ヲ縺ョ繝√Ε繝ウ繝阪Ν縺ァ縺ゅk + { + var thisChipJudge = futureJudge = e謖螳壽凾蛻サ縺九iChip縺ョJUDGE繧定ソ斐☆Impl(nowTime, processingChip); + if (thisChipJudge != E蛻、螳.Miss) + { + // 蛻、螳壹′隕矩℃縺斐@荳榊庄縺ァ縺ッ縺ェ縺(=縺溘◆縺縺ヲ荳榊庄莉・荳) + // 縺昴ョ繝弱シ繝医r蜃ヲ逅縺吶∋縺阪↑縺ョ縺ァ縲∵、懃エ「邨ゅo繧翫 + futureChip = processingChip; + break; // 讀懃エ「邨ゅo繧 + } + else + { + // 蛻、螳壹′荳榊庄縺縺」縺 + // 縺、縺セ繧頑悴譚・縺ォ蜃ヲ逅縺吶∋縺阪ヮ繝シ繝医ッ縺ェ縺縺ョ縺ァ縲∵、懃エ「邨ゅo繧翫 + futureChip = null; // 莉雁ヲ逅荳ュ縺ョ繝弱シ繝 + break; // 讀懃エ「邨ゅo繧 + } + } + } + } + #endregion + + #region 驕主悉縺ョ繝弱シ繝縺瑚ヲ九▽縺九▲縺溘i縺昴l繧定ソ泌唆縲√◎縺縺ァ縺ェ縺代l縺ー譛ェ譚・縺ョ繝弱シ繝繧定ソ泌唆 + if ((pastJudge == E蛻、螳.Miss || pastJudge == E蛻、螳.Poor) && (pastJudge != E蛻、螳.Miss && pastJudge != E蛻、螳.Poor)) + { + // 驕主悉縺ョ蛻、螳壹′荳榊庄縺ァ縲∵悴譚・縺ョ蛻、螳壹′蜿ッ莉・荳翫↑繧画悴譚・繧定ソ泌唆縲 + nearestChip = futureChip; + } + else if (futureChip == null && pastChip != null) + { + // 譛ェ譚・縺ォ蜃ヲ逅縺吶k縺ケ縺阪ヮ繝シ繝医′縺ェ縺九▲縺溘ョ縺ァ縲驕主悉縺ョ蜃ヲ逅縺吶∋縺阪ヮ繝シ繝医r霑斐☆縲 + nearestChip = pastChip; + } + else if (pastChip == null && futureChip != null) + { + // 驕主悉縺ョ讀懃エ「縺瑚ゥイ蠖薙↑縺励□縺」縺溘ョ縺ァ縲∵悴譚・縺ョ繝弱シ繝医r霑斐☆縲 + nearestChip = futureChip; + } + else + { + // 蝓コ譛ャ逧縺ォ縺ッ驕主悉縺ョ繝弱シ繝医r霑斐☆縲 + nearestChip = pastChip; + } + #endregion + + return nearestChip; + } + + + protected CDTX.CChip r謖螳壽凾蛻サ縺ォ荳逡ェ霑代>譛ェ繝偵ャ繝Chip( long nTime, int nChannel, int nInputAdjustTime, int n讀懃エ「遽蝗イ譎る俣ms, int nPlayer ) + { + //sw2.Start(); +//Trace.TraceInformation( "nTime={0}, nChannel={1:x2}, 迴セ蝨ィ縺ョTop={2}", nTime, nChannel,CDTXMania.DTX.listChip[ this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip ].n逋コ螢ー譎ょ綾ms ); + nTime += nInputAdjustTime; + + int nIndex_InitialPositionSearchingToPast; + int nTimeDiff; + if ( this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip == -1 ) // 貍泌・上ョ繝シ繧ソ縺ィ縺励※1蛟九b繝√ャ繝励′縺ェ縺蝣エ蜷医ッ + { + //sw2.Stop(); + return null; + } + int count = listChip[ nPlayer ].Count; + int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip; + if ( this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip >= count ) // 縺昴ョ譎らせ縺ァ貍泌・上☆縺ケ縺阪メ繝繝励′譌「縺ォ蜈ィ驛ィ辟。縺上↑縺」縺ヲ縺縺溘i + { + nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToPast = count - 1; + } + // int nIndex_NearestChip_Future = nIndex_InitialPositionSearchingToFuture; +// while ( nIndex_NearestChip_Future < count ) // 譛ェ譚・譁ケ蜷代∈縺ョ讀懃エ「 + for ( ; nIndex_NearestChip_Future < count; nIndex_NearestChip_Future++ ) + { + CDTX.CChip chip = listChip[ nPlayer ][ nIndex_NearestChip_Future ]; + if ( !chip.bHit ) + { + if( ( 0x11 <= nChannel) && ( nChannel <= 0x1F ) ) + { + if ((chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == nChannel) || (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == (nChannel + 0x20))) + { + if (chip.n逋コ螢ー譎ょ綾ms > nTime) + { + break; + } + nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; + } + continue; + } + + //if ( ( ( 0xDE <= nChannel ) && ( nChannel <= 0xDF ) ) ) + if ( ( ( 0xDF == nChannel ) ) ) + { + if( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == nChannel ) + { + if ( chip.n逋コ螢ー譎ょ綾ms > nTime ) + { + break; + } + nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; + } + } + + if ( ( ( 0x50 == nChannel ) ) ) + { + if( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == nChannel ) + { + if ( chip.n逋コ螢ー譎ょ綾ms > nTime ) + { + break; + } + nIndex_InitialPositionSearchingToPast = nIndex_NearestChip_Future; + } + } + + } +// nIndex_NearestChip_Future++; + } + int nIndex_NearestChip_Past = nIndex_InitialPositionSearchingToPast; +// while ( nIndex_NearestChip_Past >= 0 ) // 驕主悉譁ケ蜷代∈縺ョ讀懃エ「 + for ( ; nIndex_NearestChip_Past >= 0; nIndex_NearestChip_Past-- ) + { + CDTX.CChip chip = listChip[ nPlayer ][ nIndex_NearestChip_Past ]; + if ( (!chip.bHit) && + ( + ( + ( ( ( ( nChannel >= 0x11 ) && ( nChannel <= 0x14 ) ) || nChannel == 0x1A || nChannel == 0x1B || nChannel == 0x1F ) && ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == nChannel ) ) + ) + || + ( + // ( ( ( nChannel >= 0xDE ) && ( nChannel <= 0xDF ) ) && ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == nChannel ) ) + ( ( ( nChannel == 0xDF ) ) && ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == nChannel ) ) + ) + || + ( + // ( ( ( nChannel >= 0xDE ) && ( nChannel <= 0xDF ) ) && ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == nChannel ) ) + ( ( ( nChannel == 0x50 ) ) && ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == nChannel ) ) + ) + ) + ) + { + break; + } +// nIndex_NearestChip_Past--; + } + if ( ( nIndex_NearestChip_Future >= count ) && ( nIndex_NearestChip_Past < 0 ) ) // 讀懃エ「蟇セ雎。縺碁℃蜴サ譛ェ譚・縺ゥ縺。繧峨↓繧りヲ九▽縺九i縺ェ縺九▲縺溷エ蜷 + { + //sw2.Stop(); + return null; + } + CDTX.CChip nearestChip; // = null; // 莉・荳九ョif繝悶Ο繝繧ッ縺ョ縺縺壹l縺九〒蠢縺嗜earestChip縺ォ縺ッ髱柤ull縺御サ」蜈・縺輔l繧九ョ縺ァ縲]ull蛻晄悄蛹悶r蜑企勁 + if ( nIndex_NearestChip_Future >= count ) // 讀懃エ「蟇セ雎。縺梧悴譚・譁ケ蜷代↓縺ッ隕九▽縺九i縺ェ縺九▲縺(縺励°縺鈴℃蜴サ譁ケ蜷代↓縺ッ隕九▽縺九▲縺)蝣エ蜷 + { + nearestChip = listChip[ nPlayer ][ nIndex_NearestChip_Past ]; +// nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n逋コ螢ー譎ょ綾ms ) ); + } + else if ( nIndex_NearestChip_Past < 0 ) // 讀懃エ「蟇セ雎。縺碁℃蜴サ譁ケ蜷代↓縺ッ隕九▽縺九i縺ェ縺九▲縺(縺励°縺玲悴譚・譁ケ蜷代↓縺ッ隕九▽縺九▲縺)蝣エ蜷 + { + nearestChip = listChip[ nPlayer ][ nIndex_NearestChip_Future ]; +// nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n逋コ螢ー譎ょ綾ms ) ); + } + else + { + int nTimeDiff_Future = Math.Abs( (int) ( nTime - listChip[ nPlayer ][ nIndex_NearestChip_Future ].n逋コ螢ー譎ょ綾ms ) ); + int nTimeDiff_Past = Math.Abs( (int) ( nTime - listChip[ nPlayer ][ nIndex_NearestChip_Past ].n逋コ螢ー譎ょ綾ms ) ); + + if( nChannel == 0xDF ) //0xDF縺ョ蝣エ蜷医ッ驕主悉譁ケ蜷代∈縺ョ讀懃エ「繧偵@縺ェ縺 + { + return listChip[ nPlayer ][ nIndex_NearestChip_Future ]; + } + + if ( nTimeDiff_Future < nTimeDiff_Past ) + { + nearestChip = listChip[ nPlayer ][ nIndex_NearestChip_Future ]; +// nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n逋コ螢ー譎ょ綾ms ) ); + } + else + { + nearestChip = listChip[ nPlayer ][ nIndex_NearestChip_Past ]; +// nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n逋コ螢ー譎ょ綾ms ) ); + } + } + nTimeDiff = Math.Abs( (int) ( nTime - nearestChip.n逋コ螢ー譎ょ綾ms ) ); + if ( ( n讀懃エ「遽蝗イ譎る俣ms > 0 ) && ( nTimeDiff > n讀懃エ「遽蝗イ譎る俣ms ) ) // 繝√ャ繝励ッ隕九▽縺九▲縺溘′縲∵、懃エ「遽蝗イ譎る俣螟悶□縺」縺溷エ蜷 + { + //sw2.Stop(); + return null; + } + //sw2.Stop(); + return nearestChip; + } + public bool r讀懃エ「遽蝗イ蜀縺ォ繝√ャ繝励′縺ゅk縺玖ェソ縺ケ繧( long nTime, int nInputAdjustTime, int n讀懃エ「遽蝗イ譎る俣ms, int nPlayer ) + { + nTime += nInputAdjustTime; + + for ( int i = 0; i < listChip[ nPlayer ].Count; i++ ) + { + CDTX.CChip chip = listChip[ nPlayer ][ i ]; + if ( !chip.bHit ) + { + if ( ( ( 0x11 <= chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ ) && ( chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x14 ) ) || chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1A || chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1B ) + { + if ( chip.n逋コ螢ー譎ょ綾ms < nTime + n讀懃エ「遽蝗イ譎る俣ms ) + { + if( chip.n繧ウ繝シ繧ケ == this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ[ nPlayer ] ) //2016.06.14 kairera0467 隴憺擇蛻蟯舌b閠諷ョ縺吶k繧医≧縺ォ縺励※縺ソ繧九 + return true; + } + } + } + } + + return false; + } + + protected void ChangeInputAdjustTimeInPlaying( IInputDevice keyboard, int plusminus ) // #23580 2011.1.16 yyagi UI for InputAdjustTime in playing screen. + { + int offset; + if (keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧((int)SlimDXKeys.Key.LeftControl) || + keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧((int)SlimDXKeys.Key.RightControl)) + { + offset = plusminus; + } + else + { + offset = plusminus * 10; + } + + var newInputAdjustTimeMs = (TJAPlayer3.ConfigIni.nInputAdjustTimeMs + offset).Clamp(-99, 99); + TJAPlayer3.ConfigIni.nInputAdjustTimeMs = newInputAdjustTimeMs; + } + + protected abstract void t蜈・蜉帛ヲ逅_繝峨Λ繝(); + protected abstract void 繝峨Λ繝繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ繧「繝繝(); + protected abstract void 繝峨Λ繝繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ繝繧ヲ繝ウ(); + protected void t繧ュ繝シ蜈・蜉() + { + IInputDevice keyboard = TJAPlayer3.Input邂。逅.Keyboard; + if ( keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.F1 ) && + ( keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( (int)SlimDXKeys.Key.RightShift ) || keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( (int)SlimDXKeys.Key.LeftShift ) ) ) + { // shift+f1 (pause) + //this.bPAUSE = !this.bPAUSE; + //if ( this.bPAUSE ) + //{ + // CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.t荳譎ょ●豁「(); + // CDTXMania.Timer.t荳譎ょ●豁「(); + // CDTXMania.DTX.t蜈ィ繝√ャ繝励ョ蜀咲函荳譎ょ●豁「(); + //} + //else + //{ + // CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.t蜀埼幕(); + // CDTXMania.Timer.t蜀埼幕(); + // CDTXMania.DTX.t蜈ィ繝√ャ繝励ョ蜀咲函蜀埼幕(); + //} + } + if ( ( !this.bPAUSE && ( base.e繝輔ぉ繝シ繧コID != CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED ) ) && ( base.e繝輔ぉ繝シ繧コID != CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED_繝輔ぉ繝シ繝峨い繧ヲ繝 ) ) + { + this.t蜈・蜉帛ヲ逅_繝峨Λ繝(); + if ( keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.UpArrow ) && ( keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( (int)SlimDXKeys.Key.RightShift ) || keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( (int)SlimDXKeys.Key.LeftShift ) ) ) + { // shift (+ctrl) + UpArrow (BGMAdjust) + TJAPlayer3.DTX.t蜷閾ェ蜍募咲函髻ウ繝√ャ繝励ョ蜀咲函譎ょ綾繧貞、画峩縺吶k( ( keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( (int)SlimDXKeys.Key.LeftControl ) || keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( (int)SlimDXKeys.Key.RightControl ) ) ? 1 : 10 ); + TJAPlayer3.DTX.tWave蜀咲函菴咲スョ閾ェ蜍戊」懈ュ」(); + } + else if ( keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.DownArrow ) && ( keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( (int)SlimDXKeys.Key.RightShift ) || keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( (int)SlimDXKeys.Key.LeftShift ) ) ) + { // shift + DownArrow (BGMAdjust) + TJAPlayer3.DTX.t蜷閾ェ蜍募咲函髻ウ繝√ャ繝励ョ蜀咲函譎ょ綾繧貞、画峩縺吶k( ( keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( (int)SlimDXKeys.Key.LeftControl ) || keyboard.b繧ュ繝シ縺梧款縺輔l縺ヲ縺繧( (int)SlimDXKeys.Key.RightControl ) ) ? -1 : -10 ); + TJAPlayer3.DTX.tWave蜀咲函菴咲スョ閾ェ蜍戊」懈ュ」(); + } + else if ( keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.UpArrow ) ) + { // UpArrow(scrollspeed up) + 繝峨Λ繝繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ繧「繝繝(); + } + else if ( keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.DownArrow ) ) + { // DownArrow (scrollspeed down) + 繝峨Λ繝繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ繝繧ヲ繝ウ(); + } + else if ( keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.Delete ) ) + { // del (debug info) + TJAPlayer3.ConfigIni.b貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k = !TJAPlayer3.ConfigIni.b貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k; + } + else if ( keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.LeftArrow ) ) // #24243 2011.1.16 yyagi UI for InputAdjustTime in playing screen. + { + ChangeInputAdjustTimeInPlaying( keyboard, -1 ); + } + else if ( keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.RightArrow ) ) // #24243 2011.1.16 yyagi UI for InputAdjustTime in playing screen. + { + ChangeInputAdjustTimeInPlaying( keyboard, +1 ); + } + else if ( ( base.e繝輔ぉ繝シ繧コID == CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷 ) && ( keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.Escape ) || TJAPlayer3.Pad.b謚シ縺輔l縺檬B( E繝代ャ繝.FT ) ) && !this.actPauseMenu.bIsActivePopupMenu ) + { // escape (exit) + this.t貍泌・丈クュ豁「(); + } + else if ( keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.D1 ) ) + { + if (!TJAPlayer3.DTX.bHasBranch[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]]) return; + + //listBRANCH繧貞サ豁「縺励◆縺溘a蠑キ蛻カ蛻蟯舌ョ髢句ァ句、繧 + //rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms縺九i蠑輔▲蠑オ繧九%縺ィ縺ォ + + //蛻、螳壽棧縺ォ荳逡ェ霑代>繝√ャ繝励ョ諠蝣ア繧貞縺ォ荳蟆冗ッ蛻縺ョ蛟、繧定ィ育ョ励☆繧. 2020.04.21 akasoko26 + + var p蛻、螳壽棧縺ォ譛繧りソ代>繝√ャ繝 = r謖螳壽凾蛻サ縺ォ荳逡ェ霑代>譛ェ繝偵ャ繝Chip繧帝℃蜴サ譁ケ蜷大━蜈医〒讀懃エ「縺吶k((long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)), 0); + double db荳蟆冗ッ蠕 = 0.0; + if (p蛻、螳壽棧縺ォ譛繧りソ代>繝√ャ繝 != null) + db荳蟆冗ッ蠕 = ((15000.0 / p蛻、螳壽棧縺ォ譛繧りソ代>繝√ャ繝.dbBPM * (p蛻、螳壽棧縺ォ譛繧りソ代>繝√ャ繝.fNow_Measure_s / p蛻、螳壽棧縺ォ譛繧りソ代>繝√ャ繝.fNow_Measure_m)) * 16.0); + + this.t蛻蟯仙ヲ逅(CDTX.ECourse.eNormal, 0, (CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) + db荳蟆冗ッ蠕); + + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.t蛻蟯舌Ξ繧、繝、繝シ_繧ウ繝シ繧ケ螟牙喧(TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.stBranch[0].nAfter, CDTX.ECourse.eNormal, 0); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actMtaiko.tBranchEvent(TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actMtaiko.After[0], CDTX.ECourse.eNormal, 0); + this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ[0] = CDTX.ECourse.eNormal; + this.n谺。蝗槭ョ繧ウ繝シ繧ケ[0] = CDTX.ECourse.eNormal; + this.n繝ャ繝シ繝ウ逕ィ陦ィ遉コ繧ウ繝シ繧ケ[0] = CDTX.ECourse.eNormal; + + this.b蠑キ蛻カ逧縺ォ蛻蟯舌&縺帙◆[0] = true; + } + else if ( keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.D2 ) ) // #24243 2011.1.16 yyagi UI for InputAdjustTime in playing screen. + { + if (!TJAPlayer3.DTX.bHasBranch[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]]) return; + + //listBRANCH繧貞サ豁「縺励◆縺溘a蠑キ蛻カ蛻蟯舌ョ髢句ァ句、繧 + //rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms縺九i蠑輔▲蠑オ繧九%縺ィ縺ォ + + //蛻、螳壽棧縺ォ荳逡ェ霑代>繝√ャ繝励ョ諠蝣ア繧貞縺ォ荳蟆冗ッ蛻縺ョ蛟、繧定ィ育ョ励☆繧. 2020.04.21 akasoko26 + var p蛻、螳壽棧縺ォ譛繧りソ代>繝√ャ繝 = r謖螳壽凾蛻サ縺ォ荳逡ェ霑代>譛ェ繝偵ャ繝Chip繧帝℃蜴サ譁ケ蜷大━蜈医〒讀懃エ「縺吶k((long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)), 0); + + double db荳蟆冗ッ蠕 = 0.0; + if (p蛻、螳壽棧縺ォ譛繧りソ代>繝√ャ繝 != null) + db荳蟆冗ッ蠕 = ((15000.0 / p蛻、螳壽棧縺ォ譛繧りソ代>繝√ャ繝.dbBPM * (p蛻、螳壽棧縺ォ譛繧りソ代>繝√ャ繝.fNow_Measure_s / p蛻、螳壽棧縺ォ譛繧りソ代>繝√ャ繝.fNow_Measure_m)) * 16.0); + + this.t蛻蟯仙ヲ逅(CDTX.ECourse.eExpert, 0, (CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) + db荳蟆冗ッ蠕); + + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.t蛻蟯舌Ξ繧、繝、繝シ_繧ウ繝シ繧ケ螟牙喧(TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.stBranch[0].nAfter, CDTX.ECourse.eExpert, 0); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actMtaiko.tBranchEvent(TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actMtaiko.After[0], CDTX.ECourse.eExpert, 0); + + this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ[0] = CDTX.ECourse.eExpert; + this.n谺。蝗槭ョ繧ウ繝シ繧ケ[0] = CDTX.ECourse.eExpert; + this.n繝ャ繝シ繝ウ逕ィ陦ィ遉コ繧ウ繝シ繧ケ[0] = CDTX.ECourse.eExpert; + + this.b蠑キ蛻カ逧縺ォ蛻蟯舌&縺帙◆[0] = true; + } + else if ( keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.D3 ) ) // #24243 2011.1.16 yyagi UI for InputAdjustTime in playing screen. + { + if (!TJAPlayer3.DTX.bHasBranch[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]]) return; + + //listBRANCH繧貞サ豁「縺励◆縺溘a蠑キ蛻カ蛻蟯舌ョ髢句ァ句、繧 + //rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms縺九i蠑輔▲蠑オ繧九%縺ィ縺ォ + + //蛻、螳壽棧縺ォ荳逡ェ霑代>繝√ャ繝励ョ諠蝣ア繧貞縺ォ荳蟆冗ッ蛻縺ョ蛟、繧定ィ育ョ励☆繧. 2020.04.21 akasoko26 + var p蛻、螳壽棧縺ォ譛繧りソ代>繝√ャ繝 = r謖螳壽凾蛻サ縺ォ荳逡ェ霑代>譛ェ繝偵ャ繝Chip繧帝℃蜴サ譁ケ蜷大━蜈医〒讀懃エ「縺吶k((long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)), 0); + + double db荳蟆冗ッ蠕 = 0.0; + if (p蛻、螳壽棧縺ォ譛繧りソ代>繝√ャ繝 != null) + db荳蟆冗ッ蠕 = ((15000.0 / p蛻、螳壽棧縺ォ譛繧りソ代>繝√ャ繝.dbBPM * (p蛻、螳壽棧縺ォ譛繧りソ代>繝√ャ繝.fNow_Measure_s / p蛻、螳壽棧縺ォ譛繧りソ代>繝√ャ繝.fNow_Measure_m)) * 16.0); + + this.t蛻蟯仙ヲ逅(CDTX.ECourse.eMaster, 0, (CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) + db荳蟆冗ッ蠕); + + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.t蛻蟯舌Ξ繧、繝、繝シ_繧ウ繝シ繧ケ螟牙喧(TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.stBranch[0].nAfter, CDTX.ECourse.eMaster, 0); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actMtaiko.tBranchEvent(TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actMtaiko.After[0], CDTX.ECourse.eMaster, 0); + + this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ[0] = CDTX.ECourse.eMaster; + this.n谺。蝗槭ョ繧ウ繝シ繧ケ[0] = CDTX.ECourse.eMaster; + this.n繝ャ繝シ繝ウ逕ィ陦ィ遉コ繧ウ繝シ繧ケ[0] = CDTX.ECourse.eMaster; + + this.b蠑キ蛻カ逧縺ォ蛻蟯舌&縺帙◆[0] = true; + } + + if ( keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.F4 ) ) + { + if( TJAPlayer3.ConfigIni.bJudgeCountDisplay == false ) + TJAPlayer3.ConfigIni.bJudgeCountDisplay = true; + else + TJAPlayer3.ConfigIni.bJudgeCountDisplay = false; + } + else if ( keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.F5 ) ) + { + switch( TJAPlayer3.ConfigIni.eClipDispType ) + { + case EClipDispType.OFF: + TJAPlayer3.ConfigIni.eClipDispType = EClipDispType.閭梧勹縺ョ縺ソ; + break; + case EClipDispType.閭梧勹縺ョ縺ソ: + TJAPlayer3.ConfigIni.eClipDispType = EClipDispType.繧ヲ繧」繝ウ繝峨え縺ョ縺ソ; + break; + case EClipDispType.繧ヲ繧」繝ウ繝峨え縺ョ縺ソ: + TJAPlayer3.ConfigIni.eClipDispType = EClipDispType.荳。譁ケ; + break; + case EClipDispType.荳。譁ケ: + TJAPlayer3.ConfigIni.eClipDispType = EClipDispType.OFF; + break; + } + } + if (TJAPlayer3.ConfigIni.bTokkunMode) + { + if (keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.F6)) + { + if (TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay == false) + TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay = true; + else + TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay = false; + } + } + } + +#if DEBUG + + if (keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.F7)) + { + if (TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay2P == false) + TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay2P = true; + else + TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay2P = false; + } +#endif + if ( !this.actPauseMenu.bIsActivePopupMenu && this.bPAUSE && ( ( base.e繝輔ぉ繝シ繧コID != CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED ) ) && ( base.e繝輔ぉ繝シ繧コID != CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED_繝輔ぉ繝シ繝峨い繧ヲ繝 ) ) + { + if ( keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.UpArrow ) ) + { // UpArrow(scrollspeed up) + 繝峨Λ繝繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ繧「繝繝(); + } + else if ( keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.DownArrow ) ) + { // DownArrow (scrollspeed down) + 繝峨Λ繝繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ繝繧ヲ繝ウ(); + } + else if ( keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDXKeys.Key.Delete ) ) + { // del (debug info) + TJAPlayer3.ConfigIni.b貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k = !TJAPlayer3.ConfigIni.b貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k; + } + else if ((keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.Escape))) + { // escape (exit) + CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.t蜀埼幕(); + TJAPlayer3.Timer.t蜀埼幕(); + this.t貍泌・丈クュ豁「(); + } + } + +#region [ Minus & Equals Sound Group Level ] + KeyboardSoundGroupLevelControlHandler.Handle( + keyboard, TJAPlayer3.SoundGroupLevelController, TJAPlayer3.Skin, false); +#endregion + } + + protected void t蜈・蜉帙Γ繧ス繝繝芽ィ俶カ( E讌ス蝎ィ繝代シ繝 part ) + { + if ( TJAPlayer3.Pad.st讀懃衍縺励◆繝繝舌う繧ケ.Keyboard ) + { + this.b貍泌・上↓繧ュ繝シ繝懊シ繝峨r菴ソ縺」縺 = true; + } + if ( TJAPlayer3.Pad.st讀懃衍縺励◆繝繝舌う繧ケ.Joypad ) + { + this.b貍泌・上↓繧ク繝ァ繧、繝代ャ繝峨r菴ソ縺」縺 = true; + } + if ( TJAPlayer3.Pad.st讀懃衍縺励◆繝繝舌う繧ケ.MIDIIN ) + { + this.b貍泌・上↓MIDI蜈・蜉帙r菴ソ縺」縺 = true; + } + if ( TJAPlayer3.Pad.st讀懃衍縺励◆繝繝舌う繧ケ.Mouse ) + { + this.b貍泌・上↓繝槭え繧ケ繧剃スソ縺」縺 = true; + } + } + + + protected abstract void t騾イ陦梧緒逕サ_AVI(); + protected void t騾イ陦梧緒逕サ_AVI(int x, int y) + { + if ( ( ( base.e繝輔ぉ繝シ繧コID != CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED ) && ( base.e繝輔ぉ繝シ繧コID != CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED_繝輔ぉ繝シ繝峨い繧ヲ繝 ) ) && ( !TJAPlayer3.ConfigIni.b繧ケ繝医う繝繧ッ繝「繝シ繝 && TJAPlayer3.ConfigIni.bAVI譛牙柑 ) ) + { + this.actAVI.t騾イ陦梧緒逕サ( x, y ); + } + } + protected abstract void t騾イ陦梧緒逕サ_DANGER(); + protected void t騾イ陦梧緒逕サ_MIDIBGM() + { + if ( base.e繝輔ぉ繝シ繧コID != CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED ) + { + CStage.E繝輔ぉ繝シ繧コ e繝輔ぉ繝シ繧コid1 = base.e繝輔ぉ繝シ繧コID; + } + } + protected void t騾イ陦梧緒逕サ_STAGEFAILED() + { + if ( ( ( base.e繝輔ぉ繝シ繧コID == CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED ) || ( base.e繝輔ぉ繝シ繧コID == CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED_繝輔ぉ繝シ繝峨い繧ヲ繝 ) ) && ( ( this.actStageFailed.On騾イ陦梧緒逕サ() != 0 ) && ( base.e繝輔ぉ繝シ繧コID != CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED_繝輔ぉ繝シ繝峨い繧ヲ繝 ) ) ) + { + this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、 = E貍泌・冗判髱「縺ョ謌サ繧雁、.繧ケ繝繝シ繧ク螟ア謨; + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED_繝輔ぉ繝シ繝峨い繧ヲ繝; + this.actFO.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(); + } + } + + protected void t騾イ陦梧緒逕サ_繝√ャ繝励ヵ繧。繧、繧「GB() + { + this.actChipFireGB.On騾イ陦梧緒逕サ(); + } + protected abstract void t騾イ陦梧緒逕サ_繝代ロ繝ォ譁蟄怜(); + protected void t騾イ陦梧緒逕サ_繝代ロ繝ォ譁蟄怜( int x, int y ) + { + if ( ( base.e繝輔ぉ繝シ繧コID != CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED ) && ( base.e繝輔ぉ繝シ繧コID != CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED_繝輔ぉ繝シ繝峨い繧ヲ繝 ) ) + { + this.actPanel.t騾イ陦梧緒逕サ( x, y ); + } + } + protected void t繝代ロ繝ォ譁蟄怜励ョ險ュ螳() + { + // When performing calibration, inform the player that + // calibration is taking place, rather than + // displaying the panel title or song title as usual. + + var panelString = TJAPlayer3.IsPerformingCalibration + ? "Calibrating input..." + : string.IsNullOrEmpty( TJAPlayer3.DTX.PANEL ) ? TJAPlayer3.DTX.TITLE: TJAPlayer3.DTX.PANEL; + + this.actPanel.SetPanelString( panelString, TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.str譛ャ蠖薙ョ繧ク繝」繝ウ繝ォ, TJAPlayer3.Skin.Game_StageText ); + } + + + protected void t騾イ陦梧緒逕サ_繧イ繝シ繧ク() + { + if ( ( ( ( base.e繝輔ぉ繝シ繧コID != CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED ) && ( base.e繝輔ぉ繝シ繧コID != CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED_繝輔ぉ繝シ繝峨い繧ヲ繝 ) ) ) ) + { + this.actGauge.On騾イ陦梧緒逕サ(); + } + } + protected void t騾イ陦梧緒逕サ_繧ウ繝ウ繝() + { + this.actCombo.On騾イ陦梧緒逕サ(); + } + protected void t騾イ陦梧緒逕サ_繧ケ繧ウ繧「() + { + this.actScore.On騾イ陦梧緒逕サ(); + } + protected void t騾イ陦梧緒逕サ_繧ケ繝繝シ繧ソ繧ケ繝代ロ繝ォ() + { + this.actStatusPanels.On騾イ陦梧緒逕サ(); + } + protected bool t騾イ陦梧緒逕サ_繝√ャ繝( E讌ス蝎ィ繝代シ繝 ePlayMode ) + { + return this.t騾イ陦梧緒逕サ_繝√ャ繝( ePlayMode, 0 ); + } + protected bool t騾イ陦梧緒逕サ_繝√ャ繝( E讌ス蝎ィ繝代シ繝 ePlayMode, int nPlayer ) + { + if ( ( base.e繝輔ぉ繝シ繧コID == CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED ) || ( base.e繝輔ぉ繝シ繧コID == CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED_繝輔ぉ繝シ繝峨い繧ヲ繝 ) ) + { + return true; + } + if ( ( this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip == -1 ) || ( this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip >= listChip[ nPlayer ].Count ) ) + { + return true; + } + if (IsDanFailed) + { + return true; + } + + var n迴セ蝨ィ譎ょ綾ms = (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + + if ( this.r謖螳壽凾蛻サ縺ォ荳逡ェ霑代>譛ェ繝偵ャ繝Chip( (long)n迴セ蝨ィ譎ょ綾ms, 0x50, 0, 1000000, nPlayer ) == null ) + { + this.actChara.b貍泌・丈クュ[nPlayer] = false; + } + + var db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ = this.act隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ; + + //double speed = 264.0; // BPM150縺ョ譎ゅョ1蟆冗ッ縺ョ髟キ縺票dot] + const double speed = 324.0; // BPM150縺ョ譎ゅョ1蟆冗ッ縺ョ髟キ縺票dot] + + double ScrollSpeedDrums = (( db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums + 1.0 ) * speed ) * 0.5 * 37.5 / 60000.0; + double ScrollSpeedGuitar = ( db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Guitar + 1.0 ) * 0.5 * 0.5 * 37.5 * speed / 60000.0; + double ScrollSpeedBass = ( db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Bass + 1.0 ) * 0.5 * 0.5 * 37.5 * speed / 60000.0; + double ScrollSpeedTaiko = (( db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums + 1.0 ) * speed ) * 0.5 * 37.5 / 60000.0; + + CConfigIni configIni = TJAPlayer3.ConfigIni; + + CDTX dTX = TJAPlayer3.DTX; + bool bAutoPlay = false; + switch( nPlayer ) //2017.08.11 kairera0467 + { + case 0: + bAutoPlay = configIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay; + break; + case 1: + bAutoPlay = configIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay2P; + dTX = TJAPlayer3.DTX_2P; + break; + default: + break; + } + + if( this.n蛻蟯舌@縺溷屓謨ー[ nPlayer ] == 0 ) + { + this.bUseBranch[ nPlayer ] = dTX.bHIDDENBRANCH ? false : dTX.b繝√ャ繝励′縺ゅk.Branch; + } + + + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.轣ー, this.nLoopCount_Clear.ToString() ); + + float? play_bpm_time = null; + + //for ( int nCurrentTopChip = this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip; nCurrentTopChip < dTX.listChip.Count; nCurrentTopChip++ ) + for ( int nCurrentTopChip = dTX.listChip.Count - 1; nCurrentTopChip > 0; nCurrentTopChip-- ) + { + CDTX.CChip pChip = dTX.listChip[ nCurrentTopChip ]; +//Debug.WriteLine( "nCurrentTopChip=" + nCurrentTopChip + ", ch=" + pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ.ToString("x2") + ", 逋コ髻ウ菴咲スョ=" + pChip.n逋コ螢ー菴咲スョ + ", 逋コ螢ー譎ょ綾ms=" + pChip.n逋コ螢ー譎ょ綾ms ); + var time = pChip.n逋コ螢ー譎ょ綾ms - n迴セ蝨ィ譎ょ綾ms; + pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums = (int) ( time * ScrollSpeedDrums ); + pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Guitar = (int) ( time * ScrollSpeedGuitar ); + pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Bass = (int) ( time * ScrollSpeedBass ); + pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Taiko = (int)(time * pChip.dbBPM * pChip.dbSCROLL * (db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums + 1.0) / 502.8594 / 5.0); + if ( pChip.n繝弱シ繝邨ゆコ譎ょ綾ms != 0 ) + pChip.n繝舌シ縺九i縺ョ繝弱シ繝譛ォ遶ッ霍晞屬dot = (int)((pChip.n繝弱シ繝邨ゆコ譎ょ綾ms - n迴セ蝨ィ譎ょ綾ms) * pChip.dbBPM * pChip.dbSCROLL * (db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums + 1) / 502.8594 / 5.0); + + if ( configIni.eScrollMode == EScrollMode.BMSCROLL || configIni.eScrollMode == EScrollMode.HBSCROLL ) + { + if( !play_bpm_time.HasValue ) + { + play_bpm_time = this.GetNowPBMTime( dTX, 0 ); + } + + var dbSCROLL = configIni.eScrollMode == EScrollMode.BMSCROLL ? 1.0 : pChip.dbSCROLL; + + pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Taiko = (int)(3 * 0.8335 * ((pChip.fBMSCROLLTime * NOTE_GAP) - (play_bpm_time * NOTE_GAP)) * dbSCROLL * (db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums + 1) / 2 / 5.0); + if ( pChip.n繝弱シ繝邨ゆコ譎ょ綾ms != 0 ) + pChip.n繝舌シ縺九i縺ョ繝弱シ繝譛ォ遶ッ霍晞屬dot = (int)(3 * 0.8335 * ((pChip.fBMSCROLLTime_end * NOTE_GAP) - (play_bpm_time * NOTE_GAP)) * pChip.dbSCROLL * (db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums + 1.0) / 2 / 5.0); + } + + int instIndex = (int) pChip.e讌ス蝎ィ繝代シ繝; + + if (!pChip.IsMissed && !pChip.bHit) + { + if ( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x11 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x14 || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1A || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1B )//|| pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x9A ) + { + //縺薙▲縺。縺ョ縺サ縺縺碁←譬シ縺ィ閠縺医◆縺溘a繝輔Λ繧ー繧貞、画峩.2020.04.20 Akasoko26 + if (time <= 0) + { + if (this.e謖螳壽凾蛻サ縺九iChip縺ョJUDGE繧定ソ斐☆(n迴セ蝨ィ譎ょ綾ms, pChip) == E蛻、螳.Miss) + { + pChip.IsMissed = true; + pChip.eNoteState = ENoteState.bad; + this.t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅(n迴セ蝨ィ譎ょ綾ms, pChip, E讌ス蝎ィ繝代シ繝.TAIKO, false, 0, nPlayer); + } + } + } + } + + if( pChip.n繝舌シ縺九i縺ョ霍晞屬dot[ instIndex ] < -150 ) + { + if( !( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x11 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x14 ) || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1A || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1B ) + { + //2016.02.11 kairera0467 + //螟ェ鮠薙ョ蜊倬浹隨ヲ縺ョ蝣エ蜷医ッ蠎ァ讓吶↓繧医k蛻、螳壹r陦後o縺ェ縺縲 + //(縺薙%縺ァ蛻、螳壹r縺吶k縺ィ鬮倥せ繝斐シ繝峨〒繧ケ繧ッ繝ュ繝シ繝ォ縺励※縺繧区凾縺ォ隕矩縺嶺ク榊庄蛻、螳壹′陦後o繧後↑縺縲) + pChip.bHit = true; + } + } + + var cChipCurrentlyInProcess = chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕 nPlayer ]; + if( cChipCurrentlyInProcess != null && !cChipCurrentlyInProcess.bHit ) + { + if( cChipCurrentlyInProcess.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x13 && cChipCurrentlyInProcess.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x15 )//|| pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x9A ) + { + if ( ( ( cChipCurrentlyInProcess.n繝舌シ縺九i縺ョ霍晞屬dot.Taiko < -500 ) && ( cChipCurrentlyInProcess.n逋コ螢ー譎ょ綾ms <= n迴セ蝨ィ譎ょ綾ms && cChipCurrentlyInProcess.n繝弱シ繝邨ゆコ譎ょ綾ms >= n迴セ蝨ィ譎ょ綾ms ) ) ) + //( ( chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝.n繝舌シ縺九i縺ョ繝弱シ繝譛ォ遶ッ霍晞屬dot.Taiko < -500 ) && ( chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝.n逋コ螢ー譎ょ綾ms <= CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms && chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝.n繝弱シ繝邨ゆコ譎ょ綾ms >= CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms ) ) ) + //( ( pChip.n逋コ螢ー譎ょ綾ms <= CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms && pChip.n繝弱シ繝邨ゆコ譎ょ綾ms >= CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms ) ) ) + { + if( bAutoPlay ) + this.t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅( n迴セ蝨ィ譎ょ綾ms, cChipCurrentlyInProcess, E讌ス蝎ィ繝代シ繝.TAIKO, false, 0, nPlayer ); + } + } + } + + //if((!pChip.bHit || pChip.bShow) && (pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0)) + //{ + // NowProcessingChip[pChip.nPlayerSide] = nCurrentTopChip; + //} + + if(pChip.nPlayerSide == nPlayer && pChip.n逋コ螢ー譎ょ綾ms >= n迴セ蝨ィ譎ょ綾ms) + { + NowProcessingChip[pChip.nPlayerSide] = nCurrentTopChip; + } + + switch ( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ ) + { +#region [ 01: BGM ] + case 0x01: // BGM + if ( !pChip.bHit && ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0 ) ) + { + pChip.bHit = true; + if ( configIni.bBGM髻ウ繧堤匱螢ー縺吶k ) + { + dTX.t繝√ャ繝励ョ蜀咲函(pChip, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾 + (long)(pChip.n逋コ螢ー譎ょ綾ms / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))); + } + } + break; +#endregion +#region [ 03: BPM螟画峩 ] + case 0x03: // BPM螟画峩 + if ( !pChip.bHit && ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0 ) ) + { + pChip.bHit = true; + this.actPlayInfo.dbBPM = dTX.BASEBPM; //2016.07.10 kairera0467 螟ェ鮠薙ョ莉墓ァ倥↓縺ゅo縺帙※菫ョ豁」縲(縺昴b縺昴b縺ョ莉墓ァ倥′荳肴&繧ウ繝シ繝峨Α繧ケ逍第ヱ) + } + break; +#endregion +#region [ 08: BPM螟画峩(諡。蠑オ) ] + case 0x08: // BPM螟画峩(諡。蠑オ) + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 414 + pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums + 4, 192, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, "BRANCH START" + " " + pChip.n謨エ謨ー蛟、.ToString() ); + if ( !pChip.bHit && ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0 ) ) + { + pChip.bHit = true; + //if( pChip.n繧ウ繝シ繧ケ == this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ[ nPlayer ] ) + //{ + //double bpm = ( dTX.listBPM[ pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ].dbBPM蛟、 * ( ( (double) configIni.n貍泌・城溷コヲ ) / 20.0 ) ); + //int nUnit = (int)((60.0 / ( bpm ) / this.actChara.n繧ュ繝」繝ゥ繧ッ繧ソ繝シ騾壼クク繝「繝シ繧キ繝ァ繝ウ譫壽焚 ) * 1000 ); + //int nUnit_gogo = (int)((60.0 / ( bpm ) / this.actChara.n繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ譫壽焚 ) * 1000 ); + //this.actChara.ct騾壼クク繝「繝シ繧キ繝ァ繝ウ = new CCounter( 0, this.actChara.n繧ュ繝」繝ゥ繧ッ繧ソ繝シ騾壼クク繝「繝シ繧キ繝ァ繝ウ譫壽焚 - 1, nUnit, CDTXMania.Timer ); + //this.actChara.ct繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ = new CCounter(0, this.actChara.n繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ譫壽焚 - 1, nUnit_gogo * 2, CDTXMania.Timer); + + //} + } + break; +#endregion + +#region [ 11-1f: 螟ェ鮠1P ] + case 0x11: + case 0x12: + case 0x13: + case 0x14: + { + this.t騾イ陦梧緒逕サ_繝√ャ繝誉Taiko( configIni, ref dTX, ref pChip, nPlayer ); + } + break; + + case 0x15: + case 0x16: + case 0x17: + { + //2015.03.28 kairera0467 + //謠冗判鬆蠎上r螟峨∴繧九◆繧√√Γ繧、繝ウ蜃ヲ逅縺縺代r縺薙■繧峨↓谿九@縺ヲ謠冗判蜃ヲ逅縺ッ蛻髮「縲 + + //this.t騾イ陦梧緒逕サ_繝√ャ繝誉Taiko騾」謇(configIni, ref dTX, ref pChip); + //2015.04.13 kairera0467 縺薙%繧貞、悶&縺ェ縺縺ィ諱区枚2000縺ョ騾」謇薙↓蟇セ蠢懊〒縺阪★縲√%縺薙r縺、縺代↑縺縺ィ莉悶ョ繧ウ繝シ繧ケ縺ィ驥阪↑縺」縺ヲ縺繧矩」謇薙r縺ゥ縺縺ォ繧ゅ〒縺阪↑縺縲 + //蟶ク譎ょョ溯。後Γ繧ス繝繝峨↓貂。縺励◆繧牙ッセ蠢懊〒縺阪◆!? + //if ((!pChip.bHit && (pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0))) + { + if( ( pChip.n逋コ螢ー譎ょ綾ms <= (int)n迴セ蝨ィ譎ょ綾ms && pChip.n繝弱シ繝邨ゆコ譎ょ綾ms >= (int)n迴セ蝨ィ譎ょ綾ms ) ) + { + //if( this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ == pChip.n繧ウ繝シ繧ケ ) + if( pChip.b蜿ッ隕 == true ) + this.chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕 nPlayer ] = pChip; + } + } + if (pChip.n謠冗判蜆ェ蜈亥コヲ <= 0) + this.t騾イ陦梧緒逕サ_繝√ャ繝誉Taiko騾」謇(configIni, ref dTX, ref pChip, nPlayer); + } + + break; + case 0x18: + { + if( ( !pChip.bHit && (pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0 ) ) ) + { + this.b騾」謇謎クュ[ nPlayer ] = false; + this.actRoll.b陦ィ遉コ[ nPlayer ] = false; + this.actChara.b鬚ィ闊ケ騾」謇謎クュ[nPlayer] = false; + pChip.bHit = true; + if( chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕 nPlayer ] != null ) + { + chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕 nPlayer ].bHit = true; + if (nPlayer == 0 && chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕nPlayer].nBalloon > chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕nPlayer].nRollCount && chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕nPlayer].nRollCount > 0 && actChara.CharaAction_Balloon_Miss != null) + { + if (TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Miss > 0) + { + actChara.繧「繧ッ繧キ繝ァ繝ウ繧ソ繧、繝槭シ繝ェ繧サ繝繝(nPlayer); + actChara.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[nPlayer] = true; + actChara.CharaAction_Balloon_Miss[nPlayer] = new CCounter(0, TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Miss - 1, TJAPlayer3.Skin.Game_Chara_Balloon_Timer, TJAPlayer3.Timer); + if (actChara.CharaAction_Balloon_Delay != null) actChara.CharaAction_Balloon_Delay[nPlayer] = new CCounter(0, TJAPlayer3.Skin.Game_Chara_Balloon_Delay - 1, 1, TJAPlayer3.Timer); + } + } + chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕nPlayer] = null; + + } + this.eRollState = E騾」謇鉄tate.none; + } + if( pChip.n謠冗判蜆ェ蜈亥コヲ <= 0 ) + this.t騾イ陦梧緒逕サ_繝√ャ繝誉Taiko騾」謇(configIni, ref dTX, ref pChip, nPlayer); + } + + break; + case 0x19: + case 0x1c: + case 0x1d: + case 0x1e: + break; + + case 0x1a: + case 0x1b: + case 0x1f: + { + this.t騾イ陦梧緒逕サ_繝√ャ繝誉Taiko( configIni, ref dTX, ref pChip, nPlayer ); + } + break; +#endregion +#region [ 20-2F: EmptySlot ] + case 0x20: + case 0x21: + case 0x22: + case 0x23: + case 0x24: + case 0x25: + case 0x26: + case 0x27: + case 0x28: + case 0x29: + case 0x2a: + case 0x2b: + case 0x2c: + case 0x2d: + case 0x2e: + case 0x2f: + break; +#endregion +#region [ 31-3f: EmptySlot ] + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: + case 0x3a: + case 0x3b: + case 0x3c: + case 0x3d: + case 0x3e: + case 0x3f: + break; +#endregion + +#region [ 50: 蟆冗ッ邱 ] + case 0x50: // 蟆冗ッ邱 + { + if ( !pChip.bHit && ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Taiko < 0 ) ) + { + this.actChara.b貍泌・丈クュ[nPlayer] = true; + if( this.actPlayInfo.NowMeasure[nPlayer] == 0 ) + { + for (int i = 0; i < 2; i++) + { + ctChipAnime[i] = new CCounter(0, 3, 60.0 / TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM * 1 / 4 / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0), CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + } + + if (TJAPlayer3.Skin.Game_Chara_Ptn_Normal != 0) + { + double dbPtn_Normal = (60.0 / TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM) * TJAPlayer3.Skin.Game_Chara_Beat_Normal / this.actChara.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0); + this.actChara.ctChara_Normal[nPlayer] = new CCounter(0, this.actChara.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, dbPtn_Normal, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + } + else + { + this.actChara.ctChara_Normal[nPlayer] = new CCounter(); + } + if (TJAPlayer3.Skin.Game_Chara_Ptn_Clear != 0) + { + double dbPtn_Clear = (60.0 / TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM) * TJAPlayer3.Skin.Game_Chara_Beat_Clear / this.actChara.ar繧ッ繝ェ繧「繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0); + this.actChara.ctChara_Clear[nPlayer] = new CCounter(0, this.actChara.ar繧ッ繝ェ繧「繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, dbPtn_Clear, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + } + else + { + this.actChara.ctChara_Clear[nPlayer] = new CCounter(); + } + if (TJAPlayer3.Skin.Game_Chara_Ptn_GoGo != 0) + { + double dbPtn_GoGo = (60.0 / TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM) * TJAPlayer3.Skin.Game_Chara_Beat_GoGo / this.actChara.ar繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0); + this.actChara.ctChara_GoGo[nPlayer] = new CCounter(0, this.actChara.ar繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, dbPtn_GoGo, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + } + else + { + this.actChara.ctChara_GoGo[nPlayer] = new CCounter(); + } + if (TJAPlayer3.Skin.Game_Dancer_Ptn != 0) + { + double dbUnit_dancer = (((60 / (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM))) / this.actDancer.ar雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length) / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0); + this.actDancer.ct雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ = new CCounter(0, this.actDancer.ar雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, dbUnit_dancer * TJAPlayer3.Skin.Game_Dancer_Beat, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + } + else + { + this.actDancer.ct雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ = new CCounter(); + } + if (TJAPlayer3.Skin.Game_Mob_Ptn != 0 && TJAPlayer3.Skin.Game_Mob_Beat > 0 ) //2018.6.15 Game_Mob_Beat縺0縺ョ縺セ縺セCCounter逕滓舌r縺輔l縺ヲ辟。髯舌Ν繝シ繝励′逋コ逕溘@縺ェ縺繧医≧蟇セ遲 + { + this.actMob.ctMob = new CCounter(1, 180, 60.0 / TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM * TJAPlayer3.Skin.Game_Mob_Beat / 180 / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0), CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + this.actMob.ctMobPtn = new CCounter(0, TJAPlayer3.Skin.Game_Mob_Ptn - 1, 60.0 / TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM * TJAPlayer3.Skin.Game_Mob_Ptn_Beat / TJAPlayer3.Skin.Game_Mob_Ptn / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0), CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + } + else + { + this.actMob.ctMob = new CCounter(); + this.actMob.ctMobPtn = new CCounter(); + } + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.PuchiChara.ChangeBPM(60.0 / TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + } + if (!bPAUSE)//2020.07.08 Mr-Ojii KabanFriends豌上ョ繧ウ繝シ繝峨r蜿り縺ォ + { + actPlayInfo.NowMeasure[nPlayer] = pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ; + + //this.actChara.ctChara_Normal = new CCounter( 0, this.actChara.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, dbPtn_Normal, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝 ); + //this.actChara.ctChara_GoGo = new CCounter( 0, this.actChara.ar繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, dbPtn_GoGo, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝 ); + //this.actChara.ctChara_Clear = new CCounter( 0, this.actChara.ar繧ッ繝ェ繧「繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, dbPtn_Clear, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝 ); + + //this.ct蛻カ蠕。繧ソ繧、繝 = new CCounter(0, 10, 500, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + + //for (int i = 0; i < 2; i++) + //{ + // ctChipAnime[i] = new CCounter(0, 3, 60.0 / CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM * 1 / 4, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + //} + + ////this.actChara.ctChara_Normal.n迴セ蝨ィ縺ョ蛟、 = 0; + + ////this.actDancer.ct騾壼クク繝「繝シ繧キ繝ァ繝ウ = new CCounter( 0, this.actDancer.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ_騾壼クク.Length - 1, ( dbUnit * 4.0) / this.actDancer.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ_騾壼クク.Length, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝 ); + + //// 竊楢ク翫j蟄舌サ繝「繝問 + //this.actDancer.ct雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ = new CCounter(0, this.actDancer.ar雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, (dbUnit * CDTXMania.Skin.Game_Dancer_Beat) / this.actDancer.ar雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + ////this.actChara.ct繝「繝悶Δ繝シ繧キ繝ァ繝ウ = new CCounter(0, this.actChara.ar繝「繝悶Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, (dbUnit) / this.actChara.ar繝「繝悶Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + //this.actDancer.ct雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ.n迴セ蝨ィ縺ョ蛟、 = 0; + ////this.actChara.ct繝「繝悶Δ繝シ繧キ繝ァ繝ウ.n迴セ蝨ィ縺ョ蛟、 = 0; + //this.actMob.ctMob = new CCounter(1, 180, 60.0 / CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM * CDTXMania.Skin.Game_Mob_Beat / 180, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + //this.actMob.ctMobPtn = new CCounter(0, CDTXMania.Skin.Game_Mob_Ptn - 1, 60.0 / CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM * CDTXMania.Skin.Game_Mob_Ptn_Beat / CDTXMania.Skin.Game_Mob_Ptn, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + //// 竊題ク翫j蟄舌サ繝「繝問 + ////this.actDancer.ct繝「繝 = new CCounter( 1.0, 16.0, (( dbUnit / 16.0 )), CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝 ); + + //if (CDTXMania.Skin.Game_Chara_Ptn_Clear != 0 ) + //{ + // double dbUnit_max = ( ( ( 60.0 / ( CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM ) ) ) / this.actChara.ar繧ッ繝ェ繧「繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length ); + // this.actChara.ctChara_Clear = new CCounter( 0, this.actChara.ar繧ッ繝ェ繧「繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, dbPtn_Clear, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝 ); + //} + //if(CDTXMania.Skin.Game_Chara_Ptn_GoGo != 0 ) + //{ + // double dbUnit_max_gogo = ( ( ( 60.0 / ( CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM ) ) ) / this.actChara.ar繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length ); + // this.actChara.ctChara_GoGo = new CCounter( 0, this.actChara.ar繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, dbPtn_GoGo, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝 ); + //} + } + pChip.bHit = true; + } + this.t騾イ陦梧緒逕サ_繝√ャ繝誉蟆冗ッ邱( configIni, ref dTX, ref pChip, nPlayer ); + break; + } +#endregion +#region [ 51: 諡咲キ ] + case 0x51: // 諡咲キ + if ( !pChip.bHit && ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0 ) ) + { + pChip.bHit = true; + } + //螟ェ鮠薙〒縺ッ諡咲キ壹r菴ソ繧上↑縺縲 + //this.tx繝√ャ繝.t2D謠冗判( CDTXMania.app.Device, 295, configIni.bReverse.Drums ? ( ( 0x38 + pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums ) - 1 ) : ( ( 567 - pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums ) - 1 ), new Rectangle( 0, 772, 559, 2 ) ); + + //this.t騾イ陦梧緒逕サ_繝√ャ繝誉蟆冗ッ邱( configIni, ref dTX, ref pChip ); + break; +#endregion +#region [ 54: 蜍慕判蜀咲函 ] + case 0x54: // 蜍慕判蜀咲函 + if ( !pChip.bHit && ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0 ) ) + { + pChip.bHit = true; + if ( configIni.bAVI譛牙柑 ) + { + switch ( pChip.eAVI遞ョ蛻・ ) + { + case EAVI遞ョ蛻・.AVI: + if ( pChip.rAVI != null ) + { + this.actAVI.Start( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ, pChip.rAVI, pChip.rDShow, 278, 355, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, pChip.n逋コ螢ー譎ょ綾ms ); + } + break; + case EAVI遞ョ蛻・.Unknown: + if ( pChip.rAVI != null || pChip.rDShow != null ) + { + this.actAVI.Start( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ, pChip.rAVI, pChip.rDShow, 278, 355, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, pChip.n逋コ螢ー譎ょ綾ms ); + } + break; + } + } + } + break; +#endregion +#region[ 55-60: EmptySlot ] + case 0x55: + case 0x56: + case 0x57: + case 0x58: + case 0x59: + break; +#endregion +#region [ 61-89: EmptySlot ] + case 0x60: + case 0x61: + case 0x62: + case 0x63: + case 0x64: + case 0x65: + case 0x66: + case 0x67: + case 0x68: + case 0x69: + case 0x70: + case 0x71: + case 0x72: + case 0x73: + case 0x74: + case 0x75: + case 0x76: + case 0x77: + case 0x78: + case 0x79: + case 0x80: + case 0x81: + case 0x82: + case 0x83: + case 0x84: + case 0x85: + case 0x86: + case 0x87: + case 0x88: + case 0x89: + break; +#endregion + +#region[ 90-9A: EmptySlot ] + case 0x90: + case 0x91: + case 0x92: + case 0x93: + case 0x94: + case 0x95: + case 0x96: + case 0x97: + case 0x98: + case 0x99: + case 0x9A: + break; +#endregion + +#region[ 9B-9F: 螟ェ鮠 ] + case 0x9B: + // 谿オ菴崎ェ榊ョ壹Δ繝シ繝峨ョ蟷輔い繝九Γ繝シ繧キ繝ァ繝ウ + if ( !pChip.bHit && ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0)) + { + pChip.bHit = true; + this.actPanel.t豁瑚ゥ槭ユ繧ッ繧ケ繝√Ε繧貞炎髯、縺吶k(); + if (pChip.n繧ウ繝シ繧ケ == this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ[nPlayer]) + { + if(ListDan_Number != 0 && actDan.FirstSectionAnime) + { + if (this.actDan.GetFailedAllChallenges()) + { + this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip = TJAPlayer3.DTX.listChip.Count - 1; // 邨らォッ縺ォ繧キ繝シ繧ッ + IsDanFailed = true; + return true; + } + this.actDan.Start(this.ListDan_Number); + ListDan_Number++; + } + else + { + actDan.FirstSectionAnime = true; + } + } + } + break; + //0x9C BPM螟牙喧(繧「繝九Γ繝シ繧キ繝ァ繝ウ逕ィ) + case 0x9C: + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 414 + pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Taiko + 8, 192, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, "BPMCHANGE" ); + if ( !pChip.bHit && ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0 ) ) + { + pChip.bHit = true; + if( pChip.n繧ウ繝シ繧ケ == this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ[ nPlayer ] ) + { + if ( dTX.listBPM.TryGetValue( pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, out CDTX.CBPM cBPM ) ) + { + this.actPlayInfo.dbBPM = cBPM.dbBPM蛟、;// + dTX.BASEBPM; + } + + + for (int i = 0; i < 2; i++) + { + ctChipAnime[i] = new CCounter(0, 3, 60.0 / TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM * 1 / 4, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + } + + if (TJAPlayer3.Skin.Game_Chara_Ptn_Normal != 0) + { + double dbPtn_Normal = (60.0 / TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM) * TJAPlayer3.Skin.Game_Chara_Beat_Normal / this.actChara.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0); + this.actChara.ctChara_Normal[nPlayer] = new CCounter(0, this.actChara.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, dbPtn_Normal, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + } else + { + this.actChara.ctChara_Normal[nPlayer] = new CCounter(); + } + if (TJAPlayer3.Skin.Game_Chara_Ptn_Clear != 0) + { + double dbPtn_Clear = (60.0 / TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM) * TJAPlayer3.Skin.Game_Chara_Beat_Clear / this.actChara.ar繧ッ繝ェ繧「繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0); + this.actChara.ctChara_Clear[nPlayer] = new CCounter(0, this.actChara.ar繧ッ繝ェ繧「繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, dbPtn_Clear, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + } + else + { + this.actChara.ctChara_Clear[nPlayer] = new CCounter(); + } + if (TJAPlayer3.Skin.Game_Chara_Ptn_GoGo != 0) + { + double dbPtn_GoGo = (60.0 / TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM) * TJAPlayer3.Skin.Game_Chara_Beat_GoGo / this.actChara.ar繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0); + this.actChara.ctChara_GoGo[nPlayer] = new CCounter(0, this.actChara.ar繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, dbPtn_GoGo, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + } else + { + this.actChara.ctChara_GoGo[nPlayer] = new CCounter(); + } + if (TJAPlayer3.Skin.Game_Dancer_Ptn != 0) + { + double dbUnit_dancer = (((60 / (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM))) / this.actDancer.ar雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length) / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0); + this.actDancer.ct雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ = new CCounter(0, this.actDancer.ar雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, dbUnit_dancer * TJAPlayer3.Skin.Game_Dancer_Beat, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + } + else + { + this.actDancer.ct雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ = new CCounter(); + } + if (TJAPlayer3.Skin.Game_Mob_Ptn != 0) + { + this.actMob.ctMobPtn = new CCounter(0, TJAPlayer3.Skin.Game_Mob_Ptn - 1, 60.0 / TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM * TJAPlayer3.Skin.Game_Mob_Ptn_Beat / TJAPlayer3.Skin.Game_Mob_Ptn / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0), CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + this.actMob.ctMobPtn = new CCounter(0, TJAPlayer3.Skin.Game_Mob_Ptn - 1, 60.0 / TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM * TJAPlayer3.Skin.Game_Mob_Ptn_Beat / TJAPlayer3.Skin.Game_Mob_Ptn, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + } else + { + this.actMob.ctMob = new CCounter(); + this.actMob.ctMobPtn = new CCounter(); + } + + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.PuchiChara.ChangeBPM(60.0 / TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM); + //this.actDancer.ct雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ = new CCounter(0, this.actDancer.ar雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, (dbUnit * CDTXMania.Skin.Game_Dancer_Beat) / this.actDancer.ar雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + //this.actChara.ct繝「繝悶Δ繝シ繧キ繝ァ繝ウ = new CCounter(0, this.actChara.ar繝「繝悶Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, (dbUnit) / this.actChara.ar繝「繝悶Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + //#if C_82D982F182AF82CD82A282AF82A2 + /* + * for( int dancer = 0; dancer < 5; dancer++ ) + this.actDancer.st謚輔£荳翫£[ dancer ].ct騾イ陦 = new CCounter( 0, this.actDancer.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ_逋サ蝣エ.Length - 1, dbUnit / this.actDancer.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ_逋サ蝣エ.Length, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝 ); + + this.actDancer.ct騾壼クク繝「繝シ繧キ繝ァ繝ウ = new CCounter( 0, this.actDancer.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ_騾壼クク.Length - 1, ( dbUnit * 4 ) / this.actDancer.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ_騾壼クク.Length, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝 ); + this.actDancer.ct繝「繝 = new CCounter( 1.0, 16.0, (int)((60.0 / bpm / 16.0 ) * 1000 ), CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝 ); +//#endif + */ + } + + } + break; + + case 0x9D: //SCROLL + if ( !pChip.bHit && ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0 ) ) + { + pChip.bHit = true; + //if ( dTX.listSCROLL.ContainsKey( pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ) ) + //{ + //this.actPlayInfo.dbBPM = ( dTX.listBPM[ pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ].dbBPM蛟、 * ( ( (double) configIni.n貍泌・城溷コヲ ) / 20.0 ) );// + dTX.BASEBPM; + //} + } + break; + + case 0x9E: //繧エ繝シ繧エ繝シ繧ソ繧、繝 + if( !pChip.bHit && ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0 ) ) + { + pChip.bHit = true; + this.bIsGOGOTIME[ nPlayer ] = true; + //double dbUnit = (((60.0 / (CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM)))); + double dbUnit = (((60.0 / pChip.dbBPM))); + + { + if (TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].b邨ゆコ蛟、縺ォ驕斐@縺) + { + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[nPlayer] < 100) + { + // 鬲ゅご繝シ繧クMAX縺ァ縺ッ縺ェ縺 + // 繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝_繝弱シ繝槭Ν + this.actChara.繧「繧ッ繧キ繝ァ繝ウ繧ソ繧、繝槭シ繝ェ繧サ繝繝(nPlayer); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝[nPlayer] = new CCounter(0, TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart - 1, (dbUnit / TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart) * 2, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝[nPlayer].t騾イ陦慧b(); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝[nPlayer].n迴セ蝨ィ縺ョ蛟、 = 0; + this.actChara.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[nPlayer] = true; + //this.actChara.繝槭う縺ゥ繧点繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝(); + } + } + if (TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart_Max != 0 && actChara.CharaAction_Balloon_Delay[nPlayer].b邨ゆコ蛟、縺ォ驕斐@縺) + { + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[nPlayer] >= 100) + { + // 鬲ゅご繝シ繧クMAX + // 繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝_MAX + this.actChara.繧「繧ッ繧キ繝ァ繝ウ繧ソ繧、繝槭シ繝ェ繧サ繝繝(nPlayer); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝MAX[nPlayer] = new CCounter(0, TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart_Max - 1, (dbUnit / TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart_Max) * 2, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝MAX[nPlayer].t騾イ陦慧b(); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝MAX[nPlayer].n迴セ蝨ィ縺ョ蛟、 = 0; + this.actChara.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[nPlayer] = true; + } + } + + } + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.GOGOSTART(); + } + break; + case 0x9F: //繧エ繝シ繧エ繝シ繧ソ繧、繝 + if( !pChip.bHit && ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0 ) ) + { + pChip.bHit = true; + this.bIsGOGOTIME[ nPlayer ] = false; + } + break; +#endregion + +#region [ a0-a8: EmptySlot ] + case 0xa0: + case 0xa1: + case 0xa2: + case 0xa3: + case 0xa4: + case 0xa5: + case 0xa6: + case 0xa7: + case 0xa8: + break; +#endregion +#region [ B1ス曖C EmptySlot ] + case 0xb1: + case 0xb2: + case 0xb3: + case 0xb4: + case 0xb5: + case 0xb6: + case 0xb7: + case 0xb8: + case 0xb9: + case 0xba: + case 0xbb: + case 0xbc: + break; +#endregion +#region [ c4, c7, d5-d9: EmptySlot ] + case 0xc4: + case 0xc7: + case 0xd5: + case 0xd6: // BGA逕サ蜒丞・繧梧崛縺 + case 0xd7: + case 0xd8: + case 0xd9: + //case 0xe0: + if ( !pChip.bHit && ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0 ) ) + { + pChip.bHit = true; + } + break; +#endregion + +#region [ da: 繝溘く繧オ繝シ縺ク繝√ャ繝鈴浹霑ス蜉 ] + case 0xDA: + if ( !pChip.bHit && ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0 ) ) + { +//Debug.WriteLine( "[DA(AddMixer)] BAR=" + pChip.n逋コ螢ー菴咲スョ / 384 + " ch=" + pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ.ToString( "x2" ) + ", wav=" + pChip.n謨エ謨ー蛟、.ToString( "x2" ) + ", time=" + pChip.n逋コ螢ー譎ょ綾ms ); + pChip.bHit = true; + if ( listWAV.TryGetValue( pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, out CDTX.CWAV wc ) ) // 蜿らァ縺碁□縺縺ョ縺ァ蠕梧律譛驕ゥ蛹悶☆繧 + { + for ( int i = 0; i < nPolyphonicSounds; i++ ) + { + if ( wc.rSound[ i ] != null ) + { + //CDTXMania.Sound邂。逅.AddMixer( wc.rSound[ i ] ); + AddMixer( wc.rSound[ i ], pChip.b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk ); + } + } + } + } + break; +#endregion +#region [ db: 繝溘く繧オ繝シ縺九i繝√ャ繝鈴浹蜑企勁 ] + case 0xDB: + if ( !pChip.bHit && ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0 ) ) + { +//Debug.WriteLine( "[DB(RemoveMixer)] BAR=" + pChip.n逋コ螢ー菴咲スョ / 384 + " ch=" + pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ.ToString( "x2" ) + ", wav=" + pChip.n謨エ謨ー蛟、.ToString( "x2" ) + ", time=" + pChip.n逋コ螢ー譎ょ綾ms ); + pChip.bHit = true; + if ( listWAV.TryGetValue( pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, out CDTX.CWAV wc ) ) // 蜿らァ縺碁□縺縺ョ縺ァ蠕梧律譛驕ゥ蛹悶☆繧 + { + for ( int i = 0; i < nPolyphonicSounds; i++ ) + { + if ( wc.rSound[ i ] != null ) + { + //CDTXMania.Sound邂。逅.RemoveMixer( wc.rSound[ i ] ); + if ( !wc.rSound[ i ].b貍泌・冗オゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励〒縺ゅk ) // #32248 2013.10.16 yyagi + { // DTX邨ゆコ蠕後b蜀咲函縺檎カ壹¥繝√ャ繝励ョ0xDB逋サ骭イ繧偵↑縺上☆縺薙→縺ッ縺ァ縺阪★縲 + RemoveMixer( wc.rSound[ i ] ); // (繝溘く繧オ繝シ隗」髯、縺ョ繧ソ繧、繝溘Φ繧ー縺碁≦蟒カ縺吶k蝣エ蜷医ョ蟇セ蠢懊′髱「蛟偵↑縺ョ縺ァ縲) + } // 縺昴%縺ァ縲∽サ」繧上j縺ォ繝輔Λ繧ー繧偵メ繧ァ繝繧ッ縺励※繝溘く繧オ繝シ蜑企勁繝ュ繧ク繝繧ッ縺ク縺ョ驕キ遘サ繧偵き繝繝医☆繧九 + } + } + } + } + break; +#endregion + +#region[ dc-df:螟ェ鮠(迚ケ谿雁多莉、) ] + case 0xDC: //DELAY + if ( !pChip.bHit && ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0 ) ) + { + pChip.bHit = true; + //if ( dTX.listDELAY.ContainsKey( pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ) ) + //{ + //this.actPlayInfo.dbBPM = ( dTX.listBPM[ pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ ].dbBPM蛟、 * ( ( (double) configIni.n貍泌・城溷コヲ ) / 20.0 ) );// + dTX.BASEBPM; + //} + } + break; + case 0xDD: //SECTION + if (!pChip.bHit && (pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < -10)) + { + // 蛻蟯先ッ弱↓繝ェ繧サ繝繝医@縺ヲ縺縺溘ョ縺ァSECTION縺ョ蜻ス莉、縺梧擂縺溘i繝ェ繧サ繝繝医☆繧九 + this.tBranchReset(nPlayer); + pChip.bHit = true; + } + break; + + case 0xDE: //Judge縺ォ蠢懊§縺櫃ourse繧貞叙蠕 + if (!pChip.bHit && (pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0)) + { + this.b蠑キ蛻カ蛻蟯占ュ憺擇[nPlayer] = false; + //蛻蟯舌ョ遞ョ鬘槭ッ繝励Ξ繧、繝、繝シ髢「菫ゅ↑縺縺ィ諤昴≧ + this.eBranch遞ョ鬘 = pChip.e蛻蟯舌ョ遞ョ鬘; + this.nBranch譚。莉カ謨ー蛟、A = pChip.n譚。莉カ謨ー蛟、A; + this.nBranch譚。莉カ謨ー蛟、B = pChip.n譚。莉カ謨ー蛟、B; + if (!this.bLEVELHOLD[nPlayer]) + { + //謌蝉サ2000縺ォ縺ゅk-2,-1縺縺」縺溘i驕比ココ縺ォ蠑キ蛻カ蛻蟯舌∩縺溘>縺ェ縲 + this.t蠑キ蛻カ逕ィ譚。莉カ縺九r蛻、譁ュ縺吶k(pChip.n譚。莉カ謨ー蛟、A, pChip.n譚。莉カ謨ー蛟、B, nPlayer); + + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bUseBranch[nPlayer] = true; + this.tBranchJudge(pChip, this.CBranchScore[nPlayer].cBigNotes, this.CBranchScore[nPlayer].nScore, this.CBranchScore[nPlayer].nRoll, this.CBranchScore[nPlayer].nGreat, this.CBranchScore[nPlayer].nGood, this.CBranchScore[nPlayer].nMiss, nPlayer); + + if (this.b蠑キ蛻カ蛻蟯占ュ憺擇[nPlayer])//蠑キ蛻カ蛻蟯占ュ憺擇縺縺」縺溘i谺。蝗槭さ繝シ繧ケ繧偵◎縺ョ繧ウ繝シ繧ケ縺ォ繧サ繝繝 + this.n谺。蝗槭ョ繧ウ繝シ繧ケ[nPlayer] = this.E蠑キ蛻カ繧ウ繝シ繧ケ[nPlayer]; + + this.t蛻蟯仙ヲ逅(this.n谺。蝗槭ョ繧ウ繝シ繧ケ[nPlayer], nPlayer, pChip.n蛻蟯先凾蛻サms, pChip.e蛻蟯舌ョ遞ョ鬘); + + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.t蛻蟯舌Ξ繧、繝、繝シ_繧ウ繝シ繧ケ螟牙喧(TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.stBranch[nPlayer].nAfter, this.n谺。蝗槭ョ繧ウ繝シ繧ケ[nPlayer], nPlayer); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actMtaiko.tBranchEvent(TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actMtaiko.After[nPlayer], this.n谺。蝗槭ョ繧ウ繝シ繧ケ[nPlayer], nPlayer); + this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ[nPlayer] = this.n谺。蝗槭ョ繧ウ繝シ繧ケ[nPlayer]; + } + this.n蛻蟯舌@縺溷屓謨ー[nPlayer]++; + pChip.bHit = true; + } + break; + case 0x52://End蜃ヲ逅 + if (!pChip.bHit && (pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0)) + { + + pChip.bHit = true; + } + + break; + case 0xE0: + //if( !pChip.bHit && ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0 ) ) + //{ + //#BARLINEON縺ィ#BARLINEOFF + //貍泌・丈クュ縺ッ菴ソ逕ィ縺励∪縺帙s縲 + //} + break; + case 0xE1: + if (!pChip.bHit && (pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0)) + { + //LEVELHOLD + this.bLEVELHOLD[nPlayer] = true; + } + break; + case 0xE2: + if( !pChip.bHit && ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0 ) ) + { + if (nPlayer == 0) + { + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.t蛻、螳壽棧遘サ蜍(dTX.listJPOSSCROLL[nJPOSSCROLL[nPlayer]].db遘サ蜍墓凾髢, dTX.listJPOSSCROLL[nJPOSSCROLL[nPlayer]].n遘サ蜍戊キ晞屬px, dTX.listJPOSSCROLL[nJPOSSCROLL[nPlayer]].n遘サ蜍墓婿蜷); + } + else + { + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.t蛻、螳壽棧遘サ蜍2(dTX.listJPOSSCROLL[nJPOSSCROLL[nPlayer]].db遘サ蜍墓凾髢, dTX.listJPOSSCROLL[nJPOSSCROLL[nPlayer]].n遘サ蜍戊キ晞屬px, dTX.listJPOSSCROLL[nJPOSSCROLL[nPlayer]].n遘サ蜍墓婿蜷); + } + this.nJPOSSCROLL[ nPlayer ]++; + pChip.bHit = true; + } + break; +#endregion +#region[ f1: 豁瑚ゥ ] + case 0xF1: + if (!pChip.bHit && (pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0)) + { + if (dTX.listLyric.Count > ShownLyric[nPlayer] && dTX.nPlayerSide == nPlayer) + { + this.actPanel.t豁瑚ゥ槭ユ繧ッ繧ケ繝√Ε繧堤函謌舌☆繧(dTX.listLyric[ShownLyric[nPlayer]]); + ShownLyric[nPlayer]++; + } + pChip.bHit = true; + } + break; +#endregion +#region[ ff: 隴憺擇縺ョ蠑キ蛻カ邨ゆコ ] + //繝舌げ縺ァ隴憺擇縺後→縺ヲ縺、繧ゅ↑縺縺薙→縺ォ縺ェ縺」縺ヲ縺繧九◆繧√#END縺後″縺溘i縺薙l繧貞キョ縺苓セシ繧縲 + case 0xFF: + if ( !pChip.bHit && ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0 ) ) + { + if (TJAPlayer3.ConfigIni.bTokkunMode) + { + foreach (CDTX.CWAV cwav in TJAPlayer3.DTX.listWAV.Values) + { + for (int i = 0; i < nPolyphonicSounds; i++) + { + if ((cwav.rSound[i] != null) && cwav.rSound[i].b蜀咲函荳ュ) + { + return false; + } + } + } + } + pChip.bHit = true; + return true; + } + break; +#endregion + +#region [ 縺昴ョ莉(譛ェ螳夂セゥ) ] + default: + if ( !pChip.bHit && ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0 ) ) + { + pChip.bHit = true; + } + break; +#endregion + } + + } + return false; + } + + protected bool t騾イ陦梧緒逕サ_繝√ャ繝誉騾」謇( E讌ス蝎ィ繝代シ繝 ePlayMode, int nPlayer ) + { + if ( ( base.e繝輔ぉ繝シ繧コID == CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED ) || ( base.e繝輔ぉ繝シ繧コID == CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED_繝輔ぉ繝シ繝峨い繧ヲ繝 ) ) + { + return true; + } + if ( ( this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip == -1 ) || ( this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip >= listChip[ nPlayer ].Count ) ) + { + return true; + } + + CConfigIni configIni = TJAPlayer3.ConfigIni; + + CDTX dTX = TJAPlayer3.DTX; + bool bAutoPlay = false; + switch( nPlayer ) //2017.08.11 kairera0467 + { + case 0: + bAutoPlay = configIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay; + break; + case 1: + bAutoPlay = configIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay2P; + dTX = TJAPlayer3.DTX_2P; + break; + default: + break; + } + + var n迴セ蝨ィ譎ょ綾ms = (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + + //for ( int nCurrentTopChip = this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip; nCurrentTopChip < dTX.listChip.Count; nCurrentTopChip++ ) + for ( int nCurrentTopChip = dTX.listChip.Count - 1; nCurrentTopChip > 0; nCurrentTopChip-- ) + { + CDTX.CChip pChip = dTX.listChip[ nCurrentTopChip ]; + + if ( !pChip.bHit ) + { + bool bRollChip = pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x15 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x19; + if( bRollChip && ( ( pChip.e讌ス蝎ィ繝代シ繝 != E讌ス蝎ィ繝代シ繝.UNKNOWN ) ) ) + { + int instIndex = (int) pChip.e讌ス蝎ィ繝代シ繝; + if( pChip.n繝舌シ縺九i縺ョ霍晞屬dot[instIndex] < -40 ) + { + if ( this.e謖螳壽凾蛻サ縺九iChip縺ョJUDGE繧定ソ斐☆( n迴セ蝨ィ譎ょ綾ms, pChip ) == E蛻、螳.Miss ) + { + this.t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅( n迴セ蝨ィ譎ょ綾ms, pChip, E讌ス蝎ィ繝代シ繝.TAIKO, false, 0, nPlayer ); + } + } + } + } + + switch ( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ ) + { +#region[ 15-19: 騾」謇 ] + case 0x15: //騾」謇 + case 0x16: //騾」謇(螟ァ) + case 0x17: //鬚ィ闊ケ + case 0x18: //騾」謇鍋オゆコ + case 0x19: + { + if( pChip.n謠冗判蜆ェ蜈亥コヲ >= 1 ) + this.t騾イ陦梧緒逕サ_繝√ャ繝誉Taiko騾」謇( configIni, ref dTX, ref pChip, nPlayer ); + } + break; +#endregion + } + + } + return false; + } + + public void tBranchReset(int player) + { + if (player != -1) + { + this.CBranchScore[player].cBigNotes.nGreat = 0; + this.CBranchScore[player].cBigNotes.nGood = 0; + this.CBranchScore[player].cBigNotes.nMiss = 0; + this.CBranchScore[player].cBigNotes.nRoll = 0; + + this.CBranchScore[player].nGreat = 0; + this.CBranchScore[player].nGood = 0; + this.CBranchScore[player].nMiss = 0; + this.CBranchScore[player].nRoll = 0; + } + else + { + for (int i = 0; i < CBranchScore.Length; i++) + { + this.CBranchScore[i].cBigNotes.nGreat = 0; + this.CBranchScore[i].cBigNotes.nGood = 0; + this.CBranchScore[i].cBigNotes.nMiss = 0; + this.CBranchScore[i].cBigNotes.nRoll = 0; + + this.CBranchScore[i].nGreat = 0; + this.CBranchScore[i].nGood = 0; + this.CBranchScore[i].nMiss = 0; + this.CBranchScore[i].nRoll = 0; + } + } + } + + public void tBranchJudge(CDTX.CChip pChip, CBRANCHSCORE cBRANCHSCORE, int n繧ケ繧ウ繧「, int n騾」謇捺焚, int n濶ッ, int n蜿ッ, int n荳榊庄, int nPlayer) + { + if (this.b蠑キ蛻カ逧縺ォ蛻蟯舌&縺帙◆[nPlayer]) return; + + var e遞ョ鬘 = pChip.e蛻蟯舌ョ遞ョ鬘; + + //蛻蟯舌ョ莉墓婿縺悟酔縺倥↑縺ョ縺ァ荳邱偵↓縺励※縺縺縺ィ諤昴≧縲 + var b蛻蟯千ィョ鬘槭′荳閾エ = e遞ョ鬘 == CDTX.E蛻蟯千ィョ鬘.e邊セ蠎ヲ蛻蟯 || e遞ョ鬘 == CDTX.E蛻蟯千ィョ鬘.e繧ケ繧ウ繧「蛻蟯; + + + double dbRate = 0; + + if (e遞ョ鬘 == CDTX.E蛻蟯千ィョ鬘.e邊セ蠎ヲ蛻蟯) + { + if ((n濶ッ + n蜿ッ + n荳榊庄) != 0) + { + dbRate = ((double)n濶ッ / (double)(n濶ッ + n蜿ッ + n荳榊庄)) * 100.0; + } + } + else if (e遞ョ鬘 == CDTX.E蛻蟯千ィョ鬘.e繧ケ繧ウ繧「蛻蟯) + { + dbRate = n繧ケ繧ウ繧「; + } + else if (e遞ョ鬘 == CDTX.E蛻蟯千ィョ鬘.e騾」謇灘蟯) + { + dbRate = n騾」謇捺焚; + } + else if (e遞ョ鬘 == CDTX.E蛻蟯千ィョ鬘.e螟ァ髻ウ隨ヲ縺ョ縺ソ邊セ蠎ヲ蛻蟯) + { + dbRate = cBRANCHSCORE.nGreat; + } + + + if (b蛻蟯千ィョ鬘槭′荳閾エ) + { + if (dbRate < pChip.n譚。莉カ謨ー蛟、A) + { + this.n繝ャ繝シ繝ウ逕ィ陦ィ遉コ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eNormal; + this.n谺。蝗槭ョ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eNormal; + } + else if (dbRate >= pChip.n譚。莉カ謨ー蛟、A && dbRate < pChip.n譚。莉カ謨ー蛟、B) + { + this.n繝ャ繝シ繝ウ逕ィ陦ィ遉コ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eExpert; + this.n谺。蝗槭ョ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eExpert; + } + else if (dbRate >= pChip.n譚。莉カ謨ー蛟、B) + { + this.n繝ャ繝シ繝ウ逕ィ陦ィ遉コ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eMaster; + this.n谺。蝗槭ョ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eMaster; + } + + } + else if (e遞ョ鬘 == CDTX.E蛻蟯千ィョ鬘.e騾」謇灘蟯) + { + if (!(pChip.n譚。莉カ謨ー蛟、A == 0 && pChip.n譚。莉カ謨ー蛟、B == 0)) + { + if (dbRate < pChip.n譚。莉カ謨ー蛟、A) + { + this.n繝ャ繝シ繝ウ逕ィ陦ィ遉コ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eNormal; + this.n谺。蝗槭ョ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eNormal; + } + else if (dbRate >= pChip.n譚。莉カ謨ー蛟、A && dbRate < pChip.n譚。莉カ謨ー蛟、B) + { + this.n繝ャ繝シ繝ウ逕ィ陦ィ遉コ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eExpert; + this.n谺。蝗槭ョ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eExpert; + } + else if (dbRate >= pChip.n譚。莉カ謨ー蛟、B) + { + this.n繝ャ繝シ繝ウ逕ィ陦ィ遉コ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eMaster; + this.n谺。蝗槭ョ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eMaster; + } + } + } + else if (e遞ョ鬘 == CDTX.E蛻蟯千ィョ鬘.e螟ァ髻ウ隨ヲ縺ョ縺ソ邊セ蠎ヲ蛻蟯) + { + if (!(pChip.n譚。莉カ謨ー蛟、A == 0 && pChip.n譚。莉カ謨ー蛟、B == 0)) + { + if (dbRate < pChip.n譚。莉カ謨ー蛟、A) + { + this.n繝ャ繝シ繝ウ逕ィ陦ィ遉コ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eNormal; + this.n谺。蝗槭ョ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eNormal; + } + else if (dbRate >= pChip.n譚。莉カ謨ー蛟、A && dbRate < pChip.n譚。莉カ謨ー蛟、B) + { + this.n繝ャ繝シ繝ウ逕ィ陦ィ遉コ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eExpert; + this.n谺。蝗槭ョ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eExpert; + } + else if (dbRate >= pChip.n譚。莉カ謨ー蛟、B) + { + this.n繝ャ繝シ繝ウ逕ィ陦ィ遉コ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eMaster; + this.n谺。蝗槭ョ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eMaster; + } + } + } + } + + private CDTX.ECourse[] E蠑キ蛻カ繧ウ繝シ繧ケ = new CDTX.ECourse[4]; + private void t蠑キ蛻カ逕ィ譚。莉カ縺九r蛻、譁ュ縺吶k(double db譚。莉カA, double db譚。莉カB, int nPlayer) + { + //Wiki蜿り + //謌蝉サ + + if (db譚。莉カA == 101 && db譚。莉カB == 102) //蠑キ蛻カ譎ョ騾夊ュ憺擇 + { + E蠑キ蛻カ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eNormal; + this.b蠑キ蛻カ蛻蟯占ュ憺擇[nPlayer] = true; + } + else if (db譚。莉カA == -1 && db譚。莉カB == 101) //蠑キ蛻カ邇莠コ隴憺擇 + { + E蠑キ蛻カ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eExpert; + this.b蠑キ蛻カ蛻蟯占ュ憺擇[nPlayer] = true; + } + else if (db譚。莉カA == -2 && db譚。莉カB == -1) //蠑キ蛻カ驕比ココ隴憺擇 + { + E蠑キ蛻カ繧ウ繝シ繧ケ[nPlayer] = CDTX.ECourse.eMaster; + this.b蠑キ蛻カ蛻蟯占ュ憺擇[nPlayer] = true; + } + } + + public void t蛻蟯仙ヲ逅(CDTX.ECourse n蛻蟯仙, int nPlayer, double n逋コ螢ー菴咲スョ, CDTX.E蛻蟯千ィョ鬘 e蛻蟯千ィョ鬘 = CDTX.E蛻蟯千ィョ鬘.e邊セ蠎ヲ蛻蟯) + { + + CDTX dTX = TJAPlayer3.DTX; + switch ( nPlayer ) + { + case 1: + dTX = TJAPlayer3.DTX_2P; + break; + default: + break; + } + + + for (int A = 0; A < dTX.listChip.Count; A++) + { + var Chip = dTX.listChip[A].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ; + var bDontDeleteFlag = Chip >= 0x11 && Chip <= 0x19; + var bRollAllFlag = Chip >= 0x15 && Chip <= 0x19; + var bBalloonOnlyFlag = Chip == 0x17; + var bRollOnlyFlag = Chip >= 0x15 && Chip <= 0x16; + if (bDontDeleteFlag) + { + if (dTX.listChip[A].n逋コ螢ー譎ょ綾ms > n逋コ螢ー菴咲スョ) + { + if (dTX.listChip[A].n繧ウ繝シ繧ケ == n蛻蟯仙) + { + dTX.listChip[A].b蜿ッ隕 = true; + + if (dTX.listChip[A].IsEndedBranching) + { + if (bRollAllFlag)//蜈ア騾夊ュ憺擇譎ゅ°縺、縲騾」謇楢ュ憺擇縺縺」縺溘i髱槫庄隕門喧 + { + dTX.listChip[A].bHit = true; + dTX.listChip[A].bShow = false; + dTX.listChip[A].b蜿ッ隕 = false; + } + } + } + else + { + dTX.listChip[A].b蜿ッ隕 = false; + } + //蜈ア騾壹↑縺溘a蛻蟯舌&縺帙↑縺. + dTX.listChip[A].eNoteState = ENoteState.none; + + if (dTX.listChip[A].IsEndedBranching && (dTX.listChip[A].n繧ウ繝シ繧ケ == CDTX.ECourse.eNormal)) + { + if (bRollOnlyFlag)//蜈ア騾夊ュ憺擇譎ゅ°縺、縲騾」謇楢ュ憺擇縺縺」縺溘i蜿ッ隕門喧 + { + dTX.listChip[A].bHit = false; + dTX.listChip[A].bShow = true; + dTX.listChip[A].b蜿ッ隕 = true; + } + else + { + if (bBalloonOnlyFlag)//蜈ア騾夊ュ憺擇譎ゅ°縺、縲鬚ィ闊ケ隴憺擇縺縺」縺溘i蜿ッ隕門喧 + { + dTX.listChip[A].bShow = true; + dTX.listChip[A].b蜿ッ隕 = true; + } + } + } + } + } + } + } + + public int GetRoll(int player) + { + return n蜷郁ィ磯」謇捺焚[player]; + } + + protected float GetNowPBMTime( CDTX tja, float play_time ) + { + float bpm_time = 0; + int last_input = 0; + float last_bpm_change_time; + play_time = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((float)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0f) - tja.nOFFSET; + + for (int i = 1; ; i++) + { + //BPMCHANGE縺ョ謨ー雜翫∴縺 + if( i >= tja.listBPM.Count ) + { + CDTX.CBPM cBPM = tja.listBPM[ last_input ]; + bpm_time = (float)cBPM.bpm_change_bmscroll_time + ( ( play_time - (float)cBPM.bpm_change_time ) * (float)cBPM.dbBPM蛟、 / 15000.0f ); + last_bpm_change_time = (float)cBPM.bpm_change_time; + break; + } + for( ; i < tja.listBPM.Count; i++ ) + { + CDTX.CBPM cBPM = tja.listBPM[ i ]; + if (cBPM.bpm_change_time == 0 || cBPM.bpm_change_course == this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ[ 0 ] ) + { + break; + } + } + if( i == tja.listBPM.Count ) + { + i = tja.listBPM.Count - 1; + continue; + } + + if( play_time < tja.listBPM[ i ].bpm_change_time ) + { + CDTX.CBPM cBPM = tja.listBPM[ last_input ]; + bpm_time = (float)cBPM.bpm_change_bmscroll_time + ( ( play_time - (float)cBPM.bpm_change_time ) * (float)cBPM.dbBPM蛟、 / 15000.0f ); + last_bpm_change_time = (float)cBPM.bpm_change_time; + break; + } + else + { + last_input = i; + } + } + + return bpm_time; + } + + public void t蜀崎ェュ霎シ() + { + TJAPlayer3.DTX.t蜈ィ繝√ャ繝励ョ蜀咲函蛛懈ュ「縺ィ繝溘く繧オ繝シ縺九i縺ョ蜑企勁(); + this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、 = E貍泌・冗判髱「縺ョ謌サ繧雁、.蜀崎ェュ霎シ_蜀肴シ泌・; + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.貍泌・柔蜀崎ェュ霎シ; + this.bPAUSE = false; + } + + public void t貍泌・上d繧翫↑縺翫@() + { + TJAPlayer3.DTX.t蜈ィ繝√ャ繝励ョ蜀咲函蛛懈ュ「縺ィ繝溘く繧オ繝シ縺九i縺ョ蜑企勁(); + this.t謨ー蛟、縺ョ蛻晄悄蛹( true, true ); + this.actAVI.tReset(); + this.actPanel.t豁瑚ゥ槭ユ繧ッ繧ケ繝√Ε繧貞炎髯、縺吶k(); + for (int i = 0; i < 2; i++) + { + this.t貍泌・丈ス咲スョ縺ョ螟画峩(0, i); + this.actPlayInfo.NowMeasure[i] = 0; + } + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.On豢サ諤ァ蛹(); + for( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) + { + this.chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕 i ] = null; + } + this.bPAUSE = false; + } + + public void t蛛懈ュ「() + { + TJAPlayer3.DTX.t蜈ィ繝√ャ繝励ョ蜀咲函蛛懈ュ「縺ィ繝溘く繧オ繝シ縺九i縺ョ蜑企勁(); + this.actAVI.Stop(); + this.actPanel.Stop(); // PANEL陦ィ遉コ蛛懈ュ「 + TJAPlayer3.Timer.t荳譎ょ●豁「(); // 蜀咲函譎ょ綾繧ォ繧ヲ繝ウ繧ソ蛛懈ュ「 + + this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip = TJAPlayer3.DTX.listChip.Count - 1; // 邨らォッ縺ォ繧キ繝シ繧ッ + + // 閾ェ蛻閾ェ霄ォ縺ョOn豢サ諤ァ蛹()逶ク蠖薙ョ蜃ヲ逅繧ゅ☆縺ケ縺阪 + } + + public void t謨ー蛟、縺ョ蛻晄悄蛹( bool b貍泌・剰ィ倬鹸, bool b貍泌・冗憾諷 ) + { + if( b貍泌・剰ィ倬鹸 ) + { + this.n繝偵ャ繝域焚_Auto蜷ォ繧.Taiko.Perfect = 0; + this.n繝偵ャ繝域焚_Auto蜷ォ繧.Taiko.Great = 0; + this.n繝偵ャ繝域焚_Auto蜷ォ繧.Taiko.Good = 0; + this.n繝偵ャ繝域焚_Auto蜷ォ繧.Taiko.Poor = 0; + this.n繝偵ャ繝域焚_Auto蜷ォ繧.Taiko.Miss = 0; + + this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Taiko.Perfect = 0; + this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Taiko.Great = 0; + this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Taiko.Good = 0; + this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Taiko.Poor = 0; + this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Taiko.Miss = 0; + + this.actCombo.On豢サ諤ァ蛹(); + this.actScore.On豢サ諤ァ蛹(); + this.actGauge.Init( TJAPlayer3.ConfigIni.nRisky, 0 ); + if (bDoublePlay) this.actGauge.Init( TJAPlayer3.ConfigIni.nRisky, 1 ); + } + if( b貍泌・冗憾諷 ) + { + for( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) + { + this.bIsGOGOTIME[ i ] = false; + this.bLEVELHOLD[ i ] = false; + this.b蠑キ蛻カ逧縺ォ蛻蟯舌&縺帙◆[ i ] = false; + this.b隴憺擇蛻蟯蝉クュ[ i ] = false; + this.b騾」謇謎クュ[ i ] = false; + this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ[ i ] = 0; + this.n谺。蝗槭ョ繧ウ繝シ繧ケ[ i] = 0; + this.n迴セ蝨ィ縺ョ騾」謇捺焚[ i ] = 0; + this.n蜷郁ィ磯」謇捺焚[ i ] = 0; + this.n蛻蟯舌@縺溷屓謨ー[ i ] = 0; + } + for (int i = 0; i < 2; i++) + { + this.actComboVoice.tReset(i); + NowProcessingChip[i] = 0; + } + } + + this.ReSetScore(TJAPlayer3.DTX.nScoreInit[0, TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]], TJAPlayer3.DTX.nScoreDiff[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]]); + this.nHand = new int[]{ 0, 0, 0, 0 }; + } + + public void t貍泌・丈ス咲スョ縺ョ螟画峩( int nStartBar, int nPlayer ) + { + // 縺セ縺壼ィ繧オ繧ヲ繝ウ繝峨が繝輔↓縺吶k + TJAPlayer3.DTX.t蜈ィ繝√ャ繝励ョ蜀咲函蛛懈ュ「(); + this.actAVI.Stop(); + CDTX dTX = TJAPlayer3.DTX; + switch (nPlayer) + { + case 1: + dTX = TJAPlayer3.DTX_2P; + break; + default: + break; + } + + if (dTX == null) return; //CDTX縺系ull縺ョ蝣エ蜷医ッ繝励Ξ繧、繝、繝シ縺悟ア縺ェ縺縺ョ縺ァ縺昴ョ蝣エ縺ァ蜃ヲ逅邨ゆコ + + +#region [ 蜀咲函髢句ァ句ー冗ッ縺ョ螟画峩 ] + //nStartBar++; // +1縺悟ソ隕 + +#region [ 貍泌・乗ク医∩繝輔Λ繧ー縺ョ縺、縺縺櫃hip繧偵Μ繧サ繝繝医☆繧 ] + for ( int i = 0; i < dTX.listChip.Count; i++ ) + { + //if(dTX.listChip[i].bHit) 繝輔Λ繧ー縺御サ倥>縺ヲ縺ェ縺上※繧ゅ☆縺ケ縺ヲ縺ョ繝√ャ繝励r繝ェ繧サ繝繝医☆繧九(蠢隕√′縺ゅk).2020.04.23.akasoko26 + + dTX.listChip[i].bHit = false; + dTX.listChip[i].bShow = true; + dTX.listChip[i].b蜿ッ隕 = true; + dTX.listChip[i].IsHitted = false; + dTX.listChip[i].IsMissed = false; + dTX.listChip[i].eNoteState = ENoteState.none; + dTX.listChip[i].nProcessTime = 0; + dTX.listChip[i].nRollCount = 0; + dTX.listChip[i].nRollCount = 0; + } +#endregion + +#region [ 蜃ヲ逅繧帝幕蟋九☆繧九メ繝繝励ョ迚ケ螳 ] + //for ( int i = this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip; i < CDTXMania.DTX.listChip.Count; i++ ) + bool bSuccessSeek = false; + for (int i = 0; i < dTX.listChip.Count; i++) + { + CDTX.CChip pChip = dTX.listChip[i]; + if (nStartBar == 0) + { + if (pChip.n逋コ螢ー菴咲スョ < 384 * nStartBar) + { + continue; + } + else + { + bSuccessSeek = true; + this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip = i; + break; + } + } + else + { + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x50 && pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ > nStartBar - 1) + { + bSuccessSeek = true; + this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip = i; + break; + } + } + } + if (!bSuccessSeek) + { + // this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip = CDTXMania.DTX.listChip.Count - 1; + this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip = 0; // 蟇セ雎。蟆冗ッ縺悟ュ伜惠縺励↑縺縺ェ繧峨∵怙蛻昴°繧牙咲函 + } + else + { + while (this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip != 0 && dTX.listChip[this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip].n逋コ螢ー譎ょ綾ms == dTX.listChip[TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n迴セ蝨ィ縺ョ繝医ャ繝佑hip - 1].n逋コ螢ー譎ょ綾ms) + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n迴セ蝨ィ縺ョ繝医ャ繝佑hip--; + } +#endregion +#region [ 貍泌・城幕蟋九ョ逋コ螢ー譎ょ綾ms繧貞叙蠕励@縲√ち繧、繝槭↓險ュ螳 ] + int nStartTime = (int)(dTX.listChip[this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip].n逋コ螢ー譎ょ綾ms / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + + CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.t繝ェ繧サ繝繝(); // 縺薙l縺ァPAUSE隗」髯、縺輔l繧九ョ縺ァ縲∵ャ。縺ョPAUSE繝√ぉ繝繧ッ縺ッ荳崎ヲ + //if ( !this.bPAUSE ) + //{ + CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.t荳譎ょ●豁「(); + //} + CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 = nStartTime; +#endregion + + List pausedCSound = new List(); + +#region [ BGM繧繧ョ繧ソ繝シ縺ェ縺ゥ縲∵シ泌・城幕蟋九ョ繧ソ繧、繝溘Φ繧ー縺ァ蜀咲函縺後°縺九▲縺ヲ縺繧九し繧ヲ繝ウ繝峨ョ縺ョ騾比クュ蜀咲函髢句ァ ] // (CDTX縺ョt蜈・蜉媽陦瑚ァ」譫神繝√ャ繝鈴咲スョ()縺ァ蟆冗ッ逡ェ蜿キ縺+1縺輔l縺ヲ縺繧九ョ繧貞炎縺」縺ヲ縺翫¥縺薙→) + for ( int i = this.n迴セ蝨ィ縺ョ繝医ャ繝佑hip; i >= 0; i-- ) + { + CDTX.CChip pChip = dTX.listChip[ i ]; + int nDuration = pChip.GetDuration(); + long n逋コ螢ー譎ょ綾ms = (long)(pChip.n逋コ螢ー譎ょ綾ms / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + + if ((n逋コ螢ー譎ょ綾ms + nDuration > 0) && (n逋コ螢ー譎ょ綾ms <= nStartTime) && (nStartTime <= n逋コ螢ー譎ょ綾ms + nDuration)) + { + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01 && (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >> 4) != 0xB) // wav邉サ繝√Ε繝ウ繝阪Ν縲∽ク斐▽縲∫ゥコ謇薙■繝√ャ繝励〒縺ッ縺ェ縺 + { + CDTX.CWAV wc; + bool b = dTX.listWAV.TryGetValue( pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ, out wc ); + if ( !b ) continue; + + if ( ( wc.bIsBGMSound && TJAPlayer3.ConfigIni.bBGM髻ウ繧堤匱螢ー縺吶k ) || ( !wc.bIsBGMSound ) ) + { + TJAPlayer3.DTX.t繝√ャ繝励ョ蜀咲函(pChip, (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾) + (long)(pChip.n逋コ螢ー譎ょ綾ms / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))); +#region [ PAUSE縺吶k ] + int j = wc.n迴セ蝨ィ蜀咲函荳ュ縺ョ繧オ繧ヲ繝ウ繝臥分蜿キ; + if ( wc.rSound[ j ] != null ) + { + wc.rSound[ j ].t蜀咲函繧剃ク譎ょ●豁「縺吶k(); + wc.rSound[j].t蜀咲函菴咲スョ繧貞、画峩縺吶k(nStartTime - n逋コ螢ー譎ょ綾ms); + pausedCSound.Add( wc.rSound[ j ] ); + } +#endregion + } + } + } + } +#endregion +#region [ 貍泌・城幕蟋区凾轤ケ縺ァ譌「縺ォ陦ィ遉コ縺輔l縺ヲ縺繧毅GA縺ィAVI縺ョ縲√す繝シ繧ッ縺ィ蜀咲函 ] + this.actAVI.SkipStart( nStartTime ); +#endregion +#region [ PAUSE縺励※縺縺溘し繧ヲ繝ウ繝峨r荳譁峨↓蜀咲函蜀埼幕縺吶k(縺溘□縺励ち繧、繝槭r豁「繧√※縺繧九ョ縺ァ縲√%縺薙〒縺ッ縺セ縺蜀咲函髢句ァ九@縺ェ縺) ] + + if (!(TJAPlayer3.ConfigIni.b貍泌・城溷コヲ縺御ク蛟埼溘〒縺ゅk縺ィ縺堺サ・螟夜浹螢ー繧貞咲函縺励↑縺 && TJAPlayer3.ConfigIni.n貍泌・城溷コヲ != 20)) + foreach (CSound cs in pausedCSound) + { + cs.t繧オ繧ヲ繝ウ繝峨r蜀咲函縺吶k(); + } +#endregion + pausedCSound.Clear(); +#region [ 繧ソ繧、繝槭r蜀埼幕縺励※縲 ̄AUSE縺九i蠕ゥ蟶ー縺吶k ] + CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 = nStartTime; + TJAPlayer3.Timer.t繝ェ繧サ繝繝(); // 縺薙l縺ァPAUSE隗」髯、縺輔l繧九ョ縺ァ縲3陦悟医ョ蜀埼幕()縺ッ荳崎ヲ + TJAPlayer3.Timer.n迴セ蝨ィ譎ょ綾 = nStartTime; // Debug陦ィ遉コ縺ョTime: 陦ィ險倥r豁」縺励¥縺吶k縺溘a縺ォ蠢隕 + CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.t蜀埼幕(); + //CDTXMania.Timer.t蜀埼幕(); + this.bPAUSE = false; // 繧キ繧ケ繝繝縺訓AUSE迥カ諷九□縺」縺溘i縲∝シキ蛻カ隗」髯、 + this.actPanel.Start(); +#endregion +#endregion + } + + public void t貍泌・丈クュ豁「() + { + this.actFO.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝; + this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、 = E貍泌・冗判髱「縺ョ謌サ繧雁、.貍泌・丈クュ譁ュ; + } + + /// + /// DTXV逕ィ縺ョ險ュ螳壹r縺吶k縲(蜈ィAUTO縺ェ縺ゥ) + /// 蜈縺ョ險ュ螳壹ョ繝舌ャ繧ッ繧「繝繝励↑縺ゥ縺ッ縺励↑縺縺ョ縺ァ縲√≠縺ィ縺ァConfig.ini繧剃ク頑嶌縺堺ソ晏ュ倥@縺ェ縺縺薙→縲 + /// + protected void tDTXV逕ィ縺ョ險ュ螳() + { + TJAPlayer3.ConfigIni.bAutoPlay.HH = true; + TJAPlayer3.ConfigIni.bAutoPlay.SD = true; + TJAPlayer3.ConfigIni.bAutoPlay.BD = true; + TJAPlayer3.ConfigIni.bAutoPlay.HT = true; + TJAPlayer3.ConfigIni.bAutoPlay.LT = true; + TJAPlayer3.ConfigIni.bAutoPlay.CY = true; + TJAPlayer3.ConfigIni.bAutoPlay.FT = true; + TJAPlayer3.ConfigIni.bAutoPlay.RD = true; + TJAPlayer3.ConfigIni.bAutoPlay.LC = true; + TJAPlayer3.ConfigIni.bAutoPlay.LP = true; + TJAPlayer3.ConfigIni.bAutoPlay.LBD = true; + TJAPlayer3.ConfigIni.bAutoPlay.GtR = true; + TJAPlayer3.ConfigIni.bAutoPlay.GtB = true; + TJAPlayer3.ConfigIni.bAutoPlay.GtB = true; + TJAPlayer3.ConfigIni.bAutoPlay.GtPick = true; + TJAPlayer3.ConfigIni.bAutoPlay.GtW = true; + TJAPlayer3.ConfigIni.bAutoPlay.BsR = true; + TJAPlayer3.ConfigIni.bAutoPlay.BsB = true; + TJAPlayer3.ConfigIni.bAutoPlay.BsB = true; + TJAPlayer3.ConfigIni.bAutoPlay.BsPick = true; + TJAPlayer3.ConfigIni.bAutoPlay.BsW = true; + + this.bIsAutoPlay = TJAPlayer3.ConfigIni.bAutoPlay; + + TJAPlayer3.ConfigIni.bAVI譛牙柑 = true; + TJAPlayer3.ConfigIni.bBGA譛牙柑 = true; + for ( int i = 0; i < 3; i++ ) + { + TJAPlayer3.ConfigIni.bGraph[ i ] = false; + TJAPlayer3.ConfigIni.bHidden[ i ] = false; + TJAPlayer3.ConfigIni.bLeft[ i ] = false; + TJAPlayer3.ConfigIni.bLight[ i ] = false; + TJAPlayer3.ConfigIni.bReverse[ i ] = false; + TJAPlayer3.ConfigIni.bSudden[ i ] = false; + TJAPlayer3.ConfigIni.eInvisible[ i ] = EInvisible.OFF; + TJAPlayer3.ConfigIni.eRandom[ i ] = E繝ゥ繝ウ繝繝繝「繝シ繝.OFF; + TJAPlayer3.ConfigIni.n陦ィ遉コ蜿ッ閭ス縺ェ譛蟆上さ繝ウ繝懈焚[ i ] = 65535; + TJAPlayer3.ConfigIni.蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ[ i ] = E蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ.陦ィ遉コOFF; + // CDTXMania.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[ i ] = CDTXMania.ConfigIni.nViewerScrollSpeed[ i ]; // 縺薙l縺縺代ッOn豢サ諤ァ蛹()縺ァ陦後≧縺薙→縲 + // 縺昴≧縺励↑縺縺ィ縲∵シ泌・城幕蟋狗峩蠕後↓繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ縺悟、牙喧縺励※隕玖協縺励>縲 + } + + TJAPlayer3.ConfigIni.eDark = E繝繝シ繧ッ繝「繝シ繝.OFF; + + TJAPlayer3.ConfigIni.b貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k = TJAPlayer3.ConfigIni.bViewerShowDebugStatus; + TJAPlayer3.ConfigIni.bScoreIni繧貞コ蜉帙☆繧 = false; + TJAPlayer3.ConfigIni.bSTAGEFAILED譛牙柑 = false; + TJAPlayer3.ConfigIni.bTight = false; + TJAPlayer3.ConfigIni.b繧ケ繝医う繝繧ッ繝「繝シ繝 = false; + + TJAPlayer3.ConfigIni.nRisky = 0; + } + + protected abstract void t騾イ陦梧緒逕サ_繝√ャ繝誉繝峨Λ繝繧ケ( CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip ); + protected abstract void t騾イ陦梧緒逕サ_繝√ャ繝玲悽菴点繝峨Λ繝繧ケ( CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip ); + protected abstract void t騾イ陦梧緒逕サ_繝√ャ繝誉Taiko( CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip, int nPlayer ); + protected abstract void t騾イ陦梧緒逕サ_繝√ャ繝誉Taiko騾」謇( CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip, int nPlayer ); + + protected abstract void t騾イ陦梧緒逕サ_繝√ャ繝誉繝輔ぅ繝ォ繧、繝ウ( CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip ); + protected abstract void t騾イ陦梧緒逕サ_繝√ャ繝誉蟆冗ッ邱( CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip, int nPlayer ); + protected void t騾イ陦梧緒逕サ_繝√ャ繝励い繝九Γ() + { + if( this.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + //this.ct蛻カ蠕。繧ソ繧、繝 = FDK.CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝; + //this.ct蛻カ蠕。繧ソ繧、繝 = new CCounter(0, 10, 500, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + //this.ct蛻カ蠕。繧ソ繧、繝.t騾イ陦鍬oopDb(); + } + for (int i = 0; i < 2; i++) + { + ctChipAnime[i].t騾イ陦鍬oopDb(); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 20 * i, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, ctChipAnime[i].n迴セ蝨ィ縺ョ蛟、.ToString()); + ctChipAnimeLag[i].t騾イ陦(); + // CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 20 * i, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, ctChipAnimeLag[i].n迴セ蝨ィ縺ョ蛟、.ToString()); + // + } + + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(60, 140, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, ct蛻カ蠕。繧ソ繧、繝.n迴セ蝨ィ縺ョ蛟、.ToString()); + //this.n繧ソ繧、繝樒分蜿キ = (int)this.actChara.ct繝「繝悶Δ繝シ繧キ繝ァ繝ウ.n迴セ蝨ィ縺ョ蛟、; + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.n繧ソ繧、繝樒分蜿キ.ToString()); + + + //if (this.actChara.ct繝「繝悶Δ繝シ繧キ繝ァ繝ウ.n迴セ蝨ィ縺ョ蛟、 <= 30) + //{ + // this.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ = 0; + //} else + //{ + // this.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ = 1; + //} + + /*long num = FDK.CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾; + if( num < this.ct蛻カ蠕。繧ソ繧、繝 ) + { + this.ct蛻カ蠕。繧ソ繧、繝 = num; + } + while( ( num - this.ct蛻カ蠕。繧ソ繧、繝 ) >= 1000 ) + { + if( this.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ == 0 ) + { + this.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ = 1; + } + else if( this.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ == 1 ) + { + this.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ = 0; + } + + if( this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.P1 < 50 ) + { + this.ct蛻カ蠕。繧ソ繧、繝 += 500; + } + else if(this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.P1 >= 50 && this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.P1 < 150) + { + this.ct蛻カ蠕。繧ソ繧、繝 += 400; + } + else if( this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.P1 >= 150 && this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.P1 < 250 ) + { + this.ct蛻カ蠕。繧ソ繧、繝 += 300; + } + else if( this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.P1 >= 250 && this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.P1 < 300 ) + { + this.ct蛻カ蠕。繧ソ繧、繝 += 200; + } + else if( this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.P1 >= 300 ) + { + this.ct蛻カ蠕。繧ソ繧、繝 += 80; + } + else + { + this.ct蛻カ蠕。繧ソ繧、繝 += 500; + } + + }*/ + + //if ( this.actChara.ct繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ != null ) + //{ + // this.actChara.ct繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ.t騾イ陦鍬oopDb(); + //} + } + + protected bool t騾イ陦梧緒逕サ_繝輔ぉ繝シ繝峨う繝ウ_繧「繧ヲ繝() + { + switch ( base.e繝輔ぉ繝シ繧コID ) + { + case CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨う繝ウ: + if ( this.actFI.On騾イ陦梧緒逕サ() != 0) + { + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷; + } + break; + + case CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝: + case CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED_繝輔ぉ繝シ繝峨い繧ヲ繝: + if ( this.actFO.On騾イ陦梧緒逕サ() != 0 ) + { + return true; + } + break; + + case CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_CLEAR_繝輔ぉ繝シ繝峨い繧ヲ繝: + if ( this.actFOClear.On騾イ陦梧緒逕サ() == 0 ) + { + break; + } + return true; + + } + return false; + } + protected void t騾イ陦梧緒逕サ_繝ャ繝シ繝ウ繝輔Λ繝繧キ繝・D() + { + //if ( ( CDTXMania.ConfigIni.eDark == E繝繝シ繧ッ繝「繝シ繝.OFF ) && ( base.e繝輔ぉ繝シ繧コID != CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED ) && ( base.e繝輔ぉ繝シ繧コID != CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED_繝輔ぉ繝シ繝峨い繧ヲ繝 ) ) + { + this.actTaikoLaneFlash.On騾イ陦梧緒逕サ(); + } + } + protected abstract void t騾イ陦梧緒逕サ_貍泌・乗ュ蝣ア(); + protected void t騾イ陦梧緒逕サ_貍泌・乗ュ蝣ア(int x, int y) + { + if ( !TJAPlayer3.ConfigIni.b貍泌・乗ュ蝣ア繧定。ィ遉コ縺励↑縺 ) + { + this.actPlayInfo.t騾イ陦梧緒逕サ( x, y ); + } + } + protected void t騾イ陦梧緒逕サ_閭梧勹() + { + if ( this.tx閭梧勹 != null ) + { + this.tx閭梧勹.t2D謠冗判( TJAPlayer3.app.Device, 0, 0 ); + } + } + + protected void t騾イ陦梧緒逕サ_蛻、螳壹Λ繧、繝ウ() + { + if ( TJAPlayer3.ConfigIni.eDark != E繝繝シ繧ッ繝「繝シ繝.FULL ) + { + int y = TJAPlayer3.ConfigIni.bReverse.Drums ? 53 - 貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓.nJudgeLinePosY_delta.Drums : 567 + 貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓.nJudgeLinePosY_delta.Drums; + // #31602 2013.6.23 yyagi 謠冗判驕蟒カ蟇セ遲悶→縺励※縲∝愛螳壹Λ繧、繝ウ縺ョ陦ィ遉コ菴咲スョ繧偵が繝輔そ繝繝郁ェソ謨エ縺ァ縺阪k繧医≧縺ォ縺吶k + if ( this.tx繝偵ャ繝医ヰ繝シ != null ) + { + this.tx繝偵ャ繝医ヰ繝シ.t2D謠冗判( TJAPlayer3.app.Device, 295, y, new Rectangle( 0, 0, 558, 6 ) ); + } + } + } + protected void t騾イ陦梧緒逕サ_蛻、螳壽枚蟄怜() + { + this.actJudgeString.On騾イ陦梧緒逕サ(); + } + protected void t騾イ陦梧緒逕サ_蛻、螳壽枚蟄怜1_騾壼クク菴咲スョ謖螳壹ョ蝣エ蜷() + { + if ( ( (E蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ) TJAPlayer3.ConfigIni.蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ.Drums ) != E蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ.繧ウ繝ウ繝應ク ) // 蛻、螳壹Λ繧、繝ウ荳翫∪縺溘ッ讓ェ + { + this.actJudgeString.On騾イ陦梧緒逕サ(); + } + } + protected void t騾イ陦梧緒逕サ_蛻、螳壽枚蟄怜2_蛻、螳壹Λ繧、繝ウ荳頑欠螳壹ョ蝣エ蜷() + { + if ( ( (E蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ) TJAPlayer3.ConfigIni.蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ.Drums ) == E蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ.繧ウ繝ウ繝應ク ) // 蛻、螳壹Λ繧、繝ウ荳翫∪縺溘ッ讓ェ + { + this.actJudgeString.On騾イ陦梧緒逕サ(); + } + } + + protected void t騾イ陦梧緒逕サ_隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ() + { + this.act隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.On騾イ陦梧緒逕サ(); + } + protected abstract void t邏吝聖髮ェ_髢句ァ(); + protected abstract void t閭梧勹繝繧ッ繧ケ繝√Ε縺ョ逕滓(); + protected void t閭梧勹繝繧ッ繧ケ繝√Ε縺ョ逕滓( string DefaultBgFilename, Rectangle bgrect, string bgfilename ) + { + try + { + if( !String.IsNullOrEmpty( bgfilename ) ) + this.tx閭梧勹 = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.繝輔ぃ繧、繝ォ諠蝣ア.繝輔か繝ォ繝縺ョ邨カ蟇セ繝代せ + bgfilename ); + else + this.tx閭梧勹 = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( DefaultBgFilename ) ); + } + catch (Exception e) + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (a80767e1-4de7-4fec-b072-d078b3659e62)" ); + this.tx閭梧勹 = null; + } + } + + public void ReSetScore(int scoreInit, int scoreDiff) + { + //荳謇鍋岼縺ョ蜃ヲ逅關ス縺。縺後イ縺ゥ縺縺ョ縺ァ縲√≠繧峨°縺倥a縺薙%縺ァ轤ケ謨ー縺ョ險育ョ励r縺励※縺翫¥縲 + // -1縺縺」縺溷エ蜷医√◎縺ョ蜑阪r蠑輔″邯吶$縲 + int nInit = scoreInit != -1 ? scoreInit : this.nScore[0]; + int nDiff = scoreDiff != -1 ? scoreDiff : this.nScore[1] - this.nScore[0]; + int nAddScore = 0; + int[] n蛟咲紫 = { 0, 1, 2, 4, 8 }; + + if( TJAPlayer3.DTX.nScoreModeTmp == 1 ) + { + for( int i = 0; i < 11; i++ ) + { + this.nScore[ i ] = (int)( nInit + ( nDiff * ( i ) ) ); + } + } + else if( TJAPlayer3.DTX.nScoreModeTmp == 2 ) + { + for( int i = 0; i < 5; i++ ) + { + this.nScore[ i ] = (int)( nInit + ( nDiff * n蛟咲紫[ i ] ) ); + + this.nScore[ i ] = (int)( this.nScore[ i ] / 10.0 ); + this.nScore[ i ] = this.nScore[ i ] * 10; + + } + + //this.nScore[ 0 ] = (int)nInit; + //this.nScore[ 1 ] = (int)( nInit + nDiff ); + //this.nScore[ 2 ] = (int)( nInit + ( nDiff * 2 ) ); + //this.nScore[ 3 ] = (int)( nInit + ( nDiff * 4 ) ); + //this.nScore[ 4 ] = (int)( nInit + ( nDiff * 8 ) ); + } + } + } +} diff --git a/TJAPlayer3/Stages/07.Game/C貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓吝ア騾.cs b/TJAPlayer3/Stages/07.Game/C貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓吝ア騾.cs new file mode 100644 index 00000000..63b2d592 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/C貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓吝ア騾.cs @@ -0,0 +1,202 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; + +namespace TJAPlayer3 +{ + /// + /// 蛻、螳壹Λ繧、繝ウ髢「菫ゅョ蠎ァ讓吝ヲ逅繧偵∪縺ィ繧√◆繧ッ繝ゥ繧ケ + /// + internal class C貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓吝ア騾 + { + /// + /// 蛻、螳壹Λ繧、繝ウ縺ョy蠎ァ讓 + /// + private STDGBVALUE[,,] n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ = null; // 陬懈ュ」辟。縺励ョ譎ゅョ蠎ァ讓吶ョ繝シ繧ソ + private STDGBVALUE[,,] n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ = null; + + /// + /// 陦ィ遉コ菴咲スョ縺ョ陬懈ュ」繝繝シ繧ソ + /// 蛻晄悄蛹悶ッ螟夜Κ縺九i陦後≧縺薙→縲 + /// + public STDGBVALUE nJudgeLinePosY_delta; + + /// + /// 蛻、螳壹Λ繧、繝ウ陦ィ遉コ菴咲スョ繧偵〃繧キ繝ェ繝シ繧コ莠呈鋤縺ォ縺吶k縺九←縺縺九 + /// 險ュ螳壹ッ螟夜Κ縺九i陦後≧縺薙→縲 + /// + public STDGBVALUE n蛻、螳壻ス咲スョ; + + /// + /// 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ(蠎ァ讓吝、縺ョ蛻晄悄蛹) + /// + public C貍泌・丞愛螳壹Λ繧、繝ウ蠎ァ讓吝ア騾() + { + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ = new STDGBVALUE[ 2, 2, 2 ]; + #region [ 蛻、螳壹Λ繧、繝ウ蠎ァ讓吶ョ蛻晄悄蛹望 + // Normal, Drums逕サ髱「, 蛻、螳壹Λ繧、繝ウ + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 0, 0 ].Drums = 0; //譛ェ菴ソ逕ィ + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 0, 0 ].Guitar = 95; + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 0, 0 ].Bass = 95; + // Reverse, Drums逕サ髱「, 蛻、螳壹Λ繧、繝ウ + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 0, 0 ].Drums = 0; //譛ェ菴ソ逕ィ + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 0, 0 ].Guitar = 374; + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 0, 0 ].Bass = 374; + // Normal, Drums逕サ髱「, Wailing譫 + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 0, 1 ].Drums = 0; //譛ェ菴ソ逕ィ + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 0, 1 ].Guitar = 69; + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 0, 1 ].Bass = 69; + // Reverse, Drums逕サ髱「, Wailing譫 + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 0, 1 ].Drums = 0; //譛ェ菴ソ逕ィ + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 0, 1 ].Guitar = 350; + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 0, 1 ].Bass = 350; + + // Normal, GR逕サ髱「, 蛻、螳壹Λ繧、繝ウ + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 1, 0 ].Drums = 0; //譛ェ菴ソ逕ィ + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 1, 0 ].Guitar = 40; + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 1, 0 ].Bass = 40; + // Reverse, GR逕サ髱「, 蛻、螳壹Λ繧、繝ウ + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 1, 0 ].Drums = 0; //譛ェ菴ソ逕ィ + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 1, 0 ].Guitar = 369; + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 1, 0 ].Bass = 369; + // Normal, GR逕サ髱「, Wailing譫 + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 1, 1 ].Drums = 0; //譛ェ菴ソ逕ィ + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 1, 1 ].Guitar = 11; + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 1, 1 ].Bass = 11; + // Reverse, GR逕サ髱「, Wailing譫 + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 1, 1 ].Drums = 0; //譛ェ菴ソ逕ィ + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 1, 1 ].Guitar = 340; + n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 1, 1 ].Bass = 340; + #endregion + + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ = new STDGBVALUE[ 2, 2, 2 ]; + #region [ RGB繝懊ち繝ウ蠎ァ讓吶ョ蛻晄悄蛹望 + // Normal, Drums逕サ髱「, RGB繝懊ち繝ウ + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 0, 0 ].Drums = 0; // 譛ェ菴ソ逕ィ + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 0, 0 ].Guitar = 57; + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 0, 0 ].Bass = 57; + // Reverse, Drums逕サ髱「, RGB繝懊ち繝ウ + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 0, 0 ].Drums = 0; // 譛ェ菴ソ逕ィ + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 0, 0 ].Guitar = 57; + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 0, 0 ].Bass = 57; + // Normal, Drums逕サ髱「, RGB繝懊ち繝ウ(V繧キ繝ェ繝シ繧コ) + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 0, 1 ].Drums = 0; // 譛ェ菴ソ逕ィ + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 0, 1 ].Guitar = 107; + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 0, 1 ].Bass = 107; + // Reverse, Drums逕サ髱「, RGB繝懊ち繝ウ(V繧キ繝ェ繝シ繧コ) + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 0, 1 ].Drums = 0; // 譛ェ菴ソ逕ィ + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 0, 1 ].Guitar = 107; + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 0, 1 ].Bass = 107; + + // Normal, GR逕サ髱「, RGB繝懊ち繝ウ + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 1, 0 ].Drums = 0; // 譛ェ菴ソ逕ィ + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 1, 0 ].Guitar = 3; + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 1, 0 ].Bass = 3; + // Reverse, GR逕サ髱「, RGB繝懊ち繝ウ + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 1, 0 ].Drums = 0; // 譛ェ菴ソ逕ィ + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 1, 0 ].Guitar = 3; + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 1, 0 ].Bass = 3; + // Normal, GR逕サ髱「, RGB繝懊ち繝ウ(V繧キ繝ェ繝シ繧コ) + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 1, 1 ].Drums = 0; // 譛ェ菴ソ逕ィ + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 1, 1 ].Guitar = 44; + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 0, 1, 1 ].Bass = 44; + // Reverse, GR逕サ髱「, RGB繝懊ち繝ウ(V繧キ繝ェ繝シ繧コ) + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 1, 1 ].Drums = 0; // 譛ェ菴ソ逕ィ + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 1, 1 ].Guitar = 44; + n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ 1, 1, 1 ].Bass = 44; + #endregion + + n蛻、螳壻ス咲スョ = new STDGBVALUE(); + n蛻、螳壻ス咲スョ.Drums = E蛻、螳壻ス咲スョ.讓呎コ; + n蛻、螳壻ス咲スョ.Guitar = E蛻、螳壻ス咲スョ.讓呎コ; + n蛻、螳壻ス咲スョ.Bass = E蛻、螳壻ス咲スョ.讓呎コ; + + // 陬懈ュ」蛟、縺ッ縲¨ormal/Reverse, Drums/GR逕サ髱「蜈ア騾 + nJudgeLinePosY_delta.Drums = 0; + nJudgeLinePosY_delta.Guitar = 0; + nJudgeLinePosY_delta.Bass = 0; + } + + + + /// + /// 蛻、螳壹Λ繧、繝ウ縺ョY蠎ァ讓吶r霑斐☆縲ゅ→繧翫≠縺医★Guitar/Bass縺ョ縺ソ蟇セ蠢懊 + /// + /// E讌ス蝎ィ繝代シ繝 + /// GRmode縺句凄縺 + /// Reverse縺句凄縺 + /// + public int n蛻、螳壹Λ繧、繝ウY蠎ァ讓( E讌ス蝎ィ繝代シ繝 eInst, bool bGRmode, bool bReverse ) + { + return n蛻、螳壹Λ繧、繝ウY蠎ァ讓( eInst, bGRmode, bReverse, false ); + } + + public int n蛻、螳壹Λ繧、繝ウY蠎ァ讓( E讌ス蝎ィ繝代シ繝 eInst, bool bGRmode, bool bReverse, bool bWailingFrame ) + { + return n蛻、螳壹Λ繧、繝ウY蠎ァ讓( eInst, bGRmode, bReverse, bWailingFrame, false ); + } + + /// + /// 蛻、螳壹Λ繧、繝ウ縺ョY蠎ァ讓吶r霑斐☆縲ゅ→繧翫≠縺医★Guitar/Bass縺ョ縺ソ蟇セ蠢懊 + /// + /// E讌ス蝎ィ繝代シ繝 + /// GRmode縺句凄縺 + /// Reverse縺句凄縺 + /// Wailing譫縺ョ蠎ァ讓吶°縲∝愛螳壹Λ繧、繝ウ縺ョ蠎ァ讓吶° + /// 繝励Ξ繝シ繝、繝シ縺ョ繝ゥ繧、繝ウ陦ィ遉コ菴咲スョ陬懈ュ」諠蝣ア繧貞刈縺医k縺九←縺縺 + /// + public int n蛻、螳壹Λ繧、繝ウY蠎ァ讓( E讌ス蝎ィ繝代シ繝 eInst, bool bGRmode, bool bReverse, bool bWailingFrame, bool b陬懈ュ」縺ゅj ) + { + if ( eInst == E讌ス蝎ィ繝代シ繝.DRUMS ) + { + throw new NotImplementedException(); + } + else if ( eInst == E讌ス蝎ィ繝代シ繝.UNKNOWN ) + { + throw new ArgumentOutOfRangeException(); + } + else + { + int nReverse = bReverse ? 1 : 0; + int nGRmode = bGRmode ? 1 : 0; + int nWailing = bWailingFrame ? 1 : 0; + int nInst = (int) eInst; + int ret = this.n蛻、螳壹Λ繧、繝ウY蠎ァ讓吝繝繝シ繧ソ[ nReverse, nGRmode, nWailing ][ nInst ]; // 陬懈ュ」辟。縺励ョ蛟、 + if ( bReverse ) + { + if ( n蛻、螳壻ス咲スョ[ nInst ] == E蛻、螳壻ス咲スョ.Lower ) ret += 13; + if ( b陬懈ュ」縺ゅj ) ret += nJudgeLinePosY_delta[ nInst ]; + } + else + { + if ( n蛻、螳壻ス咲スョ[ nInst ] == E蛻、螳壻ス咲スョ.Lower ) ret += 52; + if ( b陬懈ュ」縺ゅj ) ret -= nJudgeLinePosY_delta[ nInst ]; + } + return ret; + } + } + + public int n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓( E讌ス蝎ィ繝代シ繝 eInst, bool bGRmode, bool bReverse ) + { + if ( eInst == E讌ス蝎ィ繝代シ繝.DRUMS ) + { + throw new NotImplementedException(); + } + else if ( eInst == E讌ス蝎ィ繝代シ繝.UNKNOWN ) + { + throw new ArgumentOutOfRangeException(); + } + else + { + int nInst = (int) eInst; + int nGRmode = bGRmode ? 1 : 0; + int nReverse = bReverse ? 1 : 0; + int nVseries = (int) n蛻、螳壻ス咲スョ[ nInst ]; + int ret = n貍泌・蹴GB繝懊ち繝ウY蠎ァ讓吝繝繝シ繧ソ[ nReverse, nGRmode, nVseries ][ nInst ]; // 陬懈ュ」辟。縺励ョ蛟、 + + return ret; + } + } + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rumsDancer.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rumsDancer.cs new file mode 100644 index 00000000..2af6273a --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rumsDancer.cs @@ -0,0 +1,75 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Runtime.InteropServices; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rumsDancer : CActivity + { + /// + /// 雕翫j蟄 + /// + public CAct貍泌・愁rumsDancer() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + public override void On豢サ諤ァ蛹() + { + this.ct雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ = new CCounter(); + base.On豢サ諤ァ蛹(); + } + + public override void On髱樊エサ諤ァ蛹() + { + this.ct雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ = null; + base.On髱樊エサ諤ァ蛹(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + this.ar雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ = C螟画鋤.ar驟榊怜ス「蠑上ョstring繧段nt驟榊励↓螟画鋤縺励※霑斐☆(TJAPlayer3.Skin.Game_Dancer_Motion); + if(this.ar雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ == null) ar雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ = C螟画鋤.ar驟榊怜ス「蠑上ョstring繧段nt驟榊励↓螟画鋤縺励※霑斐☆("0,0"); + this.ct雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ = new CCounter(0, this.ar雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, 0.01, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + public override int On騾イ陦梧緒逕サ() + { + if( this.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + this.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = true; + } + + if (this.ct雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ != null || TJAPlayer3.Skin.Game_Dancer_Ptn != 0) this.ct雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ.t騾イ陦鍬oopDb(); + + if (TJAPlayer3.ConfigIni.ShowDancer && this.ct雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ != null && TJAPlayer3.Skin.Game_Dancer_Ptn != 0) + { + for (int i = 0; i < 5; i++) + { + if (TJAPlayer3.Tx.Dancer[i][this.ar雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ[(int)this.ct雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ.n迴セ蝨ィ縺ョ蛟、]] != null) + { + if ((int)TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[0] >= TJAPlayer3.Skin.Game_Dancer_Gauge[i]) + TJAPlayer3.Tx.Dancer[i][this.ar雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ[(int)this.ct雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ.n迴セ蝨ィ縺ョ蛟、]].t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Dancer_X[i], TJAPlayer3.Skin.Game_Dancer_Y[i]); + } + } + } + return base.On騾イ陦梧緒逕サ(); + } + + #region[ private ] + //----------------- + public int[] ar雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ; + public CCounter ct雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rumsDanger.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rumsDanger.cs new file mode 100644 index 00000000..aeba30d2 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rumsDanger.cs @@ -0,0 +1,80 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rumsDanger : CAct貍泌・愁anger蜈ア騾 + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + //public CAct貍泌・愁rumsDanger() + //{ + // base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + //} + + + // CActivity 螳溯」 + + //public override void On豢サ諤ァ蛹() + //{ + // this.bDanger荳ュ = false; + // this.ct遘サ蜍慕畑 = new CCounter(); + // this.ct騾乗主コヲ逕ィ = new CCounter(); + // base.On豢サ諤ァ蛹(); + //} + //public override void On髱樊エサ諤ァ蛹() + //{ + // this.ct遘サ蜍慕畑 = null; + // this.ct騾乗主コヲ逕ィ = null; + // base.On髱樊エサ諤ァ蛹(); + //} + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txDANGER ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + throw new InvalidOperationException( "t騾イ陦梧緒逕サ(bool)縺ョ縺サ縺繧剃スソ逕ィ縺励※縺上□縺輔>縲" ); + } + /// + /// 繝峨Λ繝逕サ髱「縺ョDANGER謠冗判 + /// + /// Drums縺ョ繧イ繝シ繧ク縺轡anger縺九←縺縺(Guitar/Bass縺ィ蜈ア逕ィ縺ョ繧イ繝シ繧ク) + /// Guitar縺ョ繧イ繝シ繧ク(譛ェ菴ソ逕ィ) + /// Bass縺ョ繧イ繝シ繧ク(譛ェ菴ソ逕ィ) + /// + public override int t騾イ陦梧緒逕サ( bool bIsDangerDrums, bool bIsDangerGuitar, bool bIsDangerBass ) + { + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + //private bool bDanger荳ュ; + //private CCounter ct遘サ蜍慕畑; + //private CCounter ct騾乗主コヲ逕ィ; +// private const int n蜿ウ菴咲スョ = 0x12a; +// private const int n蟾ヲ菴咲スョ = 0x26; + private readonly Rectangle[] rc鬆伜沺 = new Rectangle[] { new Rectangle( 0, 0, 0x20, 0x40 ), new Rectangle( 0x20, 0, 0x20, 0x40 ) }; + private CTexture txDANGER; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rumsFooter.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rumsFooter.cs new file mode 100644 index 00000000..31ee79a2 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rumsFooter.cs @@ -0,0 +1,54 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Runtime.InteropServices; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rumsFooter : CActivity + { + /// + /// 繝輔ャ繧ソ繝シ + /// + public CAct貍泌・愁rumsFooter() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + public override void On豢サ諤ァ蛹() + { + base.On豢サ諤ァ蛹(); + } + + public override void On髱樊エサ諤ァ蛹() + { + base.On髱樊エサ諤ァ蛹(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + public override int On騾イ陦梧緒逕サ() + { + if (TJAPlayer3.Tx.Mob_Footer != null) + { + TJAPlayer3.Tx.Mob_Footer.t2D謠冗判(TJAPlayer3.app.Device, 0, 720 - TJAPlayer3.Tx.Mob_Footer.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height); + } + return base.On騾イ陦梧緒逕サ(); + } + + #region[ private ] + //----------------- + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rumsMob.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rumsMob.cs new file mode 100644 index 00000000..73f622e8 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rumsMob.cs @@ -0,0 +1,93 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Runtime.InteropServices; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rumsMob : CActivity + { + /// + /// 雕翫j蟄 + /// + public CAct貍泌・愁rumsMob() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + public override void On豢サ諤ァ蛹() + { + ctMob = new CCounter(); + //ctMob = new CCounter(1, 180, 60.0 / TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM * TJAPlayer3.Skin.Game_Mob_Beat / 180 / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0), CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + ctMobPtn = new CCounter(); + RandomMob = TJAPlayer3.Random.Next(TJAPlayer3.Skin.Game_Mob_Ptn); + base.On豢サ諤ァ蛹(); + } + + public override void On髱樊エサ諤ァ蛹() + { + ctMob = null; + ctMobPtn = null; + base.On髱樊エサ諤ァ蛹(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + public override int On騾イ陦梧緒逕サ() + { + if(!TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay) + { + if (ctMob != null) ctMob.t騾イ陦鍬oopDb(); + if (ctMobPtn != null || TJAPlayer3.Skin.Game_Mob_Ptn != 0) ctMobPtn.t騾イ陦鍬oopDb(); + + if (TJAPlayer3.Skin.Game_Mob_Ptn != 0) + { + + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, ctMob.n迴セ蝨ィ縺ョ蛟、.ToString()); + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 20, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, ctMobPtn.n迴セ蝨ィ縺ョ蛟、.ToString()); + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 30, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, ((int)ctMobPtn.n迴セ蝨ィ縺ョ蛟、).ToString()); + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 40, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[0].ToString()); + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 10, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, Math.Sin((float)this.ctMob.n迴セ蝨ィ縺ョ蛟、 * (Math.PI / 180)).ToString()); + + + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[0] >= 100) + { + + + + if (TJAPlayer3.Tx.Mob[RandomMob] != null) + TJAPlayer3.Tx.Mob[RandomMob].t2D謠冗判(TJAPlayer3.app.Device, 0, (720 - (TJAPlayer3.Tx.Mob[RandomMob].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height - 70)) + -((float)Math.Sin((float)this.ctMob.n迴セ蝨ィ縺ョ蛟、 * (Math.PI / 180)) * 70)); + + + /* + if (TJAPlayer3.Tx.Mob[(int)ctMobPtn.n迴セ蝨ィ縺ョ蛟、] != null) + { + TJAPlayer3.Tx.Mob[(int)ctMobPtn.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, 0, (720 - (TJAPlayer3.Tx.Mob[0].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height - 70)) + -((float)Math.Sin((float)this.ctMob.n迴セ蝨ィ縺ョ蛟、 * (Math.PI / 180)) * 70)); + } + */ + + } + + } + } + return base.On騾イ陦梧緒逕サ(); + } + #region[ private ] + //----------------- + public CCounter ctMob; + public CCounter ctMobPtn; + private int RandomMob; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rumsMtaiko.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rumsMtaiko.cs new file mode 100644 index 00000000..624e535c --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rumsMtaiko.cs @@ -0,0 +1,379 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Runtime.InteropServices; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rumsMtaiko : CActivity + { + /// + /// mtaiko驛ィ蛻繧呈緒逕サ縺吶k繧ッ繝ゥ繧ケ縲ょキヲ蛛エ縺縺代 + /// + /// + public CAct貍泌・愁rumsMtaiko() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + public override void On豢サ諤ァ蛹() + { + for( int i = 0; i < 16; i++ ) + { + ST繝代ャ繝臥憾諷 st繝代ャ繝臥憾諷 = new ST繝代ャ繝臥憾諷(); + st繝代ャ繝臥憾諷.n譏弱k縺 = 0; + this.st繝代ャ繝臥憾諷擬 i ] = st繝代ャ繝臥憾諷; + } + base.On豢サ諤ァ蛹(); + } + + public override void On髱樊エサ諤ァ蛹() + { + base.On髱樊エサ諤ァ蛹(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ = new CCounter[ 4 ]; + this.After = new CDTX.ECourse[ 4 ]; + this.Before = new CDTX.ECourse[ 4 ]; + for ( int i = 0; i < 4; i++ ) + { + this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ i ] = new CCounter(); + } + + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ = null; + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + public override int On騾イ陦梧緒逕サ() + { + if( base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + this.n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝 = (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + + long num = (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + if ( num < this.n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝 ) + { + this.n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝 = num; + } + while( ( num - this.n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝 ) >= 20 ) + { + for( int j = 0; j < 16; j++ ) + { + if( this.st繝代ャ繝臥憾諷擬 j ].n譏弱k縺 > 0 ) + { + this.st繝代ャ繝臥憾諷擬 j ].n譏弱k縺--; + } + } + this.n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝 += 20; + } + + + this.nHS = TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums < 8 ? TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums : 7; + + if(TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan) + { + if (TJAPlayer3.Tx.Taiko_Background[2] != null) + TJAPlayer3.Tx.Taiko_Background[2].t2D謠冗判(TJAPlayer3.app.Device, 0, 184); + } + else + { + if (TJAPlayer3.Tx.Taiko_Background[0] != null) + TJAPlayer3.Tx.Taiko_Background[0].t2D謠冗判(TJAPlayer3.app.Device, 0, 184); + + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay) + { + if (TJAPlayer3.Tx.Taiko_Background[1] != null) + TJAPlayer3.Tx.Taiko_Background[1].t2D謠冗判(TJAPlayer3.app.Device, 0, 360); + } + } + + if(TJAPlayer3.Tx.Taiko_Base != null ) + { + TJAPlayer3.Tx.Taiko_Base.t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[0], TJAPlayer3.Skin.Game_Taiko_Y[0]); + if( TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay ) + TJAPlayer3.Tx.Taiko_Base.t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[1], TJAPlayer3.Skin.Game_Taiko_Y[1]); + } + if( TJAPlayer3.Tx.Taiko_Don_Left != null && TJAPlayer3.Tx.Taiko_Don_Right != null && TJAPlayer3.Tx.Taiko_Ka_Left != null && TJAPlayer3.Tx.Taiko_Ka_Right != null ) + { + TJAPlayer3.Tx.Taiko_Ka_Left.Opacity = this.st繝代ャ繝臥憾諷擬0].n譏弱k縺 * 73; + TJAPlayer3.Tx.Taiko_Ka_Right.Opacity = this.st繝代ャ繝臥憾諷擬1].n譏弱k縺 * 73; + TJAPlayer3.Tx.Taiko_Don_Left.Opacity = this.st繝代ャ繝臥憾諷擬2].n譏弱k縺 * 73; + TJAPlayer3.Tx.Taiko_Don_Right.Opacity = this.st繝代ャ繝臥憾諷擬3].n譏弱k縺 * 73; + + TJAPlayer3.Tx.Taiko_Ka_Left.t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[0], TJAPlayer3.Skin.Game_Taiko_Y[0], new Rectangle( 0, 0, TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height) ); + TJAPlayer3.Tx.Taiko_Ka_Right.t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[0] + TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Skin.Game_Taiko_Y[0], new Rectangle(TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, 0, TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height) ); + TJAPlayer3.Tx.Taiko_Don_Left.t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[0], TJAPlayer3.Skin.Game_Taiko_Y[0], new Rectangle( 0, 0, TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height) ); + TJAPlayer3.Tx.Taiko_Don_Right.t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[0] + TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Skin.Game_Taiko_Y[0], new Rectangle(TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, 0, TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + } + + if( TJAPlayer3.Tx.Taiko_Don_Left != null && TJAPlayer3.Tx.Taiko_Don_Right != null && TJAPlayer3.Tx.Taiko_Ka_Left != null && TJAPlayer3.Tx.Taiko_Ka_Right != null ) + { + TJAPlayer3.Tx.Taiko_Ka_Left.Opacity = this.st繝代ャ繝臥憾諷擬4].n譏弱k縺 * 73; + TJAPlayer3.Tx.Taiko_Ka_Right.Opacity = this.st繝代ャ繝臥憾諷擬5].n譏弱k縺 * 73; + TJAPlayer3.Tx.Taiko_Don_Left.Opacity = this.st繝代ャ繝臥憾諷擬6].n譏弱k縺 * 73; + TJAPlayer3.Tx.Taiko_Don_Right.Opacity = this.st繝代ャ繝臥憾諷擬7].n譏弱k縺 * 73; + + TJAPlayer3.Tx.Taiko_Ka_Left.t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[1], TJAPlayer3.Skin.Game_Taiko_Y[1], new Rectangle( 0, 0, TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height) ); + TJAPlayer3.Tx.Taiko_Ka_Right.t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[1] + TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Skin.Game_Taiko_Y[1], new Rectangle(TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, 0, TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height) ); + TJAPlayer3.Tx.Taiko_Don_Left.t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[1], TJAPlayer3.Skin.Game_Taiko_Y[1], new Rectangle( 0, 0, TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height) ); + TJAPlayer3.Tx.Taiko_Don_Right.t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_X[1] + TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Skin.Game_Taiko_Y[1], new Rectangle(TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, 0, TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Tx.Taiko_Ka_Right.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height) ); + } + + int[] nLVUPY = new int[] { 127, 127, 0, 0 }; + + for ( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) + { + if( !this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ i ].b蛛懈ュ「荳ュ ) + { + this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ i ].t騾イ陦(); + if( this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ i ].b邨ゆコ蛟、縺ォ驕斐@縺 ) { + this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ i ].t蛛懈ュ「(); + } + } + if( ( this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ i ].b騾イ陦御クュ && ( TJAPlayer3.Tx.Taiko_LevelUp != null && TJAPlayer3.Tx.Taiko_LevelDown != null ) ) && !TJAPlayer3.ConfigIni.bNoInfo ) + { + //this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ i ].n迴セ蝨ィ縺ョ蛟、 = 110; + + //2017.08.21 kairera0467 t3D謠冗判縺ォ螟画峩縲 + float fScale = 1.0f; + int nAlpha = 255; + float[] fY = new float[] { 206, -206, 0, 0 }; + if( this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ i ].n迴セ蝨ィ縺ョ蛟、 >= 0 && this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ i ].n迴セ蝨ィ縺ョ蛟、 <= 20 ) + { + nAlpha = 60; + fScale = 1.14f; + } + else if( this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ i ].n迴セ蝨ィ縺ョ蛟、 >= 21 && this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ i ].n迴セ蝨ィ縺ョ蛟、 <= 40 ) + { + nAlpha = 60; + fScale = 1.19f; + } + else if( this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ i ].n迴セ蝨ィ縺ョ蛟、 >= 41 && this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ i ].n迴セ蝨ィ縺ョ蛟、 <= 60 ) + { + nAlpha = 220; + fScale = 1.23f; + } + else if( this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ i ].n迴セ蝨ィ縺ョ蛟、 >= 61 && this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ i ].n迴セ蝨ィ縺ョ蛟、 <= 80 ) + { + nAlpha = 230; + fScale = 1.19f; + } + else if( this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ i ].n迴セ蝨ィ縺ョ蛟、 >= 81 && this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ i ].n迴セ蝨ィ縺ョ蛟、 <= 100 ) + { + nAlpha = 240; + fScale = 1.14f; + } + else if( this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ i ].n迴セ蝨ィ縺ョ蛟、 >= 101 && this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ i ].n迴セ蝨ィ縺ョ蛟、 <= 120 ) + { + nAlpha = 255; + fScale = 1.04f; + } + else + { + nAlpha = 255; + fScale = 1.0f; + } + + SlimDX.Matrix mat = SlimDX.Matrix.Identity; + mat *= SlimDX.Matrix.Scaling( fScale, fScale, 1.0f ); + mat *= SlimDX.Matrix.Translation( -329, fY[ i ], 0 ); + if( this.After[ i ] - this.Before[ i ] >= 0 ) + { + //繝ャ繝吶Ν繧「繝繝 + TJAPlayer3.Tx.Taiko_LevelUp.Opacity = nAlpha; + TJAPlayer3.Tx.Taiko_LevelUp.t3D謠冗判( TJAPlayer3.app.Device, mat ); + } + else + { + TJAPlayer3.Tx.Taiko_LevelDown.Opacity = nAlpha; + TJAPlayer3.Tx.Taiko_LevelDown.t3D謠冗判( TJAPlayer3.app.Device, mat ); + } + } + } + + for( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) + { + // 2018/7/1 荳譎ら噪縺ォ繧ェ繝励す繝ァ繝ウ逕サ蜒上ョ蟒豁「縲ゅが繝励す繝ァ繝ウ逕サ蜒上↓縺、縺縺ヲ縺ッ蠕梧律菴懊j逶エ縺励∪縺吶(AioiLight) + //if( !CDTXMania.ConfigIni.bNoInfo && CDTXMania.Skin.eDiffDispMode != E髮」譏灘コヲ陦ィ遉コ繧ソ繧、繝.mtaiko縺ォ逕サ蜒上〒陦ィ遉コ ) + //{ + // this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ_HS.t2D謠冗判( CDTXMania.app.Device, 0, 230, new Rectangle( 0, this.nHS * 44, 162, 44 ) ); + // switch( CDTXMania.ConfigIni.eRandom.Taiko ) + // { + // case E繝ゥ繝ウ繝繝繝「繝シ繝.RANDOM: + // if( this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ_RANMIR != null ) + // this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ_RANMIR.t2D謠冗判( CDTXMania.app.Device, 0, 264, new Rectangle( 0, 0, 162, 44 ) ); + // break; + // case E繝ゥ繝ウ繝繝繝「繝シ繝.HYPERRANDOM: + // if( this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ_RANMIR != null ) + // this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ_RANMIR.t2D謠冗判( CDTXMania.app.Device, 0, 264, new Rectangle( 0, 88, 162, 44 ) ); + // break; + // case E繝ゥ繝ウ繝繝繝「繝シ繝.SUPERRANDOM: + // if( this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ_RANMIR != null ) + // this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ_RANMIR.t2D謠冗判( CDTXMania.app.Device, 0, 264, new Rectangle( 0, 132, 162, 44 ) ); + // break; + // case E繝ゥ繝ウ繝繝繝「繝シ繝.MIRROR: + // if( this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ_RANMIR != null ) + // this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ_RANMIR.t2D謠冗判( CDTXMania.app.Device, 0, 264, new Rectangle( 0, 44, 162, 44 ) ); + // break; + // } + + // if( CDTXMania.ConfigIni.eSTEALTH == E繧ケ繝繝ォ繧ケ繝「繝シ繝.STEALTH ) + // this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ_迚ケ谿.t2D謠冗判( CDTXMania.app.Device, 0, 300, new Rectangle( 0, 0, 162, 44 ) ); + // else if( CDTXMania.ConfigIni.eSTEALTH == E繧ケ繝繝ォ繧ケ繝「繝シ繝.DORON ) + // this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ_迚ケ谿.t2D謠冗判( CDTXMania.app.Device, 0, 300, new Rectangle( 0, 44, 162, 44 ) ); + //} + if (TJAPlayer3.Tx.Couse_Symbol[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[i]] != null) + { + TJAPlayer3.Tx.Couse_Symbol[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[i]].t2D謠冗判(TJAPlayer3.app.Device, + TJAPlayer3.Skin.Game_CourseSymbol_X[i], + TJAPlayer3.Skin.Game_CourseSymbol_Y[i] + ); + } + + if (TJAPlayer3.ConfigIni.ShinuchiMode) + { + if (TJAPlayer3.Tx.Couse_Symbol[(int)Difficulty.Total] != null) + { + TJAPlayer3.Tx.Couse_Symbol[(int)Difficulty.Total].t2D謠冗判(TJAPlayer3.app.Device, + TJAPlayer3.Skin.Game_CourseSymbol_X[i], + TJAPlayer3.Skin.Game_CourseSymbol_Y[i] + ); + } + + } + } + + TJAPlayer3.NamePlate.tNamePlateDraw(TJAPlayer3.Skin.Game_Taiko_NamePlate_X[0], TJAPlayer3.Skin.Game_Taiko_NamePlate_Y[0], 0); + + if(TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay) + { + TJAPlayer3.NamePlate.tNamePlateDraw(TJAPlayer3.Skin.Game_Taiko_NamePlate_X[1], TJAPlayer3.Skin.Game_Taiko_NamePlate_Y[1], 1); + } + + if (TJAPlayer3.Tx.Taiko_PlayerNumber[0] != null) + { + TJAPlayer3.Tx.Taiko_PlayerNumber[0].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_PlayerNumber_X[0], TJAPlayer3.Skin.Game_Taiko_PlayerNumber_Y[0]); + } + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay && TJAPlayer3.Tx.Taiko_PlayerNumber[1] != null) + { + TJAPlayer3.Tx.Taiko_PlayerNumber[1].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Taiko_PlayerNumber_X[1], TJAPlayer3.Skin.Game_Taiko_PlayerNumber_Y[1]); + } + return base.On騾イ陦梧緒逕サ(); + } + + public void tMtaikoEvent( int nChannel, int nHand, int nPlayer ) + { + if( !TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay ) + { + switch( nChannel ) + { + case 0x11: + case 0x13: + case 0x15: + case 0x16: + case 0x17: + { + this.st繝代ャ繝臥憾諷擬 2 + nHand + ( 4 * nPlayer ) ].n譏弱k縺 = 8; + } + break; + case 0x12: + case 0x14: + { + this.st繝代ャ繝臥憾諷擬 nHand + ( 4 * nPlayer ) ].n譏弱k縺 = 8; + } + break; + + } + } + else + { + switch( nChannel ) + { + case 0x11: + case 0x15: + case 0x16: + case 0x17: + { + this.st繝代ャ繝臥憾諷擬 2 + nHand + ( 4 * nPlayer ) ].n譏弱k縺 = 8; + } + break; + + case 0x13: + { + this.st繝代ャ繝臥憾諷擬 2 + ( 4 * nPlayer ) ].n譏弱k縺 = 8; + this.st繝代ャ繝臥憾諷擬 3 + ( 4 * nPlayer ) ].n譏弱k縺 = 8; + } + break; + + case 0x12: + { + this.st繝代ャ繝臥憾諷擬 nHand + ( 4 * nPlayer ) ].n譏弱k縺 = 8; + } + break; + + case 0x14: + { + this.st繝代ャ繝臥憾諷擬 0 + ( 4 * nPlayer ) ].n譏弱k縺 = 8; + this.st繝代ャ繝臥憾諷擬 1 + ( 4 * nPlayer ) ].n譏弱k縺 = 8; + } + break; + } + } + + } + + public void tBranchEvent(CDTX.ECourse Before, CDTX.ECourse After, int player) + { + if ( After != Before ) + this.ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ[ player ] = new CCounter( 0, 1000, 1, TJAPlayer3.Timer ); + + this.After[ player ] = After; + this.Before[ player ] = Before; + } + + + #region[ private ] + //----------------- + //讒矩菴 + [StructLayout(LayoutKind.Sequential)] + private struct ST繝代ャ繝臥憾諷 + { + public int n譏弱k縺; + } + + //螟ェ鮠 + private ST繝代ャ繝臥憾諷擬] st繝代ャ繝臥憾諷 = new ST繝代ャ繝臥憾諷擬 4 * 4 ]; + private long n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝; + + //private CTexture[] tx繧ウ繝シ繧ケ繧キ繝ウ繝懊Ν = new CTexture[ 6 ]; + private string[] strCourseSymbolFileName; + + //繧ェ繝励す繝ァ繝ウ + private CTexture tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ_HS; + private CTexture tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ_RANMIR; + private CTexture tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ_迚ケ谿; + private int nHS; + + //隴憺擇蛻蟯 + private CCounter[] ct繝ャ繝吶Ν繧「繝繝励ム繧ヲ繝ウ; + public CDTX.ECourse[] After; + public CDTX.ECourse[] Before; + //----------------- + #endregion + + } +} +縲 diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ュ繝」繝ゥ繧ッ繧ソ繝シ.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ュ繝」繝ゥ繧ッ繧ソ繝シ.cs new file mode 100644 index 00000000..2067b8a5 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ュ繝」繝ゥ繧ッ繧ソ繝シ.cs @@ -0,0 +1,394 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Globalization; +using System.Runtime.InteropServices; +using System.Drawing; +using System.Diagnostics; +using FDK; + + +namespace TJAPlayer3 +{ + //繧ッ繝ゥ繧ケ縺ョ險ュ鄂ョ菴咲スョ縺ッ蠢縺壽シ泌・冗判髱「蜈ア騾壹↓鄂ョ縺上%縺ィ縲 + //縺昴≧縺励↑縺代l縺ーBPM螟牙喧縺ォ蟇セ蠢懊〒縺阪∪縺帙s縲 + + //螳梧舌@縺ヲ縺繧矩Κ蛻縺ッ莉・荳九ョ縺ィ縺翫j縲(逕サ蜒丞ョ梧+蜍穂ス懃「コ隱榊ョ御コ縺ァ螳梧舌→縺吶k) + //_騾壼クク繝「繝シ繧キ繝ァ繝ウ + //_繧エ繝シ繧エ繝シ繧ソ繧、繝繝「繝シ繧キ繝ァ繝ウ + //_繧ッ繝ェ繧「譎ゅΔ繝シ繧キ繝ァ繝ウ + // + internal class CAct貍泌・愁rums繧ュ繝」繝ゥ繧ッ繧ソ繝シ : CActivity + { + public CAct貍泌・愁rums繧ュ繝」繝ゥ繧ッ繧ソ繝シ() + { + + } + + public override void On豢サ諤ァ蛹() + { + for(int i = 0; i < 2; i++) + { + ctChara_Normal[i] = new CCounter(); + ctChara_GoGo[i] = new CCounter(); + ctChara_Clear[i] = new CCounter(); + + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝彈i] = new CCounter(); + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝廴AX[i] = new CCounter(); + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝[i] = new CCounter(); + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝MAX[i] = new CCounter(); + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝杣i] = new CCounter(); + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX[i] = new CCounter(); + + CharaAction_Balloon_Breaking[i] = new CCounter(); + CharaAction_Balloon_Broke[i] = new CCounter(); + CharaAction_Balloon_Miss[i] = new CCounter(); + CharaAction_Balloon_Delay[i] = new CCounter(); + + this.b鬚ィ闊ケ騾」謇謎クュ[i] = false; + this.b貍泌・丈クュ[i] = false; + + CharaAction_Balloon_FadeOut[i] = new Animations.FadeOut(TJAPlayer3.Skin.Game_Chara_Balloon_FadeOut); + + this.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[i] = false; + } + + // 縺オ縺縺帙s邉サ繧「繝九Γ繝シ繧キ繝ァ繝ウ縺ョ邱丞咲函譎る俣縺ッ逕サ蜒乗椢謨ー x Tick髢馴囈縺ェ縺ョ縺ァ縲 + // 繝輔ぉ繝シ繝峨い繧ヲ繝医ョ髢句ァ九ち繧、繝溘Φ繧ー縺ッ縲∫キ丞咲函譎る俣 - 繝輔ぉ繝シ繝峨い繧ヲ繝域凾髢薙 + var tick = TJAPlayer3.Skin.Game_Chara_Balloon_Timer; + var balloonBrokePtn = TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Broke; + var balloonMissPtn = TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Miss; + CharaAction_Balloon_FadeOut_StartMs[0] = (balloonBrokePtn * tick) - TJAPlayer3.Skin.Game_Chara_Balloon_FadeOut; + CharaAction_Balloon_FadeOut_StartMs[1] = (balloonMissPtn * tick) - TJAPlayer3.Skin.Game_Chara_Balloon_FadeOut; + if (balloonBrokePtn > 1) CharaAction_Balloon_FadeOut_StartMs[0] /= balloonBrokePtn - 1; + if (balloonMissPtn > 1) CharaAction_Balloon_FadeOut_StartMs[1] /= balloonMissPtn - 1; // - 1縺ッ繧ソ繧、繝槭シ逕ィ + + base.On豢サ諤ァ蛹(); + } + + public override void On髱樊エサ諤ァ蛹() + { + for (int i = 0; i < 2; i++) + { + ctChara_Normal[i] = null; + ctChara_GoGo[i] = null; + ctChara_Clear[i] = null; + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝彈i] = null; + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝廴AX[i] = null; + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝[i] = null; + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝MAX[i] = null; + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝杣i] = null; + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX[i] = null; + + CharaAction_Balloon_Breaking[i] = null; + CharaAction_Balloon_Broke[i] = null; + CharaAction_Balloon_Miss[i] = null; + CharaAction_Balloon_Delay[i] = null; + + CharaAction_Balloon_FadeOut[i] = null; + } + + base.On髱樊エサ諤ァ蛹(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + this.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ = C螟画鋤.ar驟榊怜ス「蠑上ョstring繧段nt驟榊励↓螟画鋤縺励※霑斐☆( TJAPlayer3.Skin.Game_Chara_Motion_Normal); + this.ar繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ = C螟画鋤.ar驟榊怜ス「蠑上ョstring繧段nt驟榊励↓螟画鋤縺励※霑斐☆(TJAPlayer3.Skin.Game_Chara_Motion_GoGo); + this.ar繧ッ繝ェ繧「繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ = C螟画鋤.ar驟榊怜ス「蠑上ョstring繧段nt驟榊励↓螟画鋤縺励※霑斐☆(TJAPlayer3.Skin.Game_Chara_Motion_Clear); + if (ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ == null) this.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ = C螟画鋤.ar驟榊怜ス「蠑上ョstring繧段nt驟榊励↓螟画鋤縺励※霑斐☆("0,0"); + if (ar繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ == null) this.ar繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ = C螟画鋤.ar驟榊怜ス「蠑上ョstring繧段nt驟榊励↓螟画鋤縺励※霑斐☆("0,0"); + if (ar繧ッ繝ェ繧「繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ == null) this.ar繧ッ繝ェ繧「繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ = C螟画鋤.ar驟榊怜ス「蠑上ョstring繧段nt驟榊励↓螟画鋤縺励※霑斐☆("0,0"); + for (int i = 0; i < 2; i++) + { + ctChara_Normal[i] = new CCounter(0, ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, 10, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + ctChara_GoGo[i] = new CCounter(0, ar繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, 10, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + ctChara_Clear[i] = new CCounter(0, ar繧ッ繝ェ繧「繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, 10, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + if (CharaAction_Balloon_Delay[i] != null) CharaAction_Balloon_Delay[i].n迴セ蝨ィ縺ョ蛟、 = (int)CharaAction_Balloon_Delay[i].n邨ゆコ蛟、; + } + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + public override int On騾イ陦梧緒逕サ() + { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + if (ctChara_Normal != null || TJAPlayer3.Skin.Game_Chara_Ptn_Normal != 0) ctChara_Normal[i].t騾イ陦鍬oopDb(); + if (ctChara_GoGo != null || TJAPlayer3.Skin.Game_Chara_Ptn_GoGo != 0) ctChara_GoGo[i].t騾イ陦鍬oopDb(); + if (ctChara_Clear != null || TJAPlayer3.Skin.Game_Chara_Ptn_Clear != 0) ctChara_Clear[i].t騾イ陦鍬oopDb(); + if (this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝 != null || TJAPlayer3.Skin.Game_Chara_Ptn_10combo != 0) this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝彈i].t騾イ陦慧b(); + if (this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝廴AX != null || TJAPlayer3.Skin.Game_Chara_Ptn_10combo_Max != 0) this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝廴AX[i].t騾イ陦慧b(); + if (this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝 != null || TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart != 0) this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝[i].t騾イ陦慧b(); + if (this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝MAX != null || TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart_Max != 0) this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝MAX[i].t騾イ陦慧b(); + if (this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝 != null || TJAPlayer3.Skin.Game_Chara_Ptn_ClearIn != 0) this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝杣i].t騾イ陦慧b(); + if (this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX != null || TJAPlayer3.Skin.Game_Chara_Ptn_SoulIn != 0) this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX[i].t騾イ陦慧b(); + + + if (this.b鬚ィ闊ケ騾」謇謎クュ[i] != true && this.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[i] != true && CharaAction_Balloon_Delay[i].b邨ゆコ蛟、縺ォ驕斐@縺) + { + if (!TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bIsGOGOTIME[i]) + { + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[i] >= 100.0 && TJAPlayer3.Skin.Game_Chara_Ptn_Clear != 0) + { + if (TJAPlayer3.Skin.Game_Chara_Ptn_Clear != 0) + TJAPlayer3.Tx.Chara_Normal_Maxed[this.ar繧ッ繝ェ繧「繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ[(int)this.ctChara_Clear[i].n迴セ蝨ィ縺ョ蛟、]].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Chara_X[i], TJAPlayer3.Skin.Game_Chara_Y[i]); + } + else if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[i] >= 80.0 && TJAPlayer3.Skin.Game_Chara_Ptn_Clear != 0) + { + if (TJAPlayer3.Skin.Game_Chara_Ptn_Clear != 0) + { + TJAPlayer3.Tx.Chara_Normal_Cleared[this.ar繧ッ繝ェ繧「繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ[(int)this.ctChara_Clear[i].n迴セ蝨ィ縺ョ蛟、]].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Chara_X[i], TJAPlayer3.Skin.Game_Chara_Y[i]); + } + } + else + { + if (TJAPlayer3.Skin.Game_Chara_Ptn_Normal != 0) + { + TJAPlayer3.Tx.Chara_Normal[this.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ[(int)this.ctChara_Normal[i].n迴セ蝨ィ縺ョ蛟、]].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Chara_X[i], TJAPlayer3.Skin.Game_Chara_Y[i]); + } + } + } + else + { + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[i] >= 100.0 && TJAPlayer3.Skin.Game_Chara_Ptn_GoGo != 0) + { + if (TJAPlayer3.Skin.Game_Chara_Ptn_GoGo != 0) + TJAPlayer3.Tx.Chara_GoGoTime_Maxed[this.ar繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ[(int)this.ctChara_GoGo[i].n迴セ蝨ィ縺ョ蛟、]].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Chara_X[i], TJAPlayer3.Skin.Game_Chara_Y[i]); + } + else + { + if (TJAPlayer3.Skin.Game_Chara_Ptn_GoGo != 0) + TJAPlayer3.Tx.Chara_GoGoTime[this.ar繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ[(int)this.ctChara_GoGo[i].n迴セ蝨ィ縺ョ蛟、]].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Chara_X[i], TJAPlayer3.Skin.Game_Chara_Y[i]); + } + } + } + + if (this.b鬚ィ闊ケ騾」謇謎クュ[i] != true && b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[i] == true && CharaAction_Balloon_Delay[i].b邨ゆコ蛟、縺ォ驕斐@縺) + { + + if (this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝彈i].b騾イ陦御クュ) + { + if (TJAPlayer3.Tx.Chara_10Combo[i] != null && TJAPlayer3.Skin.Game_Chara_Ptn_10combo != 0) + { + TJAPlayer3.Tx.Chara_10Combo[(int)this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝彈i].n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Chara_X[i], TJAPlayer3.Skin.Game_Chara_Y[i]); + } + if (this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝彈i].b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[i] = false; + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝彈i].t蛛懈ュ「(); + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝彈i].n迴セ蝨ィ縺ョ蛟、 = 0; + } + } + + + if (this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝廴AX[i].b騾イ陦御クュ) + { + if (TJAPlayer3.Tx.Chara_10Combo_Maxed[i] != null && TJAPlayer3.Skin.Game_Chara_Ptn_10combo_Max != 0) + { + TJAPlayer3.Tx.Chara_10Combo_Maxed[(int)this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝廴AX[i].n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Chara_X[i], TJAPlayer3.Skin.Game_Chara_Y[i]); + } + if (this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝廴AX[i].b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[i] = false; + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝廴AX[i].t蛛懈ュ「(); + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝廴AX[i].n迴セ蝨ィ縺ョ蛟、 = 0; + } + + } + + if (this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝[i].b騾イ陦御クュ) + { + if (TJAPlayer3.Tx.Chara_GoGoStart[i] != null && TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart != 0) + { + TJAPlayer3.Tx.Chara_GoGoStart[(int)this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝[i].n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Chara_X[i], TJAPlayer3.Skin.Game_Chara_Y[i]); + } + if (this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝[i].b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[i] = false; + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝[i].t蛛懈ュ「(); + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝[i].n迴セ蝨ィ縺ョ蛟、 = 0; + this.ctChara_GoGo[i].n迴セ蝨ィ縺ョ蛟、 = TJAPlayer3.Skin.Game_Chara_Ptn_GoGo / 2; + } + } + + if (this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝MAX[i].b騾イ陦御クュ) + { + if (TJAPlayer3.Tx.Chara_GoGoStart_Maxed[i] != null && TJAPlayer3.Skin.Game_Chara_Ptn_GoGoStart_Max != 0) + { + TJAPlayer3.Tx.Chara_GoGoStart_Maxed[(int)this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝MAX[i].n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Chara_X[i], TJAPlayer3.Skin.Game_Chara_Y[i]); + } + if (this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝MAX[i].b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[i] = false; + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝MAX[i].t蛛懈ュ「(); + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝MAX[i].n迴セ蝨ィ縺ョ蛟、 = 0; + this.ctChara_GoGo[i].n迴セ蝨ィ縺ョ蛟、 = TJAPlayer3.Skin.Game_Chara_Ptn_GoGo / 2; + } + } + + if (this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝杣i].b騾イ陦御クュ) + { + if (TJAPlayer3.Tx.Chara_Become_Cleared[i] != null && TJAPlayer3.Skin.Game_Chara_Ptn_ClearIn != 0) + { + TJAPlayer3.Tx.Chara_Become_Cleared[(int)this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝杣i].n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Chara_X[i], TJAPlayer3.Skin.Game_Chara_Y[i]); + } + if (this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝杣i].b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[i] = false; + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝杣i].t蛛懈ュ「(); + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝杣i].n迴セ蝨ィ縺ョ蛟、 = 0; + } + } + + if (this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX[i].b騾イ陦御クュ) + { + if (TJAPlayer3.Tx.Chara_Become_Maxed[i] != null && TJAPlayer3.Skin.Game_Chara_Ptn_SoulIn != 0) + { + TJAPlayer3.Tx.Chara_Become_Maxed[(int)this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX[i].n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Chara_X[i], TJAPlayer3.Skin.Game_Chara_Y[i]); + } + if (this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX[i].b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[i] = false; + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX[i].t蛛懈ュ「(); + this.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX[i].n迴セ蝨ィ縺ョ蛟、 = 0; + } + } + } + if (this.b鬚ィ闊ケ騾」謇謎クュ[i] != true && CharaAction_Balloon_Delay[i].b邨ゆコ蛟、縺ォ驕斐@縺) + { + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.PuchiChara.On騾イ陦梧緒逕サ(TJAPlayer3.Skin.Game_PuchiChara_X[i], TJAPlayer3.Skin.Game_PuchiChara_Y[i], TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bIsAlreadyMaxed[i]); + } + } + return base.On騾イ陦梧緒逕サ(); + } + + public void OnDraw_Balloon() + { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + if (TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Breaking != 0) CharaAction_Balloon_Breaking[i]?.t騾イ陦(); + if (TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Broke != 0) CharaAction_Balloon_Broke[i]?.t騾イ陦(); + CharaAction_Balloon_Delay[i]?.t騾イ陦(); + if (TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Miss != 0) CharaAction_Balloon_Miss[i]?.t騾イ陦(); + CharaAction_Balloon_FadeOut[i].Tick(); + + //CharaAction_Balloon_Delay?.t騾イ陦(); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, CharaAction_Balloon_Broke?.b騾イ陦御クュ.ToString()); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 20, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, CharaAction_Balloon_Miss?.b騾イ陦御クュ.ToString()); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 40, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, CharaAction_Balloon_Breaking?.b騾イ陦御クュ.ToString()); + + if (b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[i]) + { + var nowOpacity = CharaAction_Balloon_FadeOut[i].Counter.b騾イ陦御クュ ? (int)CharaAction_Balloon_FadeOut[i].GetAnimation() : 255; + if (CharaAction_Balloon_Broke[i]?.b騾イ陦御クュ == true && TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Broke != 0) + { + if (CharaAction_Balloon_FadeOut[i].Counter.b蛛懈ュ「荳ュ && CharaAction_Balloon_Broke[i].n迴セ蝨ィ縺ョ蛟、 > CharaAction_Balloon_FadeOut_StartMs[i]) + { + CharaAction_Balloon_FadeOut[i].Start(); + } + if (TJAPlayer3.Tx.Chara_Balloon_Broke[CharaAction_Balloon_Broke[i].n迴セ蝨ィ縺ョ蛟、] != null) + { + TJAPlayer3.Tx.Chara_Balloon_Broke[CharaAction_Balloon_Broke[i].n迴セ蝨ィ縺ョ蛟、].Opacity = nowOpacity; + TJAPlayer3.Tx.Chara_Balloon_Broke[CharaAction_Balloon_Broke[i].n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, (TJAPlayer3.Skin.nScrollFieldX[0] - TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.nDefaultJudgePos[0, 0]) + TJAPlayer3.Skin.Game_Chara_Balloon_X[0], TJAPlayer3.Skin.Game_Chara_Balloon_Y[i]); + } + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.PuchiChara.On騾イ陦梧緒逕サ((TJAPlayer3.Skin.nScrollFieldX[0] - TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.nDefaultJudgePos[0, 0]) + TJAPlayer3.Skin.Game_PuchiChara_BalloonX[0], TJAPlayer3.Skin.Game_PuchiChara_BalloonY[i], false, nowOpacity, true); + if (CharaAction_Balloon_Broke[i].b邨ゆコ蛟、縺ォ驕斐@縺) + { + CharaAction_Balloon_Broke[i].t蛛懈ュ「(); + CharaAction_Balloon_Broke[i].n迴セ蝨ィ縺ョ蛟、 = 0; + b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[i] = false; + } + } + else if (CharaAction_Balloon_Miss[i]?.b騾イ陦御クュ == true && TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Miss != 0) + { + if (CharaAction_Balloon_FadeOut[i].Counter.b蛛懈ュ「荳ュ && CharaAction_Balloon_Miss[i].n迴セ蝨ィ縺ョ蛟、 > CharaAction_Balloon_FadeOut_StartMs[1]) + { + CharaAction_Balloon_FadeOut[i].Start(); + } + if (TJAPlayer3.Tx.Chara_Balloon_Miss[CharaAction_Balloon_Miss[i].n迴セ蝨ィ縺ョ蛟、] != null) + { + TJAPlayer3.Tx.Chara_Balloon_Miss[CharaAction_Balloon_Miss[i].n迴セ蝨ィ縺ョ蛟、].Opacity = nowOpacity; + TJAPlayer3.Tx.Chara_Balloon_Miss[CharaAction_Balloon_Miss[i].n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, (TJAPlayer3.Skin.nScrollFieldX[0] - TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.nDefaultJudgePos[0, 0]) + TJAPlayer3.Skin.Game_Chara_Balloon_X[0], TJAPlayer3.Skin.Game_Chara_Balloon_Y[i]); + } + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.PuchiChara.On騾イ陦梧緒逕サ((TJAPlayer3.Skin.nScrollFieldX[0] - TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.nDefaultJudgePos[0, 0]) + TJAPlayer3.Skin.Game_PuchiChara_BalloonX[0], TJAPlayer3.Skin.Game_PuchiChara_BalloonY[i], false, nowOpacity, true); + if (CharaAction_Balloon_Miss[i].b邨ゆコ蛟、縺ォ驕斐@縺) + { + CharaAction_Balloon_Miss[i].t蛛懈ュ「(); + CharaAction_Balloon_Miss[i].n迴セ蝨ィ縺ョ蛟、 = 0; + b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[i] = false; + } + } + else if (CharaAction_Balloon_Breaking[i]?.b騾イ陦御クュ == true && TJAPlayer3.Skin.Game_Chara_Ptn_Balloon_Breaking != 0) + { + TJAPlayer3.Tx.Chara_Balloon_Breaking[CharaAction_Balloon_Breaking[i].n迴セ蝨ィ縺ョ蛟、]?.t2D謠冗判(TJAPlayer3.app.Device, (TJAPlayer3.Skin.nScrollFieldX[0] - TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.nDefaultJudgePos[0, 0]) + TJAPlayer3.Skin.Game_Chara_Balloon_X[0], TJAPlayer3.Skin.Game_Chara_Balloon_Y[i]); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.PuchiChara.On騾イ陦梧緒逕サ((TJAPlayer3.Skin.nScrollFieldX[0] - TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.nDefaultJudgePos[0, 0]) + TJAPlayer3.Skin.Game_PuchiChara_BalloonX[0], TJAPlayer3.Skin.Game_PuchiChara_BalloonY[i], false, 255, true); + } + + //if (CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChara.CharaAction_Balloon_Breaking?.b邨ゆコ蛟、縺ォ驕斐@縺 == true) + //{ + // CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChara.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ = false; + // CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChara.CharaAction_Balloon_Breaking.t蛛懈ュ「(); + // CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChara.CharaAction_Balloon_Breaking.n迴セ蝨ィ縺ョ蛟、 = 0; + //} + + } + } + } + + public void 繧「繧ッ繧キ繝ァ繝ウ繧ソ繧、繝槭シ繝ェ繧サ繝繝(int player) + { + ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝彈player].t蛛懈ュ「(); + ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝廴AX[player].t蛛懈ュ「(); + ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝[player].t蛛懈ュ「(); + ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝MAX[player].t蛛懈ュ「(); + ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝杣player].t蛛懈ュ「(); + ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX[player].t蛛懈ュ「(); + ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝彈player].n迴セ蝨ィ縺ョ蛟、 = 0; + ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝廴AX[player].n迴セ蝨ィ縺ョ蛟、 = 0; + ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝[player].n迴セ蝨ィ縺ョ蛟、 = 0; + ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝MAX[player].n迴セ蝨ィ縺ョ蛟、 = 0; + ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝杣player].n迴セ蝨ィ縺ョ蛟、 = 0; + ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX[player].n迴セ蝨ィ縺ョ蛟、 = 0; + CharaAction_Balloon_Breaking[player]?.t蛛懈ュ「(); + CharaAction_Balloon_Broke[player]?.t蛛懈ュ「(); + CharaAction_Balloon_Miss[player]?.t蛛懈ュ「(); + //CharaAction_Balloon_Delay?.t蛛懈ュ「(); + CharaAction_Balloon_Breaking[player].n迴セ蝨ィ縺ョ蛟、 = 0; + CharaAction_Balloon_Broke[player].n迴セ蝨ィ縺ョ蛟、 = 0; + CharaAction_Balloon_Miss[player].n迴セ蝨ィ縺ョ蛟、 = 0; + //CharaAction_Balloon_Delay.n迴セ蝨ィ縺ョ蛟、 = 0; + } + + public int[] ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ; + public int[] ar繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ; + public int[] ar繧ッ繝ェ繧「繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ; + + public CCounter[] ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝 = new CCounter[2]; + public CCounter[] ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝廴AX = new CCounter[2]; + public CCounter[] ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝 = new CCounter[2]; + public CCounter[] ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繧エ繝シ繧エ繝シ繧ケ繧ソ繝シ繝MAX = new CCounter[2]; + public CCounter[] ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_繝弱Ν繝 = new CCounter[2]; + public CCounter[] ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_鬲MAX = new CCounter[2]; + public CCounter[] CharaAction_Balloon_Breaking = new CCounter[2]; + public CCounter[] CharaAction_Balloon_Broke = new CCounter[2]; + public CCounter[] CharaAction_Balloon_Miss = new CCounter[2]; + public CCounter[] CharaAction_Balloon_Delay = new CCounter[2]; + + public CCounter[] ctChara_Normal = new CCounter[2]; + public CCounter[] ctChara_GoGo = new CCounter[2]; + public CCounter[] ctChara_Clear = new CCounter[2]; + + public Animations.FadeOut[] CharaAction_Balloon_FadeOut = new Animations.FadeOut[2]; + private readonly int[] CharaAction_Balloon_FadeOut_StartMs = new int[2]; + + public bool[] b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ = new bool[2]; + + public bool[] b鬚ィ闊ケ騾」謇謎クュ = new bool[2]; + public bool[] b貍泌・丈クュ = new bool[2]; + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ー繝ゥ繝.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ー繝ゥ繝.cs new file mode 100644 index 00000000..267642d0 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ー繝ゥ繝.cs @@ -0,0 +1,67 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using System.IO; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rums繧ー繝ゥ繝 : CActivity + { + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CAct貍泌・愁rums繧ー繝ゥ繝() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + if( base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + } + + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //---------------- + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧イ繝シ繧ク.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧イ繝シ繧ク.cs new file mode 100644 index 00000000..999948e2 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧イ繝シ繧ク.cs @@ -0,0 +1,466 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using System.Diagnostics; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rums繧イ繝シ繧ク : CAct貍泌・上ご繝シ繧ク蜈ア騾 + { + // 繝励Ο繝代ユ繧」 + +// public double db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、 +// { +// get +// { +// return this.db繧イ繝シ繧ク蛟、; +// } +// set +// { +// this.db繧イ繝シ繧ク蛟、 = value; +// if( this.db繧イ繝シ繧ク蛟、 > 1.0 ) +// { +// this.db繧イ繝シ繧ク蛟、 = 1.0; +// } +// } +// } + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + /// + /// 繧イ繝シ繧ク縺ョ謠冗判繧ッ繝ゥ繧ケ縲ゅラ繝ゥ繝蛛エ縲 + /// + /// 隱イ鬘 + /// _繧イ繝シ繧ク縺ョ螳溯」縲 + /// _Danger譎ゅ↓繧イ繝シ繧ク縺ョ濶イ縺悟、峨o繧区シ泌コ縺ョ螳溯」縲 + /// _Danger縲`AX譎ゅョ繧「繝九Γ繝シ繧キ繝ァ繝ウ螳溯」縲 + /// + public CAct貍泌・愁rums繧イ繝シ繧ク() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + public override void Start(int nLane, E蛻、螳 judge, int player) + { + for (int j = 0; j < 32; j++) + { + if( player == 0 ) + { + if( !this.st闃ア轣ォ迥カ諷擬 j ].b菴ソ逕ィ荳ュ ) + { + this.st闃ア轣ォ迥カ諷擬j].ct騾イ陦 = new CCounter(0, 10, 20, TJAPlayer3.Timer); + this.st闃ア轣ォ迥カ諷擬j].nPlayer = player; + + switch (nLane) + { + case 0x11: + case 0x12: + case 0x15: + this.st闃ア轣ォ迥カ諷擬j].isBig = false; + break; + case 0x13: + case 0x14: + case 0x16: + case 0x17: + this.st闃ア轣ォ迥カ諷擬j].isBig = true; + break; + } + this.st闃ア轣ォ迥カ諷擬j].nLane = nLane; + + this.st闃ア轣ォ迥カ諷擬j].b菴ソ逕ィ荳ュ = true; + break; + } + } + if( player == 1 ) + { + if( !this.st闃ア轣ォ迥カ諷2P[ j ].b菴ソ逕ィ荳ュ ) + { + this.st闃ア轣ォ迥カ諷2P[ j ].ct騾イ陦 = new CCounter(0, 10, 20, TJAPlayer3.Timer); + this.st闃ア轣ォ迥カ諷2P[ j ].nPlayer = player; + + switch (nLane) + { + case 0x11: + case 0x12: + case 0x15: + this.st闃ア轣ォ迥カ諷2P[ j ].isBig = false; + break; + case 0x13: + case 0x14: + case 0x16: + case 0x17: + this.st闃ア轣ォ迥カ諷2P[ j ].isBig = true; + break; + } + this.st闃ア轣ォ迥カ諷2P[j].nLane = nLane; + this.st闃ア轣ォ迥カ諷2P[ j ].b菴ソ逕ィ荳ュ = true; + break; + } + } + } + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + this.ct轤 = new CCounter( 0, 6, 50, TJAPlayer3.Timer ); + + for (int i = 0; i < 32; i++ ) + { + this.st闃ア轣ォ迥カ諷擬i].ct騾イ陦 = new CCounter(); + this.st闃ア轣ォ迥カ諷2P[i].ct騾イ陦 = new CCounter(); + } + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + for (int i = 0; i < 32; i++ ) + { + this.st闃ア轣ォ迥カ諷擬i].ct騾イ陦 = null; + this.st闃ア轣ォ迥カ諷2P[i].ct騾イ陦 = null; + } + this.ct轤 = null; + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //this.tx繧イ繝シ繧ク = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_Gauge.png" ) ); + //this.tx繧イ繝シ繧ク閭梧勹 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_Gauge_base.png" ) ); + // if (CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay) + // this.tx繧イ繝シ繧ク2P = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_Gauge_2P.png" ) ); + // if (CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay) + // this.tx繧イ繝シ繧ク閭梧勹2P = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_Gauge_base_2P.png" ) ); + // this.tx繧イ繝シ繧ク邱 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_Gauge_line.png" ) ); + // if (CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay) + // this.tx繧イ繝シ繧ク邱2P = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_Gauge_line_2P.png" ) ); + + // this.tx鬲 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_Soul.png" ) ); + // this.tx轤 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_Soul_fire.png" ) ); + + // this.tx鬲り干轣ォ = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_explosion_soul.png" ) ); + //for( int i = 0; i < 12; i++ ) + //{ + // this.tx繧イ繝シ繧ク陌ケ[ i ] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path(@"Graphics\Gauge\Gauge_rainbow_" + i.ToString() + ".png") ); + //} + if(TJAPlayer3.Skin.Game_Gauge_Rainbow_Timer <= 1) + { + throw new DivideByZeroException("SkinConfig縺ョ險ュ螳喀"Game_Gauge_Rainbow_Timer\"繧1莉・荳九↓縺吶k縺薙→縺ッ蜃コ譚・縺セ縺帙s縲"); + } + this.ct陌ケ繧「繝九Γ = new CCounter( 0, TJAPlayer3.Skin.Game_Gauge_Rainbow_Ptn -1, TJAPlayer3.Skin.Game_Gauge_Rainbow_Timer, TJAPlayer3.Timer ); + this.ct陌ケ騾乗主コヲ = new CCounter(0, TJAPlayer3.Skin.Game_Gauge_Rainbow_Timer-1, 1, TJAPlayer3.Timer); + this.ctGaugeFlash = new CCounter(0, 532, 1, TJAPlayer3.Timer); + //this.tx髻ウ隨ヲ = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_taiko_notes.png")); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧イ繝シ繧ク ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧イ繝シ繧ク閭梧勹 ); + // if (CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay) + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧イ繝シ繧ク2P ); + // if (CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay) + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧イ繝シ繧ク閭梧勹2P ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧イ繝シ繧ク邱 ); + // if (CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay) + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧イ繝シ繧ク邱2P ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx鬲 ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx轤 ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx鬲り干轣ォ ); + + + // for( int i = 0; i < 12; i++ ) + // { + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧イ繝シ繧ク陌ケ[ i ] ); + // } + this.ct陌ケ繧「繝九Γ = null; + + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.tx髻ウ隨ヲ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if ( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 20, 150, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、.Taiko.ToString() ); + + #region [ 蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ] + if ( base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + #endregion + + this.ctGaugeFlash.t騾イ陦鍬oop(); + + int nRectX2P = (int)(this.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[1] / 2) * 14; + int nRectX = (int)( this.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[ 0 ] / 2 ) * 14; + int 陌ケ繝吶シ繧ケ = ct陌ケ繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、 + 1; + if (陌ケ繝吶シ繧ケ == ct陌ケ繧「繝九Γ.n邨ゆコ蛟、+1) 陌ケ繝吶シ繧ケ = 0; + /* + + 譁ー陌ケ繧イ繝シ繧ク縺ョ莉墓ァ 2018/08/10 繧阪∩繧ス橸シ + + 繝輔ぉ繝シ繝峨〒蜍輔¥陌ケ繧イ繝シ繧ク縺後√≠繧狗ィ句コヲ蠑キ蛹悶〒縺阪◆縺ョ縺ァ謾セ蜃コ縲 + 騾乗主コヲ255縺ョ陌ケ繝吶シ繧ケ繧呈緒逕サ縺励√◎縺ョ荳翫°繧蛾乗主コヲ蜿ッ螟牙シ上ョ陌ケ繧イ繝シ繧ク繧呈緒逕サ縺吶k縲 + 繧イ繝シ繧ク縺ョ繝代ち繝シ繝ウ譫壽焚縺ッ縲∬ェュ縺ソ霎シ縺ソ譫壽焚縺ォ繧医▲縺ヲ豎コ螳壹☆繧九 + 繧イ繝シ繧ク謠冗判縺ョ蛻繧頑崛縺磯溷コヲ縺ッ縲√ち繧、繝槭シ縺ョ蛟、繧担kinConfig縺ァ謖螳壹@縺ヲ陦後≧(蛻晄悄蛟、50,1縺ォ縺吶k縺ィ繧ィ繝ゥ繝シ繧貞瑞縺乗ィ。讒)縲るイ陦碁溷コヲ縺ッ1ms縲鬮倥ヵ繝ャ繝シ繝繝ャ繝シ繝医〒縺ョ貊代i縺九&繧帝崎ヲ悶 + 陌ケ繧イ繝シ繧ク縺ョ騾乗主コヲ隱ソ謨エ蛟、縺ッ縲√255/繝代ち繝シ繝ウ謨ー縲阪〒邂怜コ縺吶k縲 + 縺薙s縺ェ邁。蜊倥↑縺薙→繧定縺医k縺ョ縺ォ30蛻(60f/s謠帷ョ励〒108000f)繧定イサ繧縺吶 + + */ + + + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan) + { + if (TJAPlayer3.Tx.Gauge_Dan[0] != null) + { + TJAPlayer3.Tx.Gauge_Dan[0].t2D謠冗判(TJAPlayer3.app.Device, 492, 144, new Rectangle(0, 0, 700, 44)); + } + if (TJAPlayer3.Tx.Gauge_Dan[2] != null) + { + for (int i = 0; i < TJAPlayer3.DTX.Dan_C.Length; i++) + { + if (TJAPlayer3.DTX.Dan_C[i] != null) + { + if (TJAPlayer3.DTX.Dan_C[i].GetExamType() == Exam.Type.Gauge) + { + TJAPlayer3.Tx.Gauge_Dan[2].t2D謠冗判(TJAPlayer3.app.Device, 492 + (TJAPlayer3.DTX.Dan_C[i].GetValue(false) / 2 * 14), 144, new Rectangle((TJAPlayer3.DTX.Dan_C[i].GetValue(false) / 2 * 14), 0, 700 - (TJAPlayer3.DTX.Dan_C[i].GetValue(false) / 2 * 14), 44)); + } + } + } + } + } + else + { + if (TJAPlayer3.Tx.Gauge_Base[0] != null) + { + TJAPlayer3.Tx.Gauge_Base[0].t2D謠冗判(TJAPlayer3.app.Device, 492, 144, new Rectangle(0, 0, 700, 44)); + } + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay && TJAPlayer3.Tx.Gauge_Base[1] != null) + { + TJAPlayer3.Tx.Gauge_Base[1].t2D謠冗判(TJAPlayer3.app.Device, 492, 532, new Rectangle(0, 0, 700, 44)); + } + } + #region[ 繧イ繝シ繧ク1P ] + if( TJAPlayer3.Tx.Gauge[0] != null ) + { + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan) + { + TJAPlayer3.Tx.Gauge_Dan[1]?.t2D謠冗判(TJAPlayer3.app.Device, 492, 144, new Rectangle(0, 0, nRectX, 44)); + } + else + { + TJAPlayer3.Tx.Gauge[0].t2D謠冗判(TJAPlayer3.app.Device, 492, 144, new Rectangle(0, 0, nRectX, 44)); + } + + if (db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[0] >= 80.0 && db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[0] < 100.0) + { + int Opacity = 0; + if (this.ctGaugeFlash.n迴セ蝨ィ縺ョ蛟、 <= 365) Opacity = 0; + else if (this.ctGaugeFlash.n迴セ蝨ィ縺ョ蛟、 <= 448) Opacity = (int)((this.ctGaugeFlash.n迴セ蝨ィ縺ョ蛟、 - 365) / 83f * 255f); + else if (this.ctGaugeFlash.n迴セ蝨ィ縺ョ蛟、 <= 531) Opacity = 255 - (int)((this.ctGaugeFlash.n迴セ蝨ィ縺ョ蛟、 - 448) / 83f * 255f); + TJAPlayer3.Tx.Gauge_Flash.Opacity = Opacity; + TJAPlayer3.Tx.Gauge_Flash.t2D謠冗判(TJAPlayer3.app.Device, 492, 144); + } + if (TJAPlayer3.Tx.Gauge_Line[0] != null ) + { + if( this.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[ 0 ] >= 100.0 ) + { + this.ct陌ケ繧「繝九Γ.t騾イ陦鍬oop(); + this.ct陌ケ騾乗主コヲ.t騾イ陦鍬oop(); + if(TJAPlayer3.Tx.Gauge_Rainbow[ this.ct陌ケ繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、 ] != null ) + { + TJAPlayer3.Tx.Gauge_Rainbow[this.ct陌ケ繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、].Opacity = 255; + TJAPlayer3.Tx.Gauge_Rainbow[this.ct陌ケ繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, 492, 144 + (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan ? 22 : 0), + new RectangleF(0, + TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan ? 22 : 0, + TJAPlayer3.Tx.Gauge_Rainbow[this.ct陌ケ繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, + TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan ? TJAPlayer3.Tx.Gauge_Rainbow[this.ct陌ケ繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height - 22 : TJAPlayer3.Tx.Gauge_Rainbow[this.ct陌ケ繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + TJAPlayer3.Tx.Gauge_Rainbow[陌ケ繝吶シ繧ケ].Opacity = (ct陌ケ騾乗主コヲ.n迴セ蝨ィ縺ョ蛟、 * 255 / (int)ct陌ケ騾乗主コヲ.n邨ゆコ蛟、)/1; + TJAPlayer3.Tx.Gauge_Rainbow[陌ケ繝吶シ繧ケ].t2D謠冗判(TJAPlayer3.app.Device, 492, 144 + (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan ? 22 : 0), + new RectangleF(0, + TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan ? 22 : 0, + TJAPlayer3.Tx.Gauge_Rainbow[陌ケ繝吶シ繧ケ].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, + TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan ? TJAPlayer3.Tx.Gauge_Rainbow[陌ケ繝吶シ繧ケ].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height - 22 : TJAPlayer3.Tx.Gauge_Rainbow[陌ケ繝吶シ繧ケ].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + } + } + TJAPlayer3.Tx.Gauge_Line[0].t2D謠冗判( TJAPlayer3.app.Device, 492, 144 ); + } + #region[ 縲後け繝ェ繧「縲肴枚蟄 ] + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Dan) + { + if (this.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[0] >= 80.0) + { + TJAPlayer3.Tx.Gauge[0].t2D謠冗判(TJAPlayer3.app.Device, 1038, 144, new Rectangle(0, 44, 58, 24)); + } + else + { + TJAPlayer3.Tx.Gauge[0].t2D謠冗判(TJAPlayer3.app.Device, 1038, 144, new Rectangle(58, 44, 58, 24)); + } + } + #endregion + } + #endregion + #region[ 繧イ繝シ繧ク2P ] + if( TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay && TJAPlayer3.Tx.Gauge[1] != null ) + { + TJAPlayer3.Tx.Gauge[1].t2D謠冗判( TJAPlayer3.app.Device, 492, 532, new Rectangle( 0, 0, nRectX2P, 44 ) ); + if (db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[1] >= 80.0 && db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[1] < 100.0) + { + int Opacity = 0; + if (this.ctGaugeFlash.n迴セ蝨ィ縺ョ蛟、 <= 365) Opacity = 0; + else if (this.ctGaugeFlash.n迴セ蝨ィ縺ョ蛟、 <= 448) Opacity = (int)((this.ctGaugeFlash.n迴セ蝨ィ縺ョ蛟、 - 365) / 83f * 255f); + else if (this.ctGaugeFlash.n迴セ蝨ィ縺ョ蛟、 <= 531) Opacity = 255 - (int)((this.ctGaugeFlash.n迴セ蝨ィ縺ョ蛟、 - 448) / 83f * 255f); + TJAPlayer3.Tx.Gauge_Flash.Opacity = Opacity; + TJAPlayer3.Tx.Gauge_Flash.t2D荳贋ク句渚霆「謠冗判(TJAPlayer3.app.Device, 492, 509); + } + if (TJAPlayer3.Tx.Gauge[1] != null ) + { + if (this.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[1] >= 100.0) + { + this.ct陌ケ繧「繝九Γ.t騾イ陦鍬oop(); + this.ct陌ケ騾乗主コヲ.t騾イ陦鍬oop(); + if (TJAPlayer3.Tx.Gauge_Rainbow[this.ct陌ケ繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、] != null) + { + TJAPlayer3.Tx.Gauge_Rainbow[ct陌ケ繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、].Opacity = 255; + TJAPlayer3.Tx.Gauge_Rainbow[ct陌ケ繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、].t2D荳贋ク句渚霆「謠冗判(TJAPlayer3.app.Device, 492, 532); + TJAPlayer3.Tx.Gauge_Rainbow[陌ケ繝吶シ繧ケ].Opacity = (int)(ct陌ケ騾乗主コヲ.n迴セ蝨ィ縺ョ蛟、 * 255 / ct陌ケ騾乗主コヲ.n邨ゆコ蛟、) / 1; + TJAPlayer3.Tx.Gauge_Rainbow[陌ケ繝吶シ繧ケ].t2D荳贋ク句渚霆「謠冗判(TJAPlayer3.app.Device, 492, 532); + } + } + TJAPlayer3.Tx.Gauge_Line[1].t2D謠冗判( TJAPlayer3.app.Device, 492, 532 ); + } + #region[ 縲後け繝ェ繧「縲肴枚蟄 ] + if( this.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[ 1 ] >= 80.0 ) + { + TJAPlayer3.Tx.Gauge[1].t2D謠冗判( TJAPlayer3.app.Device, 1038, 554, new Rectangle( 0, 44, 58, 24 ) ); + } + else + { + TJAPlayer3.Tx.Gauge[1].t2D謠冗判( TJAPlayer3.app.Device, 1038, 554, new Rectangle( 58, 44, 58, 24 ) ); + } + #endregion + } + #endregion + + + if(TJAPlayer3.Tx.Gauge_Soul_Fire != null ) + { + //莉ョ鄂ョ縺 + int[] nSoulFire = new int[] { 52, 443, 0, 0 }; + for( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) + { + if( this.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[ i ] >= 100.0 ) + { + this.ct轤.t騾イ陦鍬oop(); + TJAPlayer3.Tx.Gauge_Soul_Fire.t2D謠冗判( TJAPlayer3.app.Device, 1112, nSoulFire[ i ], new Rectangle( 230 * ( this.ct轤.n迴セ蝨ィ縺ョ蛟、 ), 0, 230, 230 ) ); + } + } + } + if(TJAPlayer3.Tx.Gauge_Soul != null ) + { + //莉ョ鄂ョ縺 + int[] nSoulY = new int[] { 125, 516, 0, 0 }; + for( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) + { + if( this.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[ i ] >= 80.0 ) + { + TJAPlayer3.Tx.Gauge_Soul.t2D謠冗判( TJAPlayer3.app.Device, 1184, nSoulY[ i ], new Rectangle( 0, 0, 80, 80 ) ); + } + else + { + TJAPlayer3.Tx.Gauge_Soul.t2D謠冗判( TJAPlayer3.app.Device, 1184, nSoulY[ i ], new Rectangle( 0, 80, 80, 80 ) ); + } + } + } + + //莉ョ鄂ョ縺 + int[] nSoulExplosion = new int[] { 73, 468, 0, 0 }; + for( int d = 0; d < 32; d++ ) + { + if( this.st闃ア轣ォ迥カ諷擬d].b菴ソ逕ィ荳ュ ) + { + this.st闃ア轣ォ迥カ諷擬d].ct騾イ陦.t騾イ陦(); + if (this.st闃ア轣ォ迥カ諷擬d].ct騾イ陦.b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.st闃ア轣ォ迥カ諷擬d].ct騾イ陦.t蛛懈ュ「(); + this.st闃ア轣ォ迥カ諷擬d].b菴ソ逕ィ荳ュ = false; + } + + + //if(CDTXMania.Tx.Gauge_Soul_Explosion != null ) + //{ + // CDTXMania.Tx.Gauge_Soul_Explosion.t2D謠冗判( CDTXMania.app.Device, 1140, 73, new Rectangle( this.st闃ア轣ォ迥カ諷擬d].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 * 140, 0, 140, 180 ) ); + //} + //if (CDTXMania.Tx.Notes != null) + //{ + //CDTXMania.Tx.Notes.t2D荳ュ蠢蝓コ貅匁緒逕サ(CDTXMania.app.Device, 1224, 162, new Rectangle(this.st闃ア轣ォ迥カ諷擬d].nLane * 130, 0, 130, 130)); + //this.tx髻ウ隨ヲ.color4 = new Color4( 1.0f, 1.0f, 1.0f - (this.st闃ア轣ォ迥カ諷擬d].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 / 10f) ); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(60, 140, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.st闃ア轣ォ迥カ諷擬d].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、.ToString()); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(60, 160, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, (this.st闃ア轣ォ迥カ諷擬d].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 / 10f).ToString()); + //} + break; + } + } + for( int d = 0; d < 32; d++ ) + { + if (this.st闃ア轣ォ迥カ諷2P[d].b菴ソ逕ィ荳ュ) + { + this.st闃ア轣ォ迥カ諷2P[d].ct騾イ陦.t騾イ陦(); + if (this.st闃ア轣ォ迥カ諷2P[d].ct騾イ陦.b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.st闃ア轣ォ迥カ諷2P[d].ct騾イ陦.t蛛懈ュ「(); + this.st闃ア轣ォ迥カ諷2P[d].b菴ソ逕ィ荳ュ = false; + } + + + //if(CDTXMania.Tx.Gauge_Soul_Explosion != null ) + //{ + // CDTXMania.Tx.Gauge_Soul_Explosion.t2D謠冗判( CDTXMania.app.Device, 1140, 468, new Rectangle( this.st闃ア轣ォ迥カ諷2P[d].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 * 140, 0, 140, 180 ) ); + //} + //if (CDTXMania.Tx.Notes != null) + //{ + // CDTXMania.Tx.Notes.t2D荳ュ蠢蝓コ貅匁緒逕サ(CDTXMania.app.Device, 1224, 162, new Rectangle(this.st闃ア轣ォ迥カ諷擬d].nLane * 130, 0, 130, 130)); + // //this.tx髻ウ隨ヲ.color4 = new Color4( 1.0f, 1.0f, 1.0f - (this.st闃ア轣ォ迥カ諷擬d].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 / 10f) ); + // //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(60, 140, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.st闃ア轣ォ迥カ諷擬d].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、.ToString()); + // //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(60, 160, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, (this.st闃ア轣ォ迥カ諷擬d].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 / 10f).ToString()); + //} + break; + } + } + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private CCounter ctGaugeFlash; + + protected STSTATUS[] st闃ア轣ォ迥カ諷 = new STSTATUS[ 32 ]; + protected STSTATUS[] st闃ア轣ォ迥カ諷2P = new STSTATUS[ 32 ]; + [StructLayout(LayoutKind.Sequential)] + protected struct STSTATUS + { + public CCounter ct騾イ陦; + public bool isBig; + public bool b菴ソ逕ィ荳ュ; + public int nPlayer; + public int nLane; + } + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧イ繝シ繝繝「繝シ繝.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧イ繝シ繝繝「繝シ繝.cs new file mode 100644 index 00000000..9ca8646d --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧イ繝シ繝繝「繝シ繝.cs @@ -0,0 +1,896 @@ +サソusing System; +using System.Drawing; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Runtime.InteropServices; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rums繧イ繝シ繝繝「繝シ繝 : CActivity + { + /// + /// 迴セ譎らせ縺ァ縺ッ縲悟ョ瑚オー!蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ!縲阪ョ縺ソ縲 + /// + /// + public CAct貍泌・愁rums繧イ繝シ繝繝「繝シ繝() + { + this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + //蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ! + //<繝ォ繝シ繝ォ> + //_譟織AM縺ョ繧縺、縺ォ莨シ縺ヲ繧九d縺、縲 + //_貍泌・丞庄閭ス縺ェ谿九j譎る俣縺梧ク帙▲縺ヲ縺縺上 + //_隍謨ー縺ョ鬆逶ョ縺ォ蟇セ縺励※縲∽ク螳壹ョ譚。莉カ繧偵け繝ェ繧「縺励※縺縺」縺ヲ蟒カ蜻ス縺輔○縺ヲ縺縺上 + //_繧ソ繧、繝槭シ縺0縺ォ縺ェ縺」縺溘iSTAGE FAILED縲 + // + //蛻、螳夊ヲ∫エ + //_邊セ蠎ヲ + //_繝溘せ謨ー + //_繧コ繝ャ譎る俣 + //_譛螟ァ繧ウ繝ウ繝懈焚 + //縺昴ョ莉冶ォク縲 + + private long n蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ_谿九j譎る俣繧ソ繧、繝槭シ; + public ST蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ; + public struct ST蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ + { + public bool b譛蛻昴ョ繝√ャ繝励′蜿ゥ縺九l縺; + public bool b繧ソ繧、繝槭シ菴ソ逕ィ荳ュ; + public bool b雜豼霎; + public bool b蜉邂励い繝九Γ荳ュ; + public int n繝偵ャ繝域焚_PERFECT; + public int n繝偵ャ繝域焚_GREAT; + public int n繝偵ャ繝域焚_GOOD; + public int n繝偵ャ繝域焚_POOR; + public int n繝偵ャ繝域焚_MISS; + public int n譛螟ァ繧ウ繝ウ繝; + public int n迴セ蝨ィ縺ョ繧ウ繝ウ繝; + public int n蛹コ髢薙ヮ繝シ繝域焚; + public int n譛螟ァ繧コ繝ャ譎る俣; + public int n譛蟆上ぜ繝ャ譎る俣; + public int n迴セ蝨ィ騾夐℃縺励◆繝弱シ繝域焚; + public int n蜈ィ菴捺怙螟ァ繧コ繝ャ譎る俣; + public int n縺翫∪縺大刈邂励′逋コ逕溘@縺溷屓謨ー; + public int n蟒カ髟キ繧「繝九Γ騾溷コヲ; + public CCounter ct谿九j譎る俣; + public CCounter ct蜉邂玲凾髢楢。ィ遉コ; + public CCounter ct蜉邂怜ッゥ譟サ荳ュ; + public CCounter ct驥昴い繝九Γ; + } + private int n譛蠕後↓譎る俣蟒カ髟キ縺励◆譎ょ綾; + private int n貍泌・乗凾髢; + private int n蜑榊屓縺ョ蟒カ髟キ譎る俣; + //private CTexture tx谿九j譎る俣謨ー蟄; + //private CTexture tx閭梧勹鮟; + //private CTexture tx蜉邂玲凾髢捺焚蟄; + //private CTexture tx繧ソ繧、繝槭シ譫; + //private CTexture tx繧ソ繧、繝槭シ驥; + + [StructLayout(LayoutKind.Sequential)] + private struct ST繝懊シ繝翫せ + { + public double ret; + public double point; + public ST繝懊シ繝翫せ( double ret, double point ) + { + this.ret = ret; + this.point = point; + } + } + + private ST繝懊シ繝翫せ[] n邊セ蠎ヲ繝懊シ繝翫せ; + private ST繝懊シ繝翫せ[] n譛螟ァ繧コ繝ャ譎る俣繝懊シ繝翫せ; + private ST繝懊シ繝翫せ[] n譛蟆上ぜ繝ャ譎る俣繝懊シ繝翫せ; + private ST繝懊シ繝翫せ[] n繧ウ繝ウ繝懃紫繝懊シ繝翫せ; + private ST繝懊シ繝翫せ[] n繝溘せ邇繝懊シ繝翫せ; + + private ST繝懊シ繝翫せ[] n蜈ィ菴鍋イセ蠎ヲ繝懊シ繝翫せ; + private ST繝懊シ繝翫せ[] n蜈ィ菴捺怙螟ァ繧コ繝ャ譎る俣繝懊シ繝翫せ; + private ST繝懊シ繝翫せ[] n蜈ィ菴薙さ繝ウ繝懃紫繝懊シ繝翫せ; + private ST繝懊シ繝翫せ[] n蜈ィ菴薙Α繧ケ邇繝懊シ繝翫せ; + private int n蜉邂玲凾髢; + + public void t蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ_蛻晄悄蛹() + { + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ = new ST蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ(); + this.n貍泌・乗凾髢 = ( TJAPlayer3.DTX.listChip.Count > 0 ) ? TJAPlayer3.DTX.listChip[ TJAPlayer3.DTX.listChip.Count - 1 ].n逋コ螢ー譎ょ綾ms : 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣 = new CCounter( 0, 25000, 1, TJAPlayer3.Timer ); + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct蜉邂玲凾髢楢。ィ遉コ = new CCounter(); + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct蜉邂怜ッゥ譟サ荳ュ = new CCounter(); + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b譛蛻昴ョ繝√ャ繝励′蜿ゥ縺九l縺 = false; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b繧ソ繧、繝槭シ菴ソ逕ィ荳ュ = false; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b蜉邂励い繝九Γ荳ュ = false; + this.n譛蠕後↓譎る俣蟒カ髟キ縺励◆譎ょ綾 = 0; + + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_PERFECT = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_GREAT = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_GOOD = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_POOR = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_MISS = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蛹コ髢薙ヮ繝シ繝域焚 = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n迴セ蝨ィ縺ョ繧ウ繝ウ繝 = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛蟆上ぜ繝ャ譎る俣 = -1; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛螟ァ繧コ繝ャ譎る俣 = -1; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蜈ィ菴捺怙螟ァ繧コ繝ャ譎る俣 = -1; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n迴セ蝨ィ騾夐℃縺励◆繝弱シ繝域焚 = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b雜豼霎 = false; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n縺翫∪縺大刈邂励′逋コ逕溘@縺溷屓謨ー = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蟒カ髟キ繧「繝九Γ騾溷コヲ = 0; + this.n蜉邂玲凾髢 = 0; + this.n蜑榊屓縺ョ蟒カ髟キ譎る俣 = 0; + + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct驥昴い繝九Γ = new CCounter( 0, 1000, 1, TJAPlayer3.Timer ); + + this.t蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ_蛻、螳夐逶ョ縺ィ髮」譏灘コヲ繧呈アコ繧√k(); + } + + public void t蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ_蛻、螳夐逶ョ縺ィ髮」譏灘コヲ繧呈アコ繧√k() + { + //縺セ縺夐壼クク縲∵ソ霎帶凾縺ァ繧上¢繧九 + if( TJAPlayer3.ConfigIni.eGameMode == EGame.螳瑚オー蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ ) + { + #region[ 騾壼クク ] + //騾壼クク縺ョ譟サ螳 + // 邊セ蠎ヲ > 譛蟆上ぜ繝ャ > 繧ウ繝ウ繝 > 譛螟ァ繧コ繝ャ > 繝溘せ + this.n邊セ蠎ヲ繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 90, 5 ), + new ST繝懊シ繝翫せ( 70, 4.5 ), + new ST繝懊シ繝翫せ( 60, 3 ), + new ST繝懊シ繝翫せ( 50, 1 ), + new ST繝懊シ繝翫せ( 30, 0 ) + }; + this.n譛蟆上ぜ繝ャ譎る俣繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 5, 4 ), + new ST繝懊シ繝翫せ( 10, 3.5 ), + new ST繝懊シ繝翫せ( 20, 3 ), + new ST繝懊シ繝翫せ( 50, 1.5 ), + new ST繝懊シ繝翫せ( 80, -1 ) + }; + this.n譛螟ァ繧コ繝ャ譎る俣繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 50, 2 ), + new ST繝懊シ繝翫せ( 60, 1.5 ), + new ST繝懊シ繝翫せ( 80, 0.5 ), + new ST繝懊シ繝翫せ( 90, 0 ), + new ST繝懊シ繝翫せ( 100, -1 ) + }; + this.n繧ウ繝ウ繝懃紫繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 98.0, 3.5 ), + new ST繝懊シ繝翫せ( 80.0, 1 ), + new ST繝懊シ繝翫せ( 50.0, 0.5 ), + new ST繝懊シ繝翫せ( 35.0, -1.5 ) + }; + this.n繝溘せ邇繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 0, 2 ), + new ST繝懊シ繝翫せ( 20.0, 1 ), + new ST繝懊シ繝翫せ( 50.0, -0.5 ) + }; + + this.n蜈ィ菴鍋イセ蠎ヲ繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 90, 3.5 ), + new ST繝懊シ繝翫せ( 70, 2.5 ), + new ST繝懊シ繝翫せ( 60, 1 ), + new ST繝懊シ繝翫せ( 50, 0.5 ), + new ST繝懊シ繝翫せ( 30, -0.5 ) + }; + this.n蜈ィ菴捺怙螟ァ繧コ繝ャ譎る俣繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 50, 4.2 ), + new ST繝懊シ繝翫せ( 60, 3.6 ), + new ST繝懊シ繝翫せ( 80, 2 ), + new ST繝懊シ繝翫せ( 90, -0.5 ), + new ST繝懊シ繝翫せ( 100, -1 ) + }; + this.n蜈ィ菴薙さ繝ウ繝懃紫繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 98.0, 3 ), + new ST繝懊シ繝翫せ( 80.0, 2.5 ), + new ST繝懊シ繝翫せ( 50.0, 0.5 ) + }; + this.n蜈ィ菴薙Α繧ケ邇繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 0, 2 ), + new ST繝懊シ繝翫せ( 20.0, 1.5 ), + new ST繝懊シ繝翫せ( 50.0, 0.5 ), + new ST繝懊シ繝翫せ( 70.0, -0.5 ) + }; + #endregion + } + else if( TJAPlayer3.ConfigIni.eGameMode == EGame.螳瑚オー蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ豼霎 ) + { + #region[ 豼霎 ] + //豼繝繧コ縺ョ譟サ螳 + // 譛螟ァ繧コ繝ャ > 邊セ蠎ヲ > 繧ウ繝ウ繝 > 譛蟆上ぜ繝ャ > 繝溘せ + //蜷鬆逶ョ譛鬮伜、蜷郁ィ医〒20遘貞刈邂励↓縺ェ繧九h縺縺ォ縺吶k縺薙→縲 + this.n邊セ蠎ヲ繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 100, 3 ), + new ST繝懊シ繝翫せ( 95, 2 ), + new ST繝懊シ繝翫せ( 90, 1 ), + new ST繝懊シ繝翫せ( 70, -2 ), + new ST繝懊シ繝翫せ( 50, -4 ), + new ST繝懊シ繝翫せ( 0, -10 ) + }; + this.n譛蟆上ぜ繝ャ譎る俣繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 0, 2 ), + new ST繝懊シ繝翫せ( 3, 1 ), + new ST繝懊シ繝翫せ( 5, -2 ), + new ST繝懊シ繝翫せ( 10, -3 ), + new ST繝懊シ繝翫せ( 30, -3 ), + new ST繝懊シ繝翫せ( 108, -4 ) + }; + this.n譛螟ァ繧コ繝ャ譎る俣繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 3, 3.5 ), + new ST繝懊シ繝翫せ( 10, 2 ), + new ST繝懊シ繝翫せ( 15, 1 ), + new ST繝懊シ繝翫せ( 20, 0 ), + new ST繝懊シ繝翫せ( 50, -2 ), + new ST繝懊シ繝翫せ( 108, -5 ) + }; + this.n繧ウ繝ウ繝懃紫繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 100.0, 1 ), + new ST繝懊シ繝翫せ( 50.0, 0.5 ), + new ST繝懊シ繝翫せ( 0.0, -5 ) + }; + this.n繝溘せ邇繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 0, 1 ), + new ST繝懊シ繝翫せ( 100.0, -5 ) + }; + + this.n蜈ィ菴鍋イセ蠎ヲ繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 100, 5 ), + new ST繝懊シ繝翫せ( 99, 4 ), + new ST繝懊シ繝翫せ( 90, 1.5 ), + new ST繝懊シ繝翫せ( 80, 1 ), + new ST繝懊シ繝翫せ( 50, -1 ), + new ST繝懊シ繝翫せ( 30, -3 ), + new ST繝懊シ繝翫せ( 0, -4.5 ) + }; + this.n蜈ィ菴捺怙螟ァ繧コ繝ャ譎る俣繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 20, 3 ), + new ST繝懊シ繝翫せ( 30, 1.5 ), + new ST繝懊シ繝翫せ( 50, 1 ), + new ST繝懊シ繝翫せ( 80, 0 ), + new ST繝懊シ繝翫せ( 108, -2.5 ) + }; + this.n蜈ィ菴薙さ繝ウ繝懃紫繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 100.0, 1 ), + new ST繝懊シ繝翫せ( 0.0, -2 ) + }; + this.n蜈ィ菴薙Α繧ケ邇繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 0, 1 ), + new ST繝懊シ繝翫せ( 100.0, -2 ), + }; + + //笘10縺ョ蝣エ蜷郁カ豼霎帙Δ繝シ繝峨↓縺ェ繧九 + if( TJAPlayer3.DTX.LEVELtaiko[ TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]] >= 10 ) + { + #region[ 雜豼霎 ] + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b雜豼霎 = true; + + this.n邊セ蠎ヲ繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 100, 3 ), + new ST繝懊シ繝翫せ( 95, 2 ), + new ST繝懊シ繝翫せ( 88, 1 ), + new ST繝懊シ繝翫せ( 80, -3 ), + new ST繝懊シ繝翫せ( 50, -6 ), + new ST繝懊シ繝翫せ( 0, -10 ) + }; + + this.n譛螟ァ繧コ繝ャ譎る俣繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 2, 4 ), + new ST繝懊シ繝翫せ( 10, 1 ), + new ST繝懊シ繝翫せ( 30, 0 ), + new ST繝懊シ繝翫せ( 50, -1 ), + new ST繝懊シ繝翫せ( 70, -3 ), + new ST繝懊シ繝翫せ( 108, -5 ) + }; + this.n繧ウ繝ウ繝懃紫繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 100.0, 1 ), + new ST繝懊シ繝翫せ( 0.0, -6 ) + }; + this.n繝溘せ邇繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 0, 1 ), + new ST繝懊シ繝翫せ( 100.0, -6 ) + }; + + this.n蜈ィ菴捺怙螟ァ繧コ繝ャ譎る俣繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 20, 3 ), + new ST繝懊シ繝翫せ( 60, 1 ), + new ST繝懊シ繝翫せ( 108, -5 ) + }; + this.n蜈ィ菴薙さ繝ウ繝懃紫繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 100.0, 1 ), + new ST繝懊シ繝翫せ( 0.0, -5 ) + }; + this.n蜈ィ菴薙Α繧ケ邇繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 0, 1 ), + new ST繝懊シ繝翫せ( 100.0, -5 ), + }; + #endregion + } + + if( TJAPlayer3.ConfigIni.bSuperHard ) + { + #region[ 雜豼霎 ] + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b雜豼霎 = true; + + this.n邊セ蠎ヲ繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 100, 3 ), + new ST繝懊シ繝翫せ( 98, 2.3 ), + new ST繝懊シ繝翫せ( 95, 2 ), + new ST繝懊シ繝翫せ( 90, 1.5 ), + new ST繝懊シ繝翫せ( 85, 0 ), + new ST繝懊シ繝翫せ( 80, -2 ), + new ST繝懊シ繝翫せ( 60, -3 ), + new ST繝懊シ繝翫せ( 40, -6 ), + new ST繝懊シ繝翫せ( 0, -7.5 ) + }; + + this.n譛螟ァ繧コ繝ャ譎る俣繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 8, 5 ), + new ST繝懊シ繝翫せ( 18, 3 ), + new ST繝懊シ繝翫せ( 40, 1 ), + new ST繝懊シ繝翫せ( 50, -0.5 ), + new ST繝懊シ繝翫せ( 70, -3 ), + new ST繝懊シ繝翫せ( 108, -5 ) + }; + this.n繧ウ繝ウ繝懃紫繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 100.0, 1 ), + new ST繝懊シ繝翫せ( 0.0, -6 ) + }; + this.n繝溘せ邇繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 0, 1 ), + new ST繝懊シ繝翫せ( 100.0, -6 ) + }; + + this.n蜈ィ菴鍋イセ蠎ヲ繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 100, 7 ), + new ST繝懊シ繝翫せ( 99, 4 ), + new ST繝懊シ繝翫せ( 90, 2 ), + new ST繝懊シ繝翫せ( 80, 1 ), + new ST繝懊シ繝翫せ( 50, -1 ), + new ST繝懊シ繝翫せ( 0, -7 ) + }; + this.n蜈ィ菴捺怙螟ァ繧コ繝ャ譎る俣繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 20, 3 ), + new ST繝懊シ繝翫せ( 40, 1 ), + new ST繝懊シ繝翫せ( 60, -3 ), + new ST繝懊シ繝翫せ( 108, -5 ) + }; + this.n蜈ィ菴薙さ繝ウ繝懃紫繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 100.0, 1 ), + new ST繝懊シ繝翫せ( 0.0, -5 ) + }; + this.n蜈ィ菴薙Α繧ケ邇繝懊シ繝翫せ = new ST繝懊シ繝翫せ[]{ + new ST繝懊シ繝翫せ( 0, 0 ), + new ST繝懊シ繝翫せ( 100.0, -5 ), + }; + #endregion + } + #endregion + } + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + //this.tx谿九j譎る俣謨ー蟄 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_combo taiko.png" ) ); + //this.tx蜉邂玲凾髢捺焚蟄 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_Score_number_1P.png" ) ); + //this.tx繧ソ繧、繝槭シ譫 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_TimerPanel.png" ) ); + //this.tx繧ソ繧、繝槭シ驥 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_TimerTick.png" ) ); + //this.tx閭梧勹鮟 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\Tile black 64x64.png" ) ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx谿九j譎る俣謨ー蟄 ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx蜉邂玲凾髢捺焚蟄 ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧ソ繧、繝槭シ譫 ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧ソ繧、繝槭シ驥 ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx閭梧勹鮟 ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + public override int On騾イ陦梧緒逕サ() + { + if( TJAPlayer3.ConfigIni.eGameMode == EGame.螳瑚オー蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ || TJAPlayer3.ConfigIni.eGameMode == EGame.螳瑚オー蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ豼霎 ) + { + //if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b譛蛻昴ョ繝√ャ繝励′蜿ゥ縺九l縺 == true )//&& + //CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.r讀懃エ「遽蝗イ蜀縺ォ繝√ャ繝励′縺ゅk縺玖ェソ縺ケ繧( CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms, 0, 3000 ) ) + //this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.t騾イ陦(); + //else + //{ + // this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.n迴セ蝨ィ縺ョ蛟、 = this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.n迴セ蝨ィ縺ョ蛟、; + //} + + + //if( !this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.b蛛懈ュ「荳ュ ) + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b繧ソ繧、繝槭シ菴ソ逕ィ荳ュ ) + { + if( !this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.b蛛懈ュ「荳ュ || this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b蜉邂励い繝九Γ荳ュ == true ) + { + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.t騾イ陦(); + if (!TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.r讀懃エ「遽蝗イ蜀縺ォ繝√ャ繝励′縺ゅk縺玖ェソ縺ケ繧((long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)), 0, 5000, 0) || this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b蜉邂励い繝九Γ荳ュ == true) + { + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b繧ソ繧、繝槭シ菴ソ逕ィ荳ュ = false; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.t蛛懈ュ「(); + } + } + } + + if( !this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b繧ソ繧、繝槭シ菴ソ逕ィ荳ュ && this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b蜉邂励い繝九Γ荳ュ == false ) + { + if ((this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b譛蛻昴ョ繝√ャ繝励′蜿ゥ縺九l縺 == true && ( TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.r讀懃エ「遽蝗イ蜀縺ォ繝√ャ繝励′縺ゅk縺玖ェソ縺ケ繧(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms, 0, 2000, 0 ) ) ) ) + { + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b繧ソ繧、繝槭シ菴ソ逕ィ荳ュ = true; + int nCount = this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.n迴セ蝨ィ縺ョ蛟、; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣 = new CCounter( 0, 25000, 1, TJAPlayer3.Timer ); + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct驥昴い繝九Γ = new CCounter( 0, 1000, 1, TJAPlayer3.Timer ); + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.n迴セ蝨ィ縺ョ蛟、 = nCount; + } + + } + + + if( ( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.n迴セ蝨ィ縺ョ蛟、 >= 20000 ) && this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.n迴セ蝨ィ縺ョ蛟、 != 25000 ) + this.t蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ_隧穂セ。繧偵@縺ヲ谿九j譎る俣繧貞サカ髟キ縺吶k(); + + if( TJAPlayer3.Tx.Tile_Black != null ) + { + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.n迴セ蝨ィ縺ョ蛟、 >= 22000 && this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.n迴セ蝨ィ縺ョ蛟、 < 23000 ) + TJAPlayer3.Tx.Tile_Black.Opacity = 64; + else if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.n迴セ蝨ィ縺ョ蛟、 >= 23000 && this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.n迴セ蝨ィ縺ョ蛟、 < 24000 ) + TJAPlayer3.Tx.Tile_Black.Opacity = 128; + else if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.n迴セ蝨ィ縺ョ蛟、 >= 24000 ) + TJAPlayer3.Tx.Tile_Black.Opacity = 192; + else + TJAPlayer3.Tx.Tile_Black.Opacity = 0; + + for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / 64); i++) + { + for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / 64); j++) + { + TJAPlayer3.Tx.Tile_Black.t2D謠冗判(TJAPlayer3.app.Device, i * 64, j * 64); + } + } + } + + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 100, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, ( 25 - this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.n迴セ蝨ィ縺ョ蛟、 ).ToString() ); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 100, 16, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蛹コ髢薙ヮ繝シ繝域焚.ToString() ); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 100, 16 * 2, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n迴セ蝨ィ騾夐℃縺励◆繝弱シ繝域焚.ToString() ); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 100, 16 * 3, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_MISS.ToString() ); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 100, 16 * 4, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛蟆上ぜ繝ャ譎る俣.ToString() ); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 100, 16 * 5, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛螟ァ繧コ繝ャ譎る俣.ToString() ); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 100, 16 * 6, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蜈ィ菴捺怙螟ァ繧コ繝ャ譎る俣.ToString() ); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 100, 16 * 7, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛螟ァ繧ウ繝ウ繝.ToString() ); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 100, 16 * 7, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct蜉邂怜ッゥ譟サ荳ュ.n迴セ蝨ィ縺ョ蛟、.ToString() ); + + #region[ 谿九j譎る俣謠冗判 ] + if(TJAPlayer3.Tx.Taiko_Combo != null ) + { + if (TJAPlayer3.Tx.GameMode_Timer_Frame != null) + TJAPlayer3.Tx.GameMode_Timer_Frame.t2D謠冗判( TJAPlayer3.app.Device, 230, 84 ); + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct驥昴い繝九Γ.t騾イ陦鍬oop(); + + int nCenterX = 230; + int nCerterY = 84; + float fRotate = -C螟画鋤.DegreeToRadian( 360.0f * ( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct驥昴い繝九Γ.n迴セ蝨ィ縺ョ蛟、 / 1000.0f ) ); + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b蜉邂励い繝九Γ荳ュ == true ) + fRotate = C螟画鋤.DegreeToRadian( 360.0f * ( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct驥昴い繝九Γ.n迴セ蝨ィ縺ョ蛟、 / (float)this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蟒カ髟キ繧「繝九Γ騾溷コヲ ) ); + + SlimDX.Matrix mat = SlimDX.Matrix.Identity; + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b譛蛻昴ョ繝√ャ繝励′蜿ゥ縺九l縺 ) + { + mat *= SlimDX.Matrix.RotationZ( fRotate ); + mat *= SlimDX.Matrix.Translation( 280 - 640, -( 134 - 360 ), 0 ); + } + else + { + mat *= SlimDX.Matrix.Translation( 280 - 640, -( 134 - 360 ), 0 ); + } + + TJAPlayer3.Tx.GameMode_Timer_Tick.t3D謠冗判( TJAPlayer3.app.Device, mat ); + + string str陦ィ遉コ縺吶k谿九j譎る俣 = ( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.n迴セ蝨ィ縺ョ蛟、 < 1000 ) ? "25" : ( ( 26000 - this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.n迴セ蝨ィ縺ョ蛟、 ) / 1000 ).ToString(); + this.t蟆乗枚蟄苓。ィ遉コ( 230 + (str陦ィ遉コ縺吶k谿九j譎る俣.Length * TJAPlayer3.Skin.Game_Taiko_Combo_Size[0] / 4 ), 84 + TJAPlayer3.Tx.GameMode_Timer_Frame.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height / 2 , string.Format("{0,2:#0}", str陦ィ遉コ縺吶k谿九j譎る俣 )); + } + + if( !this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct蜉邂怜ッゥ譟サ荳ュ.b蛛懈ュ「荳ュ ) + { + if( !this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct蜉邂怜ッゥ譟サ荳ュ.b蛛懈ュ「荳ュ ) + { + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct蜉邂怜ッゥ譟サ荳ュ.t騾イ陦(); + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct蜉邂怜ッゥ譟サ荳ュ.b邨ゆコ蛟、縺ォ驕斐@縺 ) + { + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct蜉邂怜ッゥ譟サ荳ュ.t蛛懈ュ「(); + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b蜉邂励い繝九Γ荳ュ = false; + this.t蜉邂玲凾髢捺緒逕サ_Start(); + } + } + } + if( !this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct蜉邂玲凾髢楢。ィ遉コ.b蛛懈ュ「荳ュ ) + { + if( !this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct蜉邂玲凾髢楢。ィ遉コ.b蛛懈ュ「荳ュ ) + { + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct蜉邂玲凾髢楢。ィ遉コ.t騾イ陦(); + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct蜉邂玲凾髢楢。ィ遉コ.b邨ゆコ蛟、縺ォ驕斐@縺 ) + { + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct蜉邂玲凾髢楢。ィ遉コ.t蛛懈ュ「(); + } + } + this.t蜉邂玲凾髢捺緒逕サ( this.n蜑榊屓縺ョ蟒カ髟キ譎る俣 ); + } + #endregion + } + return 0; + } + + private void t蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ_隧穂セ。繧偵@縺ヲ谿九j譎る俣繧貞サカ髟キ縺吶k() + { + double n蟒カ髟キ縺吶k譎る俣 = 0; + + //譛蠕後↓蟒カ髟キ縺励◆譎ょ綾縺九i11遘堤オ碁℃縺励※縺縺ェ縺代l縺ー蟒カ髟キ繧定。後o縺ェ縺縲 + if (this.n譛蠕後↓譎る俣蟒カ髟キ縺励◆譎ょ綾 + 11000 <= (CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))) + { + //1鬆逶ョ縺ォ縺、縺5遘 + //-邊セ蠎ヲ + if ( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_PERFECT != 0 || this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_GREAT != 0 ) + { + double db蛹コ髢灘邊セ蠎ヲ = ( (double) ( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_PERFECT + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_GREAT ) / this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蛹コ髢薙ヮ繝シ繝域焚 ) * 100.0; + for( int i = 0; i < this.n邊セ蠎ヲ繝懊シ繝翫せ.Length; i++ ) + { + if( db蛹コ髢灘邊セ蠎ヲ >= this.n邊セ蠎ヲ繝懊シ繝翫せ[ i ].ret ) + { + n蟒カ髟キ縺吶k譎る俣 += this.n邊セ蠎ヲ繝懊シ繝翫せ[ i ].point; + break; + } + } + } + + //-繝ゥ繧ー譎る俣 + #region[ 繝ゥ繧ー譎る俣縺ォ繧医k蛻、螳 ] + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛蟆上ぜ繝ャ譎る俣 != -1 ) + { + for( int i = 0; i < this.n譛蟆上ぜ繝ャ譎る俣繝懊シ繝翫せ.Length; i++ ) + { + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛蟆上ぜ繝ャ譎る俣 >= this.n譛蟆上ぜ繝ャ譎る俣繝懊シ繝翫せ[ i ].ret ) + { + n蟒カ髟キ縺吶k譎る俣 += this.n譛蟆上ぜ繝ャ譎る俣繝懊シ繝翫せ[ i ].point; + break; + } + } + } + + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛螟ァ繧コ繝ャ譎る俣 != -1 ) + { + for( int i = 0; i < this.n譛螟ァ繧コ繝ャ譎る俣繝懊シ繝翫せ.Length; i++ ) + { + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛螟ァ繧コ繝ャ譎る俣 <= this.n譛螟ァ繧コ繝ャ譎る俣繝懊シ繝翫せ[ i ].ret ) + { + n蟒カ髟キ縺吶k譎る俣 += this.n譛螟ァ繧コ繝ャ譎る俣繝懊シ繝翫せ[ i ].point; + break; + } + } + } + #endregion + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛螟ァ繧ウ繝ウ繝 != 0 ) + { + double db蛹コ髢灘繧ウ繝ウ繝懃イセ蠎ヲ = ( (double)this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛螟ァ繧ウ繝ウ繝 / this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蛹コ髢薙ヮ繝シ繝域焚 ) * 100.0; + for( int i = 0; i < this.n繧ウ繝ウ繝懃紫繝懊シ繝翫せ.Length; i++ ) + { + if( db蛹コ髢灘繧ウ繝ウ繝懃イセ蠎ヲ >= this.n繧ウ繝ウ繝懃紫繝懊シ繝翫せ[ i ].ret ) + { + n蟒カ髟キ縺吶k譎る俣 += this.n繧ウ繝ウ繝懃紫繝懊シ繝翫せ[ i ].point; + break; + } + } + } + + double db蛹コ髢灘繝溘せ邇 = ( ( (double)this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_POOR + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_MISS ) / this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蛹コ髢薙ヮ繝シ繝域焚 ) * 100.0; + for( int i = 0; i < this.n繝溘せ邇繝懊シ繝翫せ.Length; i++ ) + { + if( db蛹コ髢灘繝溘せ邇 >= this.n繝溘せ邇繝懊シ繝翫せ[ i ].ret ) + { + n蟒カ髟キ縺吶k譎る俣 += this.n繝溘せ邇繝懊シ繝翫せ[ i ].point; + break; + } + } + #region[ 蜈ィ菴 ] + if( TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Perfect != 0 || TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Great != 0 ) + { + double db蜈ィ菴鍋イセ蠎ヲ = ( (double) ( TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Perfect + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Great ) / this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蛹コ髢薙ヮ繝シ繝域焚 ) * 100.0; + for( int i = 0; i < this.n蜈ィ菴鍋イセ蠎ヲ繝懊シ繝翫せ.Length; i++ ) + { + if( db蜈ィ菴鍋イセ蠎ヲ >= this.n蜈ィ菴鍋イセ蠎ヲ繝懊シ繝翫せ[ i ].ret ) + { + n蟒カ髟キ縺吶k譎る俣 += this.n蜈ィ菴鍋イセ蠎ヲ繝懊シ繝翫せ[ i ].point; + break; + } + } + } + + //-繝ゥ繧ー譎る俣 + #region[ 繝ゥ繧ー譎る俣縺ォ繧医k蛻、螳 ] + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蜈ィ菴捺怙螟ァ繧コ繝ャ譎る俣 != -1 ) + { + for( int i = 0; i < this.n蜈ィ菴捺怙螟ァ繧コ繝ャ譎る俣繝懊シ繝翫せ.Length; i++ ) + { + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蜈ィ菴捺怙螟ァ繧コ繝ャ譎る俣 <= this.n蜈ィ菴捺怙螟ァ繧コ繝ャ譎る俣繝懊シ繝翫せ[ i ].ret ) + { + n蟒カ髟キ縺吶k譎る俣 += this.n蜈ィ菴捺怙螟ァ繧コ繝ャ譎る俣繝懊シ繝翫せ[ i ].point; + break; + } + } + } + #endregion + if( TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.譛鬮伜、[0] != 0 ) + { + double db蜈ィ菴薙さ繝ウ繝懃紫 = ( (double)TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.譛鬮伜、[0] / this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n迴セ蝨ィ騾夐℃縺励◆繝弱シ繝域焚 ) * 100.0; + for( int i = 0; i < this.n蜈ィ菴薙さ繝ウ繝懃紫繝懊シ繝翫せ.Length; i++ ) + { + if( db蜈ィ菴薙さ繝ウ繝懃紫 >= this.n蜈ィ菴薙さ繝ウ繝懃紫繝懊シ繝翫せ[ i ].ret ) + { + n蟒カ髟キ縺吶k譎る俣 += this.n蜈ィ菴薙さ繝ウ繝懃紫繝懊シ繝翫せ[ i ].point; + break; + } + } + } + + double db蜈ィ菴薙Α繧ケ邇 = ( ( (double)TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Poor + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Miss ) / this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n迴セ蝨ィ騾夐℃縺励◆繝弱シ繝域焚 ) * 100.0; + for( int i = 0; i < this.n蜈ィ菴薙Α繧ケ邇繝懊シ繝翫せ.Length; i++ ) + { + if( db蜈ィ菴薙Α繧ケ邇 >= this.n蜈ィ菴薙Α繧ケ邇繝懊シ繝翫せ[ i ].ret ) + { + n蟒カ髟キ縺吶k譎る俣 += this.n蜈ィ菴薙Α繧ケ邇繝懊シ繝翫せ[ i ].point; + break; + } + } + #endregion + + + this.n譛蠕後↓譎る俣蟒カ髟キ縺励◆譎ょ綾 = (int)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + if ( n蟒カ髟キ縺吶k譎る俣 < 0 ) + n蟒カ髟キ縺吶k譎る俣 = 0; + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蛹コ髢薙ヮ繝シ繝域焚 == 0 ) + n蟒カ髟キ縺吶k譎る俣 = 15; + + //蜷謨ー蛟、繧貞晄悄蛹 + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_PERFECT = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_GREAT = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_GOOD = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_POOR = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_MISS = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蛹コ髢薙ヮ繝シ繝域焚 = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n迴セ蝨ィ縺ョ繧ウ繝ウ繝 = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛蟆上ぜ繝ャ譎る俣 = -1; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛螟ァ繧コ繝ャ譎る俣 = -1; + + this.n蜑榊屓縺ョ蟒カ髟キ譎る俣 = (int)n蟒カ髟キ縺吶k譎る俣; + n蟒カ髟キ縺吶k譎る俣 = n蟒カ髟キ縺吶k譎る俣 * 1000; + if( n蟒カ髟キ縺吶k譎る俣 > 0 ) + { + this.t蜉邂怜ッゥ譟サ繧「繝九Γ_Start(); + if ( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b蜉邂励い繝九Γ荳ュ == false ) + this.t蜉邂玲凾髢捺緒逕サ_Start(); + } + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.n迴セ蝨ィ縺ョ蛟、 -= (int)n蟒カ髟キ縺吶k譎る俣; + } + else if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.n迴セ蝨ィ縺ョ蛟、 >= 24000 ) + { + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n縺翫∪縺大刈邂励′逋コ逕溘@縺溷屓謨ー > 3 ) + return; + if (this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b雜豼霎 && (((double)this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_POOR + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_MISS) > 0)) + return; //繝溘せ縺悟コ繧九h縺縺ァ縺ッ荳企#縺励∪縺帙s繧医ゅ♀蜈讒倥 + if( TJAPlayer3.ConfigIni.bSuperHard ) + return; //繧ケ繝シ繝代シ繝上シ繝画凾縺ッ繝懊シ繝翫せ蜉轤ケ辟。縺励 + + + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n縺翫∪縺大刈邂励′逋コ逕溘@縺溷屓謨ー++; + + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_PERFECT != 0 || this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_GREAT != 0 ) + { + double db蛹コ髢灘邊セ蠎ヲ = ( (double) ( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_PERFECT + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_GREAT ) / this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蛹コ髢薙ヮ繝シ繝域焚 ) * 100.0; + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b雜豼霎 ? ( db蛹コ髢灘邊セ蠎ヲ >= 95.0 ) : ( db蛹コ髢灘邊セ蠎ヲ >= 98.0 ) ) + { + n蟒カ髟キ縺吶k譎る俣 += 6; + } + } + #region[ 繝ゥ繧ー譎る俣縺ォ繧医k蛻、螳 ] + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛蟆上ぜ繝ャ譎る俣 != -1 ) + { + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛蟆上ぜ繝ャ譎る俣 >= 0 ) + { + n蟒カ髟キ縺吶k譎る俣 += 6; + } + } + + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛螟ァ繧コ繝ャ譎る俣 != -1 ) + { + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛螟ァ繧コ繝ャ譎る俣 <= 30 ) + { + n蟒カ髟キ縺吶k譎る俣 += 6; + } + } + #endregion + double db蛹コ髢灘繝溘せ邇 = ( ( (double)this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_POOR + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_MISS ) / this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蛹コ髢薙ヮ繝シ繝域焚 ) * 100.0; + if( db蛹コ髢灘繝溘せ邇 >= 5.0 ) + { + n蟒カ髟キ縺吶k譎る俣 -= 2; + } + + + this.n譛蠕後↓譎る俣蟒カ髟キ縺励◆譎ょ綾 = (int)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + if ( n蟒カ髟キ縺吶k譎る俣 < 0 ) + n蟒カ髟キ縺吶k譎る俣 = 0; + + //蜷謨ー蛟、繧貞晄悄蛹 + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_PERFECT = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_GREAT = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_GOOD = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_POOR = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_MISS = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蛹コ髢薙ヮ繝シ繝域焚 = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n迴セ蝨ィ縺ョ繧ウ繝ウ繝 = 0; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛蟆上ぜ繝ャ譎る俣 = -1; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛螟ァ繧コ繝ャ譎る俣 = -1; + + this.n蜑榊屓縺ョ蟒カ髟キ譎る俣 = (int)n蟒カ髟キ縺吶k譎る俣; + n蟒カ髟キ縺吶k譎る俣 = n蟒カ髟キ縺吶k譎る俣 * 1000; + if( n蟒カ髟キ縺吶k譎る俣 > 0 ) + { + this.t蜉邂怜ッゥ譟サ繧「繝九Γ_Start(); + if ( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b蜉邂励い繝九Γ荳ュ == false ) + this.t蜉邂玲凾髢捺緒逕サ_Start(); + } + if( n蟒カ髟キ縺吶k譎る俣 > 5000 ) + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.n迴セ蝨ィ縺ョ蛟、 -= (int)n蟒カ髟キ縺吶k譎る俣; + } + + if (n蟒カ髟キ縺吶k譎る俣 >= 12000) + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蟒カ髟キ繧「繝九Γ騾溷コヲ = 100; + else if (n蟒カ髟キ縺吶k譎る俣 < 12000 && n蟒カ髟キ縺吶k譎る俣 >= 5000) + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蟒カ髟キ繧「繝九Γ騾溷コヲ = 250; + else + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蟒カ髟キ繧「繝九Γ騾溷コヲ = 500; + } + + public void t蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ_蛻、螳壹°繧牙推謨ー蛟、繧貞「怜刈縺輔○繧( E蛻、螳 eJudge, int nLagTime ) + { + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b譛蛻昴ョ繝√ャ繝励′蜿ゥ縺九l縺 = true; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蛹コ髢薙ヮ繝シ繝域焚++; + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n迴セ蝨ィ騾夐℃縺励◆繝弱シ繝域焚++; + switch( eJudge ) + { + case E蛻、螳.Perfect: + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_PERFECT++; + break; + case E蛻、螳.Great: + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_GREAT++; + break; + case E蛻、螳.Good: + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_GOOD++; + break; + case E蛻、螳.Poor: + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_POOR++; + break; + case E蛻、螳.Miss: + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n繝偵ャ繝域焚_MISS++; + break; + } + switch( eJudge ) + { + case E蛻、螳.Perfect: + case E蛻、螳.Great: + case E蛻、螳.Good: + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n迴セ蝨ィ縺ョ繧ウ繝ウ繝++; + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n迴セ蝨ィ縺ョ繧ウ繝ウ繝 >= this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛螟ァ繧ウ繝ウ繝 ) + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛螟ァ繧ウ繝ウ繝 = this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n迴セ蝨ィ縺ョ繧ウ繝ウ繝; + if( Math.Abs( nLagTime ) > this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛螟ァ繧コ繝ャ譎る俣 ) + { + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛螟ァ繧コ繝ャ譎る俣 = Math.Abs( nLagTime ); + } + if( Math.Abs( nLagTime ) > this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蜈ィ菴捺怙螟ァ繧コ繝ャ譎る俣 ) + { + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n蜈ィ菴捺怙螟ァ繧コ繝ャ譎る俣 = Math.Abs( nLagTime ); + } + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛蟆上ぜ繝ャ譎る俣 == -1 ) + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛蟆上ぜ繝ャ譎る俣 = Math.Abs( nLagTime ); + if( Math.Abs( nLagTime ) < this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛蟆上ぜ繝ャ譎る俣 ) + { + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n譛蟆上ぜ繝ャ譎る俣 = Math.Abs( nLagTime ); + } + break; + default: + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.n迴セ蝨ィ縺ョ繧ウ繝ウ繝 = 0; + break; + } + } + + private void t蜉邂怜ッゥ譟サ繧「繝九Γ_Start() + { + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct蜉邂怜ッゥ譟サ荳ュ = new CCounter( 0, 2000, 1, TJAPlayer3.Timer ); + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b蜉邂励い繝九Γ荳ュ = true; + } + private void t蜉邂玲凾髢捺緒逕サ_Start() + { + this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct蜉邂玲凾髢楢。ィ遉コ = new CCounter( 0, 1, 1000, TJAPlayer3.Timer ); + } + + private void t蜉邂玲凾髢捺緒逕サ( int addtime ) + { + this.t蜉邂玲枚蟄苓。ィ遉コ( 258, 150, string.Format( "{0,2:#0}", addtime.ToString() ) ); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 236, 80, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.襍、, "+" + string.Format( "{0,2:#0}", addtime.ToString() ) ); + } + + private struct ST譁蟄嶺ス咲スョ + { + public char ch; + public Point pt; + public ST譁蟄嶺ス咲スョ( char ch, Point pt ) + { + this.ch = ch; + this.pt = pt; + } + } + + private ST譁蟄嶺ス咲スョ[] st蟆乗枚蟄嶺ス咲スョ = new ST譁蟄嶺ス咲スョ[]{ + new ST譁蟄嶺ス咲スョ( '0', new Point( 0, 0 ) ), + new ST譁蟄嶺ス咲スョ( '1', new Point( 44, 0 ) ), + new ST譁蟄嶺ス咲スョ( '2', new Point( 88, 0 ) ), + new ST譁蟄嶺ス咲スョ( '3', new Point( 132, 0 ) ), + new ST譁蟄嶺ス咲スョ( '4', new Point( 176, 0 ) ), + new ST譁蟄嶺ス咲スョ( '5', new Point( 220, 0 ) ), + new ST譁蟄嶺ス咲スョ( '6', new Point( 264, 0 ) ), + new ST譁蟄嶺ス咲スョ( '7', new Point( 308, 0 ) ), + new ST譁蟄嶺ス咲スョ( '8', new Point( 352, 0 ) ), + new ST譁蟄嶺ス咲スョ( '9', new Point( 396, 0 ) ) + }; + + private void t蟆乗枚蟄苓。ィ遉コ( int x, int y, string str ) + { + foreach( char ch in str ) + { + for( int i = 0; i < this.st蟆乗枚蟄嶺ス咲スョ.Length; i++ ) + { + if (this.st蟆乗枚蟄嶺ス咲スョ[i].ch == ch) + { + Rectangle rectangle = new Rectangle(TJAPlayer3.Skin.Game_Taiko_Combo_Size[0] * i, 0, TJAPlayer3.Skin.Game_Taiko_Combo_Size[0], TJAPlayer3.Skin.Game_Taiko_Combo_Size[1]); + if(TJAPlayer3.Tx.Taiko_Combo[0] != null ) + { + if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b繧ソ繧、繝槭シ菴ソ逕ィ荳ュ ) + TJAPlayer3.Tx.Taiko_Combo[0].Opacity = 255; + else if( this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b譛蛻昴ョ繝√ャ繝励′蜿ゥ縺九l縺 && !this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b繧ソ繧、繝槭シ菴ソ逕ィ荳ュ ) + TJAPlayer3.Tx.Taiko_Combo[0].Opacity = 128; + if (this.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b蜉邂励い繝九Γ荳ュ) + TJAPlayer3.Tx.Taiko_Combo[0].Opacity = 0; + TJAPlayer3.Tx.Taiko_Combo[0].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1f; + TJAPlayer3.Tx.Taiko_Combo[0].vc諡。螟ァ邵ョ蟆丞咲紫.X = 1f; + TJAPlayer3.Tx.Taiko_Combo[0].t2D荳ュ蠢蝓コ貅匁緒逕サ( TJAPlayer3.app.Device, x, y, rectangle ); + } + break; + } + } + x += TJAPlayer3.Skin.Game_Taiko_Combo_Padding[0] * 2; + } + } + protected void t蜉邂玲枚蟄苓。ィ遉コ( int x, int y, string str ) + { + char[] cFont = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; + foreach( char ch in str ) + { + for( int i = 0; i < cFont.Length; i++ ) + { + if( cFont[ i ] == ch ) + { + Rectangle rectangle = new Rectangle(TJAPlayer3.Skin.Game_Score_Size[0] * i, 0, TJAPlayer3.Skin.Game_Score_Size[0], TJAPlayer3.Skin.Game_Score_Size[1]); + if (TJAPlayer3.Tx.Taiko_Score[0] != null ) + { + TJAPlayer3.Tx.Taiko_Score[0].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1f; + TJAPlayer3.Tx.Taiko_Score[0].t2D謠冗判( TJAPlayer3.app.Device, x, y, rectangle ); + } + } + } + x += 20; + } + } + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ウ繝ウ繝廛GB.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ウ繝ウ繝廛GB.cs new file mode 100644 index 00000000..c7b7e1bc --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ウ繝ウ繝廛GB.cs @@ -0,0 +1,25 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rums繧ウ繝ウ繝廛GB : CAct貍泌・修ombo蜈ア騾 + { + // CAct貍泌・修ombo蜈ア騾 螳溯」 + + protected override void t繧ウ繝ウ繝懆。ィ遉コ_繧ョ繧ソ繝シ( int nCombo蛟、, int n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ ) + { + } + protected override void t繧ウ繝ウ繝懆。ィ遉コ_繝峨Λ繝( int nCombo蛟、, int n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ ) + { + } + protected override void t繧ウ繝ウ繝懆。ィ遉コ_繝吶シ繧ケ( int nCombo蛟、, int n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ ) + { + } + protected override void t繧ウ繝ウ繝懆。ィ遉コ_螟ェ鮠(int nCombo蛟、, int n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ, int nPlayer) + { + base.t繧ウ繝ウ繝懆。ィ遉コ_螟ェ鮠( nCombo蛟、, n繧ク繝」繝ウ繝励う繝ウ繝繝繧ッ繧ケ, nPlayer ); + } + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ウ繝ウ繝懷聖縺榊コ縺.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ウ繝ウ繝懷聖縺榊コ縺.cs new file mode 100644 index 00000000..18add622 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ウ繝ウ繝懷聖縺榊コ縺.cs @@ -0,0 +1,208 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Runtime.InteropServices; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rums繧ウ繝ウ繝懷聖縺榊コ縺 : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + /// + /// 100繧ウ繝ウ繝懊#縺ィ縺ォ蜃コ繧句聖縺榊コ縺励 + /// 譛ャ蠖薙ッ縲10000轤ケ縲阪ョ縺ィ縺薙m繧ょ虚縺九@縺溘>縺代←縲∵橿陦謎ク崎カウ縺縺嶺ソ晉蕗縲 + /// + public CAct貍泌・愁rums繧ウ繝ウ繝懷聖縺榊コ縺() + { + for (int i = 0; i < 10; i++) + { + this.st蟆乗枚蟄嶺ス咲スョ[i].ch = i.ToString().ToCharArray()[0]; + this.st蟆乗枚蟄嶺ス咲スョ[i].pt = new Point(i * 53, 0); + } + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // 繝。繧ス繝繝 + public virtual void Start( int nCombo, int player ) + { + this.NowDrawBalloon = 0; + this.ct騾イ陦啓 player ] = new CCounter( 1, 42, 70, TJAPlayer3.Timer ); + this.nCombo_貂。[player] = nCombo; + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + for( int i = 0; i < 2; i++ ) + { + this.nCombo_貂。[ i ] = 0; + this.ct騾イ陦啓 i ] = new CCounter(); + } + + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + for( int i = 0; i < 2; i++ ) + { + this.ct騾イ陦啓 i ] = null; + } + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //this.tx蜷ケ縺榊コ縺玲悽菴甜 0 ] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_combo balloon.png" ) ); + //if (CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay) + // this.tx蜷ケ縺榊コ縺玲悽菴甜 1 ] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_combo balloon_2P.png" ) ); + //this.tx謨ー蟄 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_combo balloon_number.png" ) ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx蜷ケ縺榊コ縺玲悽菴甜 0 ] ); + //if (CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay) + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx蜷ケ縺榊コ縺玲悽菴甜 1 ] ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx謨ー蟄 ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + for( int i = 0; i < 2; i++ ) + { + if( !this.ct騾イ陦啓 i ].b蛛懈ュ「荳ュ ) + { + this.ct騾イ陦啓 i ].t騾イ陦(); + if( this.ct騾イ陦啓 i ].b邨ゆコ蛟、縺ォ驕斐@縺 ) + { + this.ct騾イ陦啓 i ].t蛛懈ュ「(); + } + } + + if( TJAPlayer3.Tx.Balloon_Combo[ i ] != null ) + { + //蜊企乗4f + if( this.ct騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 == 1 || this.ct騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 == 42 ) + { + TJAPlayer3.Tx.Balloon_Number_Combo.Opacity = 0; + TJAPlayer3.Tx.Balloon_Combo[i].Opacity = 64; + NowDrawBalloon = 0; + } + else if( this.ct騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 == 2 || this.ct騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 == 41 ) + { + TJAPlayer3.Tx.Balloon_Number_Combo.Opacity = 0; + TJAPlayer3.Tx.Balloon_Combo[i].Opacity = 128; + NowDrawBalloon = 0; + } + else if( this.ct騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 == 3 || this.ct騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 == 40 ) + { + NowDrawBalloon = 1; + TJAPlayer3.Tx.Balloon_Combo[i].Opacity = 255; + TJAPlayer3.Tx.Balloon_Number_Combo.Opacity = 128; + } + else if( this.ct騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 == 4 || this.ct騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 == 39 ) + { + NowDrawBalloon = 2; + TJAPlayer3.Tx.Balloon_Combo[i].Opacity = 255; + TJAPlayer3.Tx.Balloon_Number_Combo.Opacity = 255; + } + else if( this.ct騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 == 5 || this.ct騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 == 38 ) + { + NowDrawBalloon = 2; + TJAPlayer3.Tx.Balloon_Combo[i].Opacity = 255; + TJAPlayer3.Tx.Balloon_Number_Combo.Opacity = 255; + } + else if( this.ct騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 >= 6 || this.ct騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 <= 37 ) + { + NowDrawBalloon = 2; + TJAPlayer3.Tx.Balloon_Combo[i].Opacity = 255; + TJAPlayer3.Tx.Balloon_Number_Combo.Opacity = 255; + } + + if( this.ct騾イ陦啓 i ].b騾イ陦御クュ ) + { + TJAPlayer3.Tx.Balloon_Combo[ i ].t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Balloon_Combo_X[ i ], TJAPlayer3.Skin.Game_Balloon_Combo_Y[ i ], new RectangleF(NowDrawBalloon * 360f, 0, 360f, 192) ); + if( this.nCombo_貂。[ i ] < 1000 ) //2016.08.23 kairera0467 莉ョ螳溯」縲 + { + this.t蟆乗枚蟄苓。ィ遉コ( TJAPlayer3.Skin.Game_Balloon_Combo_Number_X[ i], TJAPlayer3.Skin.Game_Balloon_Combo_Number_Y[ i ], string.Format( "{0,4:###0}", this.nCombo_貂。[ i ] ), i); + TJAPlayer3.Tx.Balloon_Number_Combo.t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Balloon_Combo_Text_X[ i] + 6 - NowDrawBalloon * 3, TJAPlayer3.Skin.Game_Balloon_Combo_Text_Y[ i ], new Rectangle(0, 124, 100, 30)); + } + else + { + this.t蟆乗枚蟄苓。ィ遉コ( TJAPlayer3.Skin.Game_Balloon_Combo_Number_Ex_X[ i], TJAPlayer3.Skin.Game_Balloon_Combo_Number_Ex_Y[ i ], string.Format( "{0,4:###0}", this.nCombo_貂。[ i ] ), i ); + TJAPlayer3.Tx.Balloon_Number_Combo.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + TJAPlayer3.Tx.Balloon_Number_Combo.t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Balloon_Combo_Text_Ex_X[ i] + 6 - NowDrawBalloon * 3, TJAPlayer3.Skin.Game_Balloon_Combo_Text_Ex_Y[ i ], new Rectangle( 0, 124, 100, 30 ) ); + } + } + } + } + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private CCounter[] ct騾イ陦 = new CCounter[ 2 ]; + //private CTexture[] tx蜷ケ縺榊コ縺玲悽菴 = new CTexture[ 2 ]; + //private CTexture tx謨ー蟄; + private int[] nCombo_貂。 = new int[ 2 ]; + + private int NowDrawBalloon; + + [StructLayout(LayoutKind.Sequential)] + private struct ST譁蟄嶺ス咲スョ + { + public char ch; + public Point pt; + public ST譁蟄嶺ス咲スョ( char ch, Point pt ) + { + this.ch = ch; + this.pt = pt; + } + } + private ST譁蟄嶺ス咲スョ[] st蟆乗枚蟄嶺ス咲スョ = new ST譁蟄嶺ス咲スョ[10]; + + private void t蟆乗枚蟄苓。ィ遉コ( int x, int y, string str, int player ) + { + foreach( char ch in str ) + { + for( int i = 0; i < this.st蟆乗枚蟄嶺ス咲スョ.Length; i++ ) + { + if( this.st蟆乗枚蟄嶺ス咲スョ[ i ].ch == ch ) + { + Rectangle rectangle = new Rectangle( this.st蟆乗枚蟄嶺ス咲スョ[ i ].pt.X, this.st蟆乗枚蟄嶺ス咲スョ[ i ].pt.Y + player * 62, 53, 62 ); + if(TJAPlayer3.Tx.Balloon_Number_Combo != null ) + { + if (int.Parse(str) >= 1000) + TJAPlayer3.Tx.Balloon_Number_Combo.vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.8f; + else + TJAPlayer3.Tx.Balloon_Number_Combo.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + + TJAPlayer3.Tx.Balloon_Number_Combo.t2D謠冗判( TJAPlayer3.app.Device, x, y, rectangle ); + } + break; + } + } + x += (int)(45 * TJAPlayer3.Tx.Balloon_Number_Combo.vc諡。螟ァ邵ョ蟆丞咲紫.X); + } + } + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ケ繧ウ繧「.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ケ繧ウ繧「.cs new file mode 100644 index 00000000..69bcd63e --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ケ繧ウ繧「.cs @@ -0,0 +1,247 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Runtime.InteropServices; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rums繧ケ繧ウ繧「 : CAct貍泌・上せ繧ウ繧「蜈ア騾 + { + // CActivity 螳溯」シ亥ア騾壹け繝ゥ繧ケ縺九i縺ョ蟾ョ蛻縺ョ縺ソシ + + public unsafe override int On騾イ陦梧緒逕サ() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + if (base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ) + { + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + long num = FDK.CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾; + //if (num < base.n騾イ陦檎畑繧ソ繧、繝) + //{ + // base.n騾イ陦檎畑繧ソ繧、繝 = num; + //} + //while ((num - base.n騾イ陦檎畑繧ソ繧、繝) >= 10) + //{ + // for (int j = 0; j < 4; j++) + // { + // this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョ繧ケ繧ウ繧「[j] += this.n繧ケ繧ウ繧「縺ョ蠅怜[j]; + + // if (this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョ繧ケ繧ウ繧「[j] > (long) this.n迴セ蝨ィ縺ョ譛ャ蠖薙ョ繧ケ繧ウ繧「[j]) + // this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョ繧ケ繧ウ繧「[j] = (long) this.n迴セ蝨ィ縺ョ譛ャ蠖薙ョ繧ケ繧ウ繧「[j]; + // } + // base.n騾イ陦檎畑繧ソ繧、繝 += 10; + + //} + if( !this.ctTimer.b蛛懈ュ「荳ュ ) + { + this.ctTimer.t騾イ陦(); + if( this.ctTimer.b邨ゆコ蛟、縺ォ驕斐@縺 ) + { + this.ctTimer.t蛛懈ュ「(); + } + + //base.t蟆乗枚蟄苓。ィ遉コ( 20, 150, string.Format( "{0,7:######0}", this.n繧ケ繧ウ繧「縺ョ蠅怜.Guitar ) ); + } + + for (int i = 0; i < 4; i++) + { + if (!this.ct轤ケ謨ー繧「繝九Γ繧ソ繧、繝杣i].b蛛懈ュ「荳ュ) + { + this.ct轤ケ謨ー繧「繝九Γ繧ソ繧、繝杣i].t騾イ陦(); + if (this.ct轤ケ謨ー繧「繝九Γ繧ソ繧、繝杣i].b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.ct轤ケ謨ー繧「繝九Γ繧ソ繧、繝杣i].t蛛懈ュ「(); + } + } + } + + for (int i = 0; i < 4; i++) + { + if (!this.ct繝懊シ繝翫せ蜉邂励ち繧、繝杣i].b蛛懈ュ「荳ュ) + { + this.ct繝懊シ繝翫せ蜉邂励ち繧、繝杣i].t騾イ陦(); + if (this.ct繝懊シ繝翫せ蜉邂励ち繧、繝杣i].b邨ゆコ蛟、縺ォ驕斐@縺) + { + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actScore.BonusAdd(i); + this.ct繝懊シ繝翫せ蜉邂励ち繧、繝杣i].t蛛懈ュ「(); + } + } + } + + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.ct繝懊シ繝翫せ蜉邂励ち繧、繝杣0].n迴セ蝨ィ縺ョ蛟、.ToString()); + + base.t蟆乗枚蟄苓。ィ遉コ(TJAPlayer3.Skin.Game_Score_X[0], TJAPlayer3.Skin.Game_Score_Y[0], string.Format( "{0,7:######0}", this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョ繧ケ繧ウ繧「[ 0 ].Taiko ), 0 , 256, 0); + if( TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay ) base.t蟆乗枚蟄苓。ィ遉コ(TJAPlayer3.Skin.Game_Score_X[1], TJAPlayer3.Skin.Game_Score_Y[1], string.Format( "{0,7:######0}", this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョ繧ケ繧ウ繧「[ 1 ].Taiko ), 0 , 256, 1); + + for( int i = 0; i < 256; i++ ) + { + if( this.stScore[ i ].b菴ソ逕ィ荳ュ ) + { + if( !this.stScore[ i ].ctTimer.b蛛懈ュ「荳ュ ) + { + this.stScore[ i ].ctTimer.t騾イ陦(); + if( this.stScore[ i ].ctTimer.b邨ゆコ蛟、縺ォ驕斐@縺 ) + { + if( this.stScore[ i ].b陦ィ遉コ荳ュ == true ) + this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョAddScore--; + this.stScore[ i ].ctTimer.t蛛懈ュ「(); + this.stScore[ i ].b菴ソ逕ィ荳ュ = false; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actDan.Update(); + } + + if (!stScore[i].bAddEnd) + { + this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョ繧ケ繧ウ繧「[this.stScore[i].nPlayer].Taiko += (long)this.stScore[i].nAddScore; + stScore[i].bAddEnd = true; + if (ct轤ケ謨ー繧「繝九Γ繧ソ繧、繝杣stScore[i].nPlayer].b邨ゆコ蛟、縺ォ驕斐@縺ヲ縺ェ縺) + { + this.ct轤ケ謨ー繧「繝九Γ繧ソ繧、繝杣stScore[i].nPlayer] = new CCounter(0, 11, 13, TJAPlayer3.Timer); + this.ct轤ケ謨ー繧「繝九Γ繧ソ繧、繝杣stScore[i].nPlayer].n迴セ蝨ィ縺ョ蛟、 = 1; + } + else + { + this.ct轤ケ謨ー繧「繝九Γ繧ソ繧、繝杣stScore[i].nPlayer] = new CCounter(0, 11, 13, TJAPlayer3.Timer); + } + } + + int xAdd = 0; + int yAdd = 0; + int alpha = 0; + + if ( this.stScore[i].ctTimer.n迴セ蝨ィ縺ョ蛟、 < 10) + { + xAdd = 25; + alpha = 150; + } else if (this.stScore[i].ctTimer.n迴セ蝨ィ縺ョ蛟、 < 20) + { + xAdd = 10; + alpha = 200; + } else if (this.stScore[i].ctTimer.n迴セ蝨ィ縺ョ蛟、 < 30) + { + xAdd = -5; + alpha = 250; + } else if (this.stScore[i].ctTimer.n迴セ蝨ィ縺ョ蛟、 < 40) + { + xAdd = -9; + alpha = 256; + } else if (this.stScore[i].ctTimer.n迴セ蝨ィ縺ョ蛟、 < 50) + { + xAdd = -10; + alpha = 256; + } else if (this.stScore[i].ctTimer.n迴セ蝨ィ縺ョ蛟、 < 60) + { + xAdd = -9; + alpha = 256; + } else if (this.stScore[i].ctTimer.n迴セ蝨ィ縺ョ蛟、 < 70) + { + xAdd = -5; + alpha = 256; + } else if (this.stScore[i].ctTimer.n迴セ蝨ィ縺ョ蛟、 < 80) + { + xAdd = -3; + alpha = 256; + } else + { + xAdd = 0; + alpha = 256; + } + + + + if ( this.stScore[ i ].ctTimer.n迴セ蝨ィ縺ョ蛟、 > 120 ) + { + yAdd = -1; + } + if (this.stScore[i].ctTimer.n迴セ蝨ィ縺ョ蛟、 > 130) + { + yAdd = -5; + } + if (this.stScore[i].ctTimer.n迴セ蝨ィ縺ョ蛟、 > 140) + { + yAdd = -7; + } + if (this.stScore[i].ctTimer.n迴セ蝨ィ縺ョ蛟、 > 150) + { + yAdd = -8; + } + if (this.stScore[i].ctTimer.n迴セ蝨ィ縺ョ蛟、 > 160) + { + yAdd = -8; + alpha = 256; + } + if (this.stScore[i].ctTimer.n迴セ蝨ィ縺ョ蛟、 > 170) + { + yAdd = -6; + alpha = 256; + } + if (this.stScore[i].ctTimer.n迴セ蝨ィ縺ョ蛟、 > 180) + { + yAdd = 0; + alpha = 256; + } + if (this.stScore[i].ctTimer.n迴セ蝨ィ縺ョ蛟、 > 190) + { + yAdd = 5; + alpha = 200; + } + if (this.stScore[i].ctTimer.n迴セ蝨ィ縺ョ蛟、 > 200) + { + yAdd = 12; + alpha = 150; + } + if (this.stScore[i].ctTimer.n迴セ蝨ィ縺ョ蛟、 > 210) + { + yAdd = 20; + alpha = 0; + } + + + if ( this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョAddScore < 10 && this.stScore[ i ].bBonusScore == false ) + base.t蟆乗枚蟄苓。ィ遉コ(TJAPlayer3.Skin.Game_Score_Add_X[this.stScore[i].nPlayer] + xAdd, this.stScore[ i ].nPlayer == 0 ? TJAPlayer3.Skin.Game_Score_Add_Y[ this.stScore[ i ].nPlayer ] + yAdd : TJAPlayer3.Skin.Game_Score_Add_Y[ this.stScore[ i ].nPlayer ] - yAdd, string.Format( "{0,7:######0}", this.stScore[ i ].nAddScore ), this.stScore[ i ].nPlayer + 1 , alpha, stScore[i].nPlayer); + if( this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョAddScore < 10 && this.stScore[ i ].bBonusScore == true ) + base.t蟆乗枚蟄苓。ィ遉コ(TJAPlayer3.Skin.Game_Score_AddBonus_X[this.stScore[i].nPlayer] + xAdd, TJAPlayer3.Skin.Game_Score_AddBonus_Y[ this.stScore[ i ].nPlayer ], string.Format( "{0,7:######0}", this.stScore[ i ].nAddScore ), this.stScore[ i ].nPlayer + 1 , alpha, stScore[i].nPlayer); + else + { + this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョAddScore--; + this.stScore[ i ].b陦ィ遉コ荳ュ = false; + } + } + } + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(50, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.ct轤ケ謨ー繧「繝九Γ繧ソ繧、繝杣0].n迴セ蝨ィ縺ョ蛟、.ToString()); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(50, 20, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.ct轤ケ謨ー繧「繝九Γ繧ソ繧、繝杣0].b騾イ陦御クュ.ToString()); + } + + + //this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョ繧ケ繧ウ繧「.Taiko = (long)this.n迴セ蝨ィ縺ョ譛ャ蠖薙ョ繧ケ繧ウ繧「.Taiko; + + //string str = this.n迴セ蝨ィ陦ィ遉コ荳ュ縺ョ繧ケ繧ウ繧「.Taiko.ToString( "0000000" ); + //for ( int i = 0; i < 7; i++ ) + //{ + // Rectangle rectangle; + // char ch = str[i]; + // if( ch.Equals(' ') ) + // { + // rectangle = new Rectangle(0, 0, 24, 34); + // } + // else + // { + // int num4 = int.Parse(str.Substring(i, 1)); + // rectangle = new Rectangle(num4 * 24, 0, 24, 34); + // } + // if( base.txScore != null ) + // { + // base.txScore.t2D謠冗判(CDTXMania.app.Device, 20 + (i * 20), 192, rectangle); + // } + //} + + + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 50, 200, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, str ); + } + return 0; + } + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ケ繧ウ繧「繝ゥ繝ウ繧ッ.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ケ繧ウ繧「繝ゥ繝ウ繧ッ.cs new file mode 100644 index 00000000..4eb9a95c --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ケ繧ウ繧「繝ゥ繝ウ繧ッ.cs @@ -0,0 +1,88 @@ +サソusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using FDK; + +namespace TJAPlayer3 +{ + class CAct貍泌・愁rums繧ケ繧ウ繧「繝ゥ繝ウ繧ッ : CActivity + { + public override void On豢サ諤ァ蛹() + { + double RollTimems = 0; + foreach (var chip in TJAPlayer3.DTX.listChip) + { + if (chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 21 || chip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 22) + { + RollTimems += (chip.n繝弱シ繝邨ゆコ譎ょ綾ms - chip.n逋コ螢ー譎ょ綾ms) / 1000.0; + } + } + + this.ScoreRank = new int[] { 500000, 600000, 700000, 800000, 900000, 950000, + (int)(TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.nAddScoreNiji[0] * TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.nNoteCount[0]) + (int)(TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.nBalloonCount[0] * 100) + (int)(Math.Ceiling(RollTimems * 16.6 / 10) * 100 * 10)}; + + for(int i = 0; i < 7; i++) + { + this.counter[i] = new CCounter(); + } + base.On豢サ諤ァ蛹(); + } + + public override void On髱樊エサ諤ァ蛹() + { + base.On髱樊エサ諤ァ蛹(); + } + + public override int On騾イ陦梧緒逕サ() + { + if(TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Dan) + { + float x = 0; + for (int i = 0; i < 7; i++) + { + counter[i].t騾イ陦(); + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actScore.GetScore(0) >= ScoreRank[i]) + { + if (!this.counter[i].b騾イ陦御クュ) + { + this.counter[i].t髢句ァ(0, 3000, 1, TJAPlayer3.Timer); + } + if (counter[i].n迴セ蝨ィ縺ョ蛟、 <= 255) + { + TJAPlayer3.Tx.ScoreRank.Opacity = counter[i].n迴セ蝨ィ縺ョ蛟、; + x = 51 - (counter[i].n迴セ蝨ィ縺ョ蛟、 / 5.0f); + } + if (counter[i].n迴セ蝨ィ縺ョ蛟、 > 255 && counter[i].n迴セ蝨ィ縺ョ蛟、 <= 255 + 180) + { + TJAPlayer3.Tx.ScoreRank.Opacity = 255; + TJAPlayer3.Tx.ScoreRank.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f + (float)Math.Sin((counter[i].n迴セ蝨ィ縺ョ蛟、 - 255) * (Math.PI / 180)) * 0.2f; + TJAPlayer3.Tx.ScoreRank.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f + (float)Math.Sin((counter[i].n迴セ蝨ィ縺ョ蛟、 - 255) * (Math.PI / 180)) * 0.2f; + x = 0; + } + if (counter[i].n迴セ蝨ィ縺ョ蛟、 > 255 + 180 && counter[i].n迴セ蝨ィ縺ョ蛟、 <= 2745) + { + TJAPlayer3.Tx.ScoreRank.Opacity = 255; + TJAPlayer3.Tx.ScoreRank.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + TJAPlayer3.Tx.ScoreRank.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + x = 0; + } + if (counter[i].n迴セ蝨ィ縺ョ蛟、 >= 2745 && counter[i].n迴セ蝨ィ縺ョ蛟、 <= 3000) + { + TJAPlayer3.Tx.ScoreRank.Opacity = 255 - ((counter[i].n迴セ蝨ィ縺ョ蛟、 - 2745)); + x = -((counter[i].n迴セ蝨ィ縺ョ蛟、 - 2745) / 5.0f); + } + + TJAPlayer3.Tx.ScoreRank.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 87, 98 + (int)x, new System.Drawing.Rectangle(0, i == 0 ? i * 114 : i * 120, 140, i == 0 ? 114 : 120)); + } + } + } + + return base.On騾イ陦梧緒逕サ(); + } + + public int[] ScoreRank; + private CCounter[] counter = new CCounter[7]; + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ケ繝繝シ繧ソ繧ケ繝代ロ繝ォ.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ケ繝繝シ繧ソ繧ケ繝代ロ繝ォ.cs new file mode 100644 index 00000000..aad7b20a --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繧ケ繝繝シ繧ソ繧ケ繝代ロ繝ォ.cs @@ -0,0 +1,49 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; + +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rums繧ケ繝繝シ繧ソ繧ケ繝代ロ繝ォ : CAct貍泌・上せ繝繝シ繧ソ繧ケ繝代ロ繝ォ蜈ア騾 + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + public override void On豢サ諤ァ蛹() + { + + base.On豢サ諤ァ蛹(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + public override int On騾イ陦梧緒逕サ() + { + + + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繝√ャ繝励お繝輔ぉ繧ッ繝.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繝√ャ繝励お繝輔ぉ繧ッ繝.cs new file mode 100644 index 00000000..b0d2de6e --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繝√ャ繝励お繝輔ぉ繧ッ繝.cs @@ -0,0 +1,134 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Runtime.InteropServices; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rums繝√ャ繝励お繝輔ぉ繧ッ繝 : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CAct貍泌・愁rums繝√ャ繝励お繝輔ぉ繧ッ繝() + { + //base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // 繝。繧ス繝繝 + public virtual void Start(int nPlayer, int Lane) + { + if (TJAPlayer3.Tx.Gauge_Soul_Explosion != null) + { + for (int i = 0; i < 128; i++) + { + if (!st[i].b菴ソ逕ィ荳ュ) + { + st[i].b菴ソ逕ィ荳ュ = true; + st[i].ct騾イ陦 = new CCounter(0, TJAPlayer3.Skin.Game_Effect_NotesFlash[2], TJAPlayer3.Skin.Game_Effect_NotesFlash_Timer, TJAPlayer3.Timer); + st[i].ctChipEffect = new CCounter(0, 24, 17, TJAPlayer3.Timer); + st[i].n繝励Ξ繧、繝、繝シ = nPlayer; + st[i].Lane = Lane; + break; + } + } + } + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + for (int i = 0; i < 128; i++) + { + st[i] = new ST繝√ャ繝励お繝輔ぉ繧ッ繝 + { + b菴ソ逕ィ荳ュ = false, + ct騾イ陦 = new CCounter(), + ctChipEffect = new CCounter() + }; + } + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + for (int i = 0; i < 128; i++) + { + st[i].ct騾イ陦 = null; + st[i].ctChipEffect = null; + st[i].b菴ソ逕ィ荳ュ = false; + } + base.On髱樊エサ諤ァ蛹(); + } + public override int On騾イ陦梧緒逕サ() + { + for (int i = 0; i < 128; i++) + { + if (st[i].b菴ソ逕ィ荳ュ) + { + st[i].ct騾イ陦.t騾イ陦(); + st[i].ctChipEffect.t騾イ陦(); + if (st[i].ct騾イ陦.b邨ゆコ蛟、縺ォ驕斐@縺) + { + st[i].ct騾イ陦.t蛛懈ュ「(); + st[i].b菴ソ逕ィ荳ュ = false; + } + switch (st[i].n繝励Ξ繧、繝、繝シ) + { + case 0: + if (TJAPlayer3.Tx.Gauge_Soul_Explosion[0] != null) + TJAPlayer3.Tx.Gauge_Soul_Explosion[0].t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[0], TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[0], new Rectangle(st[i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 * TJAPlayer3.Skin.Game_Effect_NotesFlash[0], 0, TJAPlayer3.Skin.Game_Effect_NotesFlash[0], TJAPlayer3.Skin.Game_Effect_NotesFlash[1])); + if (this.st[i].ctChipEffect.n迴セ蝨ィ縺ョ蛟、 < 13) + TJAPlayer3.Tx.Notes.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[0], TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[0], new Rectangle(st[i].Lane * 130, 390, 130, 130)); + break; + + case 1: + if (TJAPlayer3.Tx.Gauge_Soul_Explosion[1] != null) + TJAPlayer3.Tx.Gauge_Soul_Explosion[1].t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[1], TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[1], new Rectangle(st[i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 * TJAPlayer3.Skin.Game_Effect_NotesFlash[0], 0, TJAPlayer3.Skin.Game_Effect_NotesFlash[0], TJAPlayer3.Skin.Game_Effect_NotesFlash[1])); + if (this.st[i].ctChipEffect.n迴セ蝨ィ縺ョ蛟、 < 13) + TJAPlayer3.Tx.Notes.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[1], TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[1], new Rectangle(st[i].Lane * 130, 390, 130, 130)); + break; + } + + if (this.st[i].ctChipEffect.n迴セ蝨ィ縺ョ蛟、 < 12) + { + TJAPlayer3.Tx.ChipEffect.color4 = new Color4(1.0f, 1.0f, 0.0f); + TJAPlayer3.Tx.ChipEffect.Opacity = (int)(this.st[i].ctChipEffect.n迴セ蝨ィ縺ョ蛟、 * (float)(225 / 11)); + TJAPlayer3.Tx.ChipEffect.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[st[i].n繝励Ξ繧、繝、繝シ], TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[st[i].n繝励Ξ繧、繝、繝シ], new Rectangle(st[i].Lane * 130, 0, 130, 130)); + } + if (this.st[i].ctChipEffect.n迴セ蝨ィ縺ョ蛟、 > 12 && this.st[i].ctChipEffect.n迴セ蝨ィ縺ョ蛟、 < 24) + { + TJAPlayer3.Tx.ChipEffect.color4 = new Color4(1.0f, 1.0f, 1.0f); + TJAPlayer3.Tx.ChipEffect.Opacity = 255 - (int)((this.st[i].ctChipEffect.n迴セ蝨ィ縺ョ蛟、 - 10) * (float)(255 / 14)); + TJAPlayer3.Tx.ChipEffect.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[st[i].n繝励Ξ繧、繝、繝シ], TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[st[i].n繝励Ξ繧、繝、繝シ], new Rectangle(st[i].Lane * 130, 0, 130, 130)); + } + } + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + //private CTexture[] txChara; + + [StructLayout(LayoutKind.Sequential)] + private struct ST繝√ャ繝励お繝輔ぉ繧ッ繝 + { + public bool b菴ソ逕ィ荳ュ; + public CCounter ct騾イ陦; + public CCounter ctChipEffect; + public int n繝励Ξ繧、繝、繝シ; + public int Lane; + } + private ST繝√ャ繝励お繝輔ぉ繧ッ繝[] st = new ST繝√ャ繝励お繝輔ぉ繧ッ繝[128]; + + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繝√ャ繝励ヵ繧。繧、繧「D.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繝√ャ繝励ヵ繧。繧、繧「D.cs new file mode 100644 index 00000000..2dd70757 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繝√ャ繝励ヵ繧。繧、繧「D.cs @@ -0,0 +1,500 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Runtime.InteropServices; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rums繝√ャ繝励ヵ繧。繧、繧「D : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CAct貍泌・愁rums繝√ャ繝励ヵ繧。繧、繧「D() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // 繝。繧ス繝繝 + + /// + /// 螟ァ髻ウ隨ヲ縺ョ闃ア轣ォ繧ィ繝輔ぉ繧ッ繝 + /// + /// + public virtual void Start( int nLane, int nPlayer ) + { + nY蠎ァ讓儕2 = new int[] { 548, 612, 670, 712, 730, 780, 725, 690, 640 }; + if( TJAPlayer3.Tx.Effects_Hit_FireWorks != null && TJAPlayer3.Tx.Effects_Hit_FireWorks != null ) + { + for (int i = 0; i < 9; i++) + { + for (int j = 0; j < 45; j++) + { + if (!this.st螟ァ髻ウ隨ヲ闃ア轣ォ[j].b菴ソ逕ィ荳ュ) + { + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[j].b菴ソ逕ィ荳ュ = true; + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[j].ct騾イ陦 = new CCounter(0, 40, 18, TJAPlayer3.Timer); // 繧ォ繧ヲ繝ウ繧ソ + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[j].fX = this.nX蠎ァ讓兌 i ]; //X蠎ァ讓 + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[j].fY = nPlayer == 0 ? this.nY蠎ァ讓兌 i ] : this.nY蠎ァ讓儕2[ i ]; + + switch(nLane) + { + case 0: + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[j].nColor = 0; + break; + case 1: + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[j].nColor = 1; + break; + } + + switch( i ) + { + case 0: + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ j ].n髢句ァ九ヵ繝ャ繝シ繝 = 0; + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ j ].n邨ゆコ繝輔Ξ繝シ繝 = 16; + break; + case 1: + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ j ].n髢句ァ九ヵ繝ャ繝シ繝 = 3; + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ j ].n邨ゆコ繝輔Ξ繝シ繝 = 19; + break; + case 2: + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ j ].n髢句ァ九ヵ繝ャ繝シ繝 = 6; + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ j ].n邨ゆコ繝輔Ξ繝シ繝 = 22; + break; + case 3: + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ j ].n髢句ァ九ヵ繝ャ繝シ繝 = 9; + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ j ].n邨ゆコ繝輔Ξ繝シ繝 = 25; + break; + case 4: + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ j ].n髢句ァ九ヵ繝ャ繝シ繝 = 12; + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ j ].n邨ゆコ繝輔Ξ繝シ繝 = 28; + break; + case 5: + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ j ].n髢句ァ九ヵ繝ャ繝シ繝 = 15; + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ j ].n邨ゆコ繝輔Ξ繝シ繝 = 31; + break; + case 6: + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ j ].n髢句ァ九ヵ繝ャ繝シ繝 = 18; + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ j ].n邨ゆコ繝輔Ξ繝シ繝 = 34; + break; + case 7: + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ j ].n髢句ァ九ヵ繝ャ繝シ繝 = 21; + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ j ].n邨ゆコ繝輔Ξ繝シ繝 = 37; + break; + case 8: + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ j ].n髢句ァ九ヵ繝ャ繝シ繝 = 24; + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ j ].n邨ゆコ繝輔Ξ繝シ繝 = 40; + break; + } + + + + break; + } + } + } + } + } + + public virtual void Start( int nLane, E蛻、螳 judge, int player ) + { + for (int j = 0; j < 3 * 4; j++) + { + if( !this.st迥カ諷擬 j ].b菴ソ逕ィ荳ュ ) + //for( int n = 0; n < 1; n++ ) + { + this.st迥カ諷擬 j ].b菴ソ逕ィ荳ュ = true; + //this.st迥カ諷擬 n ].ct騾イ陦 = new CCounter( 0, 9, 20, CDTXMania.Timer ); + this.st迥カ諷擬 j ].ct騾イ陦 = new CCounter( 0, 6, 25, TJAPlayer3.Timer ); + this.st迥カ諷擬 j ].judge = judge; + this.st迥カ諷擬 j ].nPlayer = player; + this.st迥カ諷祇螟ァ[ j ].nPlayer = player; + + switch( nLane ) + { + case 0x11: + case 0x12: + this.st迥カ諷擬 j ].nIsBig = 0; + break; + case 0x13: + case 0x14: + case 0x1A: + case 0x1B: + this.st迥カ諷祇螟ァ[ j ].ct騾イ陦 = new CCounter( 0, 9, 20, TJAPlayer3.Timer ); + this.st迥カ諷祇螟ァ[ j ].judge = judge; + this.st迥カ諷祇螟ァ[ j ].nIsBig = 1; + break; + } + break; + } + } + } + public void Start邏吝聖髮ェ() + { + return; + /* + if (this.tx邏吝聖髮ェ != null) + { + for (int i = 0; i < 256; i++) + { + for (int j = 0; j < 16; j++) + { + if (!this.st邏吝聖髮ェ[j].b菴ソ逕ィ荳ュ) + { + this.st邏吝聖髮ェ[j].b菴ソ逕ィ荳ュ = true; + int n蝗櫁サ「蛻晄悄蛟、 = CDTXMania.Random.Next(360); + int nX諡。謨」譁ケ蜷 = CDTXMania.Random.Next(10); + int n諡。謨」縺ョ螟ァ縺阪& = CDTXMania.Random.Next( 50, 1400 ); + int n驥榊鴨蜉騾 = CDTXMania.Random.Next( 6, 100 ); + double num7 = ( n諡。謨」縺ョ螟ァ縺阪& / 1000.0 ) + (1 / 100.0); // 諡。謨」縺ョ螟ァ縺阪& + //double num7 = 0.9 + ( ( (double) CDTXMania.Random.Next( 40 ) ) / 100.0 ); + this.st邏吝聖髮ェ[ j ].nGraphic = CDTXMania.Random.Next(3); + this.st邏吝聖髮ェ[ j ].nColor = CDTXMania.Random.Next(3); + this.st邏吝聖髮ェ[j].ct騾イ陦 = new CCounter(0, 500, 5, CDTXMania.Timer); // 繧ォ繧ヲ繝ウ繧ソ + this.st邏吝聖髮ェ[j].fX = 1000; //X蠎ァ讓(莉ョ) + + this.st邏吝聖髮ェ[j].fY = ((( 470 + (((float)Math.Sin((double)this.st邏吝聖髮ェ[j].f蜊雁セ)) * this.st邏吝聖髮ェ[j].f蜊雁セ)) )); //Y蠎ァ讓 + //this.st邏吝聖髮ェ[j].f蜉騾溷コヲX = (float)(num7 * Math.Cos((Math.PI * 2 * n蝗櫁サ「蛻晄悄蛟、) / 360.0)); + //this.st邏吝聖髮ェ[ j ].f蜉騾溷コヲX = (float)( ( num7 * Math.Cos((Math.PI * 2 * n蝗櫁サ「蛻晄悄蛟、) / 360.0)) > 0.005 ? Math.Abs( num7 * Math.Cos((Math.PI * 2 * n蝗櫁サ「蛻晄悄蛟、) / 360.0)) : num7 * Math.Cos((Math.PI * 2 * n蝗櫁サ「蛻晄悄蛟、) / 360.0) ); + this.st邏吝聖髮ェ[ j ].f蜉騾溷コヲX = (float)Math.Abs(num7 * Math.Cos((Math.PI * 2 * n蝗櫁サ「蛻晄悄蛟、) / 360.0)) - ( nX諡。謨」譁ケ蜷 / 20.0f ); + this.st邏吝聖髮ェ[j].f蜉騾溷コヲY = (float)-Math.Abs( num7 * (Math.Sin((Math.PI * 2 * n蝗櫁サ「蛻晄悄蛟、) / 360.0))) - 0.05f; + //this.st邏吝聖髮ェ[j].f蜉騾溷コヲY = (float)( num7 * (Math.Sin((Math.PI * 2 * n蝗櫁サ「蛻晄悄蛟、) / 360.0))) - 0.05f; + this.st邏吝聖髮ェ[j].f蜉騾溷コヲ縺ョ蜉騾溷コヲX = 1.009f + (float)(num7 / 1000); + this.st邏吝聖髮ェ[j].f蜉騾溷コヲ縺ョ蜉騾溷コヲY = 0.989f + (float)(num7 / 1000); + //this.st邏吝聖髮ェ[j].f驥榊鴨蜉騾溷コヲ = 0.0100f; + this.st邏吝聖髮ェ[j].f驥榊鴨蜉騾溷コヲ = n驥榊鴨蜉騾 / 10000.0f; + this.st邏吝聖髮ェ[j].f蜊雁セ = (float)(0.5 + (((double)CDTXMania.Random.Next(40)) / 100.0)); + + + break; + } + } + } + } */ + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + for( int i = 0; i < 3 * 4; i++ ) + { + this.st迥カ諷擬 i ].ct騾イ陦 = new CCounter(); + this.st迥カ諷擬 i ].b菴ソ逕ィ荳ュ = false; + this.st迥カ諷祇螟ァ[ i ].ct騾イ陦 = new CCounter(); + } + for( int i = 0; i < 256; i++ ) + { + this.st邏吝聖髮ェ[ i ] = new ST邏吝聖髮ェ(); + this.st邏吝聖髮ェ[ i ].b菴ソ逕ィ荳ュ = false; + this.st邏吝聖髮ェ[ i ].ct騾イ陦 = new CCounter(); + } + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + for( int i = 0; i < 3 * 4; i++ ) + { + this.st迥カ諷擬 i ].ct騾イ陦 = null; + this.st迥カ諷祇螟ァ[ i ].ct騾イ陦 = null; + } + for( int i = 0; i < 256; i++ ) + { + this.st邏吝聖髮ェ[ i ].ct騾イ陦 = null; + } + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + // this.tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Upper = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓植f( CSkin.Path( @"Graphics\7_explosion_upper.png" ) ); + // this.tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Upper_big = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_explosion_upper_big.png" ) ); + //if( this.tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Upper != null ) + //{ + // this.tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Upper.b蜉邂怜粋謌 = true; + //} + // this.tx螟ァ髻ウ隨ヲ闃ア轣ォ[0] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓植f( CSkin.Path( @"Graphics\7_explosion_bignotes_red.png" ) ); + // this.tx螟ァ髻ウ隨ヲ闃ア轣ォ[0].b蜉邂怜粋謌 = true; + // this.tx螟ァ髻ウ隨ヲ闃ア轣ォ[1] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓植f( CSkin.Path( @"Graphics\7_explosion_bignotes_blue.png" ) ); + // this.tx螟ァ髻ウ隨ヲ闃ア轣ォ[1].b蜉邂怜粋謌 = true; + //this.tx邏吝聖髮ェ = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_particle paper.png" ) ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Upper ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Upper_big ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx螟ァ髻ウ隨ヲ闃ア轣ォ[ 0 ] ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx螟ァ髻ウ隨ヲ闃ア轣ォ[ 1 ] ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx邏吝聖髮ェ ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + for( int i = 0; i < 3 * 4; i++ ) + { + if( this.st迥カ諷擬 i ].b菴ソ逕ィ荳ュ ) + { + if( !this.st迥カ諷擬 i ].ct騾イ陦.b蛛懈ュ「荳ュ ) + { + this.st迥カ諷擬 i ].ct騾イ陦.t騾イ陦(); + if( this.st迥カ諷擬 i ].ct騾イ陦.b邨ゆコ蛟、縺ォ驕斐@縺 ) + { + this.st迥カ諷擬 i ].ct騾イ陦.t蛛懈ュ「(); + this.st迥カ諷擬 i ].b菴ソ逕ィ荳ュ = false; + } + + // (When performing calibration, reduce visual distraction + // and current judgment feedback near the judgment position.) + if( TJAPlayer3.Tx.Effects_Hit_Explosion != null && !TJAPlayer3.IsPerformingCalibration ) + { + int n = this.st迥カ諷擬 i ].nIsBig == 1 ? 520 : 0; + int nX = ( TJAPlayer3.Skin.nScrollFieldX[ this.st迥カ諷擬 i ].nPlayer ] ) - ( (TJAPlayer3.Tx.Effects_Hit_Explosion.sz逕サ蜒上し繧、繧コ.Width / 7 ) / 2 ); + int nY = ( TJAPlayer3.Skin.nJudgePointY[ this.st迥カ諷擬 i ].nPlayer ] ) - ( (TJAPlayer3.Tx.Effects_Hit_Explosion.sz逕サ蜒上し繧、繧コ.Height / 4 ) / 2 ); + + switch( st迥カ諷擬 i ].judge ) + { + case E蛻、螳.Perfect: + case E蛻、螳.Great: + case E蛻、螳.Auto: + if (!this.st迥カ諷祇螟ァ[i].ct騾イ陦.b蛛懈ュ「荳ュ && TJAPlayer3.Tx.Effects_Hit_Explosion_Big != null && this.st迥カ諷祇螟ァ[i].nIsBig == 1) + TJAPlayer3.Tx.Effects_Hit_Explosion.t2D謠冗判(TJAPlayer3.app.Device, nX, nY, new Rectangle(this.st迥カ諷擬i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 * 260, n + 520, 260, 260)); + else + TJAPlayer3.Tx.Effects_Hit_Explosion.t2D謠冗判(TJAPlayer3.app.Device, nX, nY, new Rectangle(this.st迥カ諷擬i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 * 260, n, 260, 260)); + break; + case E蛻、螳.Good: + if (!this.st迥カ諷祇螟ァ[i].ct騾イ陦.b蛛懈ュ「荳ュ && TJAPlayer3.Tx.Effects_Hit_Explosion_Big != null && this.st迥カ諷祇螟ァ[i].nIsBig == 1) + TJAPlayer3.Tx.Effects_Hit_Explosion.t2D謠冗判( TJAPlayer3.app.Device, nX, nY, new Rectangle( this.st迥カ諷擬 i ].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 * 260, n + 780, 260, 260 ) ); + else + TJAPlayer3.Tx.Effects_Hit_Explosion.t2D謠冗判(TJAPlayer3.app.Device, nX, nY, new Rectangle(this.st迥カ諷擬i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 * 260, n + 260, 260, 260)); + break; + case E蛻、螳.Miss: + case E蛻、螳.Bad: + break; + } + } + } + } + } + + for( int i = 0; i < 3 * 4; i++ ) + { + if( !this.st迥カ諷祇螟ァ[ i ].ct騾イ陦.b蛛懈ュ「荳ュ ) + { + this.st迥カ諷祇螟ァ[ i ].ct騾イ陦.t騾イ陦(); + if( this.st迥カ諷祇螟ァ[ i ].ct騾イ陦.b邨ゆコ蛟、縺ォ驕斐@縺 ) + { + this.st迥カ諷祇螟ァ[ i ].ct騾イ陦.t蛛懈ュ「(); + } + if(TJAPlayer3.Tx.Effects_Hit_Explosion_Big != null && this.st迥カ諷祇螟ァ[ i ].nIsBig == 1 ) + { + + switch( st迥カ諷祇螟ァ[ i ].judge ) + { + case E蛻、螳.Perfect: + case E蛻、螳.Great: + case E蛻、螳.Auto: + if( this.st迥カ諷祇螟ァ[ i ].nIsBig == 1 ) + { + float fX = 415 - ((TJAPlayer3.Tx.Effects_Hit_Explosion_Big.sz逕サ蜒上し繧、繧コ.Width * TJAPlayer3.Tx.Effects_Hit_Explosion_Big.vc諡。螟ァ邵ョ蟆丞咲紫.X ) / 2.0f); + float fY = TJAPlayer3.Skin.nJudgePointY[ this.st迥カ諷祇螟ァ[ i ].nPlayer ] - ((TJAPlayer3.Tx.Effects_Hit_Explosion_Big.sz逕サ蜒上し繧、繧コ.Height * TJAPlayer3.Tx.Effects_Hit_Explosion_Big.vc諡。螟ァ邵ョ蟆丞咲紫.Y ) / 2.0f); + //float fY = 257 - ((this.tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Upper_big.sz逕サ蜒上し繧、繧コ.Height * this.tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Upper_big.vc諡。螟ァ邵ョ蟆丞咲紫.Y ) / 2.0f); + + ////7 + float f蛟咲紫 = 0.5f + ( (this.st迥カ諷祇螟ァ[ i ].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 * 0.5f) / 10.0f); + //this.tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Upper_big.vc諡。螟ァ邵ョ蟆丞咲紫.X = f蛟咲紫; + //this.tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Upper_big.vc諡。螟ァ邵ョ蟆丞咲紫.Y = f蛟咲紫; + //this.tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Upper_big.n騾乗主コヲ = (int)(255 * f蛟咲紫); + //this.tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Upper_big.t2D謠冗判( CDTXMania.app.Device, fX, fY ); + + Matrix mat = Matrix.Identity; + mat *= Matrix.Scaling( f蛟咲紫, f蛟咲紫, f蛟咲紫 ); + mat *= Matrix.Translation( TJAPlayer3.Skin.nScrollFieldX[0] - SampleFramework.GameWindowSize.Width / 2.0f, -(TJAPlayer3.Skin.nJudgePointY[ this.st迥カ諷擬 i ].nPlayer ] - SampleFramework.GameWindowSize.Height / 2.0f), 0f ); + //mat *= Matrix.Billboard( new Vector3( 15, 15, 15 ), new Vector3(0, 0, 0), new Vector3( 0, 0, 0 ), new Vector3( 0, 0, 0 ) ); + //mat *= Matrix.Translation( 0f, 0f, 0f ); + + + TJAPlayer3.Tx.Effects_Hit_Explosion_Big.Opacity = 255; + TJAPlayer3.Tx.Effects_Hit_Explosion_Big.t3D謠冗判( TJAPlayer3.app.Device, mat ); + } + break; + + case E蛻、螳.Good: + break; + + case E蛻、螳.Miss: + case E蛻、螳.Bad: + break; + } + } + } + } + + for (int i = 0; i < 45; i++) + { + if( TJAPlayer3.Skin.nScrollFieldX[0] != 414 ) + break; + + if (this.st螟ァ髻ウ隨ヲ闃ア轣ォ[i].b菴ソ逕ィ荳ュ) + { + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[i].n蜑榊屓縺ョValue = this.st螟ァ髻ウ隨ヲ闃ア轣ォ[i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、; + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[i].ct騾イ陦.t騾イ陦(); + if (this.st螟ァ髻ウ隨ヲ闃ア轣ォ[i].ct騾イ陦.b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[i].ct騾イ陦.t蛛懈ュ「(); + this.st螟ァ髻ウ隨ヲ闃ア轣ォ[i].b菴ソ逕ィ荳ュ = false; + } + Matrix mat = Matrix.Identity; + + mat *= Matrix.Translation(this.st螟ァ髻ウ隨ヲ闃ア轣ォ[i].fX - SampleFramework.GameWindowSize.Width / 2, -(this.st螟ァ髻ウ隨ヲ闃ア轣ォ[i].fY - SampleFramework.GameWindowSize.Height / 2), 0f); + float fX = this.st螟ァ髻ウ隨ヲ闃ア轣ォ[i].fX - ( 192 / 2 ); + float fY = this.st螟ァ髻ウ隨ヲ闃ア轣ォ[i].fY - ( 192 / 2 ); + + //if(CDTXMania.Tx.Effects_Hit_FireWorks[ 0 ] != null && this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ i ].nColor == 0 ) + //{ + // if( this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ i ].n髢句ァ九ヵ繝ャ繝シ繝 <= this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ i ].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 && this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ i ].n邨ゆコ繝輔Ξ繝シ繝 > this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ i ].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 ) + // { + // //this.tx螟ァ髻ウ隨ヲ闃ア轣ォ[ 0 ].t3D謠冗判(CDTXMania.app.Device, mat, new Rectangle( ( this.st螟ァ髻ウ隨ヲ闃ア轣ォ[i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 - this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ i ].n髢句ァ九ヵ繝ャ繝シ繝 ) * 192, 0, 192, 192 )); + // //this.tx螟ァ髻ウ隨ヲ闃ア轣ォ[ 0 ].t3D謠冗判( CDTXMania.app.Device, mat, fX, fY, new Rectangle( ( this.st螟ァ髻ウ隨ヲ闃ア轣ォ[i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 - this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ i ].n髢句ァ九ヵ繝ャ繝シ繝 ) * 192, 0, 192, 192 ) ); + // CDTXMania.Tx.Effects_Hit_FireWorks[ 0 ].t2D謠冗判( CDTXMania.app.Device, (int)fX, (int)fY, new Rectangle( ( this.st螟ァ髻ウ隨ヲ闃ア轣ォ[i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 - this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ i ].n髢句ァ九ヵ繝ャ繝シ繝 ) * 192, 0, 192, 192 ) ); + // } + //} + ////if(CDTXMania.Tx.Effects_Hit_FireWorks[ 1 ] != null && this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ i ].nColor == 1 ) + //{ + // if( this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ i ].n髢句ァ九ヵ繝ャ繝シ繝 <= this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ i ].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 && this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ i ].n邨ゆコ繝輔Ξ繝シ繝 > this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ i ].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 ) + // { + // //this.tx螟ァ髻ウ隨ヲ闃ア轣ォ[ 1 ].t3D謠冗判( CDTXMania.app.Device, mat, fX, fY, ); + // //CDTXMania.Tx.Effects_Hit_FireWorks[ 1 ].t2D謠冗判( CDTXMania.app.Device, (int)fX, (int)fY, new Rectangle( ( this.st螟ァ髻ウ隨ヲ闃ア轣ォ[i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 - this.st螟ァ髻ウ隨ヲ闃ア轣ォ[ i ].n髢句ァ九ヵ繝ャ繝シ繝 ) * 192, 0, 192, 192 ) ); + // } + //} + } + + } + + for (int i = 0; i < 256; i++) + { + if (this.st邏吝聖髮ェ[i].b菴ソ逕ィ荳ュ) + { + this.st邏吝聖髮ェ[i].n蜑榊屓縺ョValue = this.st邏吝聖髮ェ[i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、; + this.st邏吝聖髮ェ[i].ct騾イ陦.t騾イ陦(); + if (this.st邏吝聖髮ェ[i].ct騾イ陦.b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.st邏吝聖髮ェ[i].ct騾イ陦.t蛛懈ュ「(); + this.st邏吝聖髮ェ[i].b菴ソ逕ィ荳ュ = false; + } + else if( this.st邏吝聖髮ェ[ i ].fX > 1300 || this.st邏吝聖髮ェ[ i ].fX < -20 ) + { + this.st邏吝聖髮ェ[i].ct騾イ陦.t蛛懈ュ「(); + this.st邏吝聖髮ェ[i].b菴ソ逕ィ荳ュ = false; + } + for (int n = this.st邏吝聖髮ェ[i].n蜑榊屓縺ョValue; n < this.st邏吝聖髮ェ[i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、; n++) + { + this.st邏吝聖髮ェ[i].fX -= this.st邏吝聖髮ェ[i].f蜉騾溷コヲX; + this.st邏吝聖髮ェ[i].fY -= this.st邏吝聖髮ェ[i].f蜉騾溷コヲY; + this.st邏吝聖髮ェ[i].f蜉騾溷コヲX *= this.st邏吝聖髮ェ[i].f蜉騾溷コヲ縺ョ蜉騾溷コヲX; + this.st邏吝聖髮ェ[i].f蜉騾溷コヲY *= this.st邏吝聖髮ェ[i].f蜉騾溷コヲ縺ョ蜉騾溷コヲY; + this.st邏吝聖髮ェ[i].f蜉騾溷コヲY -= this.st邏吝聖髮ェ[i].f驥榊鴨蜉騾溷コヲ; + } + Matrix mat = Matrix.Identity; + + float x = (float)(this.st邏吝聖髮ェ[i].f蜊雁セ * Math.Cos((Math.PI / 2 * this.st邏吝聖髮ェ[i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、) / 100.0)) * 2.3f; + mat *= Matrix.Scaling(x, x, 1f); + mat *= Matrix.Translation(this.st邏吝聖髮ェ[i].fX - SampleFramework.GameWindowSize.Width / 2, -(this.st邏吝聖髮ェ[i].fY - SampleFramework.GameWindowSize.Height / 2), 0f); + + /*if (this.tx邏吝聖髮ェ != null) + { + this.tx邏吝聖髮ェ.t3D謠冗判(CDTXMania.app.Device, mat, new Rectangle( 32 * this.st邏吝聖髮ェ[ i ].nGraphic, 32 * this.st邏吝聖髮ェ[ i ].nColor, 32, 32 )); + + } */ + } + + } + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + //private CTextureAf tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Upper; + //private CTexture tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Upper_big; + //private CTextureAf[] tx螟ァ髻ウ隨ヲ闃ア轣ォ = new CTextureAf[2]; + //private CTexture tx邏吝聖髮ェ; + + protected STSTATUS[] st迥カ諷 = new STSTATUS[ 3 * 4 ]; + protected STSTATUS_B[] st迥カ諷祇螟ァ = new STSTATUS_B[ 3 * 4 ]; + private ST螟ァ髻ウ隨ヲ闃ア轣ォ[] st螟ァ髻ウ隨ヲ闃ア轣ォ = new ST螟ァ髻ウ隨ヲ闃ア轣ォ[45]; + + protected int[] nX蠎ァ讓 = new int[] { 450, 521, 596, 686, 778, 863, 970, 1070, 1150 }; + protected int[] nY蠎ァ讓 = new int[] { 172, 108, 50, 8, -10, -60, -5, 30, 90 }; + protected int[] nY蠎ァ讓儕2 = new int[] { 172, 108, 50, 8, -10, -60, -5, 30, 90 }; + + [StructLayout(LayoutKind.Sequential)] + protected struct STSTATUS + { + public bool b菴ソ逕ィ荳ュ; + public CCounter ct騾イ陦; + public E蛻、螳 judge; + public int nIsBig; + public int n騾乗主コヲ; + public int nPlayer; + } + [StructLayout(LayoutKind.Sequential)] + protected struct STSTATUS_B + { + public CCounter ct騾イ陦; + public E蛻、螳 judge; + public int nIsBig; + public int n騾乗主コヲ; + public int nPlayer; + } + + [StructLayout(LayoutKind.Sequential)] + private struct ST螟ァ髻ウ隨ヲ闃ア轣ォ + { + public int nColor; + public bool b菴ソ逕ィ荳ュ; + public CCounter ct騾イ陦; + public int n蜑榊屓縺ョValue; + public float fX; + public float fY; + public int n髢句ァ九ヵ繝ャ繝シ繝; + public int n邨ゆコ繝輔Ξ繝シ繝; + } + + private ST邏吝聖髮ェ[] st邏吝聖髮ェ = new ST邏吝聖髮ェ[ 256 ]; + [StructLayout( LayoutKind.Sequential )] + private struct ST邏吝聖髮ェ + { + public int nGraphic; + public int nColor; + public bool b菴ソ逕ィ荳ュ; + public CCounter ct騾イ陦; + public int n蜑榊屓縺ョValue; + public float fX; + public float fY; + public float f蜉騾溷コヲX; + public float f蜉騾溷コヲY; + public float f蜉騾溷コヲ縺ョ蜉騾溷コヲX; + public float f蜉騾溷コヲ縺ョ蜉騾溷コヲY; + public float f驥榊鴨蜉騾溷コヲ; + public float f蜊雁セ; + public float f隗貞コヲ; + } + //----------------- + #endregion + } +} +縲 diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繝代ャ繝.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繝代ャ繝.cs new file mode 100644 index 00000000..e16aef0c --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繝代ャ繝.cs @@ -0,0 +1,219 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rums繝代ャ繝 : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CAct貍泌・愁rums繝代ャ繝() + { + ST蝓コ譛ャ菴咲スョ[] st蝓コ譛ャ菴咲スョArray = new ST蝓コ譛ャ菴咲スョ[ 10 ]; + + //LC + ST蝓コ譛ャ菴咲スョ st蝓コ譛ャ菴咲スョ = new ST蝓コ譛ャ菴咲スョ(); + st蝓コ譛ャ菴咲スョ.x = 263; + st蝓コ譛ャ菴咲スョ.y = 10; + st蝓コ譛ャ菴咲スョ.rc = new Rectangle( 0, 0, 0x60, 0x60 ); + st蝓コ譛ャ菴咲スョArray[ 0 ] = st蝓コ譛ャ菴咲スョ; + + //HH + ST蝓コ譛ャ菴咲スョ st蝓コ譛ャ菴咲スョ2 = new ST蝓コ譛ャ菴咲スョ(); + st蝓コ譛ャ菴咲スョ2.x = 336; + st蝓コ譛ャ菴咲スョ2.y = 10; + st蝓コ譛ャ菴咲スョ2.rc = new Rectangle( 0x60, 0, 0x60, 0x60 ); + st蝓コ譛ャ菴咲スョArray[ 1 ] = st蝓コ譛ャ菴咲スョ2; + + //SD + ST蝓コ譛ャ菴咲スョ st蝓コ譛ャ菴咲スョ3 = new ST蝓コ譛ャ菴咲スョ(); + st蝓コ譛ャ菴咲スョ3.x = 446; + st蝓コ譛ャ菴咲スョ3.y = 10; + st蝓コ譛ャ菴咲スョ3.rc = new Rectangle( 0, 0x60, 0x60, 0x60 ); + st蝓コ譛ャ菴咲スョArray[ 2 ] = st蝓コ譛ャ菴咲スョ3; + + //BD + ST蝓コ譛ャ菴咲スョ st蝓コ譛ャ菴咲スョ4 = new ST蝓コ譛ャ菴咲スョ(); + st蝓コ譛ャ菴咲スョ4.x = 565; + st蝓コ譛ャ菴咲スョ4.y = 10; + st蝓コ譛ャ菴咲スョ4.rc = new Rectangle( 0, 0xc0, 0x60, 0x60); + st蝓コ譛ャ菴咲スョArray[ 3 ] = st蝓コ譛ャ菴咲スョ4; + + //HT + ST蝓コ譛ャ菴咲スョ st蝓コ譛ャ菴咲スョ5 = new ST蝓コ譛ャ菴咲スョ(); + st蝓コ譛ャ菴咲スョ5.x = 510; + st蝓コ譛ャ菴咲スョ5.y = 10; + st蝓コ譛ャ菴咲スョ5.rc = new Rectangle( 0x60, 0x60, 0x60, 0x60 ); + st蝓コ譛ャ菴咲スョArray[ 4 ] = st蝓コ譛ャ菴咲スョ5; + + //LT + ST蝓コ譛ャ菴咲スョ st蝓コ譛ャ菴咲スョ6 = new ST蝓コ譛ャ菴咲スョ(); + st蝓コ譛ャ菴咲スョ6.x = 622; + st蝓コ譛ャ菴咲スョ6.y = 10; + st蝓コ譛ャ菴咲スョ6.rc = new Rectangle( 0xc0, 0x60, 0x60, 0x60 ); + st蝓コ譛ャ菴咲スョArray[ 5 ] = st蝓コ譛ャ菴咲スョ6; + + //FT + ST蝓コ譛ャ菴咲スョ st蝓コ譛ャ菴咲スョ7 = new ST蝓コ譛ャ菴咲スョ(); + st蝓コ譛ャ菴咲スョ7.x = 672; + st蝓コ譛ャ菴咲スョ7.y = 10; + st蝓コ譛ャ菴咲スョ7.rc = new Rectangle( 288, 0x60, 0x60, 0x60 ); + st蝓コ譛ャ菴咲スョArray[ 6 ] = st蝓コ譛ャ菴咲スョ7; + + //CY + ST蝓コ譛ャ菴咲スョ st蝓コ譛ャ菴咲スョ8 = new ST蝓コ譛ャ菴咲スョ(); + st蝓コ譛ャ菴咲スョ8.x = 0x2df; + st蝓コ譛ャ菴咲スョ8.y = 10; + st蝓コ譛ャ菴咲スョ8.rc = new Rectangle( 0xc0, 0, 0x60, 0x60 ); + st蝓コ譛ャ菴咲スョArray[ 7 ] = st蝓コ譛ャ菴咲スョ8; + + //RD + ST蝓コ譛ャ菴咲スョ st蝓コ譛ャ菴咲スョ9 = new ST蝓コ譛ャ菴咲スョ(); + st蝓コ譛ャ菴咲スョ9.x = 0x317; + st蝓コ譛ャ菴咲スョ9.y = 10; + st蝓コ譛ャ菴咲スョ9.rc = new Rectangle( 288, 0, 0x60, 0x60 ); + st蝓コ譛ャ菴咲スョArray[ 8 ] = st蝓コ譛ャ菴咲スョ9; + + //LP + ST蝓コ譛ャ菴咲スョ st蝓コ譛ャ菴咲スョ10 = new ST蝓コ譛ャ菴咲スョ(); + st蝓コ譛ャ菴咲スョ10.x = 0x18c; + st蝓コ譛ャ菴咲スョ10.y = 10; + st蝓コ譛ャ菴咲スョ10.rc = new Rectangle( 0x60, 0xc0, 0x60, 0x60); + st蝓コ譛ャ菴咲スョArray[ 9 ] = st蝓コ譛ャ菴咲スョ10; + + this.st蝓コ譛ャ菴咲スョ = st蝓コ譛ャ菴咲スョArray; + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // 繝。繧ス繝繝 + + public void Hit( int nLane ) + { + this.st繝代ャ繝臥憾諷擬 nLane ].n譏弱k縺 = 6; + this.st繝代ャ繝臥憾諷擬 nLane ].nY蠎ァ讓吝刈騾溷コヲdot = 2; + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + this.n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝 = -1; + this.nY蠎ァ讓吝宛蠕。繧ソ繧、繝 = -1; + for( int i = 0; i < 9; i++ ) + { + ST繝代ャ繝臥憾諷 st繝代ャ繝臥憾諷2 = new ST繝代ャ繝臥憾諷(); + ST繝代ャ繝臥憾諷 st繝代ャ繝臥憾諷 = st繝代ャ繝臥憾諷2; + st繝代ャ繝臥憾諷.nY蠎ァ讓吶が繝輔そ繝繝dot = 0; + st繝代ャ繝臥憾諷.nY蠎ァ讓吝刈騾溷コヲdot = 0; + st繝代ャ繝臥憾諷.n譏弱k縺 = 0; + this.st繝代ャ繝臥憾諷擬 i ] = st繝代ャ繝臥憾諷; + } + base.On豢サ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + if( base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + this.n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝 = (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + this.nY蠎ァ讓吝宛蠕。繧ソ繧、繝 = (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + long num = (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + if ( num < this.n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝 ) + { + this.n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝 = num; + } + while( ( num - this.n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝 ) >= 15 ) + { + for( int j = 0; j < 10; j++ ) + { + if( this.st繝代ャ繝臥憾諷擬 j ].n譏弱k縺 > 0 ) + { + this.st繝代ャ繝臥憾諷擬 j ].n譏弱k縺--; + } + } + this.n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝 += 15; + } + long num3 = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾; + if( num3 < this.nY蠎ァ讓吝宛蠕。繧ソ繧、繝 ) + { + this.nY蠎ァ讓吝宛蠕。繧ソ繧、繝 = num3; + } + while( ( num3 - this.nY蠎ァ讓吝宛蠕。繧ソ繧、繝 ) >= 5 ) + { + for( int k = 0; k < 10; k++ ) + { + this.st繝代ャ繝臥憾諷擬 k ].nY蠎ァ讓吶が繝輔そ繝繝dot += this.st繝代ャ繝臥憾諷擬 k ].nY蠎ァ讓吝刈騾溷コヲdot; + if( this.st繝代ャ繝臥憾諷擬 k ].nY蠎ァ讓吶が繝輔そ繝繝dot > 15 ) + { + this.st繝代ャ繝臥憾諷擬 k ].nY蠎ァ讓吶が繝輔そ繝繝dot = 15; + this.st繝代ャ繝臥憾諷擬 k ].nY蠎ァ讓吝刈騾溷コヲdot = -1; + } + else if( this.st繝代ャ繝臥憾諷擬 k ].nY蠎ァ讓吶が繝輔そ繝繝dot < 0 ) + { + this.st繝代ャ繝臥憾諷擬 k ].nY蠎ァ讓吶が繝輔そ繝繝dot = 0; + this.st繝代ャ繝臥憾諷擬 k ].nY蠎ァ讓吝刈騾溷コヲdot = 0; + } + } + this.nY蠎ァ讓吝宛蠕。繧ソ繧、繝 += 5; + } + + + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + [StructLayout( LayoutKind.Sequential )] + private struct ST繝代ャ繝臥憾諷 + { + public int n譏弱k縺; + public int nY蠎ァ讓吶が繝輔そ繝繝dot; + public int nY蠎ァ讓吝刈騾溷コヲdot; + } + [StructLayout( LayoutKind.Sequential )] + private struct ST蝓コ譛ャ菴咲スョ + { + public int x; + public int y; + public Rectangle rc; + } + + private long nY蠎ァ讓吝宛蠕。繧ソ繧、繝; + private long n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝; + private readonly int[] n謠冗判鬆 = new int[] { 9, 3, 2, 6, 5, 4, 8, 7, 1, 0 }; + // LP BD SD FT HT LT RD CY HH LC + private ST繝代ャ繝臥憾諷擬] st繝代ャ繝臥憾諷 = new ST繝代ャ繝臥憾諷擬 10 ]; + private readonly ST蝓コ譛ャ菴咲スョ[] st蝓コ譛ャ菴咲スョ; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繝ャ繝シ繝ウ.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繝ャ繝シ繝ウ.cs new file mode 100644 index 00000000..7f53a308 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繝ャ繝シ繝ウ.cs @@ -0,0 +1,191 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rums繝ャ繝シ繝ウ : CActivity + { + public CAct貍泌・愁rums繝ャ繝シ繝ウ() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + public override void On豢サ諤ァ蛹() + { + base.On豢サ諤ァ蛹(); + } + + public override void On髱樊エサ諤ァ蛹() + { + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k( ref this.ct蛻蟯舌い繝九Γ騾イ陦 ); + base.On髱樊エサ諤ァ蛹(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + //this.tx譎ョ騾夊ュ憺擇[ 0 ] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_field_normal_base.png")); + //this.tx邇莠コ隴憺擇[ 0 ] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_field_expert_base.png")); + //this.tx驕比ココ隴憺擇[ 0 ] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_field_master_base.png")); + //this.tx譎ョ騾夊ュ憺擇[ 1 ] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_field_normal.png")); + //this.tx邇莠コ隴憺擇[ 1 ] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_field_expert.png")); + //this.tx驕比ココ隴憺擇[ 1 ] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_field_master.png")); + this.ct蛻蟯舌い繝九Γ騾イ陦 = new CCounter[ 4 ]; + this.nBefore = new CDTX.ECourse[ 4 ]; + this.nAfter = new CDTX.ECourse[ 4 ]; + for ( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) + { + this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ] = new CCounter(); + this.nBefore = new CDTX.ECourse[ 4 ]; + this.nAfter = new CDTX.ECourse[ 4 ]; + this.bState[ i ] = false; + } + TJAPlayer3.Tx.Lane_Base[0].Opacity = 255; + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx譎ョ騾夊ュ憺擇[ 0 ] ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx邇莠コ隴憺擇[ 0 ] ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx驕比ココ隴憺擇[ 0 ] ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx譎ョ騾夊ュ憺擇[ 1 ] ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx邇莠コ隴憺擇[ 1 ] ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx驕比ココ隴憺擇[ 1 ] ); + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + public override int On騾イ陦梧緒逕サ() + { + for( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) + { + if( !this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].b蛛懈ュ「荳ュ ) + { + this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].t騾イ陦(); + if( this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].b邨ゆコ蛟、縺ォ驕斐@縺 ) + { + this.bState[ i ] = false; + this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].t蛛懈ュ「(); + } + } + } + + + //繧「繝九Γ繝シ繧キ繝ァ繝ウ荳ュ縺ョ蛻蟯舌Ξ繧、繝、繝シ(閭梧勹)縺ョ謠冗判繧定。後≧縲 + for( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) + { + if( TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bUseBranch[ i ] == true ) + { + if( this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].b騾イ陦御クュ ) + { + #region[ 譎ョ騾夊ュ憺擇_繝ャ繝吶Ν繧「繝繝 ] + //譎ョ騾壺堤私莠コ + if (nBefore[i] == 0 && nAfter[i] == CDTX.ECourse.eNormal) + { + TJAPlayer3.Tx.Lane_Base[1].Opacity = this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 > 100 ? 255 : ( ( this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 * 0xff ) / 100 ); + TJAPlayer3.Tx.Lane_Base[0].t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[ i ], TJAPlayer3.Skin.nScrollFieldY[ i ] ); + TJAPlayer3.Tx.Lane_Base[1].t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[ i ], TJAPlayer3.Skin.nScrollFieldY[ i ] ); + } + //譎ョ騾壺帝#莠コ + if (nBefore[i] == 0 && nAfter[i] == CDTX.ECourse.eMaster) + { + TJAPlayer3.Tx.Lane_Base[0].t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[ i ], TJAPlayer3.Skin.nScrollFieldY[ i ] ); + if( this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 < 100 ) + { + TJAPlayer3.Tx.Lane_Base[1].Opacity = this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 > 100 ? 255 : ( ( this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 * 0xff ) / 100 ); + TJAPlayer3.Tx.Lane_Base[1].t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[ i ], TJAPlayer3.Skin.nScrollFieldY[ i ] ); + } + else if( this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 >= 100 && this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 < 150 ) + { + TJAPlayer3.Tx.Lane_Base[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Base[1].t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[ i ], TJAPlayer3.Skin.nScrollFieldY[ i ] ); + } + else if( this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 >= 150 ) + { + TJAPlayer3.Tx.Lane_Base[1].t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[ i ], TJAPlayer3.Skin.nScrollFieldY[ i ] ); + TJAPlayer3.Tx.Lane_Base[2].Opacity = this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 > 250 ? 255 : ( ( (this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 - 150) * 0xff ) / 100 ); + TJAPlayer3.Tx.Lane_Base[2].t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[ i ], TJAPlayer3.Skin.nScrollFieldY[ i ] ); + } + } + #endregion + #region[ 邇莠コ隴憺擇_繝ャ繝吶Ν繧「繝繝 ] + if (nBefore[i] == CDTX.ECourse.eExpert && nAfter[i] == CDTX.ECourse.eMaster) + { + TJAPlayer3.Tx.Lane_Base[1].t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[ i ], TJAPlayer3.Skin.nScrollFieldY[ i ] ); + TJAPlayer3.Tx.Lane_Base[2].Opacity = this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 > 100 ? 255 : ( ( this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 * 0xff ) / 100 ); + TJAPlayer3.Tx.Lane_Base[2].t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[ i ], TJAPlayer3.Skin.nScrollFieldY[ i ] ); + } + #endregion + #region[ 邇莠コ隴憺擇_繝ャ繝吶Ν繝繧ヲ繝ウ ] + if (nBefore[i] == CDTX.ECourse.eExpert && nAfter[i] == CDTX.ECourse.eNormal) + { + TJAPlayer3.Tx.Lane_Base[1].t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[ i ], TJAPlayer3.Skin.nScrollFieldY[ i ] ); + TJAPlayer3.Tx.Lane_Base[0].Opacity = this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 > 100 ? 255 : ( ( this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 * 0xff ) / 100 ); + TJAPlayer3.Tx.Lane_Base[0].t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[ i ], TJAPlayer3.Skin.nScrollFieldY[ i ] ); + } + #endregion + #region[ 驕比ココ隴憺擇_繝ャ繝吶Ν繝繧ヲ繝ウ ] + if (nBefore[i] == CDTX.ECourse.eMaster && nAfter[i] == CDTX.ECourse.eNormal) + { + TJAPlayer3.Tx.Lane_Base[2].t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[ i ], TJAPlayer3.Skin.nScrollFieldY[ i ] ); + if( this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 < 100 ) + { + TJAPlayer3.Tx.Lane_Base[1].Opacity = this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 > 100 ? 255 : ( ( this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 * 0xff ) / 100 ); + TJAPlayer3.Tx.Lane_Base[1].t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[ i ], TJAPlayer3.Skin.nScrollFieldY[ i ] ); + } + else if( this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 >= 100 && this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 < 150 ) + { + TJAPlayer3.Tx.Lane_Base[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Base[1].t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[ i ], TJAPlayer3.Skin.nScrollFieldY[ i ] ); + } + else if( this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 >= 150 ) + { + TJAPlayer3.Tx.Lane_Base[1].t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[ i ], TJAPlayer3.Skin.nScrollFieldY[ i ] ); + TJAPlayer3.Tx.Lane_Base[0].Opacity = this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 > 250 ? 255 : ( ( ( this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 - 150 ) * 0xff ) / 100 ); + TJAPlayer3.Tx.Lane_Base[0].t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[ i ], TJAPlayer3.Skin.nScrollFieldY[ i ] ); + } + } + if (nBefore[i] == CDTX.ECourse.eMaster && nAfter[i] == CDTX.ECourse.eExpert) + { + TJAPlayer3.Tx.Lane_Base[2].t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[ i ], TJAPlayer3.Skin.nScrollFieldY[ i ] ); + TJAPlayer3.Tx.Lane_Base[2].Opacity = this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 > 100 ? 255 : ( ( this.ct蛻蟯舌い繝九Γ騾イ陦啓 i ].n迴セ蝨ィ縺ョ蛟、 * 0xff ) / 100 ); + TJAPlayer3.Tx.Lane_Base[2].t2D謠冗判( TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[ i ], TJAPlayer3.Skin.nScrollFieldY[ i ] ); + } + #endregion + } + } + } + return base.On騾イ陦梧緒逕サ(); + } + + public virtual void t蛻蟯舌Ξ繧、繝、繝シ_繧ウ繝シ繧ケ螟牙喧(CDTX.ECourse n迴セ蝨ィ, CDTX.ECourse n谺。蝗, int player) + { + if ( n迴セ蝨ィ == n谺。蝗 ) { + return; + } + this.ct蛻蟯舌い繝九Γ騾イ陦啓 player ] = new CCounter( 0, 300, 2, TJAPlayer3.Timer ); + this.bState[ player ] = true; + + this.nBefore[ player ] = n迴セ蝨ィ; + this.nAfter[ player ] = n谺。蝗; + + } + + #region[ private ] + //----------------- + public bool[] bState = new bool[4]; + public CCounter[] ct蛻蟯舌い繝九Γ騾イ陦 = new CCounter[4]; + private CDTX.ECourse[] nBefore; + private CDTX.ECourse[] nAfter; + private int[] n騾乗主コヲ = new int[4]; + //private CTexture[] tx譎ョ騾夊ュ憺擇 = new CTexture[2]; + //private CTexture[] tx邇莠コ隴憺擇 = new CTexture[2]; + //private CTexture[] tx驕比ココ隴憺擇 = new CTexture[2]; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繝ャ繝シ繝ウ繝輔Λ繝繧キ繝・GB.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繝ャ繝シ繝ウ繝輔Λ繝繧キ繝・GB.cs new file mode 100644 index 00000000..141804c8 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繝ャ繝シ繝ウ繝輔Λ繝繧キ繝・GB.cs @@ -0,0 +1,29 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rums繝ャ繝シ繝ウ繝輔Λ繝繧キ繝・GB : CAct貍泌・上Ξ繝シ繝ウ繝輔Λ繝繧キ繝・GB蜈ア騾 + { + // CActivity 螳溯」シ亥ア騾壹け繝ゥ繧ケ縺九i縺ョ蟾ョ蛻縺ョ縺ソシ + + public override int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繝ャ繝シ繝ウ螟ェ鮠.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繝ャ繝シ繝ウ螟ェ鮠.cs new file mode 100644 index 00000000..89a3854c --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums繝ャ繝シ繝ウ螟ェ鮠.cs @@ -0,0 +1,1027 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Runtime.InteropServices; +using System.Diagnostics; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rums繝ャ繝シ繝ウ螟ェ鮠 : CActivity + { + /// + /// 繝ャ繝シ繝ウ繧呈緒逕サ縺吶k繧ッ繝ゥ繧ケ縲 + /// + /// + /// + public CAct貍泌・愁rums繝ャ繝シ繝ウ螟ェ鮠() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + public override void On豢サ諤ァ蛹() + { + for (int i = 0; i < 4; i++) + { + this.st迥カ諷擬i].ct騾イ陦 = new CCounter(); + this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦 = new CCounter(); + this.stBranch[i].n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝 = -1; + this.stBranch[i].nBranch繝ャ繧、繝、繝シ騾乗主コヲ = 0; + this.stBranch[i].nBranch譁蟄鈴乗主コヲ = 0; + this.stBranch[i].nY蠎ァ讓 = 0; + } + this.ct繧エ繝シ繧エ繝シ = new CCounter(); + + + this.n邱冗ァサ蜍墓凾髢 = -1; + this.n邱冗ァサ蜍墓凾髢2 = -1; + this.nDefaultJudgePos[0, 0] = TJAPlayer3.Skin.nScrollFieldX[0]; + this.nDefaultJudgePos[0, 1] = TJAPlayer3.Skin.nScrollFieldY[0]; + this.nDefaultJudgePos[1, 0] = TJAPlayer3.Skin.nScrollFieldX[1]; + this.nDefaultJudgePos[1, 1] = TJAPlayer3.Skin.nScrollFieldY[1]; + this.ct繧エ繝シ繧エ繝シ轤 = new CCounter(0, 6, 50, TJAPlayer3.Timer); + base.On豢サ諤ァ蛹(); + } + + public override void On髱樊エサ諤ァ蛹() + { + for (int i = 0; i < 4; i++) + { + this.st迥カ諷擬i].ct騾イ陦 = null; + this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦 = null; + } + TJAPlayer3.Skin.nScrollFieldX[0] = this.nDefaultJudgePos[0, 0]; + TJAPlayer3.Skin.nScrollFieldY[0] = this.nDefaultJudgePos[0, 1]; + TJAPlayer3.Skin.nScrollFieldX[1] = this.nDefaultJudgePos[1, 0]; + TJAPlayer3.Skin.nScrollFieldY[1] = this.nDefaultJudgePos[1, 1]; + this.ct繧エ繝シ繧エ繝シ = null; + + base.On髱樊エサ諤ァ蛹(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + //this.txLane = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_fieldbgA.png")); + //this.txLaneB = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_fieldbgB.png")); + //this.tx繧エ繝シ繧エ繝シ = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_fieldbgC.png")); + //this.tx譎ョ騾夊ュ憺擇[0] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_field_normal_base.png")); + //this.tx邇莠コ隴憺擇[0] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_field_expert_base.png")); + //this.tx驕比ココ隴憺擇[0] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_field_master_base.png")); + //this.tx譎ョ騾夊ュ憺擇[1] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_field_normal.png")); + //this.tx邇莠コ隴憺擇[1] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_field_expert.png")); + //this.tx驕比ココ隴憺擇[1] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_field_master.png")); + //this.tx譫邱 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_mtaiko_B.png")); + //this.tx蛻、螳壽棧 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_taiko_notes.png")); + //this.tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓植f( CSkin.Path( @"Graphics\7_explosion_lower.png" ) ); + + //this.tx繧エ繝シ繧エ繝シ轤 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_gogo_fire.png")); + + //this.tx繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・ = new CTexture[29]; + //for (int i = 0; i < 29; i++) + //{ + // this.tx繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・[i] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\Dancer\gogo_splash\" + i.ToString() + ".png")); + // this.tx繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・[i].b蜉邂怜粋謌 = true; + //} + + //this.txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_A = new CTexture[15]; + //this.txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_B = new CTexture[15]; + //this.txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_C = new CTexture[15]; + //this.txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_D = new CTexture[15]; + //for (int i = 0; i < 15; i++) + //{ + // this.txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_A[i] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\Effect\lower_1_" + i.ToString() + ".png")); + // this.txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_B[i] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\Effect\lower_2_" + i.ToString() + ".png")); + // this.txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_C[i] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\Effect\lower_3_" + i.ToString() + ".png")); + // this.txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_D[i] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\Effect\lower_4_" + i.ToString() + ".png")); + + // //this.txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_A[ i ].b蜉邂怜粋謌 = true; + // //this.txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_B[ i ].b蜉邂怜粋謌 = true; + // //this.txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_C[ i ].b蜉邂怜粋謌 = true; + // //this.txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_D[ i ].b蜉邂怜粋謌 = true; + //} + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.txLane); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.txLaneB); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.tx繧エ繝シ繧エ繝シ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.tx譎ョ騾夊ュ憺擇[0]); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.tx邇莠コ隴憺擇[0]); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.tx驕比ココ隴憺擇[0]); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.tx譎ョ騾夊ュ憺擇[1]); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.tx邇莠コ隴憺擇[1]); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.tx驕比ココ隴憺擇[1]); + + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.tx譫邱); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.tx蛻、螳壽棧); + ////CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower ); + + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.tx繧エ繝シ繧エ繝シ轤); + + //for (int i = 0; i < 29; i++) + //{ + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.tx繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・[i]); + //} + + //for (int i = 0; i < 15; i++) + //{ + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_A[i]); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_B[i]); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_C[i]); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_D[i]); + //} + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + public override int On騾イ陦梧緒逕サ() + { + if (base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ) + { + for (int i = 0; i < 4; i++) + this.stBranch[i].n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝 = (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + + //縺昴l縺槭l縺檎峡遶九@縺溘Ξ繧、繝、繝シ縺ァ縺ェ縺縺ィ縺縺代↑縺縺ョ縺ァfor繝ォ繝シ繝励ッ繝代シ繝縺斐→縺ォ蛻髮「縺吶k縺薙→縲 + + #region[ 繝ャ繝シ繝ウ譛ャ菴 ] + if (TJAPlayer3.Tx.Lane_Background_Main != null) + { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + TJAPlayer3.Tx.Lane_Background_Main.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[i], TJAPlayer3.Skin.nScrollFieldY[i]); + } + } + #endregion + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + #region[ 蛻蟯舌い繝九Γ蛻カ蠕。繧ソ繧、繝槭シ ] + long num = FDK.CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾; + if (num < this.stBranch[i].n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝) + { + this.stBranch[i].n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝 = num; + } + while ((num - this.stBranch[i].n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝) >= 30) + { + if (this.stBranch[i].nBranch繝ャ繧、繝、繝シ騾乗主コヲ <= 255) + { + this.stBranch[i].nBranch繝ャ繧、繝、繝シ騾乗主コヲ += 10; + } + + if (this.stBranch[i].nBranch譁蟄鈴乗主コヲ >= 0) + { + this.stBranch[i].nBranch譁蟄鈴乗主コヲ -= 10; + } + + if (this.stBranch[i].nY蠎ァ讓 != 0 && this.stBranch[i].nY蠎ァ讓 <= 20) + { + this.stBranch[i].nY蠎ァ讓++; + } + + this.stBranch[i].n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝 += 8; + } + + if (!this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.b蛛懈ュ「荳ュ) + { + this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.t騾イ陦(); + if (this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.t蛛懈ュ「(); + } + } + #endregion + } + #region[ 蛻蟯舌Ξ繧、繝、繝シ ] + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bUseBranch[i] == true) + { + #region[ 蜍輔>縺ヲ縺縺ェ縺 ] + switch (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝ャ繝シ繝ウ逕ィ陦ィ遉コ繧ウ繝シ繧ケ[i]) + { + case CDTX.ECourse.eNormal: + if (TJAPlayer3.Tx.Lane_Base[0] != null) + { + TJAPlayer3.Tx.Lane_Base[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Base[0].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[i], TJAPlayer3.Skin.nScrollFieldY[i]); + } + break; + case CDTX.ECourse.eExpert: + if (TJAPlayer3.Tx.Lane_Base[1] != null) + { + TJAPlayer3.Tx.Lane_Base[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Base[1].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[i], TJAPlayer3.Skin.nScrollFieldY[i]); + } + break; + case CDTX.ECourse.eMaster: + if (TJAPlayer3.Tx.Lane_Base[2] != null) + { + TJAPlayer3.Tx.Lane_Base[2].Opacity = 255; + TJAPlayer3.Tx.Lane_Base[2].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[i], TJAPlayer3.Skin.nScrollFieldY[i]); + } + break; + } + #endregion + + if (TJAPlayer3.ConfigIni.nBranchAnime == 1) + { + #region[ AC7ス14鬚ィ縺ョ閭悟セ後Ξ繧、繝、繝シ ] + if (this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.b騾イ陦御クュ) + { + int n騾乗主コヲ = ((100 - this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、) * 0xff) / 100; + + if (this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.b邨ゆコ蛟、縺ォ驕斐@縺) + { + n騾乗主コヲ = 255; + this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.t蛛懈ュ「(); + } + + #region[ 譎ョ騾夊ュ憺擇_繝ャ繝吶Ν繧「繝繝 ] + //譎ョ騾壺堤私莠コ + if (this.stBranch[i].nBefore == CDTX.ECourse.eNormal && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) + { + if (TJAPlayer3.Tx.Lane_Base[0] != null && TJAPlayer3.Tx.Lane_Base[1] != null) + { + TJAPlayer3.Tx.Lane_Base[0].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + TJAPlayer3.Tx.Lane_Base[1].Opacity = this.stBranch[i].nBranch繝ャ繧、繝、繝シ騾乗主コヲ; + TJAPlayer3.Tx.Lane_Base[1].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + } + } + //譎ョ騾壺帝#莠コ + if (this.stBranch[i].nBefore == CDTX.ECourse.eNormal && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) + { + if (this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 < 100) + { + n騾乗主コヲ = ((100 - this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、) * 0xff) / 100; + } + if (TJAPlayer3.Tx.Lane_Base[0] != null && TJAPlayer3.Tx.Lane_Base[2] != null) + { + TJAPlayer3.Tx.Lane_Base[0].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + TJAPlayer3.Tx.Lane_Base[2].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + TJAPlayer3.Tx.Lane_Base[2].Opacity = this.stBranch[i].nBranch繝ャ繧、繝、繝シ騾乗主コヲ; + } + } + #endregion + #region[ 邇莠コ隴憺擇_繝ャ繝吶Ν繧「繝繝 ] + if (this.stBranch[i].nBefore == CDTX.ECourse.eExpert && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) + { + if (TJAPlayer3.Tx.Lane_Base[1] != null && TJAPlayer3.Tx.Lane_Base[2] != null) + { + TJAPlayer3.Tx.Lane_Base[1].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + TJAPlayer3.Tx.Lane_Base[2].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + TJAPlayer3.Tx.Lane_Base[2].Opacity = this.stBranch[i].nBranch繝ャ繧、繝、繝シ騾乗主コヲ; + } + } + #endregion + #region[ 邇莠コ隴憺擇_繝ャ繝吶Ν繝繧ヲ繝ウ ] + if (this.stBranch[i].nBefore == CDTX.ECourse.eExpert && this.stBranch[i].nAfter == CDTX.ECourse.eNormal) + { + if (TJAPlayer3.Tx.Lane_Base[1] != null && TJAPlayer3.Tx.Lane_Base[0] != null) + { + TJAPlayer3.Tx.Lane_Base[1].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + TJAPlayer3.Tx.Lane_Base[0].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + TJAPlayer3.Tx.Lane_Base[0].Opacity = this.stBranch[i].nBranch繝ャ繧、繝、繝シ騾乗主コヲ; + } + } + #endregion + #region[ 驕比ココ隴憺擇_繝ャ繝吶Ν繝繧ヲ繝ウ ] + if (this.stBranch[i].nBefore == CDTX.ECourse.eMaster && this.stBranch[i].nAfter == CDTX.ECourse.eNormal) + { + if (TJAPlayer3.Tx.Lane_Base[2] != null && TJAPlayer3.Tx.Lane_Base[0] != null) + { + TJAPlayer3.Tx.Lane_Base[2].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + TJAPlayer3.Tx.Lane_Base[0].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + TJAPlayer3.Tx.Lane_Base[0].Opacity = this.stBranch[i].nBranch繝ャ繧、繝、繝シ騾乗主コヲ; + } + } + #endregion + } + #endregion + } + else if (TJAPlayer3.ConfigIni.nBranchAnime == 0) + { + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLane.On騾イ陦梧緒逕サ(); + } + } + } + #endregion + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + #region[ 繧エ繝シ繧エ繝シ繧ソ繧、繝繝ャ繝シ繝ウ閭梧勹繝ャ繧、繝、繝シ ] + if (TJAPlayer3.Tx.Lane_Background_GoGo != null && TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bIsGOGOTIME[i]) + { + if (!this.ct繧エ繝シ繧エ繝シ.b蛛懈ュ「荳ュ) + { + this.ct繧エ繝シ繧エ繝シ.t騾イ陦(); + } + + if (this.ct繧エ繝シ繧エ繝シ.n迴セ蝨ィ縺ョ蛟、 <= 4) + { + TJAPlayer3.Tx.Lane_Background_GoGo.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.2f; + TJAPlayer3.Tx.Lane_Background_GoGo.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[i], TJAPlayer3.Skin.nScrollFieldY[i] + 54); + } + else if (this.ct繧エ繝シ繧エ繝シ.n迴セ蝨ィ縺ョ蛟、 <= 5) + { + TJAPlayer3.Tx.Lane_Background_GoGo.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.4f; + TJAPlayer3.Tx.Lane_Background_GoGo.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[i], TJAPlayer3.Skin.nScrollFieldY[i] + 40); + } + else if (this.ct繧エ繝シ繧エ繝シ.n迴セ蝨ィ縺ョ蛟、 <= 6) + { + TJAPlayer3.Tx.Lane_Background_GoGo.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.6f; + TJAPlayer3.Tx.Lane_Background_GoGo.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[i], TJAPlayer3.Skin.nScrollFieldY[i] + 26); + } + else if (this.ct繧エ繝シ繧エ繝シ.n迴セ蝨ィ縺ョ蛟、 <= 8) + { + TJAPlayer3.Tx.Lane_Background_GoGo.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.8f; + TJAPlayer3.Tx.Lane_Background_GoGo.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[i], TJAPlayer3.Skin.nScrollFieldY[i] + 13); + } + else if (this.ct繧エ繝シ繧エ繝シ.n迴セ蝨ィ縺ョ蛟、 >= 9) + { + TJAPlayer3.Tx.Lane_Background_GoGo.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + TJAPlayer3.Tx.Lane_Background_GoGo.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[i], TJAPlayer3.Skin.nScrollFieldY[i]); + } + } + #endregion + } + + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bUseBranch[i] == true) + { + if (TJAPlayer3.ConfigIni.nBranchAnime == 0) + { + if (!this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.b騾イ陦御クュ) + { + switch (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝ャ繝シ繝ウ逕ィ陦ィ遉コ繧ウ繝シ繧ケ[i]) + { + case CDTX.ECourse.eNormal: + TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[0].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + break; + case CDTX.ECourse.eExpert: + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + break; + case CDTX.ECourse.eMaster: + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[2].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + break; + } + } + if (this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.b騾イ陦御クュ) + { + #region[ 譎ョ騾夊ュ憺擇_繝ャ繝吶Ν繧「繝繝 ] + //譎ョ騾壺堤私莠コ + if (this.stBranch[i].nBefore == 0 && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) + { + TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + + TJAPlayer3.Tx.Lane_Text[0].Opacity = this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 > 100 ? 0 : (255 - ((this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 * 0xff) / 60)); + //CDTXMania.Tx.Lane_Text[1].n騾乗主コヲ = this.ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 > 100 ? 255 : ( ( ( this.ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 * 0xff ) / 60 ) ); + if (this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 < 60) + { + this.stBranch[i].nY = this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 / 2; + TJAPlayer3.Tx.Lane_Text[0].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i] + this.stBranch[i].nY); + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].t2D謠冗判(TJAPlayer3.app.Device, 333, (TJAPlayer3.Skin.nScrollFieldY[i] - 30) + this.stBranch[i].nY); + } + else + { + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + } + + } + + //譎ョ騾壺帝#莠コ + if (this.stBranch[i].nBefore == 0 && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) + { + TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + if (this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 < 60) + { + this.stBranch[i].nY = this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 / 2; + TJAPlayer3.Tx.Lane_Text[0].t2D謠冗判(TJAPlayer3.app.Device, 333, (TJAPlayer3.Skin.nScrollFieldY[i] - 12) + this.stBranch[i].nY); + TJAPlayer3.Tx.Lane_Text[0].Opacity = this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 > 100 ? 0 : (255 - ((this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 * 0xff) / 100)); + TJAPlayer3.Tx.Lane_Text[1].t2D謠冗判(TJAPlayer3.app.Device, 333, (TJAPlayer3.Skin.nScrollFieldY[i] - 20) + this.stBranch[i].nY); + } + //if( this.stBranch[ i ].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 >= 5 && this.stBranch[ i ].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 < 60 ) + //{ + // this.stBranch[ i ].nY = this.stBranch[ i ].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 / 2; + // this.tx譎ョ騾夊ュ憺擇[ 1 ].t2D謠冗判(CDTXMania.app.Device, 333, CDTXMania.Skin.nScrollFieldY[ i ] + this.stBranch[ i ].nY); + // this.tx譎ョ騾夊ュ憺擇[ 1 ].n騾乗主コヲ = this.stBranch[ i ].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 > 100 ? 0 : ( 255 - ( ( this.stBranch[ i ].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 * 0xff) / 100)); + // this.tx邇莠コ隴憺擇[ 1 ].t2D謠冗判(CDTXMania.app.Device, 333, ( CDTXMania.Skin.nScrollFieldY[ i ] - 10 ) + this.stBranch[ i ].nY); + //} + else if (this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 >= 60 && this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 < 150) + { + this.stBranch[i].nY = 21; + TJAPlayer3.Tx.Lane_Text[1].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + } + else if (this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 >= 150 && this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 < 210) + { + this.stBranch[i].nY = ((this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 - 150) / 2); + TJAPlayer3.Tx.Lane_Text[1].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i] + this.stBranch[i].nY); + TJAPlayer3.Tx.Lane_Text[1].Opacity = this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 > 100 ? 0 : (255 - ((this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 * 0xff) / 100)); + TJAPlayer3.Tx.Lane_Text[2].t2D謠冗判(TJAPlayer3.app.Device, 333, (TJAPlayer3.Skin.nScrollFieldY[i] - 20) + this.stBranch[i].nY); + } + else + { + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[2].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + } + } + #endregion + #region[ 邇莠コ隴憺擇_繝ャ繝吶Ν繧「繝繝 ] + //邇莠コ竊帝#莠コ + if (this.stBranch[i].nBefore == CDTX.ECourse.eExpert && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) + { + TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + + TJAPlayer3.Tx.Lane_Text[1].Opacity = this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 > 100 ? 0 : (255 - ((this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 * 0xff) / 60)); + if (this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 < 60) + { + this.stBranch[i].nY = this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 / 2; + TJAPlayer3.Tx.Lane_Text[1].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i] + this.stBranch[i].nY); + TJAPlayer3.Tx.Lane_Text[2].t2D謠冗判(TJAPlayer3.app.Device, 333, (TJAPlayer3.Skin.nScrollFieldY[i] - 20) + this.stBranch[i].nY); + } + else + { + TJAPlayer3.Tx.Lane_Text[2].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + } + } + #endregion + #region[ 邇莠コ隴憺擇_繝ャ繝吶Ν繝繧ヲ繝ウ ] + if (this.stBranch[i].nBefore == CDTX.ECourse.eExpert && this.stBranch[i].nAfter == CDTX.ECourse.eNormal) + { + TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + + TJAPlayer3.Tx.Lane_Text[1].Opacity = this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 > 100 ? 0 : (255 - ((this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 * 0xff) / 60)); + if (this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 < 60) + { + this.stBranch[i].nY = this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 / 2; + TJAPlayer3.Tx.Lane_Text[1].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i] - this.stBranch[i].nY); + TJAPlayer3.Tx.Lane_Text[0].t2D謠冗判(TJAPlayer3.app.Device, 333, (TJAPlayer3.Skin.nScrollFieldY[i] + 30) - this.stBranch[i].nY); + } + else + { + TJAPlayer3.Tx.Lane_Text[0].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + } + } + #endregion + #region[ 驕比ココ隴憺擇_繝ャ繝吶Ν繝繧ヲ繝ウ ] + if (this.stBranch[i].nBefore == CDTX.ECourse.eMaster && this.stBranch[i].nAfter == CDTX.ECourse.eNormal) + { + TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + + if (this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 < 60) + { + this.stBranch[i].nY = this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 / 2; + TJAPlayer3.Tx.Lane_Text[2].Opacity = this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 > 100 ? 0 : (255 - ((this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 * 0xff) / 60)); + TJAPlayer3.Tx.Lane_Text[2].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i] - this.stBranch[i].nY); + TJAPlayer3.Tx.Lane_Text[1].t2D謠冗判(TJAPlayer3.app.Device, 333, (TJAPlayer3.Skin.nScrollFieldY[i] + 30) - this.stBranch[i].nY); + } + else if (this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 >= 60 && this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 < 150) + { + this.stBranch[i].nY = 21; + TJAPlayer3.Tx.Lane_Text[1].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + } + else if (this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 >= 150 && this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 < 210) + { + this.stBranch[i].nY = ((this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 - 150) / 2); + TJAPlayer3.Tx.Lane_Text[1].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i] - this.stBranch[i].nY); + TJAPlayer3.Tx.Lane_Text[1].Opacity = this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 > 100 ? 0 : (255 - ((this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 * 0xff) / 100)); + TJAPlayer3.Tx.Lane_Text[0].t2D謠冗判(TJAPlayer3.app.Device, 333, (TJAPlayer3.Skin.nScrollFieldY[i] + 30) - this.stBranch[i].nY); + } + else if (this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 >= 210) + { + TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[0].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + } + } + if (this.stBranch[i].nBefore == CDTX.ECourse.eMaster && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) + { + TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + + TJAPlayer3.Tx.Lane_Text[2].Opacity = this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 > 100 ? 0 : (255 - ((this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 * 0xff) / 60)); + if (this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 < 60) + { + this.stBranch[i].nY = this.stBranch[i].ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、 / 2; + TJAPlayer3.Tx.Lane_Text[2].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i] - this.stBranch[i].nY); + TJAPlayer3.Tx.Lane_Text[1].t2D謠冗判(TJAPlayer3.app.Device, 333, (TJAPlayer3.Skin.nScrollFieldY[i] + 30) - this.stBranch[i].nY); + } + else + { + TJAPlayer3.Tx.Lane_Text[1].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + } + + } + #endregion + } + } + else + { + if (this.stBranch[i].nY蠎ァ讓 == 21) + { + this.stBranch[i].nY蠎ァ讓 = 0; + } + + if (this.stBranch[i].nY蠎ァ讓 == 0) + { + switch (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝ャ繝シ繝ウ逕ィ陦ィ遉コ繧ウ繝シ繧ケ[0]) + { + case CDTX.ECourse.eNormal: + TJAPlayer3.Tx.Lane_Text[0].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[0].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + break; + case CDTX.ECourse.eExpert: + TJAPlayer3.Tx.Lane_Text[1].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[1].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + break; + case CDTX.ECourse.eMaster: + TJAPlayer3.Tx.Lane_Text[2].Opacity = 255; + TJAPlayer3.Tx.Lane_Text[2].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i]); + break; + } + } + + //fuck + if (this.stBranch[i].nY蠎ァ讓 != 0) + { + #region[ 譎ョ騾夊ュ憺擇_繝ャ繝吶Ν繧「繝繝 ] + //譎ョ騾壺堤私莠コ + if (this.stBranch[i].nBefore == CDTX.ECourse.eNormal && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) + { + TJAPlayer3.Tx.Lane_Text[0].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i] - this.stBranch[i].nY蠎ァ讓); + TJAPlayer3.Tx.Lane_Text[1].t2D謠冗判(TJAPlayer3.app.Device, 333, (TJAPlayer3.Skin.nScrollFieldY[i] + 20) - this.stBranch[i].nY蠎ァ讓); + TJAPlayer3.Tx.Lane_Text[0].Opacity = this.stBranch[i].nBranch繝ャ繧、繝、繝シ騾乗主コヲ; + } + //譎ョ騾壺帝#莠コ + if (this.stBranch[i].nBefore == CDTX.ECourse.eNormal && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) + { + TJAPlayer3.Tx.Lane_Text[0].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i] - this.stBranch[i].nY蠎ァ讓); + TJAPlayer3.Tx.Lane_Text[2].t2D謠冗判(TJAPlayer3.app.Device, 333, (TJAPlayer3.Skin.nScrollFieldY[i] + 20) - this.stBranch[i].nY蠎ァ讓); + TJAPlayer3.Tx.Lane_Text[0].Opacity = this.stBranch[i].nBranch繝ャ繧、繝、繝シ騾乗主コヲ; + } + #endregion + #region[ 邇莠コ隴憺擇_繝ャ繝吶Ν繧「繝繝 ] + //邇莠コ竊帝#莠コ + if (this.stBranch[i].nBefore == CDTX.ECourse.eExpert && this.stBranch[i].nAfter == CDTX.ECourse.eMaster) + { + TJAPlayer3.Tx.Lane_Text[1].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i] - this.stBranch[i].nY蠎ァ讓); + TJAPlayer3.Tx.Lane_Text[2].t2D謠冗判(TJAPlayer3.app.Device, 333, (TJAPlayer3.Skin.nScrollFieldY[i] + 20) - this.stBranch[i].nY蠎ァ讓); + TJAPlayer3.Tx.Lane_Text[1].Opacity = this.stBranch[i].nBranch繝ャ繧、繝、繝シ騾乗主コヲ; + } + #endregion + #region[ 邇莠コ隴憺擇_繝ャ繝吶Ν繝繧ヲ繝ウ ] + if (this.stBranch[i].nBefore == CDTX.ECourse.eExpert && this.stBranch[i].nAfter == CDTX.ECourse.eNormal) + { + TJAPlayer3.Tx.Lane_Text[1].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i] + this.stBranch[i].nY蠎ァ讓); + TJAPlayer3.Tx.Lane_Text[0].t2D謠冗判(TJAPlayer3.app.Device, 333, (TJAPlayer3.Skin.nScrollFieldY[i] - 24) + this.stBranch[i].nY蠎ァ讓); + TJAPlayer3.Tx.Lane_Text[1].Opacity = this.stBranch[i].nBranch繝ャ繧、繝、繝シ騾乗主コヲ; + } + #endregion + #region[ 驕比ココ隴憺擇_繝ャ繝吶Ν繝繧ヲ繝ウ ] + if (this.stBranch[i].nBefore == CDTX.ECourse.eMaster && this.stBranch[i].nAfter == CDTX.ECourse.eNormal) + { + TJAPlayer3.Tx.Lane_Text[2].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i] + this.stBranch[i].nY蠎ァ讓); + TJAPlayer3.Tx.Lane_Text[0].t2D謠冗判(TJAPlayer3.app.Device, 333, (TJAPlayer3.Skin.nScrollFieldY[i] - 24) + this.stBranch[i].nY蠎ァ讓); + TJAPlayer3.Tx.Lane_Text[2].Opacity = this.stBranch[i].nBranch繝ャ繧、繝、繝シ騾乗主コヲ; + } + if (this.stBranch[i].nBefore == CDTX.ECourse.eMaster && this.stBranch[i].nAfter == CDTX.ECourse.eExpert) + { + TJAPlayer3.Tx.Lane_Text[2].t2D謠冗判(TJAPlayer3.app.Device, 333, TJAPlayer3.Skin.nScrollFieldY[i] + this.stBranch[i].nY蠎ァ讓); + TJAPlayer3.Tx.Lane_Text[1].t2D謠冗判(TJAPlayer3.app.Device, 333, (TJAPlayer3.Skin.nScrollFieldY[i] - 24) + this.stBranch[i].nY蠎ァ讓); + TJAPlayer3.Tx.Lane_Text[2].Opacity = this.stBranch[i].nBranch繝ャ繧、繝、繝シ騾乗主コヲ; + } + #endregion + } + } + + } + } + + + + if (TJAPlayer3.Tx.Lane_Background_Sub != null) + { + TJAPlayer3.Tx.Lane_Background_Sub.t2D謠冗判(TJAPlayer3.app.Device, 333, 326); + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay) + { + TJAPlayer3.Tx.Lane_Background_Sub.t2D謠冗判(TJAPlayer3.app.Device, 333, 502); + } + } + + + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actTaikoLaneFlash.On騾イ陦梧緒逕サ(); + + + + if (TJAPlayer3.Tx.Taiko_Frame[0] != null) + { + TJAPlayer3.Tx.Taiko_Frame[0].t2D謠冗判(TJAPlayer3.app.Device, 329, 136); + + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay) + { + if(TJAPlayer3.Tx.Taiko_Frame[1] != null) + { + TJAPlayer3.Tx.Taiko_Frame[1].t2D謠冗判(TJAPlayer3.app.Device, 329, 360); + } + } + } + var nTime = (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + + if (this.n邱冗ァサ蜍墓凾髢 != -1) + { + if (n遘サ蜍墓婿蜷 == 1) + { + TJAPlayer3.Skin.nScrollFieldX[0] = this.n遘サ蜍暮幕蟋宜 + (int)((((int)nTime - this.n遘サ蜍暮幕蟋区凾蛻サ) / (double)(this.n邱冗ァサ蜍墓凾髢)) * this.n遘サ蜍戊キ晞屬px); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.FlyingNotes.StartPointX[0] = this.n遘サ蜍暮幕蟋宜 + (int)((((int)nTime - this.n遘サ蜍暮幕蟋区凾蛻サ) / (double)(this.n邱冗ァサ蜍墓凾髢)) * this.n遘サ蜍戊キ晞屬px); + } + else + { + TJAPlayer3.Skin.nScrollFieldX[0] = this.n遘サ蜍暮幕蟋宜 - (int)((((int)nTime - this.n遘サ蜍暮幕蟋区凾蛻サ) / (double)(this.n邱冗ァサ蜍墓凾髢)) * this.n遘サ蜍戊キ晞屬px); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.FlyingNotes.StartPointX[0] = this.n遘サ蜍暮幕蟋宜 - (int)((((int)nTime - this.n遘サ蜍暮幕蟋区凾蛻サ) / (double)(this.n邱冗ァサ蜍墓凾髢)) * this.n遘サ蜍戊キ晞屬px); + } + + if (((int)nTime) > this.n遘サ蜍暮幕蟋区凾蛻サ + this.n邱冗ァサ蜍墓凾髢) + { + this.n邱冗ァサ蜍墓凾髢 = -1; + TJAPlayer3.Skin.nScrollFieldX[0] = this.n遘サ蜍慕岼逧蝣エ謇X; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.FlyingNotes.StartPointX[0] = this.n遘サ蜍慕岼逧蝣エ謇X; + } + } + if (this.n邱冗ァサ蜍墓凾髢2 != -1) + { + if (n遘サ蜍墓婿蜷2 == 1) + { + TJAPlayer3.Skin.nScrollFieldX[1] = this.n遘サ蜍暮幕蟋宜2 + (int)((((int)nTime - this.n遘サ蜍暮幕蟋区凾蛻サ2) / (double)(this.n邱冗ァサ蜍墓凾髢2)) * this.n遘サ蜍戊キ晞屬px2); + TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_X[1] = this.n遘サ蜍暮幕蟋宜2 + (int)((((int)nTime - this.n遘サ蜍暮幕蟋区凾蛻サ2) / (double)(this.n邱冗ァサ蜍墓凾髢2)) * this.n遘サ蜍戊キ晞屬px2); + } + else + { + TJAPlayer3.Skin.nScrollFieldX[1] = this.n遘サ蜍暮幕蟋宜2 - (int)((((int)nTime - this.n遘サ蜍暮幕蟋区凾蛻サ2) / (double)(this.n邱冗ァサ蜍墓凾髢2)) * this.n遘サ蜍戊キ晞屬px2); + TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_X[1] = this.n遘サ蜍暮幕蟋宜2 - (int)((((int)nTime - this.n遘サ蜍暮幕蟋区凾蛻サ2) / (double)(this.n邱冗ァサ蜍墓凾髢2)) * this.n遘サ蜍戊キ晞屬px2); + } + + + if (((int)nTime) > this.n遘サ蜍暮幕蟋区凾蛻サ2 + this.n邱冗ァサ蜍墓凾髢2) + { + this.n邱冗ァサ蜍墓凾髢2 = -1; + TJAPlayer3.Skin.nScrollFieldX[1] = this.n遘サ蜍慕岼逧蝣エ謇X2; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.FlyingNotes.StartPointX[1] = this.n遘サ蜍慕岼逧蝣エ謇X2; + } + } + + + + + if (TJAPlayer3.ConfigIni.bAVI譛牙柑 && TJAPlayer3.DTX.listAVI.Count > 0) + { + if (TJAPlayer3.Tx.Lane_Background_Main != null) TJAPlayer3.Tx.Lane_Background_Main.Opacity = TJAPlayer3.ConfigIni.nBGAlpha; + if(TJAPlayer3.Tx.Lane_Background_Sub != null) TJAPlayer3.Tx.Lane_Background_Sub.Opacity = TJAPlayer3.ConfigIni.nBGAlpha; + if (TJAPlayer3.Tx.Lane_Background_GoGo != null) TJAPlayer3.Tx.Lane_Background_GoGo.Opacity = TJAPlayer3.ConfigIni.nBGAlpha; + } + else + { + if (TJAPlayer3.Tx.Lane_Background_Main != null) TJAPlayer3.Tx.Lane_Background_Main.Opacity = 255; + if (TJAPlayer3.Tx.Lane_Background_Sub != null) TJAPlayer3.Tx.Lane_Background_Sub.Opacity = 255; + if (TJAPlayer3.Tx.Lane_Background_GoGo != null) TJAPlayer3.Tx.Lane_Background_GoGo.Opacity = 255; + } + + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.nBranch繝ャ繧、繝、繝シ騾乗主コヲ.ToString()); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 16, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.ct蛻蟯舌い繝九Γ騾イ陦.n迴セ蝨ィ縺ョ蛟、.ToString()); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 32, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.ct蛻蟯舌い繝九Γ騾イ陦.n邨ゆコ蛟、.ToString()); + + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 32, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.ct繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・.n迴セ蝨ィ縺ョ蛟、.ToString()); + + /*#region[ 繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・ ] + for (int i = 0; i < CDTXMania.ConfigIni.nPlayerCount; i++) + { + if (CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.bIsGOGOTIME[i]) + { + + if (this.tx繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・ != null) + { + this.tx繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・[(int)this.ct繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(CDTXMania.app.Device, 0, 260); + this.ct繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・.n迴セ蝨ィ縺ョ蛟、++; + if(this.ct繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・.b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.ct繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・.t蛛懈ュ「(); + this.ct繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・.n迴セ蝨ィ縺ョ蛟、 = 0; + } + } + + + this.ct繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・.t騾イ陦鍬oop(); + if (this.tx繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・ != null) + { + if (this.ct繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・.b邨ゆコ蛟、縺ォ驕斐@縺ヲ縺ェ縺) + { + this.tx繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・[(int)this.ct繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(CDTXMania.app.Device, 0, 260); + } + + } + } + } + #endregion */ + /* + for (int i = 0; i < CDTXMania.ConfigIni.nPlayerCount; i++) + { + #region[ 繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・ ] + if (this.tx繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・ != null && CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.bIsGOGOTIME[i]) + { + if (!this.ct繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・.b蛛懈ュ「荳ュ) + { + this.ct繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・.t騾イ陦(); + } + if (this.ct繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・.n迴セ蝨ィ縺ョ蛟、 < 28) + { + for (int v = 0; v < 6; v++) + { + this.tx繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・[this.ct繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(CDTXMania.app.Device, 0 + (v * 213), 260); + } + + } + else + { + this.tx繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・[this.ct繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・.n迴セ蝨ィ縺ョ蛟、].n騾乗主コヲ = 100; + } + + } + #endregion + } */ + return base.On騾イ陦梧緒逕サ(); + } + + public void 繧エ繝シ繧エ繝シ轤() + { + //蛻、螳壽棧 + if (TJAPlayer3.Tx.Notes != null) + { + int nJudgeX = TJAPlayer3.Skin.nScrollFieldX[0] - (130 / 2); //蜈縺ョ蛟、縺ッ349縺ェ繧薙□縺代←... + int nJudgeY = TJAPlayer3.Skin.nScrollFieldY[0]; //蜈縺ョ蛟、縺ッ349縺ェ繧薙□縺代←... + TJAPlayer3.Tx.Judge_Frame.b蜉邂怜粋謌 = TJAPlayer3.Skin.Game_JudgeFrame_AddBlend; + TJAPlayer3.Tx.Judge_Frame.t2D謠冗判(TJAPlayer3.app.Device, nJudgeX, nJudgeY, new Rectangle(0, 0, 130, 130)); + + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay) + TJAPlayer3.Tx.Judge_Frame.t2D謠冗判(TJAPlayer3.app.Device, nJudgeX, nJudgeY + 176, new Rectangle(0, 0, 130, 130)); + } + + + #region[ 繧エ繝シ繧エ繝シ轤 ] + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bIsGOGOTIME[i]) + { + this.ct繧エ繝シ繧エ繝シ轤.t騾イ陦鍬oop(); + + if (TJAPlayer3.Tx.Effects_Fire != null) + { + float f蛟咲紫 = 1.0f; + + float[] ar蛟咲紫 = new float[] { 0.8f, 1.2f, 1.7f, 2.5f, 2.3f, 2.2f, 2.0f, 1.8f, 1.7f, 1.6f, 1.6f, 1.5f, 1.5f, 1.4f, 1.3f, 1.2f, 1.1f, 1.0f }; + + f蛟咲紫 = ar蛟咲紫[this.ct繧エ繝シ繧エ繝シ.n迴セ蝨ィ縺ョ蛟、]; + + Matrix mat = Matrix.Identity; + mat *= Matrix.Scaling(f蛟咲紫, f蛟咲紫, 1.0f); + mat *= Matrix.Translation(TJAPlayer3.Skin.nScrollFieldX[i] - SampleFramework.GameWindowSize.Width / 2.0f, -(TJAPlayer3.Skin.nJudgePointY[i] - SampleFramework.GameWindowSize.Height / 2.0f), 0f); + + //this.tx繧エ繝シ繧エ繝シ轤.b蜉邂怜粋謌 = true; + + //this.ct繧エ繝シ繧エ繝シ.n迴セ蝨ィ縺ョ蛟、 = 6; + if (this.ct繧エ繝シ繧エ繝シ.b邨ゆコ蛟、縺ォ驕斐@縺) + { + TJAPlayer3.Tx.Effects_Fire.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldX[i] - 180, TJAPlayer3.Skin.nJudgePointY[i] - (TJAPlayer3.Tx.Effects_Fire.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height / 2), new Rectangle(360 * (this.ct繧エ繝シ繧エ繝シ轤.n迴セ蝨ィ縺ョ蛟、), 0, 360, 370)); + } + else + { + TJAPlayer3.Tx.Effects_Fire.t3D謠冗判(TJAPlayer3.app.Device, mat, new Rectangle(360 * (this.ct繧エ繝シ繧エ繝シ轤.n迴セ蝨ィ縺ョ蛟、), 0, 360, 370)); + } + } + } + } + #endregion + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + if (!this.st迥カ諷擬i].ct騾イ陦.b蛛懈ュ「荳ュ) + { + this.st迥カ諷擬i].ct騾イ陦.t騾イ陦(); + if (this.st迥カ諷擬i].ct騾イ陦.b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.st迥カ諷擬i].ct騾イ陦.t蛛懈ュ「(); + } + //if( this.tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower != null ) + { + //this.tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower.b蜉邂怜粋謌 = true; + int n = this.st迥カ諷擬i].nIsBig == 1 ? 520 : 0; + + switch (st迥カ諷擬i].judge) + { + case E蛻、螳.Perfect: + case E蛻、螳.Great: + case E蛻、螳.Auto: + //this.tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower.t2D謠冗判( CDTXMania.app.Device, 285, 127, new Rectangle( this.st迥カ諷擬 i ].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 * 260, n, 260, 260 ) ); + if (this.st迥カ諷擬i].nIsBig == 1 && TJAPlayer3.Tx.Effects_Hit_Great_Big[this.st迥カ諷擬i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、] != null) + TJAPlayer3.Tx.Effects_Hit_Great_Big[this.st迥カ諷擬i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldX[0] - TJAPlayer3.Tx.Effects_Hit_Great_Big[0].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Skin.nJudgePointY[i] - TJAPlayer3.Tx.Effects_Hit_Great_Big[0].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2); + else if (TJAPlayer3.Tx.Effects_Hit_Great[this.st迥カ諷擬i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、] != null) + TJAPlayer3.Tx.Effects_Hit_Great[this.st迥カ諷擬i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldX[0] - TJAPlayer3.Tx.Effects_Hit_Great[0].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Skin.nJudgePointY[i] - TJAPlayer3.Tx.Effects_Hit_Great[0].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2); + break; + + case E蛻、螳.Good: + //this.tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower.t2D謠冗判( CDTXMania.app.Device, 285, 127, new Rectangle( this.st迥カ諷擬 i ].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 * 260, n + 260, 260, 260 ) ); + if (this.st迥カ諷擬i].nIsBig == 1 && TJAPlayer3.Tx.Effects_Hit_Good_Big[this.st迥カ諷擬i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、] != null) + TJAPlayer3.Tx.Effects_Hit_Good_Big[this.st迥カ諷擬i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldX[0] - TJAPlayer3.Tx.Effects_Hit_Good_Big[0].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Skin.nJudgePointY[i] - TJAPlayer3.Tx.Effects_Hit_Good_Big[0].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2); + else if (TJAPlayer3.Tx.Effects_Hit_Good[this.st迥カ諷擬i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、] != null) + TJAPlayer3.Tx.Effects_Hit_Good[this.st迥カ諷擬i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldX[0] - TJAPlayer3.Tx.Effects_Hit_Good[0].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Skin.nJudgePointY[i] - TJAPlayer3.Tx.Effects_Hit_Good[0].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2); + break; + + case E蛻、螳.Miss: + case E蛻、螳.Bad: + break; + } + } + } + } + + + } + + public virtual void Start(int nLane, E蛻、螳 judge, bool b荳。謇句・蜉, int nPlayer) + { + //2017.08.15 kairera0467 謗剃サ悶↑縺ョ縺ァ逡ェ蝨ー繧偵◎縺ョ縺セ縺セ蜷繝ャ繝シ繝ウ縺ョ迥カ諷九→縺励※謇ア縺 + + //for( int n = 0; n < 1; n++ ) + { + this.st迥カ諷擬nPlayer].ct騾イ陦 = new CCounter(0, 14, 20, TJAPlayer3.Timer); + this.st迥カ諷擬nPlayer].judge = judge; + this.st迥カ諷擬nPlayer].nPlayer = nPlayer; + + switch (nLane) + { + case 0x11: + case 0x12: + this.st迥カ諷擬nPlayer].nIsBig = 0; + break; + case 0x13: + case 0x14: + case 0x1A: + case 0x1B: + { + if (b荳。謇句・蜉) + this.st迥カ諷擬nPlayer].nIsBig = 1; + else + this.st迥カ諷擬nPlayer].nIsBig = 0; + } + break; + } + } + } + + + public void GOGOSTART() + { + this.ct繧エ繝シ繧エ繝シ = new CCounter(0, 17, 18, TJAPlayer3.Timer); + if(TJAPlayer3.ConfigIni.nPlayerCount == 1 && TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Dan) TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.GoGoSplash.StartSplash(); + } + + + public void t蛻蟯舌Ξ繧、繝、繝シ_繧ウ繝シ繧ケ螟牙喧(CDTX.ECourse n迴セ蝨ィ, CDTX.ECourse n谺。蝗, int nPlayer) + { + if (n迴セ蝨ィ == n谺。蝗) + { + return; + } + this.stBranch[nPlayer].ct蛻蟯舌い繝九Γ騾イ陦 = new CCounter(0, 300, 2, TJAPlayer3.Timer); + + this.stBranch[nPlayer].nBranch繝ャ繧、繝、繝シ騾乗主コヲ = 6; + this.stBranch[nPlayer].nY蠎ァ讓 = 1; + + this.stBranch[nPlayer].nBefore = n迴セ蝨ィ; + this.stBranch[nPlayer].nAfter = n谺。蝗; + + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLane.t蛻蟯舌Ξ繧、繝、繝シ_繧ウ繝シ繧ケ螟牙喧(n迴セ蝨ィ, n谺。蝗, nPlayer); + } + + public void t蛻、螳壽棧遘サ蜍(double db遘サ蜍墓凾髢, int n遘サ蜍頻x, int n遘サ蜍墓婿蜷) + { + this.n遘サ蜍暮幕蟋区凾蛻サ = (int)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + this.n遘サ蜍暮幕蟋宜 = TJAPlayer3.Skin.nScrollFieldX[0]; + this.n邱冗ァサ蜍墓凾髢 = (int)(db遘サ蜍墓凾髢 * 1000); + this.n遘サ蜍墓婿蜷 = n遘サ蜍墓婿蜷; + this.n遘サ蜍戊キ晞屬px = n遘サ蜍頻x; + if (n遘サ蜍墓婿蜷 == 0) + this.n遘サ蜍慕岼逧蝣エ謇X = TJAPlayer3.Skin.nScrollFieldX[0] - n遘サ蜍頻x; + else + this.n遘サ蜍慕岼逧蝣エ謇X = TJAPlayer3.Skin.nScrollFieldX[0] + n遘サ蜍頻x; + } + + public void t蛻、螳壽棧遘サ蜍2(double db遘サ蜍墓凾髢, int n遘サ蜍頻x, int n遘サ蜍墓婿蜷) + { + this.n遘サ蜍暮幕蟋区凾蛻サ2 = (int)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + this.n遘サ蜍暮幕蟋宜2 = TJAPlayer3.Skin.nScrollFieldX[1]; + this.n邱冗ァサ蜍墓凾髢2 = (int)(db遘サ蜍墓凾髢 * 1000); + this.n遘サ蜍墓婿蜷2 = n遘サ蜍墓婿蜷; + this.n遘サ蜍戊キ晞屬px2 = n遘サ蜍頻x; + if (n遘サ蜍墓婿蜷 == 0) + this.n遘サ蜍慕岼逧蝣エ謇X2 = TJAPlayer3.Skin.nScrollFieldX[1] - n遘サ蜍頻x; + else + this.n遘サ蜍慕岼逧蝣エ謇X2 = TJAPlayer3.Skin.nScrollFieldX[1] + n遘サ蜍頻x; + } + #region[ private ] + //----------------- + //private CTexture txLane; + //private CTexture txLaneB; + //private CTexture tx譫邱; + //private CTexture tx蛻、螳壽棧; + //private CTexture tx繧エ繝シ繧エ繝シ; + //private CTexture tx繧エ繝シ繧エ繝シ轤; + //private CTexture[] txAr繧エ繝シ繧エ繝シ轤; + //private CTexture[] txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_A; + //private CTexture[] txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_B; + //private CTexture[] txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_C; + //private CTexture[] txAr繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower_D; + + //private CTexture[] txLaneFlush = new CTexture[3]; + + //private CTexture[] tx譎ョ騾夊ュ憺擇 = new CTexture[2]; + //private CTexture[] tx邇莠コ隴憺擇 = new CTexture[2]; + //private CTexture[] tx驕比ココ隴憺擇 = new CTexture[2]; + + //private CTextureAf tx繧「繧ソ繝繧ッ繧ィ繝輔ぉ繧ッ繝Lower; + + protected STSTATUS[] st迥カ諷 = new STSTATUS[4]; + + //private CTexture[] tx繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・; + + [StructLayout(LayoutKind.Sequential)] + protected struct STSTATUS + { + public bool b菴ソ逕ィ荳ュ; + public CCounter ct騾イ陦; + public E蛻、螳 judge; + public int nIsBig; + public int n騾乗主コヲ; + public int nPlayer; + } + private CCounter ct繧エ繝シ繧エ繝シ; + private CCounter ct繧エ繝シ繧エ繝シ轤; + + + + public STBRANCH[] stBranch = new STBRANCH[4]; + [StructLayout(LayoutKind.Sequential)] + public struct STBRANCH + { + public CCounter ct蛻蟯舌い繝九Γ騾イ陦; + public CDTX.ECourse nBefore; + public CDTX.ECourse nAfter; + + public long n繝輔Λ繝繧キ繝・蛻カ蠕。繧ソ繧、繝; + public int nBranch繝ャ繧、繝、繝シ騾乗主コヲ; + public int nBranch譁蟄鈴乗主コヲ; + public int nY蠎ァ讓; + public int nY; + } + + + private int n邱冗ァサ蜍墓凾髢; + private int n遘サ蜍暮幕蟋宜; + private int n遘サ蜍暮幕蟋区凾蛻サ; + private int n遘サ蜍戊キ晞屬px; + private int n遘サ蜍慕岼逧蝣エ謇X; + private int n遘サ蜍墓婿蜷; + private int n邱冗ァサ蜍墓凾髢2; + private int n遘サ蜍暮幕蟋宜2; + private int n遘サ蜍暮幕蟋区凾蛻サ2; + private int n遘サ蜍戊キ晞屬px2; + private int n遘サ蜍慕岼逧蝣エ謇X2; + private int n遘サ蜍墓婿蜷2; + + internal int[,] nDefaultJudgePos = new int[2, 2]; + + + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums蛻、螳壽枚蟄怜.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums蛻、螳壽枚蟄怜.cs new file mode 100644 index 00000000..eef63793 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums蛻、螳壽枚蟄怜.cs @@ -0,0 +1,95 @@ +サソusing System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using System.Runtime.InteropServices; +using SlimDX; +using FDK; +using System.Drawing; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rums蛻、螳壽枚蟄怜 : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CAct貍泌・愁rums蛻、螳壽枚蟄怜() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + public override void On豢サ諤ァ蛹() + { + JudgeAnimes = new JudgeAnime[2, 512]; + for (int i = 0; i < 512; i++) + { + JudgeAnimes[0, i] = new JudgeAnime(); + JudgeAnimes[1, i] = new JudgeAnime(); + } + base.On豢サ諤ァ蛹(); + } + + public override void On髱樊エサ諤ァ蛹() + { + for (int i = 0; i < 512; i++) + { + JudgeAnimes[0, i] = null; + JudgeAnimes[1, i] = null; + } + base.On髱樊エサ諤ァ蛹(); + } + + // CActivity 螳溯」シ亥ア騾壹け繝ゥ繧ケ縺九i縺ョ蟾ョ蛻縺ョ縺ソシ + public override int On騾イ陦梧緒逕サ() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + for (int i = 0; i < 512; i++) + { + for(int j = 0; j < 2; j++) + { + if (JudgeAnimes[j, i].counter.b蛛懈ュ「荳ュ) continue; + JudgeAnimes[j, i].counter.t騾イ陦(); + float x = TJAPlayer3.Skin.nScrollFieldX[0] - TJAPlayer3.Tx.Judge.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2; + float y = (TJAPlayer3.Skin.nScrollFieldY[j] - 53 + CubicEaseOut((float)(JudgeAnimes[j, i].counter.n迴セ蝨ィ縺ョ蛟、 >= 180 ? 180 : JudgeAnimes[j, i].counter.n迴セ蝨ィ縺ョ蛟、) / 180f) * 20f) - 10; + TJAPlayer3.Tx.Judge.Opacity = (int)(255f - (JudgeAnimes[j, i].counter.n迴セ蝨ィ縺ョ蛟、 >= 360 ? ((JudgeAnimes[j, i].counter.n迴セ蝨ィ縺ョ蛟、 - 360) / 50.0f) * 255f : 0f)); + TJAPlayer3.Tx.Judge.t2D謠冗判(TJAPlayer3.app.Device, x, y, JudgeAnimes[j, i].rc); + } + } + } + return 0; + } + + public void Start(int player, E蛻、螳 judge) + { + JudgeAnimes[player, JudgeAnime.Index].counter.t髢句ァ(0, 410, 1, TJAPlayer3.Timer); + JudgeAnimes[player, JudgeAnime.Index].Judge = judge; + int njudge = judge == E蛻、螳.Perfect ? 0 : judge == E蛻、螳.Good ? 1 : judge == E蛻、螳.Auto ? 0 : 2; + JudgeAnimes[player, JudgeAnime.Index].rc = new Rectangle(0, (int)njudge * 60, 90, 60); + JudgeAnime.Index++; + if (JudgeAnime.Index >= 511) JudgeAnime.Index = 0; + } + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + + private JudgeAnime[,] JudgeAnimes; + private class JudgeAnime + { + public static int Index; + public E蛻、螳 Judge; + public Rectangle rc; + public CCounter counter = new CCounter(); + } + + private float CubicEaseOut(float p) + { + float f = (p - 1); + return f * f * f + 1; + } + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums貍泌・冗オゆコ貍泌コ.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums貍泌・冗オゆコ貍泌コ.cs new file mode 100644 index 00000000..c4c64660 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums貍泌・冗オゆコ貍泌コ.cs @@ -0,0 +1,453 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rums貍泌・冗オゆコ貍泌コ : CActivity + { + /// + /// 隱イ鬘 + /// _繧ッ繝ェ繧「螟ア謨 竊堤エ譚蝉ク崎カウ(遒コ菫昴ッ縺ァ縺阪k縲ょ繧雁コ縺励→蜉蟾・繧偵@縺ヲ縺ェ縺縺縺代) + /// _ + /// + public CAct貍泌・愁rums貍泌・冗オゆコ貍泌コ() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + public void Start() + { + // this.ct騾イ陦後Γ繧、繝ウ = new CCounter(0, 500, 1000 / 60, TJAPlayer3.Timer); + + this.ct騾イ陦後Γ繧、繝ウ = new CCounter(0, 300, 22, TJAPlayer3.Timer); + this.ctEnd_ClearFailed = new CCounter(0, 69, 30, TJAPlayer3.Timer); + this.ctEnd_FullCombo = new CCounter(0, 66, 33, TJAPlayer3.Timer); + this.ctEnd_FullComboLoop = new CCounter(0, 2, 30, TJAPlayer3.Timer); + this.ctEnd_DondaFullCombo = new CCounter(0, 61, 33, TJAPlayer3.Timer); + this.ctEnd_DondaFullComboLoop = new CCounter(0, 2, 30, TJAPlayer3.Timer); + + // 繝「繝シ繝峨ョ豎コ螳壹ゅけ繝ェ繧「螟ア謨励サ繝輔Ν繧ウ繝ウ繝懊b莠句燕縺ォ菴懊▲縺ィ縺上 + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan) + { + // 谿オ菴崎ェ榊ョ壹Δ繝シ繝峨 + if (!TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actDan.GetFailedAllChallenges()) + { + // 谿オ菴崎ェ榊ョ壹Δ繝シ繝峨√け繝ェ繧「謌仙粥 + this.Mode[0] = EndMode.StageCleared; + } + else + { + // 谿オ菴崎ェ榊ョ壹Δ繝シ繝峨√け繝ェ繧「螟ア謨 + this.Mode[0] = EndMode.StageFailed; + } + } + else + { + // 騾壼クク縺ョ繝「繝シ繝峨 + // 縺薙%縺ァ繝輔Ν繧ウ繝ウ繝懊ヵ繝ゥ繧ー繧偵メ繧ァ繝繧ッ縺吶k縺檎樟譎らせ縺ァ縺ッ縺ェ縺縲 + // 莉翫ョ谿オ髫弱〒縺ッ鬲ゅご繝シ繧ク80%莉・荳翫〒繝√ぉ繝繧ッ縲 + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[i] >= 80) + { + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.CBranchScore[i].nMiss == 0) + //if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Miss == 0) + { + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.CBranchScore[i].nGood == 0) + //if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Great == 0) + { + this.Mode[i] = EndMode.StageDondaFullCombo; + } + else + { + this.Mode[i] = EndMode.StageFullCombo; + } + } + else + { + this.Mode[i] = EndMode.StageCleared; + } + } + else + { + this.Mode[i] = EndMode.StageFailed; + } + } + } + } + + public override void On豢サ諤ァ蛹() + { + this.b繝ェ繧カ繝ォ繝医懊う繧ケ蜀咲函貂医∩ = false; + this.Mode = new EndMode[2]; + base.On豢サ諤ァ蛹(); + } + + public override void On髱樊エサ諤ァ蛹() + { + this.ct騾イ陦後Γ繧、繝ウ = null; + base.On髱樊エサ諤ァ蛹(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + this.b蜀咲函貂医∩ = false; + this.soundClear = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧(CSkin.Path(@"Sounds\Clear.ogg"), ESoundGroup.SoundEffect); + this.soundFailed = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧(CSkin.Path(@"Sounds\Failed.ogg"), ESoundGroup.SoundEffect); + this.soundFullCombo = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧(CSkin.Path(@"Sounds\Full combo.ogg"), ESoundGroup.SoundEffect); + this.soundDondaFullCombo = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧(CSkin.Path(@"Sounds\Donda Full Combo.ogg"), ESoundGroup.SoundEffect); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if (this.soundClear != null) + this.soundClear.t隗」謾セ縺吶k(); + if (this.soundFailed != null) + this.soundFailed.t隗」謾セ縺吶k(); + if (this.soundFullCombo != null) + this.soundFullCombo.t隗」謾セ縺吶k(); + if (this.soundDondaFullCombo != null) + this.soundDondaFullCombo.t隗」謾セ縺吶k(); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + #region [effects] + // ------------------------------------ + private void showEndEffect_Failed(int i) + { + int[] y = new int[] { 0, 176 }; + + this.ctEnd_ClearFailed.t騾イ陦(); + if (this.ctEnd_ClearFailed.n迴セ蝨ィ縺ョ蛟、 <= 20) + { + TJAPlayer3.Tx.End_ClearFailed[this.ctEnd_ClearFailed.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, 505, y[i] + 145); + } + if (this.ctEnd_ClearFailed.n迴セ蝨ィ縺ョ蛟、 >= 20 && this.ctEnd_ClearFailed.n迴セ蝨ィ縺ョ蛟、 <= 67) + { + TJAPlayer3.Tx.ClearFailed.t2D謠冗判(TJAPlayer3.app.Device, 502, y[i] + 192); + } + else if (this.ctEnd_ClearFailed.n迴セ蝨ィ縺ョ蛟、 == 68) + { + TJAPlayer3.Tx.ClearFailed1.t2D謠冗判(TJAPlayer3.app.Device, 502, y[i] + 192); + } + else if (this.ctEnd_ClearFailed.n迴セ蝨ィ縺ョ蛟、 >= 69) + { + TJAPlayer3.Tx.ClearFailed2.t2D謠冗判(TJAPlayer3.app.Device, 502, y[i] + 192); + } + } + private void showEndEffect_Clear(int i) + { + int[] y = new int[] { 210, 386 }; + #region[ 譁蟄 ] + //逋サ蝣エ繧「繝九Γ縺ッ20繝輔Ξ繝シ繝縲ゅ≧縺。譛蛻昴ョ5繝輔Ξ繝シ繝縺ッ蜊企城℃迥カ諷九 + float[] f譁蟄玲僑螟ァ邇 = new float[] { 1.04f, 1.11f, 1.15f, 1.19f, 1.23f, 1.26f, 1.30f, 1.31f, 1.32f, 1.32f, 1.32f, 1.30f, 1.30f, 1.26f, 1.25f, 1.19f, 1.15f, 1.11f, 1.05f, 1.0f }; + int[] n騾乗主コヲ = new int[] { 43, 85, 128, 170, 213, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }; + if (this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 >= 17) + { + if (this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 <= 36) + { + TJAPlayer3.Tx.End_Clear_Text_.vc諡。螟ァ邵ョ蟆丞咲紫.Y = f譁蟄玲僑螟ァ邇[this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 17]; + TJAPlayer3.Tx.End_Clear_Text_.Opacity = n騾乗主コヲ[this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 17]; + TJAPlayer3.Tx.End_Clear_Text_.t2D謠冗判(TJAPlayer3.app.Device, 634, (int)(y[i] - ((90 * f譁蟄玲僑螟ァ邇[this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 17]) - 90)), new Rectangle(0, 0, 90, 90)); + } + else + { + TJAPlayer3.Tx.End_Clear_Text_.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + TJAPlayer3.Tx.End_Clear_Text_.t2D謠冗判(TJAPlayer3.app.Device, 634, y[i], new Rectangle(0, 0, 90, 90)); + } + } + if (this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 >= 19) + { + if (this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 <= 38) + { + TJAPlayer3.Tx.End_Clear_Text_.vc諡。螟ァ邵ョ蟆丞咲紫.Y = f譁蟄玲僑螟ァ邇[this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 19]; + TJAPlayer3.Tx.End_Clear_Text_.Opacity = n騾乗主コヲ[this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 19]; + TJAPlayer3.Tx.End_Clear_Text_.t2D謠冗判(TJAPlayer3.app.Device, 692, (int)(y[i] - ((90 * f譁蟄玲僑螟ァ邇[this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 19]) - 90)), new Rectangle(90, 0, 90, 90)); + } + else + { + TJAPlayer3.Tx.End_Clear_Text_.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + TJAPlayer3.Tx.End_Clear_Text_.t2D謠冗判(TJAPlayer3.app.Device, 692, y[i], new Rectangle(90, 0, 90, 90)); + } + } + TJAPlayer3.Tx.End_Clear_Text_.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + if (this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 >= 21) + { + if (this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 <= 40) + { + TJAPlayer3.Tx.End_Clear_Text_.vc諡。螟ァ邵ョ蟆丞咲紫.Y = f譁蟄玲僑螟ァ邇[this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 21]; + TJAPlayer3.Tx.End_Clear_Text_.Opacity = n騾乗主コヲ[this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 21]; + TJAPlayer3.Tx.End_Clear_Text_.t2D謠冗判(TJAPlayer3.app.Device, 750, y[i] - (int)((90 * f譁蟄玲僑螟ァ邇[this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 21]) - 90), new Rectangle(180, 0, 90, 90)); + } + else + { + TJAPlayer3.Tx.End_Clear_Text_.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + TJAPlayer3.Tx.End_Clear_Text_.t2D謠冗判(TJAPlayer3.app.Device, 750, y[i], new Rectangle(180, 0, 90, 90)); + } + } + if (this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 >= 23) + { + if (this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 <= 42) + { + TJAPlayer3.Tx.End_Clear_Text_.vc諡。螟ァ邵ョ蟆丞咲紫.Y = f譁蟄玲僑螟ァ邇[this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 23]; + TJAPlayer3.Tx.End_Clear_Text_.Opacity = n騾乗主コヲ[this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 23]; + TJAPlayer3.Tx.End_Clear_Text_.t2D謠冗判(TJAPlayer3.app.Device, 819, y[i] - (int)((90 * f譁蟄玲僑螟ァ邇[this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 23]) - 90), new Rectangle(270, 0, 90, 90)); + } + else + { + TJAPlayer3.Tx.End_Clear_Text_.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + TJAPlayer3.Tx.End_Clear_Text_.t2D謠冗判(TJAPlayer3.app.Device, 819, y[i], new Rectangle(270, 0, 90, 90)); + } + } + if (this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 >= 25) + { + if (this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 <= 44) + { + TJAPlayer3.Tx.End_Clear_Text_.vc諡。螟ァ邵ョ蟆丞咲紫.Y = f譁蟄玲僑螟ァ邇[this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 25]; + TJAPlayer3.Tx.End_Clear_Text_.Opacity = n騾乗主コヲ[this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 25]; + TJAPlayer3.Tx.End_Clear_Text_.t2D謠冗判(TJAPlayer3.app.Device, 890, (y[i] + 2) - (int)((90 * f譁蟄玲僑螟ァ邇[this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 25]) - 90), new Rectangle(360, 0, 90, 90)); + } + else + { + TJAPlayer3.Tx.End_Clear_Text_.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + TJAPlayer3.Tx.End_Clear_Text_.t2D謠冗判(TJAPlayer3.app.Device, 890, y[i] + 2, new Rectangle(360, 0, 90, 90)); + } + } + if (this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 >= 50 && this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 < 90) + { + if (this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 < 70) + { + TJAPlayer3.Tx.End_Clear_Text_Effect.Opacity = (this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 50) * (255 / 20); + TJAPlayer3.Tx.End_Clear_Text_Effect.t2D謠冗判(TJAPlayer3.app.Device, 634, y[i] - 2); + } + else + { + TJAPlayer3.Tx.End_Clear_Text_Effect.Opacity = 255 - ((this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 70) * (255 / 20)); + TJAPlayer3.Tx.End_Clear_Text_Effect.t2D謠冗判(TJAPlayer3.app.Device, 634, y[i] - 2); + } + } + #endregion + #region[ 繝舌メ縺 ] + if (this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 <= 11) + { + if (TJAPlayer3.Tx.End_Clear_L[1] != null) + { + TJAPlayer3.Tx.End_Clear_L[1].t2D謠冗判(TJAPlayer3.app.Device, 697, y[i] - 30); + TJAPlayer3.Tx.End_Clear_L[1].Opacity = (int)(11.0 / this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、) * 255; + } + if (TJAPlayer3.Tx.End_Clear_R[1] != null) + { + TJAPlayer3.Tx.End_Clear_R[1].t2D謠冗判(TJAPlayer3.app.Device, 738, y[i] - 30); + TJAPlayer3.Tx.End_Clear_R[1].Opacity = (int)(11.0 / this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、) * 255; + } + } + else if (this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 <= 35) + { + if (TJAPlayer3.Tx.End_Clear_L[0] != null) + TJAPlayer3.Tx.End_Clear_L[0].t2D謠冗判(TJAPlayer3.app.Device, 697 - (int)((this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 12) * 10), y[i] - 30); + if (TJAPlayer3.Tx.End_Clear_R[0] != null) + TJAPlayer3.Tx.End_Clear_R[0].t2D謠冗判(TJAPlayer3.app.Device, 738 + (int)((this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 12) * 10), y[i] - 30); + } + else if (this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 <= 46) + { + if (TJAPlayer3.Tx.End_Clear_L[0] != null) + { + //2016.07.16 kairera0467 縺セ縺溘b蜴溷ァ狗噪... + float[] fRet = new float[] { 1.0f, 0.99f, 0.98f, 0.97f, 0.96f, 0.95f, 0.96f, 0.97f, 0.98f, 0.99f, 1.0f }; + TJAPlayer3.Tx.End_Clear_L[0].t2D謠冗判(TJAPlayer3.app.Device, 466, y[i] - 30); + TJAPlayer3.Tx.End_Clear_L[0].vc諡。螟ァ邵ョ蟆丞咲紫 = new SlimDX.Vector3(fRet[this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 36], 1.0f, 1.0f); + //CDTXMania.Tx.End_Clear_R[ 0 ].t2D謠冗判( CDTXMania.app.Device, 956 + (( this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 36 ) / 2), 180 ); + TJAPlayer3.Tx.End_Clear_R[0].t2D謠冗判(TJAPlayer3.app.Device, 1136 - 180 * fRet[this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 36], y[i] - 30); + TJAPlayer3.Tx.End_Clear_R[0].vc諡。螟ァ邵ョ蟆丞咲紫 = new SlimDX.Vector3(fRet[this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 - 36], 1.0f, 1.0f); + } + } + else if (this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 <= 49) + { + if (TJAPlayer3.Tx.End_Clear_L[1] != null) + TJAPlayer3.Tx.End_Clear_L[1].t2D謠冗判(TJAPlayer3.app.Device, 466, y[i] - 30); + if (TJAPlayer3.Tx.End_Clear_R[1] != null) + TJAPlayer3.Tx.End_Clear_R[1].t2D謠冗判(TJAPlayer3.app.Device, 956, y[i] - 30); + } + else if (this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 <= 54) + { + if (TJAPlayer3.Tx.End_Clear_L[2] != null) + TJAPlayer3.Tx.End_Clear_L[2].t2D謠冗判(TJAPlayer3.app.Device, 466, y[i] - 30); + if (TJAPlayer3.Tx.End_Clear_R[2] != null) + TJAPlayer3.Tx.End_Clear_R[2].t2D謠冗判(TJAPlayer3.app.Device, 956, y[i] - 30); + } + else if (this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 <= 58) + { + if (TJAPlayer3.Tx.End_Clear_L[3] != null) + TJAPlayer3.Tx.End_Clear_L[3].t2D謠冗判(TJAPlayer3.app.Device, 466, y[i] - 30); + if (TJAPlayer3.Tx.End_Clear_R[3] != null) + TJAPlayer3.Tx.End_Clear_R[3].t2D謠冗判(TJAPlayer3.app.Device, 956, y[i] - 30); + } + else + { + if (TJAPlayer3.Tx.End_Clear_L[4] != null) + TJAPlayer3.Tx.End_Clear_L[4].t2D謠冗判(TJAPlayer3.app.Device, 466, y[i] - 30); + if (TJAPlayer3.Tx.End_Clear_R[4] != null) + TJAPlayer3.Tx.End_Clear_R[4].t2D謠冗判(TJAPlayer3.app.Device, 956, y[i] - 30); + } + #endregion + } + + private void showEndEffect_FullCombo(int i) + { + int[] y = new int[] { 0, 176 }; + + this.ctEnd_FullCombo.t騾イ陦(); + TJAPlayer3.Tx.End_FullCombo[this.ctEnd_FullCombo.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, 330, y[i] + 50); + if (this.ctEnd_FullCombo.b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.ctEnd_FullComboLoop.t騾イ陦鍬oop(); + TJAPlayer3.Tx.End_FullComboLoop[this.ctEnd_FullComboLoop.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, 330, y[i] + 196); + } + } + + private void showEndEffect_DondaFullCombo(int i) + { + int[] y = new int[] { 0, 176 }; + + this.ctEnd_DondaFullCombo.t騾イ陦(); + if (this.ctEnd_DondaFullCombo.n迴セ蝨ィ縺ョ蛟、 >= 34) TJAPlayer3.Tx.End_DondaFullComboBg.t2D謠冗判(TJAPlayer3.app.Device, 332, y[i] + 192); + TJAPlayer3.Tx.End_DondaFullCombo[this.ctEnd_DondaFullCombo.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, 330, y[i] + 50); + + /* + if (this.ctEnd_DondaFullCombo.b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.ctEnd_DondaFullComboLoop.t騾イ陦鍬oop(); + TJAPlayer3.Tx.End_DondaFullComboLoop[this.ctEnd_DondaFullComboLoop.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, 330, 196); + } + */ + } + // ------------------------------------ + #endregion + + public override int On騾イ陦梧緒逕サ() + { + if (base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ) + { + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + if (this.ct騾イ陦後Γ繧、繝ウ != null && (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.e繝輔ぉ繝シ繧コID == CStage.E繝輔ぉ繝シ繧コ.貍泌・柔貍泌・冗オゆコ貍泌コ || TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.e繝輔ぉ繝シ繧コID == CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_CLEAR_繝輔ぉ繝シ繝峨い繧ヲ繝)) + { + this.ct騾イ陦後Γ繧、繝ウ.t騾イ陦(); + + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 0, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.轣ー, this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、.ToString() ); + //莉ョ鄂ョ縺 + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + switch (this.Mode[i]) + { + case EndMode.StageFailed: + //this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 = 18; + if (this.soundFailed != null && !this.b蜀咲函貂医∩) + { + this.soundFailed.t蜀咲函繧帝幕蟋九☆繧(); + this.b蜀咲函貂医∩ = true; + } + this.showEndEffect_Failed(i); + break; + case EndMode.StageCleared: + //this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 = 18; + if (this.soundClear != null && !this.b蜀咲函貂医∩) + { + this.soundClear.t蜀咲函繧帝幕蟋九☆繧(); + this.b蜀咲函貂医∩ = true; + } + this.showEndEffect_Clear(i); + break; + case EndMode.StageFullCombo: + //this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 = 18; + if (this.soundFullCombo != null && !this.b蜀咲函貂医∩) + { + this.soundFullCombo.t蜀咲函繧帝幕蟋九☆繧(); + this.b蜀咲函貂医∩ = true; + } + this.showEndEffect_FullCombo(i); + break; + case EndMode.StageDondaFullCombo: + //this.ct騾イ陦後Γ繧、繝ウ.n迴セ蝨ィ縺ョ蛟、 = 18; + if (this.soundDondaFullCombo != null && !this.b蜀咲函貂医∩) + { + this.soundDondaFullCombo.t蜀咲函繧帝幕蟋九☆繧(); + this.b蜀咲函貂医∩ = true; + } + this.showEndEffect_DondaFullCombo(i); + break; + default: + break; + } + + } + + + + if (this.ct騾イ陦後Γ繧、繝ウ.b邨ゆコ蛟、縺ォ驕斐@縺) + { + return 1; + } + } + + return 0; + } + + #region[ private ] + //----------------- + bool b蜀咲函貂医∩; + bool b繝ェ繧カ繝ォ繝医懊う繧ケ蜀咲函貂医∩; + CCounter ct騾イ陦後Γ繧、繝ウ; + + CCounter ctEnd_ClearFailed; + CCounter ctEnd_FullCombo; + CCounter ctEnd_FullComboLoop; + CCounter ctEnd_DondaFullCombo; + CCounter ctEnd_DondaFullComboLoop; + + CCounter ct騾イ陦鍬oop; + CSound soundClear; + CSound soundFailed; + CSound soundFullCombo; + CSound soundDondaFullCombo; + EndMode[] Mode; + enum EndMode + { + StageFailed, + StageCleared, + StageFullCombo, + StageDondaFullCombo + } + + void StarDraw(int x, int y, int count, int starttime = 0, int Endtime = 20) + { + if (count >= 0 && count <= Endtime) + { + count += starttime; + + if (count <= 11) + { + TJAPlayer3.Tx.End_Star.vc諡。螟ァ邵ョ蟆丞咲紫.X = count * 0.09f; + TJAPlayer3.Tx.End_Star.vc諡。螟ァ邵ョ蟆丞咲紫.Y = count * 0.09f; + TJAPlayer3.Tx.End_Star.Opacity = 255; + TJAPlayer3.Tx.End_Star.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x, y); + } + else if (count <= 20) + { + TJAPlayer3.Tx.End_Star.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + TJAPlayer3.Tx.End_Star.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + TJAPlayer3.Tx.End_Star.Opacity = (int)(255 - (255.0f / 9.0f) * (count - 11)); + TJAPlayer3.Tx.End_Star.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x, y); + } + } + } + + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums迚ケ險薙Δ繝シ繝.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums迚ケ險薙Δ繝シ繝.cs new file mode 100644 index 00000000..8125eb13 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums迚ケ險薙Δ繝シ繝.cs @@ -0,0 +1,601 @@ +サソusing FDK; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Diagnostics; +using System.Drawing; + +namespace TJAPlayer3 +{ + class CAct貍泌・愁rums迚ケ險薙Δ繝シ繝 : CActivity + { + public CAct貍泌・愁rums迚ケ險薙Δ繝シ繝() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + public override void On豢サ諤ァ蛹() + { + this.n迴セ蝨ィ縺ョ蟆冗ッ邱 = 0; + this.b迚ケ險撤AUSE = false; + this.n譛邨よシ泌・丈ス咲スョms = 0; + + base.On豢サ諤ァ蛹(); + + CDTX dTX = TJAPlayer3.DTX; + + var measureCount = 1; + var bIsInGoGo = false; + + int endtime = 1; + int bgmlength = 1; + + for (int index = 0; index < TJAPlayer3.DTX.listChip.Count; index++) + { + if (TJAPlayer3.DTX.listChip[index].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0xff) + { + endtime = TJAPlayer3.DTX.listChip[index].n逋コ螢ー譎ょ綾ms; + break; + } + } + for (int index = 0; index < TJAPlayer3.DTX.listChip.Count; index++) + { + if (TJAPlayer3.DTX.listChip[index].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01) + { + bgmlength = TJAPlayer3.DTX.listChip[index].GetDuration() + TJAPlayer3.DTX.listChip[index].n逋コ螢ー譎ょ綾ms; + break; + } + } + + length = Math.Max(endtime, bgmlength); + + gogoXList = new List(); + JumpPointList = new List(); + + for (int i = 0; i < dTX.listChip.Count; i++) + { + CDTX.CChip pChip = dTX.listChip[i]; + + if (pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ > measureCount && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x50) measureCount = pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ; + + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x9E && !bIsInGoGo) + { + bIsInGoGo = true; + + var current = ((double)(pChip.db逋コ螢ー譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))); + var width = 0; + if (TJAPlayer3.Tx.Tokkun_ProgressBar != null) width = TJAPlayer3.Tx.Tokkun_ProgressBar.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + + this.gogoXList.Add((int)(width * (current / length))); + } + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x9F && bIsInGoGo) + { + bIsInGoGo = false; + } + } + + this.n蟆冗ッ縺ョ邱乗焚 = measureCount; + } + + public override void On髱樊エサ諤ァ蛹() + { + length = 1; + gogoXList = null; + JumpPointList = null; + base.On髱樊エサ諤ァ蛹(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + if (TJAPlayer3.Tx.Tokkun_Background_Up != null) this.ct閭梧勹繧ケ繧ッ繝ュ繝シ繝ォ繧ソ繧、繝槭シ = new CCounter(1, TJAPlayer3.Tx.Tokkun_Background_Up.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, 16, TJAPlayer3.Timer); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + this.ct繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ繝シ = null; + this.ct閭梧勹繧ケ繧ッ繝ュ繝シ繝ォ繧ソ繧、繝槭シ = null; + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + + public override int On騾イ陦梧緒逕サ() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + if (base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ) + { + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, "TRAINING MODE (BETA)"); + + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.Space)|| TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RRed2P)) + { + if (this.b迚ケ險撤AUSE) + { + TJAPlayer3.Skin.sound迚ケ險灘咲函髻ウ.t蜀咲函縺吶k(); + this.t貍泌・上r蜀埼幕縺吶k(); + } + else + { + TJAPlayer3.Skin.sound迚ケ險灘●豁「髻ウ.t蜀咲函縺吶k(); + this.t貍泌・上r蛛懈ュ「縺吶k(); + } + } + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.LeftArrow) || TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LBlue)) + { + if (this.b迚ケ險撤AUSE) + { + if (this.n迴セ蝨ィ縺ョ蟆冗ッ邱 > 1) + { + this.n迴セ蝨ィ縺ョ蟆冗ッ邱--; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.NowMeasure[0] = this.n迴セ蝨ィ縺ョ蟆冗ッ邱; + + this.t隴憺擇縺ョ陦ィ遉コ菴咲スョ繧貞粋繧上○繧(true); + TJAPlayer3.Skin.sound迚ケ險薙せ繧ッ繝ュ繝シ繝ォ髻ウ.t蜀咲函縺吶k(); + } + if (t驟榊励ョ蛟、interval莉・荳九°(ref this.LBlue, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms, TJAPlayer3.ConfigIni.TokkunMashInterval)) + { + for (int index = this.JumpPointList.Count - 1; index >= 0; index--) + { + if (this.JumpPointList[index].Time <= CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) + { + this.n迴セ蝨ィ縺ョ蟆冗ッ邱 = this.JumpPointList[index].Measure; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.NowMeasure[0] = this.n迴セ蝨ィ縺ョ蟆冗ッ邱; + TJAPlayer3.Skin.sound迚ケ險薙せ繧ュ繝繝鈴浹.t蜀咲函縺吶k(); + this.t隴憺擇縺ョ陦ィ遉コ菴咲スョ繧貞粋繧上○繧(false); + break; + } + } + } + } + } + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.PageDown)) + { + if (this.b迚ケ險撤AUSE) + { + this.n迴セ蝨ィ縺ョ蟆冗ッ邱 -= TJAPlayer3.ConfigIni.TokkunSkipMeasures; + if (this.n迴セ蝨ィ縺ョ蟆冗ッ邱 <= 0) + this.n迴セ蝨ィ縺ョ蟆冗ッ邱 = 1; + + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.NowMeasure[0] = this.n迴セ蝨ィ縺ョ蟆冗ッ邱; + + this.t隴憺擇縺ョ陦ィ遉コ菴咲スョ繧貞粋繧上○繧(true); + TJAPlayer3.Skin.sound迚ケ險薙せ繧ッ繝ュ繝シ繝ォ髻ウ.t蜀咲函縺吶k(); + } + } + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.RightArrow) || TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RBlue)) + { + if (this.b迚ケ險撤AUSE) + { + if (this.n迴セ蝨ィ縺ョ蟆冗ッ邱 < this.n蟆冗ッ縺ョ邱乗焚) + { + this.n迴セ蝨ィ縺ョ蟆冗ッ邱++; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.NowMeasure[0] = this.n迴セ蝨ィ縺ョ蟆冗ッ邱; + + this.t隴憺擇縺ョ陦ィ遉コ菴咲スョ繧貞粋繧上○繧(true); + TJAPlayer3.Skin.sound迚ケ險薙せ繧ッ繝ュ繝シ繝ォ髻ウ.t蜀咲函縺吶k(); + } + if (t驟榊励ョ蛟、interval莉・荳九°(ref this.RBlue, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n繧キ繧ケ繝繝譎ょ綾ms, TJAPlayer3.ConfigIni.TokkunMashInterval)) + { + for (int index = 0; index < this.JumpPointList.Count; index++) + { + if (this.JumpPointList[index].Time >= CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) + { + this.n迴セ蝨ィ縺ョ蟆冗ッ邱 = this.JumpPointList[index].Measure; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.NowMeasure[0] = this.n迴セ蝨ィ縺ョ蟆冗ッ邱; + TJAPlayer3.Skin.soundSkip.t蜀咲函縺吶k(); + this.t隴憺擇縺ョ陦ィ遉コ菴咲スョ繧貞粋繧上○繧(false); + break; + } + } + } + + } + } + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.PageUp)) + { + if (this.b迚ケ險撤AUSE) + { + this.n迴セ蝨ィ縺ョ蟆冗ッ邱 += TJAPlayer3.ConfigIni.TokkunSkipMeasures; + if (this.n迴セ蝨ィ縺ョ蟆冗ッ邱 > this.n蟆冗ッ縺ョ邱乗焚) + this.n迴セ蝨ィ縺ョ蟆冗ッ邱 = this.n蟆冗ッ縺ョ邱乗焚; + + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.NowMeasure[0] = this.n迴セ蝨ィ縺ョ蟆冗ッ邱; + + this.t隴憺擇縺ョ陦ィ遉コ菴咲スョ繧貞粋繧上○繧(true); + TJAPlayer3.Skin.sound迚ケ險薙せ繧ッ繝ュ繝シ繝ォ髻ウ.t蜀咲函縺吶k(); + } + } + if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LBlue2P)) + { + if (this.b迚ケ險撤AUSE) + { + if (TJAPlayer3.ConfigIni.n貍泌・城溷コヲ > 6) + { + TJAPlayer3.ConfigIni.n貍泌・城溷コヲ = TJAPlayer3.ConfigIni.n貍泌・城溷コヲ - 2; + this.t隴憺擇縺ョ陦ィ遉コ菴咲スョ繧貞粋繧上○繧(false); + } + } + } + if (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RBlue2P)) + { + if (this.b迚ケ險撤AUSE) + { + if (TJAPlayer3.ConfigIni.n貍泌・城溷コヲ < 399) + { + TJAPlayer3.ConfigIni.n貍泌・城溷コヲ = TJAPlayer3.ConfigIni.n貍泌・城溷コヲ + 2; + this.t隴憺擇縺ョ陦ィ遉コ菴咲スョ繧貞粋繧上○繧(false); + } + } + } + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.Home)) + { + if (this.b迚ケ險撤AUSE) + { + if (this.n迴セ蝨ィ縺ョ蟆冗ッ邱 > 1) + { + this.n迴セ蝨ィ縺ョ蟆冗ッ邱 = 1; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.NowMeasure[0] = this.n迴セ蝨ィ縺ョ蟆冗ッ邱; + + this.t隴憺擇縺ョ陦ィ遉コ菴咲スョ繧貞粋繧上○繧(true); + TJAPlayer3.Skin.sound迚ケ險薙せ繧ッ繝ュ繝シ繝ォ髻ウ.t蜀咲函縺吶k(); + } + } + } + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.End)) + { + if (this.b迚ケ險撤AUSE) + { + if (this.n迴セ蝨ィ縺ョ蟆冗ッ邱 < this.n蟆冗ッ縺ョ邱乗焚) + { + this.n迴セ蝨ィ縺ョ蟆冗ッ邱 = this.n蟆冗ッ縺ョ邱乗焚; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.NowMeasure[0] = this.n迴セ蝨ィ縺ョ蟆冗ッ邱; + + this.t隴憺擇縺ョ陦ィ遉コ菴咲スョ繧貞粋繧上○繧(true); + TJAPlayer3.Skin.sound迚ケ險薙せ繧ッ繝ュ繝シ繝ォ髻ウ.t蜀咲函縺吶k(); + } + } + } + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.A)) + this.t迴セ蝨ィ縺ョ菴咲スョ縺ォ繧ク繝」繝ウ繝励昴う繝ウ繝医r險ュ螳壹☆繧(); + + if (this.b繧ケ繧ッ繝ュ繝シ繝ォ荳ュ) + { + CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms = easing.EaseOut(this.ct繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ繝シ, (int)this.n繧ケ繧ッ繝ュ繝シ繝ォ蜑肯s, (int)this.n繧ケ繧ッ繝ュ繝シ繝ォ蠕稽s, Easing.CalcType.Circular); + + this.ct繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ繝シ.t騾イ陦(); + + if ((int)CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms == (int)this.n繧ケ繧ッ繝ュ繝シ繝ォ蠕稽s) + { + this.b繧ケ繧ッ繝ュ繝シ繝ォ荳ュ = false; + CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms = this.n繧ケ繧ッ繝ュ繝シ繝ォ蠕稽s; + } + } + if (!this.b迚ケ險撤AUSE) + { + if (this.n迴セ蝨ィ縺ョ蟆冗ッ邱 < TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.NowMeasure[0]) + { + this.n迴セ蝨ィ縺ョ蟆冗ッ邱 = TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.NowMeasure[0]; + } + + if (CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0) > this.n譛邨よシ泌・丈ス咲スョms) + { + this.n譛邨よシ泌・丈ス咲スョms = (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + } + } + + } + + var current = (double)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + var percentage = current / length; + + var currentWhite = (double)(this.n譛邨よシ泌・丈ス咲スョms); + var percentageWhite = currentWhite / length; + + if (TJAPlayer3.Tx.Tokkun_ProgressBarWhite != null) TJAPlayer3.Tx.Tokkun_ProgressBarWhite.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Training_ProgressBar_XY[0], TJAPlayer3.Skin.Game_Training_ProgressBar_XY[1], new Rectangle(1, 1, (int)(TJAPlayer3.Tx.Tokkun_ProgressBarWhite.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width * percentageWhite), TJAPlayer3.Tx.Tokkun_ProgressBarWhite.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + if (TJAPlayer3.Tx.Tokkun_ProgressBar != null) TJAPlayer3.Tx.Tokkun_ProgressBar.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Training_ProgressBar_XY[0], TJAPlayer3.Skin.Game_Training_ProgressBar_XY[1], new Rectangle(1, 1, (int)(TJAPlayer3.Tx.Tokkun_ProgressBar.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width * percentage), TJAPlayer3.Tx.Tokkun_ProgressBar.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + if (TJAPlayer3.Tx.Tokkun_GoGoPoint != null) + { + foreach (int xpos in gogoXList) + { + TJAPlayer3.Tx.Tokkun_GoGoPoint.t2D謠冗判(TJAPlayer3.app.Device, xpos + TJAPlayer3.Skin.Game_Training_ProgressBar_XY[0] - (TJAPlayer3.Tx.Tokkun_GoGoPoint.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2), TJAPlayer3.Skin.Game_Training_GoGoPoint_Y); + } + } + + if (TJAPlayer3.Tx.Tokkun_JumpPoint != null) + { + foreach (STJUMPP xpos in JumpPointList) + { + var width = 0; + if (TJAPlayer3.Tx.Tokkun_ProgressBar != null) width = TJAPlayer3.Tx.Tokkun_ProgressBar.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + + int x = (int)((double)width * ((double)xpos.Time / (double)length)); + TJAPlayer3.Tx.Tokkun_JumpPoint.t2D謠冗判(TJAPlayer3.app.Device, x + TJAPlayer3.Skin.Game_Training_ProgressBar_XY[0] - (TJAPlayer3.Tx.Tokkun_JumpPoint.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2), TJAPlayer3.Skin.Game_Training_JumpPoint_Y); + } + } + + return base.On騾イ陦梧緒逕サ(); + } + + public int On騾イ陦梧緒逕サ_閭梧勹() + { + if (this.ct閭梧勹繧ケ繧ッ繝ュ繝シ繝ォ繧ソ繧、繝槭シ != null) + { + this.ct閭梧勹繧ケ繧ッ繝ュ繝シ繝ォ繧ソ繧、繝槭シ.t騾イ陦鍬oop(); + + double TexSize = 1280 / TJAPlayer3.Tx.Tokkun_Background_Up.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + // 1280繧偵ユ繧ッ繧ケ繝√Ε繧オ繧、繧コ縺ァ蜑イ縺」縺溘b縺ョ繧貞繧贋ク翫£縺ヲ縲√励Λ繧ケ+1雜ウ縺吶 + int ForLoop = (int)Math.Ceiling(TexSize) + 1; + TJAPlayer3.Tx.Tokkun_Background_Up.t2D謠冗判(TJAPlayer3.app.Device, 0 - this.ct閭梧勹繧ケ繧ッ繝ュ繝シ繝ォ繧ソ繧、繝槭シ.n迴セ蝨ィ縺ョ蛟、, TJAPlayer3.Skin.Background_Scroll_Y[0]); + for (int l = 1; l < ForLoop + 1; l++) + { + TJAPlayer3.Tx.Tokkun_Background_Up.t2D謠冗判(TJAPlayer3.app.Device, +(l * TJAPlayer3.Tx.Tokkun_Background_Up.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width) - this.ct閭梧勹繧ケ繧ッ繝ュ繝シ繝ォ繧ソ繧、繝槭シ.n迴セ蝨ィ縺ョ蛟、, TJAPlayer3.Skin.Background_Scroll_Y[0]); + } + } + + if (TJAPlayer3.Tx.Tokkun_DownBG != null) TJAPlayer3.Tx.Tokkun_DownBG.t2D謠冗判(TJAPlayer3.app.Device, 0, 360); + if (TJAPlayer3.Tx.Tokkun_BigTaiko != null) TJAPlayer3.Tx.Tokkun_BigTaiko.t2D謠冗判(TJAPlayer3.app.Device, 334, 400); + + return base.On騾イ陦梧緒逕サ(); + } + + public void On騾イ陦梧緒逕サ_蟆冗ッ_騾溷コヲ() + { + if (TJAPlayer3.Tx.Tokkun_Speed_Measure != null) + TJAPlayer3.Tx.Tokkun_Speed_Measure.t2D謠冗判(TJAPlayer3.app.Device, 0, 360); + var maxMeasureStr = this.n蟆冗ッ縺ョ邱乗焚.ToString(); + var measureStr = TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.NowMeasure[0].ToString(); + if (TJAPlayer3.Tx.Tokkun_SmallNumber != null) + { + var x = TJAPlayer3.Skin.Game_Training_MaxMeasureCount_XY[0]; + foreach (char c in maxMeasureStr) + { + var currentNum = int.Parse(c.ToString()); + TJAPlayer3.Tx.Tokkun_SmallNumber.t2D謠冗判(TJAPlayer3.app.Device, x, TJAPlayer3.Skin.Game_Training_MaxMeasureCount_XY[1], new Rectangle(TJAPlayer3.Skin.Game_Training_SmallNumber_Width * currentNum, 0, TJAPlayer3.Skin.Game_Training_SmallNumber_Width, TJAPlayer3.Tx.Tokkun_SmallNumber.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + x += TJAPlayer3.Skin.Game_Training_SmallNumber_Width - 2; + } + } + + var subtractVal = (TJAPlayer3.Skin.Game_Training_BigNumber_Width - 2) * (measureStr.Length - 1); + + if (TJAPlayer3.Tx.Tokkun_BigNumber != null) + { + var x = TJAPlayer3.Skin.Game_Training_CurrentMeasureCount_XY[0]; + foreach (char c in measureStr) + { + var currentNum = int.Parse(c.ToString()); + TJAPlayer3.Tx.Tokkun_BigNumber.t2D謠冗判(TJAPlayer3.app.Device, x - subtractVal, TJAPlayer3.Skin.Game_Training_CurrentMeasureCount_XY[1], new Rectangle(TJAPlayer3.Skin.Game_Training_BigNumber_Width * currentNum, 0, TJAPlayer3.Skin.Game_Training_BigNumber_Width, TJAPlayer3.Tx.Tokkun_BigNumber.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + x += TJAPlayer3.Skin.Game_Training_BigNumber_Width - 2; + } + + var PlaySpdtmp = TJAPlayer3.ConfigIni.n貍泌・城溷コヲ / 20.0d * 10.0d; + PlaySpdtmp = Math.Round(PlaySpdtmp, MidpointRounding.AwayFromZero); + + var playSpd = PlaySpdtmp / 10.0d; + var playSpdI = playSpd - (int)playSpd; + var playSpdStr = Decimal.Round((decimal)playSpdI, 1, MidpointRounding.AwayFromZero).ToString(); + var decimalStr = (playSpdStr == "0") ? "0" : playSpdStr[2].ToString(); + + TJAPlayer3.Tx.Tokkun_BigNumber.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Training_SpeedDisplay_XY[0], TJAPlayer3.Skin.Game_Training_SpeedDisplay_XY[1], new Rectangle(TJAPlayer3.Skin.Game_Training_BigNumber_Width * int.Parse(decimalStr), 0, TJAPlayer3.Skin.Game_Training_BigNumber_Width, TJAPlayer3.Tx.Tokkun_BigNumber.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + + x = TJAPlayer3.Skin.Game_Training_SpeedDisplay_XY[0] - 25; + + subtractVal = TJAPlayer3.Skin.Game_Training_BigNumber_Width * (((int)playSpd).ToString().Length - 1); + + foreach (char c in ((int)playSpd).ToString()) + { + var currentNum = int.Parse(c.ToString()); + TJAPlayer3.Tx.Tokkun_BigNumber.t2D謠冗判(TJAPlayer3.app.Device, x - subtractVal, TJAPlayer3.Skin.Game_Training_SpeedDisplay_XY[1], new Rectangle(TJAPlayer3.Skin.Game_Training_BigNumber_Width * currentNum, 0, TJAPlayer3.Skin.Game_Training_BigNumber_Width, TJAPlayer3.Tx.Tokkun_BigNumber.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + x += TJAPlayer3.Skin.Game_Training_BigNumber_Width - 2; + } + } + } + + public void t貍泌・上r蛛懈ュ「縺吶k() + { + CDTX dTX = TJAPlayer3.DTX; + + this.n繧ケ繧ッ繝ュ繝シ繝ォ蠕稽s = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms; + + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.On豢サ諤ァ蛹(); + CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.t荳譎ょ●豁「(); + + for (int i = 0; i < dTX.listChip.Count; i++) + { + CDTX.CChip pChip = dTX.listChip[i]; + pChip.bHit = false; + if (dTX.listChip[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x50) + { + pChip.bShow = true; + pChip.b蜿ッ隕 = true; + } + } + + TJAPlayer3.DTX.t蜈ィ繝√ャ繝励ョ蜀咲函荳譎ょ●豁「(); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bPAUSE = true; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.NowMeasure[0] = this.n迴セ蝨ィ縺ョ蟆冗ッ邱; + this.b迚ケ險撤AUSE = true; + + this.t隴憺擇縺ョ陦ィ遉コ菴咲スョ繧貞粋繧上○繧(false); + } + + public void t貍泌・上r蜀埼幕縺吶k() + { + CDTX dTX = TJAPlayer3.DTX; + + this.b繧ケ繧ッ繝ュ繝シ繝ォ荳ュ = false; + CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms = this.n繧ケ繧ッ繝ュ繝シ繝ォ蠕稽s; + + int n貍泌・城幕蟋気hip = TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n迴セ蝨ィ縺ョ繝医ャ繝佑hip; + int finalStartBar; + + finalStartBar = this.n迴セ蝨ィ縺ョ蟆冗ッ邱 - 2; + if (finalStartBar < 0) finalStartBar = 0; + + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.t貍泌・丈ス咲スョ縺ョ螟画峩(finalStartBar, 0); + + + int n蟆代@謌サ縺」縺ヲ縺九i貍泌・城幕蟋気hip = TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n迴セ蝨ィ縺ョ繝医ャ繝佑hip; + + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.NowMeasure[0] = 0; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.t謨ー蛟、縺ョ蛻晄悄蛹(true, true); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.On豢サ諤ァ蛹(); + + for (int i = 0; i < dTX.listChip.Count; i++) + { + if (i < n貍泌・城幕蟋気hip && (dTX.listChip[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ > 0x10 && dTX.listChip[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 0x20)) //2020.07.08 繝弱シ繝縺縺第カ医☆縲 null蜿らァ蝗樣∩縺ョ縺溘a縺ォ鬆逡ェ螟画峩 + { + dTX.listChip[i].bHit = true; + dTX.listChip[i].IsHitted = true; + dTX.listChip[i].b蜿ッ隕 = false; + dTX.listChip[i].bShow = false; + } + if (i < n蟆代@謌サ縺」縺ヲ縺九i貍泌・城幕蟋気hip && dTX.listChip[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x01) + { + dTX.listChip[i].bHit = true; + dTX.listChip[i].IsHitted = true; + dTX.listChip[i].b蜿ッ隕 = false; + dTX.listChip[i].bShow = false; + } + if (dTX.listChip[i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x50 && dTX.listChip[i].n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ < finalStartBar) + { + dTX.listChip[i].bHit = true; + dTX.listChip[i].IsHitted = true; + } + + } + + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕i] = null; + } + + this.b迚ケ險撤AUSE = false; + } + + public void t隴憺擇縺ョ陦ィ遉コ菴咲スョ繧貞粋繧上○繧(bool doScroll) + { + this.n繧ケ繧ッ繝ュ繝シ繝ォ蜑肯s = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms; + + CDTX dTX = TJAPlayer3.DTX; + + bool bSuccessSeek = false; + for (int i = 0; i < dTX.listChip.Count; i++) + { + CDTX.CChip pChip = dTX.listChip[i]; + + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x50 && pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ > n迴セ蝨ィ縺ョ蟆冗ッ邱 - 1) + { + bSuccessSeek = true; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n迴セ蝨ィ縺ョ繝医ャ繝佑hip = i; + break; + } + } + if (!bSuccessSeek) + { + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n迴セ蝨ィ縺ョ繝医ャ繝佑hip = 0; + } + else + { + while (dTX.listChip[TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n迴セ蝨ィ縺ョ繝医ャ繝佑hip].n逋コ螢ー譎ょ綾ms == dTX.listChip[TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n迴セ蝨ィ縺ョ繝医ャ繝佑hip - 1].n逋コ螢ー譎ょ綾ms && TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n迴セ蝨ィ縺ョ繝医ャ繝佑hip != 0) + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n迴セ蝨ィ縺ョ繝医ャ繝佑hip--; + } + + if (doScroll) + { + this.n繧ケ繧ッ繝ュ繝シ繝ォ蠕稽s = (long)(dTX.listChip[TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n迴セ蝨ィ縺ョ繝医ャ繝佑hip].n逋コ螢ー譎ょ綾ms / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + this.b繧ケ繧ッ繝ュ繝シ繝ォ荳ュ = true; + + this.ct繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ繝シ = new CCounter(0, TJAPlayer3.Skin.Game_Training_ScrollTime, 1, TJAPlayer3.Timer); + } + else + { + CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms = (long)(dTX.listChip[TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n迴セ蝨ィ縺ョ繝医ャ繝佑hip].n逋コ螢ー譎ょ綾ms / (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + this.n繧ケ繧ッ繝ュ繝シ繝ォ蠕稽s = CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms; + } + } + + public void t迴セ蝨ィ縺ョ菴咲スョ縺ォ繧ク繝」繝ウ繝励昴う繝ウ繝医r險ュ螳壹☆繧() + { + if (!this.b繧ケ繧ッ繝ュ繝シ繝ォ荳ュ && this.b迚ケ險撤AUSE) + { + if (!JumpPointList.Contains(new STJUMPP() { Time = (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)), Measure = this.n迴セ蝨ィ縺ョ蟆冗ッ邱 })) + JumpPointList.Add(new STJUMPP() { Time = (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)), Measure = this.n迴セ蝨ィ縺ョ蟆冗ッ邱 }); + TJAPlayer3.Skin.sound迚ケ險薙ず繝」繝ウ繝励昴う繝ウ繝.t蜀咲函縺吶k(); + JumpPointList.Sort((a, b) => a.Time.CompareTo(b.Time)); + } + } + + private bool t驟榊励ョ蛟、interval莉・荳九°(ref long[] array, long num, int interval) + { + long[] arraytmp = array; + for (int index = 0; index < (array.Length - 1); index++) + { + array[index] = array[index + 1]; + } + array[array.Length - 1] = num; + return Math.Abs(num - arraytmp[0]) <= interval; + } + + public int n迴セ蝨ィ縺ョ蟆冗ッ邱; + public int n蟆冗ッ縺ョ邱乗焚; + + #region [private] + private long n繧ケ繧ッ繝ュ繝シ繝ォ蜑肯s; + private long n繧ケ繧ッ繝ュ繝シ繝ォ蠕稽s; + private long n譛邨よシ泌・丈ス咲スョms; + + private bool b迚ケ險撤AUSE; + private bool b繧ケ繧ッ繝ュ繝シ繝ォ荳ュ; + + private CCounter ct繧ケ繧ッ繝ュ繝シ繝ォ繧ォ繧ヲ繝ウ繧ソ繝シ; + private CCounter ct閭梧勹繧ケ繧ッ繝ュ繝シ繝ォ繧ソ繧、繝槭シ; + private Easing easing = new Easing(); + private long length = 1; + + private List gogoXList; + private List JumpPointList; + private long[] LBlue = new long[] { 0, 0, 0, 0, 0 }; + private long[] RBlue = new long[] { 0, 0, 0, 0, 0 }; + + private struct STJUMPP + { + public long Time; + public int Measure; + } + + /// + /// + /// + /// 莉翫ョ譎る俣 + /// 譛蛻昴ョ蛟、 + /// 譛邨ゅョ蛟、-譛蛻昴ョ蛟、 + /// 蜈ィ菴薙ョ譎る俣 + /// + private int EasingCircular(int time, int begin, int change, int duration) + { + double t = time, b = begin, c = change, d = duration; + + t = t / d * 2; + if (t < 1) + return (int)(-c / 2 * (Math.Sqrt(1 - t * t) - 1) + b); + else + { + t = t - 2; + return (int)(c / 2 * (Math.Sqrt(1 - t * t) + 1) + b); + } + } + + #endregion + } +} + diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums閭梧勹.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums閭梧勹.cs new file mode 100644 index 00000000..d9049de6 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums閭梧勹.cs @@ -0,0 +1,371 @@ +サソusing System; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rums閭梧勹 : CActivity + { + // 譛ャ螳カ縺」縺ス縺閭梧勹繧定。ィ遉コ縺輔○繧九Γ繧ス繝繝峨 + // + // 諡。蠑オ諤ァ縺ィ縺九↑縺繧薙〒縲ゅッ縺縲√Κ繝ュ繧キ繧ッ繧・! + // + public CAct貍泌・愁rums閭梧勹() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + public void tFadeIn(int player) + { + this.ct荳願レ譎ッ繧ッ繝ェ繧「繧、繝ウ繧ソ繧、繝槭シ[player] = new CCounter(0, 100, 2, TJAPlayer3.Timer); + this.eFadeMode = EFIFO繝「繝シ繝.繝輔ぉ繝シ繝峨う繝ウ; + } + + //public void tFadeOut(int player) + //{ + // this.ct荳願レ譎ッ繝輔ぉ繝シ繝峨ち繧、繝槭シ[player] = new CCounter( 0, 100, 6, CDTXMania.Timer ); + // this.eFadeMode = EFIFO繝「繝シ繝.繝輔ぉ繝シ繝峨い繧ヲ繝; + //} + + public void ClearIn(int player) + { + this.ct荳願レ譎ッ繧ッ繝ェ繧「繧、繝ウ繧ソ繧、繝槭シ[player] = new CCounter(0, 100, 2, TJAPlayer3.Timer); + this.ct荳願レ譎ッ繧ッ繝ェ繧「繧、繝ウ繧ソ繧、繝槭シ[player].n迴セ蝨ィ縺ョ蛟、 = 0; + this.ct荳願レ譎ッFIFO繧ソ繧、繝槭シ = new CCounter(0, 100, 2, TJAPlayer3.Timer); + this.ct荳願レ譎ッFIFO繧ソ繧、繝槭シ.n迴セ蝨ィ縺ョ蛟、 = 0; + } + + public override void On豢サ諤ァ蛹() + { + base.On豢サ諤ァ蛹(); + } + + public override void On髱樊エサ諤ァ蛹() + { + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k(ref this.ct荳願レ譎ッFIFO繧ソ繧、繝槭シ); + for (int i = 0; i < 2; i++) + { + ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1st[i] = null; + ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2nd[i] = null; + ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd[i] = null; + } + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k(ref this.ct荳玖レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1); + base.On髱樊エサ諤ァ蛹(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1st = new CCounter[2]; + this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2nd = new CCounter[2]; + this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd = new CCounter[2]; + this.ct荳願レ譎ッ繧ッ繝ェ繧「繧、繝ウ繧ソ繧、繝槭シ = new CCounter[2]; + ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1stDan = new CCounter[4]; + + for (int i = 0; i < 2; i++) + { + if (TJAPlayer3.Tx.Background_Up_3rd[i] != null) + { + this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1st[i] = new CCounter(1, TJAPlayer3.Tx.Background_Up_1st[i].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, 16, TJAPlayer3.Timer); + this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2nd[i] = new CCounter(1, TJAPlayer3.Tx.Background_Up_2nd[i].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height, 70, TJAPlayer3.Timer); + this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd[i] = new CCounter(1, 600, 3, TJAPlayer3.Timer); + this.ct荳願レ譎ッ繧ッ繝ェ繧「繧、繝ウ繧ソ繧、繝槭シ[i] = new CCounter(); + } + } + + this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1stDan[0] = new CCounter(0, TJAPlayer3.Tx.Background_Up_Dan[1].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, 8.453f * 2, TJAPlayer3.Timer); + this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1stDan[1] = new CCounter(0, TJAPlayer3.Tx.Background_Up_Dan[2].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, 10.885f * 2, TJAPlayer3.Timer); + this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1stDan[2] = new CCounter(0, TJAPlayer3.Tx.Background_Up_Dan[3].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, 11.4f * 2, TJAPlayer3.Timer); + this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1stDan[3] = new CCounter(0, TJAPlayer3.Tx.Background_Up_Dan[5].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, 33.88f, TJAPlayer3.Timer); + this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2stDan = new CCounter(0, TJAPlayer3.Tx.Background_Up_Dan[4].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width + 200, 10, TJAPlayer3.Timer); + + if (TJAPlayer3.Tx.Background_Down_Scroll != null) + this.ct荳玖レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1 = new CCounter(1, TJAPlayer3.Tx.Background_Down_Scroll.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, 4, TJAPlayer3.Timer); + + this.ct荳願レ譎ッFIFO繧ソ繧、繝槭シ = new CCounter(); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx荳願レ譎ッ繝。繧、繝ウ ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx荳願レ譎ッ繧ッ繝ェ繧「繝。繧、繝ウ ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx荳玖レ譎ッ繝。繧、繝ウ ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx荳玖レ譎ッ繧ッ繝ェ繧「繝。繧、繝ウ ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx荳玖レ譎ッ繧ッ繝ェ繧「繧オ繝1 ); + //Trace.TraceInformation("CActDrums閭梧勹 繝ェ繧ス繝シ繧ケ縺ョ髢区叛"); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + public override int On騾イ陦梧緒逕サ() + { + this.ct荳願レ譎ッFIFO繧ソ繧、繝槭シ.t騾イ陦(); + + for (int i = 0; i < 2; i++) + { + if (this.ct荳願レ譎ッ繧ッ繝ェ繧「繧、繝ウ繧ソ繧、繝槭シ[i] != null) + this.ct荳願レ譎ッ繧ッ繝ェ繧「繧、繝ウ繧ソ繧、繝槭シ[i].t騾イ陦(); + } + for (int i = 0; i < 2; i++) + { + if (this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1st[i] != null) + this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1st[i].t騾イ陦鍬oop(); + } + for (int i = 0; i < 2; i++) + { + if (this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2nd[i] != null) + this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2nd[i].t騾イ陦鍬oop(); + } + for (int i = 0; i < 2; i++) + { + if (this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd[i] != null) + this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd[i].t騾イ陦鍬oop(); + } + for (int i = 0; i < 4; i++) + { + if (this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1stDan[i] != null) + this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1stDan[i].t騾イ陦鍬oop(); + } + if (this.ct荳玖レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1 != null) + this.ct荳玖レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1.t騾イ陦鍬oop(); + + if (this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2stDan != null) + this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2stDan.t騾イ陦鍬oop(); + + #region 1P-2P-荳願レ譎ッ + + if(TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Dan) + { + #region [ 騾壼クク閭梧勹 ] + + for (int i = 0; i < 2; i++) + { + if (this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1st[i] != null) + { + double TexSizeL = 1280 / TJAPlayer3.Tx.Background_Up_1st[i].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + double TexSizeW = 308 / TJAPlayer3.Tx.Background_Up_2nd[i].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height; + double TexSizeF = 1280 / TJAPlayer3.Tx.Background_Up_3rd[i].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + // 1280繧偵ユ繧ッ繧ケ繝√Ε繧オ繧、繧コ縺ァ蜑イ縺」縺溘b縺ョ繧貞繧贋ク翫£縺ヲ縲√励Λ繧ケ+1雜ウ縺吶 + int ForLoopL = (int)Math.Ceiling(TexSizeL) + 1; + int ForLoopW = (int)Math.Ceiling(TexSizeW) + 1; + int ForLoopF = (int)Math.Ceiling(TexSizeF) + 1; + //int n繝ォ繝シ繝怜ケ = 328; + + #region [ 荳願レ譎ッ-Back ] + + for (int W = 1; W < ForLoopW + 1; W++) + { + TJAPlayer3.Tx.Background_Up_1st[i].t2D謠冗判(TJAPlayer3.app.Device, 0 - this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1st[i].n迴セ蝨ィ縺ョ蛟、, (185 + i * 600) - (W * TJAPlayer3.Tx.Background_Up_1st[i].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height) + ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2nd[i].n迴セ蝨ィ縺ョ蛟、); + } + for (int l = 1; l < ForLoopL + 1; l++) + { + for (int W = 1; W < ForLoopW + 1; W++) + { + TJAPlayer3.Tx.Background_Up_1st[i].t2D謠冗判(TJAPlayer3.app.Device, +(l * TJAPlayer3.Tx.Background_Up_1st[i].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width) - this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1st[i].n迴セ蝨ィ縺ョ蛟、, (185 + i * 600) - (W * TJAPlayer3.Tx.Background_Up_1st[i].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height) + ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2nd[i].n迴セ蝨ィ縺ョ蛟、); + } + } + + for (int W = 1; W < ForLoopW + 1; W++) + { + TJAPlayer3.Tx.Background_Up_2nd[i].t2D謠冗判(TJAPlayer3.app.Device, 0 - this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1st[i].n迴セ蝨ィ縺ョ蛟、, (370 + i * 600) - (W * TJAPlayer3.Tx.Background_Up_2nd[i].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height) - ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2nd[i].n迴セ蝨ィ縺ョ蛟、); + } + for (int l = 1; l < ForLoopL + 1; l++) + { + for (int W = 1; W < ForLoopW + 1; W++) + { + TJAPlayer3.Tx.Background_Up_2nd[i].t2D謠冗判(TJAPlayer3.app.Device, +(l * TJAPlayer3.Tx.Background_Up_2nd[i].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width) - this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1st[i].n迴セ蝨ィ縺ョ蛟、, (370 + i * 600) - (W * TJAPlayer3.Tx.Background_Up_2nd[i].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height) - ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2nd[i].n迴セ蝨ィ縺ョ蛟、); + } + } + + #endregion + + #region [ 荳願レ譎ッ-Front ] + + float thirdy = 0; + float thirdx = 0; + + if (this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd[i].n迴セ蝨ィ縺ョ蛟、 <= 270) + { + thirdx = this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd[i].n迴セ蝨ィ縺ョ蛟、 * 0.9258f; + thirdy = (float)Math.Sin((float)this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd[i].n迴セ蝨ィ縺ョ蛟、 * (Math.PI / 270.0f)) * 40.0f; + } + else + { + thirdx = 250 + (ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd[i].n迴セ蝨ィ縺ョ蛟、 - 270) * 0.24f; + + if (this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd[i].n迴セ蝨ィ縺ョ蛟、 <= 490) thirdy = -(float)Math.Sin((float)(this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd[i].n迴セ蝨ィ縺ョ蛟、 - 270) * (Math.PI / 170.0f)) * 15.0f; + else thirdy = -((float)Math.Sin((float)220f * (Math.PI / 170.0f)) * 15.0f) + (float)(((this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd[i].n迴セ蝨ィ縺ョ蛟、 - 490) / 110f) * ((float)Math.Sin((float)220f * (Math.PI / 170.0f)) * 15.0f)); + } + + TJAPlayer3.Tx.Background_Up_3rd[i].t2D謠冗判(TJAPlayer3.app.Device, 0 - thirdx, 0 + i * 540 - thirdy); + + for (int l = 1; l < ForLoopF + 1; l++) + { + TJAPlayer3.Tx.Background_Up_3rd[i].t2D謠冗判(TJAPlayer3.app.Device, +(l * TJAPlayer3.Tx.Background_Up_3rd[i].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width) - thirdx, 0 + i * 540 - thirdy); + } + + #endregion + } + + if (this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1st[i] != null) + { + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bIsAlreadyCleared[i]) + { + TJAPlayer3.Tx.Background_Up_1st[2].Opacity = ((this.ct荳願レ譎ッ繧ッ繝ェ繧「繧、繝ウ繧ソ繧、繝槭シ[i].n迴セ蝨ィ縺ョ蛟、 * 0xff) / 100); + TJAPlayer3.Tx.Background_Up_2nd[2].Opacity = ((this.ct荳願レ譎ッ繧ッ繝ェ繧「繧、繝ウ繧ソ繧、繝槭シ[i].n迴セ蝨ィ縺ョ蛟、 * 0xff) / 100); + TJAPlayer3.Tx.Background_Up_3rd[2].Opacity = ((this.ct荳願レ譎ッ繧ッ繝ェ繧「繧、繝ウ繧ソ繧、繝槭シ[i].n迴セ蝨ィ縺ョ蛟、 * 0xff) / 100); + } + else + { + TJAPlayer3.Tx.Background_Up_1st[2].Opacity = 0; + TJAPlayer3.Tx.Background_Up_2nd[2].Opacity = 0; + TJAPlayer3.Tx.Background_Up_3rd[2].Opacity = 0; + } + + double TexSizeL = 1280 / TJAPlayer3.Tx.Background_Up_1st[2].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + double TexSizeW = 308 / TJAPlayer3.Tx.Background_Up_2nd[2].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height; + double TexSizeF = 1280 / TJAPlayer3.Tx.Background_Up_3rd[2].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + // 1280繧偵ユ繧ッ繧ケ繝√Ε繧オ繧、繧コ縺ァ蜑イ縺」縺溘b縺ョ繧貞繧贋ク翫£縺ヲ縲√励Λ繧ケ+1雜ウ縺吶 + int ForLoopL = (int)Math.Ceiling(TexSizeL) + 1; + int ForLoopW = (int)Math.Ceiling(TexSizeW) + 1; + int ForLoopF = (int)Math.Ceiling(TexSizeF) + 1; + + #region [ 荳願レ譎ッ-Back ] + + for (int W = 1; W < ForLoopW + 1; W++) + { + TJAPlayer3.Tx.Background_Up_1st[2].t2D謠冗判(TJAPlayer3.app.Device, 0 - this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1st[i].n迴セ蝨ィ縺ョ蛟、, (185 + i * 600) - (W * TJAPlayer3.Tx.Background_Up_1st[2].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height) + ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2nd[i].n迴セ蝨ィ縺ョ蛟、); + } + for (int l = 1; l < ForLoopL + 1; l++) + { + for (int W = 1; W < ForLoopW + 1; W++) + { + TJAPlayer3.Tx.Background_Up_1st[2].t2D謠冗判(TJAPlayer3.app.Device, +(l * TJAPlayer3.Tx.Background_Up_1st[2].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width) - this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1st[i].n迴セ蝨ィ縺ョ蛟、, (185 + i * 600) - (W * TJAPlayer3.Tx.Background_Up_1st[2].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height) + ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2nd[i].n迴セ蝨ィ縺ョ蛟、); + } + } + + for (int W = 1; W < ForLoopW + 1; W++) + { + TJAPlayer3.Tx.Background_Up_2nd[2].t2D謠冗判(TJAPlayer3.app.Device, 0 - this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1st[i].n迴セ蝨ィ縺ョ蛟、, (370 + i * 600) - (W * TJAPlayer3.Tx.Background_Up_2nd[2].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height) - ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2nd[i].n迴セ蝨ィ縺ョ蛟、); + } + for (int l = 1; l < ForLoopL + 1; l++) + { + for (int W = 1; W < ForLoopW + 1; W++) + { + TJAPlayer3.Tx.Background_Up_2nd[2].t2D謠冗判(TJAPlayer3.app.Device, +(l * TJAPlayer3.Tx.Background_Up_2nd[2].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width) - this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1st[i].n迴セ蝨ィ縺ョ蛟、, (370 + i * 600) - (W * TJAPlayer3.Tx.Background_Up_2nd[2].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height) - ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2nd[i].n迴セ蝨ィ縺ョ蛟、); + } + } + + #endregion + + #region [ 荳願レ譎ッ-Front ] + + float thirdy = 0; + float thirdx = 0; + + if (this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd[i].n迴セ蝨ィ縺ョ蛟、 <= 270) + { + thirdx = this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd[i].n迴セ蝨ィ縺ョ蛟、 * 0.9258f; + thirdy = (float)Math.Sin((float)this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd[i].n迴セ蝨ィ縺ョ蛟、 * (Math.PI / 270.0f)) * 40.0f; + } + else + { + thirdx = 250 + (ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd[i].n迴セ蝨ィ縺ョ蛟、 - 270) * 0.24f; + + if (this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd[i].n迴セ蝨ィ縺ョ蛟、 <= 490) thirdy = -(float)Math.Sin((float)(this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd[i].n迴セ蝨ィ縺ョ蛟、 - 270) * (Math.PI / 170.0f)) * 15.0f; + else thirdy = -((float)Math.Sin((float)220f * (Math.PI / 170.0f)) * 15.0f) + (float)(((this.ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd[i].n迴セ蝨ィ縺ョ蛟、 - 490) / 110f) * ((float)Math.Sin((float)220f * (Math.PI / 170.0f)) * 15.0f)); + } + + TJAPlayer3.Tx.Background_Up_3rd[2].t2D謠冗判(TJAPlayer3.app.Device, 0 - thirdx, 0 + i * 540 - thirdy); + + for (int l = 1; l < ForLoopF + 1; l++) + { + TJAPlayer3.Tx.Background_Up_3rd[2].t2D謠冗判(TJAPlayer3.app.Device, +(l * TJAPlayer3.Tx.Background_Up_3rd[2].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width) - thirdx, 0 + i * 540 - thirdy); + } + + #endregion + } + } + + #endregion + } + else + { + #region [ 谿オ菴肴享蝠 ] + + TJAPlayer3.Tx.Background_Up_Dan[0].t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + + for(int i = 0; i < 1280 / TJAPlayer3.Tx.Background_Up_Dan[1].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width + 2; i++) + TJAPlayer3.Tx.Background_Up_Dan[1].t2D謠冗判(TJAPlayer3.app.Device, (i * TJAPlayer3.Tx.Background_Up_Dan[1].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width) - ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1stDan[0].n迴セ蝨ィ縺ョ蛟、, 0); + + for(int i = 0; i < 1280 / TJAPlayer3.Tx.Background_Up_Dan[2].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width + 2; i++) + TJAPlayer3.Tx.Background_Up_Dan[2].t2D謠冗判(TJAPlayer3.app.Device, (i * TJAPlayer3.Tx.Background_Up_Dan[2].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width) - ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1stDan[1].n迴セ蝨ィ縺ョ蛟、, 0); + + for(int i = 0; i < 1280 / TJAPlayer3.Tx.Background_Up_Dan[3].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width + 2; i++) + TJAPlayer3.Tx.Background_Up_Dan[3].t2D謠冗判(TJAPlayer3.app.Device, (i * TJAPlayer3.Tx.Background_Up_Dan[3].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width) - ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1stDan[2].n迴セ蝨ィ縺ョ蛟、, 0); + + for(int i = 0; i < 1280 / TJAPlayer3.Tx.Background_Up_Dan[4].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width + 2; i++) + TJAPlayer3.Tx.Background_Up_Dan[4].t2D謠冗判(TJAPlayer3.app.Device, + (i * TJAPlayer3.Tx.Background_Up_Dan[4].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width) - ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2stDan.n迴セ蝨ィ縺ョ蛟、, -200 + ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2stDan.n迴セ蝨ィ縺ョ蛟、); + + for(int i = 0; i < 1280 / TJAPlayer3.Tx.Background_Up_Dan[5].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width + 2; i++) + TJAPlayer3.Tx.Background_Up_Dan[5].t2D謠冗判(TJAPlayer3.app.Device, (i * TJAPlayer3.Tx.Background_Up_Dan[5].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width) - ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1stDan[3].n迴セ蝨ィ縺ョ蛟、, 0); + + #endregion + } + + #endregion + #region 1P-荳玖レ譎ッ + if (!TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay) + { + if (TJAPlayer3.Tx.Background_Down != null) + { + TJAPlayer3.Tx.Background_Down.t2D謠冗判(TJAPlayer3.app.Device, 0, 360); + } + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bIsAlreadyCleared[0]) + { + if (TJAPlayer3.Tx.Background_Down_Clear != null && TJAPlayer3.Tx.Background_Down_Scroll != null && ct荳玖レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1 != null) + { + TJAPlayer3.Tx.Background_Down_Clear.Opacity = ((this.ct荳願レ譎ッFIFO繧ソ繧、繝槭シ.n迴セ蝨ィ縺ョ蛟、 * 0xff) / 100); + TJAPlayer3.Tx.Background_Down_Scroll.Opacity = ((this.ct荳願レ譎ッFIFO繧ソ繧、繝槭シ.n迴セ蝨ィ縺ョ蛟、 * 0xff) / 100); + TJAPlayer3.Tx.Background_Down_Clear.t2D謠冗判(TJAPlayer3.app.Device, 0, 360); + + //int n繝ォ繝シ繝怜ケ = 1257; + //CDTXMania.Tx.Background_Down_Scroll.t2D謠冗判( CDTXMania.app.Device, 0 - this.ct荳玖レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1.n迴セ蝨ィ縺ョ蛟、, 360 ); + //CDTXMania.Tx.Background_Down_Scroll.t2D謠冗判(CDTXMania.app.Device, (1 * n繝ォ繝シ繝怜ケ) - this.ct荳玖レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1.n迴セ蝨ィ縺ョ蛟、, 360); + double TexSize = 1280 / TJAPlayer3.Tx.Background_Down_Scroll.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + // 1280繧偵ユ繧ッ繧ケ繝√Ε繧オ繧、繧コ縺ァ蜑イ縺」縺溘b縺ョ繧貞繧贋ク翫£縺ヲ縲√励Λ繧ケ+1雜ウ縺吶 + int ForLoop = (int)Math.Ceiling(TexSize) + 1; + + //int n繝ォ繝シ繝怜ケ = 328; + TJAPlayer3.Tx.Background_Down_Scroll.t2D謠冗判(TJAPlayer3.app.Device, 0 - this.ct荳玖レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1.n迴セ蝨ィ縺ョ蛟、, 360); + for (int l = 1; l < ForLoop + 1; l++) + { + TJAPlayer3.Tx.Background_Down_Scroll.t2D謠冗判(TJAPlayer3.app.Device, +(l * TJAPlayer3.Tx.Background_Down_Scroll.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width) - this.ct荳玖レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1.n迴セ蝨ィ縺ョ蛟、, 360); + } + + } + } + } + #endregion + + return base.On騾イ陦梧緒逕サ(); + } + + #region[ private ] + //----------------- + private CCounter[] ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1st; //荳願レ譎ッ縺ョX譁ケ蜷代せ繧ッ繝ュ繝シ繝ォ逕ィ + private CCounter[] ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2nd; //荳願レ譎ッ縺ョY譁ケ蜷代せ繧ッ繝ュ繝シ繝ォ逕ィ + private CCounter[] ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ3rd; //荳願レ譎ッ縺ョY譁ケ蜷代せ繧ッ繝ュ繝シ繝ォ逕ィ + private CCounter ct荳玖レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1; //荳玖レ譎ッ繝代シ繝1縺ョX譁ケ蜷代せ繧ッ繝ュ繝シ繝ォ逕ィ + private CCounter ct荳願レ譎ッFIFO繧ソ繧、繝槭シ; + private CCounter[] ct荳願レ譎ッ繧ッ繝ェ繧「繧、繝ウ繧ソ繧、繝槭シ; + private CCounter[] ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ1stDan; //荳願レ譎ッ縺ョX譁ケ蜷代せ繧ッ繝ュ繝シ繝ォ逕ィ + private CCounter ct荳願レ譎ッ繧ケ繧ッ繝ュ繝シ繝ォ逕ィ繧ソ繧、繝槭シ2stDan; //荳願レ譎ッ縺ョY譁ケ蜷代せ繧ッ繝ュ繝シ繝ォ逕ィ + //private CTexture tx荳願レ譎ッ繝。繧、繝ウ; + //private CTexture tx荳願レ譎ッ繧ッ繝ェ繧「繝。繧、繝ウ; + //private CTexture tx荳玖レ譎ッ繝。繧、繝ウ; + //private CTexture tx荳玖レ譎ッ繧ッ繝ェ繧「繝。繧、繝ウ; + //private CTexture tx荳玖レ譎ッ繧ッ繝ェ繧「繧オ繝1; + private EFIFO繝「繝シ繝 eFadeMode; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums騾」謇.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums騾」謇.cs new file mode 100644 index 00000000..beb5a77a --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums騾」謇.cs @@ -0,0 +1,232 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Diagnostics; +using System.Runtime.InteropServices; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rums騾」謇 : CActivity + { + + + public CAct貍泌・愁rums騾」謇() + { + ST譁蟄嶺ス咲スョ[] st譁蟄嶺ス咲スョArray = new ST譁蟄嶺ス咲スョ[ 11 ]; + + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ.ch = '0'; + st譁蟄嶺ス咲スョ.pt = new Point( 0, 0 ); + st譁蟄嶺ス咲スョArray[ 0 ] = st譁蟄嶺ス咲スョ; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ2 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ2.ch = '1'; + st譁蟄嶺ス咲スョ2.pt = new Point( 62, 0 ); + st譁蟄嶺ス咲スョArray[ 1 ] = st譁蟄嶺ス咲スョ2; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ3 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ3.ch = '2'; + st譁蟄嶺ス咲スョ3.pt = new Point( 124, 0 ); + st譁蟄嶺ス咲スョArray[ 2 ] = st譁蟄嶺ス咲スョ3; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ4 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ4.ch = '3'; + st譁蟄嶺ス咲スョ4.pt = new Point( 186, 0 ); + st譁蟄嶺ス咲スョArray[ 3 ] = st譁蟄嶺ス咲スョ4; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ5 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ5.ch = '4'; + st譁蟄嶺ス咲スョ5.pt = new Point( 248, 0 ); + st譁蟄嶺ス咲スョArray[ 4 ] = st譁蟄嶺ス咲スョ5; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ6 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ6.ch = '5'; + st譁蟄嶺ス咲スョ6.pt = new Point( 310, 0 ); + st譁蟄嶺ス咲スョArray[ 5 ] = st譁蟄嶺ス咲スョ6; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ7 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ7.ch = '6'; + st譁蟄嶺ス咲スョ7.pt = new Point( 372, 0 ); + st譁蟄嶺ス咲スョArray[ 6 ] = st譁蟄嶺ス咲スョ7; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ8 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ8.ch = '7'; + st譁蟄嶺ス咲スョ8.pt = new Point( 434, 0 ); + st譁蟄嶺ス咲スョArray[ 7 ] = st譁蟄嶺ス咲スョ8; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ9 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ9.ch = '8'; + st譁蟄嶺ス咲スョ9.pt = new Point( 496, 0 ); + st譁蟄嶺ス咲スョArray[ 8 ] = st譁蟄嶺ス咲スョ9; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ10 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ10.ch = '9'; + st譁蟄嶺ス咲スョ10.pt = new Point( 558, 0 ); + st譁蟄嶺ス咲スョArray[ 9 ] = st譁蟄嶺ス咲スョ10; + + this.st譁蟄嶺ス咲スョ = st譁蟄嶺ス咲スョArray; + + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + + } + + public override void On豢サ諤ァ蛹() + { + this.ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ = new CCounter[ 4 ]; + this.ct騾」謇薙い繝九Γ = new CCounter[4]; + FadeOut = new Animations.FadeOut[4]; + for ( int i = 0; i < 4; i++ ) + { + this.ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[ i ] = new CCounter(); + this.ct騾」謇薙い繝九Γ[i] = new CCounter(); + // 蠕後°繧牙、峨∴繧後k繧医≧縺ォ縺吶k縲ょ、ァ菴10繝輔Ξ繝シ繝蛻縲 + FadeOut[i] = new Animations.FadeOut(167); + } + this.b陦ィ遉コ = new bool[]{ false, false, false, false }; + this.n騾」謇捺焚 = new int[ 4 ]; + + base.On豢サ諤ァ蛹(); + } + + public override void On髱樊エサ諤ァ蛹() + { + for (int i = 0; i < 4; i++) + { + ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[i] = null; + ct騾」謇薙い繝九Γ[i] = null; + FadeOut[i] = null; + } + base.On髱樊エサ諤ァ蛹(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + public override int On騾イ陦梧緒逕サ( ) + { + return base.On騾イ陦梧緒逕サ(); + } + + public int On騾イ陦梧緒逕サ( int n騾」謇捺焚, int player ) + { + this.ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[ player ].t騾イ陦(); + this.ct騾」謇薙い繝九Γ[player].t騾イ陦(); + FadeOut[player].Tick(); + //1PY:-3 2PY:514 + //莉ョ鄂ョ縺 + int[] nRollBalloon = new int[] { -3, 514, 0, 0 }; + int[] nRollNumber = new int[] { 48, 559, 0, 0 }; + for( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) + { + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, this.ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[player].n迴セ蝨ィ縺ョ蛟、.ToString()); + if ( this.ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[ player ].b邨ゆコ蛟、縺ォ驕斐@縺ヲ縺ェ縺) + { + if (ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[player].n迴セ蝨ィ縺ョ蛟、 > 66 && !FadeOut[player].Counter.b騾イ陦御クュ) + { + FadeOut[player].Start(); + } + var opacity = (int)FadeOut[player].GetAnimation(); + + if(ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[player].n迴セ蝨ィ縺ョ蛟、 == 0 || ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[player].n迴セ蝨ィ縺ョ蛟、 == 60) + { + bNowRollAnime = 0; + TJAPlayer3.Tx.Balloon_Number_Roll.Opacity = 64; + } + else if (ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[player].n迴セ蝨ィ縺ョ蛟、 == 1 || ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[player].n迴セ蝨ィ縺ョ蛟、 == 59) + { + bNowRollAnime = 1; + TJAPlayer3.Tx.Balloon_Number_Roll.Opacity = 128; + } + else if (ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[player].n迴セ蝨ィ縺ョ蛟、 == 2 || ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[player].n迴セ蝨ィ縺ョ蛟、 == 58) + { + bNowRollAnime = 2; + TJAPlayer3.Tx.Balloon_Number_Roll.Opacity = 192; + } + else if (ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[player].n迴セ蝨ィ縺ョ蛟、 == 3 || ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[player].n迴セ蝨ィ縺ョ蛟、 == 57) + { + bNowRollAnime = 3; + TJAPlayer3.Tx.Balloon_Number_Roll.Opacity = 255; + } + else if (ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[player].n迴セ蝨ィ縺ョ蛟、 >= 4 || ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[player].n迴セ蝨ィ縺ョ蛟、 <= 56) + { + bNowRollAnime = 4; + TJAPlayer3.Tx.Balloon_Number_Roll.Opacity = 255; + } + + TJAPlayer3.Tx.Balloon_Roll.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Balloon_Roll_Frame_X[player], TJAPlayer3.Skin.Game_Balloon_Roll_Frame_Y[player], new RectangleF(0 + bNowRollAnime * 334, 0, 334, 204)); ; + this.t譁蟄苓。ィ遉コ(TJAPlayer3.Skin.Game_Balloon_Roll_Number_X[player], TJAPlayer3.Skin.Game_Balloon_Roll_Number_Y[player], n騾」謇捺焚.ToString(), n騾」謇捺焚, player); + } + } + + return base.On騾イ陦梧緒逕サ(); + } + + public void t譫陦ィ遉コ譎る俣蟒カ髟キ(int player, bool first) + { + if ((this.ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[player].n迴セ蝨ィ縺ョ蛟、 >= 6 && !first) || first) + this.ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[player] = new CCounter(0, 60, 40, TJAPlayer3.Timer); + + if(!first) + this.ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[player].n迴セ蝨ィ縺ョ蛟、 = 5; + else + this.ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ[player].n迴セ蝨ィ縺ョ蛟、 = 0; + } + + public int bNowRollAnime; + public bool[] b陦ィ遉コ; + public int[] n騾」謇捺焚; + public CCounter[] ct騾」謇捺棧繧ォ繧ヲ繝ウ繧ソ繝シ; + //private CTexture tx騾」謇捺棧; + //private CTexture tx騾」謇捺焚蟄; + private readonly ST譁蟄嶺ス咲スョ[] st譁蟄嶺ス咲スョ; + public CCounter[] ct騾」謇薙い繝九Γ; + private float[] RollScale = new float[] + { + 0.000f, + 0.123f, // 繝ェ繝斐シ繝 + 0.164f, + 0.164f, + 0.164f, + 0.137f, + 0.110f, + 0.082f, + 0.055f, + 0.000f + }; + private Animations.FadeOut[] FadeOut; + + [StructLayout(LayoutKind.Sequential)] + private struct ST譁蟄嶺ス咲スョ + { + public char ch; + public Point pt; + } + + private void t譁蟄苓。ィ遉コ( int x, int y, string str, int n騾」謇, int nPlayer) + { + int n譯∵焚 = n騾」謇.ToString().Length; + + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, ct騾」謇薙い繝九Γ[nPlayer].n迴セ蝨ィ縺ョ蛟、.ToString()); + foreach ( char ch in str ) + { + for( int i = 0; i < this.st譁蟄嶺ス咲スョ.Length; i++ ) + { + if( this.st譁蟄嶺ス咲スョ[ i ].ch == ch ) + { + Rectangle rectangle = new Rectangle(TJAPlayer3.Skin.Game_Balloon_Number_Size[0] * i, 0, TJAPlayer3.Skin.Game_Balloon_Number_Size[0], TJAPlayer3.Skin.Game_Balloon_Number_Size[1]); + + if(TJAPlayer3.Tx.Balloon_Number_Roll != null ) + { + TJAPlayer3.Tx.Balloon_Number_Roll.vc諡。螟ァ邵ョ蟆丞咲紫.X = TJAPlayer3.Skin.Game_Balloon_Roll_Number_Scale; + TJAPlayer3.Tx.Balloon_Number_Roll.vc諡。螟ァ邵ョ蟆丞咲紫.Y = TJAPlayer3.Skin.Game_Balloon_Roll_Number_Scale + RollScale[this.ct騾」謇薙い繝九Γ[nPlayer].n迴セ蝨ィ縺ョ蛟、]; + TJAPlayer3.Tx.Balloon_Number_Roll.t2D諡。螟ァ邇閠諷ョ荳句渕貅匁緒逕サ( TJAPlayer3.app.Device, x - ( ( (TJAPlayer3.Skin.Game_Balloon_Number_Padding + 2) * n譯∵焚 ) / 2 ), y, rectangle ); + } + break; + } + } + x += ( TJAPlayer3.Skin.Game_Balloon_Number_Padding - ( n譯∵焚 > 2 ? n譯∵焚 * 2 : 0 ) ); + } + } + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums騾」謇薙く繝」繝ゥ.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums騾」謇薙く繝」繝ゥ.cs new file mode 100644 index 00000000..cbc24aee --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums騾」謇薙く繝」繝ゥ.cs @@ -0,0 +1,262 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Runtime.InteropServices; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rums騾」謇薙く繝」繝ゥ : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CAct貍泌・愁rums騾」謇薙く繝」繝ゥ() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // 繝。繧ス繝繝 + public virtual void Start( int player ) + { + //if( CDTXMania.Tx.Effects_Roll[0] != null ) + //{ + // int[] arXseed = new int[] { 56, -10, 200, 345, 100, 451, 600, 260, -30, 534, 156, 363 }; + // for (int i = 0; i < 1; i++) + // { + // for (int j = 0; j < 64; j++) + // { + // if (!this.st騾」謇薙く繝」繝ゥ[j].b菴ソ逕ィ荳ュ) + // { + // this.st騾」謇薙く繝」繝ゥ[j].b菴ソ逕ィ荳ュ = true; + // if(this.nTex譫壽焚 <= 1) this.st騾」謇薙く繝」繝ゥ[j].nColor = 0; + // else this.st騾」謇薙く繝」繝ゥ[j].nColor = CDTXMania.Random.Next( 0, this.nTex譫壽焚 - 1); + // this.st騾」謇薙く繝」繝ゥ[j].ct騾イ陦 = new CCounter( 0, 1000, 4, CDTXMania.Timer); // 繧ォ繧ヲ繝ウ繧ソ + + // //菴咲スョ逕滓(ホイ迚) + // int nXseed = CDTXMania.Random.Next(12); + // this.st騾」謇薙く繝」繝ゥ[ j ].fX髢句ァ狗せ = arXseed[ nXseed ]; + // this.st騾」謇薙く繝」繝ゥ[j].fX = arXseed[ nXseed ]; + // this.st騾」謇薙く繝」繝ゥ[j].fY = 720; + // this.st騾」謇薙く繝」繝ゥ[j].fX蜉騾溷コヲ = 5/2; + // this.st騾」謇薙く繝」繝ゥ[j].fY蜉騾溷コヲ = 5/2; + // break; + // } + // } + // } + //} + for (int i = 0; i < 128; i++) + { + if(!RollCharas[i].IsUsing) + { + RollCharas[i].IsUsing = true; + RollCharas[i].Type = random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Ptn); + RollCharas[i].OldValue = 0; + RollCharas[i].Counter = new CCounter(0, 5000, 1, TJAPlayer3.Timer); + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay) + { + switch (player) + { + case 0: + RollCharas[i].X = TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_1P_X[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_1P_X.Length)]; + RollCharas[i].Y = TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_1P_Y[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_1P_Y.Length)]; + RollCharas[i].XAdd = TJAPlayer3.Skin.Game_Effect_Roll_Speed_1P_X[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Speed_1P_X.Length)]; + RollCharas[i].YAdd = TJAPlayer3.Skin.Game_Effect_Roll_Speed_1P_Y[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Speed_1P_Y.Length)]; + break; + case 1: + RollCharas[i].X = TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_2P_X[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_2P_X.Length)]; + RollCharas[i].Y = TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_2P_Y[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_2P_Y.Length)]; + RollCharas[i].XAdd = TJAPlayer3.Skin.Game_Effect_Roll_Speed_2P_X[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Speed_2P_X.Length)]; + RollCharas[i].YAdd = TJAPlayer3.Skin.Game_Effect_Roll_Speed_2P_Y[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Speed_2P_Y.Length)]; + break; + default: + return; + } + } + else + { + RollCharas[i].X = TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_X[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_X.Length)]; + RollCharas[i].Y = TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_Y[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_StartPoint_Y.Length)]; + RollCharas[i].XAdd = TJAPlayer3.Skin.Game_Effect_Roll_Speed_X[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Speed_X.Length)]; + RollCharas[i].YAdd = TJAPlayer3.Skin.Game_Effect_Roll_Speed_Y[random.Next(0, TJAPlayer3.Skin.Game_Effect_Roll_Speed_Y.Length)]; + } + break; + } + } + + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + //for (int i = 0; i < 64; i++) + //{ + // this.st騾」謇薙く繝」繝ゥ[i] = new ST騾」謇薙く繝」繝ゥ(); + // this.st騾」謇薙く繝」繝ゥ[i].b菴ソ逕ィ荳ュ = false; + // this.st騾」謇薙く繝」繝ゥ[i].ct騾イ陦 = new CCounter(); + //} + for (int i = 0; i < 128; i++) + { + RollCharas[i] = new RollChara(); + RollCharas[i].IsUsing = false; + RollCharas[i].Counter = new CCounter(); + } + // SkinConfig縺ァ謖螳壹&繧後◆縺縺上▽縺九ョ螟画焚縺九i縺薙ョ繧ッ繝ゥ繧ケ縺ォ蜷医▲縺溘b縺ョ縺ォ螟画鋤縺励※縺縺 + + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + //for (int i = 0; i < 64; i++) + //{ + // this.st騾」謇薙く繝」繝ゥ[i].ct騾イ陦 = null; + //} + for (int i = 0; i < 128; i++) + { + RollCharas[i].Counter = null; + } + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //this.nTex譫壽焚 = 4; + //this.txChara = new CTexture[ this.nTex譫壽焚 ]; + + //for (int i = 0; i < this.nTex譫壽焚; i++) + //{ + // this.txChara[ i ] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\RollEffect\00\" + i.ToString() + ".png" ) ); + //} + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + // for (int i = 0; i < this.nTex譫壽焚; i++) + // { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txChara[ i ] ); + // } + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //for( int i = 0; i < 64; i++ ) + //{ + // if( this.st騾」謇薙く繝」繝ゥ[i].b菴ソ逕ィ荳ュ ) + // { + // this.st騾」謇薙く繝」繝ゥ[i].n蜑榊屓縺ョValue = this.st騾」謇薙く繝」繝ゥ[i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、; + // this.st騾」謇薙く繝」繝ゥ[i].ct騾イ陦.t騾イ陦(); + // if (this.st騾」謇薙く繝」繝ゥ[i].ct騾イ陦.b邨ゆコ蛟、縺ォ驕斐@縺) + // { + // this.st騾」謇薙く繝」繝ゥ[i].ct騾イ陦.t蛛懈ュ「(); + // this.st騾」謇薙く繝」繝ゥ[i].b菴ソ逕ィ荳ュ = false; + // } + // for (int n = this.st騾」謇薙く繝」繝ゥ[i].n蜑榊屓縺ョValue; n < this.st騾」謇薙く繝」繝ゥ[i].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、; n++) + // { + // this.st騾」謇薙く繝」繝ゥ[i].fX += this.st騾」謇薙く繝」繝ゥ[i].fX蜉騾溷コヲ; + // this.st騾」謇薙く繝」繝ゥ[i].fY -= this.st騾」謇薙く繝」繝ゥ[i].fY蜉騾溷コヲ; + // } + + // if(CDTXMania.Tx.Effects_Roll[ this.st騾」謇薙く繝」繝ゥ[ i ].nColor ] != null ) + // { + // CDTXMania.Tx.Effects_Roll[ this.st騾」謇薙く繝」繝ゥ[ i ].nColor ].t2D謠冗判( CDTXMania.app.Device, (int)this.st騾」謇薙く繝」繝ゥ[i].fX, (int)this.st騾」謇薙く繝」繝ゥ[i].fY, new Rectangle( this.st騾」謇薙く繝」繝ゥ[i].nColor * 0, 0, 128, 128 ) ); + // } + // } + + //} + for (int i = 0; i < 128; i++) + { + if(RollCharas[i].IsUsing) + { + RollCharas[i].OldValue = RollCharas[i].Counter.n迴セ蝨ィ縺ョ蛟、; + RollCharas[i].Counter.t騾イ陦(); + if(RollCharas[i].Counter.b邨ゆコ蛟、縺ォ驕斐@縺) + { + RollCharas[i].Counter.t蛛懈ュ「(); + RollCharas[i].IsUsing = false; + } + for (int l = RollCharas[i].OldValue; l < RollCharas[i].Counter.n迴セ蝨ィ縺ョ蛟、; l++) + { + RollCharas[i].X += RollCharas[i].XAdd; + RollCharas[i].Y += RollCharas[i].YAdd; + } + TJAPlayer3.Tx.Effects_Roll[RollCharas[i].Type]?.t2D謠冗判(TJAPlayer3.app.Device, RollCharas[i].X, RollCharas[i].Y); + // 逕サ髱「螟悶↓縺縺溘i謠冗判繧偵d繧√&縺帙k + if(RollCharas[i].X < 0 - TJAPlayer3.Tx.Effects_Roll[RollCharas[i].Type].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width || RollCharas[i].X > 1280) + { + RollCharas[i].Counter.t蛛懈ュ「(); + RollCharas[i].IsUsing = false; + } + if (RollCharas[i].Y < 0 - TJAPlayer3.Tx.Effects_Roll[RollCharas[i].Type].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height || RollCharas[i].Y > 720) + { + RollCharas[i].Counter.t蛛懈ュ「(); + RollCharas[i].IsUsing = false; + } + } + } + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + //private CTexture[] txChara; + private int nTex譫壽焚; + + [StructLayout(LayoutKind.Sequential)] + private struct ST騾」謇薙く繝」繝ゥ + { + public int nColor; + public bool b菴ソ逕ィ荳ュ; + public CCounter ct騾イ陦; + public int n蜑榊屓縺ョValue; + public float fX; + public float fY; + public float fX髢句ァ狗せ; + public float fY髢句ァ狗せ; + public float f騾イ陦梧婿蜷; //騾イ陦梧婿蜷 0:蟾ヲ竊貞承 1:蟾ヲ荳銀貞承荳 2:蜿ウ竊貞キヲ + public float fX蜉騾溷コヲ; + public float fY蜉騾溷コヲ; + } + private ST騾」謇薙く繝」繝ゥ[] st騾」謇薙く繝」繝ゥ = new ST騾」謇薙く繝」繝ゥ[64]; + + [StructLayout(LayoutKind.Sequential)] + private struct RollChara + { + public CCounter Counter; + public int Type; + public bool IsUsing; + public float X; + public float Y; + public float XAdd; + public float YAdd; + public int OldValue; + } + + private RollChara[] RollCharas = new RollChara[128]; + + private Random random = new Random(); + + private int[,] StartPoint; + private int[,] StartPoint_1P; + private int[,] StartPoint_2P; + private float[,] Speed; + private float[,] Speed_1P; + private float[,] Speed_2P; + private int CharaPtn; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums鬚ィ闊ケ.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums鬚ィ闊ケ.cs new file mode 100644 index 00000000..97f00692 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct貍泌・愁rums鬚ィ闊ケ.cs @@ -0,0 +1,295 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Diagnostics; +using System.Runtime.InteropServices; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CAct貍泌・愁rums鬚ィ闊ケ : CActivity + { + + + public CAct貍泌・愁rums鬚ィ闊ケ() + { + ST譁蟄嶺ス咲スョ[] st譁蟄嶺ス咲スョArray = new ST譁蟄嶺ス咲スョ[11]; + + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ.ch = '0'; + st譁蟄嶺ス咲スョ.pt = new Point(0, 0); + st譁蟄嶺ス咲スョArray[0] = st譁蟄嶺ス咲スョ; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ2 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ2.ch = '1'; + st譁蟄嶺ス咲スョ2.pt = new Point(62, 0); + st譁蟄嶺ス咲スョArray[1] = st譁蟄嶺ス咲スョ2; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ3 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ3.ch = '2'; + st譁蟄嶺ス咲スョ3.pt = new Point(124, 0); + st譁蟄嶺ス咲スョArray[2] = st譁蟄嶺ス咲スョ3; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ4 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ4.ch = '3'; + st譁蟄嶺ス咲スョ4.pt = new Point(186, 0); + st譁蟄嶺ス咲スョArray[3] = st譁蟄嶺ス咲スョ4; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ5 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ5.ch = '4'; + st譁蟄嶺ス咲スョ5.pt = new Point(248, 0); + st譁蟄嶺ス咲スョArray[4] = st譁蟄嶺ス咲スョ5; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ6 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ6.ch = '5'; + st譁蟄嶺ス咲スョ6.pt = new Point(310, 0); + st譁蟄嶺ス咲スョArray[5] = st譁蟄嶺ス咲スョ6; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ7 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ7.ch = '6'; + st譁蟄嶺ス咲スョ7.pt = new Point(372, 0); + st譁蟄嶺ス咲スョArray[6] = st譁蟄嶺ス咲スョ7; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ8 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ8.ch = '7'; + st譁蟄嶺ス咲スョ8.pt = new Point(434, 0); + st譁蟄嶺ス咲スョArray[7] = st譁蟄嶺ス咲スョ8; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ9 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ9.ch = '8'; + st譁蟄嶺ス咲スョ9.pt = new Point(496, 0); + st譁蟄嶺ス咲スョArray[8] = st譁蟄嶺ス咲スョ9; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ10 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ10.ch = '9'; + st譁蟄嶺ス咲スョ10.pt = new Point(558, 0); + st譁蟄嶺ス咲スョArray[9] = st譁蟄嶺ス咲スョ10; + + this.st譁蟄嶺ス咲スョ = st譁蟄嶺ス咲スョArray; + + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + + } + + public override void On豢サ諤ァ蛹() + { + this.ct鬚ィ闊ケ邨ゆコ = new CCounter(); + this.ct鬚ィ闊ケ縺オ縺阪□縺励い繝九Γ = new CCounter(); + this.ct鬚ィ闊ケ繧「繝九Γ = new CCounter[4]; + for (int i = 0; i < 4; i++) + { + this.ct鬚ィ闊ケ繧「繝九Γ[i] = new CCounter(); + } + base.On豢サ諤ァ蛹(); + } + + public override void On髱樊エサ諤ァ蛹() + { + this.ct鬚ィ闊ケ邨ゆコ = null; + this.ct鬚ィ闊ケ縺オ縺阪□縺励い繝九Γ = null; + base.On髱樊エサ諤ァ蛹(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + //this.tx騾」謇捺棧 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_balloon.png")); + //this.tx騾」謇捺焚蟄 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_RollNumber.png")); + + //this.tx繧ュ繝」繝ゥ繧ッ繧ソ繝シ = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\Chara\balloon.png")); + //this.tx繧ュ繝」繝ゥ繧ッ繧ソ繝シ_鬚ィ闊ケ邨ゆコ = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\Chara\balloon_break_0.png")); + + //for (int i = 0; i < 6; i++) + //{ + // this.tx鬚ィ闊ケ譫[i] = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\Chara\balloon_" + i.ToString() + ".png")); + //} + + this.ct鬚ィ闊ケ縺オ縺阪□縺励い繝九Γ = new CCounter(0, 1, 100, TJAPlayer3.Timer); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.tx騾」謇捺棧); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.tx騾」謇捺焚蟄); + + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.tx繧ュ繝」繝ゥ繧ッ繧ソ繝シ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.tx繧ュ繝」繝ゥ繧ッ繧ソ繝シ_鬚ィ闊ケ邨ゆコ); + + //for (int i = 0; i < 6; i++) + //{ + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ(ref this.tx鬚ィ闊ケ譫[i]); + //} + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + public override int On騾イ陦梧緒逕サ() + { + return base.On騾イ陦梧緒逕サ(); + } + + public int On騾イ陦梧緒逕サ(int n騾」謇薙ヮ繝ォ繝, int n騾」謇捺焚, int player) + { + this.ct鬚ィ闊ケ縺オ縺阪□縺励い繝九Γ.t騾イ陦鍬oop(); + this.ct鬚ィ闊ケ繧「繝九Γ[player].t騾イ陦(); + + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 0, 16, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.襍、, this.ct鬚ィ闊ケ邨ゆコ.n迴セ蝨ィ縺ョ蛟、.ToString() ); + int[] n谿九j謇捺焚 = new int[] { 0, 0, 0, 0, 0 }; + #region[ ] + if (n騾」謇薙ヮ繝ォ繝 > 0) + { + if (n騾」謇薙ヮ繝ォ繝 < 5) + { + n谿九j謇捺焚 = new int[] { 4, 3, 2, 1, 0 }; + } + else + { + n谿九j謇捺焚[0] = (n騾」謇薙ヮ繝ォ繝 / 5) * 4; + n谿九j謇捺焚[1] = (n騾」謇薙ヮ繝ォ繝 / 5) * 3; + n谿九j謇捺焚[2] = (n騾」謇薙ヮ繝ォ繝 / 5) * 2; + n谿九j謇捺焚[3] = (n騾」謇薙ヮ繝ォ繝 / 5) * 1; + } + } + #endregion + + if (n騾」謇捺焚 != 0) + { + //1P:0 2P:245 + //if (CDTXMania.Tx.Chara_Balloon_Breaking != null && CDTXMania.ConfigIni.ShowChara) + // CDTXMania.Tx.Chara_Balloon_Breaking.t2D謠冗判(CDTXMania.app.Device, CDTXMania.Skin.Game_Chara_Balloon_X[player], CDTXMania.Skin.Game_Chara_Balloon_Y[player]); + for (int j = 0; j < 5; j++) + { + if (n谿九j謇捺焚[j] < n騾」謇捺焚) + { + if (TJAPlayer3.Tx.Balloon_Breaking[j] != null) + TJAPlayer3.Tx.Balloon_Breaking[j].t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Balloon_Balloon_X[player] + (this.ct鬚ィ闊ケ縺オ縺阪□縺励い繝九Γ.n迴セ蝨ィ縺ョ蛟、 == 1 ? 3 : 0), TJAPlayer3.Skin.Game_Balloon_Balloon_Y[player]); + break; + } + } + //1P:31 2P:329 + if (TJAPlayer3.Tx.Balloon_Balloon != null) + TJAPlayer3.Tx.Balloon_Balloon.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Balloon_Balloon_Frame_X[player], TJAPlayer3.Skin.Game_Balloon_Balloon_Frame_Y[player]); + this.t譁蟄苓。ィ遉コ(TJAPlayer3.Skin.Game_Balloon_Balloon_Number_X[player], TJAPlayer3.Skin.Game_Balloon_Balloon_Number_Y[player], n騾」謇捺焚.ToString(), n騾」謇捺焚, player); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 0, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, n騾」謇捺焚.ToString() ); + } + if (n騾」謇捺焚 == 0 && TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChara.b鬚ィ闊ケ騾」謇謎クュ[player]) + { + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChara.b鬚ィ闊ケ騾」謇謎クュ[player] = false; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.b騾」謇謎クュ[player] = false; + //this.tEnd(); + ////this.ct鬚ィ闊ケ邨ゆコ.n迴セ蝨ィ縺ョ蛟、 = 0; + //if (this.ct鬚ィ闊ケ邨ゆコ.b騾イ陦御クュ) + //{ + // this.ct鬚ィ闊ケ邨ゆコ.t騾イ陦慧b(); + // if (this.ct鬚ィ闊ケ邨ゆコ.b邨ゆコ蛟、縺ォ驕斐@縺) + // { + // this.ct鬚ィ闊ケ邨ゆコ.t蛛懈ュ「(); + // this.ct鬚ィ闊ケ邨ゆコ.n迴セ蝨ィ縺ョ蛟、 = 0D; + // CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChara.b鬚ィ闊ケ騾」謇謎クュ = false; + // CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.b騾」謇謎クュ[player] = false; + // } + //} + + //if (this.ct鬚ィ闊ケ邨ゆコ.b騾イ陦御クュ) + //{ + // int nY = 0; + // int nT = 255; + + + // if (this.ct鬚ィ闊ケ邨ゆコ.n迴セ蝨ィ縺ョ蛟、 <= 10) + // { + // nY = (int)this.ct鬚ィ闊ケ邨ゆコ.n迴セ蝨ィ縺ョ蛟、; + // } + // else if (this.ct鬚ィ闊ケ邨ゆコ.n迴セ蝨ィ縺ョ蛟、 > 10) + // { + // nY = 100; + // } + // //else if( this.ct鬚ィ闊ケ邨ゆコ.n迴セ蝨ィ縺ョ蛟、 > 800 ) + // { + // //nY = 100; + // //nT = 0; + // } + + // if (CDTXMania.Tx.Chara_Balloon_Broken != null) + // CDTXMania.Tx.Chara_Balloon_Broken.t2D謠冗判(CDTXMania.app.Device, 240, 140 - nY); + // //this.tx繧ュ繝」繝ゥ繧ッ繧ソ繝シ_鬚ィ闊ケ邨ゆコ.n騾乗主コヲ = nT; + // CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 0, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.襍、, this.ct鬚ィ闊ケ邨ゆコ.n迴セ蝨ィ縺ョ蛟、.ToString() ); + + + //} + //if (!this.ct鬚ィ闊ケ邨ゆコ.b邨ゆコ蛟、縺ォ驕斐@縺ヲ縺ェ縺db) + //{ + // //CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChara.b鬚ィ闊ケ騾」謇謎クュ = false; + // //CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.b騾」謇謎クュ[player] = false; + //} + ////CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChara.b鬚ィ闊ケ騾」謇謎クュ = false; + + + } + + + + + return base.On騾イ陦梧緒逕サ(); + } + + + + //private CTexture tx騾」謇捺棧; + //private CTexture tx騾」謇捺焚蟄; + private readonly ST譁蟄嶺ス咲スョ[] st譁蟄嶺ス咲スョ; + + //private CTexture tx繧ュ繝」繝ゥ繧ッ繧ソ繝シ; + //private CTexture tx繧ュ繝」繝ゥ繧ッ繧ソ繝シ_鬚ィ闊ケ邨ゆコ; + + //private CTexture[] tx鬚ィ闊ケ譫 = new CTexture[6]; + + private CCounter ct鬚ィ闊ケ邨ゆコ; + private CCounter ct鬚ィ闊ケ縺オ縺阪□縺励い繝九Γ; + + public CCounter[] ct鬚ィ闊ケ繧「繝九Γ; + private float[] RollScale = new float[] + { + 0.000f, + 0.123f, // 繝ェ繝斐シ繝 + 0.164f, + 0.164f, + 0.164f, + 0.137f, + 0.110f, + 0.082f, + 0.055f, + 0.000f + }; + + [StructLayout(LayoutKind.Sequential)] + private struct ST譁蟄嶺ス咲スョ + { + public char ch; + public Point pt; + } + + private void t譁蟄苓。ィ遉コ(int x, int y, string str, int n騾」謇, int nPlayer) + { + int n譯∵焚 = n騾」謇.ToString().Length; + foreach (char ch in str) + { + for (int i = 0; i < this.st譁蟄嶺ス咲スョ.Length; i++) + { + if (this.st譁蟄嶺ス咲スョ[i].ch == ch) + { + Rectangle rectangle = new Rectangle(TJAPlayer3.Skin.Game_Balloon_Number_Size[0] * i, 0, TJAPlayer3.Skin.Game_Balloon_Number_Size[0], TJAPlayer3.Skin.Game_Balloon_Number_Size[1]); + + if (TJAPlayer3.Tx.Balloon_Number_Roll != null) + { + TJAPlayer3.Tx.Balloon_Number_Roll.Opacity = 255; + TJAPlayer3.Tx.Balloon_Number_Roll.vc諡。螟ァ邵ョ蟆丞咲紫.X = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_Scale; + TJAPlayer3.Tx.Balloon_Number_Roll.vc諡。螟ァ邵ョ蟆丞咲紫.Y = TJAPlayer3.Skin.Game_Balloon_Balloon_Number_Scale + RollScale[this.ct鬚ィ闊ケ繧「繝九Γ[nPlayer].n迴セ蝨ィ縺ョ蛟、]; + TJAPlayer3.Tx.Balloon_Number_Roll.t2D諡。螟ァ邇閠諷ョ荳句渕貅匁緒逕サ(TJAPlayer3.app.Device, x - (((TJAPlayer3.Skin.Game_Balloon_Number_Padding + 2) * n譯∵焚) / 2), y, rectangle); + } + break; + } + } + x += (TJAPlayer3.Skin.Game_Balloon_Number_Padding - (n譯∵焚 > 2 ? n譯∵焚 * 2 : 0)); + } + } + + public void tEnd() + { + this.ct鬚ィ闊ケ邨ゆコ = new CCounter(0, 80, 10, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + } + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CStage貍泌・上ラ繝ゥ繝逕サ髱「.cs b/TJAPlayer3/Stages/07.Game/Taiko/CStage貍泌・上ラ繝ゥ繝逕サ髱「.cs new file mode 100644 index 00000000..69374e3f --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/CStage貍泌・上ラ繝ゥ繝逕サ髱「.cs @@ -0,0 +1,2338 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using System.Drawing.Imaging; +using System.IO; +using System.Diagnostics; +using System.Threading; +using SlimDX; +using SlimDX.Direct3D9; +using FDK; +using TJAPlayer3; + +namespace TJAPlayer3 +{ + internal class CStage貍泌・上ラ繝ゥ繝逕サ髱「 : CStage貍泌・冗判髱「蜈ア騾 + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CStage貍泌・上ラ繝ゥ繝逕サ髱「() + { + base.e繧ケ繝繝シ繧クID = CStage.E繧ケ繝繝シ繧ク.貍泌・; + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷; + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + base.list蟄植ctivities.Add( this.actPad = new CAct貍泌・愁rums繝代ャ繝() ); + base.list蟄植ctivities.Add( this.actCombo = new CAct貍泌・愁rums繧ウ繝ウ繝廛GB() ); + base.list蟄植ctivities.Add( this.actDANGER = new CAct貍泌・愁rumsDanger() ); + base.list蟄植ctivities.Add( this.actChipFireD = new CAct貍泌・愁rums繝√ャ繝励ヵ繧。繧、繧「D() ); + base.list蟄植ctivities.Add( this.Rainbow = new Rainbow() ); + base.list蟄植ctivities.Add( this.actGauge = new CAct貍泌・愁rums繧イ繝シ繧ク() ); + base.list蟄植ctivities.Add( this.actGraph = new CAct貍泌・愁rums繧ー繝ゥ繝() ); // #24074 2011.01.23 add ikanick + base.list蟄植ctivities.Add( this.actJudgeString = new CAct貍泌・愁rums蛻、螳壽枚蟄怜() ); + base.list蟄植ctivities.Add( this.actTaikoLaneFlash = new TaikoLaneFlash() ); + base.list蟄植ctivities.Add( this.actLaneFlushGB = new CAct貍泌・愁rums繝ャ繝シ繝ウ繝輔Λ繝繧キ繝・GB() ); + base.list蟄植ctivities.Add( this.actScore = new CAct貍泌・愁rums繧ケ繧ウ繧「() ); + base.list蟄植ctivities.Add( this.actStatusPanels = new CAct貍泌・愁rums繧ケ繝繝シ繧ソ繧ケ繝代ロ繝ォ() ); + base.list蟄植ctivities.Add( this.act隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ = new CAct貍泌・上せ繧ッ繝ュ繝シ繝ォ騾溷コヲ() ); + base.list蟄植ctivities.Add( this.actAVI = new CAct貍泌・就VI() ); + base.list蟄植ctivities.Add( this.actPanel = new CAct貍泌・上ヱ繝阪Ν譁蟄怜() ); + base.list蟄植ctivities.Add( this.actStageFailed = new CAct貍泌・上せ繝繝シ繧ク螟ア謨() ); + base.list蟄植ctivities.Add( this.actPlayInfo = new CAct貍泌・乗シ泌・乗ュ蝣ア() ); + //base.list蟄植ctivities.Add( this.actFI = new CActFIFOBlack() ); + base.list蟄植ctivities.Add( this.actFI = new CActFIFOStart() ); + base.list蟄植ctivities.Add( this.actFO = new CActFIFOBlack() ); + base.list蟄植ctivities.Add( this.actFOClear = new CActFIFOResult() ); + base.list蟄植ctivities.Add( this.actLane = new CAct貍泌・愁rums繝ャ繝シ繝ウ() ); + base.list蟄植ctivities.Add( this.actEnd = new CAct貍泌・愁rums貍泌・冗オゆコ貍泌コ() ); + base.list蟄植ctivities.Add( this.actDancer = new CAct貍泌・愁rumsDancer() ); + base.list蟄植ctivities.Add( this.actMtaiko = new CAct貍泌・愁rumsMtaiko() ); + base.list蟄植ctivities.Add( this.actLaneTaiko = new CAct貍泌・愁rums繝ャ繝シ繝ウ螟ェ鮠() ); + base.list蟄植ctivities.Add( this.actRoll = new CAct貍泌・愁rums騾」謇() ); + base.list蟄植ctivities.Add( this.actBalloon = new CAct貍泌・愁rums鬚ィ闊ケ() ); + base.list蟄植ctivities.Add( this.actChara = new CAct貍泌・愁rums繧ュ繝」繝ゥ繧ッ繧ソ繝シ() ); + base.list蟄植ctivities.Add( this.actGame = new CAct貍泌・愁rums繧イ繝シ繝繝「繝シ繝() ); + base.list蟄植ctivities.Add( this.actBackground = new CAct貍泌・愁rums閭梧勹() ); + base.list蟄植ctivities.Add( this.actRollChara = new CAct貍泌・愁rums騾」謇薙く繝」繝ゥ() ); + base.list蟄植ctivities.Add( this.actComboBalloon = new CAct貍泌・愁rums繧ウ繝ウ繝懷聖縺榊コ縺() ); + base.list蟄植ctivities.Add( this.actComboVoice = new CAct貍泌・修ombo髻ウ螢ー() ); + base.list蟄植ctivities.Add( this.actPauseMenu = new CAct貍泌・襲auseMenu() ); + base.list蟄植ctivities.Add(this.actChipEffects = new CAct貍泌・愁rums繝√ャ繝励お繝輔ぉ繧ッ繝()); + base.list蟄植ctivities.Add(this.actFooter = new CAct貍泌・愁rumsFooter()); + base.list蟄植ctivities.Add(this.actMob = new CAct貍泌・愁rumsMob()); + base.list蟄植ctivities.Add(this.GoGoSplash = new GoGoSplash()); + base.list蟄植ctivities.Add(this.FlyingNotes = new FlyingNotes()); + base.list蟄植ctivities.Add(this.FireWorks = new FireWorks()); + base.list蟄植ctivities.Add(this.PuchiChara = new PuchiChara()); + base.list蟄植ctivities.Add(this.ScoreRank = new CAct貍泌・愁rums繧ケ繧ウ繧「繝ゥ繝ウ繧ッ()); + + base.list蟄植ctivities.Add(this.actDan = new Dan_Cert()); + base.list蟄植ctivities.Add(this.actTokkun = new CAct貍泌・愁rums迚ケ險薙Δ繝シ繝()); + #region[ 譁蟄怜晄悄蛹 ] + ST譁蟄嶺ス咲スョ[] st譁蟄嶺ス咲スョArray = new ST譁蟄嶺ス咲スョ[ 12 ]; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ.ch = '0'; + st譁蟄嶺ス咲スョ.pt = new Point( 0, 0 ); + st譁蟄嶺ス咲スョArray[ 0 ] = st譁蟄嶺ス咲スョ; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ2 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ2.ch = '1'; + st譁蟄嶺ス咲スョ2.pt = new Point( 32, 0 ); + st譁蟄嶺ス咲スョArray[ 1 ] = st譁蟄嶺ス咲スョ2; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ3 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ3.ch = '2'; + st譁蟄嶺ス咲スョ3.pt = new Point( 64, 0 ); + st譁蟄嶺ス咲スョArray[ 2 ] = st譁蟄嶺ス咲スョ3; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ4 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ4.ch = '3'; + st譁蟄嶺ス咲スョ4.pt = new Point( 96, 0 ); + st譁蟄嶺ス咲スョArray[ 3 ] = st譁蟄嶺ス咲スョ4; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ5 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ5.ch = '4'; + st譁蟄嶺ス咲スョ5.pt = new Point( 128, 0 ); + st譁蟄嶺ス咲スョArray[ 4 ] = st譁蟄嶺ス咲スョ5; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ6 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ6.ch = '5'; + st譁蟄嶺ス咲スョ6.pt = new Point( 160, 0 ); + st譁蟄嶺ス咲スョArray[ 5 ] = st譁蟄嶺ス咲スョ6; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ7 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ7.ch = '6'; + st譁蟄嶺ス咲スョ7.pt = new Point( 192, 0 ); + st譁蟄嶺ス咲スョArray[ 6 ] = st譁蟄嶺ス咲スョ7; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ8 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ8.ch = '7'; + st譁蟄嶺ス咲スョ8.pt = new Point( 224, 0 ); + st譁蟄嶺ス咲スョArray[ 7 ] = st譁蟄嶺ス咲スョ8; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ9 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ9.ch = '8'; + st譁蟄嶺ス咲スョ9.pt = new Point( 256, 0 ); + st譁蟄嶺ス咲スョArray[ 8 ] = st譁蟄嶺ス咲スョ9; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ10 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ10.ch = '9'; + st譁蟄嶺ス咲スョ10.pt = new Point( 288, 0 ); + st譁蟄嶺ス咲スョArray[ 9 ] = st譁蟄嶺ス咲スョ10; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ11 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ11.ch = '%'; + st譁蟄嶺ス咲スョ11.pt = new Point( 320, 0 ); + st譁蟄嶺ス咲スョArray[ 10 ] = st譁蟄嶺ス咲スョ11; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ12 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ12.ch = ' '; + st譁蟄嶺ス咲スョ12.pt = new Point( 0, 0 ); + st譁蟄嶺ス咲スョArray[ 11 ] = st譁蟄嶺ス咲スョ12; + this.st蟆乗枚蟄嶺ス咲スョ = st譁蟄嶺ス咲スョArray; + + st譁蟄嶺ス咲スョArray = new ST譁蟄嶺ス咲スョ[ 12 ]; + st譁蟄嶺ス咲スョ = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ.ch = '0'; + st譁蟄嶺ス咲スョ.pt = new Point( 0, 0 ); + st譁蟄嶺ス咲スョArray[ 0 ] = st譁蟄嶺ス咲スョ; + st譁蟄嶺ス咲スョ2 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ2.ch = '1'; + st譁蟄嶺ス咲スョ2.pt = new Point( 32, 0 ); + st譁蟄嶺ス咲スョArray[ 1 ] = st譁蟄嶺ス咲スョ2; + st譁蟄嶺ス咲スョ3 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ3.ch = '2'; + st譁蟄嶺ス咲スョ3.pt = new Point( 64, 0 ); + st譁蟄嶺ス咲スョArray[ 2 ] = st譁蟄嶺ス咲スョ3; + st譁蟄嶺ス咲スョ4 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ4.ch = '3'; + st譁蟄嶺ス咲スョ4.pt = new Point( 96, 0 ); + st譁蟄嶺ス咲スョArray[ 3 ] = st譁蟄嶺ス咲スョ4; + st譁蟄嶺ス咲スョ5 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ5.ch = '4'; + st譁蟄嶺ス咲スョ5.pt = new Point( 128, 0 ); + st譁蟄嶺ス咲スョArray[ 4 ] = st譁蟄嶺ス咲スョ5; + st譁蟄嶺ス咲スョ6 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ6.ch = '5'; + st譁蟄嶺ス咲スョ6.pt = new Point( 160, 0 ); + st譁蟄嶺ス咲スョArray[ 5 ] = st譁蟄嶺ス咲スョ6; + st譁蟄嶺ス咲スョ7 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ7.ch = '6'; + st譁蟄嶺ス咲スョ7.pt = new Point( 192, 0 ); + st譁蟄嶺ス咲スョArray[ 6 ] = st譁蟄嶺ス咲スョ7; + st譁蟄嶺ス咲スョ8 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ8.ch = '7'; + st譁蟄嶺ス咲スョ8.pt = new Point( 224, 0 ); + st譁蟄嶺ス咲スョArray[ 7 ] = st譁蟄嶺ス咲スョ8; + st譁蟄嶺ス咲スョ9 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ9.ch = '8'; + st譁蟄嶺ス咲スョ9.pt = new Point( 256, 0 ); + st譁蟄嶺ス咲スョArray[ 8 ] = st譁蟄嶺ス咲スョ9; + st譁蟄嶺ス咲スョ10 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ10.ch = '9'; + st譁蟄嶺ス咲スョ10.pt = new Point( 288, 0 ); + st譁蟄嶺ス咲スョArray[ 9 ] = st譁蟄嶺ス咲スョ10; + st譁蟄嶺ス咲スョ11 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ11.ch = '%'; + st譁蟄嶺ス咲スョ11.pt = new Point( 320, 0 ); + st譁蟄嶺ス咲スョArray[ 10 ] = st譁蟄嶺ス咲スョ11; + st譁蟄嶺ス咲スョ12 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ12.ch = ' '; + st譁蟄嶺ス咲スョ12.pt = new Point( 0, 0 ); + st譁蟄嶺ス咲スョArray[ 11 ] = st譁蟄嶺ス咲スョ12; + this.st蟆乗枚蟄嶺ス咲スョ = st譁蟄嶺ス咲スョArray; + #endregion + } + + + // 繝。繧ス繝繝 + + public void t貍泌・冗オ先棡繧呈シ邏阪☆繧( out CScoreIni.C貍泌・剰ィ倬鹸 Drums ) + { + base.t貍泌・冗オ先棡繧呈シ邏阪☆繧祇繝峨Λ繝( out Drums ); + } + + + // CStage 螳溯」 + + public override void On豢サ諤ァ蛹() + { + LoudnessMetadataScanner.StopBackgroundScanning(joinImmediately: false); + + this.b繝輔ぅ繝ォ繧、繝ウ荳ュ = false; + this.n蠕讖滉クュ縺ョ螟ァ髻ウ隨ヲ縺ョ蠎ァ讓 = 0; + this.actGame.t蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ_蛻晄悄蛹(); + base.ReSetScore(TJAPlayer3.DTX.nScoreInit[0, TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]], TJAPlayer3.DTX.nScoreDiff[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]]); + #region [ branch ] + for (int i = 0; i < 2; i++) + { + this.n蛻蟯舌@縺溷屓謨ー[0] = 0; + this.bLEVELHOLD[i] = false; + } + this.nBranch譚。莉カ謨ー蛟、A = 0; + this.nBranch譚。莉カ謨ー蛟、B = 0; + #endregion + + base.On豢サ諤ァ蛹(); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷;//蛻晄悄蛹悶☆繧後ー縲√Μ繧カ繝ォ繝亥、蛾キ縺ッ豁「縺セ繧九 + + // MODIFY_BEGIN #25398 2011.06.07 FROM + if ( TJAPlayer3.b繧ウ繝ウ繝代け繝医Δ繝シ繝 ) + { + var score = new C繧ケ繧ウ繧「(); + TJAPlayer3.Songs邂。逅.tScoreIni繧定ェュ縺ソ霎シ繧薙〒隴憺擇諠蝣ア繧定ィュ螳壹☆繧( TJAPlayer3.str繧ウ繝ウ繝代け繝医Δ繝シ繝峨ヵ繧。繧、繝ォ + ".score.ini", score ); + } + else + { + } + // MODIFY_END #25398 + dtLastQueueOperation = DateTime.MinValue; + + //int nUnit = (int)( ( ( 60.0 / ( CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM ) ) ) * 1000.0 / this.actChara.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length ); + //int nUnit_gogo = (int)((60.0 / ( CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM ) / this.actChara.ar繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length ) * 1000 ); + + //double dbUnit = ( ( ( 60.0 / ( CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM ) ) ) ); + //double dbUnit_gogo = ( ( ( 60.0 / ( CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM ) ) ) / this.actChara.ar繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length ); + + double dbPtn_Normal = (60.0 / TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM) * TJAPlayer3.Skin.Game_Chara_Beat_Normal / this.actChara.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length; + double dbPtn_Clear = (60.0 / TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM) * TJAPlayer3.Skin.Game_Chara_Beat_Clear / this.actChara.ar繧ッ繝ェ繧「繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length; + double dbPtn_GoGo = (60.0 / TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM) * TJAPlayer3.Skin.Game_Chara_Beat_GoGo / this.actChara.ar繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length; + + PuchiChara.ChangeBPM(60.0 / TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM); + + //dbUnit = Math.Ceiling( dbUnit * 1000.0 ); + //dbUnit = dbUnit / 1000.0; + + //this.actChara.ctChara_Normal = new CCounter( 0, this.actChara.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, dbPtn_Normal, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝 ); + ////this.actChara.ct騾壼クク繝「繝シ繧キ繝ァ繝ウ = new CCounter( 0, this.actChara.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, 0.07, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝 ); + //this.actChara.ctChara_GoGo = new CCounter( 0, this.actChara.ar繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, dbPtn_GoGo, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝 ); + + for(int nPlayer = 0; nPlayer < 2; nPlayer++) + { + if (TJAPlayer3.Skin.Game_Chara_Ptn_Normal != 0) + { + this.actChara.ctChara_Normal[nPlayer] = new CCounter(0, this.actChara.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, dbPtn_Normal, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + } + else + { + this.actChara.ctChara_Normal[nPlayer] = new CCounter(); + } + if (TJAPlayer3.Skin.Game_Chara_Ptn_Clear != 0) + { + this.actChara.ctChara_Clear[nPlayer] = new CCounter(0, this.actChara.ar繧ッ繝ェ繧「繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, dbPtn_Clear, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + } + else + { + this.actChara.ctChara_Clear[nPlayer] = new CCounter(); + } + if (TJAPlayer3.Skin.Game_Chara_Ptn_GoGo != 0) + { + this.actChara.ctChara_GoGo[nPlayer] = new CCounter(0, this.actChara.ar繧エ繝シ繧エ繝シ繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, dbPtn_GoGo, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + } + else + { + this.actChara.ctChara_GoGo[nPlayer] = new CCounter(); + } + } + + //if (this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ繧ソ繧、繝 != null) this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ繧ソ繧、繝 = new CCounter(); + + //this.actDancer.ct騾壼クク繝「繝シ繧キ繝ァ繝ウ = new CCounter( 0, this.actDancer.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ_騾壼クク.Length - 1, ( dbUnit * 4.0) / this.actDancer.ar繝「繝シ繧キ繝ァ繝ウ逡ェ蜿キ_騾壼クク.Length, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝 ); + //this.actDancer.ct繝「繝 = new CCounter( 1.0, 16.0, ((60.0 / CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM / 16.0 )), CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝 ); + + if(this.actDancer.ct雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ != null) + { + double dbUnit_dancer = (((60 / (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM))) / this.actDancer.ar雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length); + this.actDancer.ct雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ = new CCounter(0, this.actDancer.ar雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ逡ェ蜿キ.Length - 1, dbUnit_dancer * TJAPlayer3.Skin.Game_Dancer_Beat, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + }else + { + this.actDancer.ct雕翫j蟄舌Δ繝シ繧キ繝ァ繝ウ = new CCounter(); + } + + this.ct謇九▽縺ェ縺 = new CCounter( 0, 60, 20, TJAPlayer3.Timer ); + this.ShownLyric2 = 0; + + //try + //{ + // this.stream = new StreamWriter("noteTest.txt", false); + //} + //catch (Exception ex) + //{ + // this.stream.Close(); + // this.stream = new StreamWriter("noteTest.txt", false); + //} + // Discord Presence 縺ョ譖エ譁ー + var difficultyName = TJAPlayer3.DifficultyNumberToEnum(TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]).ToString(); + Discord.UpdatePresence(TJAPlayer3.ConfigIni.SendDiscordPlayingInformation ? TJAPlayer3.DTX.str繝輔ぃ繧、繝ォ蜷 : "", + Properties.Discord.Stage_InGame + (TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay == true ? " (" + Properties.Discord.Info_IsAuto + ")" : ""), + 0, + Discord.GetUnixTime() + (long)TJAPlayer3.DTX.listChip[TJAPlayer3.DTX.listChip.Count - 1].n逋コ螢ー譎ょ綾ms / 1000, + TJAPlayer3.ConfigIni.SendDiscordPlayingInformation ? difficultyName.ToLower() : "", + TJAPlayer3.ConfigIni.SendDiscordPlayingInformation ? String.Format("COURSE:{0} ({1})", difficultyName, TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ) : ""); + } + public override void On髱樊エサ諤ァ蛹() + { + this.ct謇九▽縺ェ縺 = null; + base.On髱樊エサ諤ァ蛹(); + + LoudnessMetadataScanner.StartBackgroundScanning(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //this.t閭梧勹繝繧ッ繧ケ繝√Ε縺ョ逕滓(); + //this.tx螟ェ鮠薙ヮ繝シ繝 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_taiko_notes.png" ) ); + //this.txHand = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_taiko_notes_arm.png" ) ); + //this.txSenotes = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_senotes.png" ) ); + //this.tx蟆冗ッ邱 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_bar_line.png" ) ); + //this.tx蟆冗ッ邱喟branch = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_bar_line_branch.png" ) ); + // this.tx蛻、螳壽焚蟆乗枚蟄 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\8_Result_number_s.png" ) ); + // this.txNamePlate = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_NamePlate.png" ) ); + // if (CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay) + // this.txNamePlate2P = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_NamePlate2P.png" ) ); + // this.txPlayerNumber = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\7_PlayerNumber.png")); + + // this.tx蛻、螳壽焚陦ィ遉コ繝代ロ繝ォ = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\7_Paramater Panel.png" ) ); + + // When performing calibration, reduce audio distraction from user input. + // For users who play primarily by listening to the music, + // you might think that we want them to hear drum sound effects during + // calibration, but we do not. Humans are remarkably good at adjusting + // the timing of their own physical movement, even without realizing it. + // We are calibrating their input timing for the purposes of judgment. + // We do not want them subconsciously playing early so as to line up + // their drum sound effects with the sounds of the input calibration file. + // Instead, we want them focused on the sounds of their keyboard, tatacon, + // other controller, etc. and the sounds of the input calibration audio file. + if (!TJAPlayer3.IsPerformingCalibration) + { + this.soundRed = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧( CSkin.Path( @"Sounds\Taiko\dong.ogg" ), ESoundGroup.SoundEffect ); + this.soundBlue = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧( CSkin.Path( @"Sounds\Taiko\ka.ogg" ), ESoundGroup.SoundEffect ); + this.soundAdlib = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧( CSkin.Path(@"Sounds\Taiko\Adlib.ogg"), ESoundGroup.SoundEffect ); + this.soundRed2 = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧(CSkin.Path(@"Sounds\Taiko\dong.ogg"), ESoundGroup.SoundEffect); + this.soundBlue2 = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧(CSkin.Path(@"Sounds\Taiko\ka.ogg"), ESoundGroup.SoundEffect); + this.soundAdlib2 = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧(CSkin.Path(@"Sounds\Taiko\Adlib.ogg"), ESoundGroup.SoundEffect); + + if (TJAPlayer3.ConfigIni.nPlayerCount >= 2)//2020.05.06 Mr-Ojii蟾ヲ蜿ウ縺ォ蜃コ縺励◆縺九▲縺溘°繧峨∬ソス蜉縲 + { + this.soundRed.n菴咲スョ = -100; + this.soundBlue.n菴咲スョ = -100; + this.soundAdlib.n菴咲スョ = -100; + this.soundRed2.n菴咲スョ = 100; + this.soundBlue2.n菴咲スョ = 100; + this.soundAdlib2.n菴咲スョ = 100; + } + } + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + ////CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx閭梧勹 ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繝偵ャ繝医ヰ繝シ ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繝偵ャ繝医ヰ繝シGB ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繝√ャ繝 ); + // //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx螟ェ鮠薙ヮ繝シ繝 ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txHand ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txSenotes ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx蟆冗ッ邱 ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx蟆冗ッ邱喟branch ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繝ャ繝シ繝ウ繝輔Ξ繝シ繝GB ); + ////CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txWailing譫 ); + + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx蛻、螳壽焚陦ィ遉コ繝代ロ繝ォ ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx蛻、螳壽焚蟆乗枚蟄 ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txNamePlate ); + // if (CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay) + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txNamePlate2P ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txPlayerNumber); + + if( this.soundRed != null ) + this.soundRed.t隗」謾セ縺吶k(); + if( this.soundBlue != null ) + this.soundBlue.t隗」謾セ縺吶k(); + if( this.soundAdlib != null ) + this.soundAdlib.t隗」謾セ縺吶k(); + if (this.soundRed2 != null) + this.soundRed2.t隗」謾セ縺吶k(); + if (this.soundBlue2 != null) + this.soundBlue2.t隗」謾セ縺吶k(); + if (this.soundAdlib2 != null) + this.soundAdlib2.t隗」謾セ縺吶k(); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + base.sw.Start(); + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + bool bIsFinishedPlaying = false; + bool bIsFinishedEndAnime = false; + bool bIsFinishedFadeout = false; + #region [ 蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ] + if ( base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.t繝ェ繧サ繝繝(); + TJAPlayer3.Timer.t繝ェ繧サ繝繝(); + this.ct繝√ャ繝玲ィ。讒倥い繝九Γ.Drums = new CCounter( 0, 1, 500, TJAPlayer3.Timer ); + this.ct繝√ャ繝玲ィ。讒倥い繝九Γ.Guitar = new CCounter( 0, 0x17, 20, TJAPlayer3.Timer ); + this.ct繝√ャ繝玲ィ。讒倥い繝九Γ.Bass = new CCounter( 0, 0x17, 20, TJAPlayer3.Timer ); + this.ct繝√ャ繝玲ィ。讒倥い繝九Γ.Taiko = new CCounter( 0, 1, 500, TJAPlayer3.Timer ); + + // this.actChipFireD.Start( E繝ャ繝シ繝ウ.HH ); // #31554 2013.6.12 yyagi + // 蛻昴メ繝繝励ヲ繝繝域凾縺ョ繧ゅ◆縺、縺榊屓驕ソ縲よ怙蛻昴↓actChipFireD.Start()縺吶k縺ィ縺阪↓JIT縺梧寺縺九▲縺ヲシ + // 繧ゅョ縺吶#縺丞セ縺溘&繧後k(2蝗樒岼莉・髯阪→豈斐∋繧九→2,3譯》ick驕輔≧)縲ゅ◎縺薙〒譛蛻昴ョ逕サ髱「繝輔ぉ繝シ繝峨う繝ウ縺ョ髢薙↓ + // 荳逋コStart()繧呈寺縺代※JIT縺ョ邨先棡繧堤函謌舌&縺帙※縺翫¥縲 + + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨う繝ウ; + + this.actFI.t繝輔ぉ繝シ繝峨う繝ウ髢句ァ(); + + if ( TJAPlayer3.DTXVmode.Enabled ) // DTXV繝「繝シ繝峨↑繧 + { + #region [ DTXV逕ィ縺ョ蜀咲函險ュ螳壹↓縺吶k(蜈ィAUTO縺ェ縺ゥ) ] + tDTXV逕ィ縺ョ險ュ螳(); + #endregion + t貍泌・丈ス咲スョ縺ョ螟画峩( TJAPlayer3.DTXVmode.nStartBar, 0 ); + } + + TJAPlayer3.Sound邂。逅.tDisableUpdateBufferAutomatically(); + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + #endregion + if ( ( ( TJAPlayer3.ConfigIni.nRisky != 0 && this.actGauge.IsFailed( E讌ス蝎ィ繝代シ繝.TAIKO ) ) || this.actGame.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.ct谿九j譎る俣.b邨ゆコ蛟、縺ォ驕斐@縺 ) && ( base.e繝輔ぉ繝シ繧コID == CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷 ) ) + { + this.actStageFailed.Start(); + TJAPlayer3.DTX.t蜈ィ繝√ャ繝励ョ蜀咲函蛛懈ュ「(); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_FAILED; + } + if( !String.IsNullOrEmpty( TJAPlayer3.DTX.strBGIMAGE_PATH ) || ( TJAPlayer3.DTX.listAVI.Count == 0 )|| !TJAPlayer3.ConfigIni.bAVI譛牙柑 ) //閭梧勹蜍慕判縺後≠縺」縺溘i閭梧勹逕サ蜒上r謠冗判縺励↑縺縲 + { + this.t騾イ陦梧緒逕サ_閭梧勹(); + } + + if (TJAPlayer3.ConfigIni.bAVI譛牙柑 && TJAPlayer3.DTX.listAVI.Count > 0 && !TJAPlayer3.ConfigIni.bTokkunMode) + { + this.t騾イ陦梧緒逕サ_AVI(); + } + else if (TJAPlayer3.ConfigIni.bBGA譛牙柑) + { + if (TJAPlayer3.ConfigIni.bTokkunMode) actTokkun.On騾イ陦梧緒逕サ_閭梧勹(); + else actBackground.On騾イ陦梧緒逕サ(); + } + + if (!TJAPlayer3.ConfigIni.bAVI譛牙柑 && !TJAPlayer3.ConfigIni.bTokkunMode) + { + actRollChara.On騾イ陦梧緒逕サ(); + } + + if (!TJAPlayer3.ConfigIni.bAVI譛牙柑 && !bDoublePlay && TJAPlayer3.ConfigIni.ShowDancer && !TJAPlayer3.ConfigIni.bTokkunMode) + { + actDancer.On騾イ陦梧緒逕サ(); + } + + if(!TJAPlayer3.ConfigIni.bAVI譛牙柑 && !bDoublePlay && TJAPlayer3.ConfigIni.ShowFooter && !TJAPlayer3.ConfigIni.bTokkunMode) + this.actFooter.On騾イ陦梧緒逕サ(); + + //this.t騾イ陦梧緒逕サ_繧ー繝ゥ繝(); // #24074 2011.01.23 add ikanick + + + //this.t騾イ陦梧緒逕サ_DANGER(); + //this.t騾イ陦梧緒逕サ_蛻、螳壹Λ繧、繝ウ(); + if (!TJAPlayer3.ConfigIni.bNoInfo && TJAPlayer3.ConfigIni.bTokkunMode) + this.t騾イ陦梧緒逕サ_繝阪シ繝繝励Ξ繝シ繝(); + if( TJAPlayer3.ConfigIni.ShowChara ) + this.actChara.On騾イ陦梧緒逕サ(); + + if(!TJAPlayer3.ConfigIni.bAVI譛牙柑 && TJAPlayer3.ConfigIni.ShowMob && !TJAPlayer3.ConfigIni.bTokkunMode) + this.actMob.On騾イ陦梧緒逕サ(); + + if ( TJAPlayer3.ConfigIni.eGameMode != EGame.OFF ) + this.actGame.On騾イ陦梧緒逕サ(); + + this.t騾イ陦梧緒逕サ_隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ(); + this.t騾イ陦梧緒逕サ_繝√ャ繝励い繝九Γ(); + + this.actLaneTaiko.On騾イ陦梧緒逕サ(); + //this.t騾イ陦梧緒逕サ_繝ャ繝シ繝ウ(); + //this.t騾イ陦梧緒逕サ_繝ャ繝シ繝ウ繝輔Λ繝繧キ繝・D(); + + if( ( TJAPlayer3.ConfigIni.eClipDispType == EClipDispType.繧ヲ繧」繝ウ繝峨え縺ョ縺ソ || TJAPlayer3.ConfigIni.eClipDispType == EClipDispType.荳。譁ケ ) && TJAPlayer3.ConfigIni.nPlayerCount == 1 ) + this.actAVI.t遯楢。ィ遉コ(); + + if( !TJAPlayer3.ConfigIni.bNoInfo && !TJAPlayer3.ConfigIni.bTokkunMode) + this.t騾イ陦梧緒逕サ_繧イ繝シ繧ク(); + + this.actLaneTaiko.繧エ繝シ繧エ繝シ轤(); + + + for ( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) + { + bIsFinishedPlaying = this.t騾イ陦梧緒逕サ_繝√ャ繝( E讌ス蝎ィ繝代シ繝.DRUMS, i ); + this.t騾イ陦梧緒逕サ_繝√ャ繝誉騾」謇( E讌ス蝎ィ繝代シ繝.DRUMS, i ); + } + + this.actDan.On騾イ陦梧緒逕サ(); + + this.actMtaiko.On騾イ陦梧緒逕サ(); + this.GoGoSplash.On騾イ陦梧緒逕サ(); + this.t騾イ陦梧緒逕サ_繝ェ繧「繝ォ繧ソ繧、繝蛻、螳壽焚陦ィ遉コ(); + if (TJAPlayer3.ConfigIni.bTokkunMode) + this.actTokkun.On騾イ陦梧緒逕サ_蟆冗ッ_騾溷コヲ(); + + if ( !TJAPlayer3.ConfigIni.bNoInfo ) + this.t騾イ陦梧緒逕サ_繧ウ繝ウ繝(); + if( !TJAPlayer3.ConfigIni.bNoInfo && !TJAPlayer3.ConfigIni.bTokkunMode) + this.t騾イ陦梧緒逕サ_繧ケ繧ウ繧「(); + + + this.Rainbow.On騾イ陦梧緒逕サ(); + this.FireWorks.On騾イ陦梧緒逕サ(); + this.actChipEffects.On騾イ陦梧緒逕サ(); + this.FlyingNotes.On騾イ陦梧緒逕サ(); + this.t騾イ陦梧緒逕サ_繝√ャ繝励ヵ繧。繧、繧「D(); + + if (!TJAPlayer3.ConfigIni.bNoInfo) + this.t騾イ陦梧緒逕サ_繝代ロ繝ォ譁蟄怜(); + + this.actComboBalloon.On騾イ陦梧緒逕サ(); + + for ( int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++ ) + { + this.actRoll.On騾イ陦梧緒逕サ( this.n迴セ蝨ィ縺ョ騾」謇捺焚[ i ], i ); + } + + + if( !TJAPlayer3.ConfigIni.bNoInfo ) + this.t騾イ陦梧緒逕サ_蛻、螳壽枚蟄怜1_騾壼クク菴咲スョ謖螳壹ョ蝣エ蜷(); + + this.t騾イ陦梧緒逕サ_貍泌・乗ュ蝣ア(); + + if (TJAPlayer3.DTX.listLyric2.Count > ShownLyric2 && TJAPlayer3.DTX.listLyric2[ShownLyric2].Time < (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))) + { + this.actPanel.t豁瑚ゥ槭ユ繧ッ繧ケ繝√Ε繧堤函謌舌☆繧(TJAPlayer3.DTX.listLyric2[ShownLyric2++].TextTex); + } + + this.actPanel.t豁瑚ゥ槭ユ繧ッ繧ケ繝√Ε繧呈緒逕サ縺吶k(); + + actChara.OnDraw_Balloon(); + + this.t蜈ィ菴灘宛蠕。繝。繧ス繝繝(); + + this.actPauseMenu.t騾イ陦梧緒逕サ(); + //this.actEnd.On騾イ陦梧緒逕サ(); + this.t騾イ陦梧緒逕サ_STAGEFAILED(); + + this.ScoreRank.On騾イ陦梧緒逕サ(); + + if (TJAPlayer3.ConfigIni.bTokkunMode) + { + actTokkun.On騾イ陦梧緒逕サ(); + } + + bIsFinishedEndAnime = this.actEnd.On騾イ陦梧緒逕サ() == 1 ? true : false; + bIsFinishedFadeout = this.t騾イ陦梧緒逕サ_繝輔ぉ繝シ繝峨う繝ウ_繧「繧ヲ繝(); + + //貍泌・冗オゆコ竊呈シ泌コ陦ィ遉コ竊偵ヵ繧ァ繝シ繝峨い繧ヲ繝 + if( bIsFinishedPlaying && base.e繝輔ぉ繝シ繧コID == CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷 ) + { + if (TJAPlayer3.ConfigIni.bTokkunMode) + { + bIsFinishedPlaying = false; + TJAPlayer3.Skin.sound迚ケ險灘●豁「髻ウ.t蜀咲函縺吶k(); + actTokkun.t貍泌・上r蛛懈ュ「縺吶k(); + + actTokkun.t隴憺擇縺ョ陦ィ遉コ菴咲スョ繧貞粋繧上○繧(true); + } + else + { + for(int i = 0; i < 2; i++) + { + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.貍泌・柔貍泌・冗オゆコ貍泌コ; + + this.actEnd.Start(); + if (TJAPlayer3.Skin.Game_Chara_Ptn_10combo_Max != 0) + { + if (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[0] >= 100) + { + double dbUnit = (((60.0 / (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPlayInfo.dbBPM)))); + this.actChara.繧「繧ッ繧キ繝ァ繝ウ繧ソ繧、繝槭シ繝ェ繧サ繝繝(i); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝廴AX[i] = new CCounter(0, TJAPlayer3.Skin.Game_Chara_Ptn_10combo_Max - 1, (dbUnit / TJAPlayer3.Skin.Game_Chara_Ptn_10combo_Max) * 2, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝廴AX[i].t騾イ陦慧b(); + this.actChara.ct繧ュ繝」繝ゥ繧ッ繧ソ繝シ繧「繧ッ繧キ繝ァ繝ウ_10繧ウ繝ウ繝廴AX[i].n迴セ蝨ィ縺ョ蛟、 = 0; + this.actChara.b繝槭う縺ゥ繧薙い繧ッ繧キ繝ァ繝ウ荳ュ[i] = true; + } + } + } + } + } + else if( bIsFinishedEndAnime && base.e繝輔ぉ繝シ繧コID == E繝輔ぉ繝シ繧コ.貍泌・柔貍泌・冗オゆコ貍泌コ ) + { + this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、 = E貍泌・冗判髱「縺ョ謌サ繧雁、.繧ケ繝繝シ繧ク繧ッ繝ェ繧「; + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_CLEAR_繝輔ぉ繝シ繝峨い繧ヲ繝; + this.actFOClear.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(); + } + + + //if( bIsFinishedPlaying && ( base.e繝輔ぉ繝シ繧コID == CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷 ) ) + //{ + // this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、 = E貍泌・冗判髱「縺ョ謌サ繧雁、.繧ケ繝繝シ繧ク繧ッ繝ェ繧「; + // base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.貍泌・柔STAGE_CLEAR_繝輔ぉ繝シ繝峨い繧ヲ繝; + // this.actFOClear.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(); + //} + + if( bIsFinishedFadeout ) + { + Debug.WriteLine( "Total On騾イ陦梧緒逕サ=" + sw.ElapsedMilliseconds + "ms" ); + return (int) this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、; + } + + ManageMixerQueue(); + + // 繧ュ繝シ蜈・蜉 + + if( TJAPlayer3.act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ == null ) + this.t繧ュ繝シ蜈・蜉(); + + + } + base.sw.Stop(); + return 0; + } + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + [StructLayout( LayoutKind.Sequential )] + private struct ST譁蟄嶺ス咲スョ + { + public char ch; + public Point pt; + } + public CAct貍泌・愁rums繝√ャ繝励ヵ繧。繧、繧「D actChipFireD; + + private CAct貍泌・愁rums繧ー繝ゥ繝 actGraph; // #24074 2011.01.23 add ikanick + private CAct貍泌・愁rums繝代ャ繝 actPad; + public CAct貍泌・愁rums繝ャ繝シ繝ウ actLane; + public CAct貍泌・愁rumsMtaiko actMtaiko; + public CAct貍泌・愁rums繝ャ繝シ繝ウ螟ェ鮠 actLaneTaiko; + public CAct貍泌・愁rums貍泌・冗オゆコ貍泌コ actEnd; + private CAct貍泌・愁rums繧イ繝シ繝繝「繝シ繝 actGame; + public CAct貍泌・愁rums迚ケ險薙Δ繝シ繝 actTokkun; + public CAct貍泌・愁rums閭梧勹 actBackground; + public GoGoSplash GoGoSplash; + public FlyingNotes FlyingNotes; + public FireWorks FireWorks; + public PuchiChara PuchiChara; + public CAct貍泌・愁rums繧ケ繧ウ繧「繝ゥ繝ウ繧ッ ScoreRank; + private bool b繝輔ぅ繝ォ繧、繝ウ荳ュ; + private readonly E繝代ャ繝閏] e繝√Ε繝ウ繝阪Νto繝代ャ繝 = new E繝代ャ繝閏] + { + E繝代ャ繝.HH, E繝代ャ繝.SD, E繝代ャ繝.BD, E繝代ャ繝.HT, + E繝代ャ繝.LT, E繝代ャ繝.CY, E繝代ャ繝.FT, E繝代ャ繝.HHO, + E繝代ャ繝.RD, E繝代ャ繝.UNKNOWN, E繝代ャ繝.UNKNOWN, E繝代ャ繝.LC, + E繝代ャ繝.LP, E繝代ャ繝.LBD + }; + private int[] n繝√Ε繝ウ繝阪ΝtoX蠎ァ讓 = new int[] { 370, 470, 582, 527, 645, 748, 694, 373, 815, 298, 419, 419 }; + private CCounter ct謇九▽縺ェ縺; + private CTexture tx繝偵ャ繝医ヰ繝シGB; + private CTexture tx繝ャ繝シ繝ウ繝輔Ξ繝シ繝GB; + //private CTexture tx螟ェ鮠薙ヮ繝シ繝; + //private CTexture txHand; + //private CTexture txSenotes; + //private CTexture tx蟆冗ッ邱; + //private CTexture tx蟆冗ッ邱喟branch; + + private CTexture tx蛻、螳壽焚陦ィ遉コ繝代ロ繝ォ; + private CTexture tx蛻、螳壽焚蟆乗枚蟄; + //private CTexture txNamePlate; //縺。繧縺」縺ィ謠冗判鬆縺ァ驛ス蜷医′謔ェ縺上↑繧九ョ縺ァ遘サ蜍輔 + //private CTexture txNamePlate2P; //縺。繧縺」縺ィ謠冗判鬆縺ァ驛ス蜷医′謔ェ縺上↑繧九ョ縺ァ遘サ蜍輔 + //private CTexture txPlayerNumber; + + private CTexture txMovie; //2016.08.30 kairera0467 繧ヲ繧」繝ウ繝峨え陦ィ遉コ + + public float nGauge = 0.0f; + private int ShownLyric2 = 0; + + private StreamWriter stream; + + private int n蠕讖滉クュ縺ョ螟ァ髻ウ隨ヲ縺ョ蠎ァ讓; + private readonly ST譁蟄嶺ス咲スョ[] st蟆乗枚蟄嶺ス咲スョ; + private readonly ST譁蟄嶺ス咲スョ[] st螟ァ譁蟄嶺ス咲スョ; + //----------------- + + private bool b繝輔ぅ繝ォ繧、繝ウ蛹コ髢薙ョ譛蠕後ョChip縺ァ縺ゅk( CDTX.CChip pChip ) + { + if( pChip == null ) + { + return false; + } + int num = pChip.n逋コ螢ー菴咲スョ; + for( int i = listChip[0].IndexOf( pChip ) + 1; i < listChip[0].Count; i++ ) + { + pChip = listChip[0][ i ]; + if( ( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x53 ) && ( pChip.n謨エ謨ー蛟、 == 2 ) ) + { + return true; + } + if( ( ( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x11 ) && ( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x1C ) ) && ( ( pChip.n逋コ螢ー菴咲スョ - num ) > 0x18 ) ) + { + return false; + } + } + return true; + } + + protected override E蛻、螳 t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅( long nHitTime, CDTX.CChip pChip, bool bCorrectLane ) + { + E蛻、螳 eJudgeResult = t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅( nHitTime, pChip, E讌ス蝎ィ繝代シ繝.DRUMS, bCorrectLane, 0 ); + // #24074 2011.01.23 add ikanick + if( pChip.n繧ウ繝シ繧ケ == this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ[ 0 ] && ( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x11 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x14 ) && pChip.bShow == true && eJudgeResult != E蛻、螳.Auto ) + this.actGame.t蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ_蛻、螳壹°繧牙推謨ー蛟、繧貞「怜刈縺輔○繧( eJudgeResult, (int)( nHitTime - pChip.n逋コ螢ー譎ょ綾ms ) ); + return eJudgeResult; + } + + protected override void t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅_Bad縺ェ繧峨ウ縺ォTight譎ゅョMiss(CDTX.ECourse eCourse, E讌ス蝎ィ繝代シ繝 part) + { + this.t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅_Bad縺ェ繧峨ウ縺ォTight譎ゅョMiss(eCourse, part, 0, E讌ス蝎ィ繝代シ繝.DRUMS); + } + protected override void t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅_Bad縺ェ繧峨ウ縺ォTight譎ゅョMiss(CDTX.ECourse eCourse, E讌ス蝎ィ繝代シ繝 part, int nLane) + { + this.t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅_Bad縺ェ繧峨ウ縺ォTight譎ゅョMiss(eCourse, part, nLane, E讌ス蝎ィ繝代シ繝.DRUMS); + } + + private bool t繝峨Λ繝繝偵ャ繝亥ヲ逅( long nHitTime, E繝代ャ繝 type, CDTX.CChip pChip, bool b荳。謇句・蜉, int nPlayer ) + { + int nInput = 0; + + switch( type ) + { + case E繝代ャ繝.LRed: + case E繝代ャ繝.RRed: + case E繝代ャ繝.LRed2P: + case E繝代ャ繝.RRed2P: + nInput = 0; + if( b荳。謇句・蜉 ) + nInput = 2; + break; + case E繝代ャ繝.LBlue: + case E繝代ャ繝.RBlue: + case E繝代ャ繝.LBlue2P: + case E繝代ャ繝.RBlue2P: + nInput = 1; + if( b荳。謇句・蜉 ) + nInput = 3; + break; + } + + + if( pChip == null ) + { + return false; + } + int index = pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ; + if ( ( index >= 0x11 ) && ( index <= 0x12 ) ) + { + index -= 0x11; + } + else if ( ( index >= 0x13 ) && ( index <= 0x14 ) ) + { + index -= 0x13; + } + else if ( ( index >= 0x1A ) && ( index <= 0x1B ) ) + { + index -= 0x1A; + } + else if( index == 0x1F ) + { + index = 0x11 - 0x11; + } + else if( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x15 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x17 ) + { + this.t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅( nHitTime, pChip, E讌ス蝎ィ繝代シ繝.TAIKO, true, nInput, nPlayer ); + return true; + } + else + { + return false; + } + + + int nLane = index; + int nPad = index; + + E蛻、螳 e蛻、螳 = this.e謖螳壽凾蛻サ縺九iChip縺ョJUDGE繧定ソ斐☆( nHitTime, pChip ); + //if( pChip.n繧ウ繝シ繧ケ == this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ ) + this.actGame.t蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ_蛻、螳壹°繧牙推謨ー蛟、繧貞「怜刈縺輔○繧( e蛻、螳, (int)( nHitTime - pChip.n逋コ螢ー譎ょ綾ms ) ); + if( e蛻、螳 == E蛻、螳.Miss ) + { + return false; + } + this.t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅( nHitTime, pChip, E讌ス蝎ィ繝代シ繝.TAIKO, true, nInput, nPlayer ); + if( ( e蛻、螳 != E蛻、螳.Poor ) && ( e蛻、螳 != E蛻、螳.Miss ) ) + { + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actLaneTaiko.Start( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ, e蛻、螳, b荳。謇句・蜉, nPlayer ); + + int nFly = 0; + switch(pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ) + { + case 0x11: + nFly = 1; + break; + case 0x12: + nFly = 2; + break; + case 0x13: + case 0x1A: + nFly = b荳。謇句・蜉 ? 3 : 1; + break; + case 0x14: + case 0x1B: + nFly = b荳。謇句・蜉 ? 4 : 2; + break; + case 0x1F: + nFly = nInput == 0 ? 1 : 2; + break; + default: + nFly = 1; + break; + } + + + //this.actChipFireTaiko.Start( nFly, nPlayer ); + this.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Hit); + this.FlyingNotes.Start(nFly, nPlayer); + } + + return true; + } + + protected override void 繝峨Λ繝繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ繧「繝繝() + { + TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums = Math.Min( TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums + 1, 1999 ); + } + protected override void 繝峨Λ繝繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ繝繧ヲ繝ウ() + { + TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums = Math.Max( TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums - 1, 0 ); + } + + + protected override void t騾イ陦梧緒逕サ_AVI() + { + base.t騾イ陦梧緒逕サ_AVI( 0, 0 ); + } + protected override void t騾イ陦梧緒逕サ_DANGER() + { + this.actDANGER.t騾イ陦梧緒逕サ( this.actGauge.IsDanger(E讌ス蝎ィ繝代シ繝.DRUMS), false, false ); + } + + private void t騾イ陦梧緒逕サ_繧ー繝ゥ繝() + { + if( TJAPlayer3.ConfigIni.bGraph.Drums ) + { + this.actGraph.On騾イ陦梧緒逕サ(); + } + } + + private void t騾イ陦梧緒逕サ_繝√ャ繝励ヵ繧。繧、繧「D() + { + this.actChipFireD.On騾イ陦梧緒逕サ(); + } + + + private void t騾イ陦梧緒逕サ_繝峨Λ繝繝代ャ繝() + { + if( TJAPlayer3.ConfigIni.eDark != E繝繝シ繧ッ繝「繝シ繝.FULL ) + { + this.actPad.On騾イ陦梧緒逕サ(); + } + } + protected override void t騾イ陦梧緒逕サ_繝代ロ繝ォ譁蟄怜() + { + base.t騾イ陦梧緒逕サ_繝代ロ繝ォ譁蟄怜( 336, 427 ); + } + + protected override void t騾イ陦梧緒逕サ_貍泌・乗ュ蝣ア() + { + base.t騾イ陦梧緒逕サ_貍泌・乗ュ蝣ア( 1000, 257 ); + } + + protected override void t邏吝聖髮ェ_髢句ァ() + { + //if( this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.Drums % 10 == 0 && this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.Drums > 0 ) + { + //this.actChipFireD.Start邏吝聖髮ェ(); + } + } + + protected override void t蜈・蜉帛ヲ逅_繝峨Λ繝() + { + var nInputAdjustTimeMs = TJAPlayer3.ConfigIni.nInputAdjustTimeMs; + + for( int nPad = 0; nPad < (int) E繝代ャ繝.MAX; nPad++ ) // #27029 2012.1.4 from: <10 to <=10; E繝代ャ繝峨ョ隕∫エ縺鯉シ代▽シHPシ牙「励∴縺溘◆繧√ + // 2012.1.5 yyagi: (int)E繝代ャ繝.MAX 縺ォ螟画峩縲E繝代ャ繝峨ョ隕∫エ謨ー縺ク縺ョ萓晏ュ倥r辟。縺上☆縺溘a縲 + { + List listInputEvent = TJAPlayer3.Pad.GetEvents( E讌ス蝎ィ繝代シ繝.DRUMS, (E繝代ャ繝) nPad ); + + if( ( listInputEvent == null ) || ( listInputEvent.Count == 0 ) ) + continue; + + this.t蜈・蜉帙Γ繧ス繝繝芽ィ俶カ( E讌ス蝎ィ繝代シ繝.DRUMS ); + + foreach( STInputEvent inputEvent in listInputEvent ) + { + if( !inputEvent.b謚シ縺輔l縺 ) + continue; + + long nTime = (long)(((inputEvent.nTimeStamp + nInputAdjustTimeMs - CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n蜑榊屓繝ェ繧サ繝繝医@縺滓凾縺ョ繧キ繧ケ繝繝譎ょ綾) * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))); + //int nPad09 = ( nPad == (int) E繝代ャ繝.HP ) ? (int) E繝代ャ繝.BD : nPad; // #27029 2012.1.5 yyagi + + bool bHitted = false; + + int nLane = 0; + int nHand = 0; + int nChannel = 0; + + //騾」謇薙メ繝繝励r讀懃エ「縺励※縺九i騾壼クク髻ウ隨ヲ讀懃エ「 + //騾」謇薙メ繝繝励ョ讀懃エ「縺ッ縲 + //荳逡ェ霑代¥縺ョ騾」謇馴浹隨ヲ繧呈爾縺吮呈凾蛻サ繝√ぉ繝繧ッ + //逋コ螢ー < 迴セ蝨ィ譎ょ綾 && 邨ゅo繧 > 迴セ蝨ィ譎ょ綾 + + //2015.03.19 kairera0467 Chip繧1縺、縺ォ縺セ縺ィ繧√※1縺、縺ョ繝ャ繝シ繝ウ謇ア縺縺ォ縺吶k縲 + int nUsePlayer = 0; + if (nPad >= 12 && nPad <= 15) + { + nUsePlayer = 0; + } + else if (nPad >= 16 && nPad <= 19) + { + nUsePlayer = 1; + if (TJAPlayer3.ConfigIni.nPlayerCount < 2) //繝励Ξ繧、莠コ謨ー縺2莠コ莉・荳翫〒縺ェ縺代l縺ー蜈・蜉帙r繧ュ繝」繝ウ繧サ繝ォ + break; + } + if (!TJAPlayer3.ConfigIni.bTokkunMode && TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay && (nPad >= 12 && nPad <= 15))//2020.05.18 Mr-Ojii 繧ェ繝シ繝域凾縺ョ蜈・蜉帙く繝」繝ウ繧サ繝ォ + break; + else if (TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay && (nPad >= 16 && nPad <= 19)) + break; + var padTo = nUsePlayer == 0 ? nPad - 12 : nPad - 12 - 4; + var isDon = padTo < 2 ? true : false; + + CDTX.CChip chipNoHit = r謖螳壽凾蛻サ縺ォ荳逡ェ霑代>譛ェ繝偵ャ繝Chip繧帝℃蜴サ譁ケ蜷大━蜈医〒讀懃エ「縺吶k(nTime, nUsePlayer); + E蛻、螳 e蛻、螳 = (chipNoHit != null) ? this.e謖螳壽凾蛻サ縺九iChip縺ョJUDGE繧定ソ斐☆(nTime, chipNoHit) : E蛻、螳.Miss; + + + bool b螟ェ鮠馴浹蜀咲函繝輔Λ繧ー = true; + if (chipNoHit != null) + { + if (chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1F && (e蛻、螳 == E蛻、螳.Perfect || e蛻、螳 == E蛻、螳.Good)) + b螟ェ鮠馴浹蜀咲函繝輔Λ繧ー = false; + if (chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1F && (e蛻、螳 != E蛻、螳.Miss && e蛻、螳 != E蛻、螳.Poor)) + if (chipNoHit.nPlayerSide == 0) + { + this.soundAdlib?.t蜀咲函繧帝幕蟋九☆繧(); + } + else + { + this.soundAdlib2?.t蜀咲函繧帝幕蟋九☆繧(); + } + } + + switch (nPad) + { + case 12: + nLane = 0; + nHand = 0; + nChannel = 0x11; + if (b螟ェ鮠馴浹蜀咲函繝輔Λ繧ー) + { + this.soundRed?.t蜀咲函繧帝幕蟋九☆繧(); + } + break; + case 13: + nLane = 0; + nHand = 1; + nChannel = 0x11; + if (b螟ェ鮠馴浹蜀咲函繝輔Λ繧ー) + { + this.soundRed?.t蜀咲函繧帝幕蟋九☆繧(); + } + break; + case 14: + nLane = 1; + nHand = 0; + nChannel = 0x12; + if (b螟ェ鮠馴浹蜀咲函繝輔Λ繧ー) + this.soundBlue?.t蜀咲函繧帝幕蟋九☆繧(); + break; + case 15: + nLane = 1; + nHand = 1; + nChannel = 0x12; + if (b螟ェ鮠馴浹蜀咲函繝輔Λ繧ー) + this.soundBlue?.t蜀咲函繧帝幕蟋九☆繧(); + break; + //莉・荳2P + case 16: + nLane = 0; + nHand = 0; + nChannel = 0x11; + if (b螟ェ鮠馴浹蜀咲函繝輔Λ繧ー) + { + this.soundRed2?.t蜀咲函繧帝幕蟋九☆繧(); + } + break; + case 17: + nLane = 0; + nHand = 1; + nChannel = 0x11; + if (b螟ェ鮠馴浹蜀咲函繝輔Λ繧ー) + { + this.soundRed2?.t蜀咲函繧帝幕蟋九☆繧(); + } + break; + case 18: + nLane = 1; + nHand = 0; + nChannel = 0x12; + if (b螟ェ鮠馴浹蜀咲函繝輔Λ繧ー) + this.soundBlue2?.t蜀咲函繧帝幕蟋九☆繧(); + break; + case 19: + nLane = 1; + nHand = 1; + nChannel = 0x12; + if (b螟ェ鮠馴浹蜀咲函繝輔Λ繧ー) + this.soundBlue2?.t蜀咲函繧帝幕蟋九☆繧(); + break; + } + + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actTaikoLaneFlash.PlayerLane[nUsePlayer].Start((PlayerLane.FlashType)nLane); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actMtaiko.tMtaikoEvent(nChannel, nHand, nUsePlayer); + + if (this.b騾」謇謎クュ[nUsePlayer]) + { + chipNoHit = this.chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕nUsePlayer]; + e蛻、螳 = E蛻、螳.Perfect; + } + + if (chipNoHit == null) + { + break; + } + + + #region [ (A) 繝偵ャ繝医@縺ヲ縺繧後ー繝偵ャ繝亥ヲ逅縺励※谺。縺ョ inputEvent 縺ク ] + //----------------------------- + switch (((E繝代ャ繝)nPad)) + { + case E繝代ャ繝.LRed: + case E繝代ャ繝.LRed2P: + #region[ 髱「縺ョ繝偵ャ繝亥ヲ逅 ] + //----------------------------- + { + if (e蛻、螳 != E蛻、螳.Miss && chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x11) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.LRed, chipNoHit, false, nUsePlayer); + bHitted = true; + } + if (e蛻、螳 != E蛻、螳.Miss && (chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x13 || chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1A) && !TJAPlayer3.ConfigIni.b螟ァ髻ウ隨ヲ蛻、螳) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.LRed, chipNoHit, true, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + break; + } + if (e蛻、螳 != E蛻、螳.Miss && (chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x13 || chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1A) && TJAPlayer3.ConfigIni.b螟ァ髻ウ隨ヲ蛻、螳) + { + if (chipNoHit.eNoteState == ENoteState.none) + { + float time = chipNoHit.n逋コ螢ー譎ょ綾ms - (float)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + if (time <= 110) + { + chipNoHit.nProcessTime = (int)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + chipNoHit.eNoteState = ENoteState.wait; + this.nWaitButton = 2; + } + } + else if (chipNoHit.eNoteState == ENoteState.wait) + { + float time = chipNoHit.n逋コ螢ー譎ょ綾ms - (float)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + int nWaitTime = TJAPlayer3.ConfigIni.n荳。謇句愛螳壹ョ蠕縺。譎る俣; + if (this.nWaitButton == 1 && time <= 110 && chipNoHit.nProcessTime + nWaitTime > (int)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.LRed, chipNoHit, true, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + } + else if (this.nWaitButton == 2 && time <= 110 && chipNoHit.nProcessTime + nWaitTime < (int)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.LRed, chipNoHit, false, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + } + } + } + if (e蛻、螳 != E蛻、螳.Miss && (chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15 || chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x16 || chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x17)) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.LRed, chipNoHit, false, nUsePlayer); + } + + if (!bHitted) + break; + continue; + } + //----------------------------- + #endregion + case E繝代ャ繝.RRed: + case E繝代ャ繝.RRed2P: + #region[ 髱「縺ョ繝偵ャ繝亥ヲ逅 ] + //----------------------------- + { + if (e蛻、螳 != E蛻、螳.Miss && chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x11) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.RRed, chipNoHit, false, nUsePlayer); + bHitted = true; + } + if (e蛻、螳 != E蛻、螳.Miss && (chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x13 || chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1A) && !TJAPlayer3.ConfigIni.b螟ァ髻ウ隨ヲ蛻、螳) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.RRed, chipNoHit, true, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + break; + } + if (e蛻、螳 != E蛻、螳.Miss && (chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x13 || chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1A) && TJAPlayer3.ConfigIni.b螟ァ髻ウ隨ヲ蛻、螳) + { + if (chipNoHit.eNoteState == ENoteState.none) + { + float time = chipNoHit.n逋コ螢ー譎ょ綾ms - (float)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + if (time <= 110) + { + chipNoHit.nProcessTime = (int)CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms; + this.n蠕讖滉クュ縺ョ螟ァ髻ウ隨ヲ縺ョ蠎ァ讓 = chipNoHit.n繝舌シ縺九i縺ョ霍晞屬dot.Taiko; + chipNoHit.eNoteState = ENoteState.wait; + this.nWaitButton = 1; + } + } + else if (chipNoHit.eNoteState == ENoteState.wait) + { + float time = chipNoHit.n逋コ螢ー譎ょ綾ms - (float)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + int nWaitTime = TJAPlayer3.ConfigIni.n荳。謇句愛螳壹ョ蠕縺。譎る俣; + if (this.nWaitButton == 2 && time <= 110 && chipNoHit.nProcessTime + nWaitTime > (int)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.RRed, chipNoHit, true, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + break; + } + else if (this.nWaitButton == 2 && time <= 110 && chipNoHit.nProcessTime + nWaitTime < (int)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.RRed, chipNoHit, false, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + } + } + } + if (e蛻、螳 != E蛻、螳.Miss && (chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15 || chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x16 || chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x17)) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.RRed, chipNoHit, false, nUsePlayer); + } + + if (!bHitted) + break; + + continue; + } + //----------------------------- + #endregion + + case E繝代ャ繝.LBlue: + case E繝代ャ繝.LBlue2P: + #region[ 縺オ縺。縺ョ繝偵ャ繝亥ヲ逅 ] + //----------------------------- + { + if (e蛻、螳 != E蛻、螳.Miss && chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x12) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.LBlue, chipNoHit, false, nUsePlayer); + bHitted = true; + } + if (e蛻、螳 != E蛻、螳.Miss && (chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x14 || chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1B) && !TJAPlayer3.ConfigIni.b螟ァ髻ウ隨ヲ蛻、螳) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.LBlue, chipNoHit, true, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + break; + } + if (e蛻、螳 != E蛻、螳.Miss && (chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x14 || chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1B) && TJAPlayer3.ConfigIni.b螟ァ髻ウ隨ヲ蛻、螳) + { + if (chipNoHit.eNoteState == ENoteState.none) + { + float time = chipNoHit.n逋コ螢ー譎ょ綾ms - (float)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + if (time <= 110) + { + chipNoHit.nProcessTime = (int)CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms; + chipNoHit.eNoteState = ENoteState.wait; + this.nWaitButton = 2; + } + } + else if (chipNoHit.eNoteState == ENoteState.wait) + { + float time = chipNoHit.n逋コ螢ー譎ょ綾ms - (float)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + int nWaitTime = TJAPlayer3.ConfigIni.n荳。謇句愛螳壹ョ蠕縺。譎る俣; + if (this.nWaitButton == 1 && time <= 110 && chipNoHit.nProcessTime + nWaitTime > (int)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.LBlue, chipNoHit, true, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + } + else if (this.nWaitButton == 2 && time <= 110 && chipNoHit.nProcessTime + nWaitTime < (int)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.LBlue, chipNoHit, false, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + } + } + } + if (e蛻、螳 != E蛻、螳.Miss && (chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15 || chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x16)) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.LBlue, chipNoHit, false, nUsePlayer); + } + + if (!bHitted) + break; + continue; + } + //----------------------------- + #endregion + + case E繝代ャ繝.RBlue: + case E繝代ャ繝.RBlue2P: + #region[ 縺オ縺。縺ョ繝偵ャ繝亥ヲ逅 ] + //----------------------------- + { + if (e蛻、螳 != E蛻、螳.Miss && chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x12) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.RBlue, chipNoHit, false, nUsePlayer); + bHitted = true; + } + if (e蛻、螳 != E蛻、螳.Miss && (chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x14 || chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1B) && !TJAPlayer3.ConfigIni.b螟ァ髻ウ隨ヲ蛻、螳) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.RBlue, chipNoHit, true, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + break; + } + if (e蛻、螳 != E蛻、螳.Miss && (chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x14 || chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1B) && TJAPlayer3.ConfigIni.b螟ァ髻ウ隨ヲ蛻、螳) + { + if (chipNoHit.eNoteState == ENoteState.none) + { + float time = chipNoHit.n逋コ螢ー譎ょ綾ms - (float)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + if (time <= 110) + { + chipNoHit.nProcessTime = (int)CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms; + this.n蠕讖滉クュ縺ョ螟ァ髻ウ隨ヲ縺ョ蠎ァ讓 = chipNoHit.n繝舌シ縺九i縺ョ霍晞屬dot.Taiko; + chipNoHit.eNoteState = ENoteState.wait; + this.nWaitButton = 1; + } + } + else if (chipNoHit.eNoteState == ENoteState.wait) + { + float time = chipNoHit.n逋コ螢ー譎ょ綾ms - (float)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + int nWaitTime = TJAPlayer3.ConfigIni.n荳。謇句愛螳壹ョ蠕縺。譎る俣; + if (this.nWaitButton == 2 && time <= 110 && chipNoHit.nProcessTime + nWaitTime > (int)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.RBlue, chipNoHit, true, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + break; + } + else if (this.nWaitButton == 2 && time <= 110 && chipNoHit.nProcessTime + nWaitTime < (int)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.RBlue, chipNoHit, false, nUsePlayer); + bHitted = true; + this.nWaitButton = 0; + } + } + } + if (e蛻、螳 != E蛻、螳.Miss && (chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15 || chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x16)) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, E繝代ャ繝.RBlue, chipNoHit, false, nUsePlayer); + } + + if (!bHitted) + break; + continue; + } + //----------------------------- + #endregion + } + //2016.07.14 kairera0467 Adlib縺ョ蝣エ蜷医∽ク諡ャ縺励※蜃ヲ逅繧定。後≧縲 + if (e蛻、螳 != E蛻、螳.Miss && chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1F) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(nTime, (E繝代ャ繝)nPad, chipNoHit, false, nUsePlayer); + bHitted = true; + } + + //----------------------------- + #endregion + #region [ (B) 繝偵ャ繝医@縺ヲ縺ェ縺九▲縺溷エ蜷医ッ縲√Ξ繝シ繝ウ繝輔Λ繝繧キ繝・縲√ヱ繝繝峨い繝九Γ縲∫ゥコ謇薙■髻ウ蜀咲函繧貞ョ溯。 ] + //----------------------------- + int pad = nPad; // 莉・荳九]Pad 縺ョ莉」繧上j縺ォ pad 繧堤畑縺繧九ゑシ域舌j縺吶∪縺礼畑シ + // BAD or TIGHT 譎ゅョ蜃ヲ逅縲 + if (TJAPlayer3.ConfigIni.bTight && !b騾」謇謎クュ[nUsePlayer]) // 18/8/13 - 騾」謇捺凾縺ォ縺薙l縺檎匱蜍輔☆繧九→蝗ー繧!!! (AioiLight) + this.t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅_Bad縺ェ繧峨ウ縺ォTight譎ゅョMiss(chipNoHit.n繧ウ繝シ繧ケ, E讌ス蝎ィ繝代シ繝.DRUMS, 0, E讌ス蝎ィ繝代シ繝.TAIKO); + //----------------------------- + #endregion + } + } + } + + // t蜈・蜉帛ヲ逅_繝峨Λ繝()縺九i繝。繧ス繝繝峨r謚ス蜃コ縺励◆繧ゅョ縲 + /// + /// chipArray縺ョ荳ュ繧, n逋コ逕滉ス咲スョ縺ョ蟆上&縺鬆縺ォ荳ヲ縺ケ繧 + null繧貞、ァ縺阪>譁ケ縺ォ騾縺九☆縲ゅそ繝繝医〒e蛻、螳哂rray繧ゆクヲ縺ケ逶エ縺吶 + /// + /// 繧ス繝シ繝亥ッセ雎。chip鄒、 + /// 繧ス繝シ繝亥ッセ雎。e蛻、螳夂セ、 + /// 繝√ャ繝玲焚 + private static void SortChipsByNTime( CDTX.CChip[] chipArray, E蛻、螳喙] e蛻、螳哂rray, int NumOfChips ) + { + for ( int i = 0; i < NumOfChips - 1; i++ ) + { + //num9 = 2; + //while( num9 > num8 ) + for ( int j = NumOfChips - 1; j > i; j-- ) + { + if ( ( chipArray[ j - 1 ] == null ) || ( ( chipArray[ j ] != null ) && ( chipArray[ j - 1 ].n逋コ螢ー菴咲スョ > chipArray[ j ].n逋コ螢ー菴咲スョ ) ) ) + { + // swap + CDTX.CChip chipTemp = chipArray[ j - 1 ]; + chipArray[ j - 1 ] = chipArray[ j ]; + chipArray[ j ] = chipTemp; + E蛻、螳 e蛻、螳啜emp = e蛻、螳哂rray[ j - 1 ]; + e蛻、螳哂rray[ j - 1 ] = e蛻、螳哂rray[ j ]; + e蛻、螳哂rray[ j ] = e蛻、螳啜emp; + } + //num9--; + } + //num8++; + } + } + + protected override void t閭梧勹繝繧ッ繧ケ繝√Ε縺ョ逕滓() + { + Rectangle bgrect = new Rectangle( 0, 0, 1280, 720 ); + string DefaultBgFilename = @"Graphics\5_Game\5_Background\0\Background.png"; + string BgFilename = ""; + if( !String.IsNullOrEmpty( TJAPlayer3.DTX.strBGIMAGE_PATH ) ) + BgFilename = TJAPlayer3.DTX.strBGIMAGE_PATH; + base.t閭梧勹繝繧ッ繧ケ繝√Ε縺ョ逕滓( DefaultBgFilename, bgrect, BgFilename ); + } + protected override void t騾イ陦梧緒逕サ_繝√ャ繝誉Taiko( CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip, int nPlayer ) + { + int nLane = 0; + + #region[ 菴懊j逶エ縺励◆繧ゅョ ] + if (pChip.b蜿ッ隕) + { + if (!pChip.bHit) + { + long nPlayTime = (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + if ((!pChip.bHit) && (pChip.n逋コ螢ー譎ょ綾ms <= nPlayTime)) + { + bool bAutoPlay = false; + switch (nPlayer) + { + case 0: + bAutoPlay = TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay; + break; + case 1: + bAutoPlay = TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay2P; + break; + case 2: + case 3: + bAutoPlay = true; + break; + } + + if (bAutoPlay && !this.bPAUSE) + { + pChip.bHit = true; + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x1F) + this.FlyingNotes.Start(pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 0x1A ? (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ - 0x10) : (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ - 0x17), nPlayer); + //this.actChipFireTaiko.Start(pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ < 0x1A ? (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ - 0x10) : (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ - 0x17), nPlayer); + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x12 || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x14 || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1B) nLane = 1; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actTaikoLaneFlash.PlayerLane[nPlayer].Start((nLane == 0 ? PlayerLane.FlashType.Red : PlayerLane.FlashType.Blue)); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Hit); + this.actMtaiko.tMtaikoEvent(pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ, this.nHand[nPlayer], nPlayer); + + int n螟ァ髻ウ隨ヲ = (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x11 || pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x12 ? 2 : 0); + + this.t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅(pChip.n逋コ螢ー譎ょ綾ms, pChip, E讌ス蝎ィ繝代シ繝.TAIKO, true, nLane + n螟ァ髻ウ隨ヲ, nPlayer); + this.t繧オ繧ヲ繝ウ繝牙咲函(pChip, nPlayer); + return; + } + } + + + if ( pChip.n繝弱シ繝蜃コ迴セ譎ょ綾ms != 0 && ( nPlayTime < pChip.n逋コ螢ー譎ょ綾ms - pChip.n繝弱シ繝蜃コ迴セ譎ょ綾ms ) ) + pChip.bShow = false; + else + pChip.bShow = true; + + + switch (nPlayer) + { + case 0: + break; + case 1: + break; + } + switch( pChip.nPlayerSide ) + { + case 1: + break; + } + + int x = 0; + int y = TJAPlayer3.Skin.nScrollFieldY[nPlayer];// + ((int)(pChip.n繧ウ繝シ繧ケ) * 100) + + if (pChip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms != 0 && (nPlayTime < pChip.n逋コ螢ー譎ょ綾ms - pChip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms)) + { + x = (int)( ( ( ( pChip.n逋コ螢ー譎ょ綾ms ) - ( pChip.n逋コ螢ー譎ょ綾ms - pChip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms ) ) * pChip.dbBPM * pChip.dbSCROLL * ( this.act隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums + 1.5 ) ) / 628.7 ); + } + else + { + x = pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Taiko; + } + + int xTemp = 0; + int yTemp = 0; + + #region[ 繧ケ繧ッ繝ュ繝シ繝ォ譁ケ蜷大、画峩 ] + if( pChip.n繧ケ繧ッ繝ュ繝シ繝ォ譁ケ蜷 != 0 ) + { + xTemp = x; + yTemp = y; + } + switch ( pChip.n繧ケ繧ッ繝ュ繝シ繝ォ譁ケ蜷 ) + { + case 0: + x += ( TJAPlayer3.Skin.nScrollFieldX[ nPlayer ] ); + break; + case 1: + x = ( TJAPlayer3.Skin.nScrollFieldX[ nPlayer ] ); + y = TJAPlayer3.Skin.nScrollFieldY[ nPlayer ] - xTemp; + break; + case 2: + x = ( TJAPlayer3.Skin.nScrollFieldX[ nPlayer ] + 3 ); + y = TJAPlayer3.Skin.nScrollFieldY[ nPlayer ] + xTemp; + break; + case 3: + x += ( TJAPlayer3.Skin.nScrollFieldX[ nPlayer ] ); + y = TJAPlayer3.Skin.nScrollFieldY[ nPlayer ] - xTemp; + break; + case 4: + x += ( TJAPlayer3.Skin.nScrollFieldX[ nPlayer ] ); + y = TJAPlayer3.Skin.nScrollFieldY[ nPlayer ] + xTemp; + break; + case 5: + x = ( TJAPlayer3.Skin.nScrollFieldX[ nPlayer ] + 10 ) - xTemp; + break; + case 6: + x = ( TJAPlayer3.Skin.nScrollFieldX[ nPlayer ] ) - xTemp; + y = TJAPlayer3.Skin.nScrollFieldY[ nPlayer ] - xTemp; + break; + case 7: + x = ( TJAPlayer3.Skin.nScrollFieldX[ nPlayer ] ) - xTemp; + y = TJAPlayer3.Skin.nScrollFieldY[ nPlayer ] + xTemp; + break; + } + #endregion + + #region[ 荳。謇句セ縺。譎 ] + if( pChip.eNoteState == ENoteState.wait ) + { + x = ( TJAPlayer3.Skin.nScrollFieldX[0] ); + } + #endregion + + #region[ HIDSUD & STEALTH ] + if( TJAPlayer3.ConfigIni.eSTEALTH == E繧ケ繝繝ォ繧ケ繝「繝シ繝.STEALTH ) + { + pChip.bShow = false; + } + #endregion + + if( pChip.dbSCROLL_Y != 0.0 ) + { + var dbSCROLL = configIni.eScrollMode == EScrollMode.BMSCROLL ? 1.0 : pChip.dbSCROLL; + + y = TJAPlayer3.Skin.nScrollFieldY[nPlayer]; + if (TJAPlayer3.ConfigIni.eScrollMode == EScrollMode.Normal) + y += (int)(((pChip.n逋コ螢ー譎ょ綾ms - CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾) * pChip.dbBPM * pChip.dbSCROLL_Y * (this.act隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums + 1.0)) / 502.8594 / 5.0); + else if (TJAPlayer3.ConfigIni.eScrollMode == EScrollMode.BMSCROLL || TJAPlayer3.ConfigIni.eScrollMode == EScrollMode.HBSCROLL) + { + float? play_bpm_time = null; + if (!play_bpm_time.HasValue) + { + play_bpm_time = this.GetNowPBMTime(dTX, 0); + } + var dbSCROLL_Y = configIni.eScrollMode == EScrollMode.BMSCROLL ? 1.0 : pChip.dbSCROLL_Y; + + y += (int)(3 * 0.8335 * ((pChip.fBMSCROLLTime * NOTE_GAP) - (play_bpm_time * NOTE_GAP)) * dbSCROLL_Y * (this.act隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ[nPlayer] + 1.0) / 2 / 5.0); + } + } + + if ( pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Drums < 0 ) + { + this.actGame.st蜿ゥ縺阪″繧翫∪繧キ繝ァ繝シ.b譛蛻昴ョ繝√ャ繝励′蜿ゥ縺九l縺 = true; + } + + if(( 1400 > x )) + { + if( TJAPlayer3.Tx.Notes != null ) + { + //int num9 = this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.Drums >= 50 ? this.ct繝√ャ繝玲ィ。讒倥い繝九Γ.Drums.n迴セ蝨ィ縺ョ蛟、 * 130 : 0; + int num9 = 0; + if (TJAPlayer3.Skin.Game_Notes_Anime) + { + if (this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[nPlayer] >= 300 && ctChipAnimeLag[nPlayer].b邨ゆコ蛟、縺ォ驕斐@縺) + { + //num9 = ctChipAnime[nPlayer].n迴セ蝨ィ縺ョ蛟、 != 0 ? 260 : 0; + if ((int)ctChipAnime[nPlayer].n迴セ蝨ィ縺ョ蛟、 == 1 || (int)ctChipAnime[nPlayer].n迴セ蝨ィ縺ョ蛟、 == 3) + { + num9 = 260; + } + else + { + num9 = 0; + } + } + else if (this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[nPlayer] >= 300 && !ctChipAnimeLag[nPlayer].b邨ゆコ蛟、縺ォ驕斐@縺) + { + //num9 = base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ != 0 ? base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ * 130 : 0; + if ((int)ctChipAnime[nPlayer].n迴セ蝨ィ縺ョ蛟、 == 1 || (int)ctChipAnime[nPlayer].n迴セ蝨ィ縺ョ蛟、 == 3) + { + num9 = 130; + } + else + { + num9 = 0; + } + } + else if (this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[nPlayer] >= 150) + { + //num9 = base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ != 0 ? base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ * 130 : 0; + if ((int)ctChipAnime[nPlayer].n迴セ蝨ィ縺ョ蛟、 == 1 || (int)ctChipAnime[nPlayer].n迴セ蝨ィ縺ョ蛟、 == 3) + { + num9 = 130; + } + else + { + num9 = 0; + } + } + else if (this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[nPlayer] >= 50 && ctChipAnimeLag[nPlayer].b邨ゆコ蛟、縺ォ驕斐@縺) + { + //num9 = base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ != 0 ? base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ * 130 : 0; + if ((int)ctChipAnime[nPlayer].n迴セ蝨ィ縺ョ蛟、 <= 1) + { + num9 = 130; + } + else + { + num9 = 0; + } + } + else if (this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[nPlayer] >= 50 && !ctChipAnimeLag[nPlayer].b邨ゆコ蛟、縺ォ驕斐@縺) + { + //num9 = base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ != 0 ? base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ * 130 : 0; + num9 = 0; + } + else + { + num9 = 0; + } + } + + + + int nSenotesY = TJAPlayer3.Skin.nSENotesY[nPlayer]; + this.ct謇九▽縺ェ縺.t騾イ陦鍬oop(); + int nHand = this.ct謇九▽縺ェ縺.n迴セ蝨ィ縺ョ蛟、 < 30 ? this.ct謇九▽縺ェ縺.n迴セ蝨ィ縺ョ蛟、 : 60 - this.ct謇九▽縺ェ縺.n迴セ蝨ィ縺ョ蛟、; + + + x = ( x ) - ( ( int ) ( ( 130.0 * pChip.db繝√ャ繝励し繧、繧コ蛟咲紫 ) / 2.0 ) ); + TJAPlayer3.Tx.Notes.b蜉邂怜粋謌 = false; + TJAPlayer3.Tx.SENotes.b蜉邂怜粋謌 = false; + var device = TJAPlayer3.app.Device; + switch ( pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ ) + { + case 0x11: + + if( TJAPlayer3.Tx.Notes != null && pChip.bShow) + { + if( TJAPlayer3.ConfigIni.eSTEALTH != E繧ケ繝繝ォ繧ケ繝「繝シ繝.DORON ) + TJAPlayer3.Tx.Notes.t2D謠冗判( device, x, y, new Rectangle( 130, num9, 130, 130 ) ); + TJAPlayer3.Tx.SENotes.t2D謠冗判( device, x - 2, y + nSenotesY, new Rectangle( 0, 30 * pChip.nSenote, 136, 30 ) ); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x + 60, y + 140, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, pChip.nSenote.ToString() ); + } + break; + + case 0x12: + if( TJAPlayer3.Tx.Notes != null && pChip.bShow) + { + if( TJAPlayer3.ConfigIni.eSTEALTH != E繧ケ繝繝ォ繧ケ繝「繝シ繝.DORON ) + TJAPlayer3.Tx.Notes.t2D謠冗判( device, x, y, new Rectangle( 260, num9, 130, 130) ); + TJAPlayer3.Tx.SENotes.t2D謠冗判( device, x - 2, y + nSenotesY, new Rectangle( 0, 30 * pChip.nSenote, 136, 30 ) ); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x + 60, y + 140, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, pChip.nSenote.ToString() ); + } + nLane = 1; + break; + + case 0x13: + if( TJAPlayer3.Tx.Notes != null && pChip.bShow) + { + if( TJAPlayer3.ConfigIni.eSTEALTH != E繧ケ繝繝ォ繧ケ繝「繝シ繝.DORON ) + { + TJAPlayer3.Tx.Notes.t2D謠冗判( device, x, y, new Rectangle( 390, num9, 130, 130 ) ); + //CDTXMania.Tx.Notes.t3D謠冗判( device, mat, new Rectangle( 390, num9, 130, 130 ) ); + } + TJAPlayer3.Tx.SENotes.t2D謠冗判( device, x - 2, y + nSenotesY, new Rectangle( 0, 30 * pChip.nSenote, 136, 30 ) ); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x + 60, y + 140, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, pChip.nSenote.ToString() ); + } + break; + + case 0x14: + if( TJAPlayer3.Tx.Notes != null && pChip.bShow) + { + if( TJAPlayer3.ConfigIni.eSTEALTH != E繧ケ繝繝ォ繧ケ繝「繝シ繝.DORON ) + TJAPlayer3.Tx.Notes.t2D謠冗判( device, x, y, new Rectangle( 520, num9, 130, 130 ) ); + TJAPlayer3.Tx.SENotes.t2D謠冗判( device, x - 2, y + nSenotesY, new Rectangle( 0, 30 * pChip.nSenote, 136, 30 ) ); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x + 60, y + 140, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, pChip.nSenote.ToString() ); + } + nLane = 1; + break; + + case 0x1A: + if( TJAPlayer3.Tx.Notes != null ) + { + if( TJAPlayer3.ConfigIni.eSTEALTH != E繧ケ繝繝ォ繧ケ繝「繝シ繝.DORON ) + { + if( nPlayer == 0 ) + { + TJAPlayer3.Tx.Notes_Arm.t2D荳贋ク句渚霆「謠冗判( device, x + 25, ( y + 74 ) + nHand ); + TJAPlayer3.Tx.Notes_Arm.t2D荳贋ク句渚霆「謠冗判( device, x + 60, ( y + 104 ) - nHand ); + } + else if( nPlayer == 1 ) + { + TJAPlayer3.Tx.Notes_Arm.t2D謠冗判( device, x + 25, ( y - 44 ) + nHand ); + TJAPlayer3.Tx.Notes_Arm.t2D謠冗判( device, x + 60, ( y - 14 ) - nHand ); + } + TJAPlayer3.Tx.Notes.t2D謠冗判( device, x, y, new Rectangle( 1690, num9, 130, 130 ) ); + //CDTXMania.Tx.Notes.t3D謠冗判( device, mat, new Rectangle( 390, num9, 130, 130 ) ); + } + TJAPlayer3.Tx.SENotes.t2D謠冗判( device, x - 2, y + nSenotesY, new Rectangle( 0, 390, 136, 30 ) ); + } + break; + + case 0x1B: + if( TJAPlayer3.Tx.Notes != null ) + { + if( TJAPlayer3.ConfigIni.eSTEALTH != E繧ケ繝繝ォ繧ケ繝「繝シ繝.DORON ) + { + if( nPlayer == 0 ) + { + TJAPlayer3.Tx.Notes_Arm.t2D荳贋ク句渚霆「謠冗判( device, x + 25, ( y + 74 ) + nHand ); + TJAPlayer3.Tx.Notes_Arm.t2D荳贋ク句渚霆「謠冗判( device, x + 60, ( y + 104 ) - nHand ); + } + else if( nPlayer == 1 ) + { + TJAPlayer3.Tx.Notes_Arm.t2D謠冗判( device, x + 25, ( y - 44 ) + nHand ); + TJAPlayer3.Tx.Notes_Arm.t2D謠冗判( device, x + 60, ( y - 14 ) - nHand ); + } + TJAPlayer3.Tx.Notes.t2D謠冗判( device, x, y, new Rectangle( 1820, num9, 130, 130 ) ); + } + TJAPlayer3.Tx.SENotes.t2D謠冗判( device, x - 2, y + nSenotesY, new Rectangle( 0, 420, 136, 30 ) ); + } + nLane = 1; + break; + + case 0x1F: + break; + } + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( x + 60, y + 160, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, pChip.nPlayerSide.ToString() ); + } + } + else if( x < -1000 ) + { + //pChip.bHit = true; + } + } + } + else + { + return; + } + #endregion + } + protected override void t騾イ陦梧緒逕サ_繝√ャ繝誉Taiko騾」謇( CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip, int nPlayer ) + { + int nSenotesY = TJAPlayer3.Skin.nSENotesY[ nPlayer ]; + int n繝弱シ繝亥コァ讓 = 0; + int n繝弱シ繝域忰遶ッ蠎ァ讓 = 0; + int n蜈磯ュ逋コ螢ー菴咲スョ = 0; + + // 2016.11.2 kairera0467 + // 鮟騾」謇馴浹隨ヲ繧定オ、縺上☆繧九d縺、縺ョ螳溯」譁ケ豕輔Γ繝「 + //蜑埼擇繧帝サ濶イ縲∬レ髱「繧貞、芽牡蠕後↓縺励◆繧ゅョ繧帝阪ュ縺ヲ縲∵遠謨ー縺ォ蠢懊§縺ヲ蜑埼擇縺ョ騾乗主コヲ繧呈桃菴懊☆繧後ー縲∬牡繧呈桃菴懊〒縺阪k縺ッ縺壹 + //縺溘□縺励ユ繧ッ繧ケ繝√Ε縺ョホア繝√Ε繝ウ繝阪Ν驛ィ蛻縺悟、ェ縺上↑繧九↑縺ゥ縺ョ繝繝。繝ェ繝繝医′蜃コ繧九ょy縺医h縺縲 + + #region[ 菴懊j逶エ縺励◆繧ゅョ ] + if (pChip.b蜿ッ隕) + { + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x15 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x18) + { + if (pChip.n繝弱シ繝蜃コ迴セ譎ょ綾ms != 0 && ((long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) < pChip.n逋コ螢ー譎ょ綾ms - pChip.n繝弱シ繝蜃コ迴セ譎ょ綾ms)) + pChip.bShow = false; + else if (pChip.n繝弱シ繝蜃コ迴セ譎ょ綾ms != 0 && pChip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms != 0) + pChip.bShow = true; + + if (pChip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms != 0 && ((long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) < pChip.n逋コ螢ー譎ょ綾ms - pChip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms)) + { + n繝弱シ繝亥コァ讓 = (int)((((pChip.n逋コ螢ー譎ょ綾ms) - (pChip.n逋コ螢ー譎ょ綾ms - pChip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms)) * pChip.dbBPM * pChip.dbSCROLL * (this.act隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums + 1.0)) / 502.8594 / 5.0); + n繝弱シ繝域忰遶ッ蠎ァ讓 = (int)(((pChip.n繝弱シ繝邨ゆコ譎ょ綾ms - (pChip.n逋コ螢ー譎ょ綾ms - pChip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms)) * pChip.dbBPM * pChip.dbSCROLL * (this.act隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums + 1.0)) / 502.8594 / 5.0); + } + else + { + n繝弱シ繝亥コァ讓 = 0; + n繝弱シ繝域忰遶ッ蠎ァ讓 = 0; + } + } + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x18) + { + if (pChip.n繝弱シ繝蜃コ迴セ譎ょ綾ms != 0 && ((long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) < n蜈磯ュ逋コ螢ー菴咲スョ - pChip.n繝弱シ繝蜃コ迴セ譎ょ綾ms)) + pChip.bShow = false; + else + pChip.bShow = true; + + CDTX.CChip cChip = null; + if (pChip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms != 0) // n蜈磯ュ逋コ螢ー菴咲スョ value is only used when this condition is met + { + cChip = TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.r謖螳壽凾蛻サ縺ォ荳逡ェ霑代>騾」謇鼎hip_繝偵ャ繝域悴貂亥撫繧上★荳榊庄隕冶諷ョ(pChip.n逋コ螢ー譎ょ綾ms, 0x10 + pChip.n騾」謇馴浹隨ヲState, 0, nPlayer); + if (cChip != null) + { + n蜈磯ュ逋コ螢ー菴咲スョ = cChip.n逋コ螢ー譎ょ綾ms; + } + } + + //騾」謇馴浹隨ヲ蜈磯ュ縺ョ髢句ァ区凾蛻サ繧貞叙蠕励@縺ェ縺代l縺ー縺ェ繧峨↑縺縲 + //縺昴≧縺励↑縺代l縺ー騾」謇灘磯ュ縺ィ騾」謇捺忰遶ッ縺ョ遘サ蜍暮幕蟋区凾蛻サ縺ォ繧コ繝ャ縺悟コ縺ヲ縺励∪縺縲 + if (pChip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms != 0 && ((long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) < n蜈磯ュ逋コ螢ー菴咲スョ - pChip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms)) + { + n繝弱シ繝亥コァ讓 = (int)(((pChip.n逋コ螢ー譎ょ綾ms - (n蜈磯ュ逋コ螢ー菴咲スョ - pChip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms)) * pChip.dbBPM * pChip.dbSCROLL * (this.act隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums + 1.0)) / 502.8594 / 5.0); + } + else + { + n繝弱シ繝亥コァ讓 = 0; + } + } + + int x = 349 + pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Taiko + 10; + int x譛ォ遶ッ = 349 + pChip.n繝舌シ縺九i縺ョ繝弱シ繝譛ォ遶ッ霍晞屬dot + 10; + int y = TJAPlayer3.Skin.nScrollFieldY[nPlayer];// + ((int)(pChip.n繧ウ繝シ繧ケ) * 100) + + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ >= 0x15 && pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ <= 0x17) + { + if (pChip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms != 0 && ((long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) < pChip.n逋コ螢ー譎ょ綾ms - pChip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms)) + { + x = 349 + n繝弱シ繝亥コァ讓; + x譛ォ遶ッ = 349 + n繝弱シ繝域忰遶ッ蠎ァ讓; + } + else + { + x = 349 + pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Taiko + 10; + x譛ォ遶ッ = 349 + pChip.n繝舌シ縺九i縺ョ繝弱シ繝譛ォ遶ッ霍晞屬dot + 10; + } + } + else if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x18) + { + if (pChip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms != 0 && ((long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) < n蜈磯ュ逋コ螢ー菴咲スョ - pChip.n繝弱シ繝遘サ蜍暮幕蟋区凾蛻サms)) + { + x = 349 + n繝弱シ繝亥コァ讓; + } + else + { + x = 349 + pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Taiko + 10; + } + } + + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15 && pChip.n逋コ螢ー譎ょ綾ms < 5000) + { + + } + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x18 && pChip.n逋コ螢ー譎ょ綾ms < 5000) + { + + } + + + #region[ HIDSUD & STEALTH ] + if (TJAPlayer3.ConfigIni.eSTEALTH == E繧ケ繝繝ォ繧ケ繝「繝シ繝.STEALTH) + { + pChip.bShow = false; + } + #endregion + + //if( CDTXMania.ConfigIni.eScrollMode != EScrollMode.Normal ) + x -= 10; + + if ((1400 > x)) + { + if (TJAPlayer3.Tx.Notes != null) + { + //int num9 = this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.Drums >= 50 ? this.ct繝√ャ繝玲ィ。讒倥い繝九Γ.Drums.n迴セ蝨ィ縺ョ蛟、 * 130 : 0; + //int num9 = this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.Drums >= 50 ? base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ * 130 : 0; + int num9 = 0; + //if( this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[ nPlayer ] >= 300 ) + //{ + // num9 = base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ != 0 ? 260 : 0; + //} + //else if( this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[ nPlayer ] >= 50 ) + //{ + // num9 = base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ != 0 ? base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ * 130 : 0; + //} + if (TJAPlayer3.Skin.Game_Notes_Anime) + { + if (this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[nPlayer] >= 300 && ctChipAnimeLag[nPlayer].b邨ゆコ蛟、縺ォ驕斐@縺) + { + //num9 = ctChipAnime[nPlayer].db迴セ蝨ィ縺ョ蛟、 != 0 ? 260 : 0; + if ((int)ctChipAnime[nPlayer].n迴セ蝨ィ縺ョ蛟、 == 1 || (int)ctChipAnime[nPlayer].n迴セ蝨ィ縺ョ蛟、 == 3) + { + num9 = 260; + } + else + { + num9 = 0; + } + } + else if (this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[nPlayer] >= 300 && !ctChipAnimeLag[nPlayer].b邨ゆコ蛟、縺ォ驕斐@縺) + { + //num9 = base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ != 0 ? base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ * 130 : 0; + if ((int)ctChipAnime[nPlayer].n迴セ蝨ィ縺ョ蛟、 == 1 || (int)ctChipAnime[nPlayer].n迴セ蝨ィ縺ョ蛟、 == 3) + { + num9 = 130; + } + else + { + num9 = 0; + } + } + else if (this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[nPlayer] >= 150) + { + //num9 = base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ != 0 ? base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ * 130 : 0; + if ((int)ctChipAnime[nPlayer].n迴セ蝨ィ縺ョ蛟、 == 1 || (int)ctChipAnime[nPlayer].n迴セ蝨ィ縺ョ蛟、 == 3) + { + num9 = 130; + } + else + { + num9 = 0; + } + } + else if (this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[nPlayer] >= 50 && ctChipAnimeLag[nPlayer].b邨ゆコ蛟、縺ォ驕斐@縺) + { + //num9 = base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ != 0 ? base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ * 130 : 0; + if ((int)ctChipAnime[nPlayer].n迴セ蝨ィ縺ョ蛟、 <= 1) + { + num9 = 130; + } + else + { + num9 = 0; + } + } + else if (this.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚[nPlayer] >= 50 && !ctChipAnimeLag[nPlayer].b邨ゆコ蛟、縺ォ驕斐@縺) + { + //num9 = base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ != 0 ? base.n迴セ蝨ィ縺ョ髻ウ隨ヲ縺ョ鬘皮分蜿キ * 130 : 0; + num9 = 0; + } + else + { + num9 = 0; + } + } + + //kairera0467豌 縺ョ TJAPlayer2forPC 縺ョ繧ウ繝シ繝峨r蜿り縺ォ縺励∵遠謨ー縺ォ蠢懊§縺ヲ濶イ繧貞、峨∴繧(謇捺焚縺ョ螟画峩莉・螟悶ッ縺サ縺ィ繧薙←縺昴ョ縺セ繧薙∪) 繧阪∩繧ス橸シ 2018/8/20 + pChip.RollInputTime?.t騾イ陦(); + pChip.RollDelay?.t騾イ陦(); + + if (pChip.RollInputTime != null && pChip.RollInputTime.b邨ゆコ蛟、縺ォ驕斐@縺) + { + pChip.RollInputTime.t蛛懈ュ「(); + pChip.RollInputTime.n迴セ蝨ィ縺ョ蛟、 = 0; + pChip.RollDelay = new CCounter(0, 1, 1, TJAPlayer3.Timer); + } + + if (pChip.RollDelay != null && pChip.RollDelay.b邨ゆコ蛟、縺ォ驕斐@縺 && pChip.RollEffectLevel > 0) + { + pChip.RollEffectLevel--; + pChip.RollDelay = new CCounter(0, 1, 1, TJAPlayer3.Timer); + pChip.RollDelay.n迴セ蝨ィ縺ョ蛟、 = 0; + } + + float f貂帛ー代☆繧九き繝ゥ繝シ = 1.0f - ((0.95f / 100) * pChip.RollEffectLevel); + var effectedColor = new Color4(1.0f, f貂帛ー代☆繧九き繝ゥ繝シ, f貂帛ー代☆繧九き繝ゥ繝シ); + var normalColor = new Color4(1.0f, 1.0f, 1.0f); + float f譛ォ遶ッ繝弱シ繝縺ョ繝繧ッ繧ケ繝√Ε菴咲スョ隱ソ謨エ = 65f; + + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x15 && pChip.bShow) //騾」謇(蟆) + { + int index = x譛ォ遶ッ - x; //騾」謇薙ョ霍晞屬 + if (TJAPlayer3.ConfigIni.eSTEALTH != E繧ケ繝繝ォ繧ケ繝「繝シ繝.DORON) + { + #region[譛ォ遶ッ繧偵ユ繧ッ繧ケ繝√Ε蛛エ縺ァ荳ュ螟ョ縺ォ謖√▲縺ヲ縺上k蝣エ蜷医ョ譁ケ蠑従 + + //CDTXMania.Tx.Notes.color4 = new Color4(1.0f, f貂帛ー代☆繧九き繝ゥ繝シ, f貂帛ー代☆繧九き繝ゥ繝シ); + //CDTXMania.Tx.Notes.vc諡。螟ァ邵ョ蟆丞咲紫.X = (index - 65.0f + f譛ォ遶ッ繝弱シ繝縺ョ繝繧ッ繧ケ繝√Ε菴咲スョ隱ソ謨エ+1) / 128.0f; + //CDTXMania.Tx.Notes.t2D謠冗判(CDTXMania.app.Device, x + 64, y, new Rectangle(781, 0, 128, 130)); + //CDTXMania.Tx.Notes.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + //CDTXMania.Tx.Notes.t2D謠冗判(CDTXMania.app.Device, x譛ォ遶ッ, y, 0, new Rectangle(910, num9, 130, 130)); + //CDTXMania.Tx.Notes.color4 = new Color4(1.0f, 1.0f, 1.0f); //蜈育ォッ繧キ繝ウ繝懊Ν縺ッ濶イ繧貞、峨∴縺ェ縺 + //CDTXMania.Tx.Notes.t2D謠冗判(CDTXMania.app.Device, x, y, 0, new Rectangle(650, num9, 130, 130)); + + #endregion + #region[譛ォ遶ッ繧偵ユ繧ッ繧ケ繝√Ε蛛エ縺ァ縺、縺ェ縺偵k蝣エ蜷医ョ譁ケ蠑従 + + if (TJAPlayer3.Skin.Game_RollColorMode != CSkin.RollColorMode.None) + TJAPlayer3.Tx.Notes.color4 = effectedColor; + else + TJAPlayer3.Tx.Notes.color4 = normalColor; + TJAPlayer3.Tx.Notes.vc諡。螟ァ邵ョ蟆丞咲紫.X = (index - 65.0f + f譛ォ遶ッ繝弱シ繝縺ョ繝繧ッ繧ケ繝√Ε菴咲スョ隱ソ謨エ + 1) / 128.0f; + TJAPlayer3.Tx.Notes.t2D謠冗判(TJAPlayer3.app.Device, x + 64, y, new Rectangle(781, 0, 128, 130)); + TJAPlayer3.Tx.Notes.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + TJAPlayer3.Tx.Notes.t2D謠冗判(TJAPlayer3.app.Device, x譛ォ遶ッ + f譛ォ遶ッ繝弱シ繝縺ョ繝繧ッ繧ケ繝√Ε菴咲スョ隱ソ謨エ, y, 0, new Rectangle(910, num9, 130, 130)); + if (TJAPlayer3.Skin.Game_RollColorMode == CSkin.RollColorMode.All) + TJAPlayer3.Tx.Notes.color4 = effectedColor; + else + TJAPlayer3.Tx.Notes.color4 = normalColor; + + TJAPlayer3.Tx.Notes.t2D謠冗判(TJAPlayer3.app.Device, x, y, 0, new Rectangle(650, num9, 130, 130)); + TJAPlayer3.Tx.Notes.color4 = normalColor; + #endregion + } + TJAPlayer3.Tx.SENotes.vc諡。螟ァ邵ョ蟆丞咲紫.X = index - 44; + TJAPlayer3.Tx.SENotes.t2D謠冗判(TJAPlayer3.app.Device, x + 90, y + nSenotesY, new Rectangle(60, 240, 1, 30)); + TJAPlayer3.Tx.SENotes.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + TJAPlayer3.Tx.SENotes.t2D謠冗判(TJAPlayer3.app.Device, x + 30, y + nSenotesY, new Rectangle(0, 240, 60, 30)); + TJAPlayer3.Tx.SENotes.t2D謠冗判(TJAPlayer3.app.Device, x, y + nSenotesY, new Rectangle(0, 30 * pChip.nSenote, 136, 30)); + } + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x16 && pChip.bShow) + { + int index = x譛ォ遶ッ - x; //騾」謇薙ョ霍晞屬 + + if (TJAPlayer3.ConfigIni.eSTEALTH != E繧ケ繝繝ォ繧ケ繝「繝シ繝.DORON) + { + #region[譛ォ遶ッ繧偵ユ繧ッ繧ケ繝√Ε蛛エ縺ァ荳ュ螟ョ縺ォ謖√▲縺ヲ縺上k蝣エ蜷医ョ譁ケ蠑従 + + //CDTXMania.Tx.Notes.color4 = new Color4(1.0f, f貂帛ー代☆繧九き繝ゥ繝シ, f貂帛ー代☆繧九き繝ゥ繝シ); + //CDTXMania.Tx.Notes.vc諡。螟ァ邵ョ蟆丞咲紫.X = (index - 65.0f + f譛ォ遶ッ繝弱シ繝縺ョ繝繧ッ繧ケ繝√Ε菴咲スョ隱ソ謨エ+1) / 128f; + //CDTXMania.Tx.Notes.t2D謠冗判(CDTXMania.app.Device, x + 64, y, new Rectangle(1171, 0, 128, 130)); + //CDTXMania.Tx.Notes.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + //CDTXMania.Tx.Notes.t2D謠冗判(CDTXMania.app.Device, x譛ォ遶ッ, y, 0, new Rectangle(1300, num9, 130, 130)); + //CDTXMania.Tx.Notes.color4 = new Color4(1.0f, 1.0f, 1.0f); //蜈育ォッ繧キ繝ウ繝懊Ν縺ッ濶イ繧貞、峨∴縺ェ縺 + //CDTXMania.Tx.Notes.t2D謠冗判(CDTXMania.app.Device, x, y, new Rectangle(1040, num9, 130, 130)); + + #endregion + #region[譛ォ遶ッ繧偵ユ繧ッ繧ケ繝√Ε蛛エ縺ァ縺、縺ェ縺偵k蝣エ蜷医ョ譁ケ蠑従 + + if (TJAPlayer3.Skin.Game_RollColorMode != CSkin.RollColorMode.None) + TJAPlayer3.Tx.Notes.color4 = effectedColor; + else + TJAPlayer3.Tx.Notes.color4 = normalColor; + + TJAPlayer3.Tx.Notes.vc諡。螟ァ邵ョ蟆丞咲紫.X = (index - 65 + f譛ォ遶ッ繝弱シ繝縺ョ繝繧ッ繧ケ繝√Ε菴咲スョ隱ソ謨エ + 1) / 128f; + TJAPlayer3.Tx.Notes.t2D謠冗判(TJAPlayer3.app.Device, x + 64, y, new Rectangle(1171, 0, 128, 130)); + + TJAPlayer3.Tx.Notes.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + TJAPlayer3.Tx.Notes.t2D謠冗判(TJAPlayer3.app.Device, x譛ォ遶ッ + f譛ォ遶ッ繝弱シ繝縺ョ繝繧ッ繧ケ繝√Ε菴咲スョ隱ソ謨エ, y, 0, new Rectangle(1300, num9, 130, 130)); + if (TJAPlayer3.Skin.Game_RollColorMode == CSkin.RollColorMode.All) + TJAPlayer3.Tx.Notes.color4 = effectedColor; + else + TJAPlayer3.Tx.Notes.color4 = normalColor; + + TJAPlayer3.Tx.Notes.t2D謠冗判(TJAPlayer3.app.Device, x, y, new Rectangle(1040, num9, 130, 130)); + TJAPlayer3.Tx.Notes.color4 = normalColor; + #endregion + } + TJAPlayer3.Tx.SENotes.vc諡。螟ァ邵ョ蟆丞咲紫.X = index - 70; + TJAPlayer3.Tx.SENotes.t2D謠冗判(TJAPlayer3.app.Device, x + 116, y + nSenotesY, new Rectangle(60, 240, 1, 30)); + TJAPlayer3.Tx.SENotes.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + TJAPlayer3.Tx.SENotes.t2D謠冗判(TJAPlayer3.app.Device, x + 56, y + nSenotesY, new Rectangle(0, 240, 60, 30)); + TJAPlayer3.Tx.SENotes.t2D謠冗判(TJAPlayer3.app.Device, x - 2, y + nSenotesY, new Rectangle(0, 30 * pChip.nSenote, 136, 30)); + } + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x17) + { + if (pChip.bShow) + { + if ((long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) >= pChip.n逋コ螢ー譎ょ綾ms && (long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) < pChip.n繝弱シ繝邨ゆコ譎ょ綾ms) + x = 349; + else if ((long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) >= pChip.n繝弱シ繝邨ゆコ譎ょ綾ms) + x = (349 + pChip.n繝舌シ縺九i縺ョ繝弱シ繝譛ォ遶ッ霍晞屬dot); + + if (TJAPlayer3.ConfigIni.eSTEALTH != E繧ケ繝繝ォ繧ケ繝「繝シ繝.DORON) + TJAPlayer3.Tx.Notes.t2D謠冗判(TJAPlayer3.app.Device, x, y, new Rectangle(1430, num9, 260, 130)); + + TJAPlayer3.Tx.SENotes.t2D謠冗判(TJAPlayer3.app.Device, x - 2, y + nSenotesY, new Rectangle(0, 30 * pChip.nSenote, 136, 30)); + } + } + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x18) + { + //螟ァ縺阪>騾」謇薙°蟆上&縺騾」謇薙°縺ョ蛹コ蛻・譁ケ豕輔r閠縺医※縺ェ縺九▲縺溘h縺。縺上@繧縺 + TJAPlayer3.Tx.Notes.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + int n = 0; + switch (pChip.n騾」謇馴浹隨ヲState) + { + case 5: + n = 910; + break; + case 6: + n = 1300; + break; + default: + n = 910; + break; + } + if (pChip.n騾」謇馴浹隨ヲState != 7) + { + //if( CDTXMania.ConfigIni.eSTEALTH != E繧ケ繝繝ォ繧ケ繝「繝シ繝.DORON ) + // CDTXMania.Tx.Notes.t2D謠冗判( CDTXMania.app.Device, x, y, new Rectangle( n, num9, 130, 130 ) );//螟ァ髻ウ隨ヲ:1170 + TJAPlayer3.Tx.SENotes.t2D謠冗判(TJAPlayer3.app.Device, x + 56, y + nSenotesY, new Rectangle(58, 270, 78, 30)); + } + + + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(x, y - 10, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, pChip.n逋コ螢ー譎ょ綾ms.ToString()); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(x, y - 26, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, pChip.n騾」謇馴浹隨ヲState.ToString()); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(x, y - 42, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, pChip.dbSCROLL.ToString()); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(x, y - 58, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, pChip.dbBPM.ToString()); + + + } + } + } + if (pChip.n逋コ螢ー譎ょ綾ms < (CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) && pChip.n繝弱シ繝邨ゆコ譎ょ綾ms > (CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))) + { + //譎る俣蜀縺ァ縺九▽0x9A縺倥c縺ェ縺縺ェ繧峨↑繧峨ヲ繝繝亥ヲ逅 + if (pChip.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ != 0x18 && (nPlayer == 0 ? TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay : TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay2P)) + this.t繝√ャ繝励ョ繝偵ャ繝亥ヲ逅(pChip.n逋コ螢ー譎ょ綾ms, pChip, E讌ス蝎ィ繝代シ繝.TAIKO, false, 0, nPlayer); + } + } + #endregion + } + + protected override void t騾イ陦梧緒逕サ_繝√ャ繝誉繝峨Λ繝繧ケ( CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip ) + { + } + protected override void t騾イ陦梧緒逕サ_繝√ャ繝玲悽菴点繝峨Λ繝繧ケ( CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip ) + { + } + protected override void t騾イ陦梧緒逕サ_繝√ャ繝誉繝輔ぅ繝ォ繧、繝ウ( CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip ) + { + + } + protected override void t騾イ陦梧緒逕サ_繝√ャ繝誉蟆冗ッ邱( CConfigIni configIni, ref CDTX dTX, ref CDTX.CChip pChip, int nPlayer ) + { + if( pChip.n繧ウ繝シ繧ケ != this.n迴セ蝨ィ縺ョ繧ウ繝シ繧ケ[ nPlayer ] ) + return; + + //int n蟆冗ッ逡ェ蜿キplus1 = pChip.n逋コ螢ー菴咲スョ / 384; + int n蟆冗ッ逡ェ蜿キplus1 = this.actPlayInfo.NowMeasure[nPlayer]; + int x = TJAPlayer3.Skin.nScrollFieldX[ nPlayer ] + pChip.n繝舌シ縺九i縺ョ霍晞屬dot.Taiko; + int y = TJAPlayer3.Skin.nScrollFieldY[ nPlayer ]; + + if( pChip.dbSCROLL_Y != 0.0 ) + { + y = TJAPlayer3.Skin.nScrollFieldY[ nPlayer ]; + y += (int)(((pChip.n逋コ螢ー譎ょ綾ms - (CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))) * pChip.dbBPM * pChip.dbSCROLL_Y * (this.act隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.db迴セ蝨ィ縺ョ隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums + 1.5)) / 628.7); + } + + if ( !pChip.bHit && pChip.n逋コ螢ー譎ょ綾ms > CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 ) + { + //pChip.bHit = true; + //this.actPlayInfo.n蟆冗ッ逡ェ蜿キ = n蟆冗ッ逡ェ蜿キplus1 - 1; + //this.actPlayInfo.n蟆冗ッ逡ェ蜿キ++; + if ( configIni.bWave蜀咲函菴咲スョ閾ェ蜍戊ェソ謨エ讖溯ス譛牙柑 && ( bIsDirectSound || bUseOSTimer ) ) + { + dTX.tWave蜀咲函菴咲スョ閾ェ蜍戊」懈ュ」(); + } + } + if (configIni.b貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k || TJAPlayer3.ConfigIni.bTokkunMode) + { + var nowMeasure = pChip.n謨エ謨ー蛟、_蜀驛ィ逡ェ蜿キ; + if ( x >= 310 ) + { + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(x + 8, y - 26, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, nowMeasure.ToString()); + } + } + if ( ( pChip.b蜿ッ隕 ) && (TJAPlayer3.Tx.Bar != null ) ) + { + if( x >= 0 ) + { + Matrix mat = Matrix.Identity; + mat *= Matrix.RotationZ(C螟画鋤.DegreeToRadian(-(90.0f * (float)pChip.dbSCROLL_Y))); + mat *= Matrix.Translation((float)(x - 640.0f) - 1.5f, -(y - 360.0f + 65.0f), 0f); + + if( pChip.bBranch ) + { + //this.tx蟆冗ッ邱喟branch.t2D謠冗判( CDTXMania.app.Device, x - 3, y, new Rectangle( 0, 0, 3, 130 ) ); + TJAPlayer3.Tx.Bar_Branch.t3D謠冗判( TJAPlayer3.app.Device, mat, new Rectangle( 0, 0, 3, 130 ) ); + } + else + { + //this.tx蟆冗ッ邱.t2D謠冗判( CDTXMania.app.Device, x - 3, y, new Rectangle( 0, 0, 3, 130 ) ); + TJAPlayer3.Tx.Bar.t3D謠冗判( TJAPlayer3.app.Device, mat, new Rectangle( 0, 0, 3, 130 ) ); + } + } + } + } + + protected void t騾イ陦梧緒逕サ_繝ャ繝シ繝ウ() + { + this.actLane.On騾イ陦梧緒逕サ(); + } + + /// + /// 蜈ィ菴薙↓繧上◆繧句宛蠕。繧偵☆繧九 + /// + public void t蜈ィ菴灘宛蠕。繝。繧ス繝繝() + { + int t = (int)CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms; + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint( 0, 16, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, t.ToString() ); + + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + if (this.chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕i] != null) + { + int n = this.chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ; + + if (this.chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕i].n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x17 && this.b騾」謇謎クュ[i] == true) + { + //if (this.chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝.n逋コ螢ー譎ょ綾ms <= (int)CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms && this.chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝.n繝弱シ繝邨ゆコ譎ょ綾ms >= (int)CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms) + if (this.chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕i].n逋コ螢ー譎ょ綾ms <= (int)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)) && this.chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕i].n繝弱シ繝邨ゆコ譎ょ綾ms + 500 >= (int)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))) + { + this.chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕i].bShow = false; + this.actBalloon.On騾イ陦梧緒逕サ(this.chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕i].nBalloon, this.n鬚ィ闊ケ谿九j[i], i); + } + else + { + this.n迴セ蝨ィ縺ョ騾」謇捺焚[i] = 0; + + } + + } + else + { + //if (actChara.CharaAction_Balloon_Breaking.b騾イ陦御クュ && chip迴セ蝨ィ蜃ヲ逅荳ュ縺ョ騾」謇薙メ繝繝夕i].nPlayerSide == 0) + //{ + //} + } + } + } + #region[ 迚謇句愛螳壹r縺薙▲縺。縺ォ謖√▲縺ヲ縺阪※縺ソ繧九] + //蟶ク譎ゅう繝吶Φ繝医′逋コ逕溘@縺ヲ縺繧九Γ繧ス繝繝峨ョ縺サ縺縺後>縺繧薙§繧縺ェ縺縺九→縺縺莠域Φ縲 + //CDTX.CChip chipNoHit = this.r謖螳壽凾蛻サ縺ォ荳逡ェ霑代>譛ェ繝偵ャ繝Chip((int)CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms, 0); + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + CDTX.CChip chipNoHit = r謖螳壽凾蛻サ縺ォ荳逡ェ霑代>譛ェ繝偵ャ繝Chip繧帝℃蜴サ譁ケ蜷大━蜈医〒讀懃エ「縺吶k((long)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)), i); + + + if (chipNoHit != null && (chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x13 || chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x14 || chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1A || chipNoHit.n繝√Ε繝ウ繝阪Ν逡ェ蜿キ == 0x1B)) + { + float timeC = chipNoHit.n逋コ螢ー譎ょ綾ms - (float)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0)); + int nWaitTime = TJAPlayer3.ConfigIni.n荳。謇句愛螳壹ョ蠕縺。譎る俣; + if (chipNoHit.eNoteState == ENoteState.wait && timeC <= 110 && chipNoHit.nProcessTime + nWaitTime <= (int)(CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾 * (((double)TJAPlayer3.ConfigIni.n貍泌・城溷コヲ) / 20.0))) + { + this.t繝峨Λ繝繝偵ャ繝亥ヲ逅(chipNoHit.nProcessTime, E繝代ャ繝.RRed, chipNoHit, false, i); + this.nWaitButton = 0; + chipNoHit.eNoteState = ENoteState.none; + chipNoHit.bHit = true; + chipNoHit.IsHitted = true; + } + } + } + + #endregion + + string strNull = "Found"; + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDX.DirectInput.Key.F1)) + { + if (!this.actPauseMenu.bIsActivePopupMenu && this.bPAUSE == false) + { + TJAPlayer3.Skin.sound螟画峩髻ウ.t蜀咲函縺吶k(); + + CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.t荳譎ょ●豁「(); + TJAPlayer3.Timer.t荳譎ょ●豁「(); + TJAPlayer3.DTX.t蜈ィ繝√ャ繝励ョ蜀咲函荳譎ょ●豁「(); + this.actAVI.tPauseControl(); + + this.bPAUSE = true; + this.actPauseMenu.tActivatePopupMenu(0); + } + + } + //if( CDTXMania.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺( (int)SlimDX.DirectInput.Key.F8 ) ) + //{ + //this.actChipFireD.Start邏吝聖髮ェ(); + //this.actDancer.t蜈・騾蝣エ( 0, 0, 0.4 ); + //} + + if (!this.bStartFlag) + { + //CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾ms = 80000; + } + this.bStartFlag = true; + } + private bool bStartFlag; + private void t騾イ陦梧緒逕サ_繝阪シ繝繝励Ξ繝シ繝() + { + //if( this.txNamePlate != null ) + //this.txNamePlate.t2D謠冗判( CDTXMania.app.Device, 0, 100 ); + + //if(CDTXMania.Tx.Taiko_NamePlate[0] != null) CDTXMania.Tx.Taiko_NamePlate[0].t2D謠冗判(CDTXMania.app.Device, 0, 100); + //if(CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay && CDTXMania.Tx.Taiko_NamePlate[1] != null) CDTXMania.Tx.Taiko_NamePlate[0].t2D謠冗判(CDTXMania.app.Device, 0, 600); + + //if ( CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.bDoublePlay ) + //{ + // if( this.txNamePlate2P != null ) + // this.txNamePlate2P.t2D謠冗判( CDTXMania.app.Device, 314, 636 ); + //} + } + + private void t騾イ陦梧緒逕サ_繝ェ繧「繝ォ繧ソ繧、繝蛻、螳壽焚陦ィ遉コ() + { + var showJudgeInfo = false; + + if (TJAPlayer3.ConfigIni.nPlayerCount == 1 ? (TJAPlayer3.ConfigIni.bJudgeCountDisplay && !TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay) : false) showJudgeInfo = true; + if (TJAPlayer3.ConfigIni.bTokkunMode) showJudgeInfo = true; + + if (showJudgeInfo) + { + //繝懊シ繝峨ョ讓ェ蟷縺ッ333px + //謨ー蟄励ヵ繧ゥ繝ウ繝医ョ蟆上&縺縺サ縺縺ッ繝ェ繧カ繝ォ繝医ョ繧ゅョ縺ィ蜷後§縲 + if( TJAPlayer3.Tx.Judge_Meter != null ) + TJAPlayer3.Tx.Judge_Meter.t2D謠冗判( TJAPlayer3.app.Device, 0, 360 ); + + this.t蟆乗枚蟄苓。ィ遉コ( 102, 494, string.Format( "{0,4:###0}", this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Perfect.ToString() ), false ); + this.t蟆乗枚蟄苓。ィ遉コ( 102, 532, string.Format( "{0,4:###0}", this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Great.ToString() ), false ); + this.t蟆乗枚蟄苓。ィ遉コ( 102, 570, string.Format( "{0,4:###0}", this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Miss.ToString() ), false ); + this.t蟆乗枚蟄苓。ィ遉コ(102, 634, string.Format("{0,4:###0}", GetRoll(0)), false); + + int nNowTotal = this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Perfect + this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Great + this.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Miss; + double db縺溘◆縺代◆邇 = Math.Round((100.0 * ( TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Perfect + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Great)) / (double)nNowTotal); + double dbPERFECT邇 = Math.Round((100.0 * TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Perfect) / (double)nNowTotal); + double dbGREAT邇 = Math.Round((100.0 * TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Great / (double)nNowTotal)); + double dbMISS邇 = Math.Round((100.0 * TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Miss / (double)nNowTotal)); + + if (double.IsNaN(db縺溘◆縺代◆邇)) + db縺溘◆縺代◆邇 = 0; + if (double.IsNaN(dbPERFECT邇)) + dbPERFECT邇 = 0; + if (double.IsNaN(dbGREAT邇)) + dbGREAT邇 = 0; + if (double.IsNaN(dbMISS邇)) + dbMISS邇 = 0; + + this.t螟ァ譁蟄苓。ィ遉コ( 202, 436, string.Format( "{0,3:##0}%", db縺溘◆縺代◆邇 ) ); + this.t蟆乗枚蟄苓。ィ遉コ( 206, 494, string.Format( "{0,3:##0}%", dbPERFECT邇 ), false ); + this.t蟆乗枚蟄苓。ィ遉コ( 206, 532, string.Format( "{0,3:##0}%", dbGREAT邇 ), false ); + this.t蟆乗枚蟄苓。ィ遉コ( 206, 570, string.Format( "{0,3:##0}%", dbMISS邇 ), false ); + } + } + + private void t蟆乗枚蟄苓。ィ遉コ( int x, int y, string str, bool bOrange ) + { + foreach( char ch in str ) + { + for( int i = 0; i < this.st蟆乗枚蟄嶺ス咲スョ.Length; i++ ) + { + if( ch == ' ' ) + { + break; + } + + if( this.st蟆乗枚蟄嶺ス咲スョ[ i ].ch == ch ) + { + Rectangle rectangle = new Rectangle( this.st蟆乗枚蟄嶺ス咲スョ[ i ].pt.X, this.st蟆乗枚蟄嶺ス咲スョ[ i ].pt.Y, 32, 38 ); + if( TJAPlayer3.Tx.Result_Number != null ) + { + TJAPlayer3.Tx.Result_Number.t2D謠冗判( TJAPlayer3.app.Device, x, y, rectangle ); + } + break; + } + } + x += 22; + } + } + + private void t螟ァ譁蟄苓。ィ遉コ( int x, int y, string str ) + { + foreach( char ch in str ) + { + for( int i = 0; i < this.st蟆乗枚蟄嶺ス咲スョ.Length; i++ ) + { + if( ch == ' ' ) + { + break; + } + + if( this.st蟆乗枚蟄嶺ス咲スョ[ i ].ch == ch ) + { + Rectangle rectangle = new Rectangle( this.st蟆乗枚蟄嶺ス咲スョ[ i ].pt.X, 38, 32, 42 ); + if(TJAPlayer3.Tx.Result_Number != null ) + { + TJAPlayer3.Tx.Result_Number.t2D謠冗判( TJAPlayer3.app.Device, x, y, rectangle ); + } + break; + } + } + x += 28; + } + } + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/Dan_Cert.cs b/TJAPlayer3/Stages/07.Game/Taiko/Dan_Cert.cs new file mode 100644 index 00000000..3fb53ee1 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/Dan_Cert.cs @@ -0,0 +1,1079 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Runtime.InteropServices; +using FDK; +using System.IO; +using TJAPlayer3; +using System.Linq; + +namespace TJAPlayer3 +{ + internal class Dan_Cert : CActivity + { + /// + /// 谿オ菴崎ェ榊ョ + /// + public Dan_Cert() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + // + Dan_C[] Challenge = new Dan_C[4]; + // + + public void Start(int number) + { + NowShowingNumber = number; + if (number == 0) + { + Counter_Wait = new CCounter(0, 2299, 1, TJAPlayer3.Timer); + } + else + { + Counter_In = new CCounter(0, 999, 1, TJAPlayer3.Timer); + } + bExamChangeCheck = false; + + if(number == 0) + { + for (int i = 1; i < 4; i++) + ExamChange[i] = false; + + for (int j = 1; j < 4; j++) //谿オ菴肴擅莉カ縺ョ繝ォ繝シ繝(鬲ゅご繝シ繧ク繧帝勁縺) 邵ヲ(y) + { + if (TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[0].Dan_C[j] != null) + { + if (TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs.Count - 1].Dan_C[j] != null) //蛟句挨縺ョ譚。莉カ縺後≠繧翫∪縺吶h繝シ + { + if (TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[NowShowingNumber].Dan_C[j].GetExamRange() == Exam.Range.Less) + { + TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[NowShowingNumber].Dan_C[j].Amount = TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[NowShowingNumber].Dan_C[j].Value[0]; + } + else + { + TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[NowShowingNumber].Dan_C[j].Amount = 0; + } + + Challenge[j] = TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[NowShowingNumber].Dan_C[j]; + ExamChange[j] = true; + } + } + } + } + + ScreenPoint = new double[] { TJAPlayer3.Skin.nScrollFieldBGX[0] - TJAPlayer3.Tx.DanC_Screen.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, 1280 }; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.ReSetScore(TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].ScoreInit, TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].ScoreDiff); + IsAnimating = true; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actPanel.SetPanelString(TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].Title, TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].Genre, 1 + NowShowingNumber + "譖イ逶ョ"); + if(number == 0) Sound_Section_First?.t蜀咲函繧帝幕蟋九☆繧(); + else Sound_Section?.t蜀咲函繧帝幕蟋九☆繧(); + } + + public override void On豢サ諤ァ蛹() + { + for (int i = 0; i < 4; i++) + { + if(TJAPlayer3.DTX.Dan_C[i] != null) Challenge[i] = new Dan_C(TJAPlayer3.DTX.Dan_C[i]); + + for (int j = 0; j < TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs.Count; j++) + { + if (TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j].Dan_C[i] != null) + { + TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j].Dan_C[i] = new Dan_C(TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j].Dan_C[i]); + } + } + } + + if(TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.ListDan_Number >= 1 && FirstSectionAnime) + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.ListDan_Number = 0; + + FirstSectionAnime = false; + // 蟋狗せ繧呈アコ螳壹☆繧九 + ExamCount = 0; + songsnotesremain = new int[TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs.Count]; + this.ct陌ケ繧「繝九Γ = new CCounter(0, TJAPlayer3.Skin.Game_Gauge_Dan_Rainbow_Ptn - 1, 30, TJAPlayer3.Timer); + this.ct陌ケ騾乗主コヲ = new CCounter(0, TJAPlayer3.Skin.Game_Gauge_Rainbow_Timer - 1, 1, TJAPlayer3.Timer); + for (int i = 0; i < 4; i++) + { + if (Challenge[i] != null && Challenge[i].GetEnable() == true) + this.ExamCount++; + } + NowCymbolShowingNumber = 0; + bExamChangeCheck = false; + + for (int i = 0; i < 4; i++) + { + Status[i] = new ChallengeStatus(); + Status[i].Timer_Amount = new CCounter(); + Status[i].Timer_Gauge = new CCounter(); + Status[i].Timer_Failed = new CCounter(); + } + + IsEnded = new bool[TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs.Count]; + + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan) IsAnimating = true; + base.On豢サ諤ァ蛹(); + } + + public void Update() + { + for (int i = 0; i < 4; i++) + { + if (Challenge[i] == null || !Challenge[i].GetEnable()) return; + var oldReached = Challenge[i].GetReached(); + var isChangedAmount = false; + switch (Challenge[i].GetExamType()) + { + case Exam.Type.Gauge: + isChangedAmount = Challenge[i].Update((int)TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actGauge.db迴セ蝨ィ縺ョ繧イ繝シ繧ク蛟、[0]); + break; + case Exam.Type.JudgePerfect: + isChangedAmount = Challenge[i].Update(ExamChange[i] ? TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n濶ッ[NowShowingNumber] : (int)TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ繧.Drums.Perfect + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Perfect); + break; + case Exam.Type.JudgeGood: + isChangedAmount = Challenge[i].Update(ExamChange[i] ? TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n蜿ッ[NowShowingNumber] : (int)TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ繧.Drums.Great + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Great); + break; + case Exam.Type.JudgeBad: + isChangedAmount = Challenge[i].Update(ExamChange[i] ? TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n荳榊庄[NowShowingNumber] : (int)TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Miss); + break; + case Exam.Type.Score: + isChangedAmount = Challenge[i].Update((int)TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actScore.GetScore(0)); + break; + case Exam.Type.Roll: + isChangedAmount = Challenge[i].Update(ExamChange[i] ? TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n騾」謇甜NowShowingNumber] : (int)(TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.GetRoll(0))); + break; + case Exam.Type.Hit: + isChangedAmount = Challenge[i].Update(ExamChange[i] ? TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n濶ッ[NowShowingNumber] + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n蜿ッ[NowShowingNumber] + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n騾」謇甜NowShowingNumber] : (int)(TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ繧.Drums.Perfect + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Perfect + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ繧.Drums.Great + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Great + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.GetRoll(0))); + break; + case Exam.Type.Combo: + isChangedAmount = Challenge[i].Update((int)TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.譛鬮伜、[0]); + break; + default: + break; + } + + // 蛟、縺悟、画峩縺輔l縺ヲ縺縺溘i繧「繝九Γ繝シ繧キ繝ァ繝ウ繧定。後≧縲 + if (isChangedAmount) + { + if(Status[i].Timer_Amount != null && Status[i].Timer_Amount.b邨ゆコ蛟、縺ォ驕斐@縺ヲ縺ェ縺) + { + Status[i].Timer_Amount = new CCounter(0, 11, 12, TJAPlayer3.Timer); + Status[i].Timer_Amount.n迴セ蝨ィ縺ョ蛟、 = 1; + } + else + { + Status[i].Timer_Amount = new CCounter(0, 11, 12, TJAPlayer3.Timer); + } + } + + // 譚。莉カ縺ョ驕疲占ヲ玖セシ縺ソ縺後≠繧九°縺ゥ縺縺句愛譁ュ縺吶k縲 + if (Challenge[i].GetExamRange() == Exam.Range.Less) + { + Challenge[i].SetReached(!Challenge[i].IsCleared[0]); + } + else + { + songsnotesremain[NowShowingNumber] = TJAPlayer3.DTX.nDan_NotesCount[NowShowingNumber] - (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n濶ッ[NowShowingNumber] + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n蜿ッ[NowShowingNumber] + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n荳榊庄[NowShowingNumber]); + notesremain = TJAPlayer3.DTX.n繝弱シ繝謨ー[3] - (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ繧.Drums.Perfect + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Perfect) - (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ繧.Drums.Great + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Great) - (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ繧.Drums.Miss + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Miss); + // 谿九j髻ウ隨ヲ謨ー縺0縺ォ縺ェ縺」縺溘→縺阪↓蛻、譁ュ縺輔l繧九d縺、 + if (ExamChange[i] ? songsnotesremain[NowShowingNumber] <= 0 : notesremain <= 0) + { + // 谿九j髻ウ隨ヲ謨ー繧シ繝ュ + switch (Challenge[i].GetExamType()) + { + case Exam.Type.Gauge: + if (Challenge[i].Amount < Challenge[i].Value[0]) Challenge[i].SetReached(true); + break; + case Exam.Type.Score: + if (Challenge[i].Amount < Challenge[i].Value[0]) Challenge[i].SetReached(true); + break; + default: + // 菴輔b縺励↑縺 + break; + } + } + + // 蟶ク縺ォ逶」隕悶&繧後k繧縺、縲 + switch (Challenge[i].GetExamType()) + { + case Exam.Type.JudgePerfect: + case Exam.Type.JudgeGood: + case Exam.Type.JudgeBad: + if (ExamChange[i] ? songsnotesremain[NowShowingNumber] < (Challenge[i].Value[0] - Challenge[i].Amount) : notesremain < (Challenge[i].Value[0] - Challenge[i].Amount)) Challenge[i].SetReached(true); + break; + case Exam.Type.Combo: + if (notesremain + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.P1 < ((Challenge[i].Value[0])) && TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actCombo.n迴セ蝨ィ縺ョ繧ウ繝ウ繝懈焚.譛鬮伜、[0] < (Challenge[i].Value[0])) Challenge[i].SetReached(true); + break; + default: + break; + } + + // 髻ウ貅舌′邨ゆコ縺励◆繧縺、縺ョ蛻蟯舌 + // ( CDTXMania.DTX.listChip.Count > 0 ) ? CDTXMania.DTX.listChip[ CDTXMania.DTX.listChip.Count - 1 ].n逋コ螢ー譎ょ綾ms : 0; + if(!IsEnded[NowShowingNumber]) + { + if (TJAPlayer3.DTX.listChip.Count <= 0) continue; + if (ExamChange[i] ? TJAPlayer3.DTX.pDan_LastChip[NowShowingNumber].n逋コ螢ー譎ょ綾ms <= TJAPlayer3.Timer.n迴セ蝨ィ譎ょ綾 : TJAPlayer3.DTX.listChip[TJAPlayer3.DTX.listChip.Count - 1].n逋コ螢ー譎ょ綾ms <= TJAPlayer3.Timer.n迴セ蝨ィ譎ょ綾) + { + switch (Challenge[i].GetExamType()) + { + case Exam.Type.Score: + case Exam.Type.Hit: + if (Challenge[i].Amount < Challenge[i].Value[0]) Challenge[i].SetReached(true); + break; + case Exam.Type.Roll: + if (Challenge[i].Amount < Challenge[i].Value[0]) Challenge[i].SetReached(true); + break; + default: + break; + } + IsEnded[NowShowingNumber] = true; + } + } + } + if(oldReached == false && Challenge[i].GetReached() == true) + { + Sound_Failed?.t蜀咲函繧帝幕蟋九☆繧(); + } + } + } + + public override void On髱樊エサ諤ァ蛹() + { + for (int i = 0; i < 4; i++) + { + Challenge[i] = null; + } + + for (int i = 0; i < 4; i++) + { + Status[i].Timer_Amount = null; + Status[i].Timer_Gauge = null; + Status[i].Timer_Failed = null; + } + for(int i = 0; i < IsEnded.Length; i++) + IsEnded[i] = false; + + base.On髱樊エサ諤ァ蛹(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + Dan_Plate = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(Path.GetDirectoryName(TJAPlayer3.DTX.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ) + @"\Dan_Plate.png"); + Sound_Section = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧(CSkin.Path(@"Sounds\Dan\Section.ogg"), ESoundGroup.SoundEffect); + Sound_Section_First = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧(CSkin.Path(@"Sounds\Dan\Section_First.wav"), ESoundGroup.SoundEffect); + Sound_Failed = TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r逕滓舌☆繧(CSkin.Path(@"Sounds\Dan\Failed.ogg"), ESoundGroup.SoundEffect); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + Dan_Plate?.Dispose(); + Sound_Section_First?.Dispose(); + Sound_Section?.t隗」謾セ縺吶k(); + Sound_Failed?.t隗」謾セ縺吶k(); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + + public override int On騾イ陦梧緒逕サ() + { + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Dan) return base.On騾イ陦梧緒逕サ(); + Counter_In?.t騾イ陦(); + Counter_Wait?.t騾イ陦(); + Counter_Out?.t騾イ陦(); + Counter_Text?.t騾イ陦(); + + if (Counter_Text != null) + { + if (Counter_Text.n迴セ蝨ィ縺ョ蛟、 >= 2000) + { + for (int i = Counter_Text_Old; i < Counter_Text.n迴セ蝨ィ縺ョ蛟、; i++) + { + if (i % 2 == 0) + { + if (TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].TitleTex != null) + { + TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].TitleTex.Opacity--; + } + if (TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].SubTitleTex != null) + { + TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].SubTitleTex.Opacity--; + } + } + } + } + else + { + if (TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].TitleTex != null) + { + TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].TitleTex.Opacity = 255; + } + if (TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].SubTitleTex != null) + { + TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].SubTitleTex.Opacity = 255; + } + } + Counter_Text_Old = Counter_Text.n迴セ蝨ィ縺ョ蛟、; + } + + for (int i = 0; i < 4; i++) + { + Status[i].Timer_Amount?.t騾イ陦(); + } + + //for (int i = 0; i < 3; i++) + //{ + // if (Challenge[i] != null && Challenge[i].GetEnable()) + // CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 20 * i, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, Challenge[i].ToString()); + // else + // CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 20 * i, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, "None"); + //} + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 80, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, String.Format("Notes Remain: {0}", CDTXMania.DTX.n繝弱シ繝謨ー[3] - (CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ繧.Drums.Perfect + CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Perfect) - (CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ繧.Drums.Great + CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Great) - (CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ繧.Drums.Miss + CDTXMania.stage貍泌・上ラ繝ゥ繝逕サ髱「.n繝偵ャ繝域焚_Auto蜷ォ縺セ縺ェ縺.Drums.Miss))); + + // 閭梧勹繧呈緒逕サ縺吶k縲 + + TJAPlayer3.Tx.DanC_Background?.t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + + DrawExam(Challenge); + + // 蟷輔ョ繧「繝九Γ繝シ繧キ繝ァ繝ウ + if (Counter_In != null) + { + if (Counter_In.b邨ゆコ蛟、縺ォ驕斐@縺ヲ縺ェ縺) + { + for (int i = Counter_In_Old; i < Counter_In.n迴セ蝨ィ縺ョ蛟、; i++) + { + ScreenPoint[0] += (TJAPlayer3.Skin.nScrollFieldBGX[0] - ScreenPoint[0]) / 180.0; + ScreenPoint[1] += ((1280 / 2 + TJAPlayer3.Skin.nScrollFieldBGX[0] / 2) - ScreenPoint[1]) / 180.0; + } + Counter_In_Old = Counter_In.n迴セ蝨ィ縺ョ蛟、; + TJAPlayer3.Tx.DanC_Screen?.t2D謠冗判(TJAPlayer3.app.Device, (int)ScreenPoint[0], TJAPlayer3.Skin.nScrollFieldY[0], new Rectangle(0, 0, TJAPlayer3.Tx.DanC_Screen.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Tx.DanC_Screen.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + TJAPlayer3.Tx.DanC_Screen?.t2D謠冗判(TJAPlayer3.app.Device, (int)ScreenPoint[1], TJAPlayer3.Skin.nScrollFieldY[0], new Rectangle(TJAPlayer3.Tx.DanC_Screen.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, 0, TJAPlayer3.Tx.DanC_Screen.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Tx.DanC_Screen.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 420, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, String.Format("{0} : {1}", ScreenPoint[0], ScreenPoint[1])); + } + if (Counter_In.b邨ゆコ蛟、縺ォ驕斐@縺) + { + Counter_In = null; + Counter_Wait = new CCounter(0, 2299, 1, TJAPlayer3.Timer); + } + } + + if (Counter_Wait != null) + { + if (Counter_Wait.b邨ゆコ蛟、縺ォ驕斐@縺ヲ縺ェ縺) + { + TJAPlayer3.Tx.DanC_Screen?.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[0], TJAPlayer3.Skin.nScrollFieldY[0]); + + if (NowShowingNumber != 0) + { + if (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 >= 800) + { + if (!bExamChangeCheck) + { + for (int i = 1; i < 4; i++) + ExamChange[i] = false; + + for (int j = 1; j < 4; j++) //谿オ菴肴擅莉カ縺ョ繝ォ繝シ繝(鬲ゅご繝シ繧ク繧帝勁縺) 邵ヲ(y) + { + if (TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[0].Dan_C[j] != null) + { + if (TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs.Count - 1].Dan_C[j] != null) //蛟句挨縺ョ譚。莉カ縺後≠繧翫∪縺吶h繝シ + { + Challenge[j] = TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[NowShowingNumber].Dan_C[j]; + ExamChange[j] = true; + } + } + } + NowCymbolShowingNumber = NowShowingNumber; + bExamChangeCheck = true; + } + } + } + } + if (Counter_Wait.b邨ゆコ蛟、縺ォ驕斐@縺) + { + Counter_Wait = null; + Counter_Out = new CCounter(0, 90, 3, TJAPlayer3.Timer); + Counter_Text = new CCounter(0, 2899, 1, TJAPlayer3.Timer); + } + } + if (Counter_Text != null) + { + if (Counter_Text.b邨ゆコ蛟、縺ォ驕斐@縺ヲ縺ェ縺) + { + var title = TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].TitleTex; + var subTitle = TJAPlayer3.DTX.List_DanSongs[NowShowingNumber].SubTitleTex; + if (subTitle == null) + title?.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 1280 / 2 + TJAPlayer3.Skin.nScrollFieldBGX[0] / 2, TJAPlayer3.Skin.nScrollFieldY[0] + 65); + else + { + title?.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 1280 / 2 + TJAPlayer3.Skin.nScrollFieldBGX[0] / 2, TJAPlayer3.Skin.nScrollFieldY[0] + 45); + subTitle?.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 1280 / 2 + TJAPlayer3.Skin.nScrollFieldBGX[0] / 2, TJAPlayer3.Skin.nScrollFieldY[0] + 85); + } + } + if (Counter_Text.b邨ゆコ蛟、縺ォ驕斐@縺) + { + Counter_Text = null; + IsAnimating = false; + } + } + if (Counter_Out != null) + { + if (Counter_Out.b邨ゆコ蛟、縺ォ驕斐@縺ヲ縺ェ縺) + { + ScreenPoint[0] = TJAPlayer3.Skin.nScrollFieldBGX[0] - Math.Sin(Counter_Out.n迴セ蝨ィ縺ョ蛟、 * (Math.PI / 180)) * 500; + ScreenPoint[1] = TJAPlayer3.Skin.nScrollFieldBGX[0] + TJAPlayer3.Tx.DanC_Screen.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2 + Math.Sin(Counter_Out.n迴セ蝨ィ縺ョ蛟、 * (Math.PI / 180)) * 500; + TJAPlayer3.Tx.DanC_Screen?.t2D謠冗判(TJAPlayer3.app.Device, (int)ScreenPoint[0], TJAPlayer3.Skin.nScrollFieldY[0], new Rectangle(0, 0, TJAPlayer3.Tx.DanC_Screen.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Tx.DanC_Screen.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + TJAPlayer3.Tx.DanC_Screen?.t2D謠冗判(TJAPlayer3.app.Device, (int)ScreenPoint[1], TJAPlayer3.Skin.nScrollFieldY[0], new Rectangle(TJAPlayer3.Tx.DanC_Screen.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, 0, TJAPlayer3.Tx.DanC_Screen.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2, TJAPlayer3.Tx.DanC_Screen.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + //CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 420, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, String.Format("{0} : {1}", ScreenPoint[0], ScreenPoint[1])); + } + if (Counter_Out.b邨ゆコ蛟、縺ォ驕斐@縺) + { + Counter_Out = null; + } + } + // 谿オ繝励Ξ繝シ繝医r謠冗判縺吶k縲 + Dan_Plate?.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_DanC_Dan_Plate[0], TJAPlayer3.Skin.Game_DanC_Dan_Plate[1]); + + TJAPlayer3.act譁蟄励さ繝ウ繧ス繝シ繝ォ.tPrint(0, 0, C譁蟄励さ繝ウ繧ス繝シ繝ォ.E繝輔か繝ウ繝育ィョ蛻・.逋ス, TJAPlayer3.DTX.pDan_LastChip[NowShowingNumber].n逋コ螢ー譎ょ綾ms + " / " + CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝.n迴セ蝨ィ譎ょ綾); + + + return base.On騾イ陦梧緒逕サ(); + } + + public void DrawExam(Dan_C[] dan_C) + { + var count = 0; + for (int i = 0; i < 4; i++) + { + if (dan_C[i] != null && dan_C[i].GetEnable() == true) + count++; + } + for (int i = 0; i < count; i++) + { + if (dan_C[i].GetExamType() != Exam.Type.Gauge) + { + #region 繧イ繝シ繧ク縺ョ蝨溷床繧呈緒逕サ縺吶k縲 + + TJAPlayer3.Tx.DanC_Base?.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_DanC_X[count - 1], TJAPlayer3.Skin.Game_DanC_Y[count - 1] + TJAPlayer3.Skin.Game_DanC_Size[1] * i + (i * TJAPlayer3.Skin.Game_DanC_Padding), new RectangleF(0, ExamChange[i] ? 92 : 0, 1006, 92)); + + for (int j = 1; j < 3; j++) + { + if (TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j - 1].Dan_C[i] != null && TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[NowShowingNumber].Dan_C[i] != null) + { + if (NowShowingNumber > j) + { + TJAPlayer3.Tx.DanC_SmallBase.Opacity = 255; + TJAPlayer3.Tx.DanC_Small_ExamCymbol.Opacity = 255; + } + + if (NowShowingNumber == j) + { + if (Counter_Wait != null && Counter_Wait.n迴セ蝨ィ縺ョ蛟、 >= 800) + { + TJAPlayer3.Tx.DanC_SmallBase.Opacity = (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - 800); + TJAPlayer3.Tx.DanC_Small_ExamCymbol.Opacity = (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - 800); + } + else + { + if (Counter_In != null || (Counter_Wait != null && Counter_Wait.n迴セ蝨ィ縺ョ蛟、 < 800)) + { + TJAPlayer3.Tx.DanC_SmallBase.Opacity = 0; + TJAPlayer3.Tx.DanC_Small_ExamCymbol.Opacity = 0; + } + else + { + TJAPlayer3.Tx.DanC_SmallBase.Opacity = 255; + TJAPlayer3.Tx.DanC_Small_ExamCymbol.Opacity = 255; + } + } + } + + if (NowShowingNumber >= j) + { + TJAPlayer3.Tx.DanC_SmallBase?.t2D謠冗判(TJAPlayer3.app.Device, 815, 613 + (j - 1) * 33); + TJAPlayer3.Tx.DanC_Small_ExamCymbol?.t2D謠冗判(TJAPlayer3.app.Device, 785, 610 + (j - 1) * 33, new RectangleF(0, (j - 1) * 28, 30, 28)); + } + } + } + + #endregion + + #region 繧イ繝シ繧ク繧呈緒逕サ縺吶k縲 + + #region 繧イ繝シ繧ク讓ェ縺ョ繧キ繝ウ繝懊Ν謠冗判縺励h縺縺懊 + + if (ExamChange[i] && NowShowingNumber != 0) + { + if (Counter_Wait != null) + { + if (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 >= 800) + { + TJAPlayer3.Tx.DanC_ExamCymbol.Opacity = (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - 800); + } + else if (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 >= 800 - 255) + { + TJAPlayer3.Tx.DanC_ExamCymbol.Opacity = 255 - (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - (800 - 255)); + } + } + else + { + TJAPlayer3.Tx.DanC_ExamCymbol.Opacity = 255; + } + } + else + { + TJAPlayer3.Tx.DanC_ExamCymbol.Opacity = 255; + } + + //75, 418 + if (ExamChange[i]) + { + TJAPlayer3.Tx.DanC_ExamCymbol.t2D謠冗判(TJAPlayer3.app.Device, 75, 428 + (i - 1) * 100, new RectangleF(0, 41 * NowCymbolShowingNumber, 197, 41)); + } + + #endregion + + for (int j = 1; j < 3; j++) + { + if(TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j - 1].Dan_C[i] != null && TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[NowShowingNumber].Dan_C[i] != null) + { + if (GetExamStatus(TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j - 1].Dan_C[i]) == Exam.Status.Better_Success && GetExamConfirmStatus(TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j - 1].Dan_C[i])) + { + if (NowShowingNumber > j) + { + TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].Opacity = 255; + TJAPlayer3.Tx.DanC_MiniNumber.Opacity = 255; + } + + if (NowShowingNumber == j) + { + if (Counter_Wait != null && Counter_Wait.n迴セ蝨ィ縺ョ蛟、 >= 800) + { + TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].Opacity = (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - 800); + TJAPlayer3.Tx.DanC_MiniNumber.Opacity = (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - 800); + } + else + { + if (Counter_In != null || (Counter_Wait != null && Counter_Wait.n迴セ蝨ィ縺ョ蛟、 < 800)) + { + TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].Opacity = 0; + TJAPlayer3.Tx.DanC_MiniNumber.Opacity = 0; + } + else + { + TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].Opacity = 255; + TJAPlayer3.Tx.DanC_MiniNumber.Opacity = 255; + } + } + } + + if (NowShowingNumber >= j) + { + TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.23875f; + TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.35185f; + + TJAPlayer3.Tx.Gauge_Dan_Rainbow[0]?.t2D謠冗判(TJAPlayer3.app.Device, 818, 615 + (j - 1) * 33, + new Rectangle(0, 0, (int)(TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j - 1].Dan_C[i].GetAmountToPercent() * (TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 100.0)), TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + + DrawMiniNumber(TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j - 1].Dan_C[i].GetAmount(), 826, 636 + (j - 1) * 33, 14, TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j - 1].Dan_C[i]); + } + } + else + { + if (NowShowingNumber > j) + { + for (int l = 0; l < TJAPlayer3.Tx.DanC_Gauge.Length; l++) + TJAPlayer3.Tx.DanC_Gauge[l].Opacity = 255; + + TJAPlayer3.Tx.DanC_MiniNumber.Opacity = 255; + } + + if (NowShowingNumber == j) + { + if (Counter_Wait != null && Counter_Wait.n迴セ蝨ィ縺ョ蛟、 >= 800) + { + for (int l = 0; l < TJAPlayer3.Tx.DanC_Gauge.Length; l++) + TJAPlayer3.Tx.DanC_Gauge[l].Opacity = (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - 800); + + TJAPlayer3.Tx.DanC_MiniNumber.Opacity = (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - 800); + } + else + { + if (Counter_In != null || (Counter_Wait != null && Counter_Wait.n迴セ蝨ィ縺ョ蛟、 < 800)) + { + for (int l = 0; l < TJAPlayer3.Tx.DanC_Gauge.Length; l++) + TJAPlayer3.Tx.DanC_Gauge[l].Opacity = 0; + + TJAPlayer3.Tx.DanC_MiniNumber.Opacity = 0; + } + else + { + for (int l = 0; l < TJAPlayer3.Tx.DanC_Gauge.Length; l++) + TJAPlayer3.Tx.DanC_Gauge[l].Opacity = 255; + + TJAPlayer3.Tx.DanC_MiniNumber.Opacity = 255; + } + } + } + + if (NowShowingNumber >= j) + { + var drawGaugeTypetwo = 0; + if (TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j - 1].Dan_C[i].GetExamRange() == Exam.Range.More) + { + if (TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j - 1].Dan_C[i].GetAmountToPercent() >= 100) + drawGaugeTypetwo = 2; + else if (TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j - 1].Dan_C[i].GetAmountToPercent() >= 70) + drawGaugeTypetwo = 1; + else + drawGaugeTypetwo = 0; + } + else + { + if (TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j - 1].Dan_C[i].GetAmountToPercent() >= 100) + drawGaugeTypetwo = 2; + else if (TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j - 1].Dan_C[i].GetAmountToPercent() > 70) + drawGaugeTypetwo = 1; + else + drawGaugeTypetwo = 0; + } + + TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo].vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.23875f; + TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.35185f; + TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo]?.t2D謠冗判(TJAPlayer3.app.Device, 818, 615 + (j - 1) * 33, new Rectangle(0, 0, (int)(TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j - 1].Dan_C[i].GetAmountToPercent() * (TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 100.0)), TJAPlayer3.Tx.DanC_Gauge[drawGaugeTypetwo].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + + DrawMiniNumber(TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j - 1].Dan_C[i].GetAmount(), 826, 630 + (j - 1) * 33, 14, TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j - 1].Dan_C[i]); + } + } + } + } + + if (GetExamStatus(dan_C[i]) == Exam.Status.Better_Success && GetExamConfirmStatus(dan_C[i])) + { + if (ExamChange[i] && NowShowingNumber != 0) + { + if (Counter_Wait != null) + { + if (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 >= 800) + { + for (int j = 0; j < TJAPlayer3.Tx.DanC_Gauge.Length; j++) + TJAPlayer3.Tx.DanC_Gauge[j].Opacity = (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - 800); + + for (int j = 0; j < TJAPlayer3.Tx.Gauge_Dan_Rainbow.Length; j++) + TJAPlayer3.Tx.Gauge_Dan_Rainbow[j].Opacity = (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - 800); + + TJAPlayer3.Tx.DanC_Number.Opacity = (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - 800); + TJAPlayer3.Tx.DanC_ExamRange.Opacity = (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - 800); + TJAPlayer3.Tx.DanC_Small_Number.Opacity = (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - 800); + } + else if (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 >= 800 - 255) + { + for (int j = 0; j < TJAPlayer3.Tx.DanC_Gauge.Length; j++) + TJAPlayer3.Tx.DanC_Gauge[j].Opacity = 255 - (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - (800 - 255)); + + for (int j = 0; j < TJAPlayer3.Tx.Gauge_Dan_Rainbow.Length; j++) + TJAPlayer3.Tx.Gauge_Dan_Rainbow[j].Opacity = 255 - (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - (800 - 255)); + + TJAPlayer3.Tx.DanC_Number.Opacity = 255 - (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - (800 - 255)); + TJAPlayer3.Tx.DanC_ExamRange.Opacity = 255 - (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - (800 - 255)); + TJAPlayer3.Tx.DanC_Small_Number.Opacity = 255 - (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - (800 - 255)); + } + } + else + { + for (int j = 0; j < TJAPlayer3.Tx.DanC_Gauge.Length; j++) + TJAPlayer3.Tx.DanC_Gauge[j].Opacity = 255; + + for (int j = 0; j < TJAPlayer3.Tx.Gauge_Dan_Rainbow.Length; j++) + TJAPlayer3.Tx.Gauge_Dan_Rainbow[j].Opacity = 255; + + TJAPlayer3.Tx.DanC_Number.Opacity = 255; + TJAPlayer3.Tx.DanC_ExamRange.Opacity = 255; + TJAPlayer3.Tx.DanC_Small_Number.Opacity = 255; + } + } + else + { + for (int j = 0; j < TJAPlayer3.Tx.DanC_Gauge.Length; j++) + TJAPlayer3.Tx.DanC_Gauge[j].Opacity = 255; + + for (int j = 0; j < TJAPlayer3.Tx.Gauge_Dan_Rainbow.Length; j++) + TJAPlayer3.Tx.Gauge_Dan_Rainbow[j].Opacity = 255; + + TJAPlayer3.Tx.DanC_Number.Opacity = 255; + TJAPlayer3.Tx.DanC_ExamRange.Opacity = 255; + TJAPlayer3.Tx.DanC_Small_Number.Opacity = 255; + } + + this.ct陌ケ繧「繝九Γ.t騾イ陦鍬oop(); + this.ct陌ケ騾乗主コヲ.t騾イ陦鍬oop(); + + int 陌ケ繝吶シ繧ケ = ct陌ケ繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、; + if (陌ケ繝吶シ繧ケ == ct陌ケ繧「繝九Γ.n邨ゆコ蛟、) 陌ケ繝吶シ繧ケ = 0; + + TJAPlayer3.Tx.Gauge_Dan_Rainbow[this.ct陌ケ繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、].vc諡。螟ァ邵ョ蟆丞咲紫.X = ExamChange[i] ? 0.663333333f : 1.0f; + TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].vc諡。螟ァ邵ョ蟆丞咲紫.X = ExamChange[i] ? 0.663333333f : 1.0f; + TJAPlayer3.Tx.Gauge_Dan_Rainbow[0].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + + if (Counter_Wait != null && !(Counter_Wait.n迴セ蝨ィ縺ョ蛟、 <= 1055 && Counter_Wait.n迴セ蝨ィ縺ョ蛟、 >= 800 - 255)) + { + TJAPlayer3.Tx.Gauge_Dan_Rainbow[this.ct陌ケ繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、].Opacity = 255; + } + TJAPlayer3.Tx.Gauge_Dan_Rainbow[this.ct陌ケ繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、]?.t2D諡。螟ァ邇閠諷ョ荳句渕貅匁緒逕サ(TJAPlayer3.app.Device, + TJAPlayer3.Skin.Game_DanC_X[count - 1] + TJAPlayer3.Skin.Game_DanC_Offset[0], TJAPlayer3.Skin.Game_DanC_Y[count - 1] + TJAPlayer3.Skin.Game_DanC_Size[1] * (i + 1) + ((i + 1) * TJAPlayer3.Skin.Game_DanC_Padding) - TJAPlayer3.Skin.Game_DanC_Offset[1], + new Rectangle(0, 0, (int)(dan_C[i].GetAmountToPercent() * (TJAPlayer3.Tx.Gauge_Dan_Rainbow[this.ct陌ケ繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 100.0)), TJAPlayer3.Tx.Gauge_Dan_Rainbow[this.ct陌ケ繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + + if (Counter_Wait != null && !(Counter_Wait.n迴セ蝨ィ縺ョ蛟、 <= 1055 && Counter_Wait.n迴セ蝨ィ縺ョ蛟、 >= 800 - 255)) + { + TJAPlayer3.Tx.Gauge_Dan_Rainbow[陌ケ繝吶シ繧ケ].Opacity = (ct陌ケ騾乗主コヲ.n迴セ蝨ィ縺ョ蛟、 * 255 / (int)ct陌ケ騾乗主コヲ.n邨ゆコ蛟、) / 1; + } + + TJAPlayer3.Tx.Gauge_Dan_Rainbow[陌ケ繝吶シ繧ケ]?.t2D諡。螟ァ邇閠諷ョ荳句渕貅匁緒逕サ(TJAPlayer3.app.Device, + TJAPlayer3.Skin.Game_DanC_X[count - 1] + TJAPlayer3.Skin.Game_DanC_Offset[0], TJAPlayer3.Skin.Game_DanC_Y[count - 1] + TJAPlayer3.Skin.Game_DanC_Size[1] * (i + 1) + ((i + 1) * TJAPlayer3.Skin.Game_DanC_Padding) - TJAPlayer3.Skin.Game_DanC_Offset[1], + new Rectangle(0, 0, (int)(dan_C[i].GetAmountToPercent() * (TJAPlayer3.Tx.Gauge_Dan_Rainbow[陌ケ繝吶シ繧ケ].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 100.0)), TJAPlayer3.Tx.Gauge_Dan_Rainbow[this.ct陌ケ繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + + } + else + { + if(ExamChange[i] && NowShowingNumber != 0) + { + if (Counter_Wait != null) + { + if (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 >= 800) + { + for (int j = 0; j < TJAPlayer3.Tx.DanC_Gauge.Length; j++) + TJAPlayer3.Tx.DanC_Gauge[j].Opacity = (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - 800); + + TJAPlayer3.Tx.DanC_Number.Opacity = (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - 800); + TJAPlayer3.Tx.DanC_ExamRange.Opacity = (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - 800); + TJAPlayer3.Tx.DanC_Small_Number.Opacity = (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - 800); + } + else if (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 >= 800 - 255) + { + for (int j = 0; j < TJAPlayer3.Tx.DanC_Gauge.Length; j++) + TJAPlayer3.Tx.DanC_Gauge[j].Opacity = 255 - (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - (800 - 255)); + + TJAPlayer3.Tx.DanC_Number.Opacity = 255 - (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - (800 - 255)); + TJAPlayer3.Tx.DanC_ExamRange.Opacity = 255 - (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - (800 - 255)); + TJAPlayer3.Tx.DanC_Small_Number.Opacity = 255 - (Counter_Wait.n迴セ蝨ィ縺ョ蛟、 - (800 - 255)); + } + } + else + { + for (int j = 0; j < TJAPlayer3.Tx.DanC_Gauge.Length; j++) + TJAPlayer3.Tx.DanC_Gauge[j].Opacity = 255; + + TJAPlayer3.Tx.DanC_Number.Opacity = 255; + TJAPlayer3.Tx.DanC_ExamRange.Opacity = 255; + TJAPlayer3.Tx.DanC_Small_Number.Opacity = 255; + } + } + else + { + for (int j = 0; j < TJAPlayer3.Tx.DanC_Gauge.Length; j++) + TJAPlayer3.Tx.DanC_Gauge[j].Opacity = 255; + + TJAPlayer3.Tx.DanC_Number.Opacity = 255; + TJAPlayer3.Tx.DanC_ExamRange.Opacity = 255; + TJAPlayer3.Tx.DanC_Small_Number.Opacity = 255; + } + + var drawGaugeType = 0; + if (dan_C[i].GetExamRange() == Exam.Range.More) + { + if (dan_C[i].GetAmountToPercent() >= 100) + drawGaugeType = 2; + else if (dan_C[i].GetAmountToPercent() >= 70) + drawGaugeType = 1; + else + drawGaugeType = 0; + } + else + { + if (dan_C[i].GetAmountToPercent() >= 100) + drawGaugeType = 2; + else if (dan_C[i].GetAmountToPercent() > 70) + drawGaugeType = 1; + else + drawGaugeType = 0; + } + TJAPlayer3.Tx.DanC_Gauge[drawGaugeType].vc諡。螟ァ邵ョ蟆丞咲紫.X = ExamChange[i] ? 0.663333333f : 1.0f; + TJAPlayer3.Tx.DanC_Gauge[drawGaugeType].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + TJAPlayer3.Tx.DanC_Gauge[drawGaugeType]?.t2D諡。螟ァ邇閠諷ョ荳句渕貅匁緒逕サ(TJAPlayer3.app.Device, + TJAPlayer3.Skin.Game_DanC_X[count - 1] + TJAPlayer3.Skin.Game_DanC_Offset[0], TJAPlayer3.Skin.Game_DanC_Y[count - 1] + TJAPlayer3.Skin.Game_DanC_Size[1] * (i + 1) + ((i + 1) * TJAPlayer3.Skin.Game_DanC_Padding) - TJAPlayer3.Skin.Game_DanC_Offset[1], + new Rectangle(0, 0, (int)(dan_C[i].GetAmountToPercent() * (TJAPlayer3.Tx.DanC_Gauge[drawGaugeType].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 100.0)), TJAPlayer3.Tx.DanC_Gauge[drawGaugeType].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height)); + + } + + #endregion + + #region 迴セ蝨ィ縺ョ蛟、繧呈緒逕サ縺吶k縲 + var nowAmount = 0; + if (dan_C[i].GetExamRange() == Exam.Range.Less) + { + nowAmount = dan_C[i].Value[0] - dan_C[i].Amount; + } + else + { + nowAmount = dan_C[i].Amount; + } + if (nowAmount < 0) nowAmount = 0; + + DrawNumber(nowAmount, + TJAPlayer3.Skin.Game_DanC_X[count - 1] + TJAPlayer3.Skin.Game_DanC_Number_Small_Number_Offset[0], + TJAPlayer3.Skin.Game_DanC_Y[count - 1] + TJAPlayer3.Skin.Game_DanC_Size[1] * (i + 1) + ((i + 1) * TJAPlayer3.Skin.Game_DanC_Padding) - TJAPlayer3.Skin.Game_DanC_Number_Small_Number_Offset[1], + TJAPlayer3.Skin.Game_DanC_Number_Padding, + true, + Challenge[i], + TJAPlayer3.Skin.Game_DanC_Number_Small_Scale, + TJAPlayer3.Skin.Game_DanC_Number_Small_Scale, + (Status[i].Timer_Amount != null ? ScoreScale[Status[i].Timer_Amount.n迴セ蝨ィ縺ョ蛟、] : 0f)); + + #endregion + + #region 譚。莉カ縺ョ譁蟄励r謠冗判縺吶k縲 + var offset = TJAPlayer3.Skin.Game_DanC_Exam_Offset[0]; + //offset -= CDTXMania.Skin.Game_DanC_ExamRange_Padding; + // 譚。莉カ縺ョ遽蝗イ + TJAPlayer3.Tx.DanC_ExamType.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f; + TJAPlayer3.Tx.DanC_ExamType.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f; + + TJAPlayer3.Tx.DanC_ExamRange?.t2D諡。螟ァ邇閠諷ョ荳句渕貅匁緒逕サ(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_DanC_X[count - 1] + offset - TJAPlayer3.Tx.DanC_ExamRange.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width, TJAPlayer3.Skin.Game_DanC_Y[count - 1] + TJAPlayer3.Skin.Game_DanC_Size[1] * (i + 1) + ((i + 1) * TJAPlayer3.Skin.Game_DanC_Padding) - TJAPlayer3.Skin.Game_DanC_Exam_Offset[1], new Rectangle(0, TJAPlayer3.Skin.Game_DanC_ExamRange_Size[1] * (int)dan_C[i].GetExamRange(), TJAPlayer3.Skin.Game_DanC_ExamRange_Size[0], TJAPlayer3.Skin.Game_DanC_ExamRange_Size[1])); + //offset -= CDTXMania.Skin.Game_DanC_ExamRange_Padding; + offset -= TJAPlayer3.Skin.Game_DanC_ExamRange_Padding; + + // 譚。莉カ縺ョ謨ー蟄 + DrawNumber( + dan_C[i].Value[0], + TJAPlayer3.Skin.Game_DanC_X[count - 1] + offset - dan_C[i].Value[0].ToString().Length * (int)(TJAPlayer3.Skin.Game_DanC_Number_Small_Padding * TJAPlayer3.Skin.Game_DanC_Exam_Number_Scale), + TJAPlayer3.Skin.Game_DanC_Y[count - 1] + TJAPlayer3.Skin.Game_DanC_Size[1] * (i + 1) + ((i + 1) * TJAPlayer3.Skin.Game_DanC_Padding) - TJAPlayer3.Skin.Game_DanC_Exam_Offset[1] - 1, + (int)(TJAPlayer3.Skin.Game_DanC_Number_Small_Padding * TJAPlayer3.Skin.Game_DanC_Exam_Number_Scale), + false, + Challenge[i]); + + //offset -= CDTXMania.Skin.Game_DanC_Number_Small_Padding * (dan_C[i].Value[0].ToString().Length + 1); + offset -= TJAPlayer3.Skin.Game_DanC_Number_Small_Padding * (dan_C[i].Value[0].ToString().Length); + + // 譚。莉カ縺ョ遞ョ鬘 + TJAPlayer3.Tx.DanC_ExamType?.t2D諡。螟ァ邇閠諷ョ荳句渕貅匁緒逕サ(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_DanC_X[1] + TJAPlayer3.Skin.Game_DanC_Exam_Offset[0] - TJAPlayer3.Tx.DanC_ExamType.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width + 22, TJAPlayer3.Skin.Game_DanC_Y[count - 1] + TJAPlayer3.Skin.Game_DanC_Size[1] * (i + 1) + ((i + 1) * TJAPlayer3.Skin.Game_DanC_Padding) - TJAPlayer3.Skin.Game_DanC_Exam_Offset[1] - 48, new Rectangle(0, TJAPlayer3.Skin.Game_DanC_ExamType_Size[1] * (int)dan_C[i].GetExamType(), TJAPlayer3.Skin.Game_DanC_ExamType_Size[0], TJAPlayer3.Skin.Game_DanC_ExamType_Size[1])); + #endregion + + #region 譚。莉カ驕疲仙、ア謨励ョ逕サ蜒上r謠冗判縺吶k縲 + if (dan_C[i].GetReached()) + { + TJAPlayer3.Tx.DanC_Failed.t2D諡。螟ァ邇閠諷ョ荳句渕貅匁緒逕サ(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_DanC_X[count - 1] + TJAPlayer3.Skin.Game_DanC_Offset[0], TJAPlayer3.Skin.Game_DanC_Y[count - 1] + TJAPlayer3.Skin.Game_DanC_Size[1] * (i + 1) + ((i + 1) * TJAPlayer3.Skin.Game_DanC_Padding) - TJAPlayer3.Skin.Game_DanC_Offset[1]); + } + #endregion + } + else + { + #region 繧イ繝シ繧ク縺ョ蝨溷床繧呈緒逕サ縺吶k縲 + TJAPlayer3.Tx.DanC_Gauge_Base?.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_DanC_X[0] - ((50 - dan_C[i].GetValue(false) / 2) * 14) + 4, TJAPlayer3.Skin.Game_DanC_Y[0] + TJAPlayer3.Skin.Game_DanC_Size[1] * i + (i * TJAPlayer3.Skin.Game_DanC_Padding)); + #endregion + } + } + } + + /// + /// 谿オ菴阪メ繝」繝ャ繝ウ繧ク縺ョ謨ー蟄励ヵ繧ゥ繝ウ繝医〒謨ー蟄励r謠冗判縺励∪縺吶 + /// + /// 蛟、縲 + /// 荳譯∫岼縺ョX蠎ァ讓吶 + /// 荳譯∫岼縺ョY蠎ァ讓 + /// 譯∵焚髢薙ョ蟄鈴俣 + /// 諡。螟ァ邇X + /// 諡。螟ァ邇Y + /// 繧「繝九Γ繝シ繧キ繝ァ繝ウ逕ィ諡。螟ァ邇(Y縺ォ蜉邂励&繧後k)縲 + private void DrawNumber(int value, int x, int y, int padding,縲bool bBig, Dan_C dan_c, float scaleX = 1.0f, float scaleY = 1.0f, float scaleJump = 0.0f) + { + if (bBig) + { + var notesRemainDigit = 0; + for (int i = 0; i < value.ToString().Length; i++) + { + var number = Convert.ToInt32(value.ToString()[i].ToString()); + Rectangle rectangle = new Rectangle(TJAPlayer3.Skin.Game_DanC_Number_Size[0] * number - 1, GetExamConfirmStatus(dan_c) ? TJAPlayer3.Skin.Game_DanC_Number_Size[1] : 0, TJAPlayer3.Skin.Game_DanC_Number_Size[0], TJAPlayer3.Skin.Game_DanC_Number_Size[1]); + if (TJAPlayer3.Tx.DanC_Number != null) + { + TJAPlayer3.Tx.DanC_Number.vc諡。螟ァ邵ョ蟆丞咲紫.X = scaleX; + TJAPlayer3.Tx.DanC_Number.vc諡。螟ァ邵ョ蟆丞咲紫.Y = scaleY + scaleJump; + } + TJAPlayer3.Tx.DanC_Number?.t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x - (notesRemainDigit * padding), y, rectangle); + notesRemainDigit--; + } + } + else + { + var notesRemainDigit = 0; + for (int i = 0; i < value.ToString().Length; i++) + { + var number = Convert.ToInt32(value.ToString()[i].ToString()); + Rectangle rectangle = new Rectangle(TJAPlayer3.Skin.Game_DanC_Small_Number_Size[0] * number - 1, 0, TJAPlayer3.Skin.Game_DanC_Small_Number_Size[0], TJAPlayer3.Skin.Game_DanC_Small_Number_Size[1]); + if (TJAPlayer3.Tx.DanC_Small_Number != null) + { + TJAPlayer3.Tx.DanC_Small_Number.vc諡。螟ァ邵ョ蟆丞咲紫.X = scaleX; + TJAPlayer3.Tx.DanC_Small_Number.vc諡。螟ァ邵ョ蟆丞咲紫.Y = scaleY + scaleJump; + } + TJAPlayer3.Tx.DanC_Small_Number?.t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x - (notesRemainDigit * padding), y, rectangle); + notesRemainDigit--; + } + } + } + + public void DrawMiniNumber(int value, int x, int y, int padding, Dan_C dan_c) + { + var notesRemainDigit = 0; + for (int i = 0; i < value.ToString().Length; i++) + { + var number = Convert.ToInt32(value.ToString()[i].ToString()); + Rectangle rectangle = new Rectangle(TJAPlayer3.Skin.Game_DanC_MiniNumber_Size[0] * number - 1, GetExamConfirmStatus(dan_c) ? TJAPlayer3.Skin.Game_DanC_MiniNumber_Size[1] : 0, TJAPlayer3.Skin.Game_DanC_MiniNumber_Size[0], TJAPlayer3.Skin.Game_DanC_MiniNumber_Size[1]); + TJAPlayer3.Tx.DanC_MiniNumber?.t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x - (notesRemainDigit * padding), y, rectangle); + notesRemainDigit--; + } + } + + /// + /// n蛟九ョ譚。莉カ縺後イ縺ィ縺、莉・荳企#謌仙、ア謨励@縺ヲ縺繧九°縺ゥ縺縺九r霑斐@縺セ縺吶 + /// + /// n蛟九ョ譚。莉カ縺後イ縺ィ縺、莉・荳企#謌仙、ア謨励@縺ヲ縺繧九°縲 + public bool GetFailedAllChallenges() + { + var isFailed = false; + for (int i = 0; i < this.ExamCount; i++) + { + for(int j = 0; j < TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs.Count; j++ ) + { + if(TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j].Dan_C[i] != null) + { + if (TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.DanSongs[j].Dan_C[i].GetReached()) isFailed = true; + } + } + if (Challenge[i].GetReached()) isFailed = true; + } + return isFailed; + } + + /// + /// n蛟九ョ譚。莉カ縺ァ谿オ菴崎ェ榊ョ壹Δ繝シ繝峨ョ繧ケ繝繝シ繧ソ繧ケ繧定ソ斐@縺セ縺吶 + /// + /// 譚。莉カ縲 + /// ExamStatus縲 + public Exam.Status GetExamStatus(Dan_C[] dan_C) + { + var status = Exam.Status.Better_Success; + var count = 0; + for (int i = 0; i < 4; i++) + { + if (dan_C[i] != null && dan_C[i].GetEnable() == true) + count++; + } + for (int i = 0; i < count; i++) + { + if (!dan_C[i].GetCleared()[1]) status = Exam.Status.Success; + } + for (int i = 0; i < count; i++) + { + if (!dan_C[i].GetCleared()[0]) status = Exam.Status.Failure; + } + return status; + } + + public Exam.Status GetExamStatus(Dan_C dan_C) + { + var status = Exam.Status.Better_Success; + if (!dan_C.GetCleared()[1]) status = Exam.Status.Success; + if (!dan_C.GetCleared()[0]) status = Exam.Status.Failure; + return status; + } + + public bool GetExamConfirmStatus(Dan_C dan_C) + { + switch (dan_C.GetExamRange()) + { + case Exam.Range.Less: + { + if (GetExamStatus(dan_C) == Exam.Status.Better_Success && notesremain == 0) + return true; + else + return false; + } + + case Exam.Range.More: + { + if (GetExamStatus(dan_C) == Exam.Status.Better_Success) + return true; + else + return false; + } + } + return false; + } + + public Dan_C[] GetExam() + { + return Challenge; + } + + + private readonly float[] ScoreScale = new float[] + { + 0.000f, + 0.111f, // 繝ェ繝斐シ繝 + 0.222f, + 0.185f, + 0.148f, + 0.129f, + 0.111f, + 0.074f, + 0.065f, + 0.033f, + 0.015f, + 0.000f + }; + + [StructLayout(LayoutKind.Sequential)] + struct ChallengeStatus + { + public SlimDX.Color4 Color; + public CCounter Timer_Gauge; + public CCounter Timer_Amount; + public CCounter Timer_Failed; + } + + #region[ private ] + //----------------- + + private bool bExamChangeCheck; + private int notesremain; + private int[] songsnotesremain; + private bool[] ExamChange = new bool[4]; + private int ExamCount; + private ChallengeStatus[] Status = new ChallengeStatus[4]; + private CTexture Dan_Plate; + private bool[] IsEnded; + public bool FirstSectionAnime; + + // 繧「繝九Γ髢「騾」 + public int NowShowingNumber; + public int NowCymbolShowingNumber; + private CCounter Counter_In, Counter_Wait, Counter_Out, Counter_Text; + private double[] ScreenPoint; + private int Counter_In_Old, Counter_Out_Old, Counter_Text_Old; + public bool IsAnimating; + + //髻ウ螢ー髢「騾」 + private CSound Sound_Section; + private CSound Sound_Section_First; + private CSound Sound_Failed; + + private CCounter ct陌ケ繧「繝九Γ; + private CCounter ct陌ケ騾乗主コヲ; + + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/FireWorks.cs b/TJAPlayer3/Stages/07.Game/Taiko/FireWorks.cs new file mode 100644 index 00000000..1e120eee --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/FireWorks.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Runtime.InteropServices; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class FireWorks : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public FireWorks() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // 繝。繧ス繝繝 + + /// + /// 螟ァ髻ウ隨ヲ縺ョ闃ア轣ォ繧ィ繝輔ぉ繧ッ繝 + /// + /// + public virtual void Start(int nLane, int nPlayer, double x, double y) + { + for (int i = 0; i < 32; i++) + { + if(!FireWork[i].IsUsing) + { + FireWork[i].IsUsing = true; + FireWork[i].Lane = nLane; + FireWork[i].Player = nPlayer; + FireWork[i].X = x; + FireWork[i].Y = y; + FireWork[i].Counter = new CCounter(0, TJAPlayer3.Skin.Game_Effect_FireWorks[2] - 1, TJAPlayer3.Skin.Game_Effect_FireWorks_Timer, TJAPlayer3.Timer); + break; + } + } + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + for (int i = 0; i < 32; i++) + { + FireWork[i] = new Status(); + FireWork[i].IsUsing = false; + FireWork[i].Counter = new CCounter(); + } + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + for (int i = 0; i < 32; i++) + { + FireWork[i].Counter = null; + } + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + for (int i = 0; i < 32; i++) + { + if(FireWork[i].IsUsing) + { + FireWork[i].Counter.t騾イ陦(); + TJAPlayer3.Tx.Effects_Hit_FireWorks.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, (float)FireWork[i].X, (float)FireWork[i].Y, 1, new Rectangle(FireWork[i].Counter.n迴セ蝨ィ縺ョ蛟、 * TJAPlayer3.Skin.Game_Effect_FireWorks[0], 0, TJAPlayer3.Skin.Game_Effect_FireWorks[0], TJAPlayer3.Skin.Game_Effect_FireWorks[1])); + if (FireWork[i].Counter.b邨ゆコ蛟、縺ォ驕斐@縺) + { + FireWork[i].Counter.t蛛懈ュ「(); + FireWork[i].IsUsing = false; + } + } + } + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + [StructLayout(LayoutKind.Sequential)] + private struct Status + { + public int Lane; + public int Player; + public bool IsUsing; + public CCounter Counter; + public double X; + public double Y; + } + private Status[] FireWork = new Status[32]; + + //----------------- + #endregion + } +} +縲 diff --git a/TJAPlayer3/Stages/07.Game/Taiko/FlyingNotes.cs b/TJAPlayer3/Stages/07.Game/Taiko/FlyingNotes.cs new file mode 100644 index 00000000..6c85c25c --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/FlyingNotes.cs @@ -0,0 +1,191 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Runtime.InteropServices; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class FlyingNotes : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public FlyingNotes() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // 繝。繧ス繝繝 + public virtual void Start(int nLane, int nPlayer, bool isRoll = false) + { + if (TJAPlayer3.Tx.Notes != null) + { + for (int i = 0; i < 128; i++) + { + if (!Flying[i].IsUsing) + { + // 蛻晄悄蛹 + Flying[i].IsUsing = true; + Flying[i].Lane = nLane; + Flying[i].Player = nPlayer; + Flying[i].X = -100; //StartPointX[nPlayer]; + Flying[i].Y = -100; //TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[nPlayer]; + Flying[i].StartPointX = StartPointX[nPlayer]; + Flying[i].StartPointY = TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[nPlayer]; + Flying[i].OldValue = 0; + Flying[i].IsRoll = isRoll; + // 隗貞コヲ縺ョ豎コ螳 + Flying[i].Height = Math.Abs(TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[nPlayer] - TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[nPlayer]); + Flying[i].Width = (Math.Abs((TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[nPlayer] - StartPointX[nPlayer])) / 2); + //Console.WriteLine("{0}, {1}", width2P, height2P); + Flying[i].Theta = ((Math.Atan2(Flying[i].Height, Flying[i].Width) * 180.0) / Math.PI); + Flying[i].Counter = new CCounter(36, 140, TJAPlayer3.Skin.Game_Effect_FlyingNotes_Timer, TJAPlayer3.Timer); + //Flying[i].Counter = new CCounter(0, 200000, CDTXMania.Skin.Game_Effect_FlyingNotes_Timer, CDTXMania.Timer); + + Flying[i].IncreaseX = (1.00 * Math.Abs((TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[nPlayer] - StartPointX[nPlayer]))) / (180); + Flying[i].IncreaseY = (1.00 * Math.Abs((TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[nPlayer] - TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[nPlayer]))) / (180); + break; + } + } + } + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + for (int i = 0; i < 128; i++) + { + Flying[i] = new Status(); + Flying[i].IsUsing = false; + Flying[i].Counter = new CCounter(); + } + for (int i = 0; i < 2; i++) + { + StartPointX[i] = TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_X[i]; + } + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + for (int i = 0; i < 128; i++) + { + Flying[i].Counter = null; + } + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + for (int i = 0; i < 128; i++) + { + if (Flying[i].IsUsing) + { + Flying[i].OldValue = Flying[i].Counter.n迴セ蝨ィ縺ョ蛟、; + Flying[i].Counter.t騾イ陦(); + if (Flying[i].Counter.b邨ゆコ蛟、縺ォ驕斐@縺) + { + Flying[i].Counter.t蛛懈ュ「(); + Flying[i].IsUsing = false; + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actGauge.Start(Flying[i].Lane, E蛻、螳.Perfect, Flying[i].Player); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actChipEffects.Start(Flying[i].Player, Flying[i].Lane); + } + for (int n = Flying[i].OldValue; n < Flying[i].Counter.n迴セ蝨ィ縺ョ蛟、; n += 16) + { + if (TJAPlayer3.Skin.Game_Effect_FlyingNotes_IsUsingEasing) + { + Flying[i].X = (Flying[i].StartPointX + 499 + ((-Math.Cos(Flying[i].Counter.n迴セ蝨ィ縺ョ蛟、 * (Math.PI / 180)) * 499))) - 85; + //Flying[i].X += (Math.Cos(Flying[i].Counter.n迴セ蝨ィ縺ョ蛟、 * (Math.PI / 180))) * Flying[i].Increase; + } + else + { + Flying[i].X += Flying[i].IncreaseX; + } + + if (n % TJAPlayer3.Skin.Game_Effect_FireWorks_Timing == 0 && !Flying[i].IsRoll && Flying[i].Counter.n迴セ蝨ィ縺ョ蛟、 > 18) + { + if (Flying[i].Lane == 3 || Flying[i].Lane == 4) + { + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.FireWorks.Start(Flying[i].Lane, Flying[i].Player, Flying[i].X, Flying[i].Y); + } + } + + if (Flying[i].Player == 0) + { + Flying[i].Y = ((TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[Flying[i].Player]) + -Math.Sin(Flying[i].Counter.n迴セ蝨ィ縺ョ蛟、 * (Math.PI / 180)) * 559) + 329; + Flying[i].Y -= Flying[i].IncreaseY * Flying[i].Counter.n迴セ蝨ィ縺ョ蛟、; + } + else + { + Flying[i].Y = ((TJAPlayer3.Skin.Game_Effect_FlyingNotes_StartPoint_Y[Flying[i].Player]) + Math.Sin(Flying[i].Counter.n迴セ蝨ィ縺ョ蛟、 * (Math.PI / 180)) * 559) - 329; + Flying[i].Y += Flying[i].IncreaseY * Flying[i].Counter.n迴セ蝨ィ縺ョ蛟、; + } + + } + //Flying[i].OldValue = Flying[i].Counter.n迴セ蝨ィ縺ョ蛟、; + + if (Flying[i].Player == 0) + { + TJAPlayer3.Tx.Notes?.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, (int)Flying[i].X, (int)Flying[i].Y, new Rectangle(Flying[i].Lane * 130, 0, 130, 130)); + } + else if (Flying[i].Player == 1) + { + // + TJAPlayer3.Tx.Notes?.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, (int)Flying[i].X, (int)Flying[i].Y, new Rectangle(Flying[i].Lane * 130, 0, 130, 130)); + } + } + } + } + return base.On騾イ陦梧緒逕サ(); + } + + + #region [ private ] + //----------------- + + [StructLayout(LayoutKind.Sequential)] + private struct Status + { + public int Lane; + public int Player; + public bool IsUsing; + public CCounter Counter; + public int OldValue; + public double X; + public double Y; + public int Height; + public int Width; + public double IncreaseX; + public double IncreaseY; + public bool IsRoll; + public int StartPointX; + public int StartPointY; + public double Theta; + } + + private Status[] Flying = new Status[128]; + + public readonly int[] StartPointX = new int[2]; + + //----------------- + #endregion + } +} \ No newline at end of file diff --git a/TJAPlayer3/Stages/07.Game/Taiko/GoGoSplash.cs b/TJAPlayer3/Stages/07.Game/Taiko/GoGoSplash.cs new file mode 100644 index 00000000..d91d5efa --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/GoGoSplash.cs @@ -0,0 +1,85 @@ +サソusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FDK; +using System.Drawing; + +namespace TJAPlayer3 +{ + class GoGoSplash : CActivity + { + public GoGoSplash() + { + this.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + public override void On豢サ諤ァ蛹() + { + Splash = new CCounter(); + base.On豢サ諤ァ蛹(); + } + + public override void On髱樊エサ諤ァ蛹() + { + base.On髱樊エサ諤ァ蛹(); + } + + /// + /// 繧エ繝シ繧エ繝シ繧ケ繝励Λ繝繧キ繝・縺ョ謠冗判蜃ヲ逅縺ァ縺吶 + /// SkinCofig縺ァ譛ャ謨ー繧貞、画峩縺吶k縺薙→縺後〒縺阪∪縺吶 + /// + /// + public override int On騾イ陦梧緒逕サ() + { + if (Splash == null) return base.On騾イ陦梧緒逕サ(); + Splash.t騾イ陦(); + if (Splash.b邨ゆコ蛟、縺ォ驕斐@縺) + { + Splash.n迴セ蝨ィ縺ョ蛟、 = 0; + Splash.t蛛懈ュ「(); + } + if (Splash.b騾イ陦御クュ) + { + for (int i = 0; i < TJAPlayer3.Skin.Game_Effect_GoGoSplash_X.Length; i++) + { + if (i > TJAPlayer3.Skin.Game_Effect_GoGoSplash_Y.Length) break; + // Y縺ョ驟榊励′i繧医j繧ょー上&縺九▲縺溘i縺昴%縺ァ繧ュ繝」繝ウ繧サ繝ォ縺吶k縲 + if(TJAPlayer3.Skin.Game_Effect_GoGoSplash_Rotate && TJAPlayer3.Tx.Effects_GoGoSplash != null) + { + // Switch譁繧剃スソ縺縺溘°縺」縺溘′縲∝ョ壽焚縺倥c縺ェ縺縺九i菴ソ縺医ュ縺!!!! + if (i == 0) + { + TJAPlayer3.Tx.Effects_GoGoSplash.fZ霆ク荳ュ蠢蝗櫁サ「 = -0.2792526803190927f; + } + else if (i == 1) + { + TJAPlayer3.Tx.Effects_GoGoSplash.fZ霆ク荳ュ蠢蝗櫁サ「 = -0.13962634015954636f; + } + else if (i == TJAPlayer3.Skin.Game_Effect_GoGoSplash_X.Length - 2) + { + TJAPlayer3.Tx.Effects_GoGoSplash.fZ霆ク荳ュ蠢蝗櫁サ「 = 0.13962634015954636f; + } + else if (i == TJAPlayer3.Skin.Game_Effect_GoGoSplash_X.Length - 1) + { + TJAPlayer3.Tx.Effects_GoGoSplash.fZ霆ク荳ュ蠢蝗櫁サ「 = 0.2792526803190927f; + } + else + { + TJAPlayer3.Tx.Effects_GoGoSplash.fZ霆ク荳ュ蠢蝗櫁サ「 = 0.0f; + } + } + TJAPlayer3.Tx.Effects_GoGoSplash?.t2D諡。螟ァ邇閠諷ョ荳倶クュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Effect_GoGoSplash_X[i], TJAPlayer3.Skin.Game_Effect_GoGoSplash_Y[i], new Rectangle(TJAPlayer3.Skin.Game_Effect_GoGoSplash[0] * Splash.n迴セ蝨ィ縺ョ蛟、, 0, TJAPlayer3.Skin.Game_Effect_GoGoSplash[0], TJAPlayer3.Skin.Game_Effect_GoGoSplash[1])); + } + } + return base.On騾イ陦梧緒逕サ(); + } + + public void StartSplash() + { + Splash = new CCounter(0, TJAPlayer3.Skin.Game_Effect_GoGoSplash[2] - 1, TJAPlayer3.Skin.Game_Effect_GoGoSplash_Timer, TJAPlayer3.Timer); + } + + private CCounter Splash; + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/LaneFlash.cs b/TJAPlayer3/Stages/07.Game/Taiko/LaneFlash.cs new file mode 100644 index 00000000..6957cd20 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/LaneFlash.cs @@ -0,0 +1,58 @@ +サソusing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using TJAPlayer3; +using FDK; + +namespace TJAPlayer3 +{ + /// + /// 繝ャ繝シ繝ウ繝輔Λ繝繧キ繝・縺ョ繧ッ繝ゥ繧ケ縲 + /// + public class LaneFlash : CActivity + { + + public LaneFlash(ref CTexture texture, int player) + { + Texture = texture; + Player = player; + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + public void Start() + { + Counter = new CCounter(0, 100, 1, TJAPlayer3.Timer); + } + + public override void On豢サ諤ァ蛹() + { + Counter = new CCounter(); + base.On豢サ諤ァ蛹(); + } + + public override void On髱樊エサ諤ァ蛹() + { + Counter = null; + base.On髱樊エサ諤ァ蛹(); + } + + public override int On騾イ陦梧緒逕サ() + { + if (Texture == null || Counter == null) return base.On騾イ陦梧緒逕サ(); + if (!Counter.b蛛懈ュ「荳ュ) + { + Counter.t騾イ陦(); + if (Counter.b邨ゆコ蛟、縺ォ驕斐@縺) Counter.t蛛懈ュ「(); + int opacity = (((150 - Counter.n迴セ蝨ィ縺ョ蛟、) * 255) / 100); + Texture.Opacity = opacity; + Texture.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.nScrollFieldBGX[Player], TJAPlayer3.Skin.nScrollFieldY[Player]); + } + return base.On騾イ陦梧緒逕サ(); + } + + private CTexture Texture; + private CCounter Counter; + private int Player; + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/PuchiChara.cs b/TJAPlayer3/Stages/07.Game/Taiko/PuchiChara.cs new file mode 100644 index 00000000..334e4799 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/PuchiChara.cs @@ -0,0 +1,60 @@ +サソusing TJAPlayer3; +using FDK; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; + +namespace TJAPlayer3 +{ + class PuchiChara : CActivity + { + public PuchiChara() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + public override void On豢サ諤ァ蛹() + { + Counter = new CCounter(0, TJAPlayer3.Skin.Game_PuchiChara[2] - 1, TJAPlayer3.Skin.Game_PuchiChara_Timer, TJAPlayer3.Timer); + SineCounter = new CCounter(0, 360, TJAPlayer3.Skin.Game_PuchiChara_SineTimer, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + Counter = null; + SineCounter = null; + base.On髱樊エサ諤ァ蛹(); + } + + public void ChangeBPM(double bpm) + { + Counter = new CCounter(0, TJAPlayer3.Skin.Game_PuchiChara[2] - 1, (int)(TJAPlayer3.Skin.Game_PuchiChara_Timer * bpm / TJAPlayer3.Skin.Game_PuchiChara[2]), TJAPlayer3.Timer); + SineCounter = new CCounter(1, 360, TJAPlayer3.Skin.Game_PuchiChara_SineTimer * bpm / 180, CSound邂。逅.rc貍泌・冗畑繧ソ繧、繝); + } + + /// + /// 縺キ縺。繧ュ繝」繝ゥ繧呈緒逕サ縺吶k縲(繧ェ繝シ繝舌シ繝ゥ繧、繝峨§繧縺ェ縺繧) + /// + /// X蠎ァ讓(荳ュ螟ョ) + /// Y蠎ァ讓(荳ュ螟ョ) + /// 荳埼乗主コヲ + /// + public int On騾イ陦梧緒逕サ(int x, int y, bool isGrowing, int alpha = 255, bool isBalloon = false) + { + if (!TJAPlayer3.ConfigIni.ShowPuchiChara) return base.On騾イ陦梧緒逕サ(); + if (Counter == null || SineCounter == null || TJAPlayer3.Tx.PuchiChara == null) return base.On騾イ陦梧緒逕サ(); + Counter.t騾イ陦鍬oop(); + SineCounter.t騾イ陦鍬oopDb(); + var sineY = Math.Sin(SineCounter.n迴セ蝨ィ縺ョ蛟、 * (Math.PI / 180)) * (TJAPlayer3.Skin.Game_PuchiChara_Sine * (isBalloon ? TJAPlayer3.Skin.Game_PuchiChara_Scale[1] : TJAPlayer3.Skin.Game_PuchiChara_Scale[0])); + TJAPlayer3.Tx.PuchiChara.vc諡。螟ァ邵ョ蟆丞咲紫 = new SlimDX.Vector3((isBalloon ? TJAPlayer3.Skin.Game_PuchiChara_Scale[1] : TJAPlayer3.Skin.Game_PuchiChara_Scale[0])); + TJAPlayer3.Tx.PuchiChara.Opacity = alpha; + TJAPlayer3.Tx.PuchiChara.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x, y + (int)sineY, new Rectangle(Counter.n迴セ蝨ィ縺ョ蛟、 * TJAPlayer3.Skin.Game_PuchiChara[0], (isGrowing ? TJAPlayer3.Skin.Game_PuchiChara[1] : 0), TJAPlayer3.Skin.Game_PuchiChara[0], TJAPlayer3.Skin.Game_PuchiChara[1])); + return base.On騾イ陦梧緒逕サ(); + } + + private CCounter Counter; + private CCounter SineCounter; + } +} \ No newline at end of file diff --git a/TJAPlayer3/Stages/07.Game/Taiko/Rainbow.cs b/TJAPlayer3/Stages/07.Game/Taiko/Rainbow.cs new file mode 100644 index 00000000..60c0da4f --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/Rainbow.cs @@ -0,0 +1,168 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Runtime.InteropServices; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class Rainbow : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public Rainbow() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + public virtual void Start( int player ) + { + if (TJAPlayer3.Tx.Effects_Rainbow != null) + { + for (int i = 0; i < 2; i++) + { + if (!this.Rainbow1P[i].IsUsing && player == 0) + { + this.Rainbow1P[i].IsUsing = true; + this.Rainbow1P[i].Counter = new CCounter(0, 164, TJAPlayer3.Skin.Game_Effect_Rainbow_Timer, TJAPlayer3.Timer); // 繧ォ繧ヲ繝ウ繧ソ + this.Rainbow1P[i].Player = player; + break; + } + if (!this.Rainbow2P[i].IsUsing && player == 1) + { + this.Rainbow2P[i].IsUsing = true; + this.Rainbow2P[i].Counter = new CCounter(0, 164, TJAPlayer3.Skin.Game_Effect_Rainbow_Timer, TJAPlayer3.Timer); // 繧ォ繧ヲ繝ウ繧ソ + this.Rainbow2P[i].Player = player; + break; + } + } + } + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + for( int i = 0; i < 2; i++ ) + { + this.Rainbow1P[ i ].Counter = new CCounter(); + this.Rainbow2P[ i ].Counter = new CCounter(); + } + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + for( int i = 0; i < 2; i++ ) + { + this.Rainbow1P[ i ].Counter = null; + this.Rainbow2P[ i ].Counter = null; + } + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + for (int f = 0; f < 2; f++) + { + if (this.Rainbow1P[f].IsUsing) + { + this.Rainbow1P[f].Counter.t騾イ陦(); + if (this.Rainbow1P[f].Counter.b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.Rainbow1P[f].Counter.t蛛懈ュ「(); + this.Rainbow1P[f].IsUsing = false; + } + + if(TJAPlayer3.Tx.Effects_Rainbow != null && this.Rainbow1P[f].Player == 0 ) //逕サ蜒上′蜃コ譚・繧九∪縺ァ + { + //this.st陌ケ[f].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 = 164; + + if (this.Rainbow1P[f].Counter.n迴セ蝨ィ縺ョ蛟、 < 82) + { + int nRectX = ((this.Rainbow1P[f].Counter.n迴セ蝨ィ縺ョ蛟、 * 920) / 85); + TJAPlayer3.Tx.Effects_Rainbow.t2D謠冗判(TJAPlayer3.app.Device, 360, -100, new Rectangle(0, 0, nRectX, 410)); + } + else if (this.Rainbow1P[f].Counter.n迴セ蝨ィ縺ョ蛟、 >= 82) + { + int nRectX = (((this.Rainbow1P[f].Counter.n迴セ蝨ィ縺ョ蛟、 - 82) * 920) / 85); + TJAPlayer3.Tx.Effects_Rainbow.t2D謠冗判(TJAPlayer3.app.Device, 360 + nRectX, -100, new Rectangle(nRectX, 0, 920 - nRectX, 410)); + } + + } + + } + } + for (int f = 0; f < 2; f++) + { + if (this.Rainbow2P[f].IsUsing) + { + this.Rainbow2P[f].Counter.t騾イ陦(); + if (this.Rainbow2P[f].Counter.b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.Rainbow2P[f].Counter.t蛛懈ュ「(); + this.Rainbow2P[f].IsUsing = false; + } + + if(TJAPlayer3.Tx.Effects_Rainbow != null && this.Rainbow2P[f].Player == 1 ) //逕サ蜒上′蜃コ譚・繧九∪縺ァ + { + //this.st陌ケ[f].ct騾イ陦.n迴セ蝨ィ縺ョ蛟、 = 164; + + if (this.Rainbow2P[f].Counter.n迴セ蝨ィ縺ョ蛟、 < 82) + { + int nRectX = ((this.Rainbow2P[f].Counter.n迴セ蝨ィ縺ョ蛟、 * 920) / 85); + TJAPlayer3.Tx.Effects_Rainbow.t2D荳贋ク句渚霆「謠冗判(TJAPlayer3.app.Device, 360, 410, new Rectangle(0, 0, nRectX, 410)); + } + else if (this.Rainbow2P[f].Counter.n迴セ蝨ィ縺ョ蛟、 >= 82) + { + int nRectX = (((this.Rainbow2P[f].Counter.n迴セ蝨ィ縺ョ蛟、 - 82) * 920) / 85); + TJAPlayer3.Tx.Effects_Rainbow.t2D荳贋ク句渚霆「謠冗判(TJAPlayer3.app.Device, 360 + nRectX, 410, new Rectangle(nRectX, 0, 920 - nRectX, 410)); + } + + } + + } + } + } + return base.On騾イ陦梧緒逕サ(); + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + + [StructLayout(LayoutKind.Sequential)] + private struct StructRainbow + { + public bool IsUsing; + public int Player; + public CCounter Counter; + public float X; + } + + private StructRainbow[] Rainbow1P = new StructRainbow[2]; + private StructRainbow[] Rainbow2P = new StructRainbow[2]; + + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/07.Game/Taiko/TaikoLaneFlash.cs b/TJAPlayer3/Stages/07.Game/Taiko/TaikoLaneFlash.cs new file mode 100644 index 00000000..a9ae3682 --- /dev/null +++ b/TJAPlayer3/Stages/07.Game/Taiko/TaikoLaneFlash.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using FDK; +using static TJAPlayer3.PlayerLane; + +namespace TJAPlayer3 +{ + internal class TaikoLaneFlash : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public TaikoLaneFlash() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + public override void On豢サ諤ァ蛹() + { + PlayerLane = new PlayerLane[TJAPlayer3.ConfigIni.nPlayerCount]; + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + PlayerLane[i] = new PlayerLane(i); + } + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + PlayerLane[i] = null; + } + base.On髱樊エサ諤ァ蛹(); + } + + public override int On騾イ陦梧緒逕サ() + { + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + for (int j = 0; j < (int)FlashType.Total; j++) + { + PlayerLane[i].Flash[j].On騾イ陦梧緒逕サ(); + } + } + return base.On騾イ陦梧緒逕サ(); + } + + public PlayerLane[] PlayerLane; + + } + public class PlayerLane + { + public PlayerLane(int player) + { + Flash = new LaneFlash[(int)FlashType.Total]; + for (int i = 0; i < (int)FlashType.Total; i++) + { + switch (i) + { + case (int)FlashType.Red: + Flash[i] = new LaneFlash(ref TJAPlayer3.Tx.Lane_Red, player); + break; + case (int)FlashType.Blue: + Flash[i] = new LaneFlash(ref TJAPlayer3.Tx.Lane_Blue, player); + break; + case (int)FlashType.Hit: + Flash[i] = new LaneFlash(ref TJAPlayer3.Tx.Lane_Yellow, player); + break; + default: + break; + } + } + } + public void Start(FlashType flashType) + { + if (flashType == FlashType.Total) return; + Flash[(int)flashType].Start(); + } + + public LaneFlash[] Flash; + + public enum FlashType + { + Red, + Blue, + Hit, + Total + } + } +} diff --git a/TJAPlayer3/Stages/08.Result/CActResultImage.cs b/TJAPlayer3/Stages/08.Result/CActResultImage.cs new file mode 100644 index 00000000..422abe4b --- /dev/null +++ b/TJAPlayer3/Stages/08.Result/CActResultImage.cs @@ -0,0 +1,115 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using System.IO; +using System.Drawing; +using SlimDX; +using SlimDX.Direct3D9; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActResultImage : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + /// + /// 繝ェ繧カ繝ォ繝育判蜒上r陦ィ遉コ縺輔○繧九け繝ゥ繧ケ縲9G蛹悶☆繧九↓縺ゅ◆縺」縺ヲ蜍慕判縺ッ蟒豁「縲 + /// 縺セ縺溘∽クュ螟ョ縺ョ逕サ蜒上b陦ィ遉コ縺吶k縲(STAGE陦ィ遉コ縲ヾTANDARD_CLASSIC縺ェ縺ゥ) + /// + public CActResultImage() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // 繝。繧ス繝繝 + + public void t繧「繝九Γ繧貞ョ御コ縺輔○繧() + { + this.ct逋サ蝣エ逕ィ.n迴セ蝨ィ縺ョ蛟、 = (int)this.ct逋サ蝣エ逕ィ.n邨ゆコ蛟、; + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + if( this.ct逋サ蝣エ逕ィ != null ) + { + this.ct逋サ蝣エ逕ィ = null; + } + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override unsafe int On騾イ陦梧緒逕サ() + { + if( base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + return 0; + } + if( base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + this.ct逋サ蝣エ逕ィ = new CCounter( 0, 100, 5, TJAPlayer3.Timer ); + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + this.ct逋サ蝣エ逕ィ.t騾イ陦(); + + if( !this.ct逋サ蝣エ逕ィ.b邨ゆコ蛟、縺ォ驕斐@縺 ) + { + return 0; + } + return 1; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private CCounter ct逋サ蝣エ逕ィ; + private CTexture r陦ィ遉コ縺吶k繝ェ繧カ繝ォ繝育判蜒; + private CTexture tx繝ェ繧カ繝ォ繝育判蜒; + + private bool t繝励Ξ繝薙Η繝シ逕サ蜒上ョ謖螳壹′縺ゅl縺ー讒狗ッ峨☆繧() + { + if( string.IsNullOrEmpty( TJAPlayer3.DTX.PREIMAGE ) ) + { + return false; + } + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k( ref this.tx繝ェ繧カ繝ォ繝育判蜒 ); + this.r陦ィ遉コ縺吶k繝ェ繧カ繝ォ繝育判蜒 = null; + string path = TJAPlayer3.DTX.str繝輔か繝ォ繝蜷 + TJAPlayer3.DTX.PREIMAGE; + if( !File.Exists( path ) ) + { + Trace.TraceWarning( "繝輔ぃ繧、繝ォ縺悟ュ伜惠縺励∪縺帙s縲({0})", new object[] { path } ); + return false; + } + this.tx繝ェ繧カ繝ォ繝育判蜒 = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( path ); + this.r陦ィ遉コ縺吶k繝ェ繧カ繝ォ繝育判蜒 = this.tx繝ェ繧カ繝ォ繝育判蜒; + return ( this.r陦ィ遉コ縺吶k繝ェ繧カ繝ォ繝育判蜒 != null ); + } + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/08.Result/CActResultParameterPanel.cs b/TJAPlayer3/Stages/08.Result/CActResultParameterPanel.cs new file mode 100644 index 00000000..19bfdc6f --- /dev/null +++ b/TJAPlayer3/Stages/08.Result/CActResultParameterPanel.cs @@ -0,0 +1,856 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using System.IO; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActResultParameterPanel : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CActResultParameterPanel() + { + ST譁蟄嶺ス咲スョ[] st譁蟄嶺ス咲スョArray = new ST譁蟄嶺ス咲スョ[11]; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ.ch = '0'; + st譁蟄嶺ス咲スョ.pt = new Point(0, 0); + st譁蟄嶺ス咲スョArray[0] = st譁蟄嶺ス咲スョ; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ2 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ2.ch = '1'; + st譁蟄嶺ス咲スョ2.pt = new Point(32, 0); + st譁蟄嶺ス咲スョArray[1] = st譁蟄嶺ス咲スョ2; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ3 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ3.ch = '2'; + st譁蟄嶺ス咲スョ3.pt = new Point(64, 0); + st譁蟄嶺ス咲スョArray[2] = st譁蟄嶺ス咲スョ3; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ4 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ4.ch = '3'; + st譁蟄嶺ス咲スョ4.pt = new Point(96, 0); + st譁蟄嶺ス咲スョArray[3] = st譁蟄嶺ス咲スョ4; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ5 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ5.ch = '4'; + st譁蟄嶺ス咲スョ5.pt = new Point(128, 0); + st譁蟄嶺ス咲スョArray[4] = st譁蟄嶺ス咲スョ5; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ6 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ6.ch = '5'; + st譁蟄嶺ス咲スョ6.pt = new Point(160, 0); + st譁蟄嶺ス咲スョArray[5] = st譁蟄嶺ス咲スョ6; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ7 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ7.ch = '6'; + st譁蟄嶺ス咲スョ7.pt = new Point(192, 0); + st譁蟄嶺ス咲スョArray[6] = st譁蟄嶺ス咲スョ7; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ8 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ8.ch = '7'; + st譁蟄嶺ス咲スョ8.pt = new Point(224, 0); + st譁蟄嶺ス咲スョArray[7] = st譁蟄嶺ス咲スョ8; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ9 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ9.ch = '8'; + st譁蟄嶺ス咲スョ9.pt = new Point(256, 0); + st譁蟄嶺ス咲スョArray[8] = st譁蟄嶺ス咲スョ9; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ10 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ10.ch = '9'; + st譁蟄嶺ス咲スョ10.pt = new Point(288, 0); + st譁蟄嶺ス咲スョArray[9] = st譁蟄嶺ス咲スョ10; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ11 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ11.ch = ' '; + st譁蟄嶺ス咲スョ11.pt = new Point(0, 0); + st譁蟄嶺ス咲スョArray[10] = st譁蟄嶺ス咲スョ11; + this.st蟆乗枚蟄嶺ス咲スョ = st譁蟄嶺ス咲スョArray; + + ST譁蟄嶺ス咲スョ[] st譁蟄嶺ス咲スョArray2 = new ST譁蟄嶺ス咲スョ[11]; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ12 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ12.ch = '0'; + st譁蟄嶺ス咲スョ12.pt = new Point(0, 0); + st譁蟄嶺ス咲スョArray2[0] = st譁蟄嶺ス咲スョ12; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ13 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ13.ch = '1'; + st譁蟄嶺ス咲スョ13.pt = new Point(32, 0); + st譁蟄嶺ス咲スョArray2[1] = st譁蟄嶺ス咲スョ13; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ14 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ14.ch = '2'; + st譁蟄嶺ス咲スョ14.pt = new Point(64, 0); + st譁蟄嶺ス咲スョArray2[2] = st譁蟄嶺ス咲スョ14; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ15 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ15.ch = '3'; + st譁蟄嶺ス咲スョ15.pt = new Point(96, 0); + st譁蟄嶺ス咲スョArray2[3] = st譁蟄嶺ス咲スョ15; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ16 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ16.ch = '4'; + st譁蟄嶺ス咲スョ16.pt = new Point(128, 0); + st譁蟄嶺ス咲スョArray2[4] = st譁蟄嶺ス咲スョ16; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ17 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ17.ch = '5'; + st譁蟄嶺ス咲スョ17.pt = new Point(160, 0); + st譁蟄嶺ス咲スョArray2[5] = st譁蟄嶺ス咲スョ17; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ18 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ18.ch = '6'; + st譁蟄嶺ス咲スョ18.pt = new Point(192, 0); + st譁蟄嶺ス咲スョArray2[6] = st譁蟄嶺ス咲スョ18; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ19 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ19.ch = '7'; + st譁蟄嶺ス咲スョ19.pt = new Point(224, 0); + st譁蟄嶺ス咲スョArray2[7] = st譁蟄嶺ス咲スョ19; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ20 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ20.ch = '8'; + st譁蟄嶺ス咲スョ20.pt = new Point(256, 0); + st譁蟄嶺ス咲スョArray2[8] = st譁蟄嶺ス咲スョ20; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ21 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ21.ch = '9'; + st譁蟄嶺ス咲スョ21.pt = new Point(288, 0); + st譁蟄嶺ス咲スョArray2[9] = st譁蟄嶺ス咲スョ21; + ST譁蟄嶺ス咲スョ st譁蟄嶺ス咲スョ22 = new ST譁蟄嶺ス咲スョ(); + st譁蟄嶺ス咲スョ22.ch = '%'; + st譁蟄嶺ス咲スョ22.pt = new Point(0x37, 0); + st譁蟄嶺ス咲スョArray2[10] = st譁蟄嶺ス咲スョ22; + this.st螟ァ譁蟄嶺ス咲スョ = st譁蟄嶺ス咲スョArray2; + + ST譁蟄嶺ス咲スョ[] stScore譁蟄嶺ス咲スョArray = new ST譁蟄嶺ス咲スョ[10]; + ST譁蟄嶺ス咲スョ stScore譁蟄嶺ス咲スョ = new ST譁蟄嶺ス咲スョ(); + stScore譁蟄嶺ス咲スョ.ch = '0'; + stScore譁蟄嶺ス咲スョ.pt = new Point(0, 0); + stScore譁蟄嶺ス咲スョArray[0] = stScore譁蟄嶺ス咲スョ; + ST譁蟄嶺ス咲スョ stScore譁蟄嶺ス咲スョ2 = new ST譁蟄嶺ス咲スョ(); + stScore譁蟄嶺ス咲スョ2.ch = '1'; + stScore譁蟄嶺ス咲スョ2.pt = new Point(51, 0); + stScore譁蟄嶺ス咲スョArray[1] = stScore譁蟄嶺ス咲スョ2; + ST譁蟄嶺ス咲スョ stScore譁蟄嶺ス咲スョ3 = new ST譁蟄嶺ス咲スョ(); + stScore譁蟄嶺ス咲スョ3.ch = '2'; + stScore譁蟄嶺ス咲スョ3.pt = new Point(102, 0); + stScore譁蟄嶺ス咲スョArray[2] = stScore譁蟄嶺ス咲スョ3; + ST譁蟄嶺ス咲スョ stScore譁蟄嶺ス咲スョ4 = new ST譁蟄嶺ス咲スョ(); + stScore譁蟄嶺ス咲スョ4.ch = '3'; + stScore譁蟄嶺ス咲スョ4.pt = new Point(153, 0); + stScore譁蟄嶺ス咲スョArray[3] = stScore譁蟄嶺ス咲スョ4; + ST譁蟄嶺ス咲スョ stScore譁蟄嶺ス咲スョ5 = new ST譁蟄嶺ス咲スョ(); + stScore譁蟄嶺ス咲スョ5.ch = '4'; + stScore譁蟄嶺ス咲スョ5.pt = new Point(204, 0); + stScore譁蟄嶺ス咲スョArray[4] = stScore譁蟄嶺ス咲スョ5; + ST譁蟄嶺ス咲スョ stScore譁蟄嶺ス咲スョ6 = new ST譁蟄嶺ス咲スョ(); + stScore譁蟄嶺ス咲スョ6.ch = '5'; + stScore譁蟄嶺ス咲スョ6.pt = new Point(255, 0); + stScore譁蟄嶺ス咲スョArray[5] = stScore譁蟄嶺ス咲スョ6; + ST譁蟄嶺ス咲スョ stScore譁蟄嶺ス咲スョ7 = new ST譁蟄嶺ス咲スョ(); + stScore譁蟄嶺ス咲スョ7.ch = '6'; + stScore譁蟄嶺ス咲スョ7.pt = new Point(306, 0); + stScore譁蟄嶺ス咲スョArray[6] = stScore譁蟄嶺ス咲スョ7; + ST譁蟄嶺ス咲スョ stScore譁蟄嶺ス咲スョ8 = new ST譁蟄嶺ス咲スョ(); + stScore譁蟄嶺ス咲スョ8.ch = '7'; + stScore譁蟄嶺ス咲スョ8.pt = new Point(357, 0); + stScore譁蟄嶺ス咲スョArray[7] = stScore譁蟄嶺ス咲スョ8; + ST譁蟄嶺ス咲スョ stScore譁蟄嶺ス咲スョ9 = new ST譁蟄嶺ス咲スョ(); + stScore譁蟄嶺ス咲スョ9.ch = '8'; + stScore譁蟄嶺ス咲スョ9.pt = new Point(408, 0); + stScore譁蟄嶺ス咲スョArray[8] = stScore譁蟄嶺ス咲スョ9; + ST譁蟄嶺ス咲スョ stScore譁蟄嶺ス咲スョ10 = new ST譁蟄嶺ス咲スョ(); + stScore譁蟄嶺ス咲スョ10.ch = '9'; + stScore譁蟄嶺ス咲スョ10.pt = new Point(459, 0); + stScore譁蟄嶺ス咲スョArray[9] = stScore譁蟄嶺ス咲スョ10; + this.stScoreFont = stScore譁蟄嶺ス咲スョArray; + + + + this.ptFullCombo菴咲スョ = new Point[] { new Point(0x80, 0xed), new Point(0xdf, 0xed), new Point(0x141, 0xed) }; + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // 繝。繧ス繝繝 + + public void t繧「繝九Γ繧貞ョ御コ縺輔○繧() + { + this.ct陦ィ遉コ逕ィ.n迴セ蝨ィ縺ョ蛟、 = (int)this.ct陦ィ遉コ逕ィ.n邨ゆコ蛟、; + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + this.sdDTX縺ァ謖螳壹&繧後◆繝輔Ν繧ウ繝ウ繝憺浹 = null; + + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + if (this.ct陦ィ遉コ逕ィ != null) + { + this.ct陦ィ遉コ逕ィ = null; + } + + for(int i = 0; i < this.b髻ウ螢ー蜀咲函.Length; i++) + { + b髻ウ螢ー蜀咲函[i] = false; + } + + if (this.sdDTX縺ァ謖螳壹&繧後◆繝輔Ν繧ウ繝ウ繝憺浹 != null) + { + TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r遐エ譽縺吶k(this.sdDTX縺ァ謖螳壹&繧後◆繝輔Ν繧ウ繝ウ繝憺浹); + this.sdDTX縺ァ謖螳壹&繧後◆繝輔Ν繧ウ繝ウ繝憺浹 = null; + } + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + ct蜈ィ菴馴イ陦 = new CCounter(0, 20000, 1, TJAPlayer3.Timer); + + ct繧イ繝シ繧ク繧「繝九Γ = new CCounter(); + ct陌ケ繧イ繝シ繧ク繧「繝九Γ = new CCounter(); + + ctSoul = new CCounter(); + + ctEndAnime = new CCounter(); + ctBackgroundAnime = new CCounter(0, 1000, 1, TJAPlayer3.Timer); + ctBackgroundAnime_Clear = new CCounter(0, 1000, 1, TJAPlayer3.Timer); + ctMountain_ClearIn = new CCounter(); + + RandomText = TJAPlayer3.Random.Next(3); + + ctFlash_Icon = new CCounter(0, 3000, 1, TJAPlayer3.Timer); + ctRotate_Flowers = new CCounter(0, 1500, 1, TJAPlayer3.Timer); + ctShine_Plate = new CCounter(0, 1000, 1, TJAPlayer3.Timer); + + ctDonchan_Normal = new CCounter(0, TJAPlayer3.Tx.Result_Donchan_Normal.Length - 1, 1000 / 60, TJAPlayer3.Timer); + ctDonchan_Clear = new CCounter(); + ctDonchan_Failed = new CCounter(); + ctDonchan_Failed_In = new CCounter(); + + Dan_Plate = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(Path.GetDirectoryName(TJAPlayer3.DTX.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ) + @"\Dan_Plate.png"); + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + Dan_Plate?.Dispose(); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if (base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + return 0; + } + if (base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ) + { + this.ct陦ィ遉コ逕ィ = new CCounter(0, 0x3e7, 2, TJAPlayer3.Timer); + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + this.ct陦ィ遉コ逕ィ.t騾イ陦(); + + ct蜈ィ菴馴イ陦.t騾イ陦(); + ct繧イ繝シ繧ク繧「繝九Γ.t騾イ陦(); + + ctEndAnime.t騾イ陦(); + ctBackgroundAnime.t騾イ陦鍬oop(); + ctMountain_ClearIn.t騾イ陦(); + ctDonchan_Clear.t騾イ陦鍬oop(); + ctDonchan_Failed.t騾イ陦鍬oop(); + ctDonchan_Failed_In.t騾イ陦(); + ctDonchan_Normal.t騾イ陦鍬oop(); + + ctFlash_Icon.t騾イ陦鍬oop(); + ctRotate_Flowers.t騾イ陦鍬oop(); + ctShine_Plate.t騾イ陦鍬oop(); + + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Dan) + { + #region [ 騾壼クク譎ゅΜ繧カ繝ォ繝 ] + + int AnimeCount = 3000 + (int)ct繧イ繝シ繧ク繧「繝九Γ.n邨ゆコ蛟、 * 59; + int ScoreApparitionTimeStamp = AnimeCount + 420 * 4 + 840; + + TJAPlayer3.Tx.Result_Panel.t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + + TJAPlayer3.Tx.Result_Diff_Bar.t2D謠冗判(TJAPlayer3.app.Device, 18, 101, new RectangleF(0, TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] * 54, 185, 54)); + + TJAPlayer3.Tx.Result_Gauge_Base.t2D謠冗判(TJAPlayer3.app.Device, 55, 140); + + if (ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 >= 2000) + { + #region [ 繧イ繝シ繧ク髢「騾」 ] + + if (!b髻ウ螢ー蜀咲函[0]) + { + TJAPlayer3.Skin.soundGauge.t蜀咲函縺吶k(); + b髻ウ螢ー蜀咲函[0] = true; + } + + if (!ct繧イ繝シ繧ク繧「繝九Γ.b騾イ陦御クュ) + ct繧イ繝シ繧ク繧「繝九Γ.t髢句ァ(0, (int)TJAPlayer3.stage邨先棡.st貍泌・剰ィ倬鹸.Drums.f繧イ繝シ繧ク / 2, 59, TJAPlayer3.Timer); + + TJAPlayer3.Tx.Result_Gauge.t2D謠冗判(TJAPlayer3.app.Device, 57, 140, new RectangleF(0, 0, 9.74f * ct繧イ繝シ繧ク繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、, 36)); + + if (ct繧イ繝シ繧ク繧「繝九Γ.b邨ゆコ蛟、縺ォ驕斐@縺) + { + if(ct繧イ繝シ繧ク繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、 != 50) + TJAPlayer3.Skin.soundGauge.t蛛懈ュ「縺吶k(); + else + { + if (!TJAPlayer3.Skin.soundGauge.b蜀咲函荳ュ) + TJAPlayer3.Skin.soundGauge.t蛛懈ュ「縺吶k(); + + if (!ct陌ケ繧イ繝シ繧ク繧「繝九Γ.b騾イ陦御クュ) + ct陌ケ繧イ繝シ繧ク繧「繝九Γ.t髢句ァ(0, 40, 1000 / 60, TJAPlayer3.Timer); + + if (!ctSoul.b騾イ陦御クュ) + ctSoul.t髢句ァ(0, 8, 33, TJAPlayer3.Timer); + + ct陌ケ繧イ繝シ繧ク繧「繝九Γ.t騾イ陦鍬oop(); + ctSoul.t騾イ陦鍬oop(); + + TJAPlayer3.Tx.Result_Rainbow[ct陌ケ繧イ繝シ繧ク繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、].t2D謠冗判(TJAPlayer3.app.Device, 57, 144); + + TJAPlayer3.Tx.Result_Soul_Fire.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 576, 160, new Rectangle(150 * ctSoul.n迴セ蝨ィ縺ョ蛟、, 0, 150, 131)); + + TJAPlayer3.Tx.Result_Soul_Text.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 575, 159, new Rectangle(37 * 1, 0, 37, 37)); + + if (ctSoul.n迴セ蝨ィ縺ョ蛟、 % 2 == 0) + TJAPlayer3.Tx.Result_Soul_Text.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 575, 159, new Rectangle(37 * 2, 0, 37, 37)); + } + } + + #endregion + } + + if (ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 >= 2000) + { + #region [ 謌千クセ(繧ケ繧ウ繧「繧帝勁縺)髢「騾」 ] + + int Interval = 420; + + float AddCount = 135; + + if (ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 >= AnimeCount) + { + TJAPlayer3.Tx.Result_Number.vc諡。螟ァ邵ョ蟆丞咲紫.X = ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= AnimeCount + AddCount ? 1.3f - (float)Math.Sin((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - AnimeCount) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f; + TJAPlayer3.Tx.Result_Number.vc諡。螟ァ邵ョ蟆丞咲紫.Y = ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= AnimeCount + AddCount ? 1.3f - (float)Math.Sin((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - AnimeCount) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f; + this.t蟆乗枚蟄苓。ィ遉コ(TJAPlayer3.Skin.nResultNumberP1X, TJAPlayer3.Skin.nResultNumberY + TJAPlayer3.Skin.nResultNumberYPadding * 0, string.Format("{0,4:###0}", TJAPlayer3.stage邨先棡.st貍泌・剰ィ倬鹸.Drums.nPerfect謨ー.ToString())); + if (!this.b髻ウ螢ー蜀咲函[1]) + { + TJAPlayer3.Skin.soundPon.t蜀咲函縺吶k(); + this.b髻ウ螢ー蜀咲函[1] = true; + } + } + if (ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 >= AnimeCount + Interval) + { + TJAPlayer3.Tx.Result_Number.vc諡。螟ァ邵ョ蟆丞咲紫.X = ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= AnimeCount + Interval + AddCount ? 1.3f - (float)Math.Sin((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (AnimeCount + Interval)) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f; + TJAPlayer3.Tx.Result_Number.vc諡。螟ァ邵ョ蟆丞咲紫.Y = ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= AnimeCount + Interval + AddCount ? 1.3f - (float)Math.Sin((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (AnimeCount + Interval)) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f; + this.t蟆乗枚蟄苓。ィ遉コ(TJAPlayer3.Skin.nResultNumberP1X, TJAPlayer3.Skin.nResultNumberY + TJAPlayer3.Skin.nResultNumberYPadding * 1, string.Format("{0,4:###0}", TJAPlayer3.stage邨先棡.st貍泌・剰ィ倬鹸.Drums.nGreat謨ー.ToString())); + if (!this.b髻ウ螢ー蜀咲函[2]) + { + TJAPlayer3.Skin.soundPon.t蜀咲函縺吶k(); + this.b髻ウ螢ー蜀咲函[2] = true; + } + } + if (ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 >= AnimeCount + Interval * 2) + { + TJAPlayer3.Tx.Result_Number.vc諡。螟ァ邵ョ蟆丞咲紫.X = ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= AnimeCount + Interval * 2 + AddCount ? 1.3f - (float)Math.Sin((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (AnimeCount + Interval * 2)) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f; + TJAPlayer3.Tx.Result_Number.vc諡。螟ァ邵ョ蟆丞咲紫.Y = ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= AnimeCount + Interval * 2 + AddCount ? 1.3f - (float)Math.Sin((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (AnimeCount + Interval * 2)) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f; + this.t蟆乗枚蟄苓。ィ遉コ(TJAPlayer3.Skin.nResultNumberP1X, TJAPlayer3.Skin.nResultNumberY + TJAPlayer3.Skin.nResultNumberYPadding * 2, string.Format("{0,4:###0}", TJAPlayer3.stage邨先棡.st貍泌・剰ィ倬鹸.Drums.nMiss謨ー.ToString())); + if (!this.b髻ウ螢ー蜀咲函[3]) + { + TJAPlayer3.Skin.soundPon.t蜀咲函縺吶k(); + this.b髻ウ螢ー蜀咲函[3] = true; + } + } + if (ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 >= AnimeCount + Interval * 3) + { + TJAPlayer3.Tx.Result_Number.vc諡。螟ァ邵ョ蟆丞咲紫.X = ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= AnimeCount + Interval * 3 + AddCount ? 1.3f - (float)Math.Sin((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (AnimeCount + Interval * 3)) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f; + TJAPlayer3.Tx.Result_Number.vc諡。螟ァ邵ョ蟆丞咲紫.Y = ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= AnimeCount + Interval * 3 + AddCount ? 1.3f - (float)Math.Sin((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (AnimeCount + Interval * 3)) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f; + this.t蟆乗枚蟄苓。ィ遉コ(TJAPlayer3.Skin.nResultNumberP1X, TJAPlayer3.Skin.nResultNumberY + TJAPlayer3.Skin.nResultNumberYPadding * 3, string.Format("{0,4:###0}", TJAPlayer3.stage邨先棡.st貍泌・剰ィ倬鹸.Drums.n騾」謇捺焚.ToString())); + if (!this.b髻ウ螢ー蜀咲函[4]) + { + TJAPlayer3.Skin.soundPon.t蜀咲函縺吶k(); + this.b髻ウ螢ー蜀咲函[4] = true; + } + } + if (ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 >= AnimeCount + Interval * 4) + { + TJAPlayer3.Tx.Result_Number.vc諡。螟ァ邵ョ蟆丞咲紫.X = ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= AnimeCount + Interval * 4 + AddCount ? 1.3f - (float)Math.Sin((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (AnimeCount + Interval * 4)) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f; + TJAPlayer3.Tx.Result_Number.vc諡。螟ァ邵ョ蟆丞咲紫.Y = ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= AnimeCount + Interval * 4 + AddCount ? 1.3f - (float)Math.Sin((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (AnimeCount + Interval * 4)) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f; + this.t蟆乗枚蟄苓。ィ遉コ(TJAPlayer3.Skin.nResultNumberP1X, TJAPlayer3.Skin.nResultNumberY + TJAPlayer3.Skin.nResultNumberYPadding * 4, string.Format("{0,4:###0}", TJAPlayer3.stage邨先棡.st貍泌・剰ィ倬鹸.Drums.n譛螟ァ繧ウ繝ウ繝懈焚.ToString())); + if (!this.b髻ウ螢ー蜀咲函[5]) + { + TJAPlayer3.Skin.soundPon.t蜀咲函縺吶k(); + this.b髻ウ螢ー蜀咲函[5] = true; + } + } + + #endregion + + #region [ 繧ケ繧ウ繧「髢「騾」 ] + + if (ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 >= AnimeCount + Interval * 4 + 840) + { + int AnimeCount1 = AnimeCount + Interval * 4 + 840; + + TJAPlayer3.Tx.Result_Score_Number.vc諡。螟ァ邵ョ蟆丞咲紫.X = ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= AnimeCount1 + 270 ? 1.0f + (float)Math.Sin((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - AnimeCount1) / 1.5f * (Math.PI / 180)) * 0.65f : + ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= AnimeCount1 + 360 ? 1.0f - (float)Math.Sin((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - AnimeCount1 - 270) * (Math.PI / 180)) * 0.1f : 1.0f; + TJAPlayer3.Tx.Result_Score_Number.vc諡。螟ァ邵ョ蟆丞咲紫.Y = ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= AnimeCount1 + 270 ? 1.0f + (float)Math.Sin((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - AnimeCount1) / 1.5f * (Math.PI / 180)) * 0.65f : + ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= AnimeCount1 + 360 ? 1.0f - (float)Math.Sin((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - AnimeCount1 - 270) * (Math.PI / 180)) * 0.1f : 1.0f; + + this.t繧ケ繧ウ繧「譁蟄苓。ィ遉コ(TJAPlayer3.Skin.nResultScoreP1X, TJAPlayer3.Skin.nResultScoreP1Y, string.Format("{0,7:######0}", TJAPlayer3.stage邨先棡.st貍泌・剰ィ倬鹸.Drums.n繧ケ繧ウ繧「)); + + if (!b髻ウ螢ー蜀咲函[6]) + { + TJAPlayer3.Skin.soundScoreDon.t蜀咲函縺吶k(); + b髻ウ螢ー蜀咲函[6] = true; + } + } + + #endregion + } + + + + if (ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 >= ScoreApparitionTimeStamp + 1000) + { + #region [Score rank apparition] + + if (ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= ScoreApparitionTimeStamp + 1180) + for (int i = 0; i < 3; i++) + { + TJAPlayer3.Tx.Result_ScoreRankEffect.Opacity = (int)((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (ScoreApparitionTimeStamp + 1000)) / 180.0f * 255.0f); + TJAPlayer3.Tx.Result_ScoreRankEffect.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f + (float)Math.Sin((float)(ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (ScoreApparitionTimeStamp + 910)) / 1.5f * (Math.PI / 180)) * 1.4f; + TJAPlayer3.Tx.Result_ScoreRankEffect.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f + (float)Math.Sin((float)(ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (ScoreApparitionTimeStamp + 910)) / 1.5f * (Math.PI / 180)) * 1.4f; + } + else if (ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= ScoreApparitionTimeStamp + 1270) + for (int i = 0; i < 3; i++) + { + TJAPlayer3.Tx.Result_ScoreRankEffect.vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.5f + (float)Math.Sin((float)(ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (ScoreApparitionTimeStamp + 1180)) * (Math.PI / 180)) * 0.5f; + TJAPlayer3.Tx.Result_ScoreRankEffect.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.5f + (float)Math.Sin((float)(ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (ScoreApparitionTimeStamp + 1180)) * (Math.PI / 180)) * 0.5f; + } + + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Dan && TJAPlayer3.stage邨先棡.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ > 0) + { + int CurrentFlash = 0; + int[] FlashTimes = { 1500, 1540, 1580, 1620, 1660, 1700, 1740, 1780 }; + + if (ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 >= FlashTimes[0] && ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 <= FlashTimes[1] || ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 >= FlashTimes[4] && ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 <= FlashTimes[5]) + CurrentFlash = 1; + else if (ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 >= FlashTimes[1] && ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 <= FlashTimes[2] || ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 >= FlashTimes[5] && ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 <= FlashTimes[6]) + CurrentFlash = 2; + else if (ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 >= FlashTimes[2] && ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 <= FlashTimes[3] || ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 >= FlashTimes[6] && ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 <= FlashTimes[7]) + CurrentFlash = 3; + + + TJAPlayer3.Tx.Result_ScoreRankEffect.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 135, 339, new Rectangle((TJAPlayer3.stage邨先棡.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ - 1) * 229, CurrentFlash * 194, 229, 194)); + + if (!b髻ウ螢ー蜀咲函[7] && ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 >= ScoreApparitionTimeStamp + 1180) + { + TJAPlayer3.Skin.soundRankIn.t蜀咲函縺吶k(); + b髻ウ螢ー蜀咲函[7] = true; + } + } + + #endregion + } + + + if (ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 >= ScoreApparitionTimeStamp + 2500) + { + #region [Crown apparition] + + if (ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= ScoreApparitionTimeStamp + 2680) + for (int i = 0; i < 3; i++) + { + TJAPlayer3.Tx.Result_CrownEffect.Opacity = (int)((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (ScoreApparitionTimeStamp + 2500)) / 180.0f * 255.0f); + TJAPlayer3.Tx.Result_CrownEffect.vc諡。螟ァ邵ョ蟆丞咲紫.X = 1.0f + (float)Math.Sin((float)(ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (ScoreApparitionTimeStamp + 2410)) / 1.5f * (Math.PI / 180)) * 1.4f; + TJAPlayer3.Tx.Result_CrownEffect.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f + (float)Math.Sin((float)(ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (ScoreApparitionTimeStamp + 2410)) / 1.5f * (Math.PI / 180)) * 1.4f; + } + else if (ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= ScoreApparitionTimeStamp + 2770) + for (int i = 0; i < 3; i++) + { + TJAPlayer3.Tx.Result_CrownEffect.vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.5f + (float)Math.Sin((float)(ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (ScoreApparitionTimeStamp + 2680)) * (Math.PI / 180)) * 0.5f; + TJAPlayer3.Tx.Result_CrownEffect.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.5f + (float)Math.Sin((float)(ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (ScoreApparitionTimeStamp + 2680)) * (Math.PI / 180)) * 0.5f; + } + + int ClearType = TJAPlayer3.stage邨先棡.n繧ッ繝ェ繧「 - 1; + + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)(Difficulty.Dan) && ClearType >= 0) + { + int CurrentFlash = 0; + int[] FlashTimes = { 2000, 2040, 2080, 2120, 2160, 2200, 2240, 2280 }; + + if (ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 >= FlashTimes[0] && ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 <= FlashTimes[1] || ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 >= FlashTimes[4] && ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 <= FlashTimes[5]) + CurrentFlash = 1; + else if (ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 >= FlashTimes[1] && ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 <= FlashTimes[2] || ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 >= FlashTimes[5] && ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 <= FlashTimes[6]) + CurrentFlash = 2; + else if (ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 >= FlashTimes[2] && ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 <= FlashTimes[3] || ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 >= FlashTimes[6] && ctFlash_Icon.n迴セ蝨ィ縺ョ蛟、 <= FlashTimes[7]) + CurrentFlash = 3; + + TJAPlayer3.Tx.Result_CrownEffect.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 262, 336, new Rectangle(ClearType * 113, CurrentFlash * 112, 113, 112)); + + if (!b髻ウ螢ー蜀咲函[8] && ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 >= ScoreApparitionTimeStamp + 2680) + { + TJAPlayer3.Skin.soundCrownIn.t蜀咲函縺吶k(); + b髻ウ螢ー蜀咲函[8] = true; + } + } + + #endregion + } + + float MountainAppearValue = 2000 + (ct繧イ繝シ繧ク繧「繝九Γ.n邨ゆコ蛟、 * 66) + 8360 - 85; + + if (ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 >= MountainAppearValue) + { + #region [Mountain animation counter setup] + + if (!this.ctMountain_ClearIn.b騾イ陦御クュ) + this.ctMountain_ClearIn.t髢句ァ(0, 515, 3, TJAPlayer3.Timer); + + if (TJAPlayer3.stage邨先棡.st貍泌・剰ィ倬鹸[0].f繧イ繝シ繧ク >= 80.0f) + { + if (!this.ctDonchan_Clear.b騾イ陦御クュ) + this.ctDonchan_Clear.t髢句ァ(0, TJAPlayer3.Tx.Result_Donchan_Clear.Length - 1, 1000 / 60, TJAPlayer3.Timer); + } + else + { + if (!this.ctDonchan_Failed_In.b騾イ陦御クュ) + this.ctDonchan_Failed_In.t髢句ァ(0, TJAPlayer3.Tx.Result_Donchan_Failed_In.Length - 1, 1000 / 60, TJAPlayer3.Timer); + else if (this.ctDonchan_Failed_In.b邨ゆコ蛟、縺ォ驕斐@縺 && !this.ctDonchan_Failed.b騾イ陦御クュ) + this.ctDonchan_Failed.t髢句ァ(0, TJAPlayer3.Tx.Result_Donchan_Failed.Length - 1, 1000 / 60, TJAPlayer3.Timer); + } + + + #endregion + + /* TO DO */ + + // Reset counter for clouds + + // Random seed for fireworks + + // Random seed for shines + + // Alter Mountain appear value/Crown appear value if no Score Rank/no Crown + } + + #region [Don-chan Animations] + + if (this.ctDonchan_Clear.b騾イ陦御クュ) + { + TJAPlayer3.Tx.Result_Donchan_Clear[ctDonchan_Clear.n迴セ蝨ィ縺ョ蛟、].vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.8f; + TJAPlayer3.Tx.Result_Donchan_Clear[ctDonchan_Clear.n迴セ蝨ィ縺ョ蛟、].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.8f; + + TJAPlayer3.Tx.Result_Donchan_Clear[ctDonchan_Clear.n迴セ蝨ィ縺ョ蛟、].t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 202, 532); + } + else if (this.ctDonchan_Failed.b騾イ陦御クュ) + { + TJAPlayer3.Tx.Result_Donchan_Failed[ctDonchan_Failed.n迴セ蝨ィ縺ョ蛟、].vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.8f; + TJAPlayer3.Tx.Result_Donchan_Failed[ctDonchan_Failed.n迴セ蝨ィ縺ョ蛟、].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.8f; + + TJAPlayer3.Tx.Result_Donchan_Failed[ctDonchan_Failed.n迴セ蝨ィ縺ョ蛟、].t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 202, 532); + } + else if (this.ctDonchan_Failed_In.b騾イ陦御クュ) + { + TJAPlayer3.Tx.Result_Donchan_Failed_In[ctDonchan_Failed_In.n迴セ蝨ィ縺ョ蛟、].vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.8f; + TJAPlayer3.Tx.Result_Donchan_Failed_In[ctDonchan_Failed_In.n迴セ蝨ィ縺ョ蛟、].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.8f; + + TJAPlayer3.Tx.Result_Donchan_Failed_In[ctDonchan_Failed_In.n迴セ蝨ィ縺ョ蛟、].t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 202, 532); + } + else + { + TJAPlayer3.Tx.Result_Donchan_Normal[ctDonchan_Normal.n迴セ蝨ィ縺ョ蛟、].vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.8f; + TJAPlayer3.Tx.Result_Donchan_Normal[ctDonchan_Normal.n迴セ蝨ィ縺ョ蛟、].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.8f; + + TJAPlayer3.Tx.Result_Donchan_Normal[ctDonchan_Normal.n迴セ蝨ィ縺ョ蛟、].t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 202, 532); + } + + #endregion + + if (ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 >= MountainAppearValue) + { + float AddCount = 135; + + int baseX = 182; + int baseY = 602; + + #region [Cherry blossom animation] + + if (TJAPlayer3.stage邨先棡.st貍泌・剰ィ倬鹸[0].f繧イ繝シ繧ク >= 80.0f) + { + TJAPlayer3.Tx.Result_Flower.vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.6f * (ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= MountainAppearValue + AddCount ? 1.3f - (float)Math.Sin((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - MountainAppearValue) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f); + TJAPlayer3.Tx.Result_Flower.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.6f * (ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= MountainAppearValue + AddCount ? 1.3f - (float)Math.Sin((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - MountainAppearValue) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f); + TJAPlayer3.Tx.Result_Flower.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, baseX, baseY, new Rectangle(0, 0, 520, 195)); + } + + #endregion + + #region [Cherry blossom Rotating flowers] + + if (TJAPlayer3.stage邨先棡.st貍泌・剰ィ倬鹸[0].f繧イ繝シ繧ク >= 80.0f) + { + float FlowerTime = ctRotate_Flowers.n迴セ蝨ィ縺ョ蛟、; + + for (int i = 0; i < 5; i++) + { + + if ((int)FlowerTime < ApparitionTimeStamps[i] || (int)FlowerTime > ApparitionTimeStamps[i] + 2 * ApparitionFade + ApparitionDuration) + TJAPlayer3.Tx.Result_Flower_Rotate[i].Opacity = 0; + else if ((int)FlowerTime <= ApparitionTimeStamps[i] + ApparitionDuration + ApparitionFade && (int)FlowerTime >= ApparitionTimeStamps[i] + ApparitionFade) + TJAPlayer3.Tx.Result_Flower_Rotate[i].Opacity = 255; + else + { + int CurrentGradiant = 0; + if ((int)FlowerTime >= ApparitionTimeStamps[i] + ApparitionFade + ApparitionDuration) + CurrentGradiant = ApparitionFade - ((int)FlowerTime - ApparitionTimeStamps[i] - ApparitionDuration - ApparitionFade); + else + CurrentGradiant = (int)FlowerTime - ApparitionTimeStamps[i]; + + + TJAPlayer3.Tx.Result_Flower_Rotate[i].Opacity = (255 * CurrentGradiant) / ApparitionFade; + } + + TJAPlayer3.Tx.Result_Flower_Rotate[i].vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.6f; + TJAPlayer3.Tx.Result_Flower_Rotate[i].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.6f; + TJAPlayer3.Tx.Result_Flower_Rotate[i].fZ霆ク荳ュ蠢蝗櫁サ「 = (float)(FlowerTime - ApparitionTimeStamps[i]) / (FlowerRotationSpeeds[i] * 360f); + + TJAPlayer3.Tx.Result_Flower_Rotate[i].t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, baseX + FlowerXPos[i] - 20, baseY + FlowerYPos[i] - 20); + } + + } + + #endregion + + #region [Panel shines] + + if (TJAPlayer3.stage邨先棡.st貍泌・剰ィ倬鹸[0].f繧イ繝シ繧ク >= 80.0f) + { + int ShineTime = (int)ctShine_Plate.n迴セ蝨ィ縺ョ蛟、; + int Quadrant500 = ShineTime % 500; + + for (int i = 0; i < 6; i++) + { + if (i < 3 && ShineTime >= 500 || i >= 3 && ShineTime < 500) + TJAPlayer3.Tx.Result_Shine.Opacity = 0; + else if (Quadrant500 >= ShinePFade && Quadrant500 <= 500 - ShinePFade) + TJAPlayer3.Tx.Result_Shine.Opacity = 255; + else + TJAPlayer3.Tx.Result_Shine.Opacity = (255 * Math.Min(Quadrant500, 500 - Quadrant500)) / ShinePFade; + + TJAPlayer3.Tx.Result_Shine.vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.15f; + TJAPlayer3.Tx.Result_Shine.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.15f; + + TJAPlayer3.Tx.Result_Shine.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, baseX + ShinePXPos[i] + 62, baseY + ShinePYPos[i] + 52); + } + + } + + + #endregion + + #region [Speech bubble animation] + // Speech Bubble + + int Mood = 0; + + if (TJAPlayer3.stage邨先棡.st貍泌・剰ィ倬鹸[0].f繧イ繝シ繧ク >= 100.0f) + Mood = 3; + else if (TJAPlayer3.stage邨先棡.st貍泌・剰ィ倬鹸[0].f繧イ繝シ繧ク >= 80.0f) + Mood = 2; + else if (TJAPlayer3.stage邨先棡.st貍泌・剰ィ倬鹸[0].f繧イ繝シ繧ク >= 40.0f) + Mood = 1; + + + TJAPlayer3.Tx.Result_Speech_Bubble.vc諡。螟ァ邵ョ蟆丞咲紫.X = ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= MountainAppearValue + AddCount ? 1.3f - (float)Math.Sin((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - MountainAppearValue) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f; + TJAPlayer3.Tx.Result_Speech_Bubble.vc諡。螟ァ邵ョ蟆丞咲紫.Y = ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 <= MountainAppearValue + AddCount ? 1.3f - (float)Math.Sin((ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - MountainAppearValue) / (AddCount / 90) * (Math.PI / 180)) * 0.3f : 1.0f; + TJAPlayer3.Tx.Result_Speech_Bubble.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 430, 526, new Rectangle(Mood * 358, RandomText * 230, 358, 230)); + + if (!b髻ウ螢ー蜀咲函[9]) + { + if (TJAPlayer3.stage邨先棡.st貍泌・剰ィ倬鹸[0].f繧イ繝シ繧ク >= 80.0f) + TJAPlayer3.Skin.soundDonClear.t蜀咲函縺吶k(); + else + TJAPlayer3.Skin.soundDonFailed.t蜀咲函縺吶k(); + b髻ウ螢ー蜀咲函[9] = true; + } + + #endregion + } + + + if (ct繧イ繝シ繧ク繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、 != 50) + { + TJAPlayer3.Tx.Result_Gauge.t2D謠冗判(TJAPlayer3.app.Device, 441, 142, new RectangleF(ct繧イ繝シ繧ク繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、 < 40 ? 0 : 42, 35, 42, 20)); + + TJAPlayer3.Tx.Result_Soul_Text.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, 575, 159, new Rectangle(37 * (ct繧イ繝シ繧ク繧「繝九Γ.n迴セ蝨ィ縺ョ蛟、 <= 30 ? 0 : 1), 0, 37, 37)); + } + + #endregion + } + else + { + #region 谿オ菴肴凾繝ェ繧カ繝ォ繝 + + switch (TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actDan.GetExamStatus(TJAPlayer3.stage邨先棡.st貍泌・剰ィ倬鹸.Drums.Dan_C)) + { + case Exam.Status.Failure: + TJAPlayer3.Tx.Result_Dan?.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Result_Dan_XY[0], TJAPlayer3.Skin.Result_Dan_XY[1], new Rectangle(0, 0, TJAPlayer3.Skin.Result_Dan[0], TJAPlayer3.Skin.Result_Dan[1])); + break; + case Exam.Status.Success: + TJAPlayer3.Tx.Result_Dan?.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Result_Dan_XY[0], TJAPlayer3.Skin.Result_Dan_XY[1], new Rectangle(TJAPlayer3.Skin.Result_Dan[0], 0, TJAPlayer3.Skin.Result_Dan[0], TJAPlayer3.Skin.Result_Dan[1])); + break; + case Exam.Status.Better_Success: + TJAPlayer3.Tx.Result_Dan?.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Result_Dan_XY[0], TJAPlayer3.Skin.Result_Dan_XY[1], new Rectangle(TJAPlayer3.Skin.Result_Dan[0] * 2, 0, TJAPlayer3.Skin.Result_Dan[0], TJAPlayer3.Skin.Result_Dan[1])); + break; + default: + break; + } + + Dan_Plate?.t2D荳ュ蠢蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, TJAPlayer3.Skin.Result_Dan_Plate_XY[0], TJAPlayer3.Skin.Result_Dan_Plate_XY[1]); + + #endregion + } + + if (!this.ct陦ィ遉コ逕ィ.b邨ゆコ蛟、縺ォ驕斐@縺) + { + return 0; + } + return 1; + } + + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + [StructLayout(LayoutKind.Sequential)] + private struct ST譁蟄嶺ス咲スョ + { + public char ch; + public Point pt; + } + + public CCounter ct蜈ィ菴馴イ陦; + public CCounter ct繧イ繝シ繧ク繧「繝九Γ; + private CCounter ct陌ケ繧イ繝シ繧ク繧「繝九Γ; + private CCounter ctSoul; + + public CCounter ctEndAnime; + public CCounter ctMountain_ClearIn; + public CCounter ctBackgroundAnime; + public CCounter ctBackgroundAnime_Clear; + private CCounter ctDonchan_Normal; + private CCounter ctDonchan_Clear; + private CCounter ctDonchan_Failed; + private CCounter ctDonchan_Failed_In; + + private int RandomText; + + private CCounter ctFlash_Icon; + private CCounter ctRotate_Flowers; + private CCounter ctShine_Plate; + + public bool[] b髻ウ螢ー蜀咲函 = { false, false, false, false, false, false, false, false, false, false, false, false, false }; + + // Cherry blossom flowers variables + public int[] FlowerXPos = { -114, -37, 114, 78, -75 }; + public int[] FlowerYPos = { -33, 3, -36, -81, -73 }; + public float[] FlowerRotationSpeeds = { 5f, 3f, -6f, 4f, -2f }; + public int[] ApparitionTimeStamps = { 10, 30, 50, 100, 190 }; + public int ApparitionFade = 100; + public int ApparitionDuration = 300; + + // Plate shine variables + public int[] ShinePXPos = { 114 - 25, 114 - 16, -37 - 23, -37 - 9, -75 + 20, 78 - 13}; + public int[] ShinePYPos = { -36 + 52, -36 + 2, 3 - 7, 3 + 30, -73 - 23, -81 - 31}; + public int ShinePFade = 100; + + private CCounter ct陦ィ遉コ逕ィ; + private readonly Point[] ptFullCombo菴咲スョ; + private CSound sdDTX縺ァ謖螳壹&繧後◆繝輔Ν繧ウ繝ウ繝憺浹; + private readonly ST譁蟄嶺ス咲スョ[] st蟆乗枚蟄嶺ス咲スョ; + private readonly ST譁蟄嶺ス咲スョ[] st螟ァ譁蟄嶺ス咲スョ; + private ST譁蟄嶺ス咲スョ[] stScoreFont; + + private CTexture Dan_Plate; + + private void t蟆乗枚蟄苓。ィ遉コ(int x, int y, string str) + { + foreach (char ch in str) + { + for (int i = 0; i < this.st蟆乗枚蟄嶺ス咲スョ.Length; i++) + { + if (ch == ' ') + { + break; + } + + if (this.st蟆乗枚蟄嶺ス咲スョ[i].ch == ch) + { + Rectangle rectangle = new Rectangle(this.st蟆乗枚蟄嶺ス咲スョ[i].pt.X, this.st蟆乗枚蟄嶺ス咲スョ[i].pt.Y, 32, 38); + if (TJAPlayer3.Tx.Result_Number != null) + { + TJAPlayer3.Tx.Result_Number.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x + 16, y + 19, rectangle); + } + break; + } + } + x += 22; + } + } + private void t螟ァ譁蟄苓。ィ遉コ(int x, int y, string str) + { + this.t螟ァ譁蟄苓。ィ遉コ(x, y, str, false); + } + private void t螟ァ譁蟄苓。ィ遉コ(int x, int y, string str, bool b蠑キ隱ソ) + { + foreach (char ch in str) + { + for (int i = 0; i < this.st螟ァ譁蟄嶺ス咲スョ.Length; i++) + { + if (this.st螟ァ譁蟄嶺ス咲スョ[i].ch == ch) + { + Rectangle rectangle = new Rectangle(this.st螟ァ譁蟄嶺ス咲スョ[i].pt.X, this.st螟ァ譁蟄嶺ス咲スョ[i].pt.Y, 11, 0x10); + if (ch == '.') + { + rectangle.Width -= 2; + rectangle.Height -= 2; + } + if (TJAPlayer3.Tx.Result_Number != null) + { + TJAPlayer3.Tx.Result_Number.t2D謠冗判(TJAPlayer3.app.Device, x, y, rectangle); + } + break; + } + } + x += 8; + } + } + + protected void t繧ケ繧ウ繧「譁蟄苓。ィ遉コ(int x, int y, string str) + { + foreach (char ch in str) + { + for (int i = 0; i < this.stScoreFont.Length; i++) + { + if (this.stScoreFont[i].ch == ch) + { + Rectangle rectangle = new Rectangle(this.stScoreFont[i].pt.X, 0, 51, 60); + if (TJAPlayer3.Tx.Result_Score_Number != null) + { + TJAPlayer3.Tx.Result_Score_Number.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x - (str.Length * 33) + 25, y + 30, rectangle); + } + break; + } + } + x += 33; + } + } + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/08.Result/CActResultRank.cs b/TJAPlayer3/Stages/08.Result/CActResultRank.cs new file mode 100644 index 00000000..45c94a7d --- /dev/null +++ b/TJAPlayer3/Stages/08.Result/CActResultRank.cs @@ -0,0 +1,69 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActResultRank : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CActResultRank() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + return 0; + } + if( base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + + return 1; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/08.Result/CActResultSongBar.cs b/TJAPlayer3/Stages/08.Result/CActResultSongBar.cs new file mode 100644 index 00000000..75f183bd --- /dev/null +++ b/TJAPlayer3/Stages/08.Result/CActResultSongBar.cs @@ -0,0 +1,130 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Diagnostics; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActResultSongBar : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CActResultSongBar() + { + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // 繝。繧ス繝繝 + + public void t繧「繝九Γ繧貞ョ御コ縺輔○繧() + { + this.ct逋サ蝣エ逕ィ.n迴セ蝨ィ縺ョ蛟、 = (int)this.ct逋サ蝣エ逕ィ.n邨ゆコ蛟、; + } + + + // CActivity 螳溯」 + + public override void On豢サ諤ァ蛹() + { + if( !string.IsNullOrEmpty( TJAPlayer3.ConfigIni.FontName) ) + { + this.pfMusicName = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), TJAPlayer3.Skin.Result_MusicName_FontSize); + } + else + { + this.pfMusicName = new CPrivateFastFont(new FontFamily("MS UI Gothic"), TJAPlayer3.Skin.Result_MusicName_FontSize); + } + + // After performing calibration, inform the player that + // calibration has been completed, rather than + // displaying the song title as usual. + + + var title = TJAPlayer3.IsPerformingCalibration + ? $"Calibration complete. InputAdjustTime is now {TJAPlayer3.ConfigIni.nInputAdjustTimeMs}ms" + : TJAPlayer3.DTX.TITLE; + + using (var bmpSongTitle = pfMusicName.DrawPrivateFont(title, TJAPlayer3.Skin.Result_MusicName_ForeColor, TJAPlayer3.Skin.Result_MusicName_BackColor)) + + { + this.txMusicName = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(bmpSongTitle, false); + txMusicName.vc諡。螟ァ邵ョ蟆丞咲紫.X = TJAPlayer3.GetSongNameXScaling(ref txMusicName); + } + + base.On豢サ諤ァ蛹(); + } + public override void On髱樊エサ諤ァ蛹() + { + if( this.ct逋サ蝣エ逕ィ != null ) + { + this.ct逋サ蝣エ逕ィ = null; + } + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + TJAPlayer3.t螳牙ィ縺ォDispose縺吶k(ref this.pfMusicName); + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.txMusicName ); + + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + return 0; + } + if( base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + this.ct逋サ蝣エ逕ィ = new CCounter( 0, 270, 4, TJAPlayer3.Timer ); + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + this.ct逋サ蝣エ逕ィ.t騾イ陦(); + + if (TJAPlayer3.Skin.Result_MusicName_ReferencePoint == CSkin.ReferencePoint.Center) + { + this.txMusicName.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Result_MusicName_X - ((this.txMusicName.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width * txMusicName.vc諡。螟ァ邵ョ蟆丞咲紫.X) / 2), TJAPlayer3.Skin.Result_MusicName_Y); + } + else if (TJAPlayer3.Skin.Result_MusicName_ReferencePoint == CSkin.ReferencePoint.Left) + { + this.txMusicName.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Result_MusicName_X, TJAPlayer3.Skin.Result_MusicName_Y); + } + else + { + this.txMusicName.t2D謠冗判(TJAPlayer3.app.Device, TJAPlayer3.Skin.Result_MusicName_X - this.txMusicName.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width * txMusicName.vc諡。螟ァ邵ョ蟆丞咲紫.X, TJAPlayer3.Skin.Result_MusicName_Y); + } + + if( !this.ct逋サ蝣エ逕ィ.b邨ゆコ蛟、縺ォ驕斐@縺 ) + { + return 0; + } + return 1; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private CCounter ct逋サ蝣エ逕ィ; + + private CTexture txMusicName; + private CPrivateFastFont pfMusicName; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/08.Result/CStage邨先棡.cs b/TJAPlayer3/Stages/08.Result/CStage邨先棡.cs new file mode 100644 index 00000000..1f8dcb21 --- /dev/null +++ b/TJAPlayer3/Stages/08.Result/CStage邨先棡.cs @@ -0,0 +1,661 @@ +サソusing System; +using System.IO; +using System.Diagnostics; +using FDK; +using System.Drawing; +using System.Collections.Generic; + +namespace TJAPlayer3 +{ + internal class CStage邨先棡 : CStage + { + // 繝励Ο繝代ユ繧」 + + public STDGBVALUE b譁ー險倬鹸繧ケ繧ュ繝ォ; + public STDGBVALUE b譁ー險倬鹸繧ケ繧ウ繧「; + public STDGBVALUE b譁ー險倬鹸繝ゥ繝ウ繧ッ; + public STDGBVALUE fPerfect邇; + public STDGBVALUE fGreat邇; + public STDGBVALUE fGood邇; + public STDGBVALUE fPoor邇; + public STDGBVALUE fMiss邇; + public STDGBVALUE b繧ェ繝シ繝; // #23596 10.11.16 add ikanick + // 10.11.17 change (int to bool) ikanick + + public STDGBVALUE n繝ゥ繝ウ繧ッ蛟、; + public STDGBVALUE n貍泌・丞屓謨ー; + public STDGBVALUE nScoreRank; + public int n邱丞粋繝ゥ繝ウ繧ッ蛟、; + public int n繧ッ繝ェ繧「; //0:譛ェ繧ッ繝ェ繧「 1:繧ッ繝ェ繧「 2:繝輔Ν繧ウ繝ウ繝 3:繝峨Φ繝繝輔Ν繧ウ繝ウ繝 + public int n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ; //0:譛ェ蜿門セ 1:逋ス邊 2:驫邊 3:驫邊 4:驥鷹寉 5:譯髮 6:邏ォ髮 7:陌ケ讌オ + public CDTX.CChip[] r遨コ縺縺。繝峨Λ繝繝√ャ繝; + public STDGBVALUE st貍泌・剰ィ倬鹸; + + + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CStage邨先棡() + { + this.st貍泌・剰ィ倬鹸.Drums = new CScoreIni.C貍泌・剰ィ倬鹸(); + this.st貍泌・剰ィ倬鹸.Guitar = new CScoreIni.C貍泌・剰ィ倬鹸(); + this.st貍泌・剰ィ倬鹸.Bass = new CScoreIni.C貍泌・剰ィ倬鹸(); + this.st貍泌・剰ィ倬鹸.Taiko = new CScoreIni.C貍泌・剰ィ倬鹸(); + this.r遨コ縺縺。繝峨Λ繝繝√ャ繝 = new CDTX.CChip[10]; + this.n邱丞粋繝ゥ繝ウ繧ッ蛟、 = -1; + this.n繝√Ε繝ウ繝阪Ν0Ato繝ャ繝シ繝ウ07 = new int[] { 1, 2, 3, 4, 5, 7, 6, 1, 7, 0 }; + base.e繧ケ繝繝シ繧クID = CStage.E繧ケ繝繝シ繧ク.邨先棡; + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷; + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + base.list蟄植ctivities.Add(this.actParameterPanel = new CActResultParameterPanel()); + base.list蟄植ctivities.Add(this.actSongBar = new CActResultSongBar()); + base.list蟄植ctivities.Add(this.actOption = new CAct繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ()); + base.list蟄植ctivities.Add(this.actFI = new CActFIFOResult()); + base.list蟄植ctivities.Add(this.actFO = new CActFIFOBlack()); + } + + + // CStage 螳溯」 + + public override void On豢サ諤ァ蛹() + { + TJAPlayer3.Skin.bgm繝ェ繧カ繝ォ繝医う繝ウ髻ウ.t蜀咲函縺吶k(); + Trace.TraceInformation("邨先棡繧ケ繝繝シ繧ク繧呈エサ諤ァ蛹悶@縺セ縺吶"); + Trace.Indent(); + b譛霑鷹♀繧薙□譖イ霑ス蜉貂医∩ = false; + try + { + { + #region [ 蛻晄悄蛹 ] + //--------------------- + this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、 = E謌サ繧雁、.邯咏カ; + this.b繧「繝九Γ縺悟ョ御コ = false; + this.bIsCheckedWhetherResultScreenShouldSaveOrNot = false; // #24609 2011.3.14 yyagi + this.n譛蠕後↓蜀咲函縺励◆HH縺ョWAV逡ェ蜿キ = -1; + this.n譛蠕後↓蜀咲函縺励◆HH縺ョ繝√Ε繝ウ繝阪Ν逡ェ蜿キ = 0; + + for (int i = 0; i < 3; i++) + { + this.b譁ー險倬鹸繧ケ繧ュ繝ォ[i] = false; + this.b譁ー險倬鹸繧ケ繧ウ繧「[i] = false; + this.b譁ー險倬鹸繝ゥ繝ウ繧ッ[i] = false; + } + //--------------------- + #endregion + + #region [ 邨先棡縺ョ險育ョ ] + //--------------------- + for (int i = 0; i < 3; i++) + { + this.n繝ゥ繝ウ繧ッ蛟、[i] = -1; + this.fPerfect邇[i] = this.fGreat邇[i] = this.fGood邇[i] = this.fPoor邇[i] = this.fMiss邇[i] = 0.0f; // #28500 2011.5.24 yyagi + if ((((i != 0) || (TJAPlayer3.DTX.b繝√ャ繝励′縺ゅk.Drums)))) + { + CScoreIni.C貍泌・剰ィ倬鹸 part = this.st貍泌・剰ィ倬鹸[i]; + bool bIsAutoPlay = true; + switch (i) + { + case 0: + bIsAutoPlay = TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay; + break; + + case 1: + bIsAutoPlay = TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay; + break; + + case 2: + bIsAutoPlay = TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay; + break; + } + this.fPerfect邇[i] = bIsAutoPlay ? 0f : ((100f * part.nPerfect謨ー) / ((float)part.n蜈ィ繝√ャ繝玲焚)); + this.fGreat邇[i] = bIsAutoPlay ? 0f : ((100f * part.nGreat謨ー) / ((float)part.n蜈ィ繝√ャ繝玲焚)); + this.fGood邇[i] = bIsAutoPlay ? 0f : ((100f * part.nGood謨ー) / ((float)part.n蜈ィ繝√ャ繝玲焚)); + this.fPoor邇[i] = bIsAutoPlay ? 0f : ((100f * part.nPoor謨ー) / ((float)part.n蜈ィ繝√ャ繝玲焚)); + this.fMiss邇[i] = bIsAutoPlay ? 0f : ((100f * part.nMiss謨ー) / ((float)part.n蜈ィ繝√ャ繝玲焚)); + this.b繧ェ繝シ繝[i] = bIsAutoPlay; // #23596 10.11.16 add ikanick 縺昴ョ繝代シ繝医′繧ェ繝シ繝医↑繧1 + // 10.11.17 change (int to bool) ikanick + this.n繝ゥ繝ウ繧ッ蛟、[i] = CScoreIni.t繝ゥ繝ウ繧ッ蛟、繧定ィ育ョ励@縺ヲ霑斐☆(part); + } + } + this.n邱丞粋繝ゥ繝ウ繧ッ蛟、 = CScoreIni.t邱丞粋繝ゥ繝ウ繧ッ蛟、繧定ィ育ョ励@縺ヲ霑斐☆(this.st貍泌・剰ィ倬鹸.Drums, this.st貍泌・剰ィ倬鹸.Guitar, this.st貍泌・剰ィ倬鹸.Bass); + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Dan && TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Tower) + { + this.n繧ッ繝ェ繧「 = (this.st貍泌・剰ィ倬鹸.Drums.nMiss謨ー == 0 && this.st貍泌・剰ィ倬鹸.Drums.f繧イ繝シ繧ク == 100) ? this.st貍泌・剰ィ倬鹸.Drums.nGreat謨ー == 0 ? 3 : 2 : this.st貍泌・剰ィ倬鹸.Drums.f繧イ繝シ繧ク >= 80 ? 1 : 0; + + if (this.st貍泌・剰ィ倬鹸.Drums.n繧ケ繧ウ繧「 < 500000) + { + this.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ = 0; + } + else + { + for (int i = 0; i < 7; i++) + { + if (this.st貍泌・剰ィ倬鹸.Drums.n繧ケ繧ウ繧「 >= TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.ScoreRank.ScoreRank[i]) + { + this.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ = i + 1; + } + } + } + } + //--------------------- + #endregion + + #region [ .score.ini 縺ョ菴懈舌→蜃コ蜉 ] + //--------------------- + string str = TJAPlayer3.DTX.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ + ".score.ini"; + CScoreIni ini = new CScoreIni(str); + + bool[] b莉翫∪縺ァ縺ォ繝輔Ν繧ウ繝ウ繝懊@縺溘%縺ィ縺後≠繧 = new bool[] { false, false, false }; + + // 繝輔Ν繧ウ繝ウ繝懊メ繧ァ繝繧ッ縺ェ繧峨ウ縺ォ譁ー險倬鹸繝ゥ繝ウ繧ッ繝√ぉ繝繧ッ縺ッ縲(ni.Record[] 縺後√せ繧ウ繧「繝√ぉ繝繧ッ繧貍泌・丞梛繧ケ繧ュ繝ォ繝√ぉ繝繧ッ縺ョ IF 蜀縺ァ譖ク縺咲峩縺輔l縺ヲ縺励∪縺繧医j繧ょ燕縺ォ陦後≧縲(2010.9.10) + + b莉翫∪縺ァ縺ォ繝輔Ν繧ウ繝ウ繝懊@縺溘%縺ィ縺後≠繧擬0] = ini.st繧サ繧ッ繧キ繝ァ繝ウ[0].b繝輔Ν繧ウ繝ウ繝懊〒縺ゅk | ini.st繧サ繧ッ繧キ繝ァ繝ウ[0].b繝輔Ν繧ウ繝ウ繝懊〒縺ゅk; + + // #24459 荳願ィ倥ョ譚。莉カ縺縺ィ[HiSkill.***]縺ァ縺ョ繝ゥ繝ウ繧ッ縺励°繝√ぉ繝繧ッ縺励※縺縺ェ縺縺ョ縺ァ縲。estRank縺ィ豈碑シ縺吶k繧医≧螟画峩縲 + if (this.n繝ゥ繝ウ繧ッ蛟、[0] >= 0 && ini.st繝輔ぃ繧、繝ォ.BestRank[0] > this.n繝ゥ繝ウ繧ッ蛟、[0]) // #24459 2011.3.1 yyagi update BestRank + { + this.b譁ー險倬鹸繝ゥ繝ウ繧ッ[0] = true; + ini.st繝輔ぃ繧、繝ォ.BestRank[0] = this.n繝ゥ繝ウ繧ッ蛟、[0]; + } + + // 譁ー險倬鹸繧ケ繧ウ繧「繝√ぉ繝繧ッ + if ((this.st貍泌・剰ィ倬鹸[0].n繧ケ繧ウ繧「 > ini.st繧サ繧ッ繧キ繝ァ繝ウ[0].n繧ケ繧ウ繧「) && !TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay) + { + this.b譁ー險倬鹸繧ケ繧ウ繧「[0] = true; + ini.st繧サ繧ッ繧キ繝ァ繝ウ[0] = this.st貍泌・剰ィ倬鹸[0]; + } + + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Dan && TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Tower) + if (this.st貍泌・剰ィ倬鹸[0].n繧ケ繧ウ繧「 > ini.st繧サ繧ッ繧キ繝ァ繝ウ[0].n繧ケ繧ウ繧「) + this.st貍泌・剰ィ倬鹸[0].n繝上う繧ケ繧ウ繧「[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]] = (int)st貍泌・剰ィ倬鹸[0].n繧ケ繧ウ繧「; + + // 譁ー險倬鹸繧ケ繧ュ繝ォ繝√ぉ繝繧ッ + if (this.st貍泌・剰ィ倬鹸[0].db貍泌・丞梛繧ケ繧ュ繝ォ蛟、 > ini.st繧サ繧ッ繧キ繝ァ繝ウ[0].db貍泌・丞梛繧ケ繧ュ繝ォ蛟、) + { + this.b譁ー險倬鹸繧ケ繧ュ繝ォ[0] = true; + ini.st繧サ繧ッ繧キ繝ァ繝ウ[0] = this.st貍泌・剰ィ倬鹸[0]; + } + + if(TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Dan && TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Tower) + { + ini.st繧サ繧ッ繧キ繝ァ繝ウ[0].n繧ッ繝ェ繧「[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]] = this.n繧ッ繝ェ繧「; + ini.st繧サ繧ッ繧キ繝ァ繝ウ[0].n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]] = this.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ; + } + + // 繝ゥ繧ケ繝医励Ξ繧、 #23595 2011.1.9 ikanick + // 繧ェ繝シ繝医§繧縺ェ縺代l縺ー繝励Ξ繧、邨先棡繧呈嶌縺崎セシ繧 + if (TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay == false) + { + ini.st繧サ繧ッ繧キ繝ァ繝ウ[0] = this.st貍泌・剰ィ倬鹸[0]; + } + + // #23596 10.11.16 add ikanick 繧ェ繝シ繝医§繧縺ェ縺縺ェ繧峨け繝ェ繧「蝗樊焚繧1蠅励d縺 + // 11.02.05 b繧ェ繝シ繝 to t譖エ譁ー譚。莉カ繧貞叙蠕励☆繧 use ikanick + bool[] b譖エ譁ー縺悟ソ隕√°蜷ヲ縺 = new bool[3]; + CScoreIni.t譖エ譁ー譚。莉カ繧貞叙蠕励☆繧(out b譖エ譁ー縺悟ソ隕√°蜷ヲ縺擬0], out b譖エ譁ー縺悟ソ隕√°蜷ヲ縺擬1], out b譖エ譁ー縺悟ソ隕√°蜷ヲ縺擬2]); + + if (b譖エ譁ー縺悟ソ隕√°蜷ヲ縺擬0]) + { + ini.st繝輔ぃ繧、繝ォ.ClearCountDrums++; + } + //---------------------------------------------------------------------/ + if (TJAPlayer3.ConfigIni.bScoreIni繧貞コ蜉帙☆繧) + ini.t譖ク縺榊コ縺(str); + + //--------------------- + #endregion + + #region [ 繝ェ繧カ繝ォ繝育判髱「縺ク縺ョ貍泌・丞屓謨ー縺ョ譖エ譁ー #24281 2011.1.30 yyagi] + if (TJAPlayer3.ConfigIni.bScoreIni繧貞コ蜉帙☆繧) + { + this.n貍泌・丞屓謨ー.Drums = ini.st繝輔ぃ繧、繝ォ.PlayCountDrums; + this.n貍泌・丞屓謨ー.Guitar = ini.st繝輔ぃ繧、繝ォ.PlayCountGuitar; + this.n貍泌・丞屓謨ー.Bass = ini.st繝輔ぃ繧、繝ォ.PlayCountBass; + } + #endregion + } + + // Discord Presense縺ョ譖エ譁ー + Discord.UpdatePresence(TJAPlayer3.DTX.TITLE + ".tja", Properties.Discord.Stage_Result + (TJAPlayer3.ConfigIni.b螟ェ鮠薙ヱ繝シ繝AutoPlay == true ? " (" + Properties.Discord.Info_IsAuto + ")" : ""), TJAPlayer3.StartupTime); + + base.On豢サ諤ァ蛹(); + } + finally + { + Trace.TraceInformation("邨先棡繧ケ繝繝シ繧ク縺ョ豢サ諤ァ蛹悶r螳御コ縺励∪縺励◆縲"); + Trace.Unindent(); + } + } + public override void On髱樊エサ諤ァ蛹() + { + if (this.rResultSound != null) + { + TJAPlayer3.Sound邂。逅.t繧オ繧ヲ繝ウ繝峨r遐エ譽縺吶k(this.rResultSound); + this.rResultSound = null; + } + base.On髱樊エサ諤ァ蛹(); + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + b髻ウ螢ー蜀咲函 = false; + this.EndAnime = false; + //this.tx閭梧勹 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\8_background.png" ) ); + //this.tx荳企Κ繝代ロ繝ォ = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\8_header.png" ) ); + //this.tx荳矩Κ繝代ロ繝ォ = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\8_footer panel.png" ), true ); + //this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\Screen option panels.png" ) ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + if (this.ct逋サ蝣エ逕ィ != null) + { + this.ct逋サ蝣エ逕ィ = null; + } + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx閭梧勹 ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx荳企Κ繝代ロ繝ォ ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx荳矩Κ繝代ロ繝ォ ); + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + int num; + if (base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ) + { + this.ct逋サ蝣エ逕ィ = new CCounter(0, 100, 5, TJAPlayer3.Timer); + this.actFI.t繝輔ぉ繝シ繝峨う繝ウ髢句ァ(); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨う繝ウ; + if (this.rResultSound != null) + { + this.rResultSound.t蜀咲函繧帝幕蟋九☆繧(); + } + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + this.b繧「繝九Γ縺悟ョ御コ = true; + if (this.ct逋サ蝣エ逕ィ.b騾イ陦御クュ) + { + this.ct逋サ蝣エ逕ィ.t騾イ陦(); + if (this.ct逋サ蝣エ逕ィ.b邨ゆコ蛟、縺ォ驕斐@縺) + { + this.ct逋サ蝣エ逕ィ.t蛛懈ュ「(); + } + else + { + this.b繧「繝九Γ縺悟ョ御コ = false; + } + } + + // 謠冗判 + + if (!b髻ウ螢ー蜀咲函 && !TJAPlayer3.Skin.bgm繝ェ繧カ繝ォ繝医う繝ウ髻ウ.b蜀咲函荳ュ) + { + TJAPlayer3.Skin.bgm繝ェ繧カ繝ォ繝磯浹.t蜀咲函縺吶k(); + b髻ウ螢ー蜀咲函 = true; + } + + if (TJAPlayer3.Tx.Result_Background != null) + { + + int CloudType = 0; + float MountainAppearValue = 2000 + (this.actParameterPanel.ct繧イ繝シ繧ク繧「繝九Γ.n邨ゆコ蛟、 * 66) + 8360 - 85; + + if (this.actParameterPanel.ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 >= MountainAppearValue) + { + #region [Mountain Bump] + + if (this.st貍泌・剰ィ倬鹸.Drums.f繧イ繝シ繧ク >= 80.0) + { + TJAPlayer3.Tx.Result_Background[1].Opacity = (this.actParameterPanel.ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (10275 + ((int)this.actParameterPanel.ct繧イ繝シ繧ク繧「繝九Γ.n邨ゆコ蛟、 * 66))) * 3; + TJAPlayer3.Tx.Result_Mountain[1].Opacity = (this.actParameterPanel.ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (10275 + ((int)this.actParameterPanel.ct繧イ繝シ繧ク繧「繝九Γ.n邨ゆコ蛟、 * 66))) * 3; + TJAPlayer3.Tx.Result_Mountain[0].Opacity = 255 - (this.actParameterPanel.ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (10275 + ((int)this.actParameterPanel.ct繧イ繝シ繧ク繧「繝九Γ.n邨ゆコ蛟、 * 66))) * 3; + + if (this.actParameterPanel.ctMountain_ClearIn.n迴セ蝨ィ縺ョ蛟、 <= 90) + { + TJAPlayer3.Tx.Result_Mountain[1].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.0f - (float)Math.Sin((float)this.actParameterPanel.ctMountain_ClearIn.n迴セ蝨ィ縺ョ蛟、 * (Math.PI / 180)) * 0.18f; + } + else if (this.actParameterPanel.ctMountain_ClearIn.n迴セ蝨ィ縺ョ蛟、 <= 225) + { + TJAPlayer3.Tx.Result_Mountain[1].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.82f + (float)Math.Sin((float)(this.actParameterPanel.ctMountain_ClearIn.n迴セ蝨ィ縺ョ蛟、 - 90) / 1.5f * (Math.PI / 180)) * 0.58f; + } + else if (this.actParameterPanel.ctMountain_ClearIn.n迴セ蝨ィ縺ョ蛟、 <= 245) + { + TJAPlayer3.Tx.Result_Mountain[1].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 1.4f; + } + else if (this.actParameterPanel.ctMountain_ClearIn.n迴セ蝨ィ縺ョ蛟、 <= 335) + { + TJAPlayer3.Tx.Result_Mountain[1].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.9f + (float)Math.Sin((float)(this.actParameterPanel.ctMountain_ClearIn.n迴セ蝨ィ縺ョ蛟、 - 155) * (Math.PI / 180)) * 0.5f; + } + else if (this.actParameterPanel.ctMountain_ClearIn.n迴セ蝨ィ縺ョ蛟、 <= 515) + { + TJAPlayer3.Tx.Result_Mountain[1].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.9f + (float)Math.Sin((float)(this.actParameterPanel.ctMountain_ClearIn.n迴セ蝨ィ縺ョ蛟、 - 335) * (Math.PI / 180)) * 0.4f; + } + } + + #endregion + } + else + { + + TJAPlayer3.Tx.Result_Background[1].Opacity = 0; + TJAPlayer3.Tx.Result_Mountain[0].Opacity = 255; + TJAPlayer3.Tx.Result_Mountain[1].Opacity = 0; + } + + TJAPlayer3.Tx.Result_Background[0].t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + TJAPlayer3.Tx.Result_Background[1].t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + TJAPlayer3.Tx.Result_Mountain[0].t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + TJAPlayer3.Tx.Result_Mountain[1].t2D諡。螟ァ邇閠諷ョ荳句渕貅匁緒逕サ(TJAPlayer3.app.Device, 0, 720); + + #region [Background Clouds] + + if (this.st貍泌・剰ィ倬鹸.Drums.f繧イ繝シ繧ク >= 80.0 && this.actParameterPanel.ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 >= MountainAppearValue) + { + CloudType = Math.Min(255, Math.Max(0, (int)this.actParameterPanel.ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (int)MountainAppearValue)); + } + + for (int i = 10; i >= 0; i--) + { + int CurMoveRed = (int)((double)CloudMaxMove[i] * Math.Tanh((double)this.actParameterPanel.ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 / 10000)); + int CurMoveGold = (int)((double)CloudMaxMove[i] * Math.Tanh(Math.Max(0, (double)this.actParameterPanel.ct蜈ィ菴馴イ陦.n迴セ蝨ィ縺ョ蛟、 - (double)MountainAppearValue) / 10000)); + + TJAPlayer3.Tx.Result_Cloud.vc諡。螟ァ邵ョ蟆丞咲紫.X = 0.65f; + TJAPlayer3.Tx.Result_Cloud.vc諡。螟ァ邵ョ蟆丞咲紫.Y = 0.65f; + TJAPlayer3.Tx.Result_Cloud.Opacity = CloudType; + + TJAPlayer3.Tx.Result_Cloud.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, CloudXPos[i] - CurMoveGold, CloudYPos[i], new Rectangle(i * 1200, 360, 1200, 360)); + + TJAPlayer3.Tx.Result_Cloud.Opacity = 255 - CloudType; + + TJAPlayer3.Tx.Result_Cloud.t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, CloudXPos[i] - CurMoveRed, CloudYPos[i], new Rectangle(i * 1200, 0, 1200, 360)); + } + + #endregion + + } + + if (this.ct逋サ蝣エ逕ィ.b騾イ陦御クュ && (TJAPlayer3.Tx.Result_Header != null)) + { + double num2 = ((double)this.ct逋サ蝣エ逕ィ.n迴セ蝨ィ縺ョ蛟、) / 100.0; + double num3 = Math.Sin(Math.PI / 2 * num2); + num = ((int)(TJAPlayer3.Tx.Result_Header.sz逕サ蜒上し繧、繧コ.Height * num3)) - TJAPlayer3.Tx.Result_Header.sz逕サ蜒上し繧、繧コ.Height; + } + else + { + num = 0; + } + if (!b髻ウ螢ー蜀咲函 && !TJAPlayer3.Skin.bgm繝ェ繧カ繝ォ繝医う繝ウ髻ウ.b蜀咲函荳ュ) + { + TJAPlayer3.Skin.bgm繝ェ繧カ繝ォ繝磯浹.t蜀咲函縺吶k(); + b髻ウ螢ー蜀咲函 = true; + } + + if (TJAPlayer3.Tx.Result_Header != null) + { + TJAPlayer3.Tx.Result_Header.t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + } + + if (this.actParameterPanel.On騾イ陦梧緒逕サ() == 0) + { + this.b繧「繝九Γ縺悟ョ御コ = false; + } + + if (this.actSongBar.On騾イ陦梧緒逕サ() == 0) + { + this.b繧「繝九Γ縺悟ョ御コ = false; + } + + #region 繝阪シ繝繝励Ξ繝シ繝 + for (int i = 0; i < TJAPlayer3.ConfigIni.nPlayerCount; i++) + { + TJAPlayer3.NamePlate.tNamePlateDraw(28, 621, i); + } + #endregion + + if (base.e繝輔ぉ繝シ繧コID == CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨う繝ウ) + { + if (this.actFI.On騾イ陦梧緒逕サ() != 0) + { + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷; + } + } + else if ((base.e繝輔ぉ繝シ繧コID == CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝)) //&& ( this.actFO.On騾イ陦梧緒逕サ() != 0 ) ) + { + return (int)this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、; + } + + #region [ #24609 2011.3.14 yyagi 繝ゥ繝ウ繧ッ譖エ譁ーor貍泌・丞梛繧ケ繧ュ繝ォ譖エ譁ー譎ゅ√Μ繧カ繝ォ繝育判蜒上rpng縺ァ菫晏ュ倥☆繧 ] + if (this.b繧「繝九Γ縺悟ョ御コ == true && this.bIsCheckedWhetherResultScreenShouldSaveOrNot == false // #24609 2011.3.14 yyagi; to save result screen in case BestRank or HiSkill. + && TJAPlayer3.ConfigIni.bScoreIni繧貞コ蜉帙☆繧 + && TJAPlayer3.ConfigIni.bIsAutoResultCapture) // #25399 2011.6.9 yyagi + { + CheckAndSaveResultScreen(true); + this.bIsCheckedWhetherResultScreenShouldSaveOrNot = true; + } + #endregion + + // 繧ュ繝シ蜈・蜉 + + if (TJAPlayer3.act迴セ蝨ィ蜈・蜉帙r蜊譛我クュ縺ョ繝励Λ繧ー繧、繝ウ == null) + { + if (base.e繝輔ぉ繝シ繧コID == CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷) + { + if (TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.Escape)) + { + TJAPlayer3.Skin.bgm繝ェ繧カ繝ォ繝磯浹.t蛛懈ュ「縺吶k(); + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + actFI.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(); + t蠕悟ヲ逅(); + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝; + this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、 = E謌サ繧雁、.螳御コ; + } + if (((TJAPlayer3.Pad.b謚シ縺輔l縺櫂GB(E繝代ャ繝.CY) || TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.RD)) || (TJAPlayer3.Pad.b謚シ縺輔l縺(E讌ス蝎ィ繝代シ繝.DRUMS, E繝代ャ繝.LC) || (TJAPlayer3.Pad.b謚シ縺輔l縺櫂GB(E繝代ャ繝.LRed) || (TJAPlayer3.Pad.b謚シ縺輔l縺櫂GB(E繝代ャ繝.RRed) || TJAPlayer3.Input邂。逅.Keyboard.b繧ュ繝シ縺梧款縺輔l縺((int)SlimDXKeys.Key.Return)))))) + { + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + actFI.t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(); + + if(TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Dan) + if (TJAPlayer3.stage驕ク譖イ.r迴セ蝨ィ驕ク謚樔クュ縺ョ譖イ.r隕ェ繝弱シ繝 != null) + TJAPlayer3.stage驕ク譖イ.act譖イ繝ェ繧ケ繝.tBOX繧貞コ繧(); + + t蠕悟ヲ逅(); + + { + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝; + this.e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、 = E謌サ繧雁、.螳御コ; + TJAPlayer3.Skin.bgm繝ェ繧カ繝ォ繝磯浹.t蛛懈ュ「縺吶k(); + TJAPlayer3.Skin.sound豎コ螳夐浹.t蜀咲函縺吶k(); + } + } + } + } + } + return 0; + } + + public void t蠕悟ヲ逅() + { + if (!TJAPlayer3.ConfigIni.bAutoPlay[0]) + { + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Dan && TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Tower) + { + if (n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ != 0) + { + if (TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]] == 0) + { + TJAPlayer3.stage驕ク譖イ.act譖イ繝ェ繧ケ繝.ScoreRankCount[n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ - 1] += 1; + } + else if (TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]] < n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ) + { + TJAPlayer3.stage驕ク譖イ.act譖イ繝ェ繧ケ繝.ScoreRankCount[n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ - 1] += 1; + TJAPlayer3.stage驕ク譖イ.act譖イ繝ェ繧ケ繝.ScoreRankCount[TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]] - 1] -= 1; + } + } + + if (n繧ッ繝ェ繧「 != 0) + { + if (TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ッ繝ェ繧「[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]] == 0) + { + TJAPlayer3.stage驕ク譖イ.act譖イ繝ェ繧ケ繝.CrownCount[n繧ッ繝ェ繧「 - 1] += 1; + } + else if (TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ッ繝ェ繧「[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]] < n繧ッ繝ェ繧「) + { + TJAPlayer3.stage驕ク譖イ.act譖イ繝ェ繧ケ繝.CrownCount[n繧ッ繝ェ繧「 - 1] += 1; + TJAPlayer3.stage驕ク譖イ.act譖イ繝ェ繧ケ繝.CrownCount[TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ッ繝ェ繧「[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]] - 1] -= 1; + } + + } + } + } + + if (!b譛霑鷹♀繧薙□譖イ霑ス蜉貂医∩) + { + #region [ 驕ク譖イ逕サ髱「縺ョ隴憺擇諠蝣ア縺ョ譖エ譁ー ] + //--------------------- + if (!TJAPlayer3.b繧ウ繝ウ繝代け繝医Δ繝シ繝) + { + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Dan && TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] != (int)Difficulty.Tower) + { + C繧ケ繧ウ繧「 c繧ケ繧ウ繧「 = TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆繧ケ繧ウ繧「; + + if (c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ッ繝ェ繧「[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]] < n繧ッ繝ェ繧「) + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ッ繝ェ繧「[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]] = this.n繧ッ繝ェ繧「; + + if (c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]] < n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ) + c繧ケ繧ウ繧「.隴憺擇諠蝣ア.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ[TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0]] = this.n繧ケ繧ウ繧「繝ゥ繝ウ繧ッ; + } + } + //--------------------- + #endregion + + foreach (var song in TJAPlayer3.Songs邂。逅.list譖イ繝ォ繝シ繝) + { + if (song.str繧ク繝」繝ウ繝ォ == "譛霑鷹♀繧薙□譖イ" && song.e繝弱シ繝臥ィョ蛻・ == C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BOX) + { + song.list蟄舌Μ繧ケ繝.Add(TJAPlayer3.stage驕ク譖イ.r遒コ螳壹&繧後◆譖イ.Clone()); + + foreach (var song2 in song.list蟄舌Μ繧ケ繝) + { + song2.r隕ェ繝弱シ繝 = song; + song2.str繧ク繝」繝ウ繝ォ = "譛霑鷹♀繧薙□譖イ"; + + if (song2.e繝弱シ繝臥ィョ蛻・ != C譖イ繝ェ繧ケ繝医ヮ繝シ繝.E繝弱シ繝臥ィョ蛻・.BACKBOX) + song2.BackColor = ColorTranslator.FromHtml("#164748"); + } + + if (song.list蟄舌Μ繧ケ繝.Count >= 6) + { + song.list蟄舌Μ繧ケ繝.RemoveAt(1); + } + } + } + + b譛霑鷹♀繧薙□譖イ霑ス蜉貂医∩ = true; + } + + } + + public enum E謌サ繧雁、 : int + { + 邯咏カ, + 螳御コ + } + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + + public bool b譛霑鷹♀繧薙□譖イ霑ス蜉貂医∩; + public bool b髻ウ螢ー蜀咲函; + public bool EndAnime; + + private CCounter ct逋サ蝣エ逕ィ; + private E謌サ繧雁、 e繝輔ぉ繝シ繝峨い繧ヲ繝亥ョ御コ譎ゅョ謌サ繧雁、; + private CActFIFOResult actFI; + private CActFIFOBlack actFO; + private CAct繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ actOption; + private CActResultParameterPanel actParameterPanel; + + private CActResultRank actRank; + private CActResultImage actResultImage; + + private CActResultSongBar actSongBar; + private bool b繧「繝九Γ縺悟ョ御コ; + private bool bIsCheckedWhetherResultScreenShouldSaveOrNot; // #24509 2011.3.14 yyagi + private readonly int[] n繝√Ε繝ウ繝阪Ν0Ato繝ャ繝シ繝ウ07; + private int n譛蠕後↓蜀咲函縺励◆HH縺ョWAV逡ェ蜿キ; + private int n譛蠕後↓蜀咲函縺励◆HH縺ョ繝√Ε繝ウ繝阪Ν逡ェ蜿キ; + private CSound rResultSound; + + // Cloud informations + private int[] CloudXPos = { 642, 612, 652, 1148, 1180, 112, 8, 1088, 1100, 32, 412 }; + private int[] CloudYPos = { 202, 424, 636, 530, 636, 636, 102, 52, 108, 326, 644 }; + private int[] CloudMaxMove = { 150, 120, 180, 60, 90, 150, 120, 50, 45, 120, 180 }; + + private CCounter ctAutoReturn; + //private CTexture tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ; + //private CTexture tx荳矩Κ繝代ロ繝ォ; + //private CTexture tx荳企Κ繝代ロ繝ォ; + //private CTexture tx閭梧勹; + + #region [ #24609 繝ェ繧カ繝ォ繝育判蜒上rpng縺ァ菫晏ュ倥☆繧 ] // #24609 2011.3.14 yyagi; to save result screen in case BestRank or HiSkill. + /// + /// 繝ェ繧カ繝ォ繝育判蜒上ョ繧ュ繝」繝励メ繝」縺ィ菫晏ュ倥 + /// 閾ェ蜍穂ソ晏ュ倥Δ繝シ繝画凾縺ッ縲√Λ繝ウ繧ッ譖エ譁ーor貍泌・丞梛繧ケ繧ュ繝ォ譖エ譁ー譎ゅ↓閾ェ蜍穂ソ晏ュ倥 + /// 謇句虚菫晏ュ倥Δ繝シ繝画凾縺ッ縲√Λ繝ウ繧ッ縺ォ萓昴i縺壻ソ晏ュ倥 + /// + /// true=閾ェ蜍穂ソ晏ュ倥Δ繝シ繝, false=謇句虚菫晏ュ倥Δ繝シ繝 + private void CheckAndSaveResultScreen(bool bIsAutoSave) + { + string path = Path.GetDirectoryName(TJAPlayer3.DTX.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ); + string datetime = DateTime.Now.ToString("yyyyMMddHHmmss"); + if (bIsAutoSave) + { + // 繝ェ繧カ繝ォ繝育判蜒上r閾ェ蜍穂ソ晏ュ倥☆繧九→縺阪ッ縲‥tx繝輔ぃ繧、繝ォ蜷.yyMMddHHmmss_DRUMS_SS.png 縺ィ縺縺蠖「蠑上〒菫晏ュ倥 + for (int i = 0; i < 3; i++) + { + if (this.b譁ー險倬鹸繝ゥ繝ウ繧ッ[i] == true || this.b譁ー險倬鹸繧ケ繧ュ繝ォ[i] == true) + { + string strPart = ((E讌ス蝎ィ繝代シ繝)(i)).ToString(); + string strRank = ((CScoreIni.ERANK)(this.n繝ゥ繝ウ繧ッ蛟、[i])).ToString(); + string strFullPath = TJAPlayer3.DTX.str繝輔ぃ繧、繝ォ蜷阪ョ邨カ蟇セ繝代せ + "." + datetime + "_" + strPart + "_" + strRank + ".png"; + //Surface.ToFile( pSurface, strFullPath, ImageFileFormat.Png ); + TJAPlayer3.app.SaveResultScreen(strFullPath); + } + } + } + #region [ #24609 2011.4.11 yyagi; 繝ェ繧カ繝ォ繝医ョ謇句虚菫晏ュ倥Ο繧ク繝繧ッ縺ッ縲,DTXMania縺ォ遘サ邂。縺励◆縲] + // else + // { + // // 繝ェ繧カ繝ォ繝育判蜒上r謇句虚菫晏ュ倥☆繧九→縺阪ッ縲‥tx繝輔ぃ繧、繝ォ蜷.yyMMddHHmmss_SS.png 縺ィ縺縺蠖「蠑上〒菫晏ュ倥(讌ス蝎ィ蜷咲┌縺) + // string strRank = ( (CScoreIni.ERANK) ( CDTXMania.stage邨先棡.n邱丞粋繝ゥ繝ウ繧ッ蛟、 ) ).ToString(); + // string strSavePath = CDTXMania.strEXE縺ョ縺ゅk繝輔か繝ォ繝 + "\\" + "Capture_img"; + // if ( !Directory.Exists( strSavePath ) ) + // { + // try + // { + // Directory.CreateDirectory( strSavePath ); + // } + // catch + // { + // } + // } + // string strFullPath = strSavePath + "\\" + CDTXMania.DTX.TITLE + + // "." + datetime + "_" + strRank + ".png"; + // // Surface.ToFile( pSurface, strFullPath, ImageFileFormat.Png ); + // CDTXMania.app.SaveResultScreen( strFullPath ); + // } + #endregion + } + #endregion + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/09.Ending/CStage邨ゆコ.cs b/TJAPlayer3/Stages/09.Ending/CStage邨ゆコ.cs new file mode 100644 index 00000000..19d8dd1f --- /dev/null +++ b/TJAPlayer3/Stages/09.Ending/CStage邨ゆコ.cs @@ -0,0 +1,182 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using DirectShowLib; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CStage邨ゆコ : CStage + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CStage邨ゆコ() + { + base.e繧ケ繝繝シ繧クID = CStage.E繧ケ繝繝シ繧ク.邨ゆコ; + base.e繝輔ぉ繝シ繧コID = CStage.E繝輔ぉ繝シ繧コ.蜈ア騾喟騾壼クク迥カ諷; + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // CStage 螳溯」 + + public override void On豢サ諤ァ蛹() + { + Trace.TraceInformation( "邨ゆコ繧ケ繝繝シ繧ク繧呈エサ諤ァ蛹悶@縺セ縺吶" ); + Trace.Indent(); + try + { + this.ct譎る俣遞シ縺 = new CCounter(); + base.On豢サ諤ァ蛹(); + } + finally + { + Trace.TraceInformation( "邨ゆコ繧ケ繝繝シ繧ク縺ョ豢サ諤ァ蛹悶r螳御コ縺励∪縺励◆縲" ); + Trace.Unindent(); + } + } + public override void On髱樊エサ諤ァ蛹() + { + Trace.TraceInformation( "邨ゆコ繧ケ繝繝シ繧ク繧帝撼豢サ諤ァ蛹悶@縺セ縺吶" ); + Trace.Indent(); + try + { + base.On髱樊エサ諤ァ蛹(); + } + finally + { + Trace.TraceInformation( "邨ゆコ繧ケ繝繝シ繧ク縺ョ髱樊エサ諤ァ蛹悶r螳御コ縺励∪縺励◆縲" ); + Trace.Unindent(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + // this.tx譁蟄 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\9_text.png" ) ); + // this.tx譁蟄2 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\9_text.png" ) ); + // this.tx譁蟄3 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\9_text.png" ) ); + //this.tx閭梧勹 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\9_background.jpg" ), false ); + // this.tx逋ス = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\Tile white 64x64.png" ), false ); + // this.ds閭梧勹 = CDTXMania.t螟ア謨励@縺ヲ繧ゅせ繧ュ繝繝怜庄閭ス縺ェDirectShow繧堤函謌舌☆繧( CSkin.Path( @"Graphics\9_background.mp4" ), CDTXMania.app.WindowHandle, true ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx閭梧勹 ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx譁蟄 ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx譁蟄2 ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx譁蟄3 ); + // CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx逋ス ); + // CDTXMania.t螳牙ィ縺ォDispose縺吶k( ref this.ds閭梧勹 ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( !TJAPlayer3.ConfigIni.bEndingAnime ) //2017.01.27 DD + { + return 1; + } + //if( this.ds閭梧勹 != null ) + //{ + // this.ds閭梧勹.t蜀咲函髢句ァ(); + + // this.ds閭梧勹.t迴セ譎らせ縺ォ縺翫¢繧区怙譁ー縺ョ繧ケ繝翫ャ繝励う繝。繝シ繧ク繧探exture縺ォ霆「蜀吶☆繧( this.tx閭梧勹 ); + //} + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + if( base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + TJAPlayer3.Skin.sound繧イ繝シ繝邨ゆコ髻ウ.t蜀咲函縺吶k(); + this.ct譎る俣遞シ縺.t髢句ァ( 0, 3000, 1, TJAPlayer3.Timer ); + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + } + + + this.ct譎る俣遞シ縺.t騾イ陦(); + + if( TJAPlayer3.Tx.Exit_Background != null ) + { + //if( this.ds閭梧勹 != null ) + //{ + // if( this.ds閭梧勹.b荳贋ク句渚霆「 ) + // this.tx閭梧勹.t2D荳贋ク句渚霆「謠冗判( CDTXMania.app.Device, 0, 0 ); + // else + // this.tx閭梧勹.t2D謠冗判( CDTXMania.app.Device, 0, 0 ); + //} + //else + TJAPlayer3.Tx.Exit_Background.t2D謠冗判( TJAPlayer3.app.Device, 0, 0 ); + } + + + // if( this.ct譎る俣遞シ縺.n迴セ蝨ィ縺ョ蛟、 < 2000 ) + // { + // if( this.tx譁蟄 != null ) + // { + // this.tx譁蟄2.fZ霆ク荳ュ蠢蝗櫁サ「 = -0.8f; + // this.tx譁蟄3.fZ霆ク荳ュ蠢蝗櫁サ「 = ( -1.6f * ( this.ct譎る俣遞シ縺.n迴セ蝨ィ縺ョ蛟、 / 1280.0f ) ) >= -1.6f ? ( -1.6f * ( this.ct譎る俣遞シ縺.n迴セ蝨ィ縺ョ蛟、 / 1280.0f ) ) : -1.6f ; + // this.tx譁蟄2.vc諡。螟ァ邵ョ蟆丞咲紫 = new Vector3( 4.0f, 4.0f, 1.0f ); + // this.tx譁蟄3.vc諡。螟ァ邵ョ蟆丞咲紫 = new Vector3( 4.0f, 4.0f, 1.0f ); + + // this.tx譁蟄2.t2D謠冗判( CDTXMania.app.Device, 1100 - (int)( 1.30f * this.ct譎る俣遞シ縺.n迴セ蝨ィ縺ョ蛟、), 1600 - (int)( 1.6f * this.ct譎る俣遞シ縺.n迴セ蝨ィ縺ョ蛟、), new System.Drawing.Rectangle( 0, 0, 620, 92 ) ); + // this.tx譁蟄3.t2D謠冗判( CDTXMania.app.Device, -250 + (int)( 1.10f * this.ct譎る俣遞シ縺.n迴セ蝨ィ縺ョ蛟、), 1600 - (int)( 1.6f * this.ct譎る俣遞シ縺.n迴セ蝨ィ縺ョ蛟、), new System.Drawing.Rectangle( 0, 92, 620, 94 ) ); + // } + // } + // else + // { + + // if( this.tx譁蟄 != null ) + // { + // this.tx譁蟄2.fZ霆ク荳ュ蠢蝗櫁サ「 = 0f; + // this.tx譁蟄3.fZ霆ク荳ュ蠢蝗櫁サ「 = 0f; + // this.tx譁蟄2.vc諡。螟ァ邵ョ蟆丞咲紫 = new Vector3( 1.3f, 1.3f, 1.0f ); + // this.tx譁蟄3.vc諡。螟ァ邵ョ蟆丞咲紫 = new Vector3( 1.3f, 1.3f, 1.0f ); + + // this.tx譁蟄2.t2D謠冗判( CDTXMania.app.Device, 480, 376, new System.Drawing.Rectangle( 0, 0, 620, 92 ) ); + // this.tx譁蟄3.t2D謠冗判( CDTXMania.app.Device, 500, 486, new System.Drawing.Rectangle( 0, 92, 620, 95 ) ); + // this.tx譁蟄.t2D謠冗判( CDTXMania.app.Device, 662, 613, new System.Drawing.Rectangle( 0, 187, 620, 44 ) ); + // } + + // if( this.tx逋ス != null ) + //{ + // this.tx逋ス.n騾乗主コヲ = ( 2255 + 300 ) - ( this.ct譎る俣遞シ縺.n迴セ蝨ィ縺ョ蛟、 ); + // for( int i = 0; i <= ( SampleFramework.GameWindowSize.Width / 64 ); i++ ) + // { + // for( int j = 0; j <= ( SampleFramework.GameWindowSize.Height / 64 ); j++ ) + // { + // this.tx逋ス.t2D謠冗判( CDTXMania.app.Device, i * 64, j * 64 ); + // } + // } + //} + // } + + if( this.ct譎る俣遞シ縺.b邨ゆコ蛟、縺ォ驕斐@縺 && !TJAPlayer3.Skin.sound繧イ繝シ繝邨ゆコ髻ウ.b蜀咲函荳ュ ) + { + return 1; + } + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private CCounter ct譎る俣遞シ縺; + //private CTexture tx閭梧勹; + // private CTexture tx譁蟄; + // private CTexture tx譁蟄2; + // private CTexture tx譁蟄3; + // private CDirectShow ds閭梧勹; + // private CTexture tx逋ス; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/10.ChangeSkin/CStageChangeSkin.cs b/TJAPlayer3/Stages/10.ChangeSkin/CStageChangeSkin.cs new file mode 100644 index 00000000..72081c6b --- /dev/null +++ b/TJAPlayer3/Stages/10.ChangeSkin/CStageChangeSkin.cs @@ -0,0 +1,104 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using System.Threading; +using System.IO; +using FDK; +using System.Runtime.Serialization.Formatters.Binary; + + +namespace TJAPlayer3 +{ + /// + /// box.def縺ォ繧医k繧ケ繧ュ繝ウ螟画峩譎ゅ↓荳譎ら噪縺ォ驕キ遘サ縺吶k縲√せ繧ュ繝ウ逕サ蜒上ョ荳蛻辟。縺繧ケ繝繝シ繧ク縲 + /// + internal class CStageChangeSkin : CStage + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CStageChangeSkin() + { + base.e繧ケ繝繝シ繧クID = CStage.E繧ケ繝繝シ繧ク.ChangeSkin; + base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 = true; + } + + + // CStage 螳溯」 + + public override void On豢サ諤ァ蛹() + { + Trace.TraceInformation( "繧ケ繧ュ繝ウ螟画峩繧ケ繝繝シ繧ク繧呈エサ諤ァ蛹悶@縺セ縺吶" ); + Trace.Indent(); + try + { + base.On豢サ諤ァ蛹(); + Trace.TraceInformation( "繧ケ繧ュ繝ウ螟画峩繧ケ繝繝シ繧ク縺ョ豢サ諤ァ蛹悶r螳御コ縺励∪縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + } + public override void On髱樊エサ諤ァ蛹() + { + Trace.TraceInformation( "繧ケ繧ュ繝ウ螟画峩繧ケ繝繝シ繧ク繧帝撼豢サ諤ァ蛹悶@縺セ縺吶" ); + Trace.Indent(); + try + { + base.On髱樊エサ諤ァ蛹(); + Trace.TraceInformation( "繧ケ繧ュ繝ウ螟画峩繧ケ繝繝シ繧ク縺ョ髱樊エサ諤ァ蛹悶r螳御コ縺励∪縺励◆縲" ); + } + finally + { + Trace.Unindent(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + if ( base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ ) + { + base.b蛻昴a縺ヲ縺ョ騾イ陦梧緒逕サ = false; + return 0; + } + + //繧ケ繧ュ繝ウ螟画峩蜃ヲ逅 + TJAPlayer3.app.RefleshSkin(); + + return 1; + } + return 0; + } + //public void tChangeSkinMain() + //{ + // Trace.TraceInformation( "繧ケ繧ュ繝ウ螟画峩:" + CDTXMania.Skin.GetCurrentSkinSubfolderFullName( false ) ); + + // CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.On髱樊エサ諤ァ蛹(); + + // CDTXMania.Skin.PrepareReloadSkin(); + // CDTXMania.Skin.ReloadSkin(); + + + // CDTXMania.Tx.DisposeTexture(); + // CDTXMania.Tx.LoadTexture(); + + // CDTXMania.act譁蟄励さ繝ウ繧ス繝シ繝ォ.On豢サ諤ァ蛹(); + //} + } +} diff --git a/TJAPlayer3/Stages/CActDFPFont.cs b/TJAPlayer3/Stages/CActDFPFont.cs new file mode 100644 index 00000000..08167722 --- /dev/null +++ b/TJAPlayer3/Stages/CActDFPFont.cs @@ -0,0 +1,601 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActDFPFont : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + public CActDFPFont() + { + ST譁蟄鈴伜沺[] st譁蟄鈴伜沺Array = new ST譁蟄鈴伜沺[ 0x5d+2 ]; + ST譁蟄鈴伜沺 st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺.ch = ' '; + st譁蟄鈴伜沺.rc = new Rectangle( 10, 3, 13, 0x1b ); + st譁蟄鈴伜沺Array[ 0 ] = st譁蟄鈴伜沺; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺2 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺2.ch = '!'; + st譁蟄鈴伜沺2.rc = new Rectangle( 0x19, 3, 14, 0x1b ); + st譁蟄鈴伜沺Array[ 1 ] = st譁蟄鈴伜沺2; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺3 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺3.ch = '"'; + st譁蟄鈴伜沺3.rc = new Rectangle( 0x2c, 3, 0x11, 0x1b ); + st譁蟄鈴伜沺Array[ 2 ] = st譁蟄鈴伜沺3; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺4 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺4.ch = '#'; + st譁蟄鈴伜沺4.rc = new Rectangle( 0x40, 3, 0x18, 0x1b ); + st譁蟄鈴伜沺Array[ 3 ] = st譁蟄鈴伜沺4; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺5 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺5.ch = '$'; + st譁蟄鈴伜沺5.rc = new Rectangle( 90, 3, 0x15, 0x1b ); + st譁蟄鈴伜沺Array[ 4 ] = st譁蟄鈴伜沺5; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺6 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺6.ch = '%'; + st譁蟄鈴伜沺6.rc = new Rectangle( 0x71, 3, 0x1b, 0x1b ); + st譁蟄鈴伜沺Array[ 5 ] = st譁蟄鈴伜沺6; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺7 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺7.ch = '&'; + st譁蟄鈴伜沺7.rc = new Rectangle( 0x8e, 3, 0x18, 0x1b ); + st譁蟄鈴伜沺Array[ 6 ] = st譁蟄鈴伜沺7; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺8 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺8.ch = '\''; + st譁蟄鈴伜沺8.rc = new Rectangle( 0xab, 3, 11, 0x1b ); + st譁蟄鈴伜沺Array[ 7 ] = st譁蟄鈴伜沺8; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺9 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺9.ch = '('; + st譁蟄鈴伜沺9.rc = new Rectangle( 0xc0, 3, 0x10, 0x1b ); + st譁蟄鈴伜沺Array[ 8 ] = st譁蟄鈴伜沺9; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺10 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺10.ch = ')'; + st譁蟄鈴伜沺10.rc = new Rectangle( 0xd0, 3, 0x10, 0x1b ); + st譁蟄鈴伜沺Array[ 9 ] = st譁蟄鈴伜沺10; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺11 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺11.ch = '*'; + st譁蟄鈴伜沺11.rc = new Rectangle( 0xe2, 3, 0x15, 0x1b ); + st譁蟄鈴伜沺Array[ 10 ] = st譁蟄鈴伜沺11; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺12 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺12.ch = '+'; + st譁蟄鈴伜沺12.rc = new Rectangle( 2, 0x1f, 0x18, 0x1b ); + st譁蟄鈴伜沺Array[ 11 ] = st譁蟄鈴伜沺12; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺13 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺13.ch = ','; + st譁蟄鈴伜沺13.rc = new Rectangle( 0x1b, 0x1f, 11, 0x1b ); + st譁蟄鈴伜沺Array[ 12 ] = st譁蟄鈴伜沺13; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺14 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺14.ch = '-'; + st譁蟄鈴伜沺14.rc = new Rectangle( 0x29, 0x1f, 13, 0x1b ); + st譁蟄鈴伜沺Array[ 13 ] = st譁蟄鈴伜沺14; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺15 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺15.ch = '.'; + st譁蟄鈴伜沺15.rc = new Rectangle( 0x37, 0x1f, 11, 0x1b ); + st譁蟄鈴伜沺Array[ 14 ] = st譁蟄鈴伜沺15; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺16 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺16.ch = '/'; + st譁蟄鈴伜沺16.rc = new Rectangle( 0x44, 0x1f, 0x15, 0x1b ); + st譁蟄鈴伜沺Array[ 15 ] = st譁蟄鈴伜沺16; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺17 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺17.ch = '0'; + st譁蟄鈴伜沺17.rc = new Rectangle( 0x5b, 0x1f, 20, 0x1b ); + st譁蟄鈴伜沺Array[ 0x10 ] = st譁蟄鈴伜沺17; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺18 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺18.ch = '1'; + st譁蟄鈴伜沺18.rc = new Rectangle( 0x75, 0x1f, 14, 0x1b ); + st譁蟄鈴伜沺Array[ 0x11 ] = st譁蟄鈴伜沺18; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺19 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺19.ch = '2'; + st譁蟄鈴伜沺19.rc = new Rectangle( 0x86, 0x1f, 0x15, 0x1b ); + st譁蟄鈴伜沺Array[ 0x12 ] = st譁蟄鈴伜沺19; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺20 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺20.ch = '3'; + st譁蟄鈴伜沺20.rc = new Rectangle( 0x9d, 0x1f, 20, 0x1b ); + st譁蟄鈴伜沺Array[ 0x13 ] = st譁蟄鈴伜沺20; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺21 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺21.ch = '4'; + st譁蟄鈴伜沺21.rc = new Rectangle( 0xb3, 0x1f, 20, 0x1b ); + st譁蟄鈴伜沺Array[ 20 ] = st譁蟄鈴伜沺21; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺22 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺22.ch = '5'; + st譁蟄鈴伜沺22.rc = new Rectangle( 0xca, 0x1f, 0x13, 0x1b ); + st譁蟄鈴伜沺Array[ 0x15 ] = st譁蟄鈴伜沺22; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺23 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺23.ch = '6'; + st譁蟄鈴伜沺23.rc = new Rectangle( 0xe0, 0x1f, 20, 0x1b ); + st譁蟄鈴伜沺Array[ 0x16 ] = st譁蟄鈴伜沺23; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺24 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺24.ch = '7'; + st譁蟄鈴伜沺24.rc = new Rectangle( 4, 0x3b, 0x13, 0x1b ); + st譁蟄鈴伜沺Array[ 0x17 ] = st譁蟄鈴伜沺24; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺25 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺25.ch = '8'; + st譁蟄鈴伜沺25.rc = new Rectangle( 0x18, 0x3b, 20, 0x1b ); + st譁蟄鈴伜沺Array[ 0x18 ] = st譁蟄鈴伜沺25; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺26 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺26.ch = '9'; + st譁蟄鈴伜沺26.rc = new Rectangle( 0x2f, 0x3b, 0x13, 0x1b ); + st譁蟄鈴伜沺Array[ 0x19 ] = st譁蟄鈴伜沺26; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺27 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺27.ch = ':'; + st譁蟄鈴伜沺27.rc = new Rectangle( 0x44, 0x3b, 12, 0x1b ); + st譁蟄鈴伜沺Array[ 0x1a ] = st譁蟄鈴伜沺27; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺28 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺28.ch = ';'; + st譁蟄鈴伜沺28.rc = new Rectangle( 0x51, 0x3b, 13, 0x1b ); + st譁蟄鈴伜沺Array[ 0x1b ] = st譁蟄鈴伜沺28; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺29 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺29.ch = '<'; + st譁蟄鈴伜沺29.rc = new Rectangle( 0x60, 0x3b, 20, 0x1b ); + st譁蟄鈴伜沺Array[ 0x1c ] = st譁蟄鈴伜沺29; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺30 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺30.ch = '='; + st譁蟄鈴伜沺30.rc = new Rectangle( 0x74, 0x3b, 0x11, 0x1b ); + st譁蟄鈴伜沺Array[ 0x1d ] = st譁蟄鈴伜沺30; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺31 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺31.ch = '>'; + st譁蟄鈴伜沺31.rc = new Rectangle( 0x85, 0x3b, 20, 0x1b ); + st譁蟄鈴伜沺Array[ 30 ] = st譁蟄鈴伜沺31; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺32 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺32.ch = '?'; + st譁蟄鈴伜沺32.rc = new Rectangle( 0x9c, 0x3b, 20, 0x1b ); + st譁蟄鈴伜沺Array[ 0x1f ] = st譁蟄鈴伜沺32; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺33 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺33.ch = 'A'; + st譁蟄鈴伜沺33.rc = new Rectangle( 0xb1, 0x3b, 0x17, 0x1b ); + st譁蟄鈴伜沺Array[ 0x20 ] = st譁蟄鈴伜沺33; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺34 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺34.ch = 'B'; + st譁蟄鈴伜沺34.rc = new Rectangle( 0xcb, 0x3b, 0x15, 0x1b ); + st譁蟄鈴伜沺Array[ 0x21 ] = st譁蟄鈴伜沺34; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺35 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺35.ch = 'C'; + st譁蟄鈴伜沺35.rc = new Rectangle( 0xe3, 0x3b, 0x16, 0x1b ); + st譁蟄鈴伜沺Array[ 0x22 ] = st譁蟄鈴伜沺35; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺36 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺36.ch = 'D'; + st譁蟄鈴伜沺36.rc = new Rectangle( 2, 0x57, 0x16, 0x1b ); + st譁蟄鈴伜沺Array[ 0x23 ] = st譁蟄鈴伜沺36; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺37 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺37.ch = 'E'; + st譁蟄鈴伜沺37.rc = new Rectangle( 0x1a, 0x57, 0x16, 0x1b ); + st譁蟄鈴伜沺Array[ 0x24 ] = st譁蟄鈴伜沺37; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺38 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺38.ch = 'F'; + st譁蟄鈴伜沺38.rc = new Rectangle( 0x30, 0x57, 0x16, 0x1b ); + st譁蟄鈴伜沺Array[ 0x25 ] = st譁蟄鈴伜沺38; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺39 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺39.ch = 'G'; + st譁蟄鈴伜沺39.rc = new Rectangle( 0x48, 0x57, 0x16, 0x1b ); + st譁蟄鈴伜沺Array[ 0x26 ] = st譁蟄鈴伜沺39; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺40 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺40.ch = 'H'; + st譁蟄鈴伜沺40.rc = new Rectangle( 0x61, 0x57, 0x18, 0x1b ); + st譁蟄鈴伜沺Array[ 0x27 ] = st譁蟄鈴伜沺40; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺41 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺41.ch = 'I'; + st譁蟄鈴伜沺41.rc = new Rectangle( 0x7a, 0x57, 13, 0x1b ); + st譁蟄鈴伜沺Array[ 40 ] = st譁蟄鈴伜沺41; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺42 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺42.ch = 'J'; + st譁蟄鈴伜沺42.rc = new Rectangle( 0x88, 0x57, 20, 0x1b ); + st譁蟄鈴伜沺Array[ 0x29 ] = st譁蟄鈴伜沺42; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺43 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺43.ch = 'K'; + st譁蟄鈴伜沺43.rc = new Rectangle( 0x9d, 0x57, 0x18, 0x1b ); + st譁蟄鈴伜沺Array[ 0x2a ] = st譁蟄鈴伜沺43; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺44 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺44.ch = 'L'; + st譁蟄鈴伜沺44.rc = new Rectangle( 0xb7, 0x57, 20, 0x1b ); + st譁蟄鈴伜沺Array[ 0x2b ] = st譁蟄鈴伜沺44; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺45 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺45.ch = 'M'; + st譁蟄鈴伜沺45.rc = new Rectangle( 0xce, 0x57, 0x1a, 0x1b ); + st譁蟄鈴伜沺Array[ 0x2c ] = st譁蟄鈴伜沺45; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺46 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺46.ch = 'N'; + st譁蟄鈴伜沺46.rc = new Rectangle( 0xe9, 0x57, 0x17, 0x1b ); + st譁蟄鈴伜沺Array[ 0x2d ] = st譁蟄鈴伜沺46; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺47 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺47.ch = 'O'; + st譁蟄鈴伜沺47.rc = new Rectangle( 2, 0x73, 0x18, 0x1b ); + st譁蟄鈴伜沺Array[ 0x2e ] = st譁蟄鈴伜沺47; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺48 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺48.ch = 'P'; + st譁蟄鈴伜沺48.rc = new Rectangle( 0x1c, 0x73, 0x15, 0x1b ); + st譁蟄鈴伜沺Array[ 0x2f ] = st譁蟄鈴伜沺48; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺49 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺49.ch = 'Q'; + st譁蟄鈴伜沺49.rc = new Rectangle( 0x33, 0x73, 0x17, 0x1b ); + st譁蟄鈴伜沺Array[ 0x30 ] = st譁蟄鈴伜沺49; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺50 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺50.ch = 'R'; + st譁蟄鈴伜沺50.rc = new Rectangle( 0x4c, 0x73, 0x16, 0x1b ); + st譁蟄鈴伜沺Array[ 0x31 ] = st譁蟄鈴伜沺50; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺51 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺51.ch = 'S'; + st譁蟄鈴伜沺51.rc = new Rectangle( 100, 0x73, 0x15, 0x1b ); + st譁蟄鈴伜沺Array[ 50 ] = st譁蟄鈴伜沺51; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺52 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺52.ch = 'T'; + st譁蟄鈴伜沺52.rc = new Rectangle( 0x7c, 0x73, 0x16, 0x1b ); + st譁蟄鈴伜沺Array[ 0x33 ] = st譁蟄鈴伜沺52; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺53 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺53.ch = 'U'; + st譁蟄鈴伜沺53.rc = new Rectangle( 0x93, 0x73, 0x16, 0x1b ); + st譁蟄鈴伜沺Array[ 0x34 ] = st譁蟄鈴伜沺53; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺54 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺54.ch = 'V'; + st譁蟄鈴伜沺54.rc = new Rectangle( 0xad, 0x73, 0x16, 0x1b ); + st譁蟄鈴伜沺Array[ 0x35 ] = st譁蟄鈴伜沺54; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺55 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺55.ch = 'W'; + st譁蟄鈴伜沺55.rc = new Rectangle( 0xc5, 0x73, 0x1a, 0x1b ); + st譁蟄鈴伜沺Array[ 0x36 ] = st譁蟄鈴伜沺55; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺56 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺56.ch = 'X'; + st譁蟄鈴伜沺56.rc = new Rectangle( 0xe0, 0x73, 0x1a, 0x1b ); + st譁蟄鈴伜沺Array[ 0x37 ] = st譁蟄鈴伜沺56; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺57 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺57.ch = 'Y'; + st譁蟄鈴伜沺57.rc = new Rectangle( 4, 0x8f, 0x17, 0x1b ); + st譁蟄鈴伜沺Array[ 0x38 ] = st譁蟄鈴伜沺57; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺58 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺58.ch = 'Z'; + st譁蟄鈴伜沺58.rc = new Rectangle( 0x1b, 0x8f, 0x16, 0x1b ); + st譁蟄鈴伜沺Array[ 0x39 ] = st譁蟄鈴伜沺58; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺59 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺59.ch = '['; + st譁蟄鈴伜沺59.rc = new Rectangle( 0x31, 0x8f, 0x11, 0x1b ); + st譁蟄鈴伜沺Array[ 0x3a ] = st譁蟄鈴伜沺59; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺60 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺60.ch = '\\'; + st譁蟄鈴伜沺60.rc = new Rectangle( 0x42, 0x8f, 0x19, 0x1b ); + st譁蟄鈴伜沺Array[ 0x3b ] = st譁蟄鈴伜沺60; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺61 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺61.ch = ']'; + st譁蟄鈴伜沺61.rc = new Rectangle( 0x5c, 0x8f, 0x11, 0x1b ); + st譁蟄鈴伜沺Array[ 60 ] = st譁蟄鈴伜沺61; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺62 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺62.ch = '^'; + st譁蟄鈴伜沺62.rc = new Rectangle( 0x71, 0x8f, 0x10, 0x1b ); + st譁蟄鈴伜沺Array[ 0x3d ] = st譁蟄鈴伜沺62; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺63 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺63.ch = '_'; + st譁蟄鈴伜沺63.rc = new Rectangle( 0x81, 0x8f, 0x13, 0x1b ); + st譁蟄鈴伜沺Array[ 0x3e ] = st譁蟄鈴伜沺63; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺64 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺64.ch = 'a'; + st譁蟄鈴伜沺64.rc = new Rectangle( 150, 0x8f, 0x13, 0x1b ); + st譁蟄鈴伜沺Array[ 0x3f ] = st譁蟄鈴伜沺64; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺65 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺65.ch = 'b'; + st譁蟄鈴伜沺65.rc = new Rectangle( 0xac, 0x8f, 20, 0x1b ); + st譁蟄鈴伜沺Array[ 0x40 ] = st譁蟄鈴伜沺65; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺66 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺66.ch = 'c'; + st譁蟄鈴伜沺66.rc = new Rectangle( 0xc3, 0x8f, 0x12, 0x1b ); + st譁蟄鈴伜沺Array[ 0x41 ] = st譁蟄鈴伜沺66; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺67 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺67.ch = 'd'; + st譁蟄鈴伜沺67.rc = new Rectangle( 0xd8, 0x8f, 0x15, 0x1b ); + st譁蟄鈴伜沺Array[ 0x42 ] = st譁蟄鈴伜沺67; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺68 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺68.ch = 'e'; + st譁蟄鈴伜沺68.rc = new Rectangle( 2, 0xab, 0x13, 0x1b ); + st譁蟄鈴伜沺Array[ 0x43 ] = st譁蟄鈴伜沺68; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺69 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺69.ch = 'f'; + st譁蟄鈴伜沺69.rc = new Rectangle( 0x17, 0xab, 0x11, 0x1b ); + st譁蟄鈴伜沺Array[ 0x44 ] = st譁蟄鈴伜沺69; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺70 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺70.ch = 'g'; + st譁蟄鈴伜沺70.rc = new Rectangle( 40, 0xab, 0x15, 0x1b ); + st譁蟄鈴伜沺Array[ 0x45 ] = st譁蟄鈴伜沺70; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺71 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺71.ch = 'h'; + st譁蟄鈴伜沺71.rc = new Rectangle( 0x3f, 0xab, 20, 0x1b ); + st譁蟄鈴伜沺Array[ 70 ] = st譁蟄鈴伜沺71; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺72 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺72.ch = 'i'; + st譁蟄鈴伜沺72.rc = new Rectangle( 0x55, 0xab, 13, 0x1b ); + st譁蟄鈴伜沺Array[ 0x47 ] = st譁蟄鈴伜沺72; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺73 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺73.ch = 'j'; + st譁蟄鈴伜沺73.rc = new Rectangle( 0x62, 0xab, 0x10, 0x1b ); + st譁蟄鈴伜沺Array[ 0x48 ] = st譁蟄鈴伜沺73; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺74 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺74.ch = 'k'; + st譁蟄鈴伜沺74.rc = new Rectangle( 0x74, 0xab, 20, 0x1b ); + st譁蟄鈴伜沺Array[ 0x49 ] = st譁蟄鈴伜沺74; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺75 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺75.ch = 'l'; + st譁蟄鈴伜沺75.rc = new Rectangle( 0x8a, 0xab, 13, 0x1b ); + st譁蟄鈴伜沺Array[ 0x4a ] = st譁蟄鈴伜沺75; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺76 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺76.ch = 'm'; + st譁蟄鈴伜沺76.rc = new Rectangle( 0x98, 0xab, 0x1a, 0x1b ); + st譁蟄鈴伜沺Array[ 0x4b ] = st譁蟄鈴伜沺76; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺77 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺77.ch = 'n'; + st譁蟄鈴伜沺77.rc = new Rectangle( 0xb5, 0xab, 20, 0x1b ); + st譁蟄鈴伜沺Array[ 0x4c ] = st譁蟄鈴伜沺77; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺78 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺78.ch = 'o'; + st譁蟄鈴伜沺78.rc = new Rectangle( 0xcc, 0xab, 0x13, 0x1b ); + st譁蟄鈴伜沺Array[ 0x4d ] = st譁蟄鈴伜沺78; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺79 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺79.ch = 'p'; + st譁蟄鈴伜沺79.rc = new Rectangle( 0xe1, 0xab, 0x15, 0x1b ); + st譁蟄鈴伜沺Array[ 0x4e ] = st譁蟄鈴伜沺79; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺80 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺80.ch = 'q'; + st譁蟄鈴伜沺80.rc = new Rectangle( 2, 0xc7, 20, 0x1b ); + st譁蟄鈴伜沺Array[ 0x4f ] = st譁蟄鈴伜沺80; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺81 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺81.ch = 'r'; + st譁蟄鈴伜沺81.rc = new Rectangle( 0x18, 0xc7, 0x12, 0x1b ); + st譁蟄鈴伜沺Array[ 80 ] = st譁蟄鈴伜沺81; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺82 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺82.ch = 's'; + st譁蟄鈴伜沺82.rc = new Rectangle( 0x2a, 0xc7, 0x13, 0x1b ); + st譁蟄鈴伜沺Array[ 0x51 ] = st譁蟄鈴伜沺82; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺83 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺83.ch = 't'; + st譁蟄鈴伜沺83.rc = new Rectangle( 0x3f, 0xc7, 0x10, 0x1b ); + st譁蟄鈴伜沺Array[ 0x52 ] = st譁蟄鈴伜沺83; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺84 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺84.ch = 'u'; + st譁蟄鈴伜沺84.rc = new Rectangle( 80, 0xc7, 20, 0x1b ); + st譁蟄鈴伜沺Array[ 0x53 ] = st譁蟄鈴伜沺84; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺85 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺85.ch = 'v'; + st譁蟄鈴伜沺85.rc = new Rectangle( 0x68, 0xc7, 20, 0x1b ); + st譁蟄鈴伜沺Array[ 0x54 ] = st譁蟄鈴伜沺85; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺86 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺86.ch = 'w'; + st譁蟄鈴伜沺86.rc = new Rectangle( 0x7f, 0xc7, 0x1a, 0x1b ); + st譁蟄鈴伜沺Array[ 0x55 ] = st譁蟄鈴伜沺86; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺87 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺87.ch = 'x'; + st譁蟄鈴伜沺87.rc = new Rectangle( 0x9a, 0xc7, 0x16, 0x1b ); + st譁蟄鈴伜沺Array[ 0x56 ] = st譁蟄鈴伜沺87; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺88 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺88.ch = 'y'; + st譁蟄鈴伜沺88.rc = new Rectangle( 0xb1, 0xc7, 0x16, 0x1b ); + st譁蟄鈴伜沺Array[ 0x57 ] = st譁蟄鈴伜沺88; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺89 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺89.ch = 'z'; + st譁蟄鈴伜沺89.rc = new Rectangle( 200, 0xc7, 0x13, 0x1b ); + st譁蟄鈴伜沺Array[ 0x58 ] = st譁蟄鈴伜沺89; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺90 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺90.ch = '{'; + st譁蟄鈴伜沺90.rc = new Rectangle( 220, 0xc7, 15, 0x1b ); + st譁蟄鈴伜沺Array[ 0x59 ] = st譁蟄鈴伜沺90; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺91 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺91.ch = '|'; + st譁蟄鈴伜沺91.rc = new Rectangle( 0xeb, 0xc7, 13, 0x1b ); + st譁蟄鈴伜沺Array[ 90 ] = st譁蟄鈴伜沺91; + st譁蟄鈴伜沺94 = new ST譁蟄鈴伜沺(); + ST譁蟄鈴伜沺 st譁蟄鈴伜沺92 = st譁蟄鈴伜沺94; + st譁蟄鈴伜沺92.ch = '}'; + st譁蟄鈴伜沺92.rc = new Rectangle( 1, 0xe3, 15, 0x1b ); + st譁蟄鈴伜沺Array[ 0x5b ] = st譁蟄鈴伜沺92; + ST譁蟄鈴伜沺 st譁蟄鈴伜沺93 = new ST譁蟄鈴伜沺(); + st譁蟄鈴伜沺93.ch = '~'; + st譁蟄鈴伜沺93.rc = new Rectangle( 0x12, 0xe3, 0x12, 0x1b ); + st譁蟄鈴伜沺Array[ 0x5c ] = st譁蟄鈴伜沺93; + + st譁蟄鈴伜沺Array[ 0x5d ] = new ST譁蟄鈴伜沺(); // #24954 2011.4.23 yyagi + st譁蟄鈴伜沺Array[ 0x5d ].ch = '@'; + st譁蟄鈴伜沺Array[ 0x5d ].rc = new Rectangle( 38, 227, 28, 28 ); + st譁蟄鈴伜沺Array[ 0x5e ] = new ST譁蟄鈴伜沺(); + st譁蟄鈴伜沺Array[ 0x5e ].ch = '`'; + st譁蟄鈴伜沺Array[ 0x5e ].rc = new Rectangle( 69, 226, 14, 29 ); + + + this.st譁蟄鈴伜沺 = st譁蟄鈴伜沺Array; + } + + + // 繝。繧ス繝繝 + + public int n譁蟄怜鈴聞dot( string str ) + { + return this.n譁蟄怜鈴聞dot( str, 1f ); + } + public int n譁蟄怜鈴聞dot( string str, float fScale ) + { + if( string.IsNullOrEmpty( str ) ) + { + return 0; + } + int num = 0; + foreach( char ch in str ) + { + foreach( ST譁蟄鈴伜沺 st譁蟄鈴伜沺 in this.st譁蟄鈴伜沺 ) + { + if( st譁蟄鈴伜沺.ch == ch ) + { + num += (int) ( ( st譁蟄鈴伜沺.rc.Width - 5 ) * fScale ); + break; + } + } + } + return num; + } + public void t譁蟄怜玲緒逕サ( int x, int y, string str ) + { + this.t譁蟄怜玲緒逕サ( x, y, str, false, 1f ); + } + public void t譁蟄怜玲緒逕サ( int x, int y, string str, bool b蠑キ隱ソ ) + { + this.t譁蟄怜玲緒逕サ( x, y, str, b蠑キ隱ソ, 1f ); + } + public void t譁蟄怜玲緒逕サ( int x, int y, string str, bool b蠑キ隱ソ, float fScale ) + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 && !string.IsNullOrEmpty( str ) ) + { + CTexture texture = b蠑キ隱ソ ? TJAPlayer3.Tx.Config_Font_Bold : TJAPlayer3.Tx.Config_Font; + if( texture != null ) + { + texture.vc諡。螟ァ邵ョ蟆丞咲紫 = new Vector3( fScale, fScale, 1f ); + foreach( char ch in str ) + { + foreach( ST譁蟄鈴伜沺 st譁蟄鈴伜沺 in this.st譁蟄鈴伜沺 ) + { + if( st譁蟄鈴伜沺.ch == ch ) + { + texture.t2D謠冗判( TJAPlayer3.app.Device, x, y, st譁蟄鈴伜沺.rc ); + x += (int) ( ( st譁蟄鈴伜沺.rc.Width - 5 ) * fScale ); + break; + } + } + } + } + } + } + + + // CActivity 螳溯」 + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //this.tx騾壼クク譁蟄 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\Screen font dfp.png" ), false ); + //this.tx蠑キ隱ソ譁蟄 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\Screen font dfp em.png" ), false ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + //if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + //{ + // if( this.tx蠑キ隱ソ譁蟄 != null ) + // { + // this.tx蠑キ隱ソ譁蟄.Dispose(); + // this.tx蠑キ隱ソ譁蟄 = null; + // } + // if( this.tx騾壼クク譁蟄 != null ) + // { + // this.tx騾壼クク譁蟄.Dispose(); + // this.tx騾壼クク譁蟄 = null; + // } + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + //} + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + [StructLayout( LayoutKind.Sequential )] + private struct ST譁蟄鈴伜沺 + { + public char ch; + public Rectangle rc; + } + + private readonly ST譁蟄鈴伜沺[] st譁蟄鈴伜沺; + //private CTexture tx蠑キ隱ソ譁蟄; + //private CTexture tx騾壼クク譁蟄; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/CActFIFOBlack.cs b/TJAPlayer3/Stages/CActFIFOBlack.cs new file mode 100644 index 00000000..e168a5c7 --- /dev/null +++ b/TJAPlayer3/Stages/CActFIFOBlack.cs @@ -0,0 +1,81 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Diagnostics; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActFIFOBlack : CActivity + { + // 繝。繧ス繝繝 + + public void t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋(int start = 0, int end = 100, int interval = 5) + { + this.mode = EFIFO繝「繝シ繝.繝輔ぉ繝シ繝峨い繧ヲ繝; + this.counter = new CCounter(start, end, interval, TJAPlayer3.Timer ); + } + public void t繝輔ぉ繝シ繝峨う繝ウ髢句ァ(int start = 0, int end = 100, int interval = 5) + { + this.mode = EFIFO繝「繝シ繝.繝輔ぉ繝シ繝峨う繝ウ; + this.counter = new CCounter(start, end, interval, TJAPlayer3.Timer ); + } + + + // CActivity 螳溯」 + + public override void On髱樊エサ諤ァ蛹() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx鮟偵ち繧、繝ォ64x64 ); + base.On髱樊エサ諤ァ蛹(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //this.tx鮟偵ち繧、繝ォ64x64 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\Tile black 64x64.png" ), false ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 || ( this.counter == null ) ) + { + return 0; + } + this.counter.t騾イ陦(); + // Size clientSize = CDTXMania.app.Window.ClientSize; // #23510 2010.10.31 yyagi: delete as of no one use this any longer. + if (TJAPlayer3.Tx.Tile_Black != null) + { + TJAPlayer3.Tx.Tile_Black.Opacity = ( this.mode == EFIFO繝「繝シ繝.繝輔ぉ繝シ繝峨う繝ウ ) ? ( ( ( 100 - this.counter.n迴セ蝨ィ縺ョ蛟、 ) * 0xff ) / 100 ) : ( ( this.counter.n迴セ蝨ィ縺ョ蛟、 * 0xff ) / 100 ); + for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / 64); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size + { + for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / 64); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size + { + TJAPlayer3.Tx.Tile_Black.t2D謠冗判( TJAPlayer3.app.Device, i * 64, j * 64 ); + } + } + } + if( this.counter.n迴セ蝨ィ縺ョ蛟、 != this.counter.n邨ゆコ蛟、 ) + { + return 0; + } + return 1; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private CCounter counter; + private EFIFO繝「繝シ繝 mode; + //private CTexture tx鮟偵ち繧、繝ォ64x64; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/CActFIFOResult.cs b/TJAPlayer3/Stages/CActFIFOResult.cs new file mode 100644 index 00000000..acde502d --- /dev/null +++ b/TJAPlayer3/Stages/CActFIFOResult.cs @@ -0,0 +1,110 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Diagnostics; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActFIFOResult : CActivity + { + // 繝。繧ス繝繝 + + public void t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋() + { + this.mode = EFIFO繝「繝シ繝.繝輔ぉ繝シ繝峨い繧ヲ繝; + this.counter = new CCounter(0, 100, 30, TJAPlayer3.Timer); + } + public void t繝輔ぉ繝シ繝峨う繝ウ髢句ァ() + { + this.mode = EFIFO繝「繝シ繝.繝輔ぉ繝シ繝峨う繝ウ; + this.counter = new CCounter(0, 300, 2, TJAPlayer3.Timer); + } + public void t繝輔ぉ繝シ繝峨う繝ウ螳御コ() + { + this.counter.n迴セ蝨ィ縺ョ蛟、 = (int)counter.n髢句ァ句、; + } + + + // CActivity 螳溯」 + + public override void On髱樊エサ諤ァ蛹() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx鮟偵ち繧、繝ォ64x64 ); + base.On髱樊エサ諤ァ蛹(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + //this.tx鮟偵ち繧、繝ォ64x64 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\Tile black 64x64.png" ), false ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if (base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 || (this.counter == null)) + { + return 0; + } + this.counter.t騾イ陦(); + // Size clientSize = CDTXMania.app.Window.ClientSize; // #23510 2010.10.31 yyagi: delete as of no one use this any longer. + if (TJAPlayer3.Tx.Tile_Black != null) + { + if (this.mode == EFIFO繝「繝シ繝.繝輔ぉ繝シ繝峨う繝ウ) + { + if (counter.n迴セ蝨ィ縺ョ蛟、 >= 200) + { + TJAPlayer3.Tx.Tile_Black.Opacity = (((100 - (this.counter.n迴セ蝨ィ縺ョ蛟、 - 200)) * 0xff) / 100); + } + else + { + TJAPlayer3.Tx.Tile_Black.Opacity = 255; + } + } + else + { + TJAPlayer3.Tx.Tile_Black.Opacity = (((this.counter.n迴セ蝨ィ縺ョ蛟、) * 0xff) / 100); + } + + for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / 64); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size + { + for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / 64); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size + { + TJAPlayer3.Tx.Tile_Black.t2D謠冗判(TJAPlayer3.app.Device, i * 64, j * 64); + } + } + } + if (this.mode == EFIFO繝「繝シ繝.繝輔ぉ繝シ繝峨い繧ヲ繝) + { + if (this.counter.n迴セ蝨ィ縺ョ蛟、 != 100) + { + return 0; + } + } + else + { + if (this.counter.n迴セ蝨ィ縺ョ蛟、 != 300) + { + return 0; + } + } + return 1; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private CCounter counter; + private EFIFO繝「繝シ繝 mode; + //private CTexture tx鮟偵ち繧、繝ォ64x64; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/CActFIFOStart.cs b/TJAPlayer3/Stages/CActFIFOStart.cs new file mode 100644 index 00000000..d5bbb084 --- /dev/null +++ b/TJAPlayer3/Stages/CActFIFOStart.cs @@ -0,0 +1,213 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActFIFOStart : CActivity + { + // 繝。繧ス繝繝 + + public void t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋() + { + this.mode = EFIFO繝「繝シ繝.繝輔ぉ繝シ繝峨い繧ヲ繝; + + TJAPlayer3.Skin.soundDanSelectBGM.t蛛懈ュ「縺吶k(); + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan) + this.counter = new CCounter(0, 1255, 1, TJAPlayer3.Timer); + else + this.counter = new CCounter(0, 3580, 1, TJAPlayer3.Timer); + } + public void t繝輔ぉ繝シ繝峨う繝ウ髢句ァ() + { + this.mode = EFIFO繝「繝シ繝.繝輔ぉ繝シ繝峨う繝ウ; + + if (TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan) + { + this.counter = new CCounter(0, 255, 1, TJAPlayer3.Timer); + + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.actDan.Start(TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.ListDan_Number); + TJAPlayer3.stage貍泌・上ラ繝ゥ繝逕サ髱「.ListDan_Number++; + } + else + this.counter = new CCounter(0, 3580, 1, TJAPlayer3.Timer); + } + public void t繝輔ぉ繝シ繝峨う繝ウ螳御コ() // #25406 2011.6.9 yyagi + { + this.counter.n迴セ蝨ィ縺ョ蛟、 = (int)this.counter.n邨ゆコ蛟、; + } + + // CActivity 螳溯」 + + public override void On髱樊エサ諤ァ蛹() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx蟷 ); + base.On髱樊エサ諤ァ蛹(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + //this.tx蟷 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\6_FO.png" ) ); + // this.tx蟷2 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\6_FI.png" ) ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if (base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 || (this.counter == null)) + { + return 0; + } + this.counter.t騾イ陦(); + + if(TJAPlayer3.stage驕ク譖イ.n遒コ螳壹&繧後◆譖イ縺ョ髮」譏灘コヲ[0] == (int)Difficulty.Dan) + { + if (TJAPlayer3.Tx.Tile_Black != null) + { + TJAPlayer3.Tx.Tile_Black.Opacity = this.mode == EFIFO繝「繝シ繝.繝輔ぉ繝シ繝峨い繧ヲ繝 ? -1000 + counter.n迴セ蝨ィ縺ョ蛟、 : 255 - counter.n迴セ蝨ィ縺ョ蛟、; + for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / 64); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size + { + for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / 64); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size + { + TJAPlayer3.Tx.Tile_Black.t2D謠冗判(TJAPlayer3.app.Device, i * 64, j * 64); + } + } + } + } + else + { + if (this.mode == EFIFO繝「繝シ繝.繝輔ぉ繝シ繝峨い繧ヲ繝) + { + if (TJAPlayer3.Tx.SongLoading_Fade != null) + { + // 譖イ髢句ァ句ケ輔い繝九Γ縲 + // 蝨ー蜻ウ縺ォ讓ェ縺ョ諡。螟ァ邇縺悟、牙虚縺励※縺繧九ョ縺御ク逡ェ蜴莉... + var time = this.counter.n迴セ蝨ィ縺ョ蛟、 >= 2580 ? this.counter.n迴セ蝨ィ縺ョ蛟、 - 2580 : 0; + var FadeValue = (time - 670f) / 330.0f; + if (FadeValue >= 1.0) FadeValue = 1.0f; else if (FadeValue <= 0.0) FadeValue = 0.0f; + + DrawBack(time < 500.0 ? TJAPlayer3.Tx.SongLoading_Fade : TJAPlayer3.Tx.SongLoading_Bg, time, 0, 500.0, false); + DrawStar(FadeValue * 255f); + DrawPlate(FadeValue * 255f, FadeValue); + DrawChara(time, (time - 730f) * (255f / 270f)); + } + + } + else + { + if (TJAPlayer3.Tx.SongLoading_Fade != null) + { + // 譖イ髢句ァ句ケ輔い繝九Γ縲 + // 蝨ー蜻ウ縺ォ讓ェ縺ョ諡。螟ァ邇縺悟、牙虚縺励※縺繧九ョ縺御ク逡ェ蜴莉... + var time = this.counter.n迴セ蝨ィ縺ョ蛟、; + var FadeValue = time / 140f; + if (FadeValue >= 1.0) FadeValue = 1.0f; else if (FadeValue <= 0.0) FadeValue = 0.0f; + + DrawBack(time < 300.0 ? TJAPlayer3.Tx.SongLoading_Bg : TJAPlayer3.Tx.SongLoading_Fade, time, 300.0, 500.0, true); + DrawStar(255f - (FadeValue * 255f)); + DrawPlate(255f - (FadeValue * 255f), 1f + (FadeValue * 0.5f), 1f - FadeValue); + DrawChara(time, (time <= 80.0 ? 255 : 255f - (float)((Math.Pow((time - 80f), 1.5f) / Math.Pow(220f, 1.5f)) * 255f)), 250f, (time <= 80.0 ? ((time / 80f) * 30f) : 30f - (float)((Math.Pow((time - 80f), 1.5f) / Math.Pow(220f, 1.5f)) * 320f))); + } + } + } + + if (this.mode == EFIFO繝「繝シ繝.繝輔ぉ繝シ繝峨い繧ヲ繝) + { + if (this.counter.n迴セ蝨ィ縺ョ蛟、 != this.counter.n邨ゆコ蛟、) + { + return 0; + } + } + else if (this.mode == EFIFO繝「繝シ繝.繝輔ぉ繝シ繝峨う繝ウ) + { + if (this.counter.n迴セ蝨ィ縺ョ蛟、 != this.counter.n邨ゆコ蛟、) + { + return 0; + } + } + return 1; + } + + public void DrawBack(CTexture ShowTex, double time, double max, double end, bool IsExit) + { + if (ShowTex == null) return; + if (time - max >= end) time = end + max; + + var SizeXHarf = ShowTex.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2f; + var SizeY = ShowTex.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height; + var StartScaleX = 0.5f; + var ScaleX = (float)((IsExit ? 1f - StartScaleX : 0f) - ((time >= max ? (time - max) : 0) * ((1f - StartScaleX) / end))) * (IsExit ? 1f : -1f); + var Value = (float)((IsExit ? 1f : 0f) - ((time >= max ? (time - max) : 0) * (1f / end))) * (IsExit ? 1f : -1f); + + ShowTex.vc諡。螟ァ邵ョ蟆丞咲紫.X = StartScaleX + ScaleX; + ShowTex.t2D謠冗判(TJAPlayer3.app.Device, -(SizeXHarf * StartScaleX) + (Value * (SizeXHarf * StartScaleX)), 0, new RectangleF(0, 0, SizeXHarf, SizeY)); + ShowTex.t2D謠冗判(TJAPlayer3.app.Device, (SizeXHarf + (SizeXHarf * StartScaleX)) - (Value * (SizeXHarf * StartScaleX)) + ((1f - ShowTex.vc諡。螟ァ邵ョ蟆丞咲紫.X) * SizeXHarf), 0, new RectangleF(SizeXHarf, 0, SizeXHarf, SizeY)); + + } + /// + /// 繧ュ繝ゥ繧ュ繝ゥ笨ィ + /// + /// + public void DrawStar(float opacity) + { + if (TJAPlayer3.Tx.SongLoading_BgWait is null) return; + + TJAPlayer3.Tx.SongLoading_BgWait.Opacity = (int)opacity; + TJAPlayer3.Tx.SongLoading_BgWait.t2D謠冗判(TJAPlayer3.app.Device, 0, 0); + } + + /// + /// 讓ェ縺ォ莨ク縺ウ繧九励Ξ繝シ繝医r謠冗判 + /// + /// + /// + public void DrawPlate(float opacity, float scaleX, float scaleY = 1f) + { + if (TJAPlayer3.Tx.SongLoading_Plate is null) return; + var SizeX_Harf = TJAPlayer3.Tx.SongLoading_Plate.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2.0f; + var SizeY_Harf = TJAPlayer3.Tx.SongLoading_Plate.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height / 2.0f; + + TJAPlayer3.Tx.SongLoading_Plate.Opacity = (int)opacity; + TJAPlayer3.Tx.SongLoading_Plate.vc諡。螟ァ邵ョ蟆丞咲紫.X = scaleX; + TJAPlayer3.Tx.SongLoading_Plate.vc諡。螟ァ邵ョ蟆丞咲紫.Y = scaleY; + TJAPlayer3.Tx.SongLoading_Plate.t2D謠冗判(TJAPlayer3.app.Device, SizeX_Harf - (SizeX_Harf * scaleX) + (1280.0f / 2.0f) - SizeX_Harf, TJAPlayer3.Skin.SongLoading_Plate_Y - SizeY_Harf + ((1f - scaleY) * SizeY_Harf)); + } + + public void DrawChara(double time, float opacity, float X = -1, float Y = -1) + { + if (TJAPlayer3.Tx.SongLoading_Plate is null || (X == -1 && Y == -1 ? time <= 680 : false)) return; + var SizeXHarf = TJAPlayer3.Tx.SongLoading_Chara.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width / 2f; + var SizeY = TJAPlayer3.Tx.SongLoading_Chara.sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Height; + + if (X == -1 && Y == -1) + { + Y = -(float)(Math.Sin((time - 680f) * (Math.PI / 320.0)) * 80f); + X = (float)((time - 680f) / 320.0) * 250f; + } + + TJAPlayer3.Tx.SongLoading_Chara.Opacity = (int)opacity; + //蟾ヲ縺ゥ繧薙■繧繧 + TJAPlayer3.Tx.SongLoading_Chara.t2D謠冗判(TJAPlayer3.app.Device, -250f + X, Y, new RectangleF(0, 0, SizeXHarf, SizeY)); + //蟾ヲ縺ゥ繧薙■繧繧 + TJAPlayer3.Tx.SongLoading_Chara.t2D謠冗判(TJAPlayer3.app.Device, SizeXHarf + 250f - X, Y, new RectangleF(SizeXHarf, 0, SizeXHarf, SizeY)); + } + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private CCounter counter; + private CCounter ct蠕讖; + private EFIFO繝「繝シ繝 mode; + //private CTexture tx蟷; + //private CTexture tx蟷2; + //----------------- + #endregion + } +} \ No newline at end of file diff --git a/TJAPlayer3/Stages/CActFIFOWhite.cs b/TJAPlayer3/Stages/CActFIFOWhite.cs new file mode 100644 index 00000000..edb386ca --- /dev/null +++ b/TJAPlayer3/Stages/CActFIFOWhite.cs @@ -0,0 +1,84 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using FDK; + +namespace TJAPlayer3 +{ + internal class CActFIFOWhite : CActivity + { + // 繝。繧ス繝繝 + + public void t繝輔ぉ繝シ繝峨い繧ヲ繝磯幕蟋() + { + this.mode = EFIFO繝「繝シ繝.繝輔ぉ繝シ繝峨い繧ヲ繝; + this.counter = new CCounter( 0, 100, 3, TJAPlayer3.Timer ); + } + public void t繝輔ぉ繝シ繝峨う繝ウ髢句ァ() + { + this.mode = EFIFO繝「繝シ繝.繝輔ぉ繝シ繝峨う繝ウ; + this.counter = new CCounter( 0, 100, 3, TJAPlayer3.Timer ); + } + public void t繝輔ぉ繝シ繝峨う繝ウ螳御コ() // #25406 2011.6.9 yyagi + { + this.counter.n迴セ蝨ィ縺ョ蛟、 = (int)this.counter.n邨ゆコ蛟、; + } + + // CActivity 螳溯」 + + public override void On髱樊エサ諤ァ蛹() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx逋ス繧ソ繧、繝ォ64x64 ); + base.On髱樊エサ諤ァ蛹(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + //this.tx逋ス繧ソ繧、繝ォ64x64 = CDTXMania.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\Tile white 64x64.png" ), false ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 || ( this.counter == null ) ) + { + return 0; + } + this.counter.t騾イ陦(); + + // Size clientSize = CDTXMania.app.Window.ClientSize; // #23510 2010.10.31 yyagi: delete as of no one use this any longer. + if (TJAPlayer3.Tx.Tile_Black != null) + { + TJAPlayer3.Tx.Tile_Black.Opacity = ( this.mode == EFIFO繝「繝シ繝.繝輔ぉ繝シ繝峨う繝ウ ) ? ( ( ( 100 - this.counter.n迴セ蝨ィ縺ョ蛟、 ) * 0xff ) / 100 ) : ( ( this.counter.n迴セ蝨ィ縺ョ蛟、 * 0xff ) / 100 ); + for (int i = 0; i <= (SampleFramework.GameWindowSize.Width / 64); i++) // #23510 2010.10.31 yyagi: change "clientSize.Width" to "640" to fix FIFO drawing size + { + for (int j = 0; j <= (SampleFramework.GameWindowSize.Height / 64); j++) // #23510 2010.10.31 yyagi: change "clientSize.Height" to "480" to fix FIFO drawing size + { + TJAPlayer3.Tx.Tile_Black.t2D謠冗判( TJAPlayer3.app.Device, i * 64, j * 64 ); + } + } + } + if( this.counter.n迴セ蝨ィ縺ョ蛟、 != 100 ) + { + return 0; + } + return 1; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private CCounter counter; + private EFIFO繝「繝シ繝 mode; + //private CTexture tx逋ス繧ソ繧、繝ォ64x64; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/CActLVLNFont.cs b/TJAPlayer3/Stages/CActLVLNFont.cs new file mode 100644 index 00000000..33af9ff6 --- /dev/null +++ b/TJAPlayer3/Stages/CActLVLNFont.cs @@ -0,0 +1,126 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using System.Diagnostics; +using SlimDX; +using FDK; + +namespace TJAPlayer3 +{ + public class CActLVLNFont : CActivity + { + // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + const int numWidth = 15; + const int numHeight = 19; + + public CActLVLNFont() + { + string numChars = "0123456789?-"; + st謨ー蟄 = new ST謨ー蟄夕12, 4]; + + for (int j = 0; j < 4; j++) + { + for (int i = 0; i < 12; i++) + { + this.st謨ー蟄夕i, j].ch = numChars[i]; + this.st謨ー蟄夕i, j].rc = new Rectangle( + (i % 4) * numWidth + (j % 2) * 64, + (i / 4) * numHeight + (j / 2) * 64, + numWidth, + numHeight + ); + } + } + } + + + // 繝。繧ス繝繝 + public void t譁蟄怜玲緒逕サ(int x, int y, string str) + { + this.t譁蟄怜玲緒逕サ(x, y, str, EFontColor.White, EFontAlign.Right); + } + public void t譁蟄怜玲緒逕サ(int x, int y, string str, EFontColor efc, EFontAlign efa) + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 && !string.IsNullOrEmpty(str)) + { + if (this.tx謨ー蛟、 != null) + { + bool bRightAlign = (efa == EFontAlign.Right); + + if (bRightAlign) // 蜿ウ隧ー縺ェ繧画枚蟄怜怜渚霆「縺励※蜿ウ縺九i謠冗判 + { + char[] chars = str.ToCharArray(); + Array.Reverse(chars); + str = new string(chars); + } + + foreach (char ch in str) + { + int p = (ch == '-' ? 11 : ch - '0'); + ST謨ー蟄 s = st謨ー蟄夕p, (int)efc]; + int sw = s.rc.Width; + int delta = bRightAlign ? 0 : -sw; + this.tx謨ー蛟、.t2D謠冗判(TJAPlayer3.app.Device, x + delta, y, s.rc); + x += bRightAlign ? -sw : sw; + } + } + } + } + + + // CActivity 螳溯」 + + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + this.tx謨ー蛟、 = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(CSkin.Path(@"Graphics\ScreenSelect level numbers.png")); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ() + { + if (!base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺) + { + if ( this.tx謨ー蛟、 != null ) + { + this.tx謨ー蛟、.Dispose(); + this.tx謨ー蛟、 = null; + } + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ隗」謾セ(); + } + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + [StructLayout(LayoutKind.Sequential)] + private struct ST謨ー蟄 + { + public char ch; + public Rectangle rc; + } + + public enum EFontColor + { + Red = 0, + Yellow = 1, + Orange = 2, + White = 3 + } + public enum EFontAlign + { + Left, + Right + } + private ST謨ー蟄夕,] st謨ー蟄; + private CTexture tx謨ー蛟、; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/CAct繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.cs b/TJAPlayer3/Stages/CAct繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.cs new file mode 100644 index 00000000..eb0ec0a2 --- /dev/null +++ b/TJAPlayer3/Stages/CAct繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.cs @@ -0,0 +1,140 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using SlimDX.Direct3D9; +using FDK; + +using Device = SampleFramework.DeviceCache; + +namespace TJAPlayer3 +{ + internal class CAct繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ : CActivity + { + // CActivity 螳溯」 + + public override void On髱樊エサ諤ァ蛹() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ隗」謾セ( ref this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ ); + base.On髱樊エサ諤ァ蛹(); + } + } + public override void OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓( CSkin.Path( @"Graphics\Screen option panels.png" ), false ); + base.OnManaged繝ェ繧ス繝シ繧ケ縺ョ菴懈(); + } + } + public override int On騾イ陦梧緒逕サ() + { + if( !base.b豢サ諤ァ蛹悶@縺ヲ縺ェ縺 ) + { + Device device = TJAPlayer3.app.Device; + CConfigIni configIni = TJAPlayer3.ConfigIni; + if( this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ != null ) + { + #region [ ScrollSpeed ] + int drums = configIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Drums; + if( drums > 15 ) + { + drums = 15; + } + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x171, 12, this.rc隴憺擇繧ケ繝斐シ繝閏 drums ] ); + int guitar = configIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Guitar; + if( guitar > 15 ) + { + guitar = 15; + } + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x171, 0x18, this.rc隴憺擇繧ケ繝斐シ繝閏 guitar ] ); + int bass = configIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ.Bass; + if( bass > 15 ) + { + bass = 15; + } + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x171, 0x24, this.rc隴憺擇繧ケ繝斐シ繝閏 bass ] ); + #endregion + #region [ Sud/Hid/Invisible ] + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x189, 12, this.rcHS[ ( configIni.bHidden.Drums ? 1 : 0 ) + ( configIni.bSudden.Drums ? 2 : 0 ) + + ( configIni.eInvisible.Drums == EInvisible.SEMI ? 4 : 0 ) + + ( configIni.eInvisible.Drums == EInvisible.FULL ? 5 : 0 ) ] ); + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x189, 0x18, this.rcHS[ ( configIni.bHidden.Guitar ? 1 : 0 ) + ( configIni.bSudden.Guitar ? 2 : 0 ) + + ( configIni.eInvisible.Guitar == EInvisible.SEMI ? 4 : 0 ) + + ( configIni.eInvisible.Guitar == EInvisible.FULL ? 5 : 0 ) ] ); + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x189, 0x24, this.rcHS[ ( configIni.bHidden.Bass ? 1 : 0 ) + ( configIni.bSudden.Bass ? 2 : 0 ) + + ( configIni.eInvisible.Bass == EInvisible.SEMI ? 4 : 0 ) + + ( configIni.eInvisible.Bass == EInvisible.FULL ? 5 : 0 ) ] ); + #endregion + #region [ Dark ] + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x1a1, 12, this.rcDark[ (int) configIni.eDark ] ); + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x1a1, 0x18, this.rcDark[ (int) configIni.eDark ] ); + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x1a1, 0x24, this.rcDark[ (int) configIni.eDark ] ); + #endregion + #region [ Reverse ] + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x1b9, 12, this.rcReverse[ configIni.bReverse.Drums ? 1 : 0 ] ); + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x1b9, 0x18, this.rcReverse[ configIni.bReverse.Guitar ? 1 : 0 ] ); + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x1b9, 0x24, this.rcReverse[ configIni.bReverse.Bass ? 1 : 0 ] ); + #endregion + #region [ Position ] + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x1d1, 12, this.rcPosition[ (int) configIni.蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ.Drums ] ); + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x1d1, 0x18, this.rcPosition[ (int) configIni.蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ.Guitar ] ); + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x1d1, 0x24, this.rcPosition[ (int) configIni.蛻、螳壽枚蟄苓。ィ遉コ菴咲スョ.Bass ] ); + #endregion + #region [ Tight ] + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x1e9, 12, this.rcTight[ configIni.bTight ? 1 : 0 ] ); + #endregion + #region [ Random ] + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x1e9, 0x18, this.rcRandom[ (int) configIni.eRandom.Guitar ] ); + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x1e9, 0x24, this.rcRandom[ (int) configIni.eRandom.Bass ] ); + #endregion + #region [ ComboPosition ] + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x201, 12, new Rectangle(0, 0, 0, 0) ); + #endregion + #region [ Light ] + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x201, 0x18, this.rcLight[ configIni.bLight.Guitar ? 1 : 0 ] ); + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x201, 0x24, this.rcLight[ configIni.bLight.Bass ? 1 : 0 ] ); + #endregion + #region [ Left ] + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x219, 0x18, this.rcLeft[ configIni.bLeft.Guitar ? 1 : 0 ] ); + this.tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ.t2D謠冗判( device, 0x219, 0x24, this.rcLeft[ configIni.bLeft.Bass ? 1 : 0 ] ); + #endregion + } + } + return 0; + } + + + // 縺昴ョ莉 + + #region [ private ] + //----------------- + private readonly Rectangle[] rcComboPos = new Rectangle[] { new Rectangle( 0x30, 0x48, 0x18, 12 ), new Rectangle( 0x30, 60, 0x18, 12 ), new Rectangle( 0x30, 0x30, 0x18, 12 ), new Rectangle( 0x18, 0x48, 0x18, 12 ) }; + private readonly Rectangle[] rcDark = new Rectangle[] { new Rectangle( 0x18, 0, 0x18, 12 ), new Rectangle( 0x18, 12, 0x18, 12 ), new Rectangle( 0x18, 0x54, 0x18, 12 ) }; + private readonly Rectangle[] rcHS = new Rectangle[] { + new Rectangle( 0, 0, 0x18, 12 ), // OFF + new Rectangle( 0, 12, 0x18, 12 ), // Hidden + new Rectangle( 0, 0x18, 0x18, 12 ), // Sudden + new Rectangle( 0, 0x24, 0x18, 12 ), // H/S + new Rectangle(0x60, 0x54, 0x18, 12 ), // Semi-Invisible + new Rectangle( 120, 0x54, 0x18, 12 ) // Full-Invisible + }; + private readonly Rectangle[] rcLeft = new Rectangle[] { new Rectangle( 0x60, 0x48, 0x18, 12 ), new Rectangle( 120, 0x48, 0x18, 12 ) }; + private readonly Rectangle[] rcLight = new Rectangle[] { new Rectangle( 120, 0x30, 0x18, 12 ), new Rectangle( 120, 60, 0x18, 12 ) }; + private readonly Rectangle[] rcPosition = new Rectangle[] { + new Rectangle( 0, 48, 24, 12 ), // P-A + new Rectangle( 0, 60, 24, 12 ), // P-B + new Rectangle( 0, 72, 24, 12 ), // P-B + new Rectangle( 24, 72, 24, 12 ) // OFF + }; + private readonly Rectangle[] rcRandom = new Rectangle[] { new Rectangle( 0x48, 0x30, 0x18, 12 ), new Rectangle( 0x48, 60, 0x18, 12 ), new Rectangle( 0x48, 0x48, 0x18, 12 ), new Rectangle( 0x48, 0x54, 0x18, 12 ) }; + private readonly Rectangle[] rcReverse = new Rectangle[] { new Rectangle( 0x18, 0x18, 0x18, 12 ), new Rectangle( 0x18, 0x24, 0x18, 12 ) }; + private readonly Rectangle[] rcTight = new Rectangle[] { new Rectangle( 0x60, 0x30, 0x18, 12 ), new Rectangle( 0x60, 60, 0x18, 12 ) }; + private readonly Rectangle[] rc隴憺擇繧ケ繝斐シ繝 = new Rectangle[] { new Rectangle( 0x30, 0, 0x18, 12 ), new Rectangle( 0x30, 12, 0x18, 12 ), new Rectangle( 0x30, 0x18, 0x18, 12 ), new Rectangle( 0x30, 0x24, 0x18, 12 ), new Rectangle( 0x48, 0, 0x18, 12 ), new Rectangle( 0x48, 12, 0x18, 12 ), new Rectangle( 0x48, 0x18, 0x18, 12 ), new Rectangle( 0x48, 0x24, 0x18, 12 ), new Rectangle( 0x60, 0, 0x18, 12 ), new Rectangle( 0x60, 12, 0x18, 12 ), new Rectangle( 0x60, 0x18, 0x18, 12 ), new Rectangle( 0x60, 0x24, 0x18, 12 ), new Rectangle( 120, 0, 0x18, 12 ), new Rectangle( 120, 12, 0x18, 12 ), new Rectangle( 120, 0x18, 0x18, 12 ), new Rectangle( 120, 0x24, 0x18, 12 ) }; + private CTexture tx繧ェ繝励す繝ァ繝ウ繝代ロ繝ォ; + //----------------- + #endregion + } +} diff --git a/TJAPlayer3/Stages/CDTXVmode.cs b/TJAPlayer3/Stages/CDTXVmode.cs new file mode 100644 index 00000000..b04b5290 --- /dev/null +++ b/TJAPlayer3/Stages/CDTXVmode.cs @@ -0,0 +1,417 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using System.IO; +using System.Threading; +using FDK; + + +namespace TJAPlayer3 +{ + public class CDTXVmode + { + public enum ECommand + { + Stop, + Play, + Preview + } + + /// + /// DTXV繝「繝シ繝峨°縺ゥ縺縺 + /// + public bool Enabled + { + get; + set; + } + + /// + /// 繝励Ξ繝薙Η繝シ繧オ繧ヲ繝ウ繝峨ョ蜀咲函縺檎匱逕溘@縺 + /// + public bool Preview + { + get; + set; + } + + /// + /// 螟夜Κ縺九i蜀肴欠遉コ縺檎匱逕溘@縺溘° + /// + public bool Refreshed + { + get; + set; + } + + /// + /// 貍泌・城幕蟋句ー冗ッ逡ェ蜿キ + /// + public int nStartBar + { + get; + set; + } + + /// + /// DTX繝輔ぃ繧、繝ォ縺ョ蜀崎ェュ縺ソ霎シ縺ソ縺悟ソ隕√°縺ゥ縺縺 + /// + public bool NeedReload + { + get; + private set; +// private set; // 譛ャ譚・縺ッprivate set縺ォ縺吶∋縺阪□縺後√ョ繝舌ャ繧ー縺檎ー。蜊倥↓縺ェ繧九ョ縺ァ縲√@縺ー繧峨¥縺ッprivate縺ェ縺励ョ縺セ縺セ縺ォ縺吶k縲 + } + + /// + /// DTXC縺九i縺ョ繧ウ繝槭Φ繝 + /// + public ECommand Command + { + get; + private set; + } + + public ESoundDeviceType soundDeviceType + { + get; + private set; + } + public int nASIOdevice + { + get; + private set; + } + /// + /// 蜑榊屓縺九i繧オ繧ヲ繝ウ繝峨ョ繝舌う繧ケ縺悟、画峩縺輔l縺溘° + /// + public bool ChangedSoundDevice + { + get; + private set; + } + + public string filename + { + get + { + return last_path; + } + } + + public string previewFilename + { + get; + private set; + } + public int previewVolume + { + get; + private set; + } + public int previewPan + { + get; + private set; + } + public bool GRmode + { + get; + private set; + } + public bool lastGRmode + { + get; + private set; + } + public bool TimeStretch + { + get; + private set; + } + public bool lastTimeStretch + { + get; + private set; + } + public bool VSyncWait + { + get; + private set; + } + public bool lastVSyncWait + { + get; + private set; + } + + + /// + /// 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + /// + public CDTXVmode() + { + this.last_path = ""; + this.last_timestamp = DateTime.MinValue; + this.Enabled = false; + this.nStartBar = 0; + this.Refreshed = false; + this.NeedReload = false; + this.previewFilename = ""; + this.GRmode = false; + this.lastGRmode = false; + this.TimeStretch = false; + this.lastTimeStretch = false; + this.VSyncWait = true; + this.lastVSyncWait = true; + } + + /// + /// DTX繝輔ぃ繧、繝ォ縺ョ繝ェ繝ュ繝シ繝峨′蠢隕√°縺ゥ縺縺句愛螳壹☆繧 + /// + /// DTX繝輔ぃ繧、繝ォ蜷 + /// 蜀崎ェュ霎シ縺悟ソ隕√↑繧液rue + /// 繝励Ο繝代ユ繧」NeedReload縺ォ繧らオ先棡縺悟・繧 + /// 縺薙l繧貞他縺ウ蜃コ縺吶◆縺ウ縺ォ縲ヽefreshed繧稚rue縺ォ縺吶k + /// + public bool bIsNeedReloadDTX( string filename ) + { + if ( !File.Exists( filename ) ) // 謖螳壹@縺溘ヵ繧。繧、繝ォ縺悟ュ伜惠縺励↑縺縺ェ繧我セ句、也オゆコ + { + Trace.TraceError( "繝輔ぃ繧、繝ォ縺瑚ヲ九▽縺九j縺セ縺帙s縲({0})", filename ); + throw new FileNotFoundException(); + //return false; + } + + this.Refreshed = true; + + // 蜑榊屓縺ィ繝輔ぃ繧、繝ォ蜷阪′逡ー縺ェ繧九°縲√ち繧、繝繧ケ繧ソ繝ウ繝励′譖エ譁ー縺輔l縺ヲ縺繧九°縲 + // GRmode遲峨ョ險ュ螳壹r螟画峩縺励◆縺ェ繧峨.TX隕∵峩譁ー + DateTime current_timestamp = File.GetLastWriteTime( filename ); + if ( last_path != filename || current_timestamp > last_timestamp || + this.lastGRmode != this.GRmode || this.lastTimeStretch != this.TimeStretch || this.lastVSyncWait != this.VSyncWait ) + { + this.last_path = filename; + this.last_timestamp = current_timestamp; + this.lastGRmode = this.GRmode; + this.lastTimeStretch = this.TimeStretch; + this.lastVSyncWait = this.VSyncWait; + + this.NeedReload = true; + return true; + } + this.NeedReload = false; + return false; + } + + /// + /// + /// + /// + /// + /// + /// DTXV逕ィ縺ョ蠑墓焚縺ァ縺ゅl縺ーtrue + /// 蜀驛ィ縺ァEnabled, nStartBar, Command, NeedReload, filename, last_path, last_timestamp繧定ィュ螳壹☆繧 + public bool ParseArguments( string arg ) + { + bool ret = false, analyzing = true; + this.nStartBar = 0; + + if ( arg != null ) + { + while ( analyzing ) + { + if ( arg == "" ) + { + analyzing = false; + } + else if ( arg.StartsWith( "-V", StringComparison.OrdinalIgnoreCase ) ) // 繧オ繧ヲ繝ウ繝牙咲函 + { + // -Vvvv,ppp,"filename"縺ョ蠖「蠑上 vvv=volume, ppp=pan. + this.Enabled = true; + this.Command = ECommand.Preview; + this.Refreshed = true; + ret = true; + arg = arg.Substring( 2 ); + + int pVol = arg.IndexOf( ',' ); //Trace.TraceInformation( "pVol=" + pVol ); + string strVol = arg.Substring( 0, pVol ); //Trace.TraceInformation( "strVol=" + strVol ); + this.previewVolume = Convert.ToInt32( strVol ); //Trace.TraceInformation( "previewVolume=" + previewVolume ); + int pPan = arg.IndexOf( ',', pVol + 1 ); //Trace.TraceInformation( "pPan=" + pPan ); + string strPan = arg.Substring( pVol + 1, pPan - pVol - 1 ); //Trace.TraceInformation( "strPan=" + strPan ); + this.previewPan = Convert.ToInt32( strPan ); //Trace.TraceInformation( "previewPan=" + previewPan ); + + arg = arg.Substring( pPan + 1 ); + arg = arg.Trim( new char[] { '\"' } ); + this.previewFilename = arg; + analyzing = false; + } + // -S -Nxxx filename + else if ( arg.StartsWith( "-S", StringComparison.OrdinalIgnoreCase ) ) // DTXV蜀咲函蛛懈ュ「 + { + this.Enabled = true; + this.Command = ECommand.Stop; + this.Refreshed = true; + ret = true; + arg = arg.Substring( 2 ); + } + else if ( arg.StartsWith( "-D", StringComparison.OrdinalIgnoreCase ) ) + { + // -DW, -DA1縺ェ縺ゥ + arg = arg.Substring( 2 ); // -D 繧貞炎髯、 + switch ( arg[ 0 ] ) + { + #region [ DirectSound ] + case 'D': + if ( this.soundDeviceType != ESoundDeviceType.DirectSound ) + { + this.ChangedSoundDevice = true; + this.soundDeviceType = ESoundDeviceType.DirectSound; + } + else + { + this.ChangedSoundDevice = false; + } + arg = arg.Substring( 1 ); + break; + #endregion + #region [ WASAPI ] + case 'W': + if ( this.soundDeviceType != ESoundDeviceType.ExclusiveWASAPI ) + { + this.ChangedSoundDevice = true; + this.soundDeviceType = ESoundDeviceType.ExclusiveWASAPI; + } + else + { + this.ChangedSoundDevice = false; + } + arg = arg.Substring( 1 ); + break; + #endregion + #region [ ASIO ] + case 'A': + if ( this.soundDeviceType != ESoundDeviceType.ASIO ) + { + this.ChangedSoundDevice = true; + this.soundDeviceType = ESoundDeviceType.ASIO; + } + else + { + this.ChangedSoundDevice = false; + } + arg = arg.Substring( 1 ); + + int nAsioDev = 0, p = 0; + while ( true ) + { + char c = arg[ 0 ]; + if ( '0' <= c && c <= '9' ) + { + nAsioDev *= 10; + nAsioDev += c - '0'; + p++; + arg = arg.Substring( 1 ); + continue; + } + else + { + break; + } + } + if ( this.nASIOdevice != nAsioDev ) + { + this.ChangedSoundDevice = true; + this.nASIOdevice = nAsioDev; + } + break; + #endregion + } + #region [ GRmode, TimeStretch, VSyncWait ] + { + // Reload蛻、螳壹ッ縲-N縺ョ縺ィ縺薙m縺ァ陦後≧ + this.GRmode = ( arg[ 0 ] == 'Y' ); + this.TimeStretch = ( arg[ 1 ] == 'Y' ); + this.VSyncWait = ( arg[ 2 ] == 'Y' ); + + arg = arg.Substring( 3 ); + } + #endregion + } + else if ( arg.StartsWith( "-N", StringComparison.OrdinalIgnoreCase ) ) + { + this.Enabled = true; + this.Command = ECommand.Play; + ret = true; + + arg = arg.Substring( 2 ); // "-N"繧帝勁蜴サ + string[] p = arg.Split( new char[] { ' ' } ); + this.nStartBar = int.Parse( p[ 0 ] ); // 蜀咲函髢句ァ句ー冗ッ + if ( this.nStartBar < 0 ) + { + this.nStartBar = -1; + } + + int startIndex = arg.IndexOf( ' ' ); + string filename = arg.Substring( startIndex + 1 ); // 蜀咲函繝輔ぃ繧、繝ォ蜷(繝輔Ν繝代せ) 縺薙l縺ァ蠑墓焚縺檎オゅo縺」縺ヲ縺繧九%縺ィ繧呈Φ螳 + try + { + filename = filename.Trim( new char[] { '\"' } ); + bIsNeedReloadDTX( filename ); + } + catch (Exception e) // 謖螳壹ヵ繧。繧、繝ォ縺悟ュ伜惠縺励↑縺 + { + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (d309a608-7311-411e-a565-19226c3116c2)" ); + } + arg = ""; + analyzing = false; + } + } + } +string[] s = { "Stop", "Play", "Preview" }; +Trace.TraceInformation( "Command: " + s[ (int) this.Command ] ); + return ret; + } + + /// + /// Viewer髢「騾」縺ョ險ュ螳壹ョ縺ソ繧呈峩譁ー縺励※縲,onfig.ini縺ォ譖ク縺榊コ縺 + /// + public void tUpdateConfigIni() + { + CConfigIni cc = new CConfigIni(); + string path = TJAPlayer3.strEXE縺ョ縺ゅk繝輔か繝ォ繝 + "Config.ini"; + if ( File.Exists( path ) ) + { + FileInfo fi = new FileInfo( path ); + if ( fi.Length > 0 ) // Config.ini縺0byte縺縺」縺溘↑繧峨∬ェュ縺ソ霎シ縺セ縺ェ縺 + { + try + { + cc.t繝輔ぃ繧、繝ォ縺九i隱ュ縺ソ霎シ縺ソ( path ); + } + catch (Exception e) + { + //ConfigIni = new CConfigIni(); // 蟄伜惠縺励※縺ェ縺代l縺ー譁ー隕冗函謌 + Trace.TraceError( e.ToString() ); + Trace.TraceError( "萓句、悶′逋コ逕溘@縺セ縺励◆縺悟ヲ逅繧堤カ咏カ壹@縺セ縺吶 (825f9ba6-9164-4f2e-8c41-edf4d73c06c9)" ); + } + } + fi = null; + } + + cc.nViewerScrollSpeed = TJAPlayer3.ConfigIni.n隴憺擇繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ; + cc.bViewerShowDebugStatus = TJAPlayer3.ConfigIni.b貍泌・乗ュ蝣ア繧定。ィ遉コ縺吶k; + cc.bViewerVSyncWait = TJAPlayer3.ConfigIni.b蝙ら峩蟶ー邱壼セ縺。繧定。後≧; + cc.bViewerTimeStretch = TJAPlayer3.ConfigIni.bTimeStretch; + cc.bViewerDrums譛牙柑 = true; + + cc.t譖ク縺榊コ縺( path ); + } + + private string last_path; + private DateTime last_timestamp; + + } +} diff --git a/TJAPlayer3/Stages/CNamePlate.cs b/TJAPlayer3/Stages/CNamePlate.cs new file mode 100644 index 00000000..423c24da --- /dev/null +++ b/TJAPlayer3/Stages/CNamePlate.cs @@ -0,0 +1,346 @@ +サソusing FDK; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TJAPlayer3 +{ + class CNamePlate + { + public CNamePlate() + { + for (int player = 0; player < 2; player++) + { + if (TJAPlayer3.NamePlateConfig.data.DanType[player] < 0) TJAPlayer3.NamePlateConfig.data.DanType[player] = 0; + else if (TJAPlayer3.NamePlateConfig.data.DanType[player] > 2) TJAPlayer3.NamePlateConfig.data.DanType[player] = 2; + + if (TJAPlayer3.NamePlateConfig.data.TitleType[player] < 0) TJAPlayer3.NamePlateConfig.data.TitleType[player] = 0; + else if (TJAPlayer3.NamePlateConfig.data.TitleType[player] > 2) TJAPlayer3.NamePlateConfig.data.TitleType[player] = 2; + + if (!string.IsNullOrEmpty(TJAPlayer3.ConfigIni.FontName)) + { + if (TJAPlayer3.NamePlateConfig.data.Title[player] == "" || TJAPlayer3.NamePlateConfig.data.Title[player] == null) + this.pfName = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), 15); + else + this.pfName = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), 12); + + this.pfTitle = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), 11); + this.pfdan = new CPrivateFastFont(new FontFamily(TJAPlayer3.ConfigIni.FontName), 12); + } + else + { + if (TJAPlayer3.NamePlateConfig.data.Title[player] == "" || TJAPlayer3.NamePlateConfig.data.Title[player] == null) + this.pfName = new CPrivateFastFont(new FontFamily("MS UI Gothic"), 15); + else + this.pfName = new CPrivateFastFont(new FontFamily("MS UI Gothic"), 12); + + this.pfTitle = new CPrivateFastFont(new FontFamily("MS UI Gothic"), 11); + this.pfdan = new CPrivateFastFont(new FontFamily("MS UI Gothic"), 12); + } + + using (var tex = pfName.DrawPrivateFont(TJAPlayer3.NamePlateConfig.data.Name[player], Color.White, Color.Black, 25)) + txName[player] = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(tex); + + using (var tex = pfTitle.DrawPrivateFont(TJAPlayer3.NamePlateConfig.data.Title[player], Color.Black, Color.Empty)) + txTitle[player] = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(tex); + + using (var tex = pfdan.DrawPrivateFont(TJAPlayer3.NamePlateConfig.data.Dan[player], Color.White, Color.Black, 22)) + txdan[player] = TJAPlayer3.t繝繧ッ繧ケ繝√Ε縺ョ逕滓(tex); + } + + ctNamePlateEffect = new CCounter(0, 120, 16.6f, TJAPlayer3.Timer); + } + + public void tNamePlateDraw(int x, int y, int player, bool bTitle = false, int Opacity = 255) + { + ctNamePlateEffect.t騾イ陦鍬oop(); + + this.txName[player].Opacity = Opacity; + this.txTitle[player].Opacity = Opacity; + this.txdan[player].Opacity = Opacity; + TJAPlayer3.Tx.NamePlateBase.Opacity = Opacity; + for (int i = 0; i < 5; i++) + TJAPlayer3.Tx.NamePlate_Effect[i].Opacity = Opacity; + + if (bTitle) + { + //220, 54 + TJAPlayer3.Tx.NamePlateBase.t2D謠冗判(TJAPlayer3.app.Device, x, y, new RectangleF(0, 3 * 54, 220, 54)); + + if (TJAPlayer3.NamePlateConfig.data.Dan[player] != "" && TJAPlayer3.NamePlateConfig.data.Dan[player] != null) + { + if (TJAPlayer3.NamePlateConfig.data.Title[player] != "" && TJAPlayer3.NamePlateConfig.data.Title[player] != null) + TJAPlayer3.Tx.NamePlateBase.t2D謠冗判(TJAPlayer3.app.Device, x, y, new RectangleF(0, (4 + TJAPlayer3.NamePlateConfig.data.TitleType[player]) * 54, 220, 54)); + } + + if (TJAPlayer3.NamePlateConfig.data.Dan[player] != "" && TJAPlayer3.NamePlateConfig.data.Dan[player] != null) + { + TJAPlayer3.Tx.NamePlateBase.t2D謠冗判(TJAPlayer3.app.Device, x, y, new RectangleF(0, 7 * 54, 220, 54)); + TJAPlayer3.Tx.NamePlateBase.t2D謠冗判(TJAPlayer3.app.Device, x, y, new RectangleF(0, (8 + TJAPlayer3.NamePlateConfig.data.DanType[player]) * 54, 220, 54)); + } + + tNamePlateDraw(player, x, y); + + if (TJAPlayer3.NamePlateConfig.data.Dan[player] != "" && TJAPlayer3.NamePlateConfig.data.Dan[player] != null) + { + if (txName[player].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width >= 120.0f) + txName[player].vc諡。螟ァ邵ョ蟆丞咲紫.X = 120.0f / txName[player].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + } + else + { + if (txName[player].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width >= 220.0f) + txName[player].vc諡。螟ァ邵ョ蟆丞咲紫.X = 220.0f / txName[player].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + } + + if (txdan[player].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width >= 66.0f) + txdan[player].vc諡。螟ァ邵ョ蟆丞咲紫.X = 66.0f / txdan[player].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + + if (TJAPlayer3.NamePlateConfig.data.Dan[player] != "" && TJAPlayer3.NamePlateConfig.data.Dan[player] != null) + { + this.txdan[player].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x + 69, y + 45); + if (TJAPlayer3.NamePlateConfig.data.DanGold[player]) + { + TJAPlayer3.Tx.NamePlateBase.b荵礼ョ怜粋謌 = true; + TJAPlayer3.Tx.NamePlateBase.t2D謠冗判(TJAPlayer3.app.Device, x, y, new RectangleF(0, 11 * 54, 220, 54)); + TJAPlayer3.Tx.NamePlateBase.b荵礼ョ怜粋謌 = false; + } + } + + if (TJAPlayer3.NamePlateConfig.data.Title[player] != "" && TJAPlayer3.NamePlateConfig.data.Title[player] != null) + { + if (txTitle[player].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width >= 160) + { + txTitle[player].vc諡。螟ァ邵ョ蟆丞咲紫.X = 160.0f / txTitle[player].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + txTitle[player].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 160.0f / txTitle[player].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + } + + txTitle[player].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x + 115, y + 19); + if (TJAPlayer3.NamePlateConfig.data.Dan[player] == "" || TJAPlayer3.NamePlateConfig.data.Dan[player] == null) + this.txName[player].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x + 100, y + 45); + else + this.txName[player].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x + 149, y + 45); + } + else + this.txName[player].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x + 121, y + 36); + } + else + { + //220, 54 + TJAPlayer3.Tx.NamePlateBase.t2D謠冗判(TJAPlayer3.app.Device, x, y, new RectangleF(0, 3 * 54, 220, 54)); + + if (TJAPlayer3.NamePlateConfig.data.Dan[player] != "" && TJAPlayer3.NamePlateConfig.data.Dan[player] != null) + { + if (TJAPlayer3.NamePlateConfig.data.Title[player] != "" && TJAPlayer3.NamePlateConfig.data.Title[player] != null) + TJAPlayer3.Tx.NamePlateBase.t2D謠冗判(TJAPlayer3.app.Device, x, y, new RectangleF(0, (4 + TJAPlayer3.NamePlateConfig.data.TitleType[player]) * 54, 220, 54)); + } + + if (TJAPlayer3.NamePlateConfig.data.Dan[player] != "" && TJAPlayer3.NamePlateConfig.data.Dan[player] != null) + { + TJAPlayer3.Tx.NamePlateBase.t2D謠冗判(TJAPlayer3.app.Device, x, y, new RectangleF(0, 7 * 54, 220, 54)); + TJAPlayer3.Tx.NamePlateBase.t2D謠冗判(TJAPlayer3.app.Device, x, y, new RectangleF(0, (8 + TJAPlayer3.NamePlateConfig.data.DanType[player]) * 54, 220, 54)); + } + + tNamePlateDraw(player, x, y); + + TJAPlayer3.Tx.NamePlateBase.t2D謠冗判(TJAPlayer3.app.Device, x, y, new RectangleF(0, player == 1 ? 2 * 54 : 0, 220, 54)); + + if (TJAPlayer3.NamePlateConfig.data.Dan[player] != "" && TJAPlayer3.NamePlateConfig.data.Dan[player] != null) + { + if (txName[player].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width >= 120.0f) + txName[player].vc諡。螟ァ邵ョ蟆丞咲紫.X = 120.0f / txName[player].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + } + else + { + if (txName[player].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width >= 220.0f) + txName[player].vc諡。螟ァ邵ョ蟆丞咲紫.X = 220.0f / txName[player].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + } + + if (txdan[player].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width >= 66.0f) + txdan[player].vc諡。螟ァ邵ョ蟆丞咲紫.X = 66.0f / txdan[player].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + + if (TJAPlayer3.NamePlateConfig.data.Dan[player] != "" && TJAPlayer3.NamePlateConfig.data.Dan[player] != null) + { + this.txdan[player].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x + 69, y + 44); + if (TJAPlayer3.NamePlateConfig.data.DanGold[player]) + { + TJAPlayer3.Tx.NamePlateBase.b荵礼ョ怜粋謌 = true; + TJAPlayer3.Tx.NamePlateBase.t2D謠冗判(TJAPlayer3.app.Device, x, y, new RectangleF(0, 11 * 54, 220, 54)); + TJAPlayer3.Tx.NamePlateBase.b荵礼ョ怜粋謌 = false; + } + } + + if (TJAPlayer3.NamePlateConfig.data.Title[player] != "" && TJAPlayer3.NamePlateConfig.data.Title[player] != null) + { + if (txTitle[player].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width >= 160) + { + txTitle[player].vc諡。螟ァ邵ョ蟆丞咲紫.X = 160.0f / txTitle[player].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + txTitle[player].vc諡。螟ァ邵ョ蟆丞咲紫.Y = 160.0f / txTitle[player].sz繝繧ッ繧ケ繝√Ε繧オ繧、繧コ.Width; + } + + txTitle[player].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x + 124, y + 20); + if (TJAPlayer3.NamePlateConfig.data.Dan[player] == "" || TJAPlayer3.NamePlateConfig.data.Dan[player] == null) + this.txName[player].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x + 121, y + 44); + else + this.txName[player].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x + 144, y + 44); + } + else + this.txName[player].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x + 121, y + 36); + } + } + + private void tNamePlateDraw(int player, int x, int y) + { + if(TJAPlayer3.NamePlateConfig.data.TitleType[player] != 0) + { + int Type = TJAPlayer3.NamePlateConfig.data.TitleType[player] - 1; + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 10) + { + tNamePlateStarDraw(player, 1.0f - (ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 / 10f * 1.0f), x + 63, y + 25); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 3 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 10) + { + tNamePlateStarDraw(player, 1.0f - ((ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 3) / 7f * 1.0f), x + 38, y + 7); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 6 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 10) + { + tNamePlateStarDraw(player, 1.0f - ((ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 6) / 4f * 1.0f), x + 51, y + 5); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 8 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 10) + { + tNamePlateStarDraw(player, 0.3f - ((ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 8) / 2f * 0.3f), x + 110, y + 25); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 11 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 13) + { + tNamePlateStarDraw(player, 1.0f - ((ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 11) / 2f * 1.0f), x + 38, y + 7); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 11 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 15) + { + tNamePlateStarDraw(player, 1.0f, x + 51, y + 5); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 11 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 17) + { + tNamePlateStarDraw(player, 1.0f - ((ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 11) / 7f * 1.0f), x + 110, y + 25); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 16 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 20) + { + tNamePlateStarDraw(player, 0.2f - ((ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 16) / 4f * 0.2f), x + 63, y + 25); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 17 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 20) + { + tNamePlateStarDraw(player, 1.0f - ((ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 17) / 3f * 1.0f), x + 99, y + 1); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 20 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 24) + { + tNamePlateStarDraw(player, 0.4f, x + 63, y + 25); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 20 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 25) + { + tNamePlateStarDraw(player, 1.0f, x + 99, y + 1); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 20 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 30) + { + tNamePlateStarDraw(player, 0.5f - ((this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 20) / 10f * 0.5f), x + 152, y + 7); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 31 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 37) + { + tNamePlateStarDraw(player, 0.5f - ((this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 31) / 6f * 0.5f), x + 176, y + 8); + tNamePlateStarDraw(player, 1.0f - ((this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 31) / 6f * 1.0f), x + 175, y + 25); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 31 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 40) + { + tNamePlateStarDraw(player, 0.9f - ((this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 31) / 9f * 0.9f), x + 136, y + 24); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 34 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 40) + { + tNamePlateStarDraw(player, 0.7f - ((this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 34) / 6f * 0.7f), x + 159, y + 25); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 41 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 42) + { + tNamePlateStarDraw(player, 0.7f, x + 159, y + 25); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 43 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 50) + { + tNamePlateStarDraw(player, 0.8f - ((this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 43) / 7f * 0.8f), x + 196, y + 23); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 51 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 57) + { + tNamePlateStarDraw(player, 0.8f - ((this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 51) / 6f * 0.8f), x + 51, y + 5); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 51 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 52) + { + tNamePlateStarDraw(player, 0.2f, x + 166, y + 22); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 51 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 53) + { + tNamePlateStarDraw(player, 0.8f, x + 136, y + 24); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 51 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 55) + { + tNamePlateStarDraw(player, 1.0f, x + 176, y + 8); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 51 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 55) + { + tNamePlateStarDraw(player, 1.0f, x + 176, y + 8); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 61 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 70) + { + tNamePlateStarDraw(player, 1.0f - ((this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 61) / 9f * 1.0f), x + 196, y + 23); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 61 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 67) + { + tNamePlateStarDraw(player, 0.7f - ((this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 61) / 6f * 0.7f), x + 214, y + 14); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 63 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 70) + { + tNamePlateStarDraw(player, 0.5f - ((this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 63) / 7f * 0.5f), x + 129, y + 24); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 63 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 70) + { + tNamePlateStarDraw(player, 0.5f - ((this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 63) / 7f * 0.5f), x + 129, y + 24); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 65 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 70) + { + tNamePlateStarDraw(player, 0.8f - ((this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 65) / 5f * 0.8f), x + 117, y + 7); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 71 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 72) + { + tNamePlateStarDraw(player, 0.8f, x + 151, y + 25); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 71 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 74) + { + tNamePlateStarDraw(player, 0.8f, x + 117, y + 7); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 85 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 112) + { + TJAPlayer3.Tx.NamePlate_Effect[4].Opacity = (int)(1400 - (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 85) * 50f); + TJAPlayer3.Tx.NamePlate_Effect[4].t2D謠冗判(TJAPlayer3.app.Device, x + ((this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 85) * (150f / 27f)), y + 7); + } + if (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 105 && this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 <= 120) + { + TJAPlayer3.Tx.NamePlate_Effect[TJAPlayer3.NamePlateConfig.data.TitleType[player] + 1].Opacity = this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 112 ? (int)(255 - (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 112) * 31.875f) : 255; + TJAPlayer3.Tx.NamePlate_Effect[TJAPlayer3.NamePlateConfig.data.TitleType[player] + 1].vc諡。螟ァ邵ョ蟆丞咲紫.X = this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 112 ? 1.0f : (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 105) / 8f; + TJAPlayer3.Tx.NamePlate_Effect[TJAPlayer3.NamePlateConfig.data.TitleType[player] + 1].vc諡。螟ァ邵ョ蟆丞咲紫.Y = this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 >= 112 ? 1.0f : (this.ctNamePlateEffect.n迴セ蝨ィ縺ョ蛟、 - 105) / 8f; + TJAPlayer3.Tx.NamePlate_Effect[TJAPlayer3.NamePlateConfig.data.TitleType[player] + 1].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x + 193, y + 6); + } + } + } + + private void tNamePlateStarDraw(int player, float Scale, int x, int y) + { + TJAPlayer3.Tx.NamePlate_Effect[TJAPlayer3.NamePlateConfig.data.TitleType[player] - 1].vc諡。螟ァ邵ョ蟆丞咲紫.X = Scale; + TJAPlayer3.Tx.NamePlate_Effect[TJAPlayer3.NamePlateConfig.data.TitleType[player] - 1].vc諡。螟ァ邵ョ蟆丞咲紫.Y = Scale; + TJAPlayer3.Tx.NamePlate_Effect[TJAPlayer3.NamePlateConfig.data.TitleType[player] - 1].t2D諡。螟ァ邇閠諷ョ荳ュ螟ョ蝓コ貅匁緒逕サ(TJAPlayer3.app.Device, x, y); + } + + private CPrivateFastFont pfName; + private CPrivateFastFont pfTitle; + private CPrivateFastFont pfdan; + private CCounter ctNamePlateEffect; + private CTexture[] txName = new CTexture[2]; + private CTexture[] txTitle = new CTexture[2]; + private CTexture[] txdan = new CTexture[2]; + } +} diff --git a/TJAPlayer3/Stages/CStage.cs b/TJAPlayer3/Stages/CStage.cs new file mode 100644 index 00000000..4682c0af --- /dev/null +++ b/TJAPlayer3/Stages/CStage.cs @@ -0,0 +1,73 @@ +サソusing System; +using System.Collections.Generic; +using System.Text; +using FDK; + +namespace TJAPlayer3 +{ + public class CStage : CActivity + { + // 繝励Ο繝代ユ繧」 + + internal enum E繝偵ャ繝亥愛螳 + { + PERFECT, + GREAT, + GOOD, + POOR, + MISS, + BAD, + AUTO + } + + internal E繧ケ繝繝シ繧ク e繧ケ繝繝シ繧クID; + public enum E繧ケ繝繝シ繧ク + { + 菴輔b縺励↑縺, + 襍キ蜍, + 繧ソ繧、繝医Ν, + 繧ェ繝励す繝ァ繝ウ, + 繧ウ繝ウ繝輔ぅ繧ー, + 驕ク譖イ, + 谿オ菴埼∈謚, + 譖イ隱ュ縺ソ霎シ縺ソ, + 貍泌・, + 邨先棡, + ChangeSkin, // #28195 2011.5.4 yyagi + 邨ゆコ + } + + internal E繝輔ぉ繝シ繧コ e繝輔ぉ繝シ繧コID; + public enum E繝輔ぉ繝シ繧コ + { + 蜈ア騾喟騾壼クク迥カ諷, + 蜈ア騾喟繝輔ぉ繝シ繝峨う繝ウ, + 蜈ア騾喟繝輔ぉ繝シ繝峨い繧ヲ繝, + 蜈ア騾喟邨ゆコ迥カ諷, + 襍キ蜍0_繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝峨r讒狗ッ, + 襍キ蜍00_songlist縺九i譖イ繝ェ繧ケ繝医r菴懈舌☆繧, + //襍キ蜍1_SongsDB縺九i繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・繧呈ァ狗ッ, + 襍キ蜍2_譖イ繧呈、懃エ「縺励※繝ェ繧ケ繝医r菴懈舌☆繧, + 襍キ蜍3_繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・繧偵Μ繧ケ繝医↓蜿肴丐縺吶k, + 襍キ蜍4_繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・縺ォ縺ェ縺九▲縺滓峇繧偵ヵ繧。繧、繝ォ縺九i隱ュ縺ソ霎シ繧薙〒蜿肴丐縺吶k, + 襍キ蜍5_譖イ繝ェ繧ケ繝医∈蠕悟ヲ逅繧帝←逕ィ縺吶k, + //襍キ蜍6_繧ケ繧ウ繧「繧ュ繝」繝繧キ繝・繧担ongsDB縺ォ蜃コ蜉帙☆繧, + 襍キ蜍廟繝繧ッ繧ケ繝√Ε縺ョ隱ュ縺ソ霎シ縺ソ, + 襍キ蜍7_螳御コ, + 繧ソ繧、繝医Ν_襍キ蜍慕判髱「縺九i縺ョ繝輔ぉ繝シ繝峨う繝ウ, + 驕ク譖イ_邨先棡逕サ髱「縺九i縺ョ繝輔ぉ繝シ繝峨う繝ウ, + 驕ク譖イ_繧ウ繝シ繧ケ驕ク謚樒判髱「縺ク縺ョ繝輔ぉ繝シ繝峨い繧ヲ繝, //2016.10.20 kairera0467 + 驕ク譖イ_NowLoading逕サ髱「縺ク縺ョ繝輔ぉ繝シ繝峨い繧ヲ繝, + NOWLOADING_DTX繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧, + NOWLOADING_WAV隱ュ縺ソ霎シ縺ソ蠕讖, + NOWLOADING_WAV繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧, + NOWLOADING_BMP繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ繧, + NOWLOADING_繧キ繧ケ繝繝繧オ繧ヲ繝ウ繝隠GM縺ョ螳御コ繧貞セ縺、, + 貍泌・柔STAGE_FAILED, + 貍泌・柔STAGE_FAILED_繝輔ぉ繝シ繝峨い繧ヲ繝, + 貍泌・柔STAGE_CLEAR_繝輔ぉ繝シ繝峨い繧ヲ繝, + 貍泌・柔貍泌・冗オゆコ貍泌コ, //2016.07.15 kairera0467 + 貍泌・柔蜀崎ェュ霎シ + } + } +} diff --git a/TJAPlayer3/TJAPlayer3-Develop-ReWrite.ico b/TJAPlayer3/TJAPlayer3-Develop-ReWrite.ico new file mode 100644 index 00000000..0f583138 Binary files /dev/null and b/TJAPlayer3/TJAPlayer3-Develop-ReWrite.ico differ diff --git a/TJAPlayer3/TJAPlayer3.csproj b/TJAPlayer3/TJAPlayer3.csproj new file mode 100644 index 00000000..14b6d76b --- /dev/null +++ b/TJAPlayer3/TJAPlayer3.csproj @@ -0,0 +1,367 @@ +サソ + + + Release + x86 + 9.0.21022 + 2.0 + {81BEC512-8074-4BD1-8A3C-AC73BC7BF846} + WinExe + Properties + TJAPlayer3 + TJAPlayer3-Develop-ReWrite + v4.6.1 + 512 + TJAPlayer3-Develop-ReWrite.ico + false + false + + + OnBuildSuccess + + + + + 3.5 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + true + + + true + ..\Test\ + TRACE;DEBUG;_TEST_ENGLISH TEST_Direct3D9Ex_ _WindowedFullscreen MemoryRenderer + full + x86 + prompt + true + 0219 + false + false + 7.3 + false + + + ..\Test\ + TRACE;TEST_ENGLISH_ TEST_Direct3D9Ex_ _WindowedFullscreen + false + pdbonly + x86 + prompt + true + 0219 + true + 7.3 + false + + + + TJAPlayer3.manifest + + + + ..\Test\dll\Bass.Net.dll + True + + + False + ..\Test\dll\DirectShowLib-2005.dll + True + + + + ..\Test\dll\Newtonsoft.Json.dll + + + + + + + + + + + + + + + + + + + + + + + + + ResXFileCodeGenerator + Discord.Designer.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + True + Discord.resx + + + True + Resources.resx + True + + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + .NET Framework Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + + + {BCD40908-F3E2-4707-BFAA-1DD99DF6357D} + FDK19 + True + + + + + 1.0.5 + + + 1.3.1.2 + + + 4.2.0 + + + 4.2.0 + + + 4.2.0 + + + 4.2.0 + + + + + + move /y "$(TargetDir)FDK.dll" "$(SolutionDir)Test\dll\" +move /y "$(TargetDir)FDK.pdb" "$(SolutionDir)Test\dll\" +move /y "$(TargetDir)Hnx8.ReadJEnc.*" "$(SolutionDir)Test\dll\" +move /y "$(TargetDir)Newtonsoft.Json.*" "$(SolutionDir)Test\dll\" +move /y "$(TargetDir)SharpDX.Direct3D9.*" "$(SolutionDir)Test\dll\" +move /y "$(TargetDir)SharpDX.DirectInput.*" "$(SolutionDir)Test\dll\" +move /y "$(TargetDir)SharpDX.DirectSound.*" "$(SolutionDir)Test\dll\" +move /y "$(TargetDir)SharpDX.DXGI.*" "$(SolutionDir)Test\dll\" +move /y "$(TargetDir)SharpDX.Mathematics.*" "$(SolutionDir)Test\dll\" +move /y "$(TargetDir)SharpDX.*" "$(SolutionDir)Test\dll\" +move /y "$(TargetDir)Bass.Net.dll" "$(SolutionDir)Test\dll\" +move /y "$(TargetDir)DirectShowLib-2005.dll" "$(SolutionDir)Test\dll\" +move /y "$(TargetDir)SlimDX.dll" "$(SolutionDir)Test\dll\" +move /y "$(TargetDir)CSharpTest.Net.Collections.*" "$(SolutionDir)Test\dll\" +copy /y "$(SolutionDir)Readme.txt" "$(SolutionDir)Test\" + + + \ No newline at end of file diff --git a/TJAPlayer3/TJAPlayer3.csproj.user b/TJAPlayer3/TJAPlayer3.csproj.user new file mode 100644 index 00000000..689cb47a --- /dev/null +++ b/TJAPlayer3/TJAPlayer3.csproj.user @@ -0,0 +1,27 @@ +サソ + + + copy /Y "%24%28TargetPath%29" "%24%28SolutionDir%29\螳溯。梧凾繝輔か繝ォ繝" +move /Y "%24%28TargetDir%29\Bass.Net.dll" "%24%28TargetDir%29dll" +move /Y "%24%28TargetDir%29\DirectShowLib-2005.dll" "%24%28TargetDir%29dll" +move /Y "%24%28TargetDir%29\FDK.dll" "%24%28TargetDir%29dll" +move /Y "%24%28TargetDir%29\SlimDXc_net20x86_Jun2010.dll" "%24%28TargetDir%29dll" + + false + + + Project + + + + + publish\ + + + + + + ja-JP + false + + \ No newline at end of file diff --git a/TJAPlayer3/TJAPlayer3.manifest b/TJAPlayer3/TJAPlayer3.manifest new file mode 100644 index 00000000..0bfcb3b0 --- /dev/null +++ b/TJAPlayer3/TJAPlayer3.manifest @@ -0,0 +1,8 @@ +サソ + + + + + + + \ No newline at end of file diff --git a/TJAPlayer3/app.config b/TJAPlayer3/app.config new file mode 100644 index 00000000..eff605cf --- /dev/null +++ b/TJAPlayer3/app.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/TJAPlayer3/dtx.ico b/TJAPlayer3/dtx.ico new file mode 100644 index 00000000..e3f64268 Binary files /dev/null and b/TJAPlayer3/dtx.ico differ diff --git a/TJAPlayer3/packages.config b/TJAPlayer3/packages.config new file mode 100644 index 00000000..4e39093e --- /dev/null +++ b/TJAPlayer3/packages.config @@ -0,0 +1,12 @@ +サソ + + + + + + + + + + + \ No newline at end of file diff --git a/Test/DirectX Redist/APR2007_xinput_x64.cab b/Test/DirectX Redist/APR2007_xinput_x64.cab new file mode 100644 index 00000000..6abbc1f7 Binary files /dev/null and b/Test/DirectX Redist/APR2007_xinput_x64.cab differ diff --git a/Test/DirectX Redist/APR2007_xinput_x86.cab b/Test/DirectX Redist/APR2007_xinput_x86.cab new file mode 100644 index 00000000..eb560b41 Binary files /dev/null and b/Test/DirectX Redist/APR2007_xinput_x86.cab differ diff --git a/Test/DirectX Redist/DSETUP.dll b/Test/DirectX Redist/DSETUP.dll new file mode 100644 index 00000000..b1e68895 Binary files /dev/null and b/Test/DirectX Redist/DSETUP.dll differ diff --git a/Test/DirectX Redist/Feb2010_X3DAudio_x64.cab b/Test/DirectX Redist/Feb2010_X3DAudio_x64.cab new file mode 100644 index 00000000..18affcd9 Binary files /dev/null and b/Test/DirectX Redist/Feb2010_X3DAudio_x64.cab differ diff --git a/Test/DirectX Redist/Feb2010_X3DAudio_x86.cab b/Test/DirectX Redist/Feb2010_X3DAudio_x86.cab new file mode 100644 index 00000000..8246f734 Binary files /dev/null and b/Test/DirectX Redist/Feb2010_X3DAudio_x86.cab differ diff --git a/Test/DirectX Redist/Jun2010_D3DCompiler_43_x64.cab b/Test/DirectX Redist/Jun2010_D3DCompiler_43_x64.cab new file mode 100644 index 00000000..10e91c30 Binary files /dev/null and b/Test/DirectX Redist/Jun2010_D3DCompiler_43_x64.cab differ diff --git a/Test/DirectX Redist/Jun2010_D3DCompiler_43_x86.cab b/Test/DirectX Redist/Jun2010_D3DCompiler_43_x86.cab new file mode 100644 index 00000000..272bb738 Binary files /dev/null and b/Test/DirectX Redist/Jun2010_D3DCompiler_43_x86.cab differ diff --git a/Test/DirectX Redist/Jun2010_XAudio_x64.cab b/Test/DirectX Redist/Jun2010_XAudio_x64.cab new file mode 100644 index 00000000..1def6f1c Binary files /dev/null and b/Test/DirectX Redist/Jun2010_XAudio_x64.cab differ diff --git a/Test/DirectX Redist/Jun2010_XAudio_x86.cab b/Test/DirectX Redist/Jun2010_XAudio_x86.cab new file mode 100644 index 00000000..c3d3f39e Binary files /dev/null and b/Test/DirectX Redist/Jun2010_XAudio_x86.cab differ diff --git a/Test/DirectX Redist/Jun2010_d3dcsx_43_x64.cab b/Test/DirectX Redist/Jun2010_d3dcsx_43_x64.cab new file mode 100644 index 00000000..fa0b595a Binary files /dev/null and b/Test/DirectX Redist/Jun2010_d3dcsx_43_x64.cab differ diff --git a/Test/DirectX Redist/Jun2010_d3dcsx_43_x86.cab b/Test/DirectX Redist/Jun2010_d3dcsx_43_x86.cab new file mode 100644 index 00000000..f0df1f30 Binary files /dev/null and b/Test/DirectX Redist/Jun2010_d3dcsx_43_x86.cab differ diff --git a/Test/DirectX Redist/Jun2010_d3dx10_43_x64.cab b/Test/DirectX Redist/Jun2010_d3dx10_43_x64.cab new file mode 100644 index 00000000..119dae92 Binary files /dev/null and b/Test/DirectX Redist/Jun2010_d3dx10_43_x64.cab differ diff --git a/Test/DirectX Redist/Jun2010_d3dx10_43_x86.cab b/Test/DirectX Redist/Jun2010_d3dx10_43_x86.cab new file mode 100644 index 00000000..2451c682 Binary files /dev/null and b/Test/DirectX Redist/Jun2010_d3dx10_43_x86.cab differ diff --git a/Test/DirectX Redist/Jun2010_d3dx11_43_x64.cab b/Test/DirectX Redist/Jun2010_d3dx11_43_x64.cab new file mode 100644 index 00000000..35b8c1a5 Binary files /dev/null and b/Test/DirectX Redist/Jun2010_d3dx11_43_x64.cab differ diff --git a/Test/DirectX Redist/Jun2010_d3dx11_43_x86.cab b/Test/DirectX Redist/Jun2010_d3dx11_43_x86.cab new file mode 100644 index 00000000..f3f5a138 Binary files /dev/null and b/Test/DirectX Redist/Jun2010_d3dx11_43_x86.cab differ diff --git a/Test/DirectX Redist/Jun2010_d3dx9_43_x64.cab b/Test/DirectX Redist/Jun2010_d3dx9_43_x64.cab new file mode 100644 index 00000000..a2feb2c9 Binary files /dev/null and b/Test/DirectX Redist/Jun2010_d3dx9_43_x64.cab differ diff --git a/Test/DirectX Redist/Jun2010_d3dx9_43_x86.cab b/Test/DirectX Redist/Jun2010_d3dx9_43_x86.cab new file mode 100644 index 00000000..8d8b9e7c Binary files /dev/null and b/Test/DirectX Redist/Jun2010_d3dx9_43_x86.cab differ diff --git a/Test/DirectX Redist/README_JP.txt b/Test/DirectX Redist/README_JP.txt new file mode 100644 index 00000000..966e4647 --- /dev/null +++ b/Test/DirectX Redist/README_JP.txt @@ -0,0 +1,22 @@ +---------------------------------------------------------------------------------------- +■ DirectX 再配布可能ランタイムパッケージ + +d3dx9_43.dllのエラーを解決するランタイムインストーラーです。 +インストール方法についてはDiscord内の#d3dx9_installチャンネルをご覧ください。 +---------------------------------------------------------------------------------------- +■ 最小限の DirectX ランタイム + +このフォルダは、本ゲーム(というか SlimDX)が必要とする、最小限の DirectX +ランタイムが入っています。 + +わざわざ本家サイトから巨大な最新ランタイムをダウンロードするのがイヤだと +いう人は、こちらの小さな DirectX ランタイムをインストールすることをお勧め +します。 + +インストールするには、DXSETUP.exe を起動し、あとは画面の指示に従って下さい。 +---------------------------------------------------------------------------------------- +■ 謝辞 +・Microsoft +・TJAP2fPC(TJAP2fPCに同梱されているDirectX Redistを使用しています、何か問題があればDiscordのgeneralへ) +---------------------------------------------------------------------------------------- +(2021/2/19 Update) \ No newline at end of file diff --git a/Test/DirectX Redist/dsetup32.dll b/Test/DirectX Redist/dsetup32.dll new file mode 100644 index 00000000..6f9b327c Binary files /dev/null and b/Test/DirectX Redist/dsetup32.dll differ diff --git a/Test/DirectX Redist/dxdllreg_x86.cab b/Test/DirectX Redist/dxdllreg_x86.cab new file mode 100644 index 00000000..f053cbcc Binary files /dev/null and b/Test/DirectX Redist/dxdllreg_x86.cab differ diff --git a/Test/DirectX Redist/dxupdate.cab b/Test/DirectX Redist/dxupdate.cab new file mode 100644 index 00000000..533cc57b Binary files /dev/null and b/Test/DirectX Redist/dxupdate.cab differ diff --git a/Test/FDK.MemoryRenderer.dll b/Test/FDK.MemoryRenderer.dll new file mode 100644 index 00000000..fcf4e7f6 Binary files /dev/null and b/Test/FDK.MemoryRenderer.dll differ diff --git a/Test/Licenses/BASS/LICENSE(BASS.Net).rtf b/Test/Licenses/BASS/LICENSE(BASS.Net).rtf new file mode 100644 index 00000000..2b6f08b1 --- /dev/null +++ b/Test/Licenses/BASS/LICENSE(BASS.Net).rtf @@ -0,0 +1,352 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1031\deflangfe1031\themelang1031\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;} +{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;} +{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} +{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;} +{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f41\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f42\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\f44\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f45\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f46\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f47\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\f48\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f49\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f61\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}{\f62\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;} +{\f64\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f65\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f66\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f67\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);} +{\f68\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f69\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f381\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f382\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;} +{\f384\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f385\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}{\f388\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;} +{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} +{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} +{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} +{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} +{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} +{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;} +{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;} +{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} +{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} +{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0; +\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128; +\red192\green192\blue192;}{\*\defchp \fs22 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{ +\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs24\alang1025 \ltrch\fcs0 \fs24\lang1031\langfe1031\cgrid\langnp1031\langfenp1031 \snext0 \sqformat \spriority0 Normal;}{\*\cs10 \additive +\ssemihidden Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv +\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang1031\langfe1031\cgrid\langnp1031\langfenp1031 \snext11 \ssemihidden \sunhideused \sqformat +Normal Table;}{\s15\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af2\afs20\alang1025 \ltrch\fcs0 \f2\fs20\lang1031\langfe1031\cgrid\langnp1031\langfenp1031 \sbasedon0 \snext15 \slink16 \styrsid78995 +Plain Text;}{\*\cs16 \additive \rtlch\fcs1 \af2\afs20 \ltrch\fcs0 \f2\fs20 \sbasedon10 \slink15 \slocked \ssemihidden Nur Text Zchn;}{\*\cs17 \additive \rtlch\fcs1 \af0 \ltrch\fcs0 \ul\cf2 \sbasedon10 \styrsid464154 Hyperlink;}}{\*\pgptbl {\pgp\ipgp2 +\itap0\li720\ri0\sb100\sa100}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp1\itap0\li0\ri0\sb0\sa0}}{\*\rsidtbl \rsid78995\rsid145286\rsid146331\rsid161050\rsid279700\rsid332450\rsid350433\rsid406586\rsid464154\rsid681154\rsid983250\rsid1194839\rsid1197405 +\rsid1254865\rsid1339755\rsid1518981\rsid1588327\rsid1650015\rsid1711593\rsid1781880\rsid1788104\rsid1801360\rsid1910885\rsid1913351\rsid1972975\rsid2034234\rsid2059497\rsid2118598\rsid2168076\rsid2183965\rsid2234732\rsid2258554\rsid2432363\rsid2439350 +\rsid2456706\rsid2577363\rsid2586307\rsid2644312\rsid2692968\rsid2704744\rsid2759937\rsid2775356\rsid2847146\rsid2914016\rsid3018229\rsid3029049\rsid3242570\rsid3305946\rsid3505921\rsid3539115\rsid3627629\rsid3870977\rsid4029877\rsid4064350\rsid4157814 +\rsid4158978\rsid4271630\rsid4288052\rsid4400397\rsid4796836\rsid4923511\rsid4935256\rsid5009523\rsid5184220\rsid5191477\rsid5645640\rsid5731012\rsid5767631\rsid5844058\rsid5848300\rsid5916471\rsid6104694\rsid6121344\rsid6307875\rsid6488464\rsid6559253 +\rsid6583351\rsid6686209\rsid6765563\rsid6912979\rsid7022091\rsid7089994\rsid7110204\rsid7279026\rsid7291396\rsid7490505\rsid7493487\rsid7538140\rsid7552412\rsid7634325\rsid7749826\rsid7827466\rsid7934307\rsid7952270\rsid8145779\rsid8146724\rsid8327213 +\rsid8414230\rsid8474828\rsid8549048\rsid8599358\rsid8616346\rsid8655317\rsid8665746\rsid8801882\rsid8858518\rsid8866551\rsid8919954\rsid9066632\rsid9068516\rsid9183392\rsid9264560\rsid9332838\rsid9445245\rsid9717180\rsid9782943\rsid9831010\rsid9846214 +\rsid9859747\rsid9900924\rsid9906384\rsid10029290\rsid10117120\rsid10432778\rsid10433871\rsid10489427\rsid10506973\rsid10513845\rsid10567864\rsid10572009\rsid10580113\rsid10694703\rsid10701960\rsid10759134\rsid10965366\rsid11015177\rsid11089399 +\rsid11213444\rsid11412790\rsid11488933\rsid11548372\rsid11605054\rsid11828939\rsid11868706\rsid11889099\rsid11957832\rsid12006136\rsid12014668\rsid12066857\rsid12068023\rsid12346656\rsid12405435\rsid12465136\rsid12594556\rsid12613635\rsid12866676 +\rsid13003980\rsid13005916\rsid13051695\rsid13052376\rsid13111913\rsid13187299\rsid13314122\rsid13461946\rsid13581354\rsid13961425\rsid13972132\rsid13974689\rsid13976672\rsid14046608\rsid14055251\rsid14095763\rsid14116533\rsid14225040\rsid14233616 +\rsid14237111\rsid14301323\rsid14508363\rsid14775798\rsid14840840\rsid14957770\rsid15037556\rsid15092654\rsid15236229\rsid15280397\rsid15364230\rsid15542213\rsid15561598\rsid15611509\rsid15740084\rsid15803317\rsid15885843\rsid15926201\rsid15932536 +\rsid16013564\rsid16023301\rsid16146409\rsid16258284\rsid16268958\rsid16278869\rsid16410124\rsid16457522\rsid16605417\rsid16607149\rsid16657582\rsid16713481\rsid16726272\rsid16739387}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1 +\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\title EULA \'96 End User License Agreement}{\author Bernd Niedergesaess}{\operator Bernd Niedergesaess}{\creatim\yr2005\mo11\dy18\hr10\min3}{\revtim\yr2009\mo1\dy15\hr11\min22} +{\version222}{\edmins0}{\nofpages3}{\nofwords1155}{\nofchars6156}{\*\company Enterest GmbH}{\nofcharsws7297}{\vern32895}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}{\xmlns2 urn:schemas-microsoft-com:office:smarttags}} +\paperw11906\paperh16838\margl1152\margr1152\margt1417\margb1134\gutter0\ltrsect +\deftab708\widowctrl\ftnbj\aenddoc\hyphhotz425\trackmoves1\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0 +\showxmlerrors0\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1152\dgvorigin1417\dghshow1\dgvshow1 +\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct +\asianbrkrule\rsidroot13976672\newtblstyruls\nogrowautofit \fet0{\*\wgrffmtfilter 013f}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\headery708\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid78995\sftnbj {\*\pnseclvl1 +\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5 +\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang +{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\s15\qc \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid7749826 +\rtlch\fcs1 \af2\afs20\alang1025 \ltrch\fcs0 \f2\fs20\lang1031\langfe1031\cgrid\langnp1031\langfenp1031 {\rtlch\fcs1 \ab\af2 \ltrch\fcs0 \b\lang2057\langfe1031\langnp2057\insrsid7749826\charrsid7749826 EULA \endash End User License Agreement +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid78995 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid7749826 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid16268958\charrsid16268958 This license agreement is a legal agreement between -YOU- (the 'LICENSEE') and }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid15037556 +\line }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid16268958\charrsid16268958 -}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid9782943 radio42}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid16268958\charrsid16268958 , Gryphiusstrasse 9, 22299 Hamburg, Germany- (the 'LICENSOR'), for use of the BASS.NET API software ('BASS.NET') in any of the LICENSEE\rquote s freeware software ('FREEWARE').}{\rtlch\fcs1 +\af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid14957770\charrsid16268958 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid14957770 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid681154 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid681154\charrsid681154 +Freeware software is herewith defined as computer software developed for the public domain and for personal use only and for non-money making use, to which no charge is associated at all and which has absolutely no commercial purpose. Freeware software +- if made available for use to any 3rd party - must be free of charge, for an unlimited time.}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid15037556\charrsid15037556 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid78995 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid15037556 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid681154 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid681154\charrsid681154 +This freeware version of BASS.NET is free for non-money making use. If you are not charging for or making any money with your software AND you are an individual person (not a corporation) AND your software is intended for personal u +se only, then you can use the BASS.NET API in your software for free.}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid681154 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid681154\charrsid681154 Free in this case means, that the LICENSEE can use BASS.NET without any further license fees. It does NOT mean that you are free to change, copy, +redistribute, share or use BASS.NET in any purpose.}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid681154 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid78995 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid5767631 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid9068516\charrsid9068516 If you wish to use BASS.NET in shareware or commercial products (or it has other commercial purpose, e.g. advertising, training etc. +), you will require another license which is NOT covered by this license agreement.}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid9068516 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8599358 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8599358 +This license agreement is ONLY valid for the freeware }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid406586 software}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8599358 . +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid78995 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid9068516\charrsid14957770 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid7749826 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid6121344\charrsid14957770 +BASS.NET is the property of }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid9782943 radio42}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid6121344\charrsid14957770 + and is protected by copyright laws and international copyright treaties. +BASS.NET is not sold, it is licensed. The LICENSOR represents that it has all of the rights necessary to grant to the LICENSEE the rights set forth in this license agreement, subject to the terms set forth below regarding BASS and MP3 technology. +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid983250 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid9717180 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid2439350 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350\charrsid2439350 Permitt +ed use and restrictions}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350 : +\par -------------------------------}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350\charrsid2439350 +\par This license agreement allows the LICENSEE to use BASS.NET in any of his FREEWARE products}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid12014668 .}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid2439350\charrsid2439350 +\par +\par By using this software, you agree to the following conditions: +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1788104 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid1788104 1) }{\rtlch\fcs1 \af2 +\ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid1788104\charrsid6307875 The LICENSEE may not }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid1788104 charge for or make any money with the software using \line BASS.NET. The }{ +\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid1788104\charrsid6307875 LICENSEE}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid1788104 \rquote s software might also have no other commercial }{\rtlch\fcs1 \af2 +\ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid1801360 \line }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid1788104 purpose}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid9264560 }{\rtlch\fcs1 \af2 +\ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid9264560\charrsid9264560 and might only be used for personal needs}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid1788104 . +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid2439350 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid11213444 2}{\rtlch\fcs1 \af2 +\ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350 ) }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350\charrsid7749826 It is prohibited to change any of the provided}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid2439350 source code }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350\charrsid983250 and }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350 all}{\rtlch\fcs1 +\af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350\charrsid983250 the files}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350 \line }{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid2439350\charrsid983250 }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350 must at any time }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350\charrsid983250 +remain intact and unmodified}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10433871 . +\par 3) }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350\charrsid14508363 The LICENSEE may not decompile, disassemble, reverse engineer or modify any }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10433871 +\line }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350\charrsid14508363 part of BASS.NET.}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10433871 4}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350 ) }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2059497\charrsid2059497 +The LICENSEE may ONLY distribute t}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid12068023 he DLL part of BASS.NET (Bass.Net.dll)\line with his}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid2059497\charrsid2059497 }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid12068023 software}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid15885843 .}{\rtlch\fcs1 \af2 +\ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2059497\charrsid2059497 N}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid15885843 o}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2059497\charrsid2059497 + other part of BASS.NET may be distributed.}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350\charrsid2059497 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10433871 5}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350 ) }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350\charrsid6307875 +The LICENSEE may not transfer the license to anyone else}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350 . +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10433871 6}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350 ) }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350\charrsid8327213 +The LICENSEE may not resell or sublicense BASS.NET.}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10433871 7}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350 ) A splash screen will appear every time at start-up (}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang1033\langfe1031\langnp1033\insrsid2439350 unless you obtained a \line valid Registration-Key}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350 ). +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10432778 8) You are NOT allowed to pass your personal }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang1033\langfe1031\langnp1033\insrsid10432778 Registration-Key to anyone at \line anytime}{ +\rtlch\fcs1 \af2 \ltrch\fcs0 \lang1033\langfe1031\langnp1033\insrsid3018229 !}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10432778\charrsid8327213 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2439350\charrsid2439350 +\par No royalty payments are required for the use of BASS.NET in the FREEWARE, and the LICENSEE may freely use future updates of BASS.NET in updates of the FREEWARE. +\par This license agreement is between only the LICENSEE and the LICENSOR. The LICENSEE may not transfer the license to anyone else. +\par +\par The LICENSOR reserves all rights not expressly granted.}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid6307875\charrsid2439350 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid7749826 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid983250 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid11868706 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid15236229 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid15236229\charrsid15236229 +Term and termination}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8145779 :}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid15236229 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid11488933 --------------------- +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid15236229\charrsid15236229 +This license agreement will continue in perpetuity unless terminated as set forth herein. This license agreement may be terminated in the event that the LICENSEE breaches any term or condition of the agreement.}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid3242570 }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid5731012\charrsid5731012 The LICENSEE may voluntarily terminate this license agreement in writing. +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid3242570\charrsid15236229 Upon termination of this agreement, the LICENSEE must cease to use BASS.NET in the }{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid15803317 FREEWARE}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid3242570\charrsid15236229 .}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid15236229 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid11412790 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid11412790\charrsid7749826 Please note that you also need to take care of all BASS modules and their respective rights.}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid11412790 They might require additional licenses and are NOT covered here at all. See}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid11412790\charrsid14840840 www.un4seen.com}{\rtlch\fcs1 \af2 +\ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid11412790 for details. +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid15561598 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid9717180 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid15561598 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid15561598\charrsid15561598 +Third party intellectual property rights}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid15561598 : +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2577363 -----------------------------------------}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2577363\charrsid15561598 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid15561598\charrsid15561598 BASS.NET is a .Net wrapper of the product BASS (www.un4seen.com). In order to use BASS.NET an additional BASS license needs to be obtained separately. +\par MP3 technology is patented, and so the use of BASS MP3 decoder in the }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid15803317 FREEWARE}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid15561598\charrsid15561598 + requires the LICENSEE to have a patent license from Thomson (www.mp3licensing.com). Alternatively, the LICENSEE does not need a patent license if BASS is set to use the already licensed Windows MP3 decoder. +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid7749826 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid15236229 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid11089399 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2914016 Shareware or Commercial Versions: +\par --------------------------------- +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid14046608 If you are using BASS.NET in software which is NOT }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid11089399 FREEWARE}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid14046608 (as described above) OR you are trying to make money with your software OR }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid16605417 your software usin}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid4157814 g}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid16605417 BASS.NET has any }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid16605417\charrsid9066632 +commercial purpose}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid16605417 }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid3305946 OR }{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid14046608 you are a company }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid16013564 or corporation }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid16605417 +then you must obtain a separate license from }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid9782943 radio42}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid16605417 !}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid14046608 +\par +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid5848300 In this case please }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid464154 contact:}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid14840840 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \insrsid9782943 radio42 +\par Bernd Niedergesaess}{\rtlch\fcs1 \af2 \ltrch\fcs0 \insrsid464154\charrsid10965366 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \insrsid7749826\charrsid10965366 Gryphiusstrasse 9 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid7749826\charrsid14840840 22299 {\*\xmlopen\xmlns2{\factoidname PersonName}}{\*\xmlopen\xmlns2{\factoidname PersonName}}Hamburg}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid1588327 {\*\xmlclose}, }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid7749826\charrsid14840840 {\*\xmlopen\xmlns2{\factoidname PersonName}}Germany}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid7749826 {\*\xmlclose}{\*\xmlclose} +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid1588327 Mail:}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid9782943 }{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid1588327\charrsid14840840 bn@radio42.com +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10506973 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid983250 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid983250\charrsid983250 +Commercial prices }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10759134 for BASS.NET }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid983250\charrsid983250 are:}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid983250 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10759134 +\par }{\rtlch\fcs1 \ab\af2 \ltrch\fcs0 \b\lang2057\langfe1031\langnp2057\insrsid983250\charrsid10759134 Shareware license: }{\rtlch\fcs1 \ab\af2 \ltrch\fcs0 \b\lang2057\langfe1031\langnp2057\insrsid2168076 2}{\rtlch\fcs1 \ab\af2 \ltrch\fcs0 +\b\lang2057\langfe1031\langnp2057\insrsid983250\charrsid10759134 9.00 Euro +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8919954 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954\charrsid8919954 +Allows the usage of BASS}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954 .NET}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954\charrsid8919954 in an unlimited number of your}{\rtlch\fcs1 \af2 +\ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954 }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954\charrsid8919954 shareware products, which must sell for no more than 40 Euros each.}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid8919954 }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954\charrsid8919954 If you're an individual making and selling your own software (and}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid8919954 }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954\charrsid8919954 its price is within the limit), this is the licen}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid16410124 s}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954\charrsid8919954 e for you.}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid983250\charrsid983250 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid983250 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10759134 +\par }{\rtlch\fcs1 \ab\af2 \ltrch\fcs0 \b\lang2057\langfe1031\langnp2057\insrsid983250\charrsid10759134 Single Commercial license: }{\rtlch\fcs1 \ab\af2 \ltrch\fcs0 \b\lang2057\langfe1031\langnp2057\insrsid279700 19}{\rtlch\fcs1 \ab\af2 \ltrch\fcs0 +\b\lang2057\langfe1031\langnp2057\insrsid983250\charrsid10759134 9.00 Euro +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8919954 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954\charrsid8919954 +Allows the usage of BASS}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954 .NET}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954\charrsid8919954 in a single commercial}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid8919954 }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954\charrsid8919954 product.}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954 + If you are a company making and selling your own software (and use BASS.NET only in a single product)}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954\charrsid8919954 , this is the licence for you.}{\rtlch\fcs1 \af2 +\ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid983250\charrsid983250 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid983250 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10759134 +\par }{\rtlch\fcs1 \ab\af2 \ltrch\fcs0 \b\lang2057\langfe1031\langnp2057\insrsid983250\charrsid10759134 Unlimited Commercial license: }{\rtlch\fcs1 \ab\af2 \ltrch\fcs0 \b\lang2057\langfe1031\langnp2057\insrsid279700 4}{\rtlch\fcs1 \ab\af2 \ltrch\fcs0 +\b\lang2057\langfe1031\langnp2057\insrsid8146724 99}{\rtlch\fcs1 \ab\af2 \ltrch\fcs0 \b\lang2057\langfe1031\langnp2057\insrsid983250\charrsid10759134 .00 Euro +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang1024\langfe1024\noproof\langnp1033\insrsid8919954\charrsid8919954 +Allows the usage of BASS.NET in an unlimited number of your commercial products. This licence is on a per site basis. So if your company has two sites that use BASS.NET, then two licences are required.}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang1033\langfe1031\langnp1033\insrsid983250\charrsid8919954 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10759134 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid8919954 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954\charrsid8919954 +Please note the products must be end-user products, e}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954 .}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954\charrsid8919954 g. not components +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid2183965 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954\charrsid8919954 +used by other products.}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2183965 }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2258554 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954\charrsid8919954 These licences only cover your own software. }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954 N}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid8919954\charrsid8919954 ot the publishing of}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2183965 }{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid8919954\charrsid8919954 other's software. If you publish other's software, its developers (or}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2183965 }{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid8919954\charrsid8919954 the software itself) will need to be licensed to use BASS}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8919954 .NET}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid8919954\charrsid8919954 .}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2183965 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang1024\langfe1024\noproof\langnp1033\insrsid146331 In }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang1024\langfe1024\noproof\langnp1033\insrsid2183965\charrsid2183965 all cases + there are no royalties to pay, and you can use future BASS}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang1024\langfe1024\noproof\langnp1033\insrsid2183965 .NET}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang1024\langfe1024\noproof\langnp1033\insrsid2183965\charrsid2183965 + updates without further cost.}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang1024\langfe1024\noproof\langnp1033\insrsid2183965 }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang1024\langfe1024\noproof\langnp1033\insrsid2183965\charrsid2183965 One licence covers one person or}{ +\rtlch\fcs1 \af2 \ltrch\fcs0 \lang1024\langfe1024\noproof\langnp1033\insrsid2258554 entity and is not transferable}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid983250\charrsid983250 .}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid983250 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid983250 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2644312 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid2644312 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2644312\charrsid2644312 +These licences do not allow reselling/sublicensing of BASS. For example, +\par if a product is a development system, the users of said product are not +\par licensed to use BASS}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2644312 .NET}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2644312\charrsid2644312 in their productions - they will need their own +\par licences. +\par +\par If the standard licences do not meet your requirements, or if you have +\par any questions, please get in touch (email: }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2644312 bn}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2644312\charrsid2644312 @}{\rtlch\fcs1 \af2 \ltrch\fcs0 +\lang2057\langfe1031\langnp2057\insrsid8474828 radio42.com}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2644312\charrsid2644312 ).}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid2644312 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid983250 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid279700 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid16657582 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid10506973 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10506973\charrsid10506973 +Registration}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10506973 : +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8858518 -------------}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8858518\charrsid10506973 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10506973\charrsid10506973 You can obtain your License and Registration-Key here: }{\rtlch\fcs1 \af2 \ltrch\fcs0 \b\lang2057\langfe1031\langnp2057\insrsid10506973\charrsid10506973 +http://www.}{\rtlch\fcs1 \af2 \ltrch\fcs0 \b\lang2057\langfe1031\langnp2057\insrsid8474828 bass.radio42.com}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10506973\charrsid10506973 +\par +\par After you have received your Registration-Key, you might disable the }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid16146409 s}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10506973\charrsid10506973 plash}{ +\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid16146409 s}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10506973\charrsid10506973 creen by calling the following method prior to any other BASS method: +\par BassNet.Registration("", ""); +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid983250 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid279700 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid10506973 +\par }\pard \ltrpar\s15\ql \li0\ri0\widctlpar\brdrb\brdrs\brdrw15\brsp20 \wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid279700 {\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid279700\charrsid279700 Disclaimer}{ +\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid279700 : +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid13052376 -----------}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid13052376\charrsid279700 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid279700\charrsid279700 TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, BASS.NET IS PROVIDED \'93AS IS\'94, WITHO +UT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. THE LICENSOR AND ITS SUPPLIERS SHALL NOT BE HELD LIABLE FOR ANY DAMAGE THAT MAY RESULT FR +OM THE USE OF BASS.NET. THE LICENSEE USES BASS.NET ENTIRELY AT ITS OWN RISK.}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid279700 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid15926201 +\par }{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8474828\charrsid8474828 Mutually agreed place of jurisdiction is Hamburg, Germany.}{\rtlch\fcs1 \af2 \ltrch\fcs0 \lang2057\langfe1031\langnp2057\insrsid8474828\charrsid279700 +\par }{\*\themedata 504b030414000600080000002100828abc13fa0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb6ac3301045f785fe83d0b6d8 +72ba28a5d8cea249777d2cd20f18e4b12d6a8f843409c9df77ecb850ba082d74231062ce997b55ae8fe3a00e1893f354e9555e6885647de3a8abf4fbee29bbd7 +2a3150038327acf409935ed7d757e5ee14302999a654e99e393c18936c8f23a4dc072479697d1c81e51a3b13c07e4087e6b628ee8cf5c4489cf1c4d075f92a0b +44d7a07a83c82f308ac7b0a0f0fbf90c2480980b58abc733615aa2d210c2e02cb04430076a7ee833dfb6ce62e3ed7e14693e8317d8cd0433bf5c60f53fea2fe7 +065bd80facb647e9e25c7fc421fd2ddb526b2e9373fed4bb902e182e97b7b461e6bfad3f010000ffff0300504b030414000600080000002100a5d6a7e7c00000 +00360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4fc7060abb08 +84a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b63095120f88d94fbc +52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462a1a82fe353 +bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f7468656d652f7468 +656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b4b0d592c9c +070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b4757e8d3f7 +29e245eb2b260a0238fd010000ffff0300504b030414000600080000002100e35a492797060000551b0000160000007468656d652f7468656d652f7468656d65 +312e786d6cec594d6f1b4518be23f11f467b6f6327761a4775aad8b11b6852a2d82dea71bc3bde9d66766735334eea1b6a8f484888823850891b0704546a252e +e5d7048aa048fd0bbc33b3bbde89d72469235a417d48bcb3cfbcdf5f33be7aed5eccd0211192f2a4edd52fd73c44129f073409dbdead61ffd29a87a4c2498019 +4f48db9b12e95ddb78ffbdab785d45242608f627721db7bd48a9747d6949fab08ce5659e9204de8db988b18247112e05021f01dd982d2dd76aab4b31a6898712 +1c03d91d2ca894f8d21691344cbc8d9c7c8f018f4449bde03331d0c489bbc7808383ba86c8a9ec32810e316b7bc02ae04743724f798861a9e045dbab998fb7b4 +717509af679b985ab0b7b4af6f3ed9be6c4370b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83aa569632cd467faddec9699640f6 +eb3ced6ead596bb8f812fd9539995b9d4ea7d9ca64b1440dc87e6dcce1d76aab8dcd65076f4016df9cc3373a9bddeeaa8337208b5f9dc3f7afb4561b2ede8022 +46938339b47668bf9f512f2063ceb62be16b005fab65f0190aa2a1082fcd62cc13b530d8627c978b3e203492614513a4a62919631f22b98be391a05873c0eb04 +97ded8255fce2d696648fa82a6aaed7d9862c88a19bd97cf7e78f9ec093abefff4f8fecfc70f1e1cdfffc91272766de3242cef7af1dde77f3dfa04fdf9e4db17 +0fbfacc6cb32feb71f3ffdf5972faa81903f33719e7ff5f8f7a78f9f7ffdd91fdf3fac806f0a3c2ac387342612dd2447689fc7a098b18a2b391989f3ed184698 +96776c26a1c409d65c2ae8f754e4a06f4e31cbbce3c8d121ae056f0ba81f55c0eb93bb8ec083484c14ade07c238a1de02ee7acc345a5156e685e25330f274958 +cd5c4ccab87d8c0fab787771e2f8b73749a172e661e928de8d8823e61ec389c221498842fa1d3f20a442bb3b943a76dda5bee0928f15ba435107d34a930ce9c8 +89a6d9a66d1a835fa6553a83bf1ddbecde461dceaab4de22872e12b202b30ae187843966bc8e270ac755248738666583ef6015550939980abf8ceb49059e0e09 +e3a81710686d15527c2440df92d36f602859956edf65d3d8450a450faa68ee60cecbc82d7ed08d709c5661073489cad80fe4018428467b5c55c177b99b21fa19 +fc809385eebe4d89e3eed3abc12d1a3a22cd0244bf99086d45a8d54e058e69f24fe59851a8c7d6fa17578ea1003effe651854fdfd642bc093da92a13b64f94df +45b89345b7cb4540dffe9abb8527c91e81309f6f3cef4aeebb92ebfde74beea27c3e6ba19dd55628bb7a6eb053b19991e3c523f298323650534676a499922534 +8aa00f8b7aa3392292e2cc9446f0352bec0e2e14d8ec4182ab8fa98a06114e61c2ae7b9a482833d2a144299770b433cb95b4351ea674650f864d7d64b0054162 +b5cb03bbbca297f3934141c6b49bd09c3f73462b9ac05999ad5cc98882daafc2acae853a33b7ba11cdd43a875ba13238715e35582cac09130882b905acbc0a87 +74cd1a4e26989140dbdd36dfdc2dc60b17e92219e180643ed27acffba86e9c94c78ab90c80d8a9f0913ee69d62b512b79626fb1adccee2a432bbc60276b9f75e +c74b7904cfbca413f7443ab2a49c9c2c41476dafd55c6e7ac8c769db1bc3a116bec629785deaa10fb3106e877c256cd89f9acc26cb67de6ce58ab94950878b0a +6bf739859d3a900aa9b6b08c6c6898575908b04473b2f22f37c1ac17a5808df4579062650d82e18d490176745d4bc663e2abb2b34b2bda76f6312ba57ca28818 +44c1111ab189d8c7e07e1daaa04f4025dc4d988aa01fe0264d5bdbbc728b739674e5fb2b83b3eb98a511cecaad4ed13c932ddce4712183792a8907ba55ca6e94 +3bbf2a26e52f48957218ffcf54d1fd04ae0a5602ed011fee7205463a5fdb1e172ae25085d288fa7d019383a91d102d701b0baf21a8e046d9fc17e450ffb73967 +6998b486139fdaa7211214fa918a04217b50964cf49d42ac9ef52e4b9265844c4495c495a9157b440e091bea1ab8aa7bbb87220875534db232607027e3cf7dce +326814ea21a79c6f4e0d297aafcd817f7bf2b1c90c4ab975d80c34b9fd0b112bbaaadd6fb6e7bdb7ac887e311bb31a795600b3522b686569ff8a229cb3d5da8a +35a7f17233170ebc38af312c1603510a173e48ff81fe4785cf880963dd50877c1f6a2b829f1a3431081b88ea4b76f040ba40dac5110c4e76d1069326654d9b8d +4eda6a79b3bee049b7e07bc2d85ab2b3f8fb9cc62e8633979d938b1769ecccc28eadedda425383674fa6282c8df3938c718cf95dabfcc3131fdd05476fc105ff +84296982097e55121846cf81c903487ecbd16cddf81b0000ffff0300504b0304140006000800000021000dd1909fb60000001b010000270000007468656d652f +7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f78277086f6fd3ba109126dd88d0add40384e4350d363f +2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89d93b64b060828e6f37ed1567914b284d262452282e31 +98720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd5001996509affb3fd381a89672f1f165dfe514173d98505 +28a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100828abc13fa0000001c02000013000000000000000000000000 +00000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6a7e7c0000000360100000b0000000000000000000000 +00002b0100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a0000001c000000000000000000000000001402000074 +68656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d0014000600080000002100e35a492797060000551b0000160000000000000000 +0000000000d10200007468656d652f7468656d652f7468656d65312e786d6c504b01022d00140006000800000021000dd1909fb60000001b0100002700000000 +0000000000000000009c0900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000970a00000000} +{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d +617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169 +6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363 +656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e} +{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4; +\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9; +\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7; +\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference; +\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000 +4d73786d6c322e534158584d4c5265616465722e352e3000000000000000000000060000 +d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffffec69d9888b8b3d4c859eaf6cd158be0f000000000000000000000000d0f3 +612efb76c901feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000105000000000000}} \ No newline at end of file diff --git a/Test/Licenses/BASS/license(BASS).txt b/Test/Licenses/BASS/license(BASS).txt new file mode 100644 index 00000000..46028e50 --- /dev/null +++ b/Test/Licenses/BASS/license(BASS).txt @@ -0,0 +1,105 @@ +Licence (BASS) +======= +BASS is free for non-commercial use. If you are a non-commercial entity +(eg. an individual) and you are not making any money from your product +(through sales/advertising/etc), then you can use BASS in it for free. +If you wish to use BASS in commercial products, then please also see the +next section. + +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, BASS IS PROVIDED +"AS IS", WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND/OR FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS SHALL NOT BE HELD +LIABLE FOR ANY DAMAGE THAT MAY RESULT FROM THE USE OF BASS. YOU USE +BASS ENTIRELY AT YOUR OWN RISK. + +Usage of BASS indicates that you agree to the above conditions. + +All trademarks and other registered names contained in the BASS +package are the property of their respective owners. + + + + +Licence (BASSMIX) +======= +BASSmix is free to use with BASS. + +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, BASSMIX IS PROVIDED +"AS IS", WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND/OR FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS SHALL NOT BE HELD +LIABLE FOR ANY DAMAGE THAT MAY RESULT FROM THE USE OF BASSMIX. YOU USE +BASSMIX ENTIRELY AT YOUR OWN RISK. + +Usage of BASSmix indicates that you agree to the above conditions. + +All trademarks and other registered names contained in the BASSmix +package are the property of their respective owners. + + + + +Licence (BASSWASAPI) +======= +BASSWASAPI is free to use with BASS. + +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, BASSWASAPI IS PROVIDED +"AS IS", WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND/OR FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS SHALL NOT BE HELD +LIABLE FOR ANY DAMAGE THAT MAY RESULT FROM THE USE OF BASSWASAPI. YOU USE +BASSWASAPI ENTIRELY AT YOUR OWN RISK. + +Usage of BASSWASAPI indicates that you agree to the above conditions. + +All trademarks and other registered names contained in the BASSWASAPI +package are the property of their respective owners. + + + +Licence (BASSASIO) +======= +BASSASIO is free for non-commercial use. If you are a non-commercial entity +(eg. an individual) and you are not making any money from your product +(through sales/advertising/etc), then you can use BASSASIO in it for free. +If you wish to use BASSASIO in commercial products, then please also see the +next section. + +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, BASSASIO IS PROVIDED +"AS IS", WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND/OR FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS SHALL NOT BE HELD +LIABLE FOR ANY DAMAGE THAT MAY RESULT FROM THE USE OF BASSASIO. YOU USE +BASSASIO ENTIRELY AT YOUR OWN RISK. + +Usage of BASSASIO indicates that you agree to the above conditions. + +ASIO is a trademark of Steinberg Media Technologies GmbH. All other +trademarks and registered names contained in the BASSASIO package +are the property of their respective owners. + + + + + +BASS.NET + Note +(c) 2005-2012 by radio42, Germany. Author: Bernd Niedergesaess - All rights reserved. + +BASS.NET is the property of radio42 and is protected by copyright laws + and international copyright treaties. BASS.NET is not sold, it is licensed. + +BASS and Add-Ons: All trademarks and other registered names contained + in the BASS.NET package are the property of their respective owners. + +Requires: BASS (c) 1999-2012 by Ian Luck. + +Caution +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, BASS.NET IS PROVIDED +"AS IS", WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY +AND/OR FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS SHALL NOT BE HELD +LIABLE FOR ANY DAMAGE THAT MAY RESULT FROM THE USE OF BASS.NET. +BASICALLY, YOU USE BASS.NET ENTIRELY AT YOUR OWN RISK. + diff --git a/Test/Licenses/CSharpTest.Net.Collections.txt b/Test/Licenses/CSharpTest.Net.Collections.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/Test/Licenses/CSharpTest.Net.Collections.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Test/Licenses/DirectShowLib.txt b/Test/Licenses/DirectShowLib.txt new file mode 100644 index 00000000..78f1f74f --- /dev/null +++ b/Test/Licenses/DirectShowLib.txt @@ -0,0 +1,513 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/Test/Licenses/IPA_Font_License_Agreement_v1.0.txt b/Test/Licenses/IPA_Font_License_Agreement_v1.0.txt new file mode 100644 index 00000000..fe8db247 --- /dev/null +++ b/Test/Licenses/IPA_Font_License_Agreement_v1.0.txt @@ -0,0 +1,117 @@ +サソ-------------------------------------------------- +IPA Font License Agreement v1.0 +-------------------------------------------------- + +IPA繝輔か繝ウ繝医Λ繧、繧サ繝ウ繧ケv1.0 + +險ア隲セ閠縺ッ縲√%縺ョ菴ソ逕ィ險ア隲セシ井サ・荳九梧悽螂醍エ縲阪→縺縺縺セ縺吶ゑシ峨↓螳壹a繧区擅莉カ縺ョ荳九〒縲∬ィア隲セ繝励Ο繧ー繝ゥ繝シ1譚。縺ォ螳夂セゥ縺吶k縺ィ縺薙m縺ォ繧医j縺セ縺吶ゑシ峨r謠蝉セ帙@縺セ縺吶ょ女鬆倩シ1譚。縺ォ螳夂セゥ縺吶k縺ィ縺薙m縺ォ繧医j縺セ縺吶ゑシ峨′縲∬ィア隲セ繝励Ο繧ー繝ゥ繝繧剃スソ逕ィ縺励∬、陬ス縺励√∪縺溘ッ鬆貞ク縺吶k陦檎ぜ縲√◎縺ョ莉悶∵悽螂醍エ縺ォ螳壹a繧区ィゥ蛻ゥ縺ョ蛻ゥ逕ィ繧定。後▲縺溷エ蜷医∝女鬆倩縺ッ譛ャ螂醍エ縺ォ蜷梧э縺励◆繧ゅョ縺ィ隕九↑縺励∪縺吶 + + +隨ャ1譚。縲逕ィ隱槭ョ螳夂セゥ + +譛ャ螂醍エ縺ォ縺翫>縺ヲ縲∵ャ。縺ョ蜷蜿キ縺ォ謗イ縺偵k逕ィ隱槭ッ縲∝ス楢ゥイ蜷蜿キ縺ォ螳壹a繧九→縺薙m縺ォ繧医j縺セ縺吶 + +1.縲後ョ繧ク繧ソ繝ォス・繝輔か繝ウ繝茨ス・繝励Ο繧ー繝ゥ繝縲阪→縺ッ縲√ヵ繧ゥ繝ウ繝医r蜷ォ縺ソ縲√Ξ繝ウ繝繝ェ繝ウ繧ー縺励∪縺溘ッ陦ィ遉コ縺吶k縺溘a縺ォ逕ィ縺繧峨l繧九さ繝ウ繝斐Η繝シ繧ソ繝サ繝励Ο繧ー繝ゥ繝繧偵>縺縺セ縺吶 +2.縲瑚ィア隲セ繝励Ο繧ー繝ゥ繝縲阪→縺ッ縲∬ィア隲セ閠縺梧悽螂醍エ縺ョ荳九〒險ア隲セ縺吶k繝繧ク繧ソ繝ォス・繝輔か繝ウ繝茨ス・繝励Ο繧ー繝ゥ繝繧偵>縺縺セ縺吶 +3.縲梧エセ逕溘励Ο繧ー繝ゥ繝縲阪→縺ッ縲∬ィア隲セ繝励Ο繧ー繝ゥ繝縺ョ荳驛ィ縺セ縺溘ッ蜈ィ驛ィ繧偵∵隼螟峨@縲∝刈髯、菫ョ豁」遲峨@縲∝・繧梧崛縺医√◎縺ョ莉也ソサ譯医@縺溘ョ繧ク繧ソ繝ォス・繝輔か繝ウ繝茨ス・繝励Ο繧ー繝ゥ繝繧偵>縺縲∬ィア隲セ繝励Ο繧ー繝ゥ繝縺ョ荳驛ィ繧ゅ@縺上ッ蜈ィ驛ィ縺九i譁蟄玲ュ蝣ア繧貞叙繧雁コ縺励√∪縺溘ッ繝繧ク繧ソ繝ォス・繝峨く繝・繝。繝ウ繝茨ス・繝輔ぃ繧、繝ォ縺九i繧ィ繝ウ繝吶ャ繝峨&繧後◆繝輔か繝ウ繝医r蜿悶j蜃コ縺励∝叙繧雁コ縺輔l縺滓枚蟄玲ュ蝣ア繧偵◎縺ョ縺セ縺セ縲√∪縺溘ッ謾ケ螟峨r縺ェ縺励※譁ー縺溘↑繝繧ク繧ソ繝ォ繝サ繝輔か繝ウ繝医サ繝励Ο繧ー繝ゥ繝縺ィ縺励※陬ス菴懊&繧後◆繧ゅョ繧貞性縺ソ縺セ縺吶 +4.縲後ョ繧ク繧ソ繝ォ繝サ繧ウ繝ウ繝繝ウ繝縲阪→縺ッ縲√ョ繧ク繧ソ繝ォ繝サ繝繝シ繧ソ蠖「蠑上↓繧医▲縺ヲ繧ィ繝ウ繝峨サ繝ヲ繝シ繧カ縺ォ謠蝉セ帙&繧後k蛻カ菴懃黄縺ョ縺薙→繧偵>縺縲∝虚逕サ繝サ髱呎ュ「逕サ遲峨ョ譏蜒上さ繝ウ繝繝ウ繝縺翫h縺ウ繝繝ャ繝鍋分邨遲峨ョ謾セ騾√さ繝ウ繝繝ウ繝縲√↑繧峨ウ縺ォ譁蟄励ユ繧ュ繧ケ繝医∫判蜒上∝峙蠖「遲峨r蜷ォ繧薙〒讒区舌&繧後◆蛻カ菴懃黄繧貞性縺ソ縺セ縺吶 +5.縲後ョ繧ク繧ソ繝ォ繝サ繝峨く繝・繝。繝ウ繝医サ繝輔ぃ繧、繝ォ縲阪→縺ッ縲 ̄DF繝輔ぃ繧、繝ォ縺昴ョ莉悶∝推遞ョ繧ス繝輔ヨ繧ヲ繧ァ繧「ス・繝励Ο繧ー繝ゥ繝縺ォ繧医▲縺ヲ陬ス菴懊&繧後◆繝繧ク繧ソ繝ォ繝サ繧ウ繝ウ繝繝ウ繝縺ァ縺ゅ▲縺ヲ縲√◎縺ョ荳ュ縺ォ繝輔か繝ウ繝医r陦ィ遉コ縺吶k縺溘a縺ォ險ア隲セ繝励Ο繧ー繝ゥ繝縺ョ蜈ィ驛ィ縺セ縺溘ッ荳驛ィ縺悟沂繧∬セシ縺セ繧後◆シ医お繝ウ繝吶ャ繝峨&繧後◆シ峨b縺ョ繧偵>縺縺セ縺吶ゅヵ繧ゥ繝ウ繝医′縲後お繝ウ繝吶ャ繝峨&繧後◆縲阪→縺ッ縲∝ス楢ゥイ繝輔か繝ウ繝医′蝓九a霎シ縺セ繧後◆迚ケ螳壹ョ縲後ョ繧ク繧ソ繝ォ繝サ繝峨く繝・繝。繝ウ繝医サ繝輔ぃ繧、繝ォ縲阪↓縺翫>縺ヲ縺ョ縺ソ陦ィ遉コ縺輔l繧九◆繧√↓菴ソ逕ィ縺輔l縺ヲ縺繧狗憾諷九r謖縺励√◎縺ョ迚ケ螳壹ョ縲後ョ繧ク繧ソ繝ォ繝サ繝峨く繝・繝。繝ウ繝医サ繝輔ぃ繧、繝ォ縲堺サ・螟悶〒繝輔か繝ウ繝医r陦ィ遉コ縺吶k縺溘a縺ォ菴ソ逕ィ縺ァ縺阪k繝繧ク繧ソ繝ォ繝サ繝輔か繝ウ繝医サ繝励Ο繧ー繝ゥ繝縺ォ蜷ォ縺セ繧後※縺繧句エ蜷医→蛹コ蛻・縺輔l縺セ縺吶 +6.縲後さ繝ウ繝斐Η繝シ繧ソス」縺ィ縺ッ縲∵悽螂醍エ縺ォ縺翫>縺ヲ縺ッ縲√し繝シ繝舌r蜷ォ縺ソ縺セ縺吶 +7.縲瑚、陬ス縺昴ョ莉悶ョ蛻ゥ逕ィ縲阪→縺ッ縲∬、陬ス縲∬ュイ貂。縲鬆貞ク縲∬イク荳弱∝ャ陦騾∽ソ。縲∽ク頑丐縲∝ア慕、コ縲∫ソサ譯医◎縺ョ莉悶ョ蛻ゥ逕ィ繧偵>縺縺セ縺吶 +8.縲悟女鬆倩縲阪→縺ッ縲∬ィア隲セ繝励Ο繧ー繝ゥ繝繧呈悽螂醍エ縺ョ荳九〒蜿鈴倥@縺滉ココ繧偵>縺縲∝女鬆倩縺九i險ア隲セ繝励Ο繧ー繝ゥ繝繧貞女鬆倥@縺滉ココ繧貞性縺ソ縺セ縺吶 + +隨ャシ呈擅 菴ソ逕ィ險ア隲セ縺ョ莉倅ク + +險ア隲セ閠縺ッ蜿鈴倩縺ォ蟇セ縺励∵悽螂醍エ縺ョ譚。鬆縺ォ蠕薙>縲√☆縺ケ縺ヲ縺ョ蝗ス縺ァ縲∬ィア隲セ繝励Ο繧ー繝ゥ繝繧剃スソ逕ィ縺吶k縺薙→繧定ィア隲セ縺励∪縺吶ゅ◆縺縺励∬ィア隲セ繝励Ο繧ー繝ゥ繝縺ォ蟄伜惠縺吶k荳蛻縺ョ讓ゥ蛻ゥ縺ッ縺吶∋縺ヲ險ア隲セ閠縺御ソ晄怏縺励※縺縺セ縺吶よ悽螂醍エ縺ッ縲∵悽螂醍エ縺ァ譏守、コ逧縺ォ螳壹a繧峨l縺ヲ縺繧句エ蜷医r髯、縺阪√>縺九↑繧区э蜻ウ縺ォ縺翫>縺ヲ繧ゅ∬ィア隲セ閠縺御ソ晄怏縺吶k險ア隲セ繝励Ο繧ー繝ゥ繝縺ォ髢「縺吶k荳蛻縺ョ讓ゥ蛻ゥ縺翫h縺ウ縲√>縺九↑繧句膚讓吶∝膚蜿キ縲√b縺励¥縺ッ繧オ繝シ繝薙せ繝サ繝槭シ繧ッ縺ォ髢「縺吶k讓ゥ蛻ゥ繧偵b蜿鈴倩縺ォ遘サ霆「縺吶k繧ゅョ縺ァ縺ッ縺ゅj縺セ縺帙s縲 + +1.蜿鈴倩縺ッ譛ャ螂醍エ縺ォ螳壹a繧区擅莉カ縺ォ蠕薙>縲∬ィア隲セ繝励Ο繧ー繝ゥ繝繧剃ササ諢上ョ謨ー縺ョ繧ウ繝ウ繝斐Η繝シ繧ソ縺ォ繧、繝ウ繧ケ繝医シ繝ォ縺励∝ス楢ゥイ繧ウ繝ウ繝斐Η繝シ繧ソ縺ァ菴ソ逕ィ縺吶k縺薙→縺後〒縺阪∪縺吶 +2.蜿鈴倩縺ッ繧ウ繝ウ繝斐Η繝シ繧ソ縺ォ繧、繝ウ繧ケ繝医シ繝ォ縺輔l縺溯ィア隲セ繝励Ο繧ー繝ゥ繝繧偵◎縺ョ縺セ縺セ縲√∪縺溘ッ謾ケ螟峨r陦後▲縺溘≧縺医〒縲∝魂蛻キ迚ゥ縺翫h縺ウ繝繧ク繧ソ繝ォ繝サ繧ウ繝ウ繝繝ウ繝縺ォ縺翫>縺ヲ縲∵枚蟄励ユ繧ュ繧ケ繝郁。ィ迴セ遲峨→縺励※菴ソ逕ィ縺吶k縺薙→縺後〒縺阪∪縺吶 +3.蜿鈴倩縺ッ蜑埼縺ョ螳壹a縺ォ蠕薙>菴懈舌@縺溷魂蛻キ迚ゥ縺翫h縺ウ繝繧ク繧ソ繝ォ繝サ繧ウ繝ウ繝繝ウ繝縺ォ縺、縺阪√◎縺ョ蝠逕ィ繝サ髱槫膚逕ィ縺ョ蛻・縲√♀繧医ウ謾セ騾√騾壻ソ。縲∝推遞ョ險倬鹸繝。繝繧」繧「縺ェ縺ゥ縺ョ蟐剃ス薙ョ蠖「蠑上r蝠上o縺壹∬、陬ス縺昴ョ莉悶ョ蛻ゥ逕ィ繧偵☆繧九%縺ィ縺後〒縺阪∪縺吶 +4.蜿鈴倩縺後ョ繧ク繧ソ繝ォ繝サ繝峨く繝・繝。繝ウ繝医サ繝輔ぃ繧、繝ォ縺九i繧ィ繝ウ繝吶ャ繝峨&繧後◆繝輔か繝ウ繝医r蜿悶j蜃コ縺励※豢セ逕溘励Ο繧ー繝ゥ繝繧剃ス懈舌@縺溷エ蜷医↓縺ッ縲√°縺九k豢セ逕溘励Ο繧ー繝ゥ繝縺ッ譛ャ螂醍エ縺ォ螳壹a繧区擅莉カ縺ォ蠕薙≧蠢隕√′縺ゅj縺セ縺吶 +5.險ア隲セ繝励Ο繧ー繝ゥ繝縺ョ繧ィ繝ウ繝吶ャ繝峨&繧後◆繝輔か繝ウ繝医′繝繧ク繧ソ繝ォ繝サ繝峨く繝・繝。繝ウ繝医サ繝輔ぃ繧、繝ォ蜀縺ョ繝繧ク繧ソ繝ォ繝サ繧ウ繝ウ繝繝ウ繝繧偵Ξ繝ウ繝繝ェ繝ウ繧ー縺吶k縺溘a縺ォ縺ョ縺ソ菴ソ逕ィ縺輔l繧句エ蜷医↓縺翫>縺ヲ縲∝女鬆倩縺悟ス楢ゥイ繝繧ク繧ソ繝ォ繝サ繝峨く繝・繝。繝ウ繝医サ繝輔ぃ繧、繝ォ繧定、陬ス縺昴ョ莉悶ョ蛻ゥ逕ィ繧偵☆繧句エ蜷医↓縺ッ縲∝女鬆倩縺ッ縺九°繧玖。檎ぜ縺ォ髢「縺励※縺ッ譛ャ螂醍エ縺ョ荳九〒縺ッ縺縺九↑繧狗セゥ蜍吶r繧りイ縺縺セ縺帙s縲 +6.蜿鈴倩縺ッ縲3譚。2鬆縺ョ螳壹a縺ォ蠕薙>縲∝膚逕ィ繝サ髱槫膚逕ィ繧貞撫繧上★縲∬ィア隲セ繝励Ο繧ー繝ゥ繝繧偵◎縺ョ縺セ縺セ縺ョ迥カ諷九〒謾ケ螟峨☆繧九%縺ィ縺ェ縺剰、陬ス縺励※隨ャ荳芽縺ク縺ョ隴イ貂。縺励∝ャ陦騾∽ソ。縺励√◎縺ョ莉悶ョ譁ケ豕輔〒蜀埼榊ク縺吶k縺薙→縺後〒縺阪∪縺(莉・荳九√悟埼榊ク縲阪→縺縺縺セ縺吶)縲 +7.蜿鈴倩縺ッ縲∽ク願ィ倥ョ險ア隲セ繝励Ο繧ー繝ゥ繝縺ォ縺、縺縺ヲ螳壹a繧峨l縺滓擅莉カ縺ィ蜷梧ァ倥ョ譚。莉カ縺ォ蠕薙▲縺ヲ縲∵エセ逕溘励Ο繧ー繝ゥ繝繧剃ス懈舌@縲∽スソ逕ィ縺励∬、陬ス縺励∝埼榊ク縺吶k縺薙→縺後〒縺阪∪縺吶ゅ◆縺縺励∝女鬆倩縺梧エセ逕溘励Ο繧ー繝ゥ繝繧貞埼榊ク縺吶k蝣エ蜷医↓縺ッ縲3譚。1鬆縺ョ螳壹a縺ォ蠕薙≧繧ゅョ縺ィ縺励∪縺吶 + +隨ャシ捺擅縲蛻カ髯 + +蜑肴擅縺ォ繧医j莉倅ク弱&繧後◆菴ソ逕ィ險ア隲セ縺ッ縲∽サ・荳九ョ蛻カ髯舌↓譛阪@縺セ縺吶 + +1.豢セ逕溘励Ο繧ー繝ゥ繝縺悟燕譚。4鬆蜿翫ウ7鬆縺ォ蝓コ縺・縺榊埼榊ク縺輔l繧句エ蜷医↓縺ッ縲∽サ・荳九ョ蜈ィ縺ヲ縺ョ譚。莉カ繧呈コ縺溘&縺ェ縺代l縺ー縺ェ繧翫∪縺帙s縲 +縲(1)豢セ逕溘励Ο繧ー繝ゥ繝繧貞埼榊ク縺吶k髫帙↓縺ッ縲∽ク玖ィ倥b縺セ縺溘∝ス楢ゥイ豢セ逕溘励Ο繧ー繝ゥ繝縺ィ荳邱偵↓蜀埼榊ク縺輔l縲√が繝ウ繝ゥ繧、繝ウ縺ァ謠蝉セ帙&繧後√∪縺溘ッ縲驛オ騾∬イサ繝サ蟐剃ス灘所縺ウ蜿匁桶謇区焚譁吶ョ蜷郁ィ医r雜縺医↑縺螳溯イサ縺ィ蠑輔″謠帙∴縺ォ蟐剃ス薙r驛オ騾√☆繧区婿豕輔↓繧医j謠蝉セ帙&繧後↑縺代l縺ー縺ェ繧翫∪縺帙s縲 +縲縲(a)豢セ逕溘励Ο繧ー繝ゥ繝縺ョ蜀吶@; 縺翫h縺ウ +縲縲(b)豢セ逕溘励Ο繧ー繝ゥ繝繧剃ス懈舌☆繧矩℃遞九〒繝輔か繝ウ繝磯幕逋コ繝励Ο繧ー繝ゥ繝縺ォ繧医▲縺ヲ菴懈舌&繧後◆霑ス蜉縺ョ繝輔ぃ繧、繝ォ縺ァ縺ゅ▲縺ヲ豢セ逕溘励Ο繧ー繝ゥ繝繧偵&繧峨↓蜉蟾・縺吶k縺ォ縺ゅ◆縺」縺ヲ蛻ゥ逕ィ縺ァ縺阪k繝輔ぃ繧、繝ォ縺悟ュ伜惠縺吶l縺ー縲∝ス楢ゥイ繝輔ぃ繧、繝ォ +縲(2)豢セ逕溘励Ο繧ー繝ゥ繝縺ョ蜿鈴倩縺後∵エセ逕溘励Ο繧ー繝ゥ繝繧偵√%縺ョ繝ゥ繧、繧サ繝ウ繧ケ縺ョ荳九〒譛蛻昴↓繝ェ繝ェ繝シ繧ケ縺輔l縺溯ィア隲セ繝励Ο繧ー繝ゥ繝シ井サ・荳九√後が繝ェ繧ク繝翫Ν繝サ繝励Ο繧ー繝ゥ繝縲阪→縺縺縺セ縺吶ゑシ峨↓鄂ョ縺肴鋤縺医k縺薙→縺後〒縺阪k譁ケ豕輔r蜀埼榊ク縺吶k繧ゅョ縺ィ縺励∪縺吶ゅ°縺九k譁ケ豕輔ッ縲√が繝ェ繧ク繝翫Ν繝サ繝輔ぃ繧、繝ォ縺九i縺ョ蟾ョ蛻繝輔ぃ繧、繝ォ縺ョ謠蝉セ帙√∪縺溘ッ縲∵エセ逕溘励Ο繧ー繝ゥ繝繧偵が繝ェ繧ク繝翫Ν繝サ繝励Ο繧ー繝ゥ繝縺ォ鄂ョ縺肴鋤縺医k譁ケ豕輔r遉コ縺呎欠遉コ縺ョ謠蝉セ帙↑縺ゥ縺瑚縺医i繧後∪縺吶 +縲(3)豢セ逕溘励Ο繧ー繝ゥ繝繧偵∵悽螂醍エ譖ク縺ォ螳壹a繧峨l縺滓擅莉カ縺ョ荳九〒繝ゥ繧、繧サ繝ウ繧ケ縺励↑縺代l縺ー縺ェ繧翫∪縺帙s縲 +縲(4)豢セ逕溘励Ο繧ー繝ゥ繝縺ョ繝励Ο繧ー繝ゥ繝蜷阪√ヵ繧ゥ繝ウ繝亥錐縺セ縺溘ッ繝輔ぃ繧、繝ォ蜷阪→縺励※縲∬ィア隲セ繝励Ο繧ー繝ゥ繝縺檎畑縺縺ヲ縺繧九ョ縺ィ蜷御ク縺ョ蜷咲ァー縲√∪縺溘ッ縺薙l繧貞性繧蜷咲ァー繧剃スソ逕ィ縺励※縺ッ縺ェ繧翫∪縺帙s縲 +縲(5)譛ャ鬆縺ョ隕∽サカ繧呈コ縺溘☆縺溘a縺ォ繧ェ繝ウ繝ゥ繧、繝ウ縺ァ謠蝉セ帙@縲√∪縺溘ッ蟐剃ス薙r驛オ騾√☆繧区婿豕輔〒謠蝉セ帙&繧後k繧ゅョ縺ッ縲√◎縺ョ謠蝉セ帙r蟶梧悍縺吶k縺縺九↑繧玖縺ォ繧医▲縺ヲ繧よ署萓帙′蜿ッ閭ス縺ァ縺吶 +2.蜿鈴倩縺悟燕譚。6鬆縺ォ蝓コ縺・縺崎ィア隲セ繝励Ο繧ー繝ゥ繝繧貞埼榊ク縺吶k蝣エ蜷医↓縺ッ縲∽サ・荳九ョ蜈ィ縺ヲ縺ョ譚。莉カ繧呈コ縺溘&縺ェ縺代l縺ー縺ェ繧翫∪縺帙s縲 +縲(1)險ア隲セ繝励Ο繧ー繝ゥ繝縺ョ蜷咲ァー繧貞、画峩縺励※縺ッ縺ェ繧翫∪縺帙s縲 +縲(2)險ア隲セ繝励Ο繧ー繝ゥ繝縺ォ蜉蟾・縺昴ョ莉悶ョ謾ケ螟峨r蜉縺医※縺ッ縺ェ繧翫∪縺帙s縲 +縲(3)譛ャ螂醍エ縺ョ蜀吶@繧定ィア隲セ繝励Ο繧ー繝ゥ繝縺ォ豺サ莉倥@縺ェ縺代l縺ー縺ェ繧翫∪縺帙s縲 +3.險ア隲セ繝励Ο繧ー繝ゥ繝縺ッ縲∫樟迥カ譛牙ァソ縺ァ謠蝉セ帙&繧後※縺翫j縲∬ィア隲セ繝励Ο繧ー繝ゥ繝縺セ縺溘ッ豢セ逕溘励Ο繧ー繝ゥ繝縺ォ縺、縺縺ヲ縲∬ィア隲セ閠縺ッ荳蛻縺ョ譏守、コ縺セ縺溘ッ鮟咏、コ縺ョ菫晁ィシシ域ィゥ蛻ゥ縺ョ謇蝨ィ縲髱樔セオ螳ウ縲∝膚蜩∵ァ縲∫音螳夂岼逧縺ク縺ョ驕ゥ蜷域ァ繧貞性繧縺後%繧後↓髯舌i繧後∪縺帙sシ峨r陦後>縺セ縺帙s縲ゅ>縺九↑繧句エ蜷医↓繧ゅ√◎縺ョ蜴溷屏繧貞撫繧上★縲∝・醍エ荳翫ョ雋ャ莉サ縺句宍譬シ雋ャ莉サ縺矩℃螟ア縺昴ョ莉悶ョ荳肴ウ戊。檎ぜ雋ャ莉サ縺九↓縺九°繧上i縺壹√∪縺滉コ句燕縺ォ騾夂衍縺輔l縺溘°蜷ヲ縺九↓縺九°繧上i縺壹∬ィア隲セ閠縺ッ縲∬ィア隲セ繝励Ο繧ー繝ゥ繝縺セ縺溘ッ豢セ逕溘励Ο繧ー繝ゥ繝縺ョ繧、繝ウ繧ケ繝医シ繝ォ縲∽スソ逕ィ縲∬、陬ス縺昴ョ莉悶ョ蛻ゥ逕ィ縺セ縺溘ッ譛ャ螂醍エ荳翫ョ讓ゥ蛻ゥ縺ョ陦御スソ縺ォ繧医▲縺ヲ逕溘§縺滉ク蛻縺ョ謳榊ョウシ育峩謗・繝サ髢捺磁繝サ莉倬囂逧繝サ迚ケ蛻・繝サ諡。螟ァ繝サ諛イ鄂ー逧縺セ縺溘ッ邨先棡逧謳榊ョウシ会シ亥膚蜩√∪縺溘ッ繧オ繝シ繝薙せ縺ョ莉」譖ソ蜩√ョ隱ソ驕斐√す繧ケ繝繝髫懷ョウ縺九i逕溘§縺滓錐螳ウ縲∫樟蟄倥☆繧九ョ繝シ繧ソ縺セ縺溘ッ繝励Ο繧ー繝ゥ繝縺ョ邏帛、ア縺セ縺溘ッ遐エ謳阪騾ク螟ア蛻ゥ逶翫r蜷ォ繧縺後%繧後↓髯舌i繧後∪縺帙sシ峨↓縺、縺縺ヲ雋ャ莉サ繧定イ縺縺セ縺帙s縲 +4.險ア隲セ繝励Ο繧ー繝ゥ繝縺セ縺溘ッ豢セ逕溘励Ο繧ー繝ゥ繝縺ョ繧、繝ウ繧ケ繝医シ繝ォ縲∽スソ逕ィ縲∬、陬ス縺昴ョ莉悶ョ蛻ゥ逕ィ縺ォ髢「縺励※縲∬ィア隲セ閠縺ッ謚陦鍋噪縺ェ雉ェ蝠上d蝠上>蜷医o縺帷ュ峨↓蟇セ縺吶k蟇セ蠢懊◎縺ョ莉悶√>縺九↑繧九Θ繝シ繧カ繝サ繧オ繝昴シ繝医r繧り。後≧鄒ゥ蜍吶r雋縺縺セ縺帙s縲 + +隨ャシ疲擅縲螂醍エ縺ョ邨ゆコ + +1.譛ャ螂醍エ縺ョ譛牙柑譛滄俣縺ッ縲∝女鬆倩縺瑚ィア隲セ繝励Ο繧ー繝ゥ繝繧貞女鬆倥@縺滓凾縺ォ髢句ァ九@縲∝女鬆倩縺瑚ィア隲セ繝励Ο繧ー繝ゥ繝繧剃ス輔i縺九ョ譁ケ豕輔〒菫晄戟縺吶k髯舌j邯壹¥繧ゅョ縺ィ縺励∪縺吶 +2.蜑埼縺ョ螳壹a縺ォ縺九°繧上i縺壹∝女鬆倩縺梧悽螂醍エ縺ォ螳壹a繧句推譚。鬆縺ォ驕募渚縺励◆縺ィ縺阪ッ縲∵悽螂醍エ縺ッ縲∽ス輔i縺ョ蛯ャ蜻翫r隕√☆繧九%縺ィ縺ェ縺上∬ェ蜍慕噪縺ォ邨ゆコ縺励∝ス楢ゥイ蜿鈴倩縺ッ縺昴l莉・蠕後∬ィア隲セ繝励Ο繧ー繝ゥ繝縺翫h縺ウ豢セ逕溘励Ο繧ー繝ゥ繝繧剃ク蛻菴ソ逕ィ縺励∪縺溘ッ隍陬ス縺昴ョ莉悶ョ蛻ゥ逕ィ繧偵☆繧九%縺ィ縺後〒縺阪↑縺繧ゅョ縺ィ縺励∪縺吶ゅ◆縺縺励√°縺九k螂醍エ縺ョ邨ゆコ縺ッ縲∝ス楢ゥイ驕募渚縺励◆蜿鈴倩縺九i險ア隲セ繝励Ο繧ー繝ゥ繝縺セ縺溘ッ豢セ逕溘励Ο繧ー繝ゥ繝縺ョ驟榊ク繧貞女縺代◆蜿鈴倩縺ョ讓ゥ蛻ゥ縺ォ蠖ア髻ソ繧貞所縺シ縺吶b縺ョ縺ァ縺ッ縺ゅj縺セ縺帙s縲 + +隨ャシ墓擅縲貅匁侠豕 + +1.IPA縺ッ縲∵悽螂醍エ縺ョ螟画峩繝舌シ繧ク繝ァ繝ウ縺セ縺溘ッ譁ー縺励>繝舌シ繧ク繝ァ繝ウ繧貞ャ陦ィ縺吶k縺薙→縺後〒縺阪∪縺吶ゅ◎縺ョ蝣エ蜷医↓縺ッ縲∝女鬆倩縺ッ縲∬ィア隲セ繝励Ο繧ー繝ゥ繝縺セ縺溘ッ豢セ逕溘励Ο繧ー繝ゥ繝縺ョ菴ソ逕ィ縲∬、陬ス縺昴ョ莉悶ョ蛻ゥ逕ィ縺セ縺溘ッ蜀埼榊ク縺ォ縺ゅ◆繧翫∵悽螂醍エ縺セ縺溘ッ螟画峩蠕後ョ螂醍エ縺ョ縺縺壹l縺九r驕ク謚槭☆繧九%縺ィ縺後〒縺阪∪縺吶ゅ◎縺ョ莉悶∽ク願ィ倥↓險倩シ峨&繧後※縺縺ェ縺譚。鬆縺ォ髢「縺励※縺ッ譌・譛ャ縺ョ闡嶺ス懈ィゥ豕輔♀繧医ウ髢「騾」豕戊ヲ上↓蠕薙≧繧ゅョ縺ィ縺励∪縺吶 +2.譛ャ螂醍エ縺ッ縲∵律譛ャ豕輔↓蝓コ縺・縺崎ァ」驥医&繧後∪縺吶 + + +---------- + +IPA Font License Agreement v1.0 + +The Licensor provides the Licensed Program (as defined in Article 1 below) under the terms of this license agreement (窶廣greement窶). Any use, reproduction or distribution of the Licensed Program, or any exercise of rights under this Agreement by a Recipient (as defined in Article 1 below) constitutes the Recipient's acceptance of this Agreement. + +Article 1 (Definitions) +1.窶廛igital Font Program窶 shall mean a computer program containing, or used to render or display fonts. +2.窶廰icensed Program窶 shall mean a Digital Font Program licensed by the Licensor under this Agreement. +3.窶廛erived Program窶 shall mean a Digital Font Program created as a result of a modification, addition, deletion, replacement or any other adaptation to or of a part or all of the Licensed Program, and includes a case where a Digital Font Program newly created by retrieving font information from a part or all of the Licensed Program or Embedded Fonts from a Digital Document File with or without modification of the retrieved font information. +4.窶廛igital Content窶 shall mean products provided to end users in the form of digital data, including video content, motion and/or still pictures, TV programs or other broadcasting content and products consisting of character text, pictures, photographic images, graphic symbols and/or the like. +5.窶廛igital Document File窶 shall mean a PDF file or other Digital Content created by various software programs in which a part or all of the Licensed Program becomes embedded or contained in the file for the display of the font (窶廢mbedded Fonts窶). Embedded Fonts are used only in the display of characters in the particular Digital Document File within which they are embedded, and shall be distinguished from those in any Digital Font Program, which may be used for display of characters outside that particular Digital Document File. +6.窶廚omputer窶 shall include a server in this Agreement. +7.窶彝eproduction and Other Exploitation窶 shall mean reproduction, transfer, distribution, lease, public transmission, presentation, exhibition, adaptation and any other exploitation. +8.窶彝ecipient窶 shall mean anyone who receives the Licensed Program under this Agreement, including one that receives the Licensed Program from a Recipient. + +Article 2 (Grant of License) +The Licensor grants to the Recipient a license to use the Licensed Program in any and all countries in accordance with each of the provisions set forth in this Agreement. However, any and all rights underlying in the Licensed Program shall be held by the Licensor. In no sense is this Agreement intended to transfer any right relating to the Licensed Program held by the Licensor except as specifically set forth herein or any right relating to any trademark, trade name, or service mark to the Recipient. + +1.The Recipient may install the Licensed Program on any number of Computers and use the same in accordance with the provisions set forth in this Agreement. +2.The Recipient may use the Licensed Program, with or without modification in printed materials or in Digital Content as an expression of character texts or the like. +3.The Recipient may conduct Reproduction and Other Exploitation of the printed materials and Digital Content created in accordance with the preceding Paragraph, for commercial or non-commercial purposes and in any form of media including but not limited to broadcasting, communication and various recording media. +4.If any Recipient extracts Embedded Fonts from a Digital Document File to create a Derived Program, such Derived Program shall be subject to the terms of this agreement. +5.If any Recipient performs Reproduction or Other Exploitation of a Digital Document File in which Embedded Fonts of the Licensed Program are used only for rendering the Digital Content within such Digital Document File then such Recipient shall have no further obligations under this Agreement in relation to such actions. +6.The Recipient may reproduce the Licensed Program as is without modification and transfer such copies, publicly transmit or otherwise redistribute the Licensed Program to a third party for commercial or non-commercial purposes (窶彝edistribute窶), in accordance with the provisions set forth in Article 3 Paragraph 2. +7.The Recipient may create, use, reproduce and/or Redistribute a Derived Program under the terms stated above for the Licensed Program: provided, that the Recipient shall follow the provisions set forth in Article 3 Paragraph 1 when Redistributing the Derived Program. + +Article 3 (Restriction) +The license granted in the preceding Article shall be subject to the following restrictions: + +1.If a Derived Program is Redistributed pursuant to Paragraph 4 and 7 of the preceding Article, the following conditions must be met : +縲(1)The following must be also Redistributed together with the Derived Program, or be made available online or by means of mailing mechanisms in exchange for a cost which does not exceed the total costs of postage, storage medium and handling fees: +縲縲(a)a copy of the Derived Program; and +縲縲(b)any additional file created by the font developing program in the course of creating the Derived Program that can be used for further modification of the Derived Program, if any. +縲(2)It is required to also Redistribute means to enable recipients of the Derived Program to replace the Derived Program with the Licensed Program first released under this License (the 窶廾riginal Program窶). Such means may be to provide a difference file from the Original Program, or instructions setting out a method to replace the Derived Program with the Original Program. +縲(3)The Recipient must license the Derived Program under the terms and conditions of this Agreement. +縲(4)No one may use or include the name of the Licensed Program as a program name, font name or file name of the Derived Program. +縲(5)Any material to be made available online or by means of mailing a medium to satisfy the requirements of this paragraph may be provided, verbatim, by any party wishing to do so. +2.If the Recipient Redistributes the Licensed Program pursuant to Paragraph 6 of the preceding Article, the Recipient shall meet all of the following conditions: +縲(1)The Recipient may not change the name of the Licensed Program. +縲(2)The Recipient may not alter or otherwise modify the Licensed Program. +縲(3)The Recipient must attach a copy of this Agreement to the Licensed Program. +3.THIS LICENSED PROGRAM IS PROVIDED BY THE LICENSOR 窶廣S IS窶 AND ANY EXPRESSED OR IMPLIED WARRANTY AS TO THE LICENSED PROGRAM OR ANY DERIVED PROGRAM, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXTENDED, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO; PROCUREMENT OF SUBSTITUTED GOODS OR SERVICE; DAMAGES ARISING FROM SYSTEM FAILURE; LOSS OR CORRUPTION OF EXISTING DATA OR PROGRAM; LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE INSTALLATION, USE, THE REPRODUCTION OR OTHER EXPLOITATION OF THE LICENSED PROGRAM OR ANY DERIVED PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +4.The Licensor is under no obligation to respond to any technical questions or inquiries, or provide any other user support in connection with the installation, use or the Reproduction and Other Exploitation of the Licensed Program or Derived Programs thereof. + +Article 4 (Termination of Agreement) +1.The term of this Agreement shall begin from the time of receipt of the Licensed Program by the Recipient and shall continue as long as the Recipient retains any such Licensed Program in any way. +2.Notwithstanding the provision set forth in the preceding Paragraph, in the event of the breach of any of the provisions set forth in this Agreement by the Recipient, this Agreement shall automatically terminate without any notice. In the case of such termination, the Recipient may not use or conduct Reproduction and Other Exploitation of the Licensed Program or a Derived Program: provided that such termination shall not affect any rights of any other Recipient receiving the Licensed Program or the Derived Program from such Recipient who breached this Agreement. + +Article 5 (Governing Law) +1.IPA may publish revised and/or new versions of this License. In such an event, the Recipient may select either this Agreement or any subsequent version of the Agreement in using, conducting the Reproduction and Other Exploitation of, or Redistributing the Licensed Program or a Derived Program. Other matters not specified above shall be subject to the Copyright Law of Japan and other related laws and regulations of Japan. +2.This Agreement shall be construed under the laws of Japan. + diff --git a/Test/Licenses/SlimDX/CodeLicense.txt b/Test/Licenses/SlimDX/CodeLicense.txt new file mode 100644 index 00000000..52863fa8 --- /dev/null +++ b/Test/Licenses/SlimDX/CodeLicense.txt @@ -0,0 +1,19 @@ +Copyright (c) 2007-2010 SlimDX Group + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/Test/Licenses/SlimDX/MediaLicense.txt b/Test/Licenses/SlimDX/MediaLicense.txt new file mode 100644 index 00000000..cf0aa70c --- /dev/null +++ b/Test/Licenses/SlimDX/MediaLicense.txt @@ -0,0 +1,20 @@ +All of the SlimDX media is covered by the Creative Commons Attribution-Share Alike 3.0 License: +http://creativecommons.org/licenses/by-sa/3.0/us/ + +You are free: +* To Share to copy, distribute, display, and perform the work +* To Remix to make derivative works + +Under the following conditions: +* Attribution - You must attribute the work in the manner specified by the author or +licensor (but not in any way that suggests that they endorse you or your use of the work). +* Share Alike - If you alter, transform, or build upon this work, you may distribute +the resulting work only under the same, similar or a compatible license. + +For any reuse or distribution, you must make clear to others the license terms of this work. +The best way to do this is with a link to the above web page. + +Any of the above conditions can be waived if you get permission from the copyright holder. + +Apart from the remix rights granted under this license, nothing in this license impairs or +restricts the author's moral rights. \ No newline at end of file diff --git a/Test/Licenses/discord-rpc b/Test/Licenses/discord-rpc new file mode 100644 index 00000000..17fca3d5 --- /dev/null +++ b/Test/Licenses/discord-rpc @@ -0,0 +1,19 @@ +Copyright 2017 Discord, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Test/Licenses/dtxmania.txt b/Test/Licenses/dtxmania.txt new file mode 100644 index 00000000..36ff142b --- /dev/null +++ b/Test/Licenses/dtxmania.txt @@ -0,0 +1,23 @@ + +DTXMania 使用許諾 +Copyright (C) 2000 2013 DTXMania Group + +以下に定める条件に従い、本ソフトウェアおよび関連文書のファイル +(以下「ソフトウェア」)の複製を取得するすべての人に対し、 +ソフトウェアを無制限に扱うことを無償で許可します。 +これには、ソフトウェアの複製を使用、複写、変更、結合、掲載、頒布、 +サブライセンス、および/または販売する権利、およびソフトウェアを +提供する相手に同じことを許可する権利も無制限に含まれます。 + +上記の著作権表示および本許諾表示を、ソフトウェアのすべての複製 +または重要な部分に記載するものとします。 + +ソフトウェアは「現状のまま」で、明示であるか暗黙であるかを問わず、 +何らの保証もなく提供されます。ここでいう保証とは、商品性、特定の +目的への適合性、および権利非侵害についての保証も含みますが、それに +限定されるものではありません。 +作者または著作権者は、契約行為、不法行為、またはそれ以外であろうと、 +ソフトウェアに起因または関連し、あるいはソフトウェアの使用または +その他の扱いによって生じる一切の請求、損害、その他の義務について +何らの責任も負わないものとします。 + diff --git a/Test/Licenses/libogg_libvorbis.txt b/Test/Licenses/libogg_libvorbis.txt new file mode 100644 index 00000000..6111c6c5 --- /dev/null +++ b/Test/Licenses/libogg_libvorbis.txt @@ -0,0 +1,28 @@ +Copyright (c) 2002, Xiph.org Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of the Xiph.org Foundation nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Test/Licenses/xadec.txt b/Test/Licenses/xadec.txt new file mode 100644 index 00000000..7e3e9901 --- /dev/null +++ b/Test/Licenses/xadec.txt @@ -0,0 +1,13 @@ + +■再配布について + このDLLを使用している「フリーソフトウェア」に限り、xadec.dll単体を + 組み込んでの配布を許可します。 + 市販ソフトやシェアウェアなどには絶対に組み込まないでください。 + +■免責 + このプログラムは無保証です。 + 当DLLを使用して発生した如何なる不具合もこちらは一切責任を持ちかねます。 + +■連絡先 + http://www.bandjam.net/ + 中本 進一(webmaster@bandjam.net) diff --git a/Test/Readme.txt b/Test/Readme.txt new file mode 100644 index 00000000..dd0e3356 --- /dev/null +++ b/Test/Readme.txt @@ -0,0 +1,79 @@ +サソ############ +TJAPlayer3 Readme.txt +############ +蜈ャ髢区律:2018/5/5 +譖エ譁ー譌・:2018/12/21 + +== 縺ッ縺倥a縺ォ == +TJAPlayer3繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨@縺ヲ縺縺溘□縺阪√≠繧翫′縺ィ縺縺斐*縺縺セ縺吶 +縺薙ョ繧キ繝溘Η繝ャ繝シ繧ソ縺ッ縲√い繝シ繧ア繝シ繝/螳カ蠎ュ逕ィ繧イ繝シ繝縲悟、ェ鮠薙ョ驕比ココ縲阪す繝ェ繝シ繧コ縺ョ繧キ繝溘Η繝ャ繝シ繧ソ縺ァ縺吶 +縺薙ョ繧キ繝溘Η繝ャ繝シ繧ソ縺ッ縲ゝJAPlayer2 forPC縺ィ縺縺繧キ繝溘Η繝ャ繝シ繧ソ繝シ繧呈隼騾縺励◆繧ゅョ縺ァ縺吶 +螟ェ鮠薙&繧捺ャ。驛弱サTJAPlayer遲峨〒菴ソ繧上l縺ヲ縺繧.tja繝輔ぃ繧、繝ォ繧定ェュ縺ソ霎シ縺ソ縲√励Ξ繧、縺吶k縺薙→縺後〒縺阪∪縺吶 +(縺吶∋縺ヲ縺ョ.tja繝輔ぃ繧、繝ォ縺瑚ェュ縺ソ霎シ繧√k繧上¢縺ァ縺ッ縺ゅj縺セ縺帙s縲ゅ∪縺溘ゝJAPlayer3蛛エ縺ァ霑ス蜉縺励◆蜻ス莉、繧ゅ≠繧翫∪縺吶) +髢狗匱騾比クュ縺ョ繧キ繝溘Η繝ャ繝シ繧ソ縺ョ縺溘a縲∽ク榊キ蜷医d繝舌げ縺後≠繧句エ蜷医′縺ゅj縺セ縺吶ゅ#莠謇ソ縺上□縺輔>縲 +(繧ゅ@荳榊キ蜷医r隕九▽縺代◆蝣エ蜷医ッ縲;itHub縺ョissue繧Уwitter縺ァ騾」邨。縺励※縺上□縺輔k縺ィ縲∝、ァ螟牙勧縺九j縺セ縺吶) + +== 菴ソ逕ィ荳翫ョ豕ィ諢 == +繝サTJAPlayer3縺ッ繧ェ繝シ繝励Φ繧ス繝シ繧ケ繧ス繝輔ヨ繧ヲ繧ァ繧「(MIT)縺ァ縺吶 +繝サ縺薙ョ繧キ繝溘Η繝ャ繝シ繧ソ繧剃スソ逕ィ縺吶k蝣エ蜷医ッ縲**蜈ィ縺ヲ閾ェ蟾ア雋ャ莉サ**縺ァ縺企。倥>縺励∪縺吶 +繝サ隱ャ譏取嶌繧縲√ラ繧ュ繝・繝。繝ウ繝医r隕九l縺ー隗」豎コ縺ァ縺阪k雉ェ蝠上′繧医¥譚・縺セ縺吶ゆココ縺ォ雉ェ蝠上☆繧句燕縺ォ縲√∪縺壹ッ閾ェ蛻縺ァ隱ソ縺ケ繧九%縺ィ繧偵@縺ヲ縺上□縺輔>縲 +繝サ繝励Ο繧ー繝ゥ繝縺ョ蛻カ菴懆(AioiLight)縺ッ縲ゝJAPlayer3譛ャ菴(AioiLight.space縺九i繝繧ヲ繝ウ繝ュ繝シ繝峨@縺溘b縺ョ)縺ィ繝繝輔か繝ォ繝医ョ繧ケ繧ュ繝ウ縲郡impleStyle縲阪ョ繧オ繝昴シ繝医ョ縺ソ陦後>縺セ縺吶 +縲縺昴ョ莉悶ョ繧ケ繧ュ繝ウ(萓:譛ャ螳カ鬚ィ繧ケ繧ュ繝ウ)繧縲ゝJAPlayer3縺ョ謾ケ騾蜩(豢セ逕溘ン繝ォ繝)縺ョ繧オ繝昴シ繝医ッ蜴溷援陦後>縺セ縺帙s縺ョ縺ァ縺比コ謇ソ縺上□縺輔>縲 +繝サ縺吶∋縺ヲ縺ョ迺ー蠅縺ァ蜍穂ス懃「コ隱阪ッ縺ァ縺阪↑縺(縺ァ縺阪k縺ッ縺壹′縺ェ縺)縺ョ縺ァ縲∝虚縺縺溘i驕九′縺縺縲∫ィ句コヲ縺ァ縺企。倥>縺励∪縺吶 +縲繝峨く繝・繝。繝ウ繝医r隱ュ繧薙〒繧りァ」豎コ縺励↑縺九▲縺溘i縲∬ォヲ繧√∪縺励g縺縲りォヲ繧√b閧晏ソ縺ァ縺吶 +繝サ蟶ク譎60fps繧剃ソ昴※縺ェ縺ПC縺ァ縺ョ蜍穂ス懊ッ譛溷セ縺ァ縺阪∪縺帙s縲 + +== 謫堺ス懈婿豕輔∵峇縺ョ霑ス蜉譁ケ豕輔∵峩譁ー諠蝣ア縺ェ縺ゥ == +https://aioilight.space/taiko/tjap3/ +繝峨く繝・繝。繝ウ繝医↓諠蝣ア縺碁寔繧√i繧後※縺繧九ョ縺ァ縲√◎繧後r縺願ェュ縺ソ縺上□縺輔>縲る囂譎よ峩譁ー縺励※縺縺セ縺吶 + +== 繝繝輔か繝ォ繝医せ繧ュ繝ウ(SimpleStyle)縺ォ縺、縺縺ヲ == +荳驛ィ逕サ蜒上ッTJAPlayer2 forPC縺ョ繝繝輔か繝ォ繝医せ繧ュ繝ウ縺九i豬∫畑縺励※縺縺セ縺吶 +繝ゥ繧、繧サ繝ウ繧ケ縺ッMIT縺ョ繧ゅ→驕狗畑縺励※縺縺セ縺吶MIT繝ゥ繧、繧サ繝ウ繧ケ繧貞宍螳医☆繧句エ蜷医∵隼螟峨驟榊ク遲碓K縺ァ縺吶 +菴懈舌ヤ繝シ繝ォ: Photoshop/After Effects + +== 蜍慕判縲驟堺ソ。遲峨〒縺ョ縺泌茜逕ィ縺ォ縺、縺縺ヲ == +TJAPlayer3繧貞虚逕サ蜈ア譛峨し繧、繝医d繝ゥ繧、繝夜堺ソ。繧オ繝シ繝薙せ縲√え繧ァ繝悶し繧、繝医d繝悶Ο繧ー遲峨〒縺泌茜逕ィ縺ォ縺ェ繧峨l繧句エ蜷医 +繝舌Φ繝繧、繝翫Β繧ウ繧ィ繝ウ繧ソ繝シ繝繧、繝ウ繝。繝ウ繝亥ャ蠑上ョ繧ゅョ縺ァ縺ェ縺縺薙→縲∽サ悶ョ螟ェ鮠薙ョ驕比ココ繧キ繝溘Η繝ャ繝シ繧ソ繝シ縺ィ豺キ蜷後@縺ェ縺繧医≧驟肴ョ繧偵♀鬘倥>縺縺溘@縺セ縺吶 +縺セ縺溘√ち繧ー讖溯ス縺ョ縺ゅk繧オ繧、繝医ョ蝣エ蜷医√卦JAPlayer3縲阪卦JAP3縲阪→縺縺」縺溘ち繧ー繧剃サ倥¢繧九%縺ィ縺ァ縲 +莉悶す繝溘Η繝ャ繝シ繧ソ縺ィ縺ョ隱、隗」繧帝亟縺舌→縺ィ繧ゅ↓縲髢「騾」蜍慕判縺ィ縺励※蜃コ繧縺吶¥縺ェ繧九Γ繝ェ繝繝医′縺ゅk縺溘a縲∵耳螂ィ縺励∪縺吶 + +== TJAPlayer3縺ョ謾ケ騾繝サ蜀埼榊ク(莠梧ャ。驟榊ク)繧定。後≧蝣エ蜷医↓縺、縺縺ヲ == +TJAPlayer3縲√ョ繝輔か繝ォ繝医せ繧ュ繝ウ縺ッMIT繝ゥ繧、繧サ繝ウ繧ケ縺ァ蛻カ菴懊&繧後※縺縺セ縺吶 +MIT繝ゥ繧、繧サ繝ウ繧ケ縺ョ繝ォ繝シ繝ォ縺ョ繧ゅ→縲∵隼騾繝サ蜀埼榊ク繧定。後≧縺薙→縺ッ閾ェ逕ア縺ァ縺吶′縲**蜈ィ縺ヲ閾ェ蟾ア雋ャ莉サ**縺ァ縺企。倥>縺励∪縺吶 +縺セ縺溘∽スソ逕ィ縺励※縺繧九Λ繧、繝悶Λ繝ェ縺ョ繝ゥ繧、繧サ繝ウ繧ケ荳翫**蠢縺**縲鍬icenses縲阪ヵ繧ゥ繝ォ繝繧貞酔譴ア縺ョ荳翫∵隼騾繝サ蜀埼榊ク繧偵♀鬘倥>縺励∪縺吶 +螟夜Κ繧ケ繧ュ繝ウ繧縲∬ュ憺擇繝代ャ繧ア繝シ繧ク繧貞酔譴ア縺吶k蝣エ蜷医ッ縲√◎繧後◇繧後ョ蛻カ菴懆縺ョ繝ォ繝シ繝ォ繧隕冗エ繧貞ョ医▲縺ヲ縺上□縺輔>縲 +縺薙l繧峨↓TJAPlayer3縺ョ繝ゥ繧、繧サ繝ウ繧ケ縺ッ驕ゥ逕ィ縺輔l縺セ縺帙s縲 + +== 繧ケ繝壹す繝」繝ォ繧オ繝ウ繧ッ繧ケ == +FROM豌/yyagi豌 - DTXMania 髢狗匱閠 +kairera0467豌 - TJAPlayer2 forPC 髢狗匱閠 +繧阪∩繧ス橸シ滓ー - 繝舌げ蝣ア蜻翫∽ク榊キ蜷亥ア蜻 +繧ウ繝シ繧キ繝シ豌 - 繝舌げ蝣ア蜻翫∽ク榊キ蜷亥ア蜻 +twopointzero豌 - 繝励Ο繧ー繝ゥ繝縺ョ譛驕ゥ蛹 + + +== 荳榊キ蜷亥ア蜻翫騾」邨。蜈医↑縺ゥ == + +=== 譌「遏・縺ョ蝠城。檎せ === +繝サ譌・譛ャ隱樒腸蠅縺ァ繧ゅ励Ο繧ー繝ゥ繝蜀驛ィ縺ァ縺ッ闍ア隱樒腸蠅縺ィ隱崎ュ倥&繧後※繧キ繧ケ繝繝繝。繝繧サ繝シ繧ク縺後⊇縺シ闍ア隱槭〒縺吶 竊歎er.1.5.6縺九i譌・譛ャ隱樒腸蠅縺ョ蝣エ蜷医ッ譌・譛ャ隱槭〒陦ィ遉コ縺輔l繧九h縺縺ォ縺ェ繧翫∪縺励◆縲 +繝サ繝繝ウ繧オ繝シ縲√Δ繝悶√Λ繝ウ繝翫シ逕サ蜒上ョ繧オ繧、繧コ縺悟、ァ縺阪>縺ィ迸ャ髢鍋噪縺ォ繧ォ繧ッ縺、縺上°繧ゅ@繧後∪縺帙s縲ゅ%繧後↓縺、縺縺ヲ縺ッ荳蠎ヲ蜀咲函縺吶k縺ィ逶エ繧翫∪縺吶や巽astRender繧丹N縺ォ縺吶l縺ー螟ァ謚オ縺ョPC縺ァ縺ッ繧ォ繧ッ縺、縺九★縺ォ蜀咲函縺輔l縺セ縺吶 +繝サ蜻ス莉、縺ィ蛟、縺ョ髢薙↓蜊願ァ偵せ繝壹シ繧ケ縺悟・縺」縺ヲ縺ェ縺縺ィ豁」蟶ク縺ォ蜀咲函縺輔l縺セ縺帙s縲(e.g. #SCROLL1.5) +繝サ荳譖イ蜀咲函蠕後ョ譖イ縺ョ繧ス繝シ繝医′縺ァ縺阪∪縺帙s縲や剃ソョ豁」縺輔l縺セ縺励◆縲 +繝サ繧繧顔峩縺玲凾縺ォ縺オ縺縺帙s縺梧カ医∴縺セ縺吶 +繝サ隴憺擇蛻蟯舌ョ荳榊キ蜷医′縺縺上▽縺区ョ九▲縺溘∪縺セ縺ァ縺吶 + +=== 雉ェ蝠上r縺吶k蜑阪↓ === +雉ェ蝠上r縺吶k蜑阪↓縲 +1.隱ソ縺ケ繧句燕縺ォ閠縺医k +2.莠コ縺ォ閨槭¥蜑阪↓隱ソ縺ケ繧 +3.驕主悉縺ォ蜷後§繧医≧縺ェ雉ェ蝠上′縺ェ縺九▲縺溘°隱ソ縺ケ繧 +4.菴ソ逕ィ縺励※縺繧九ヱ繧ス繧ウ繝ウ縺ョ迺ー蠅縲√←縺縺縺蜍穂ス懊r縺励◆繧我ク榊キ蜷医r襍キ縺薙@縺溘°縺ョ驕守ィ狗ュ峨r豺サ縺医※騾」邨。縺吶k +縺薙ョ4縺、縺ョ繝ォ繝シ繝ォ繧貞ョ医▲縺ヲ縺縺溘□縺代l縺ー蟷ク縺縺ァ縺吶ゅ←縺縺九h繧阪@縺上♀縺ュ縺後>縺励∪縺吶 + +=== 蜷騾」邨。蜈 === +荳榊キ蜷亥ア蜻翫∵眠隕乗ゥ溯ス霑ス蜉縺ョ繝ェ繧ッ繧ィ繧ケ繝育ュ峨∝、ァ豁楢ソ弱〒縺吶 +Twitter: @TJAPlayer3 +繝。繝シ繝ォ: info@aioilight.space +Discord: AioiLight#7839 +GitHub: https://github.com/AioiLight/TJAPlayer3 diff --git a/Test/Readme/Read this before you start.txt b/Test/Readme/Read this before you start.txt new file mode 100644 index 00000000..8c49a3f8 --- /dev/null +++ b/Test/Readme/Read this before you start.txt @@ -0,0 +1,98 @@ +#Title screen +At the first screen, press and hold the P key->Load Bananapass. + +After loading is complete, use the left and right edge keys to select 1P, 2P, or Don't use. + +After joining, use the edge keys to move the mode selection bar. + +Press the face key to confirm the mode selection (Performance mode -> Music selection screen Dan Dojo -> Dan selection screen) + +#Song selection screen +Use the edge key to select a song. + +Press the face key. +If it is a Box : Enter the Box +If Score (song) : Difficulty selection screen + +SHIFT + F1 : Go into Config +F2 : QuickConfig (You can switch the number of players and the mode here. Use arrow keys and Enter or edge and face keys) +F3 : 1P autoplay switching +F4 : Toggle 2P autoplay +F7 : Toggle special training mode + +#Difficulty selection screen +Edge key : Move bar +Face key : Back : Return to song selection screen + Option : Open the option menu (use edge key and face key) + Other : Play at the selected difficulty level (The darkened area has no difficulty level.) + +#Stage selection screen +Edge key : Select a level. +Edge key : Select the level of the challenge. + +#Song loading screen +Esc : Return to song selection or dan selection screen. + +#Play screen +Face and edge keys : Click to select. +Left and right arrows : Move the judgment frame. +Up and down arrows : Change scroll speed +F1 : Display of simple configuration (Stop, Redo, Continue) Redo cannot be selected for Dan. + + +# You can't select "redo" when you are at a rank. + +| key | action | +| :---------------: | :-------------------------: | +| Space | Playback of music sheet | +| 1P edge/PgUp/PgDn | Move the score | +| 2P edge | Change playback speed | +| A | Use Space to play the score | + +If you want to move to a jump point, you can do so using Config. +縲To move to a jump point, hit the ``1P edge`` five times in a row within the time specified in Config.ini. + +#Results screen +Esc, face key, or Enter: Return to the music selection screen or rank selection screen. + +#NamePlate +Open the NamePlate.json file (generated when you start the program) with Notepad or any other text editor and edit it. +For detailed instructions, see the Youtube video below. +https://youtu.be/1wsSfYVk1Os + +#Add a genre +In System/0.JpnNijiiro/OtherConfig.ini +You can add a genre by adding SongSelect_GenreName in +Make sure that the number and the location of the genre are aligned. Basically, if you put them in order, you should be able to do this normally. + +#Loading the song list +If a song does not load, wait until the song list loading display in the upper left corner finishes. If it still doesn't load, change the [Path to folder containing music sheet files] setting in Config.ini to something like the following +This will put the file in Songs. This will basically load the songs in Songs. + +TJAPath=. \ + +(I think you can copy and paste this.) + +#I can't get it to start. +https://web.archive.org/web/20210112074744/https://www.microsoft.com/en-us/download/details.aspx?id=6812 + +Please download and install from the link above. + +#Sound won't play. +If you set the value of SoundDeviceType to 0 or 2, it basically works. (Maybe) + +#The font is misaligned! +Look at the video below! +https://youtu.be/1wsSfYVk1Os + +#Where can I report a bug? +Please file a bug report from Issue on Github. We don't accept questions there, so please don't ask. It's annoying. + +#Changing the language +We will create a setting to change the language later, but for now, we are working on changing the skin. +Please check the video below for details. +https://youtu.be/1wsSfYVk1Os + +GITHUB : https://github.com/touhourenren/TJAPlayer3-Develop-ReWrite + +Translated with www.DeepL.com/Translator (free version) \ No newline at end of file diff --git a/Test/Readme/襍キ蜍募燕縺ォ縺薙l縺ォ逶ョ繧帝壹@縺ヲ縺上□縺輔>.txt b/Test/Readme/襍キ蜍募燕縺ォ縺薙l縺ォ逶ョ繧帝壹@縺ヲ縺上□縺輔>.txt new file mode 100644 index 00000000..51111e93 --- /dev/null +++ b/Test/Readme/襍キ蜍募燕縺ォ縺薙l縺ォ逶ョ繧帝壹@縺ヲ縺上□縺輔>.txt @@ -0,0 +1,96 @@ +#繧ソ繧、繝医Ν逕サ髱「 +譛蛻昴ョ逕サ髱「縺ァP繧ュ繝シ髟キ謚シ縺->繝舌リ繝代せ隱ュ縺ソ霎シ縺ソ + +隱ュ縺ソ霎シ縺ソ邨ゆコ蠕悟キヲ蜿ウ縺ョ邵√く繝シ縺ァ1P, 2P, 菴ソ繧上↑縺繧帝∈謚 + +蜿ょ刈縺励◆蠕檎ク√く繝シ縺ァ繝「繝シ繝蛾∈謚槭ョ繝舌シ縺ョ遘サ蜍 + +髱「繧ュ繝シ縺ァ繝「繝シ繝蛾∈謚槭ョ遒コ螳(貍泌・上Δ繝シ繝 -> 驕ク譖イ逕サ髱「 谿オ菴埼%蝣エ -> 谿オ菴埼∈謚樒判髱「) + +#驕ク譖イ逕サ髱「 +邵√く繝シ縺ァ譖イ驕ク謚 + +髱「繧ュ繝シ縺ァ +Box縺縺」縺溷エ蜷 : Box縺ョ荳ュ縺ォ蜈・繧 +Score(譖イ)縺縺」縺溷エ蜷 : 髮」譏灘コヲ驕ク謚樒判髱「 + +SHIFT + F1 : Config縺ョ荳ュ縺ォ蜈・繧 +F2 : QuickConfig(繝励Ξ繧、繝、繝シ莠コ謨ー縲∫悄謇薙Δ繝シ繝峨ョ蛻繧頑崛縺医ッ縺薙%縺ァ陦後>縺セ縺吶 遏「蜊ー繧ュ繝シ縺ィEnter 縺セ縺溘ッ 邵√髱「繧ュ繝シ縺ァ謫堺ス懊@縺セ縺) +F3 : 1P繧ェ繝シ繝医励Ξ繧、蛻繧頑崛縺 +F4 : 2P繧ェ繝シ繝医励Ξ繧、蛻繧頑崛縺 +F7 : 迚ケ險薙Δ繝シ繝牙譖ソ + +#髮」譏灘コヲ驕ク謚樒判髱「 +邵√く繝シ : 繝舌シ遘サ蜍 +髱「繧ュ繝シ : 謌サ繧具シ夐∈譖イ逕サ髱「縺ォ謌サ繧 + 繧ェ繝励す繝ァ繝ウ : 繧ェ繝励す繝ァ繝ウ繧帝幕縺(邵√く繝シ縺ィ髱「繧ュ繝シ縺ァ謫堺ス) + 縺昴l莉・螟 : 驕ク謚槭@縺滄屮譏灘コヲ縺ァ繝励Ξ繧、(證励¥縺ェ縺」縺ヲ縺繧矩Κ蛻縺ッ髮」譏灘コヲ縺悟ュ伜惠縺励※縺ェ縺縺ァ縺吶) + +#谿オ菴埼∈謚樒判髱「 +邵√く繝シ : 谿オ菴阪ョ驕ク謚 +髱「繧ュ繝シ : 谿オ菴阪ョ謖第姶驕ク謚樒判髱「繧定。ィ遉コ(邵√く繝シ縺ァ驕ク謚槭髱「繧ュ繝シ縺ァ豎コ螳) + +#譖イ隱ュ縺ソ霎シ縺ソ逕サ髱「 +Esc : 驕ク譖イ縺セ縺溘ッ谿オ菴埼∈謚樒判髱「縺ク謌サ繧 + +#貍泌・冗判髱「 +髱「縲∫ク√く繝シ : 繝峨Φ縲√き繝縺ョ謫堺ス +蟾ヲ縲∝承遏「蜊ー : 蛻、螳壽棧縺ョ遘サ蜍 +荳翫∽ク狗泙蜊ー : 繧ケ繧ッ繝ュ繝シ繝ォ騾溷コヲ縺ョ螟画峩 +F1 : 邁。譏薙さ繝ウ繝輔ぅ繧ー縺ョ陦ィ遉コ(貍泌・丈クュ豁「縲√d繧顔峩縺励∫カ壹¢繧 縺ェ縺頑ョオ菴肴凾縺ォ縺ッ繧繧顔峩縺励ッ驕ク謚槭〒縺阪∪縺帙s縲) + + +# 迚ケ險薙Δ繝シ繝 + +| 繧ュ繝シ | 蜍穂ス | +| :------------: | :---------------------: | +| Space | 隴憺擇縺ョ蜀咲函 | +| 1P邵/PgUp/PgDn | 隴憺擇縺ョ遘サ蜍 | +| 2P邵 | 蜀咲函騾溷コヲ縺ョ螟画峩 | +| A | 繧ク繝」繝ウ繝励昴う繝ウ繝医ョ霑ス蜉 | + +窶サ蜀咲函譎ゅッSpace縺ァ隴憺擇縺ョ蛛懈ュ「縺後〒縺阪k縺薙→莉・螟匁勸谿オ騾壹j縺ョ繧ュ繝シ謫堺ス懊→縺ェ繧翫∪縺吶 +縲繧ク繝」繝ウ繝励昴う繝ウ繝医↓遘サ蜍輔☆繧矩圀縺ッConfig.ini險倩シ峨ョ譎る俣蜀縺ァ``1P邵〜`繧5蝗樣」謇薙@縺ヲ縺上□縺輔>縲 + +#繝ェ繧カ繝ォ繝育判髱「 +Esc, 髱「繧ュ繝シ縲・nter縺ョ縺ゥ繧後° : 驕ク譖イ逕サ髱「蜿医ッ谿オ菴埼∈謚樒判髱「縺ク謌サ繧 + +#繝阪シ繝繝励Ξ繝シ繝 +NamePlate.json(襍キ蜍輔@縺溘→縺阪↓逕滓舌&繧後∪縺)繧偵Γ繝「蟶ウ縺セ縺溘ッ縺サ縺九ョ繝繧ュ繧ケ繝医お繝繧」繧ソ縺ァ髢九″邱ィ髮繧偵@縺ヲ縺上□縺輔>縲 +隧ウ縺励>隱ャ譏弱ッ荳九ョYoutube縺ョ蜍慕判縺ァ隱ャ譏弱@縺ヲ縺縺セ縺吶 +https://youtu.be/1wsSfYVk1Os + +#繧ク繝」繝ウ繝ォ霑ス蜉 +System/0.JpnNijiiro/OtherConfig.ini +縺ョ荳ュ縺ョSongSelect_GenreName繧定ソス蜉縺吶k縺薙→縺ァ繧ク繝」繝ウ繝ォ霑ス蜉縺後〒縺阪∪縺吶 +逡ェ蜿キ縺ィ繧ク繝」繝ウ繝ォ縺ョ蝣エ謇縺後◎繧阪≧繧医≧縺ォ縺励※縺上□縺輔>縲ょ渕譛ャ逧縺ォ鬆逡ェ縺ォ荳ヲ縺ケ縺ー譎ョ騾壹↓縺ァ縺阪k縺ッ縺壹〒縺吶 + +#譖イ繝ェ繧ケ繝郁ェュ縺ソ霎シ縺ソ +譖イ縺瑚ェュ縺ソ霎シ縺セ繧後↑縺蝣エ蜷医ッ蟾ヲ荳翫ョ譖イ繝ェ繧ケ繝郁ェュ縺ソ霎シ縺ソ陦ィ遉コ縺檎オゅo繧九∪縺ァ蠕縺」縺ヲ縺上□縺輔>縲ゅ◎繧後〒繧り。ィ遉コ縺輔l縺ェ縺蝣エ蜷Config.ini縺ョ[隴憺擇繝輔ぃ繧、繝ォ縺梧シ邏阪&繧後※縺繧九ヵ繧ゥ繝ォ繝縺ク縺ョ繝代せ]繧剃ク九ョ繧医≧縺ェ +險ュ螳壹↓縺励※縺上□縺輔>縲ゅ%繧後〒Songs縺ョ荳ュ縺ォ蜈・縺」縺ヲ縺繧区峇縺ッ蝓コ譛ャ隱ュ縺ソ霎シ縺セ繧後k繧医≧縺ォ縺ェ繧翫∪縺吶 + +TJAPath=.\ + +(縺薙l繧偵さ繝斐壹@縺溘i縺縺繧薙§繧縺ェ縺縺九↑縲) + +#襍キ蜍輔′縺ァ縺阪↑縺 +https://web.archive.org/web/20210112074744/https://www.microsoft.com/en-us/download/details.aspx?id=6812 + +荳翫ョ繝ェ繝ウ繧ッ縺九i繝繧ヲ繝ウ繝ュ繝シ繝峨@縺ヲ繧、繝ウ繧ケ繝医シ繝ォ縺励※縺上□縺輔>縲 + +#髻ウ螢ー縺梧オ√l縺ェ縺 +SoundDeviceType縺ョ蛟、繧0縺2縺ォ縺吶l縺ー蝓コ譛ャ蜍輔″縺セ縺吶(螟壼) + +#繝輔か繝ウ繝医ョ菴咲スョ縺後★繧後※縺セ縺呻シ +荳九ョ蜍慕判隕九m繧シ +https://youtu.be/1wsSfYVk1Os + +#繝舌げ蝣ア蜻翫ッ縺ゥ縺薙〒縺吶l縺ー縺縺縺ァ縺吶°シ +Github縺ョIssue繧医j繝舌げ蝣ア蜻翫r縺企。倥>縺励∪縺吶ゅ◎縺薙〒縺ッ雉ェ蝠上ッ蜿励¢莉倥¢縺ヲ縺ェ縺縺ョ縺ァ雉ェ蝠上@縺ェ縺縺ァ縺上□縺輔>縲りソキ諠代〒縺吶 + +#險隱槭ョ螟画峩 +蠕後險隱槫、画峩逕ィ縺ョ險ュ螳壹ッ菴懈舌@縺セ縺吶′縲∫樟蝨ィ縺ッ繧ケ繧ュ繝ウ縺ョ螟画峩縺ァ蟇セ蠢懊r縺励※縺縺セ縺吶 +隧ウ縺励¥縺ッ荳九ョ蜍慕判繧医j遒コ隱阪@縺ヲ縺上□縺輔>縲 +https://youtu.be/1wsSfYVk1Os + +GITHUB : https://github.com/touhourenren/TJAPlayer3-Develop-ReWrite \ No newline at end of file diff --git a/Test/TJAPlayer3-Develop-ReWrite.exe.config b/Test/TJAPlayer3-Develop-ReWrite.exe.config new file mode 100644 index 00000000..eff605cf --- /dev/null +++ b/Test/TJAPlayer3-Develop-ReWrite.exe.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Test/discord-rpc.dll b/Test/discord-rpc.dll new file mode 100644 index 00000000..4254cfa2 Binary files /dev/null and b/Test/discord-rpc.dll differ diff --git a/Test/dll/Bass.Net.dll b/Test/dll/Bass.Net.dll new file mode 100644 index 00000000..271af7ed Binary files /dev/null and b/Test/dll/Bass.Net.dll differ diff --git a/Test/dll/DirectShowLib-2005.dll b/Test/dll/DirectShowLib-2005.dll new file mode 100644 index 00000000..ba11a160 Binary files /dev/null and b/Test/dll/DirectShowLib-2005.dll differ diff --git a/Test/dll/FDK.dll b/Test/dll/FDK.dll new file mode 100644 index 00000000..b88fb97d Binary files /dev/null and b/Test/dll/FDK.dll differ diff --git a/Test/dll/Hnx8.ReadJEnc.dll b/Test/dll/Hnx8.ReadJEnc.dll new file mode 100644 index 00000000..97de844a Binary files /dev/null and b/Test/dll/Hnx8.ReadJEnc.dll differ diff --git a/Test/dll/Hnx8.ReadJEnc.xml b/Test/dll/Hnx8.ReadJEnc.xml new file mode 100644 index 00000000..8325428d --- /dev/null +++ b/Test/dll/Hnx8.ReadJEnc.xml @@ -0,0 +1,499 @@ + + + + Hnx8.ReadJEnc + + + + + ReadJEnc 譁蟄励さ繝シ繝臥ィョ鬘槫ョ夂セゥ(Rev.20170821) + + + + UTF8(BOM縺ゅj) + + + UTF32(BOM縺ゅjLittleEndian) + + + UTF32(BOM縺ゅjBigEndian) + + + UTF16(BOM縺ゅjLittleEndian)Windows讓呎コ悶ョUnicode + + + UTF16(BOM縺ゅjBigEndian) + + + UTF16(BOM辟。縺有ittleEndian) + + + UTF16(BOM辟。縺唯igEndian) + + + UTF8(BOM辟。縺) + + + Ascii繝繧ウ繝シ繝峨ッUTF8Encoding繧呈オ∫畑縲Bom諠蝣ア縺ッ霆「險倥@縺ェ縺 + + + 1252 ISO8859 隘ソ繝ィ繝シ繝ュ繝繝題ィ隱 + + + 50221 iso-2022-jp 譌・譛ャ隱 (JIS-Allow 1 byte Kana) 窶サMS迚 + + + 50222 iso-2022-jp 譌・譛ャ隱 (JIS-Allow 1 byte Kana - SO/SI)SO/SI縺ォ繧医k繧ォ繝翫す繝輔ヨ縺ョ縺ソ縺ョ繝輔ぃ繧、繝ォ繧CP50222縺ィ縺ソ縺ェ縺 + + + 50221(MS迚JIS) + 20932(JIS陬懷勧貍「蟄励r辟。逅繧繧翫ョ繧ウ繝シ繝)JIS陬懷勧貍「蟄励ッ繝繧ウ繝シ繝峨ョ縺ソ蟇セ蠢懊√お繝ウ繧ウ繝シ繝峨ッ譛ェ蟇セ蠢 + + + JIS縺ョ繧医≧縺ォ隕九∴繧九′繝繧ウ繝シ繝我ク崎ス縺ェ邂謇縺ゅj縲∝ョ溯ウェ髱槭ユ繧ュ繧ケ繝医ヵ繧。繧、繝ォ + + + 50225 iso-2022-kr 髻灘嵜隱(ISO)SO/SI繧ォ繝翫す繝輔ヨ繝輔ぃ繧、繝ォ縺ョ蛻、螳壹Ο繧ク繝繧ッ縺ォ豬√l霎シ縺セ縺ェ縺繧医≧縺ォ縺吶k縺溘a螳夂セゥ + + + 932 shift_jis 譌・譛ャ隱 (繧キ繝輔ヨ JIS) 窶サMS迢ャ閾ェ + + + EUC陬懷勧貍「蟄(0x8F)縺ゅj 窶サMS-CP20932繧貞茜逕ィ縺怜シキ蠑輔↓繝繧ウ繝シ繝峨☆繧繧ィ繝ウ繧ウ繝シ繝峨☆繧九→繝輔ぃ繧、繝ォ縺悟」翫l繧九ョ縺ァ豕ィ諢 + + + 51932 euc-jp 譌・譛ャ隱 (EUC) 窶サMS迚 + + + 950 big5 郢∽ス灘ュ嶺クュ蝗ス隱 (BIG5) + + + 20000 x-Chinese-CNS 郢∽ス灘ュ嶺クュ蝗ス隱(EUC-TW) + + + 54936 GB18030 邁。菴灘ュ嶺クュ蝗ス隱 (GB2312/GBK縺ョ諡。蠑オ) + + + 949 ks_c_5601-1987 髻灘嵜隱 (UHC=EUC-KR縺ョ諡。蠑オ) + + + Windows1250 荳ュ螟ョ繝ィ繝シ繝ュ繝繝題ィ隱(繝√ぉ繧ウ隱樒ュ) iso-8859-2 + + + Windows1251 繧ュ繝ェ繝ォ險隱(繝ュ繧キ繧「隱樒ュ) + + + Windows1253 繧ョ繝ェ繧キ繝」隱 iso-8859-7 + + + Windows1254 繝医Ν繧ウ隱 iso-8859-9 + + + Windows1255 繝倥ヶ繝ゥ繧、隱 iso-8859-8 + + + Windows1256 繧「繝ゥ繝薙い隱 + + + Windows1257 繝舌Ν繝郁ィ隱 iso-8859-13 + + + Windows1258 繝吶ヨ繝翫Β隱 + + + TIS-620/Windows874 繧ソ繧、隱 iso-8859-11 + + + 蠑墓焚縺ァ謖螳壹&繧後◆byte驟榊励′BOM縺ゅjUTF繝輔ぃ繧、繝ォ縺ィ蛻、螳壹〒縺阪k蝣エ蜷医√◎縺ョ譁蟄励さ繝シ繝峨r霑斐@縺セ縺吶 + 蛻、螳壼ッセ雎。縺ョ繝舌う繝磯榊 + 繝舌う繝磯榊怜磯ュ縺ョ隱ュ縺ソ霎シ縺ソ貂医ヰ繧、繝域焚シLEASTREADSIZE縺ョ繝舌う繝域焚莉・荳願ェュ縺ソ霎シ繧薙〒縺翫¥縺薙→シ + BOM縺九i蛻、螳壹〒縺阪◆譁蟄励さ繝シ繝臥ィョ鬘槭∝粋閾エ縺ェ縺励ョ蝣エ蜷null + + + 繝輔ぃ繧、繝ォ譁蟄励さ繝シ繝臥ィョ鬘槫錐 + + + 蜈磯ュ繝舌う繝郁ュ伜挨繝繝シ繧ソシBOM/繝槭ず繝繧ッ繝翫Φ繝舌シシ + + + 繧ィ繝ウ繧ウ繝シ繝繧」繝ウ繧ー + + + 繧ウ繝シ繝峨壹シ繧ク逡ェ蜿キ(Unicode莉・螟悶ョ繝ュ繝シ繧ォ繝ォ縺ェ繧ィ繝ウ繧ウ繝シ繝繧」繝ウ繧ー繧剃スソ逕ィ縺吶k繧ゅョ縺ォ縺、縺縺ヲ險ュ螳壹≠繧翫る≦蟒カ蛻晄悄蛹也畑縺ョ騾驕ソ螟画焚繧貞シ縺ュ繧) + + + 蝓コ譛ャ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + 繝輔ぃ繧、繝ォ譁蟄励さ繝シ繝臥ィョ鬘槫錐繧貞ョ夂セゥ縺吶k + 繝繧ウ繝シ繝画凾縺ォ菴ソ逕ィ縺吶kCodePage繧呈欠螳(豁」蛟、縺ェ繧吋ecoderExceptionFallback縲√槭う繝翫せ蛟、縺ェ繧吋ecoderReplacementFallBack繧定ィュ螳) + 蜈磯ュ繝舌う繝郁ュ伜挨繝繝シ繧ソ繧呈欠螳壹☆繧 + + + 蝓コ譛ャ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + 繝輔ぃ繧、繝ォ譁蟄励さ繝シ繝臥ィョ鬘槫錐繧貞ョ夂セゥ縺吶k + 繝繧ウ繝シ繝画凾縺ォ菴ソ逕ィ縺吶kEncoding繧呈欠螳壹☆繧 + 蜈磯ュ繝舌う繝郁ュ伜挨繝繝シ繧ソ繧呈欠螳壹☆繧 + + + 縺薙ョ繝輔ぃ繧、繝ォ譁蟄励さ繝シ繝臥ィョ鬘槭ョEncoding繧ェ繝悶ず繧ァ繧ッ繝医r蜿門セ励@縺セ縺吶 + + + 蠑墓焚縺ョ繝舌う繝磯榊励°繧画枚蟄怜励r蜿悶j蜃コ縺励∪縺吶ょ、ア謨玲凾縺ッnull縺瑚ソ斐j縺セ縺吶 + 蛻、螳壼ッセ雎。縺ョ繝舌う繝磯榊 + 繝輔ぃ繧、繝ォ繧オ繧、繧コ(繝舌う繝磯榊怜磯ュ縺九i縺ョ蜈磯ュ縺九i縺ョ繝繧ウ繝シ繝牙ッセ雎。繝舌う繝域焚) + + + 縺薙ョ繝輔ぃ繧、繝ォ譁蟄励さ繝シ繝臥ィョ鬘槭ョ蜷榊燕繧貞叙蠕励@縺セ縺吶 + + + 蛻、螳壼ッセ雎。縺ョ繝輔ぃ繧、繝ォ譁蟄励さ繝シ繝臥ィョ鬘樔ク隕ァ縺九i縲。OM/繝槭ず繝繧ッ繝翫Φ繝舌シ縺御ク閾エ縺吶k繧ゅョ繧呈爾邏「縺励※霑斐☆ + 蛻、螳壼ッセ雎。縺ョ繝舌う繝磯榊 + 繝舌う繝磯榊怜磯ュ縺ョ隱ュ縺ソ霎シ縺ソ貂医ヰ繧、繝域焚シLEASTREADSIZE縺ョ繝舌う繝域焚莉・荳願ェュ縺ソ霎シ繧薙〒縺翫¥縺薙→シ + 蛻、螳壼ッセ雎。縺ィ縺吶k繝輔ぃ繧、繝ォ譁蟄励さ繝シ繝臥ィョ鬘槭ョ荳隕ァ + 蜈磯ュ繝舌う繝医′荳閾エ縺励◆繝輔ぃ繧、繝ォ譁蟄励さ繝シ繝臥ィョ鬘槭∝粋閾エ縺ェ縺励ョ蝣エ蜷null + + + 譁蟄励さ繝シ繝臥ィョ鬘橸シ壹ユ繧ュ繧ケ繝 + + + + + EUC陬懷勧貍「蟄礼音谿雁ヲ逅(MS迚CP20932縺ョ迚ケ逡ー縺ェ繧ウ繝シ繝我ス鍋ウサ縺ォ繧医j繝繧ウ繝シ繝峨☆繧) + + + + + JIS陬懷勧貍「蟄礼音谿雁ヲ逅(MS迚CP20932縺ョ迚ケ逡ー縺ェ繧ウ繝シ繝我ス鍋ウサ縺ォ繧医j繝繧ウ繝シ繝峨☆繧) + + + + + ReadJEnc 繝輔ぃ繧、繝ォ隱ュ縺ソ蜃コ縺暦シ繝輔ぃ繧、繝ォ譁蟄励さ繝シ繝臥ィョ鬘櫁ェ蜍募愛蛻・(Rev.20170821) + + + + 蜊倅ク繝輔ぃ繧、繝ォ隱ュ縺ソ蜃コ縺礼畑縺ォ繝輔ぃ繧、繝ォ繧呈欠螳壹@縺ヲ譁ー縺励>繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧貞晄悄蛹悶@縺セ縺吶 + 隱ュ縺ソ蜃コ縺吶ヵ繧。繧、繝ォシ医%縺ョ繝輔ぃ繧、繝ォ縺ョ繧オ繧、繧コ縺ゥ縺翫j縺ォ隱ュ縺ソ蜃コ縺鈴伜沺繝舌ャ繝輔ぃ繧堤「コ菫昴☆繧具シ + + + 隍謨ー繝輔ぃ繧、繝ォ騾」邯夊ェュ縺ソ蜃コ縺礼畑縺ォ繝舌ャ繝輔ぃ繧オ繧、繧コ繧呈欠螳壹@縺ヲ譁ー縺励>繧、繝ウ繧ケ繧ソ繝ウ繧ケ繧貞晄悄蛹悶@縺セ縺吶 + 譛螟ァ隱ュ縺ソ蜃コ縺励ヵ繧。繧、繝ォ繧オ繧、繧コシ磯伜沺繝舌ャ繝輔ぃ遒コ菫昴し繧、繧コシ + + + 繝輔ぃ繧、繝ォ隱ュ縺ソ蜃コ縺礼畑縺ョ繝ェ繧ス繝シ繧ケ繧定ァ」謾セ縺励∪縺吶 + + + 繝輔ぃ繧、繝ォ隱ュ縺ソ蜃コ縺礼畑縺ョ繝ェ繧ス繝シ繧ケ繧定ァ」謾セ縺励∪縺吶 + + + 譁蟄励さ繝シ繝芽ェ蜍募愛蛻・蟇セ雎。險隱樊欠螳夲シ亥晄悄迥カ諷九ッ譌・譛ャ隱朶hiftJISシ + + + 繝輔ぃ繧、繝ォ繧定ェュ縺ソ蜃コ縺励※繝輔ぃ繧、繝ォ譁蟄励さ繝シ繝臥ィョ鬘槭r蜿門セ励@縺セ縺吶 + 隱ュ縺ソ蜃コ縺吶ヵ繧。繧、繝ォ + 繝輔ぃ繧、繝ォ譁蟄励さ繝シ繝臥ィョ鬘槭ョ蛻、螳夂オ先棡 + + + Read繝。繧ス繝繝牙他縺ウ蜃コ縺玲凾縺ォ繝輔ぃ繧、繝ォ縺九i隱ュ縺ソ蜃コ縺励◆繝繧ュ繧ケ繝域枚蟄怜怜螳ケ繧貞叙蠕励@縺セ縺吶 + 繝輔ぃ繧、繝ォ縺九i繝繧ュ繧ケ繝医′蜿悶j蜃コ縺帙↑縺九▲縺溷エ蜷医ッnull縺ィ縺ェ繧翫∪縺吶 + + + 繝輔ぃ繧、繝ォ蜀螳ケ縺ョ隱ュ縺ソ蜃コ縺怜磯伜沺 + + + 迴セ蝨ィ隱ュ縺ソ蜃コ縺玲ク医ョ繝輔ぃ繧、繝ォ繧オ繧、繧コ髱櫁ェュ縺ソ蜃コ縺玲凾縺ッ0縲∝蜑イ隱ュ縺ソ蜃コ縺玲凾縺ッ隱ュ霎シ貂磯Κ蛻縺ョ繧オ繧、繧コ + + + 繝輔ぃ繧、繝ォ縺九i蜿悶j蜃コ縺励◆繝繧ュ繧ケ繝域枚蟄怜 + + + 隱ュ縺ソ霎シ繧薙〒縺ゅk繝舌う繝磯榊励ョ繝励Μ繧「繝ウ繝悶ΝシBOM繝倥ャ繝シ上槭ず繝繧ッ繝翫Φ繝舌シシ峨°繧峨ヵ繧。繧、繝ォ譁蟄励さ繝シ繝臥ィョ鬘樒音螳壹r隧ヲ縺ソ繧 + 繝輔ぃ繧、繝ォ繧オ繧、繧コ(譛ェ隱ュ霎シ驛ィ蛻繧ょ性繧縲りェュ縺ソ霎シ縺ソ貂医し繧、繧コ縺ッthis.Length繧貞盾辣ァ) + 遒コ螳壹@縺溷エ蜷医√ヵ繧。繧、繝ォ譁蟄励さ繝シ繝臥ィョ鬘槭ら「コ螳壹〒縺阪↑縺九▲縺溷エ蜷null + + + + ReadJEnc 繝輔ぃ繧、繝ォ遞ョ鬘槫ョ夂セゥ(Rev.20170821) + + + + 隱ュ縺ソ霎シ縺ソ螟ア謨 + + + 遨コ繝輔ぃ繧、繝ォ + + + 蟾ィ螟ァ繝輔ぃ繧、繝ォ + + + 繝舌う繝翫Μ + + + Java繝舌う繝翫Μ + + + Windows繝舌う繝翫Μ + + + Windows繧キ繝ァ繝シ繝医き繝繝 + + + PDF + + + Zip蝨ァ邵ョ + + + GZip蝨ァ邵ョ + + + 7zip蝨ァ邵ョ + + + Rar蝨ァ邵ョ + + + Cab蝨ァ邵ョ + + + BZip2蝨ァ邵ョ + + + Z(compress)蝨ァ邵ョ + + + BMP逕サ蜒 + + + GIF逕サ蜒 + + + JPEG逕サ蜒 + + + PNG逕サ蜒 + + + TIFF逕サ蜒 + + + Windows繧「繧、繧ウ繝ウ逕サ蜒繝槭ず繝繧ッ繝翫Φ繝舌シ縺ョ縺サ縺玖ソス蜉繝√ぉ繝繧ッ縺ゅj + + + BOM/繝槭ず繝繧ッ繝翫Φ繝舌シ荳閾エ蛻、螳壹↓縺ゅ◆繧翫∵怙菴朱剞隱ュ縺ソ霎シ縺ソ繧呈ク医∪縺帙※縺翫¥蠢隕√′縺ゅk蜈磯ュ繝舌う繝域焚縺ァ縺吶 + + + 蠑墓焚縺ァ謖螳壹&繧後◆byte驟榊励↓縺、縺縺ヲ繝舌う繝翫Μ繝輔ぃ繧、繝ォ縺ョ遞ョ鬘槭r蛻、螳壹@縺セ縺吶 + 蛻、螳壼ッセ雎。縺ョ繝舌う繝磯榊 + 繝舌う繝磯榊怜磯ュ縺ョ隱ュ縺ソ霎シ縺ソ貂医ヰ繧、繝域焚シLEASTREADSIZE縺ョ繝舌う繝域焚莉・荳願ェュ縺ソ霎シ繧薙〒縺翫¥縺薙→シ + 繝舌う繝翫Μ繝輔ぃ繧、繝ォ遞ョ鬘槫愛螳夂オ先棡シ医←繧後↓繧りゥイ蠖薙@縺ェ縺代l縺ー荳闊ャ繝舌う繝翫Μ縺ィ蛻、螳夲シ + + + 繝輔ぃ繧、繝ォ譁蟄励さ繝シ繝臥ィョ鬘橸シ壹ヰ繧、繝翫Μ + + + + 繝輔ぃ繧、繝ォ譁蟄励さ繝シ繝臥ィョ鬘橸シ啝ip繝舌う繝翫Μ + + + + 繝輔ぃ繧、繝ォ譁蟄励さ繝シ繝臥ィョ鬘橸シ夂判蜒 + + + + + ReadJEnc 譁蟄励さ繝シ繝芽ェ蜍募愛蛻・繝ゥ繧、繝悶Λ繝ェ繝サ蜃ヲ逅譛ャ菴(Rev.20180421) + + + + 譌・譛ャ隱樊枚蟄励さ繝シ繝牙愛蛻・(SJIS/EUCJP) + + + ANSI譁蟄励さ繝シ繝牙愛蛻・(CP1252) + + + 郢∽ス灘ュ嶺クュ蝗ス隱樊枚蟄励さ繝シ繝牙愛蛻・(BIG5/EUCTW) + + + 邁。菴灘ュ嶺クュ蝗ス隱樊枚蟄励さ繝シ繝牙愛蛻・(GB18030) + + + 繝上Φ繧ー繝ォ譁蟄励さ繝シ繝牙愛蛻・(UHCKR) + + + Windows1250(iso-8859-2) 荳ュ螟ョ繝ィ繝シ繝ュ繝繝題ィ隱(繝√ぉ繧ウ隱樒ュ)蛻、蛻・ + + + Windows1251 繧ュ繝ェ繝ォ險隱(繝ュ繧キ繧「隱樒ュ)シANSI蛻、蛻・ + + + Windows1253(iso-8859-7) 繧ョ繝ェ繧キ繝」隱橸シANSI蛻、蛻・ + + + Windows1254(iso-8859-9) 繝医Ν繧ウ隱槫愛蛻・ + + + Windows1255(iso-8859-8) 繝倥ヶ繝ゥ繧、隱橸シANSI蛻、蛻・ + + + Windows1256 繧「繝ゥ繝薙い隱橸シANSI蛻、蛻・ + + + Windows1257(iso-8859-13) 繝舌Ν繝郁ィ隱槫愛蛻・ + + + Windows1258 繝吶ヨ繝翫Β隱槫愛蛻・ + + + TIS620/Windows874(iso-8859-11) 繧ソ繧、隱橸シANSI蛻、蛻・ + + + 繝舌う繝翫Μ縺ィ蛻、螳壹☆繧汽EL譁蟄励さ繝シ繝峨∝シ縲、SCII/髱暸SCII縺ョ蠅逡梧枚蟄励さ繝シ繝 + + + 髱槭ユ繧ュ繧ケ繝医ヵ繧。繧、繝ォ縺ィ蛻、螳壹☆繧句宛蠕。譁蟄励さ繝シ繝峨ョ譛螟ァ蛟、 + + + 縺薙ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ァ縺翫b縺ォ蛻、蛻・蟇セ雎。縺ィ縺吶k繝繝輔か繝ォ繝域枚蟄励さ繝シ繝 + + + EUC繝繧ウ繝シ繝峨〒逕ィ縺繧区枚蟄励さ繝シ繝会シ育┌謖螳嗜ull譎ゅッEUC縺ョ蛻、蛻・繧定。後o縺ェ縺シ + + + CP1252邉サ縺ァ蛻、蛻・蟇セ雎。縺ィ縺吶k譁蟄励さ繝シ繝会シ医ョ繝輔か繝ォ繝医ッANSI=CP1252シ + + + CP1252邉サ縺ョ蛻、蛻・縺ォ縺ゅ◆繧翫0x80-0x9F縺ョ縺縺。譁蟄励さ繝シ繝画悴螳夂セゥ縺ョ邂謇繧鍛it縺ァ陦ィ迴セ縺励◆蛟、 + + 繝繝輔か繝ォ繝医ョ髱曚P1252繝√ぉ繝繧ッ逕ィ螳夂セゥ蛟、(0x2001A002)シ晄悴螳夂セゥ縺ョ81,8D,8F,90,9D縺ォ蟇セ蠢懊☆繧九ン繝繝医′ON + FEDC BA98 7654 3210 FEDC BA98 7654 3210 + ---- ---- ---- ---- ---- ---- ---- ---- + (0x9#) 0010 0000 0000 0001 (0x8#) 1010 0000 0000 0010 + + + + 蠑墓焚謖螳壽枚蟄励さ繝シ繝/CP1252/EUC繧貞愛蛻・蟇セ雎。縺ィ縺吶k髫帙ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + 縺薙ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ァ蛻、蛻・蟇セ雎。縺ィ縺吶k繝繝輔か繝ォ繝域枚蟄励さ繝シ繝 + EUC縺ョ譁蟄励さ繝シ繝 + + + CP1252邉サ譁蟄励さ繝シ繝峨ョ縺ソ繧貞愛蛻・蟇セ雎。縺ィ縺吶k髫帙ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + CP1252邉サ縺ョ蛻、蛻・蟇セ雎。繝繝輔か繝ォ繝域枚蟄励さ繝シ繝(CP1252莉・螟悶r謖螳) + 0x80-0x9F縺ョ縺縺。譁蟄励さ繝シ繝画悴螳夂セゥ縺ョ邂謇繧鍛it縺ァ陦ィ迴セ縺励◆蛟、 + + + 繧ェ繝悶ず繧ァ繧ッ繝域枚蟄怜苓。ィ迴セ縺ィ縺励※縲∬ェ蜍募愛蛻・繝繝輔か繝ォ繝域枚蟄励さ繝シ繝峨ョ蜷榊燕繧定ソ斐☆ + + + 繝舌う繝磯榊励r蜈ィ襍ー譟サ縺励∵枚蟄励さ繝シ繝峨r閾ェ蜍募愛蛻・縺吶k + 蛻、螳壼ッセ雎。縺ョ繝舌う繝磯榊 + 繝輔ぃ繧、繝ォ繧オ繧、繧コ(繝舌う繝磯榊怜磯ュ縺九i縺ョ繝繧ウ繝シ繝牙ッセ雎。繝舌う繝域焚) + out 蛻、蛻・縺励◆譁蟄励さ繝シ繝峨↓繧医j蜿悶j蜃コ縺励◆繝繧ュ繧ケ繝域枚蟄怜暦シ磯撼繝繧ュ繧ケ繝医↑繧穎ullシ + 譁蟄励さ繝シ繝牙愛蛻・邨先棡シ磯撼繝繧ュ繧ケ繝医↑繧穎ullシ + + + 繝繝輔か繝ォ繝域枚蟄励さ繝シ繝峨ョ蛻、螳壹せ繧ウ繧「邂怜コシ亥愛螳夐幕蟋倶ス咲スョス槭ヵ繧。繧、繝ォ譛ォ蟆セ縺セ縺ァ縺ョ遽蝗イ繧貞ッセ雎。シ + 蛻、螳壼ッセ雎。縺ョ繝舌う繝磯榊 + 蛻、螳夐幕蟋倶ス咲スョ(髱暸SCII譁蟄励さ繝シ繝峨′蛻昴a縺ヲ逋サ蝣エ縺励◆菴咲スョ) + 繝輔ぃ繧、繝ォ繧オ繧、繧コ(繝舌う繝磯榊怜磯ュ縺九i縺ョ繝繧ウ繝シ繝牙ッセ雎。繝舌う繝域焚) + 蛻、螳壹せ繧ウ繧「邂怜コ邨先棡 + + + BOM縺ェ縺誘TF16縺ョ蜿ッ閭ス諤ァ縺後≠繧九°(蜈磯ュ譁蟄励′ASCII縺句凄縺九r繧ゅ→縺ォ)蛻、螳 + 蛻、螳壼ッセ雎。縺ョ繝舌う繝磯榊 + 繝輔ぃ繧、繝ォ繧オ繧、繧コ(繝舌う繝磯榊怜磯ュ縺九i縺ョ繝繧ウ繝シ繝牙ッセ雎。繝舌う繝域焚) + UTF16N縺ィ諤昴o繧後k蝣エ蜷医ッ縺昴ョ譁蟄励さ繝シ繝峨∝凄縺ェ繧穎ull + + + + JIS蛻、螳夐未騾」蜃ヲ逅繧ッ繝ゥ繧ケ + + + + SO/SI譁蟄怜コ迴セ繝√ぉ繝繧ッ + 蛻、螳壼ッセ雎。縺ョ繝舌う繝磯榊 + 繝輔ぃ繧、繝ォ繧オ繧、繧コ(繝舌う繝磯榊怜磯ュ縺九i縺ョ繝繧ウ繝シ繝牙ッセ雎。繝舌う繝域焚) + 蜃コ迴セ縺励※縺繧後ーtrue縲∝凄縺ェ繧映alse + + + JIS陬懷勧貍「蟄励お繧ケ繧ア繝シ繝励す繝シ繧ア繝ウ繧ケ譛臥┌(譛峨↑繧液rue) + + + ISO-2022-KR繧ィ繧ケ繧ア繝シ繝励す繝シ繧ア繝ウ繧ケ譛臥┌(譛峨↑繧液rue) + + + JIS隧穂セ。蛟、(JIS縺ィ縺励※繝繧ウ繝シ繝峨☆縺ケ縺阪↑繧画ュ」蛟、縲∝凄縺ェ繧峨槭う繝翫せ蛟、) + + + JIS繧ィ繧ケ繧ア繝シ繝励す繝シ繧ア繝ウ繧ケ蛻、螳壹が繝悶ず繧ァ繧ッ繝亥晄悄蛹厄シ医♀繧医ウISO-2022-KR蛻、螳夲シ + 蛻、螳壼ッセ雎。縺ョ繝舌う繝磯榊 + 繝輔ぃ繧、繝ォ繧オ繧、繧コ(繝舌う繝磯榊怜磯ュ縺九i縺ョ繝繧ウ繝シ繝牙ッセ雎。繝舌う繝域焚) + 繧ィ繧ケ繧ア繝シ繝(0x1B)蜃コ迴セ菴咲スョ + + + JIS繧ィ繧ケ繧ア繝シ繝励す繝シ繧ア繝ウ繧ケ螯・蠖捺ァ繝√ぉ繝繧ッ + 繧ィ繧ケ繧ア繝シ繝(0x1B)蜃コ迴セ菴咲スョ + 繧ィ繧ケ繧ア繝シ繝励す繝シ繧ア繝ウ繧ケ縺ィ縺励※螯・蠖薙↑繧英os蜉邂怜、縲√◎縺縺ァ縺ェ縺代l縺ー繧シ繝ュ + + + JIS縺ィ蛻、螳壹&繧後◆蝣エ蜷医ョ譁蟄励さ繝シ繝峨r遒コ螳壹☆繧 + out 蛻、蛻・縺励◆譁蟄励さ繝シ繝峨↓繧医j蜿悶j蜃コ縺励◆繝繧ュ繧ケ繝域枚蟄怜暦シ磯撼繝繧ュ繧ケ繝医↑繧穎ullシ + 繧ォ繝慨O/SI譛臥┌繧繝繧ウ繝シ繝我ク崎ス邂謇譛臥┌縺ォ蠢懊§縺櫟IS譁蟄励さ繝シ繝臥ィョ鬘 + + + + SJIS隧穂セ。繧ッ繝ゥ繧ケ + + + + 譌・譛ャ隱朶hiftJIS繝サEUCJP繝サCP1252繧貞愛蛻・蟇セ雎。縺ィ縺吶k髫帙ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + + + BIG5TW隧穂セ。繧ッ繝ゥ繧ケ + + + + 荳ュ蝗ス隱樒ケ∽ス灘ュ励サEUC-TW繝サCP1252繧貞愛蛻・蟇セ雎。縺ィ縺吶k髫帙ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + + + GB18030隧穂セ。繧ッ繝ゥ繧ケ + + + + 荳ュ蝗ス隱樒ー。菴灘ュ励サCP1252繧貞愛蛻・蟇セ雎。縺ィ縺吶k髫帙ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + + + UHCKR隧穂セ。繧ッ繝ゥ繧ケ + + + + 繝上Φ繧ー繝ォUHC繝サCP1252繧貞愛蛻・蟇セ雎。縺ィ縺吶k髫帙ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + + + + シ代ヰ繧、繝域枚蟄励さ繝シ繝画ア守畑隧穂セ。繧ッ繝ゥ繧ケ + 繧ソ繧、隱槭⊇縺九い繝ォ繝輔ぃ繝吶ャ繝医→豺キ蝨ィ縺輔○縺ェ縺譁蟄礼ィョ縺ョ譁蟄励さ繝シ繝牙愛蛻・縺ァ蜈ア騾壻サ墓ァ + + + + 縺昴ョ譁蟄励さ繝シ繝我ス鍋ウサ蝗コ譛峨ョ繧ウ繝シ繝峨ョ髢句ァ倶ス咲スョ + + + 0x80-0xFF縺ョ譁蟄励さ繝シ繝画悴螳夂セゥ縺ョ邂謇繧鍛it縺ァ陦ィ迴セ縺励◆蛟、 + + + 蠑墓焚謖螳壽枚蟄励さ繝シ繝峨→CP1252繧貞愛蛻・蟇セ雎。縺ィ縺吶k髫帙ョ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ + 縺薙ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ァ蛻、蛻・蟇セ雎。縺ィ縺吶k繝繝輔か繝ォ繝域枚蟄励さ繝シ繝 + 騾壼クク譁蟄暦シ上%縺ョ譁蟄励さ繝シ繝牙崋譛峨ョ譁蟄礼ィョ遽蝗イ縺ョ蠅逡 + + 譁蟄励さ繝シ繝画悴螳夂セゥ縺ョ邂謇繧鍛it縺ァ陦ィ迴セ縺励◆蛟、 + + [0]=0x80-0x9F縺ョ譛ェ螳夂セゥ邂謇 + [1]=0xA0-0xBF縺ョ譛ェ螳夂セゥ邂謇 + [2]=0xC0-0xDF縺ョ譛ェ螳夂セゥ邂謇 + [3]=0xE0-0xFF縺ョ譛ェ螳夂セゥ邂謇 + + + + diff --git a/Test/dll/Microsoft.VC90.CRT.manifest b/Test/dll/Microsoft.VC90.CRT.manifest new file mode 100644 index 00000000..5b693305 --- /dev/null +++ b/Test/dll/Microsoft.VC90.CRT.manifest @@ -0,0 +1,6 @@ +サソ + + + + S83+LBs1RkUxSkzia1WysaAhLbk= cKyCmIKF+fcGn6qaBhKuun+wAcQ= r+4y/NnOFgaANxNXoHL1jF95DUg= + \ No newline at end of file diff --git a/Test/dll/Newtonsoft.Json.dll b/Test/dll/Newtonsoft.Json.dll new file mode 100644 index 00000000..e4a63399 Binary files /dev/null and b/Test/dll/Newtonsoft.Json.dll differ diff --git a/Test/dll/Newtonsoft.Json.xml b/Test/dll/Newtonsoft.Json.xml new file mode 100644 index 00000000..aa245c5e --- /dev/null +++ b/Test/dll/Newtonsoft.Json.xml @@ -0,0 +1,11262 @@ + + + + Newtonsoft.Json + + + + + Represents a BSON Oid (object id). + + + + + Gets or sets the value of the Oid. + + The value of the Oid. + + + + Initializes a new instance of the class. + + The Oid value. + + + + Represents a reader that provides fast, non-cached, forward-only access to serialized BSON data. + + + + + Gets or sets a value indicating whether binary data reading should be compatible with incorrect Json.NET 3.5 written binary. + + + true if binary data reading will be compatible with incorrect Json.NET 3.5 written binary; otherwise, false. + + + + + Gets or sets a value indicating whether the root object will be read as a JSON array. + + + true if the root object will be read as a JSON array; otherwise, false. + + + + + Gets or sets the used when reading values from BSON. + + The used when reading values from BSON. + + + + Initializes a new instance of the class. + + The containing the BSON data to read. + + + + Initializes a new instance of the class. + + The containing the BSON data to read. + + + + Initializes a new instance of the class. + + The containing the BSON data to read. + if set to true the root object will be read as a JSON array. + The used when reading values from BSON. + + + + Initializes a new instance of the class. + + The containing the BSON data to read. + if set to true the root object will be read as a JSON array. + The used when reading values from BSON. + + + + Reads the next JSON token from the underlying . + + + true if the next token was read successfully; false if there are no more tokens to read. + + + + + Changes the reader's state to . + If is set to true, the underlying is also closed. + + + + + Represents a writer that provides a fast, non-cached, forward-only way of generating BSON data. + + + + + Gets or sets the used when writing values to BSON. + When set to no conversion will occur. + + The used when writing values to BSON. + + + + Initializes a new instance of the class. + + The to write to. + + + + Initializes a new instance of the class. + + The to write to. + + + + Flushes whatever is in the buffer to the underlying and also flushes the underlying stream. + + + + + Writes the end. + + The token. + + + + Writes a comment /*...*/ containing the specified text. + + Text to place inside the comment. + + + + Writes the start of a constructor with the given name. + + The name of the constructor. + + + + Writes raw JSON. + + The raw JSON to write. + + + + Writes raw JSON where a value is expected and updates the writer's state. + + The raw JSON to write. + + + + Writes the beginning of a JSON array. + + + + + Writes the beginning of a JSON object. + + + + + Writes the property name of a name/value pair on a JSON object. + + The name of the property. + + + + Closes this writer. + If is set to true, the underlying is also closed. + If is set to true, the JSON is auto-completed. + + + + + Writes a value. + An error will raised if the value cannot be written as a single JSON token. + + The value to write. + + + + Writes a null value. + + + + + Writes an undefined value. + + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a [] value. + + The [] value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a [] value that represents a BSON object id. + + The Object ID value to write. + + + + Writes a BSON regex. + + The regex pattern. + The regex options. + + + + Specifies how constructors are used when initializing objects during deserialization by the . + + + + + First attempt to use the public default constructor, then fall back to a single parameterized constructor, then to the non-public default constructor. + + + + + Json.NET will use a non-public default constructor before falling back to a parameterized constructor. + + + + + Converts a binary value to and from a base 64 string value. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts a to and from JSON and BSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Creates a custom object. + + The object type to convert. + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Creates an object which will then be populated by the serializer. + + Type of the object. + The created object. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Gets a value indicating whether this can write JSON. + + + true if this can write JSON; otherwise, false. + + + + + Converts a to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified value type. + + Type of the value. + + true if this instance can convert the specified value type; otherwise, false. + + + + + Converts a to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified value type. + + Type of the value. + + true if this instance can convert the specified value type; otherwise, false. + + + + + Provides a base class for converting a to and from JSON. + + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts a F# discriminated union type to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts an Entity Framework to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts an to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Gets a value indicating whether this can write JSON. + + + true if this can write JSON; otherwise, false. + + + + + Converts a to and from the ISO 8601 date format (e.g. "2008-04-12T12:53Z"). + + + + + Gets or sets the date time styles used when converting a date to and from JSON. + + The date time styles used when converting a date to and from JSON. + + + + Gets or sets the date time format used when converting a date to and from JSON. + + The date time format used when converting a date to and from JSON. + + + + Gets or sets the culture used when converting a date to and from JSON. + + The culture used when converting a date to and from JSON. + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Converts a to and from a JavaScript Date constructor (e.g. new Date(52231943)). + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing property value of the JSON that is being converted. + The calling serializer. + The object value. + + + + Converts a to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts a to and from JSON and BSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts an to and from its name string value. + + + + + Gets or sets a value indicating whether the written enum text should be camel case. + The default value is false. + + true if the written enum text will be camel case; otherwise, false. + + + + Gets or sets the naming strategy used to resolve how enum text is written. + + The naming strategy used to resolve how enum text is written. + + + + Gets or sets a value indicating whether integer values are allowed when serializing and deserializing. + The default value is true. + + true if integers are allowed when serializing and deserializing; otherwise, false. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + true if the written enum text will be camel case; otherwise, false. + + + + Initializes a new instance of the class. + + The naming strategy used to resolve how enum text is written. + true if integers are allowed when serializing and deserializing; otherwise, false. + + + + Initializes a new instance of the class. + + The of the used to write enum text. + + + + Initializes a new instance of the class. + + The of the used to write enum text. + + The parameter list to use when constructing the described by . + If null, the default constructor is used. + When non-null, there must be a constructor defined in the that exactly matches the number, + order, and type of these parameters. + + + + + Initializes a new instance of the class. + + The of the used to write enum text. + + The parameter list to use when constructing the described by . + If null, the default constructor is used. + When non-null, there must be a constructor defined in the that exactly matches the number, + order, and type of these parameters. + + true if integers are allowed when serializing and deserializing; otherwise, false. + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts a to and from Unix epoch time + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing property value of the JSON that is being converted. + The calling serializer. + The object value. + + + + Converts a to and from a string (e.g. "1.2.3.4"). + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing property value of the JSON that is being converted. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Converts XML to and from JSON. + + + + + Gets or sets the name of the root element to insert when deserializing to XML if the JSON structure has produced multiple root elements. + + The name of the deserialized root element. + + + + Gets or sets a value to indicate whether to write the Json.NET array attribute. + This attribute helps preserve arrays when converting the written XML back to JSON. + + true if the array attribute is written to the XML; otherwise, false. + + + + Gets or sets a value indicating whether to write the root JSON object. + + true if the JSON root object is omitted; otherwise, false. + + + + Gets or sets a value indicating whether to encode special characters when converting JSON to XML. + If true, special characters like ':', '@', '?', '#' and '$' in JSON property names aren't used to specify + XML namespaces, attributes or processing directives. Instead special characters are encoded and written + as part of the XML element name. + + true if special characters are encoded; otherwise, false. + + + + Writes the JSON representation of the object. + + The to write to. + The calling serializer. + The value. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Checks if the is a namespace attribute. + + Attribute name to test. + The attribute name prefix if it has one, otherwise an empty string. + true if attribute name is for a namespace attribute, otherwise false. + + + + Determines whether this instance can convert the specified value type. + + Type of the value. + + true if this instance can convert the specified value type; otherwise, false. + + + + + Specifies how dates are formatted when writing JSON text. + + + + + Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". + + + + + Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". + + + + + Specifies how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON text. + + + + + Date formatted strings are not parsed to a date type and are read as strings. + + + + + Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . + + + + + Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . + + + + + Specifies how to treat the time value when converting between string and . + + + + + Treat as local time. If the object represents a Coordinated Universal Time (UTC), it is converted to the local time. + + + + + Treat as a UTC. If the object represents a local time, it is converted to a UTC. + + + + + Treat as a local time if a is being converted to a string. + If a string is being converted to , convert to a local time if a time zone is specified. + + + + + Time zone information should be preserved when converting. + + + + + The default JSON name table implementation. + + + + + Initializes a new instance of the class. + + + + + Gets a string containing the same characters as the specified range of characters in the given array. + + The character array containing the name to find. + The zero-based index into the array specifying the first character of the name. + The number of characters in the name. + A string containing the same characters as the specified range of characters in the given array. + + + + Adds the specified string into name table. + + The string to add. + This method is not thread-safe. + The resolved string. + + + + Specifies default value handling options for the . + + + + + + + + + Include members where the member value is the same as the member's default value when serializing objects. + Included members are written to JSON. Has no effect when deserializing. + + + + + Ignore members where the member value is the same as the member's default value when serializing objects + so that it is not written to JSON. + This option will ignore all default values (e.g. null for objects and nullable types; 0 for integers, + decimals and floating point numbers; and false for booleans). The default value ignored can be changed by + placing the on the property. + + + + + Members with a default value but no JSON will be set to their default value when deserializing. + + + + + Ignore members where the member value is the same as the member's default value when serializing objects + and set members to their default value when deserializing. + + + + + Specifies float format handling options when writing special floating point numbers, e.g. , + and with . + + + + + Write special floating point values as strings in JSON, e.g. "NaN", "Infinity", "-Infinity". + + + + + Write special floating point values as symbols in JSON, e.g. NaN, Infinity, -Infinity. + Note that this will produce non-valid JSON. + + + + + Write special floating point values as the property's default value in JSON, e.g. 0.0 for a property, null for a of property. + + + + + Specifies how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. + + + + + Floating point numbers are parsed to . + + + + + Floating point numbers are parsed to . + + + + + Specifies formatting options for the . + + + + + No special formatting is applied. This is the default. + + + + + Causes child objects to be indented according to the and settings. + + + + + Provides an interface for using pooled arrays. + + The array type content. + + + + Rent an array from the pool. This array must be returned when it is no longer needed. + + The minimum required length of the array. The returned array may be longer. + The rented array from the pool. This array must be returned when it is no longer needed. + + + + Return an array to the pool. + + The array that is being returned. + + + + Provides an interface to enable a class to return line and position information. + + + + + Gets a value indicating whether the class can return line information. + + + true if and can be provided; otherwise, false. + + + + + Gets the current line number. + + The current line number or 0 if no line information is available (for example, when returns false). + + + + Gets the current line position. + + The current line position or 0 if no line information is available (for example, when returns false). + + + + Instructs the how to serialize the collection. + + + + + Gets or sets a value indicating whether null items are allowed in the collection. + + true if null items are allowed in the collection; otherwise, false. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with a flag indicating whether the array can contain null items. + + A flag indicating whether the array can contain null items. + + + + Initializes a new instance of the class with the specified container Id. + + The container Id. + + + + Instructs the to use the specified constructor when deserializing that object. + + + + + Instructs the how to serialize the object. + + + + + Gets or sets the id. + + The id. + + + + Gets or sets the title. + + The title. + + + + Gets or sets the description. + + The description. + + + + Gets or sets the collection's items converter. + + The collection's items converter. + + + + The parameter list to use when constructing the described by . + If null, the default constructor is used. + When non-null, there must be a constructor defined in the that exactly matches the number, + order, and type of these parameters. + + + + [JsonContainer(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })] + + + + + + Gets or sets the of the . + + The of the . + + + + The parameter list to use when constructing the described by . + If null, the default constructor is used. + When non-null, there must be a constructor defined in the that exactly matches the number, + order, and type of these parameters. + + + + [JsonContainer(NamingStrategyType = typeof(MyNamingStrategy), NamingStrategyParameters = new object[] { 123, "Four" })] + + + + + + Gets or sets a value that indicates whether to preserve object references. + + + true to keep object reference; otherwise, false. The default is false. + + + + + Gets or sets a value that indicates whether to preserve collection's items references. + + + true to keep collection's items object references; otherwise, false. The default is false. + + + + + Gets or sets the reference loop handling used when serializing the collection's items. + + The reference loop handling. + + + + Gets or sets the type name handling used when serializing the collection's items. + + The type name handling. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with the specified container Id. + + The container Id. + + + + Provides methods for converting between .NET types and JSON types. + + + + + + + + Gets or sets a function that creates default . + Default settings are automatically used by serialization methods on , + and and on . + To serialize without using any default settings create a with + . + + + + + Represents JavaScript's boolean value true as a string. This field is read-only. + + + + + Represents JavaScript's boolean value false as a string. This field is read-only. + + + + + Represents JavaScript's null as a string. This field is read-only. + + + + + Represents JavaScript's undefined as a string. This field is read-only. + + + + + Represents JavaScript's positive infinity as a string. This field is read-only. + + + + + Represents JavaScript's negative infinity as a string. This field is read-only. + + + + + Represents JavaScript's NaN as a string. This field is read-only. + + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation using the specified. + + The value to convert. + The format the date will be converted to. + The time zone handling when the date is converted to a string. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation using the specified. + + The value to convert. + The format the date will be converted to. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + The string delimiter character. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + The string delimiter character. + The string escape handling. + A JSON string representation of the . + + + + Converts the to its JSON string representation. + + The value to convert. + A JSON string representation of the . + + + + Serializes the specified object to a JSON string. + + The object to serialize. + A JSON string representation of the object. + + + + Serializes the specified object to a JSON string using formatting. + + The object to serialize. + Indicates how the output should be formatted. + + A JSON string representation of the object. + + + + + Serializes the specified object to a JSON string using a collection of . + + The object to serialize. + A collection of converters used while serializing. + A JSON string representation of the object. + + + + Serializes the specified object to a JSON string using formatting and a collection of . + + The object to serialize. + Indicates how the output should be formatted. + A collection of converters used while serializing. + A JSON string representation of the object. + + + + Serializes the specified object to a JSON string using . + + The object to serialize. + The used to serialize the object. + If this is null, default serialization settings will be used. + + A JSON string representation of the object. + + + + + Serializes the specified object to a JSON string using a type, formatting and . + + The object to serialize. + The used to serialize the object. + If this is null, default serialization settings will be used. + + The type of the value being serialized. + This parameter is used when is to write out the type name if the type of the value does not match. + Specifying the type is optional. + + + A JSON string representation of the object. + + + + + Serializes the specified object to a JSON string using formatting and . + + The object to serialize. + Indicates how the output should be formatted. + The used to serialize the object. + If this is null, default serialization settings will be used. + + A JSON string representation of the object. + + + + + Serializes the specified object to a JSON string using a type, formatting and . + + The object to serialize. + Indicates how the output should be formatted. + The used to serialize the object. + If this is null, default serialization settings will be used. + + The type of the value being serialized. + This parameter is used when is to write out the type name if the type of the value does not match. + Specifying the type is optional. + + + A JSON string representation of the object. + + + + + Deserializes the JSON to a .NET object. + + The JSON to deserialize. + The deserialized object from the JSON string. + + + + Deserializes the JSON to a .NET object using . + + The JSON to deserialize. + + The used to deserialize the object. + If this is null, default serialization settings will be used. + + The deserialized object from the JSON string. + + + + Deserializes the JSON to the specified .NET type. + + The JSON to deserialize. + The of object being deserialized. + The deserialized object from the JSON string. + + + + Deserializes the JSON to the specified .NET type. + + The type of the object to deserialize to. + The JSON to deserialize. + The deserialized object from the JSON string. + + + + Deserializes the JSON to the given anonymous type. + + + The anonymous type to deserialize to. This can't be specified + traditionally and must be inferred from the anonymous type passed + as a parameter. + + The JSON to deserialize. + The anonymous type object. + The deserialized anonymous type from the JSON string. + + + + Deserializes the JSON to the given anonymous type using . + + + The anonymous type to deserialize to. This can't be specified + traditionally and must be inferred from the anonymous type passed + as a parameter. + + The JSON to deserialize. + The anonymous type object. + + The used to deserialize the object. + If this is null, default serialization settings will be used. + + The deserialized anonymous type from the JSON string. + + + + Deserializes the JSON to the specified .NET type using a collection of . + + The type of the object to deserialize to. + The JSON to deserialize. + Converters to use while deserializing. + The deserialized object from the JSON string. + + + + Deserializes the JSON to the specified .NET type using . + + The type of the object to deserialize to. + The object to deserialize. + + The used to deserialize the object. + If this is null, default serialization settings will be used. + + The deserialized object from the JSON string. + + + + Deserializes the JSON to the specified .NET type using a collection of . + + The JSON to deserialize. + The type of the object to deserialize. + Converters to use while deserializing. + The deserialized object from the JSON string. + + + + Deserializes the JSON to the specified .NET type using . + + The JSON to deserialize. + The type of the object to deserialize to. + + The used to deserialize the object. + If this is null, default serialization settings will be used. + + The deserialized object from the JSON string. + + + + Populates the object with values from the JSON string. + + The JSON to populate values from. + The target object to populate values onto. + + + + Populates the object with values from the JSON string using . + + The JSON to populate values from. + The target object to populate values onto. + + The used to deserialize the object. + If this is null, default serialization settings will be used. + + + + + Serializes the to a JSON string. + + The node to serialize. + A JSON string of the . + + + + Serializes the to a JSON string using formatting. + + The node to serialize. + Indicates how the output should be formatted. + A JSON string of the . + + + + Serializes the to a JSON string using formatting and omits the root object if is true. + + The node to serialize. + Indicates how the output should be formatted. + Omits writing the root object. + A JSON string of the . + + + + Deserializes the from a JSON string. + + The JSON string. + The deserialized . + + + + Deserializes the from a JSON string nested in a root element specified by . + + The JSON string. + The name of the root element to append when deserializing. + The deserialized . + + + + Deserializes the from a JSON string nested in a root element specified by + and writes a Json.NET array attribute for collections. + + The JSON string. + The name of the root element to append when deserializing. + + A value to indicate whether to write the Json.NET array attribute. + This attribute helps preserve arrays when converting the written XML back to JSON. + + The deserialized . + + + + Deserializes the from a JSON string nested in a root element specified by , + writes a Json.NET array attribute for collections, and encodes special characters. + + The JSON string. + The name of the root element to append when deserializing. + + A value to indicate whether to write the Json.NET array attribute. + This attribute helps preserve arrays when converting the written XML back to JSON. + + + A value to indicate whether to encode special characters when converting JSON to XML. + If true, special characters like ':', '@', '?', '#' and '$' in JSON property names aren't used to specify + XML namespaces, attributes or processing directives. Instead special characters are encoded and written + as part of the XML element name. + + The deserialized . + + + + Serializes the to a JSON string. + + The node to convert to JSON. + A JSON string of the . + + + + Serializes the to a JSON string using formatting. + + The node to convert to JSON. + Indicates how the output should be formatted. + A JSON string of the . + + + + Serializes the to a JSON string using formatting and omits the root object if is true. + + The node to serialize. + Indicates how the output should be formatted. + Omits writing the root object. + A JSON string of the . + + + + Deserializes the from a JSON string. + + The JSON string. + The deserialized . + + + + Deserializes the from a JSON string nested in a root element specified by . + + The JSON string. + The name of the root element to append when deserializing. + The deserialized . + + + + Deserializes the from a JSON string nested in a root element specified by + and writes a Json.NET array attribute for collections. + + The JSON string. + The name of the root element to append when deserializing. + + A value to indicate whether to write the Json.NET array attribute. + This attribute helps preserve arrays when converting the written XML back to JSON. + + The deserialized . + + + + Deserializes the from a JSON string nested in a root element specified by , + writes a Json.NET array attribute for collections, and encodes special characters. + + The JSON string. + The name of the root element to append when deserializing. + + A value to indicate whether to write the Json.NET array attribute. + This attribute helps preserve arrays when converting the written XML back to JSON. + + + A value to indicate whether to encode special characters when converting JSON to XML. + If true, special characters like ':', '@', '?', '#' and '$' in JSON property names aren't used to specify + XML namespaces, attributes or processing directives. Instead special characters are encoded and written + as part of the XML element name. + + The deserialized . + + + + Converts an object to and from JSON. + + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Gets a value indicating whether this can read JSON. + + true if this can read JSON; otherwise, false. + + + + Gets a value indicating whether this can write JSON. + + true if this can write JSON; otherwise, false. + + + + Converts an object to and from JSON. + + The object type to convert. + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Writes the JSON representation of the object. + + The to write to. + The value. + The calling serializer. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. + The calling serializer. + The object value. + + + + Reads the JSON representation of the object. + + The to read from. + Type of the object. + The existing value of object being read. If there is no existing value then null will be used. + The existing value has a value. + The calling serializer. + The object value. + + + + Determines whether this instance can convert the specified object type. + + Type of the object. + + true if this instance can convert the specified object type; otherwise, false. + + + + + Instructs the to use the specified when serializing the member or class. + + + + + Gets the of the . + + The of the . + + + + The parameter list to use when constructing the described by . + If null, the default constructor is used. + + + + + Initializes a new instance of the class. + + Type of the . + + + + Initializes a new instance of the class. + + Type of the . + Parameter list to use when constructing the . Can be null. + + + + Represents a collection of . + + + + + Instructs the how to serialize the collection. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with the specified container Id. + + The container Id. + + + + The exception thrown when an error occurs during JSON serialization or deserialization. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class + with a specified error message. + + The error message that explains the reason for the exception. + + + + Initializes a new instance of the class + with a specified error message and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, or null if no inner exception is specified. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + Instructs the to deserialize properties with no matching class member into the specified collection + and write values during serialization. + + + + + Gets or sets a value that indicates whether to write extension data when serializing the object. + + + true to write extension data when serializing the object; otherwise, false. The default is true. + + + + + Gets or sets a value that indicates whether to read extension data when deserializing the object. + + + true to read extension data when deserializing the object; otherwise, false. The default is true. + + + + + Initializes a new instance of the class. + + + + + Instructs the not to serialize the public field or public read/write property value. + + + + + Base class for a table of atomized string objects. + + + + + Gets a string containing the same characters as the specified range of characters in the given array. + + The character array containing the name to find. + The zero-based index into the array specifying the first character of the name. + The number of characters in the name. + A string containing the same characters as the specified range of characters in the given array. + + + + Instructs the how to serialize the object. + + + + + Gets or sets the member serialization. + + The member serialization. + + + + Gets or sets the missing member handling used when deserializing this object. + + The missing member handling. + + + + Gets or sets how the object's properties with null values are handled during serialization and deserialization. + + How the object's properties with null values are handled during serialization and deserialization. + + + + Gets or sets a value that indicates whether the object's properties are required. + + + A value indicating whether the object's properties are required. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with the specified member serialization. + + The member serialization. + + + + Initializes a new instance of the class with the specified container Id. + + The container Id. + + + + Instructs the to always serialize the member with the specified name. + + + + + Gets or sets the type used when serializing the property's collection items. + + The collection's items type. + + + + The parameter list to use when constructing the described by . + If null, the default constructor is used. + When non-null, there must be a constructor defined in the that exactly matches the number, + order, and type of these parameters. + + + + [JsonProperty(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })] + + + + + + Gets or sets the of the . + + The of the . + + + + The parameter list to use when constructing the described by . + If null, the default constructor is used. + When non-null, there must be a constructor defined in the that exactly matches the number, + order, and type of these parameters. + + + + [JsonProperty(NamingStrategyType = typeof(MyNamingStrategy), NamingStrategyParameters = new object[] { 123, "Four" })] + + + + + + Gets or sets the null value handling used when serializing this property. + + The null value handling. + + + + Gets or sets the default value handling used when serializing this property. + + The default value handling. + + + + Gets or sets the reference loop handling used when serializing this property. + + The reference loop handling. + + + + Gets or sets the object creation handling used when deserializing this property. + + The object creation handling. + + + + Gets or sets the type name handling used when serializing this property. + + The type name handling. + + + + Gets or sets whether this property's value is serialized as a reference. + + Whether this property's value is serialized as a reference. + + + + Gets or sets the order of serialization of a member. + + The numeric order of serialization. + + + + Gets or sets a value indicating whether this property is required. + + + A value indicating whether this property is required. + + + + + Gets or sets the name of the property. + + The name of the property. + + + + Gets or sets the reference loop handling used when serializing the property's collection items. + + The collection's items reference loop handling. + + + + Gets or sets the type name handling used when serializing the property's collection items. + + The collection's items type name handling. + + + + Gets or sets whether this property's collection items are serialized as a reference. + + Whether this property's collection items are serialized as a reference. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with the specified name. + + Name of the property. + + + + Represents a reader that provides fast, non-cached, forward-only access to serialized JSON data. + + + + + Asynchronously reads the next JSON token from the source. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous read. The + property returns true if the next token was read successfully; false if there are no more tokens to read. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously skips the children of the current token. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously reads the next JSON token from the source as a of . + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous read. The + property returns the of . This result will be null at the end of an array. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously reads the next JSON token from the source as a []. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous read. The + property returns the []. This result will be null at the end of an array. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously reads the next JSON token from the source as a of . + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous read. The + property returns the of . This result will be null at the end of an array. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously reads the next JSON token from the source as a of . + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous read. The + property returns the of . This result will be null at the end of an array. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously reads the next JSON token from the source as a of . + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous read. The + property returns the of . This result will be null at the end of an array. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously reads the next JSON token from the source as a of . + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous read. The + property returns the of . This result will be null at the end of an array. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously reads the next JSON token from the source as a of . + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous read. The + property returns the of . This result will be null at the end of an array. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously reads the next JSON token from the source as a . + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous read. The + property returns the . This result will be null at the end of an array. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Specifies the state of the reader. + + + + + A read method has not been called. + + + + + The end of the file has been reached successfully. + + + + + Reader is at a property. + + + + + Reader is at the start of an object. + + + + + Reader is in an object. + + + + + Reader is at the start of an array. + + + + + Reader is in an array. + + + + + The method has been called. + + + + + Reader has just read a value. + + + + + Reader is at the start of a constructor. + + + + + Reader is in a constructor. + + + + + An error occurred that prevents the read operation from continuing. + + + + + The end of the file has been reached successfully. + + + + + Gets the current reader state. + + The current reader state. + + + + Gets or sets a value indicating whether the source should be closed when this reader is closed. + + + true to close the source when this reader is closed; otherwise false. The default is true. + + + + + Gets or sets a value indicating whether multiple pieces of JSON content can + be read from a continuous stream without erroring. + + + true to support reading multiple pieces of JSON content; otherwise false. + The default is false. + + + + + Gets the quotation mark character used to enclose the value of a string. + + + + + Gets or sets how time zones are handled when reading JSON. + + + + + Gets or sets how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. + + + + + Gets or sets how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. + + + + + Gets or sets how custom date formatted strings are parsed when reading JSON. + + + + + Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . + + + + + Gets the type of the current JSON token. + + + + + Gets the text value of the current JSON token. + + + + + Gets the .NET type for the current JSON token. + + + + + Gets the depth of the current token in the JSON document. + + The depth of the current token in the JSON document. + + + + Gets the path of the current JSON token. + + + + + Gets or sets the culture used when reading JSON. Defaults to . + + + + + Initializes a new instance of the class. + + + + + Reads the next JSON token from the source. + + true if the next token was read successfully; false if there are no more tokens to read. + + + + Reads the next JSON token from the source as a of . + + A of . This method will return null at the end of an array. + + + + Reads the next JSON token from the source as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the source as a []. + + A [] or null if the next JSON token is null. This method will return null at the end of an array. + + + + Reads the next JSON token from the source as a of . + + A of . This method will return null at the end of an array. + + + + Reads the next JSON token from the source as a of . + + A of . This method will return null at the end of an array. + + + + Reads the next JSON token from the source as a of . + + A of . This method will return null at the end of an array. + + + + Reads the next JSON token from the source as a of . + + A of . This method will return null at the end of an array. + + + + Reads the next JSON token from the source as a of . + + A of . This method will return null at the end of an array. + + + + Skips the children of the current token. + + + + + Sets the current token. + + The new token. + + + + Sets the current token and value. + + The new token. + The value. + + + + Sets the current token and value. + + The new token. + The value. + A flag indicating whether the position index inside an array should be updated. + + + + Sets the state based on current token type. + + + + + Releases unmanaged and - optionally - managed resources. + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Changes the reader's state to . + If is set to true, the source is also closed. + + + + + The exception thrown when an error occurs while reading JSON text. + + + + + Gets the line number indicating where the error occurred. + + The line number indicating where the error occurred. + + + + Gets the line position indicating where the error occurred. + + The line position indicating where the error occurred. + + + + Gets the path to the JSON where the error occurred. + + The path to the JSON where the error occurred. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class + with a specified error message. + + The error message that explains the reason for the exception. + + + + Initializes a new instance of the class + with a specified error message and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, or null if no inner exception is specified. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + Initializes a new instance of the class + with a specified error message, JSON path, line number, line position, and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The path to the JSON where the error occurred. + The line number indicating where the error occurred. + The line position indicating where the error occurred. + The exception that is the cause of the current exception, or null if no inner exception is specified. + + + + Instructs the to always serialize the member, and to require that the member has a value. + + + + + The exception thrown when an error occurs during JSON serialization or deserialization. + + + + + Gets the line number indicating where the error occurred. + + The line number indicating where the error occurred. + + + + Gets the line position indicating where the error occurred. + + The line position indicating where the error occurred. + + + + Gets the path to the JSON where the error occurred. + + The path to the JSON where the error occurred. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class + with a specified error message. + + The error message that explains the reason for the exception. + + + + Initializes a new instance of the class + with a specified error message and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, or null if no inner exception is specified. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + Initializes a new instance of the class + with a specified error message, JSON path, line number, line position, and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The path to the JSON where the error occurred. + The line number indicating where the error occurred. + The line position indicating where the error occurred. + The exception that is the cause of the current exception, or null if no inner exception is specified. + + + + Serializes and deserializes objects into and from the JSON format. + The enables you to control how objects are encoded into JSON. + + + + + Occurs when the errors during serialization and deserialization. + + + + + Gets or sets the used by the serializer when resolving references. + + + + + Gets or sets the used by the serializer when resolving type names. + + + + + Gets or sets the used by the serializer when resolving type names. + + + + + Gets or sets the used by the serializer when writing trace messages. + + The trace writer. + + + + Gets or sets the equality comparer used by the serializer when comparing references. + + The equality comparer. + + + + Gets or sets how type name writing and reading is handled by the serializer. + The default value is . + + + should be used with caution when your application deserializes JSON from an external source. + Incoming types should be validated with a custom + when deserializing with a value other than . + + + + + Gets or sets how a type name assembly is written and resolved by the serializer. + The default value is . + + The type name assembly format. + + + + Gets or sets how a type name assembly is written and resolved by the serializer. + The default value is . + + The type name assembly format. + + + + Gets or sets how object references are preserved by the serializer. + The default value is . + + + + + Gets or sets how reference loops (e.g. a class referencing itself) is handled. + The default value is . + + + + + Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. + The default value is . + + + + + Gets or sets how null values are handled during serialization and deserialization. + The default value is . + + + + + Gets or sets how default values are handled during serialization and deserialization. + The default value is . + + + + + Gets or sets how objects are created during deserialization. + The default value is . + + The object creation handling. + + + + Gets or sets how constructors are used during deserialization. + The default value is . + + The constructor handling. + + + + Gets or sets how metadata properties are used during deserialization. + The default value is . + + The metadata properties handling. + + + + Gets a collection that will be used during serialization. + + Collection that will be used during serialization. + + + + Gets or sets the contract resolver used by the serializer when + serializing .NET objects to JSON and vice versa. + + + + + Gets or sets the used by the serializer when invoking serialization callback methods. + + The context. + + + + Indicates how JSON text output is formatted. + The default value is . + + + + + Gets or sets how dates are written to JSON text. + The default value is . + + + + + Gets or sets how time zones are handled during serialization and deserialization. + The default value is . + + + + + Gets or sets how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. + The default value is . + + + + + Gets or sets how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. + The default value is . + + + + + Gets or sets how special floating point numbers, e.g. , + and , + are written as JSON text. + The default value is . + + + + + Gets or sets how strings are escaped when writing JSON text. + The default value is . + + + + + Gets or sets how and values are formatted when writing JSON text, + and the expected date format when reading JSON text. + The default value is "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK". + + + + + Gets or sets the culture used when reading JSON. + The default value is . + + + + + Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . + A null value means there is no maximum. + The default value is null. + + + + + Gets a value indicating whether there will be a check for additional JSON content after deserializing an object. + The default value is false. + + + true if there will be a check for additional JSON content after deserializing an object; otherwise, false. + + + + + Initializes a new instance of the class. + + + + + Creates a new instance. + The will not use default settings + from . + + + A new instance. + The will not use default settings + from . + + + + + Creates a new instance using the specified . + The will not use default settings + from . + + The settings to be applied to the . + + A new instance using the specified . + The will not use default settings + from . + + + + + Creates a new instance. + The will use default settings + from . + + + A new instance. + The will use default settings + from . + + + + + Creates a new instance using the specified . + The will use default settings + from as well as the specified . + + The settings to be applied to the . + + A new instance using the specified . + The will use default settings + from as well as the specified . + + + + + Populates the JSON values onto the target object. + + The that contains the JSON structure to read values from. + The target object to populate values onto. + + + + Populates the JSON values onto the target object. + + The that contains the JSON structure to read values from. + The target object to populate values onto. + + + + Deserializes the JSON structure contained by the specified . + + The that contains the JSON structure to deserialize. + The being deserialized. + + + + Deserializes the JSON structure contained by the specified + into an instance of the specified type. + + The containing the object. + The of object being deserialized. + The instance of being deserialized. + + + + Deserializes the JSON structure contained by the specified + into an instance of the specified type. + + The containing the object. + The type of the object to deserialize. + The instance of being deserialized. + + + + Deserializes the JSON structure contained by the specified + into an instance of the specified type. + + The containing the object. + The of object being deserialized. + The instance of being deserialized. + + + + Serializes the specified and writes the JSON structure + using the specified . + + The used to write the JSON structure. + The to serialize. + + + + Serializes the specified and writes the JSON structure + using the specified . + + The used to write the JSON structure. + The to serialize. + + The type of the value being serialized. + This parameter is used when is to write out the type name if the type of the value does not match. + Specifying the type is optional. + + + + + Serializes the specified and writes the JSON structure + using the specified . + + The used to write the JSON structure. + The to serialize. + + The type of the value being serialized. + This parameter is used when is Auto to write out the type name if the type of the value does not match. + Specifying the type is optional. + + + + + Serializes the specified and writes the JSON structure + using the specified . + + The used to write the JSON structure. + The to serialize. + + + + Specifies the settings on a object. + + + + + Gets or sets how reference loops (e.g. a class referencing itself) are handled. + The default value is . + + Reference loop handling. + + + + Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. + The default value is . + + Missing member handling. + + + + Gets or sets how objects are created during deserialization. + The default value is . + + The object creation handling. + + + + Gets or sets how null values are handled during serialization and deserialization. + The default value is . + + Null value handling. + + + + Gets or sets how default values are handled during serialization and deserialization. + The default value is . + + The default value handling. + + + + Gets or sets a collection that will be used during serialization. + + The converters. + + + + Gets or sets how object references are preserved by the serializer. + The default value is . + + The preserve references handling. + + + + Gets or sets how type name writing and reading is handled by the serializer. + The default value is . + + + should be used with caution when your application deserializes JSON from an external source. + Incoming types should be validated with a custom + when deserializing with a value other than . + + The type name handling. + + + + Gets or sets how metadata properties are used during deserialization. + The default value is . + + The metadata properties handling. + + + + Gets or sets how a type name assembly is written and resolved by the serializer. + The default value is . + + The type name assembly format. + + + + Gets or sets how a type name assembly is written and resolved by the serializer. + The default value is . + + The type name assembly format. + + + + Gets or sets how constructors are used during deserialization. + The default value is . + + The constructor handling. + + + + Gets or sets the contract resolver used by the serializer when + serializing .NET objects to JSON and vice versa. + + The contract resolver. + + + + Gets or sets the equality comparer used by the serializer when comparing references. + + The equality comparer. + + + + Gets or sets the used by the serializer when resolving references. + + The reference resolver. + + + + Gets or sets a function that creates the used by the serializer when resolving references. + + A function that creates the used by the serializer when resolving references. + + + + Gets or sets the used by the serializer when writing trace messages. + + The trace writer. + + + + Gets or sets the used by the serializer when resolving type names. + + The binder. + + + + Gets or sets the used by the serializer when resolving type names. + + The binder. + + + + Gets or sets the error handler called during serialization and deserialization. + + The error handler called during serialization and deserialization. + + + + Gets or sets the used by the serializer when invoking serialization callback methods. + + The context. + + + + Gets or sets how and values are formatted when writing JSON text, + and the expected date format when reading JSON text. + The default value is "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK". + + + + + Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . + A null value means there is no maximum. + The default value is null. + + + + + Indicates how JSON text output is formatted. + The default value is . + + + + + Gets or sets how dates are written to JSON text. + The default value is . + + + + + Gets or sets how time zones are handled during serialization and deserialization. + The default value is . + + + + + Gets or sets how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. + The default value is . + + + + + Gets or sets how special floating point numbers, e.g. , + and , + are written as JSON. + The default value is . + + + + + Gets or sets how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. + The default value is . + + + + + Gets or sets how strings are escaped when writing JSON text. + The default value is . + + + + + Gets or sets the culture used when reading JSON. + The default value is . + + + + + Gets a value indicating whether there will be a check for additional content after deserializing an object. + The default value is false. + + + true if there will be a check for additional content after deserializing an object; otherwise, false. + + + + + Initializes a new instance of the class. + + + + + Represents a reader that provides fast, non-cached, forward-only access to JSON text data. + + + + + Asynchronously reads the next JSON token from the source. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous read. The + property returns true if the next token was read successfully; false if there are no more tokens to read. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously reads the next JSON token from the source as a of . + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous read. The + property returns the of . This result will be null at the end of an array. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously reads the next JSON token from the source as a []. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous read. The + property returns the []. This result will be null at the end of an array. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously reads the next JSON token from the source as a of . + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous read. The + property returns the of . This result will be null at the end of an array. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously reads the next JSON token from the source as a of . + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous read. The + property returns the of . This result will be null at the end of an array. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously reads the next JSON token from the source as a of . + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous read. The + property returns the of . This result will be null at the end of an array. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously reads the next JSON token from the source as a of . + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous read. The + property returns the of . This result will be null at the end of an array. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously reads the next JSON token from the source as a of . + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous read. The + property returns the of . This result will be null at the end of an array. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously reads the next JSON token from the source as a . + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous read. The + property returns the . This result will be null at the end of an array. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Initializes a new instance of the class with the specified . + + The containing the JSON data to read. + + + + Gets or sets the reader's property name table. + + + + + Gets or sets the reader's character buffer pool. + + + + + Reads the next JSON token from the underlying . + + + true if the next token was read successfully; false if there are no more tokens to read. + + + + + Reads the next JSON token from the underlying as a of . + + A of . This method will return null at the end of an array. + + + + Reads the next JSON token from the underlying as a of . + + A of . This method will return null at the end of an array. + + + + Reads the next JSON token from the underlying as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the underlying as a []. + + A [] or null if the next JSON token is null. This method will return null at the end of an array. + + + + Reads the next JSON token from the underlying as a of . + + A of . This method will return null at the end of an array. + + + + Reads the next JSON token from the underlying as a of . + + A of . This method will return null at the end of an array. + + + + Reads the next JSON token from the underlying as a of . + + A of . This method will return null at the end of an array. + + + + Reads the next JSON token from the underlying as a of . + + A of . This method will return null at the end of an array. + + + + Changes the reader's state to . + If is set to true, the underlying is also closed. + + + + + Gets a value indicating whether the class can return line information. + + + true if and can be provided; otherwise, false. + + + + + Gets the current line number. + + + The current line number or 0 if no line information is available (for example, returns false). + + + + + Gets the current line position. + + + The current line position or 0 if no line information is available (for example, returns false). + + + + + Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. + + + + + Asynchronously flushes whatever is in the buffer to the destination and also flushes the destination. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes the JSON value delimiter. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes the specified end token. + + The end token to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously closes this writer. + If is set to true, the destination is also closed. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes the end of the current JSON object or array. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes indent characters. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes an indent space. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes raw JSON without changing the writer's state. + + The raw JSON to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a null value. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes the property name of a name/value pair of a JSON object. + + The name of the property. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes the property name of a name/value pair of a JSON object. + + The name of the property. + A flag to indicate whether the text should be escaped when it is written as a JSON property name. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes the beginning of a JSON array. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes the beginning of a JSON object. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes the start of a constructor with the given name. + + The name of the constructor. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes an undefined value. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes the given white space. + + The string of white space characters. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a [] value. + + The [] value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes a comment /*...*/ containing the specified text. + + Text to place inside the comment. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes the end of an array. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes the end of a constructor. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes the end of a JSON object. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Asynchronously writes raw JSON where a value is expected and updates the writer's state. + + The raw JSON to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + Derived classes must override this method to get asynchronous behaviour. Otherwise it will + execute synchronously, returning an already-completed task. + + + + Gets or sets the writer's character array pool. + + + + + Gets or sets how many s to write for each level in the hierarchy when is set to . + + + + + Gets or sets which character to use to quote attribute values. + + + + + Gets or sets which character to use for indenting when is set to . + + + + + Gets or sets a value indicating whether object names will be surrounded with quotes. + + + + + Initializes a new instance of the class using the specified . + + The to write to. + + + + Flushes whatever is in the buffer to the underlying and also flushes the underlying . + + + + + Closes this writer. + If is set to true, the underlying is also closed. + If is set to true, the JSON is auto-completed. + + + + + Writes the beginning of a JSON object. + + + + + Writes the beginning of a JSON array. + + + + + Writes the start of a constructor with the given name. + + The name of the constructor. + + + + Writes the specified end token. + + The end token to write. + + + + Writes the property name of a name/value pair on a JSON object. + + The name of the property. + + + + Writes the property name of a name/value pair on a JSON object. + + The name of the property. + A flag to indicate whether the text should be escaped when it is written as a JSON property name. + + + + Writes indent characters. + + + + + Writes the JSON value delimiter. + + + + + Writes an indent space. + + + + + Writes a value. + An error will raised if the value cannot be written as a single JSON token. + + The value to write. + + + + Writes a null value. + + + + + Writes an undefined value. + + + + + Writes raw JSON. + + The raw JSON to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a of value. + + The of value to write. + + + + Writes a value. + + The value to write. + + + + Writes a of value. + + The of value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a [] value. + + The [] value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a comment /*...*/ containing the specified text. + + Text to place inside the comment. + + + + Writes the given white space. + + The string of white space characters. + + + + Specifies the type of JSON token. + + + + + This is returned by the if a read method has not been called. + + + + + An object start token. + + + + + An array start token. + + + + + A constructor start token. + + + + + An object property name. + + + + + A comment. + + + + + Raw JSON. + + + + + An integer. + + + + + A float. + + + + + A string. + + + + + A boolean. + + + + + A null token. + + + + + An undefined token. + + + + + An object end token. + + + + + An array end token. + + + + + A constructor end token. + + + + + A Date. + + + + + Byte data. + + + + + + Represents a reader that provides validation. + + + JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. + + + + + + Sets an event handler for receiving schema validation errors. + + + + + Gets the text value of the current JSON token. + + + + + + Gets the depth of the current token in the JSON document. + + The depth of the current token in the JSON document. + + + + Gets the path of the current JSON token. + + + + + Gets the quotation mark character used to enclose the value of a string. + + + + + + Gets the type of the current JSON token. + + + + + + Gets the .NET type for the current JSON token. + + + + + + Initializes a new instance of the class that + validates the content returned from the given . + + The to read from while validating. + + + + Gets or sets the schema. + + The schema. + + + + Gets the used to construct this . + + The specified in the constructor. + + + + Changes the reader's state to . + If is set to true, the underlying is also closed. + + + + + Reads the next JSON token from the underlying as a of . + + A of . + + + + Reads the next JSON token from the underlying as a []. + + + A [] or null if the next JSON token is null. + + + + + Reads the next JSON token from the underlying as a of . + + A of . + + + + Reads the next JSON token from the underlying as a of . + + A of . + + + + Reads the next JSON token from the underlying as a of . + + A of . + + + + Reads the next JSON token from the underlying as a . + + A . This method will return null at the end of an array. + + + + Reads the next JSON token from the underlying as a of . + + A of . This method will return null at the end of an array. + + + + Reads the next JSON token from the underlying as a of . + + A of . + + + + Reads the next JSON token from the underlying . + + + true if the next token was read successfully; false if there are no more tokens to read. + + + + + Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. + + + + + Asynchronously closes this writer. + If is set to true, the destination is also closed. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously flushes whatever is in the buffer to the destination and also flushes the destination. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes the specified end token. + + The end token to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes indent characters. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes the JSON value delimiter. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes an indent space. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes raw JSON without changing the writer's state. + + The raw JSON to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes the end of the current JSON object or array. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes the end of an array. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes the end of a constructor. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes the end of a JSON object. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a null value. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes the property name of a name/value pair of a JSON object. + + The name of the property. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes the property name of a name/value pair of a JSON object. + + The name of the property. + A flag to indicate whether the text should be escaped when it is written as a JSON property name. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes the beginning of a JSON array. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a comment /*...*/ containing the specified text. + + Text to place inside the comment. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes raw JSON where a value is expected and updates the writer's state. + + The raw JSON to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes the start of a constructor with the given name. + + The name of the constructor. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes the beginning of a JSON object. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes the current token. + + The to read the token from. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes the current token. + + The to read the token from. + A flag indicating whether the current token's children should be written. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes the token and its value. + + The to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes the token and its value. + + The to write. + + The value to write. + A value is only required for tokens that have an associated value, e.g. the property name for . + null can be passed to the method for tokens that don't have a value, e.g. . + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a [] value. + + The [] value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a value. + + The value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes a of value. + + The of value to write. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes an undefined value. + + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously writes the given white space. + + The string of white space characters. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Asynchronously ets the state of the . + + The being written. + The value being written. + The token to monitor for cancellation requests. The default value is . + A that represents the asynchronous operation. + The default behaviour is to execute synchronously, returning an already-completed task. Derived + classes can override this behaviour for true asynchronicity. + + + + Gets or sets a value indicating whether the destination should be closed when this writer is closed. + + + true to close the destination when this writer is closed; otherwise false. The default is true. + + + + + Gets or sets a value indicating whether the JSON should be auto-completed when this writer is closed. + + + true to auto-complete the JSON when this writer is closed; otherwise false. The default is true. + + + + + Gets the top. + + The top. + + + + Gets the state of the writer. + + + + + Gets the path of the writer. + + + + + Gets or sets a value indicating how JSON text output should be formatted. + + + + + Gets or sets how dates are written to JSON text. + + + + + Gets or sets how time zones are handled when writing JSON text. + + + + + Gets or sets how strings are escaped when writing JSON text. + + + + + Gets or sets how special floating point numbers, e.g. , + and , + are written to JSON text. + + + + + Gets or sets how and values are formatted when writing JSON text. + + + + + Gets or sets the culture used when writing JSON. Defaults to . + + + + + Initializes a new instance of the class. + + + + + Flushes whatever is in the buffer to the destination and also flushes the destination. + + + + + Closes this writer. + If is set to true, the destination is also closed. + If is set to true, the JSON is auto-completed. + + + + + Writes the beginning of a JSON object. + + + + + Writes the end of a JSON object. + + + + + Writes the beginning of a JSON array. + + + + + Writes the end of an array. + + + + + Writes the start of a constructor with the given name. + + The name of the constructor. + + + + Writes the end constructor. + + + + + Writes the property name of a name/value pair of a JSON object. + + The name of the property. + + + + Writes the property name of a name/value pair of a JSON object. + + The name of the property. + A flag to indicate whether the text should be escaped when it is written as a JSON property name. + + + + Writes the end of the current JSON object or array. + + + + + Writes the current token and its children. + + The to read the token from. + + + + Writes the current token. + + The to read the token from. + A flag indicating whether the current token's children should be written. + + + + Writes the token and its value. + + The to write. + + The value to write. + A value is only required for tokens that have an associated value, e.g. the property name for . + null can be passed to the method for tokens that don't have a value, e.g. . + + + + + Writes the token. + + The to write. + + + + Writes the specified end token. + + The end token to write. + + + + Writes indent characters. + + + + + Writes the JSON value delimiter. + + + + + Writes an indent space. + + + + + Writes a null value. + + + + + Writes an undefined value. + + + + + Writes raw JSON without changing the writer's state. + + The raw JSON to write. + + + + Writes raw JSON where a value is expected and updates the writer's state. + + The raw JSON to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a of value. + + The of value to write. + + + + Writes a of value. + + The of value to write. + + + + Writes a of value. + + The of value to write. + + + + Writes a of value. + + The of value to write. + + + + Writes a of value. + + The of value to write. + + + + Writes a of value. + + The of value to write. + + + + Writes a of value. + + The of value to write. + + + + Writes a of value. + + The of value to write. + + + + Writes a of value. + + The of value to write. + + + + Writes a of value. + + The of value to write. + + + + Writes a of value. + + The of value to write. + + + + Writes a of value. + + The of value to write. + + + + Writes a of value. + + The of value to write. + + + + Writes a of value. + + The of value to write. + + + + Writes a of value. + + The of value to write. + + + + Writes a of value. + + The of value to write. + + + + Writes a of value. + + The of value to write. + + + + Writes a [] value. + + The [] value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + An error will raised if the value cannot be written as a single JSON token. + + The value to write. + + + + Writes a comment /*...*/ containing the specified text. + + Text to place inside the comment. + + + + Writes the given white space. + + The string of white space characters. + + + + Releases unmanaged and - optionally - managed resources. + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Sets the state of the . + + The being written. + The value being written. + + + + The exception thrown when an error occurs while writing JSON text. + + + + + Gets the path to the JSON where the error occurred. + + The path to the JSON where the error occurred. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class + with a specified error message. + + The error message that explains the reason for the exception. + + + + Initializes a new instance of the class + with a specified error message and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, or null if no inner exception is specified. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + Initializes a new instance of the class + with a specified error message, JSON path and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The path to the JSON where the error occurred. + The exception that is the cause of the current exception, or null if no inner exception is specified. + + + + Specifies how JSON comments are handled when loading JSON. + + + + + Ignore comments. + + + + + Load comments as a with type . + + + + + Specifies how duplicate property names are handled when loading JSON. + + + + + Replace the existing value when there is a duplicate property. The value of the last property in the JSON object will be used. + + + + + Ignore the new value when there is a duplicate property. The value of the first property in the JSON object will be used. + + + + + Throw a when a duplicate property is encountered. + + + + + Contains the LINQ to JSON extension methods. + + + + + Returns a collection of tokens that contains the ancestors of every token in the source collection. + + The type of the objects in source, constrained to . + An of that contains the source collection. + An of that contains the ancestors of every token in the source collection. + + + + Returns a collection of tokens that contains every token in the source collection, and the ancestors of every token in the source collection. + + The type of the objects in source, constrained to . + An of that contains the source collection. + An of that contains every token in the source collection, the ancestors of every token in the source collection. + + + + Returns a collection of tokens that contains the descendants of every token in the source collection. + + The type of the objects in source, constrained to . + An of that contains the source collection. + An of that contains the descendants of every token in the source collection. + + + + Returns a collection of tokens that contains every token in the source collection, and the descendants of every token in the source collection. + + The type of the objects in source, constrained to . + An of that contains the source collection. + An of that contains every token in the source collection, and the descendants of every token in the source collection. + + + + Returns a collection of child properties of every object in the source collection. + + An of that contains the source collection. + An of that contains the properties of every object in the source collection. + + + + Returns a collection of child values of every object in the source collection with the given key. + + An of that contains the source collection. + The token key. + An of that contains the values of every token in the source collection with the given key. + + + + Returns a collection of child values of every object in the source collection. + + An of that contains the source collection. + An of that contains the values of every token in the source collection. + + + + Returns a collection of converted child values of every object in the source collection with the given key. + + The type to convert the values to. + An of that contains the source collection. + The token key. + An that contains the converted values of every token in the source collection with the given key. + + + + Returns a collection of converted child values of every object in the source collection. + + The type to convert the values to. + An of that contains the source collection. + An that contains the converted values of every token in the source collection. + + + + Converts the value. + + The type to convert the value to. + A cast as a of . + A converted value. + + + + Converts the value. + + The source collection type. + The type to convert the value to. + A cast as a of . + A converted value. + + + + Returns a collection of child tokens of every array in the source collection. + + The source collection type. + An of that contains the source collection. + An of that contains the values of every token in the source collection. + + + + Returns a collection of converted child tokens of every array in the source collection. + + An of that contains the source collection. + The type to convert the values to. + The source collection type. + An that contains the converted values of every token in the source collection. + + + + Returns the input typed as . + + An of that contains the source collection. + The input typed as . + + + + Returns the input typed as . + + The source collection type. + An of that contains the source collection. + The input typed as . + + + + Represents a collection of objects. + + The type of token. + + + + Gets the of with the specified key. + + + + + + Represents a JSON array. + + + + + + + + Writes this token to a asynchronously. + + A into which this method will write. + The token to monitor for cancellation requests. + A collection of which will be used when writing the token. + A that represents the asynchronous write operation. + + + + Asynchronously loads a from a . + + A that will be read for the content of the . + If this is null, default load settings will be used. + The token to monitor for cancellation requests. The default value is . + A representing the asynchronous load. The property contains the JSON that was read from the specified . + + + + Asynchronously loads a from a . + + A that will be read for the content of the . + The used to load the JSON. + If this is null, default load settings will be used. + The token to monitor for cancellation requests. The default value is . + A representing the asynchronous load. The property contains the JSON that was read from the specified . + + + + Gets the container's children tokens. + + The container's children tokens. + + + + Gets the node type for this . + + The type. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class from another object. + + A object to copy from. + + + + Initializes a new instance of the class with the specified content. + + The contents of the array. + + + + Initializes a new instance of the class with the specified content. + + The contents of the array. + + + + Loads an from a . + + A that will be read for the content of the . + A that contains the JSON that was read from the specified . + + + + Loads an from a . + + A that will be read for the content of the . + The used to load the JSON. + If this is null, default load settings will be used. + A that contains the JSON that was read from the specified . + + + + Load a from a string that contains JSON. + + A that contains JSON. + A populated from the string that contains JSON. + + + + + + + Load a from a string that contains JSON. + + A that contains JSON. + The used to load the JSON. + If this is null, default load settings will be used. + A populated from the string that contains JSON. + + + + + + + Creates a from an object. + + The object that will be used to create . + A with the values of the specified object. + + + + Creates a from an object. + + The object that will be used to create . + The that will be used to read the object. + A with the values of the specified object. + + + + Writes this token to a . + + A into which this method will write. + A collection of which will be used when writing the token. + + + + Gets the with the specified key. + + The with the specified key. + + + + Gets or sets the at the specified index. + + + + + + Determines the index of a specific item in the . + + The object to locate in the . + + The index of if found in the list; otherwise, -1. + + + + + Inserts an item to the at the specified index. + + The zero-based index at which should be inserted. + The object to insert into the . + + is not a valid index in the . + + + + + Removes the item at the specified index. + + The zero-based index of the item to remove. + + is not a valid index in the . + + + + + Returns an enumerator that iterates through the collection. + + + A of that can be used to iterate through the collection. + + + + + Adds an item to the . + + The object to add to the . + + + + Removes all items from the . + + + + + Determines whether the contains a specific value. + + The object to locate in the . + + true if is found in the ; otherwise, false. + + + + + Copies the elements of the to an array, starting at a particular array index. + + The array. + Index of the array. + + + + Gets a value indicating whether the is read-only. + + true if the is read-only; otherwise, false. + + + + Removes the first occurrence of a specific object from the . + + The object to remove from the . + + true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . + + + + + Represents a JSON constructor. + + + + + Writes this token to a asynchronously. + + A into which this method will write. + The token to monitor for cancellation requests. + A collection of which will be used when writing the token. + A that represents the asynchronous write operation. + + + + Asynchronously loads a from a . + + A that will be read for the content of the . + The token to monitor for cancellation requests. The default value is . + + A that represents the asynchronous load. The + property returns a that contains the JSON that was read from the specified . + + + + Asynchronously loads a from a . + + A that will be read for the content of the . + The used to load the JSON. + If this is null, default load settings will be used. + The token to monitor for cancellation requests. The default value is . + + A that represents the asynchronous load. The + property returns a that contains the JSON that was read from the specified . + + + + Gets the container's children tokens. + + The container's children tokens. + + + + Gets or sets the name of this constructor. + + The constructor name. + + + + Gets the node type for this . + + The type. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class from another object. + + A object to copy from. + + + + Initializes a new instance of the class with the specified name and content. + + The constructor name. + The contents of the constructor. + + + + Initializes a new instance of the class with the specified name and content. + + The constructor name. + The contents of the constructor. + + + + Initializes a new instance of the class with the specified name. + + The constructor name. + + + + Writes this token to a . + + A into which this method will write. + A collection of which will be used when writing the token. + + + + Gets the with the specified key. + + The with the specified key. + + + + Loads a from a . + + A that will be read for the content of the . + A that contains the JSON that was read from the specified . + + + + Loads a from a . + + A that will be read for the content of the . + The used to load the JSON. + If this is null, default load settings will be used. + A that contains the JSON that was read from the specified . + + + + Represents a token that can contain other tokens. + + + + + Occurs when the list changes or an item in the list changes. + + + + + Occurs before an item is added to the collection. + + + + + Occurs when the items list of the collection has changed, or the collection is reset. + + + + + Gets the container's children tokens. + + The container's children tokens. + + + + Raises the event. + + The instance containing the event data. + + + + Raises the event. + + The instance containing the event data. + + + + Raises the event. + + The instance containing the event data. + + + + Gets a value indicating whether this token has child tokens. + + + true if this token has child values; otherwise, false. + + + + + Get the first child token of this token. + + + A containing the first child token of the . + + + + + Get the last child token of this token. + + + A containing the last child token of the . + + + + + Returns a collection of the child tokens of this token, in document order. + + + An of containing the child tokens of this , in document order. + + + + + Returns a collection of the child values of this token, in document order. + + The type to convert the values to. + + A containing the child values of this , in document order. + + + + + Returns a collection of the descendant tokens for this token in document order. + + An of containing the descendant tokens of the . + + + + Returns a collection of the tokens that contain this token, and all descendant tokens of this token, in document order. + + An of containing this token, and all the descendant tokens of the . + + + + Adds the specified content as children of this . + + The content to be added. + + + + Adds the specified content as the first children of this . + + The content to be added. + + + + Creates a that can be used to add tokens to the . + + A that is ready to have content written to it. + + + + Replaces the child nodes of this token with the specified content. + + The content. + + + + Removes the child nodes from this token. + + + + + Merge the specified content into this . + + The content to be merged. + + + + Merge the specified content into this using . + + The content to be merged. + The used to merge the content. + + + + Gets the count of child JSON tokens. + + The count of child JSON tokens. + + + + Represents a collection of objects. + + The type of token. + + + + An empty collection of objects. + + + + + Initializes a new instance of the struct. + + The enumerable. + + + + Returns an enumerator that can be used to iterate through the collection. + + + A that can be used to iterate through the collection. + + + + + Gets the of with the specified key. + + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Represents a JSON object. + + + + + + + + Writes this token to a asynchronously. + + A into which this method will write. + The token to monitor for cancellation requests. + A collection of which will be used when writing the token. + A that represents the asynchronous write operation. + + + + Asynchronously loads a from a . + + A that will be read for the content of the . + The token to monitor for cancellation requests. The default value is . + + A that represents the asynchronous load. The + property returns a that contains the JSON that was read from the specified . + + + + Asynchronously loads a from a . + + A that will be read for the content of the . + The used to load the JSON. + If this is null, default load settings will be used. + The token to monitor for cancellation requests. The default value is . + + A that represents the asynchronous load. The + property returns a that contains the JSON that was read from the specified . + + + + Gets the container's children tokens. + + The container's children tokens. + + + + Occurs when a property value changes. + + + + + Occurs when a property value is changing. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class from another object. + + A object to copy from. + + + + Initializes a new instance of the class with the specified content. + + The contents of the object. + + + + Initializes a new instance of the class with the specified content. + + The contents of the object. + + + + Gets the node type for this . + + The type. + + + + Gets an of of this object's properties. + + An of of this object's properties. + + + + Gets a with the specified name. + + The property name. + A with the specified name or null. + + + + Gets the with the specified name. + The exact name will be searched for first and if no matching property is found then + the will be used to match a property. + + The property name. + One of the enumeration values that specifies how the strings will be compared. + A matched with the specified name or null. + + + + Gets a of of this object's property values. + + A of of this object's property values. + + + + Gets the with the specified key. + + The with the specified key. + + + + Gets or sets the with the specified property name. + + + + + + Loads a from a . + + A that will be read for the content of the . + A that contains the JSON that was read from the specified . + + is not valid JSON. + + + + + Loads a from a . + + A that will be read for the content of the . + The used to load the JSON. + If this is null, default load settings will be used. + A that contains the JSON that was read from the specified . + + is not valid JSON. + + + + + Load a from a string that contains JSON. + + A that contains JSON. + A populated from the string that contains JSON. + + is not valid JSON. + + + + + + + + Load a from a string that contains JSON. + + A that contains JSON. + The used to load the JSON. + If this is null, default load settings will be used. + A populated from the string that contains JSON. + + is not valid JSON. + + + + + + + + Creates a from an object. + + The object that will be used to create . + A with the values of the specified object. + + + + Creates a from an object. + + The object that will be used to create . + The that will be used to read the object. + A with the values of the specified object. + + + + Writes this token to a . + + A into which this method will write. + A collection of which will be used when writing the token. + + + + Gets the with the specified property name. + + Name of the property. + The with the specified property name. + + + + Gets the with the specified property name. + The exact property name will be searched for first and if no matching property is found then + the will be used to match a property. + + Name of the property. + One of the enumeration values that specifies how the strings will be compared. + The with the specified property name. + + + + Tries to get the with the specified property name. + The exact property name will be searched for first and if no matching property is found then + the will be used to match a property. + + Name of the property. + The value. + One of the enumeration values that specifies how the strings will be compared. + true if a value was successfully retrieved; otherwise, false. + + + + Adds the specified property name. + + Name of the property. + The value. + + + + Determines whether the JSON object has the specified property name. + + Name of the property. + true if the JSON object has the specified property name; otherwise, false. + + + + Removes the property with the specified name. + + Name of the property. + true if item was successfully removed; otherwise, false. + + + + Tries to get the with the specified property name. + + Name of the property. + The value. + true if a value was successfully retrieved; otherwise, false. + + + + Returns an enumerator that can be used to iterate through the collection. + + + A that can be used to iterate through the collection. + + + + + Raises the event with the provided arguments. + + Name of the property. + + + + Raises the event with the provided arguments. + + Name of the property. + + + + Returns the responsible for binding operations performed on this object. + + The expression tree representation of the runtime value. + + The to bind this object. + + + + + Represents a JSON property. + + + + + Writes this token to a asynchronously. + + A into which this method will write. + The token to monitor for cancellation requests. + A collection of which will be used when writing the token. + A that represents the asynchronous write operation. + + + + Asynchronously loads a from a . + + A that will be read for the content of the . + The token to monitor for cancellation requests. The default value is . + A representing the asynchronous creation. The + property returns a that contains the JSON that was read from the specified . + + + + Asynchronously loads a from a . + + A that will be read for the content of the . + The used to load the JSON. + If this is null, default load settings will be used. + The token to monitor for cancellation requests. The default value is . + A representing the asynchronous creation. The + property returns a that contains the JSON that was read from the specified . + + + + Gets the container's children tokens. + + The container's children tokens. + + + + Gets the property name. + + The property name. + + + + Gets or sets the property value. + + The property value. + + + + Initializes a new instance of the class from another object. + + A object to copy from. + + + + Gets the node type for this . + + The type. + + + + Initializes a new instance of the class. + + The property name. + The property content. + + + + Initializes a new instance of the class. + + The property name. + The property content. + + + + Writes this token to a . + + A into which this method will write. + A collection of which will be used when writing the token. + + + + Loads a from a . + + A that will be read for the content of the . + A that contains the JSON that was read from the specified . + + + + Loads a from a . + + A that will be read for the content of the . + The used to load the JSON. + If this is null, default load settings will be used. + A that contains the JSON that was read from the specified . + + + + Represents a view of a . + + + + + Initializes a new instance of the class. + + The name. + + + + When overridden in a derived class, returns whether resetting an object changes its value. + + + true if resetting the component changes its value; otherwise, false. + + The component to test for reset capability. + + + + When overridden in a derived class, gets the current value of the property on a component. + + + The value of a property for a given component. + + The component with the property for which to retrieve the value. + + + + When overridden in a derived class, resets the value for this property of the component to the default value. + + The component with the property value that is to be reset to the default value. + + + + When overridden in a derived class, sets the value of the component to a different value. + + The component with the property value that is to be set. + The new value. + + + + When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted. + + + true if the property should be persisted; otherwise, false. + + The component with the property to be examined for persistence. + + + + When overridden in a derived class, gets the type of the component this property is bound to. + + + A that represents the type of component this property is bound to. + When the or + + methods are invoked, the object specified might be an instance of this type. + + + + + When overridden in a derived class, gets a value indicating whether this property is read-only. + + + true if the property is read-only; otherwise, false. + + + + + When overridden in a derived class, gets the type of the property. + + + A that represents the type of the property. + + + + + Gets the hash code for the name of the member. + + + + The hash code for the name of the member. + + + + + Represents a raw JSON string. + + + + + Asynchronously creates an instance of with the content of the reader's current token. + + The reader. + The token to monitor for cancellation requests. The default value is . + A representing the asynchronous creation. The + property returns an instance of with the content of the reader's current token. + + + + Initializes a new instance of the class from another object. + + A object to copy from. + + + + Initializes a new instance of the class. + + The raw json. + + + + Creates an instance of with the content of the reader's current token. + + The reader. + An instance of with the content of the reader's current token. + + + + Specifies the settings used when loading JSON. + + + + + Initializes a new instance of the class. + + + + + Gets or sets how JSON comments are handled when loading JSON. + The default value is . + + The JSON comment handling. + + + + Gets or sets how JSON line info is handled when loading JSON. + The default value is . + + The JSON line info handling. + + + + Gets or sets how duplicate property names in JSON objects are handled when loading JSON. + The default value is . + + The JSON duplicate property name handling. + + + + Specifies the settings used when merging JSON. + + + + + Initializes a new instance of the class. + + + + + Gets or sets the method used when merging JSON arrays. + + The method used when merging JSON arrays. + + + + Gets or sets how null value properties are merged. + + How null value properties are merged. + + + + Gets or sets the comparison used to match property names while merging. + The exact property name will be searched for first and if no matching property is found then + the will be used to match a property. + + The comparison used to match property names while merging. + + + + Represents an abstract JSON token. + + + + + Writes this token to a asynchronously. + + A into which this method will write. + The token to monitor for cancellation requests. + A collection of which will be used when writing the token. + A that represents the asynchronous write operation. + + + + Writes this token to a asynchronously. + + A into which this method will write. + A collection of which will be used when writing the token. + A that represents the asynchronous write operation. + + + + Asynchronously creates a from a . + + An positioned at the token to read into this . + The token to monitor for cancellation requests. The default value is . + + A that represents the asynchronous creation. The + property returns a that contains + the token and its descendant tokens + that were read from the reader. The runtime type of the token is determined + by the token type of the first token encountered in the reader. + + + + + Asynchronously creates a from a . + + An positioned at the token to read into this . + The used to load the JSON. + If this is null, default load settings will be used. + The token to monitor for cancellation requests. The default value is . + + A that represents the asynchronous creation. The + property returns a that contains + the token and its descendant tokens + that were read from the reader. The runtime type of the token is determined + by the token type of the first token encountered in the reader. + + + + + Asynchronously creates a from a . + + A positioned at the token to read into this . + The token to monitor for cancellation requests. The default value is . + + A that represents the asynchronous creation. The + property returns a that contains the token and its descendant tokens + that were read from the reader. The runtime type of the token is determined + by the token type of the first token encountered in the reader. + + + + + Asynchronously creates a from a . + + A positioned at the token to read into this . + The used to load the JSON. + If this is null, default load settings will be used. + The token to monitor for cancellation requests. The default value is . + + A that represents the asynchronous creation. The + property returns a that contains the token and its descendant tokens + that were read from the reader. The runtime type of the token is determined + by the token type of the first token encountered in the reader. + + + + + Gets a comparer that can compare two tokens for value equality. + + A that can compare two nodes for value equality. + + + + Gets or sets the parent. + + The parent. + + + + Gets the root of this . + + The root of this . + + + + Gets the node type for this . + + The type. + + + + Gets a value indicating whether this token has child tokens. + + + true if this token has child values; otherwise, false. + + + + + Compares the values of two tokens, including the values of all descendant tokens. + + The first to compare. + The second to compare. + true if the tokens are equal; otherwise false. + + + + Gets the next sibling token of this node. + + The that contains the next sibling token. + + + + Gets the previous sibling token of this node. + + The that contains the previous sibling token. + + + + Gets the path of the JSON token. + + + + + Adds the specified content immediately after this token. + + A content object that contains simple content or a collection of content objects to be added after this token. + + + + Adds the specified content immediately before this token. + + A content object that contains simple content or a collection of content objects to be added before this token. + + + + Returns a collection of the ancestor tokens of this token. + + A collection of the ancestor tokens of this token. + + + + Returns a collection of tokens that contain this token, and the ancestors of this token. + + A collection of tokens that contain this token, and the ancestors of this token. + + + + Returns a collection of the sibling tokens after this token, in document order. + + A collection of the sibling tokens after this tokens, in document order. + + + + Returns a collection of the sibling tokens before this token, in document order. + + A collection of the sibling tokens before this token, in document order. + + + + Gets the with the specified key. + + The with the specified key. + + + + Gets the with the specified key converted to the specified type. + + The type to convert the token to. + The token key. + The converted token value. + + + + Get the first child token of this token. + + A containing the first child token of the . + + + + Get the last child token of this token. + + A containing the last child token of the . + + + + Returns a collection of the child tokens of this token, in document order. + + An of containing the child tokens of this , in document order. + + + + Returns a collection of the child tokens of this token, in document order, filtered by the specified type. + + The type to filter the child tokens on. + A containing the child tokens of this , in document order. + + + + Returns a collection of the child values of this token, in document order. + + The type to convert the values to. + A containing the child values of this , in document order. + + + + Removes this token from its parent. + + + + + Replaces this token with the specified token. + + The value. + + + + Writes this token to a . + + A into which this method will write. + A collection of which will be used when writing the token. + + + + Returns the indented JSON for this token. + + + ToString() returns a non-JSON string value for tokens with a type of . + If you want the JSON for all token types then you should use . + + + The indented JSON for this token. + + + + + Returns the JSON for this token using the given formatting and converters. + + Indicates how the output should be formatted. + A collection of s which will be used when writing the token. + The JSON for this token using the given formatting and converters. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to of . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to of . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to of . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to of . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to of . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to of . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to of . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to of . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to of . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to of . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to of . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to of . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to of . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to of . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to of . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to of . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to of . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to []. + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to of . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to of . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from of to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from of to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from of to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from of to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from of to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from of to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from of to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from of to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from of to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from of to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from of to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from of to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from of to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from of to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from of to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from [] to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from of to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from to . + + The value to create a from. + The initialized with the specified value. + + + + Performs an implicit conversion from of to . + + The value to create a from. + The initialized with the specified value. + + + + Creates a for this token. + + A that can be used to read this token and its descendants. + + + + Creates a from an object. + + The object that will be used to create . + A with the value of the specified object. + + + + Creates a from an object using the specified . + + The object that will be used to create . + The that will be used when reading the object. + A with the value of the specified object. + + + + Creates an instance of the specified .NET type from the . + + The object type that the token will be deserialized to. + The new object created from the JSON value. + + + + Creates an instance of the specified .NET type from the . + + The object type that the token will be deserialized to. + The new object created from the JSON value. + + + + Creates an instance of the specified .NET type from the using the specified . + + The object type that the token will be deserialized to. + The that will be used when creating the object. + The new object created from the JSON value. + + + + Creates an instance of the specified .NET type from the using the specified . + + The object type that the token will be deserialized to. + The that will be used when creating the object. + The new object created from the JSON value. + + + + Creates a from a . + + A positioned at the token to read into this . + + A that contains the token and its descendant tokens + that were read from the reader. The runtime type of the token is determined + by the token type of the first token encountered in the reader. + + + + + Creates a from a . + + An positioned at the token to read into this . + The used to load the JSON. + If this is null, default load settings will be used. + + A that contains the token and its descendant tokens + that were read from the reader. The runtime type of the token is determined + by the token type of the first token encountered in the reader. + + + + + Load a from a string that contains JSON. + + A that contains JSON. + A populated from the string that contains JSON. + + + + Load a from a string that contains JSON. + + A that contains JSON. + The used to load the JSON. + If this is null, default load settings will be used. + A populated from the string that contains JSON. + + + + Creates a from a . + + A positioned at the token to read into this . + The used to load the JSON. + If this is null, default load settings will be used. + + A that contains the token and its descendant tokens + that were read from the reader. The runtime type of the token is determined + by the token type of the first token encountered in the reader. + + + + + Creates a from a . + + A positioned at the token to read into this . + + A that contains the token and its descendant tokens + that were read from the reader. The runtime type of the token is determined + by the token type of the first token encountered in the reader. + + + + + Selects a using a JSONPath expression. Selects the token that matches the object path. + + + A that contains a JSONPath expression. + + A , or null. + + + + Selects a using a JSONPath expression. Selects the token that matches the object path. + + + A that contains a JSONPath expression. + + A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. + A . + + + + Selects a collection of elements using a JSONPath expression. + + + A that contains a JSONPath expression. + + An of that contains the selected elements. + + + + Selects a collection of elements using a JSONPath expression. + + + A that contains a JSONPath expression. + + A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. + An of that contains the selected elements. + + + + Returns the responsible for binding operations performed on this object. + + The expression tree representation of the runtime value. + + The to bind this object. + + + + + Returns the responsible for binding operations performed on this object. + + The expression tree representation of the runtime value. + + The to bind this object. + + + + + Creates a new instance of the . All child tokens are recursively cloned. + + A new instance of the . + + + + Adds an object to the annotation list of this . + + The annotation to add. + + + + Get the first annotation object of the specified type from this . + + The type of the annotation to retrieve. + The first annotation object that matches the specified type, or null if no annotation is of the specified type. + + + + Gets the first annotation object of the specified type from this . + + The of the annotation to retrieve. + The first annotation object that matches the specified type, or null if no annotation is of the specified type. + + + + Gets a collection of annotations of the specified type for this . + + The type of the annotations to retrieve. + An that contains the annotations for this . + + + + Gets a collection of annotations of the specified type for this . + + The of the annotations to retrieve. + An of that contains the annotations that match the specified type for this . + + + + Removes the annotations of the specified type from this . + + The type of annotations to remove. + + + + Removes the annotations of the specified type from this . + + The of annotations to remove. + + + + Compares tokens to determine whether they are equal. + + + + + Determines whether the specified objects are equal. + + The first object of type to compare. + The second object of type to compare. + + true if the specified objects are equal; otherwise, false. + + + + + Returns a hash code for the specified object. + + The for which a hash code is to be returned. + A hash code for the specified object. + The type of is a reference type and is null. + + + + Represents a reader that provides fast, non-cached, forward-only access to serialized JSON data. + + + + + Gets the at the reader's current position. + + + + + Initializes a new instance of the class. + + The token to read from. + + + + Initializes a new instance of the class. + + The token to read from. + The initial path of the token. It is prepended to the returned . + + + + Reads the next JSON token from the underlying . + + + true if the next token was read successfully; false if there are no more tokens to read. + + + + + Gets the path of the current JSON token. + + + + + Specifies the type of token. + + + + + No token type has been set. + + + + + A JSON object. + + + + + A JSON array. + + + + + A JSON constructor. + + + + + A JSON object property. + + + + + A comment. + + + + + An integer value. + + + + + A float value. + + + + + A string value. + + + + + A boolean value. + + + + + A null value. + + + + + An undefined value. + + + + + A date value. + + + + + A raw JSON value. + + + + + A collection of bytes value. + + + + + A Guid value. + + + + + A Uri value. + + + + + A TimeSpan value. + + + + + Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. + + + + + Gets the at the writer's current position. + + + + + Gets the token being written. + + The token being written. + + + + Initializes a new instance of the class writing to the given . + + The container being written to. + + + + Initializes a new instance of the class. + + + + + Flushes whatever is in the buffer to the underlying . + + + + + Closes this writer. + If is set to true, the JSON is auto-completed. + + + Setting to true has no additional effect, since the underlying is a type that cannot be closed. + + + + + Writes the beginning of a JSON object. + + + + + Writes the beginning of a JSON array. + + + + + Writes the start of a constructor with the given name. + + The name of the constructor. + + + + Writes the end. + + The token. + + + + Writes the property name of a name/value pair on a JSON object. + + The name of the property. + + + + Writes a value. + An error will be raised if the value cannot be written as a single JSON token. + + The value to write. + + + + Writes a null value. + + + + + Writes an undefined value. + + + + + Writes raw JSON. + + The raw JSON to write. + + + + Writes a comment /*...*/ containing the specified text. + + Text to place inside the comment. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a [] value. + + The [] value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Writes a value. + + The value to write. + + + + Represents a value in JSON (string, integer, date, etc). + + + + + Writes this token to a asynchronously. + + A into which this method will write. + The token to monitor for cancellation requests. + A collection of which will be used when writing the token. + A that represents the asynchronous write operation. + + + + Initializes a new instance of the class from another object. + + A object to copy from. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Initializes a new instance of the class with the given value. + + The value. + + + + Gets a value indicating whether this token has child tokens. + + + true if this token has child values; otherwise, false. + + + + + Creates a comment with the given value. + + The value. + A comment with the given value. + + + + Creates a string with the given value. + + The value. + A string with the given value. + + + + Creates a null value. + + A null value. + + + + Creates a undefined value. + + A undefined value. + + + + Gets the node type for this . + + The type. + + + + Gets or sets the underlying token value. + + The underlying token value. + + + + Writes this token to a . + + A into which this method will write. + A collection of s which will be used when writing the token. + + + + Indicates whether the current object is equal to another object of the same type. + + + true if the current object is equal to the parameter; otherwise, false. + + An object to compare with this object. + + + + Determines whether the specified is equal to the current . + + The to compare with the current . + + true if the specified is equal to the current ; otherwise, false. + + + + + Serves as a hash function for a particular type. + + + A hash code for the current . + + + + + Returns a that represents this instance. + + + ToString() returns a non-JSON string value for tokens with a type of . + If you want the JSON for all token types then you should use . + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Returns the responsible for binding operations performed on this object. + + The expression tree representation of the runtime value. + + The to bind this object. + + + + + Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. + + An object to compare with this instance. + + A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: + Value + Meaning + Less than zero + This instance is less than . + Zero + This instance is equal to . + Greater than zero + This instance is greater than . + + + is not of the same type as this instance. + + + + + Specifies how line information is handled when loading JSON. + + + + + Ignore line information. + + + + + Load line information. + + + + + Specifies how JSON arrays are merged together. + + + + Concatenate arrays. + + + Union arrays, skipping items that already exist. + + + Replace all array items. + + + Merge array items together, matched by index. + + + + Specifies how null value properties are merged. + + + + + The content's null value properties will be ignored during merging. + + + + + The content's null value properties will be merged. + + + + + Specifies the member serialization options for the . + + + + + All public members are serialized by default. Members can be excluded using or . + This is the default member serialization mode. + + + + + Only members marked with or are serialized. + This member serialization mode can also be set by marking the class with . + + + + + All public and private fields are serialized. Members can be excluded using or . + This member serialization mode can also be set by marking the class with + and setting IgnoreSerializableAttribute on to false. + + + + + Specifies metadata property handling options for the . + + + + + Read metadata properties located at the start of a JSON object. + + + + + Read metadata properties located anywhere in a JSON object. Note that this setting will impact performance. + + + + + Do not try to read metadata properties. + + + + + Specifies missing member handling options for the . + + + + + Ignore a missing member and do not attempt to deserialize it. + + + + + Throw a when a missing member is encountered during deserialization. + + + + + Specifies null value handling options for the . + + + + + + + + + Include null values when serializing and deserializing objects. + + + + + Ignore null values when serializing and deserializing objects. + + + + + Specifies how object creation is handled by the . + + + + + Reuse existing objects, create new objects when needed. + + + + + Only reuse existing objects. + + + + + Always create new objects. + + + + + Specifies reference handling options for the . + Note that references cannot be preserved when a value is set via a non-default constructor such as types that implement . + + + + + + + + Do not preserve references when serializing types. + + + + + Preserve references when serializing into a JSON object structure. + + + + + Preserve references when serializing into a JSON array structure. + + + + + Preserve references when serializing. + + + + + Specifies reference loop handling options for the . + + + + + Throw a when a loop is encountered. + + + + + Ignore loop references and do not serialize. + + + + + Serialize loop references. + + + + + Indicating whether a property is required. + + + + + The property is not required. The default state. + + + + + The property must be defined in JSON but can be a null value. + + + + + The property must be defined in JSON and cannot be a null value. + + + + + The property is not required but it cannot be a null value. + + + + + + Contains the JSON schema extension methods. + + + JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. + + + + + + + Determines whether the is valid. + + + JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. + + + The source to test. + The schema to test with. + + true if the specified is valid; otherwise, false. + + + + + + Determines whether the is valid. + + + JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. + + + The source to test. + The schema to test with. + When this method returns, contains any error messages generated while validating. + + true if the specified is valid; otherwise, false. + + + + + + Validates the specified . + + + JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. + + + The source to test. + The schema to test with. + + + + + Validates the specified . + + + JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. + + + The source to test. + The schema to test with. + The validation event handler. + + + + + An in-memory representation of a JSON Schema. + + + JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. + + + + + + Gets or sets the id. + + + + + Gets or sets the title. + + + + + Gets or sets whether the object is required. + + + + + Gets or sets whether the object is read-only. + + + + + Gets or sets whether the object is visible to users. + + + + + Gets or sets whether the object is transient. + + + + + Gets or sets the description of the object. + + + + + Gets or sets the types of values allowed by the object. + + The type. + + + + Gets or sets the pattern. + + The pattern. + + + + Gets or sets the minimum length. + + The minimum length. + + + + Gets or sets the maximum length. + + The maximum length. + + + + Gets or sets a number that the value should be divisible by. + + A number that the value should be divisible by. + + + + Gets or sets the minimum. + + The minimum. + + + + Gets or sets the maximum. + + The maximum. + + + + Gets or sets a flag indicating whether the value can not equal the number defined by the minimum attribute (). + + A flag indicating whether the value can not equal the number defined by the minimum attribute (). + + + + Gets or sets a flag indicating whether the value can not equal the number defined by the maximum attribute (). + + A flag indicating whether the value can not equal the number defined by the maximum attribute (). + + + + Gets or sets the minimum number of items. + + The minimum number of items. + + + + Gets or sets the maximum number of items. + + The maximum number of items. + + + + Gets or sets the of items. + + The of items. + + + + Gets or sets a value indicating whether items in an array are validated using the instance at their array position from . + + + true if items are validated using their array position; otherwise, false. + + + + + Gets or sets the of additional items. + + The of additional items. + + + + Gets or sets a value indicating whether additional items are allowed. + + + true if additional items are allowed; otherwise, false. + + + + + Gets or sets whether the array items must be unique. + + + + + Gets or sets the of properties. + + The of properties. + + + + Gets or sets the of additional properties. + + The of additional properties. + + + + Gets or sets the pattern properties. + + The pattern properties. + + + + Gets or sets a value indicating whether additional properties are allowed. + + + true if additional properties are allowed; otherwise, false. + + + + + Gets or sets the required property if this property is present. + + The required property if this property is present. + + + + Gets or sets the a collection of valid enum values allowed. + + A collection of valid enum values allowed. + + + + Gets or sets disallowed types. + + The disallowed types. + + + + Gets or sets the default value. + + The default value. + + + + Gets or sets the collection of that this schema extends. + + The collection of that this schema extends. + + + + Gets or sets the format. + + The format. + + + + Initializes a new instance of the class. + + + + + Reads a from the specified . + + The containing the JSON Schema to read. + The object representing the JSON Schema. + + + + Reads a from the specified . + + The containing the JSON Schema to read. + The to use when resolving schema references. + The object representing the JSON Schema. + + + + Load a from a string that contains JSON Schema. + + A that contains JSON Schema. + A populated from the string that contains JSON Schema. + + + + Load a from a string that contains JSON Schema using the specified . + + A that contains JSON Schema. + The resolver. + A populated from the string that contains JSON Schema. + + + + Writes this schema to a . + + A into which this method will write. + + + + Writes this schema to a using the specified . + + A into which this method will write. + The resolver used. + + + + Returns a that represents the current . + + + A that represents the current . + + + + + + Returns detailed information about the schema exception. + + + JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. + + + + + + Gets the line number indicating where the error occurred. + + The line number indicating where the error occurred. + + + + Gets the line position indicating where the error occurred. + + The line position indicating where the error occurred. + + + + Gets the path to the JSON where the error occurred. + + The path to the JSON where the error occurred. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class + with a specified error message. + + The error message that explains the reason for the exception. + + + + Initializes a new instance of the class + with a specified error message and a reference to the inner exception that is the cause of this exception. + + The error message that explains the reason for the exception. + The exception that is the cause of the current exception, or null if no inner exception is specified. + + + + Initializes a new instance of the class. + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + The parameter is null. + The class name is null or is zero (0). + + + + + Generates a from a specified . + + + JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. + + + + + + Gets or sets how undefined schemas are handled by the serializer. + + + + + Gets or sets the contract resolver. + + The contract resolver. + + + + Generate a from the specified type. + + The type to generate a from. + A generated from the specified type. + + + + Generate a from the specified type. + + The type to generate a from. + The used to resolve schema references. + A generated from the specified type. + + + + Generate a from the specified type. + + The type to generate a from. + Specify whether the generated root will be nullable. + A generated from the specified type. + + + + Generate a from the specified type. + + The type to generate a from. + The used to resolve schema references. + Specify whether the generated root will be nullable. + A generated from the specified type. + + + + + Resolves from an id. + + + JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. + + + + + + Gets or sets the loaded schemas. + + The loaded schemas. + + + + Initializes a new instance of the class. + + + + + Gets a for the specified reference. + + The id. + A for the specified reference. + + + + + The value types allowed by the . + + + JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. + + + + + + No type specified. + + + + + String type. + + + + + Float type. + + + + + Integer type. + + + + + Boolean type. + + + + + Object type. + + + + + Array type. + + + + + Null type. + + + + + Any type. + + + + + + Specifies undefined schema Id handling options for the . + + + JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. + + + + + + Do not infer a schema Id. + + + + + Use the .NET type name as the schema Id. + + + + + Use the assembly qualified .NET type name as the schema Id. + + + + + + Returns detailed information related to the . + + + JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. + + + + + + Gets the associated with the validation error. + + The JsonSchemaException associated with the validation error. + + + + Gets the path of the JSON location where the validation error occurred. + + The path of the JSON location where the validation error occurred. + + + + Gets the text description corresponding to the validation error. + + The text description. + + + + + Represents the callback method that will handle JSON schema validation events and the . + + + JSON Schema validation has been moved to its own package. See https://www.newtonsoft.com/jsonschema for more details. + + + + + + A camel case naming strategy. + + + + + Initializes a new instance of the class. + + + A flag indicating whether dictionary keys should be processed. + + + A flag indicating whether explicitly specified property names should be processed, + e.g. a property name customized with a . + + + + + Initializes a new instance of the class. + + + A flag indicating whether dictionary keys should be processed. + + + A flag indicating whether explicitly specified property names should be processed, + e.g. a property name customized with a . + + + A flag indicating whether extension data names should be processed. + + + + + Initializes a new instance of the class. + + + + + Resolves the specified property name. + + The property name to resolve. + The resolved property name. + + + + Resolves member mappings for a type, camel casing property names. + + + + + Initializes a new instance of the class. + + + + + Resolves the contract for a given type. + + The type to resolve a contract for. + The contract for a given type. + + + + Used by to resolve a for a given . + + + + + Gets a value indicating whether members are being get and set using dynamic code generation. + This value is determined by the runtime permissions available. + + + true if using dynamic code generation; otherwise, false. + + + + + Gets or sets the default members search flags. + + The default members search flags. + + + + Gets or sets a value indicating whether compiler generated members should be serialized. + + + true if serialized compiler generated members; otherwise, false. + + + + + Gets or sets a value indicating whether to ignore the interface when serializing and deserializing types. + + + true if the interface will be ignored when serializing and deserializing types; otherwise, false. + + + + + Gets or sets a value indicating whether to ignore the attribute when serializing and deserializing types. + + + true if the attribute will be ignored when serializing and deserializing types; otherwise, false. + + + + + Gets or sets a value indicating whether to ignore IsSpecified members when serializing and deserializing types. + + + true if the IsSpecified members will be ignored when serializing and deserializing types; otherwise, false. + + + + + Gets or sets a value indicating whether to ignore ShouldSerialize members when serializing and deserializing types. + + + true if the ShouldSerialize members will be ignored when serializing and deserializing types; otherwise, false. + + + + + Gets or sets the naming strategy used to resolve how property names and dictionary keys are serialized. + + The naming strategy used to resolve how property names and dictionary keys are serialized. + + + + Initializes a new instance of the class. + + + + + Resolves the contract for a given type. + + The type to resolve a contract for. + The contract for a given type. + + + + Gets the serializable members for the type. + + The type to get serializable members for. + The serializable members for the type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates the constructor parameters. + + The constructor to create properties for. + The type's member properties. + Properties for the given . + + + + Creates a for the given . + + The matching member property. + The constructor parameter. + A created for the given . + + + + Resolves the default for the contract. + + Type of the object. + The contract's default . + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Creates a for the given type. + + Type of the object. + A for the given type. + + + + Determines which contract type is created for the given type. + + Type of the object. + A for the given type. + + + + Creates properties for the given . + + The type to create properties for. + /// The member serialization mode for the type. + Properties for the given . + + + + Creates the used by the serializer to get and set values from a member. + + The member. + The used by the serializer to get and set values from a member. + + + + Creates a for the given . + + The member's parent . + The member to create a for. + A created for the given . + + + + Resolves the name of the property. + + Name of the property. + Resolved name of the property. + + + + Resolves the name of the extension data. By default no changes are made to extension data names. + + Name of the extension data. + Resolved name of the extension data. + + + + Resolves the key of the dictionary. By default is used to resolve dictionary keys. + + Key of the dictionary. + Resolved key of the dictionary. + + + + Gets the resolved name of the property. + + Name of the property. + Name of the property. + + + + The default naming strategy. Property names and dictionary keys are unchanged. + + + + + Resolves the specified property name. + + The property name to resolve. + The resolved property name. + + + + The default serialization binder used when resolving and loading classes from type names. + + + + + Initializes a new instance of the class. + + + + + When overridden in a derived class, controls the binding of a serialized object to a type. + + Specifies the name of the serialized object. + Specifies the name of the serialized object. + + The type of the object the formatter creates a new instance of. + + + + + When overridden in a derived class, controls the binding of a serialized object to a type. + + The type of the object the formatter creates a new instance of. + Specifies the name of the serialized object. + Specifies the name of the serialized object. + + + + Represents a trace writer that writes to the application's instances. + + + + + Gets the that will be used to filter the trace messages passed to the writer. + For example a filter level of will exclude messages and include , + and messages. + + + The that will be used to filter the trace messages passed to the writer. + + + + + Writes the specified trace level, message and optional exception. + + The at which to write this trace. + The trace message. + The trace exception. This parameter is optional. + + + + Get and set values for a using dynamic methods. + + + + + Initializes a new instance of the class. + + The member info. + + + + Sets the value. + + The target to set the value on. + The value to set on the target. + + + + Gets the value. + + The target to get the value from. + The value. + + + + Provides information surrounding an error. + + + + + Gets the error. + + The error. + + + + Gets the original object that caused the error. + + The original object that caused the error. + + + + Gets the member that caused the error. + + The member that caused the error. + + + + Gets the path of the JSON location where the error occurred. + + The path of the JSON location where the error occurred. + + + + Gets or sets a value indicating whether this is handled. + + true if handled; otherwise, false. + + + + Provides data for the Error event. + + + + + Gets the current object the error event is being raised against. + + The current object the error event is being raised against. + + + + Gets the error context. + + The error context. + + + + Initializes a new instance of the class. + + The current object. + The error context. + + + + Get and set values for a using dynamic methods. + + + + + Initializes a new instance of the class. + + The member info. + + + + Sets the value. + + The target to set the value on. + The value to set on the target. + + + + Gets the value. + + The target to get the value from. + The value. + + + + Provides methods to get attributes. + + + + + Returns a collection of all of the attributes, or an empty collection if there are no attributes. + + When true, look up the hierarchy chain for the inherited custom attribute. + A collection of s, or an empty collection. + + + + Returns a collection of attributes, identified by type, or an empty collection if there are no attributes. + + The type of the attributes. + When true, look up the hierarchy chain for the inherited custom attribute. + A collection of s, or an empty collection. + + + + Used by to resolve a for a given . + + + + + + + + + Resolves the contract for a given type. + + The type to resolve a contract for. + The contract for a given type. + + + + Used to resolve references when serializing and deserializing JSON by the . + + + + + Resolves a reference to its object. + + The serialization context. + The reference to resolve. + The object that was resolved from the reference. + + + + Gets the reference for the specified object. + + The serialization context. + The object to get a reference for. + The reference to the object. + + + + Determines whether the specified object is referenced. + + The serialization context. + The object to test for a reference. + + true if the specified object is referenced; otherwise, false. + + + + + Adds a reference to the specified object. + + The serialization context. + The reference. + The object to reference. + + + + Allows users to control class loading and mandate what class to load. + + + + + When implemented, controls the binding of a serialized object to a type. + + Specifies the name of the serialized object. + Specifies the name of the serialized object + The type of the object the formatter creates a new instance of. + + + + When implemented, controls the binding of a serialized object to a type. + + The type of the object the formatter creates a new instance of. + Specifies the name of the serialized object. + Specifies the name of the serialized object. + + + + Represents a trace writer. + + + + + Gets the that will be used to filter the trace messages passed to the writer. + For example a filter level of will exclude messages and include , + and messages. + + The that will be used to filter the trace messages passed to the writer. + + + + Writes the specified trace level, message and optional exception. + + The at which to write this trace. + The trace message. + The trace exception. This parameter is optional. + + + + Provides methods to get and set values. + + + + + Sets the value. + + The target to set the value on. + The value to set on the target. + + + + Gets the value. + + The target to get the value from. + The value. + + + + Contract details for a used by the . + + + + + Gets the of the collection items. + + The of the collection items. + + + + Gets a value indicating whether the collection type is a multidimensional array. + + true if the collection type is a multidimensional array; otherwise, false. + + + + Gets or sets the function used to create the object. When set this function will override . + + The function used to create the object. + + + + Gets a value indicating whether the creator has a parameter with the collection values. + + true if the creator has a parameter with the collection values; otherwise, false. + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Contract details for a used by the . + + + + + Gets or sets the default collection items . + + The converter. + + + + Gets or sets a value indicating whether the collection items preserve object references. + + true if collection items preserve object references; otherwise, false. + + + + Gets or sets the collection item reference loop handling. + + The reference loop handling. + + + + Gets or sets the collection item type name handling. + + The type name handling. + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Handles serialization callback events. + + The object that raised the callback event. + The streaming context. + + + + Handles serialization error callback events. + + The object that raised the callback event. + The streaming context. + The error context. + + + + Sets extension data for an object during deserialization. + + The object to set extension data on. + The extension data key. + The extension data value. + + + + Gets extension data for an object during serialization. + + The object to set extension data on. + + + + Contract details for a used by the . + + + + + Gets the underlying type for the contract. + + The underlying type for the contract. + + + + Gets or sets the type created during deserialization. + + The type created during deserialization. + + + + Gets or sets whether this type contract is serialized as a reference. + + Whether this type contract is serialized as a reference. + + + + Gets or sets the default for this contract. + + The converter. + + + + Gets the internally resolved for the contract's type. + This converter is used as a fallback converter when no other converter is resolved. + Setting will always override this converter. + + + + + Gets or sets all methods called immediately after deserialization of the object. + + The methods called immediately after deserialization of the object. + + + + Gets or sets all methods called during deserialization of the object. + + The methods called during deserialization of the object. + + + + Gets or sets all methods called after serialization of the object graph. + + The methods called after serialization of the object graph. + + + + Gets or sets all methods called before serialization of the object. + + The methods called before serialization of the object. + + + + Gets or sets all method called when an error is thrown during the serialization of the object. + + The methods called when an error is thrown during the serialization of the object. + + + + Gets or sets the default creator method used to create the object. + + The default creator method used to create the object. + + + + Gets or sets a value indicating whether the default creator is non-public. + + true if the default object creator is non-public; otherwise, false. + + + + Contract details for a used by the . + + + + + Gets or sets the dictionary key resolver. + + The dictionary key resolver. + + + + Gets the of the dictionary keys. + + The of the dictionary keys. + + + + Gets the of the dictionary values. + + The of the dictionary values. + + + + Gets or sets the function used to create the object. When set this function will override . + + The function used to create the object. + + + + Gets a value indicating whether the creator has a parameter with the dictionary values. + + true if the creator has a parameter with the dictionary values; otherwise, false. + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Contract details for a used by the . + + + + + Gets the object's properties. + + The object's properties. + + + + Gets or sets the property name resolver. + + The property name resolver. + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Contract details for a used by the . + + + + + Gets or sets the object constructor. + + The object constructor. + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Contract details for a used by the . + + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Contract details for a used by the . + + + + + Gets or sets the object member serialization. + + The member object serialization. + + + + Gets or sets the missing member handling used when deserializing this object. + + The missing member handling. + + + + Gets or sets a value that indicates whether the object's properties are required. + + + A value indicating whether the object's properties are required. + + + + + Gets or sets how the object's properties with null values are handled during serialization and deserialization. + + How the object's properties with null values are handled during serialization and deserialization. + + + + Gets the object's properties. + + The object's properties. + + + + Gets a collection of instances that define the parameters used with . + + + + + Gets or sets the function used to create the object. When set this function will override . + This function is called with a collection of arguments which are defined by the collection. + + The function used to create the object. + + + + Gets or sets the extension data setter. + + + + + Gets or sets the extension data getter. + + + + + Gets or sets the extension data value type. + + + + + Gets or sets the extension data name resolver. + + The extension data name resolver. + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Contract details for a used by the . + + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Maps a JSON property to a .NET member or constructor parameter. + + + + + Gets or sets the name of the property. + + The name of the property. + + + + Gets or sets the type that declared this property. + + The type that declared this property. + + + + Gets or sets the order of serialization of a member. + + The numeric order of serialization. + + + + Gets or sets the name of the underlying member or parameter. + + The name of the underlying member or parameter. + + + + Gets the that will get and set the during serialization. + + The that will get and set the during serialization. + + + + Gets or sets the for this property. + + The for this property. + + + + Gets or sets the type of the property. + + The type of the property. + + + + Gets or sets the for the property. + If set this converter takes precedence over the contract converter for the property type. + + The converter. + + + + Gets or sets the member converter. + + The member converter. + + + + Gets or sets a value indicating whether this is ignored. + + true if ignored; otherwise, false. + + + + Gets or sets a value indicating whether this is readable. + + true if readable; otherwise, false. + + + + Gets or sets a value indicating whether this is writable. + + true if writable; otherwise, false. + + + + Gets or sets a value indicating whether this has a member attribute. + + true if has a member attribute; otherwise, false. + + + + Gets the default value. + + The default value. + + + + Gets or sets a value indicating whether this is required. + + A value indicating whether this is required. + + + + Gets a value indicating whether has a value specified. + + + + + Gets or sets a value indicating whether this property preserves object references. + + + true if this instance is reference; otherwise, false. + + + + + Gets or sets the property null value handling. + + The null value handling. + + + + Gets or sets the property default value handling. + + The default value handling. + + + + Gets or sets the property reference loop handling. + + The reference loop handling. + + + + Gets or sets the property object creation handling. + + The object creation handling. + + + + Gets or sets or sets the type name handling. + + The type name handling. + + + + Gets or sets a predicate used to determine whether the property should be serialized. + + A predicate used to determine whether the property should be serialized. + + + + Gets or sets a predicate used to determine whether the property should be deserialized. + + A predicate used to determine whether the property should be deserialized. + + + + Gets or sets a predicate used to determine whether the property should be serialized. + + A predicate used to determine whether the property should be serialized. + + + + Gets or sets an action used to set whether the property has been deserialized. + + An action used to set whether the property has been deserialized. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Gets or sets the converter used when serializing the property's collection items. + + The collection's items converter. + + + + Gets or sets whether this property's collection items are serialized as a reference. + + Whether this property's collection items are serialized as a reference. + + + + Gets or sets the type name handling used when serializing the property's collection items. + + The collection's items type name handling. + + + + Gets or sets the reference loop handling used when serializing the property's collection items. + + The collection's items reference loop handling. + + + + A collection of objects. + + + + + Initializes a new instance of the class. + + The type. + + + + When implemented in a derived class, extracts the key from the specified element. + + The element from which to extract the key. + The key for the specified element. + + + + Adds a object. + + The property to add to the collection. + + + + Gets the closest matching object. + First attempts to get an exact case match of and then + a case insensitive match. + + Name of the property. + A matching property if found. + + + + Gets a property by property name. + + The name of the property to get. + Type property name string comparison. + A matching property if found. + + + + Contract details for a used by the . + + + + + Initializes a new instance of the class. + + The underlying type for the contract. + + + + Lookup and create an instance of the type described by the argument. + + The type to create. + Optional arguments to pass to an initializing constructor of the JsonConverter. + If null, the default constructor is used. + + + + A kebab case naming strategy. + + + + + Initializes a new instance of the class. + + + A flag indicating whether dictionary keys should be processed. + + + A flag indicating whether explicitly specified property names should be processed, + e.g. a property name customized with a . + + + + + Initializes a new instance of the class. + + + A flag indicating whether dictionary keys should be processed. + + + A flag indicating whether explicitly specified property names should be processed, + e.g. a property name customized with a . + + + A flag indicating whether extension data names should be processed. + + + + + Initializes a new instance of the class. + + + + + Resolves the specified property name. + + The property name to resolve. + The resolved property name. + + + + Represents a trace writer that writes to memory. When the trace message limit is + reached then old trace messages will be removed as new messages are added. + + + + + Gets the that will be used to filter the trace messages passed to the writer. + For example a filter level of will exclude messages and include , + and messages. + + + The that will be used to filter the trace messages passed to the writer. + + + + + Initializes a new instance of the class. + + + + + Writes the specified trace level, message and optional exception. + + The at which to write this trace. + The trace message. + The trace exception. This parameter is optional. + + + + Returns an enumeration of the most recent trace messages. + + An enumeration of the most recent trace messages. + + + + Returns a of the most recent trace messages. + + + A of the most recent trace messages. + + + + + A base class for resolving how property names and dictionary keys are serialized. + + + + + A flag indicating whether dictionary keys should be processed. + Defaults to false. + + + + + A flag indicating whether extension data names should be processed. + Defaults to false. + + + + + A flag indicating whether explicitly specified property names, + e.g. a property name customized with a , should be processed. + Defaults to false. + + + + + Gets the serialized name for a given property name. + + The initial property name. + A flag indicating whether the property has had a name explicitly specified. + The serialized property name. + + + + Gets the serialized name for a given extension data name. + + The initial extension data name. + The serialized extension data name. + + + + Gets the serialized key for a given dictionary key. + + The initial dictionary key. + The serialized dictionary key. + + + + Resolves the specified property name. + + The property name to resolve. + The resolved property name. + + + + Hash code calculation + + + + + + Object equality implementation + + + + + + + Compare to another NamingStrategy + + + + + + + Represents a method that constructs an object. + + The object type to create. + + + + When applied to a method, specifies that the method is called when an error occurs serializing an object. + + + + + Provides methods to get attributes from a , , or . + + + + + Initializes a new instance of the class. + + The instance to get attributes for. This parameter should be a , , or . + + + + Returns a collection of all of the attributes, or an empty collection if there are no attributes. + + When true, look up the hierarchy chain for the inherited custom attribute. + A collection of s, or an empty collection. + + + + Returns a collection of attributes, identified by type, or an empty collection if there are no attributes. + + The type of the attributes. + When true, look up the hierarchy chain for the inherited custom attribute. + A collection of s, or an empty collection. + + + + Get and set values for a using reflection. + + + + + Initializes a new instance of the class. + + The member info. + + + + Sets the value. + + The target to set the value on. + The value to set on the target. + + + + Gets the value. + + The target to get the value from. + The value. + + + + A snake case naming strategy. + + + + + Initializes a new instance of the class. + + + A flag indicating whether dictionary keys should be processed. + + + A flag indicating whether explicitly specified property names should be processed, + e.g. a property name customized with a . + + + + + Initializes a new instance of the class. + + + A flag indicating whether dictionary keys should be processed. + + + A flag indicating whether explicitly specified property names should be processed, + e.g. a property name customized with a . + + + A flag indicating whether extension data names should be processed. + + + + + Initializes a new instance of the class. + + + + + Resolves the specified property name. + + The property name to resolve. + The resolved property name. + + + + Specifies how strings are escaped when writing JSON text. + + + + + Only control characters (e.g. newline) are escaped. + + + + + All non-ASCII and control characters (e.g. newline) are escaped. + + + + + HTML (<, >, &, ', ") and control characters (e.g. newline) are escaped. + + + + + Indicates the method that will be used during deserialization for locating and loading assemblies. + + + + + In simple mode, the assembly used during deserialization need not match exactly the assembly used during serialization. Specifically, the version numbers need not match as the LoadWithPartialName method of the class is used to load the assembly. + + + + + In full mode, the assembly used during deserialization must match exactly the assembly used during serialization. The Load method of the class is used to load the assembly. + + + + + Specifies type name handling options for the . + + + should be used with caution when your application deserializes JSON from an external source. + Incoming types should be validated with a custom + when deserializing with a value other than . + + + + + Do not include the .NET type name when serializing types. + + + + + Include the .NET type name when serializing into a JSON object structure. + + + + + Include the .NET type name when serializing into a JSON array structure. + + + + + Always include the .NET type name when serializing. + + + + + Include the .NET type name when the type of the object being serialized is not the same as its declared type. + Note that this doesn't include the root serialized object by default. To include the root object's type name in JSON + you must specify a root type object with + or . + + + + + Determines whether the collection is null or empty. + + The collection. + + true if the collection is null or empty; otherwise, false. + + + + + Adds the elements of the specified collection to the specified generic . + + The list to add to. + The collection of elements to add. + + + + Converts the value to the specified type. If the value is unable to be converted, the + value is checked whether it assignable to the specified type. + + The value to convert. + The culture to use when converting. + The type to convert or cast the value to. + + The converted type. If conversion was unsuccessful, the initial value + is returned if assignable to the target type. + + + + + Helper method for generating a MetaObject which calls a + specific method on Dynamic that returns a result + + + + + Helper method for generating a MetaObject which calls a + specific method on Dynamic, but uses one of the arguments for + the result. + + + + + Helper method for generating a MetaObject which calls a + specific method on Dynamic, but uses one of the arguments for + the result. + + + + + Returns a Restrictions object which includes our current restrictions merged + with a restriction limiting our type + + + + + Helper class for serializing immutable collections. + Note that this is used by all builds, even those that don't support immutable collections, in case the DLL is GACed + https://github.com/JamesNK/Newtonsoft.Json/issues/652 + + + + + Gets the type of the typed collection's items. + + The type. + The type of the typed collection's items. + + + + Gets the member's underlying type. + + The member. + The underlying type of the member. + + + + Determines whether the property is an indexed property. + + The property. + + true if the property is an indexed property; otherwise, false. + + + + + Gets the member's value on the object. + + The member. + The target object. + The member's value on the object. + + + + Sets the member's value on the target object. + + The member. + The target. + The value. + + + + Determines whether the specified MemberInfo can be read. + + The MemberInfo to determine whether can be read. + /// if set to true then allow the member to be gotten non-publicly. + + true if the specified MemberInfo can be read; otherwise, false. + + + + + Determines whether the specified MemberInfo can be set. + + The MemberInfo to determine whether can be set. + if set to true then allow the member to be set non-publicly. + if set to true then allow the member to be set if read-only. + + true if the specified MemberInfo can be set; otherwise, false. + + + + + Builds a string. Unlike this class lets you reuse its internal buffer. + + + + + Determines whether the string is all white space. Empty string will return false. + + The string to test whether it is all white space. + + true if the string is all white space; otherwise, false. + + + + + Specifies the state of the . + + + + + An exception has been thrown, which has left the in an invalid state. + You may call the method to put the in the Closed state. + Any other method calls result in an being thrown. + + + + + The method has been called. + + + + + An object is being written. + + + + + An array is being written. + + + + + A constructor is being written. + + + + + A property is being written. + + + + + A write method has not been called. + + + + Specifies that an output will not be null even if the corresponding type allows it. + + + Specifies that when a method returns , the parameter will not be null even if the corresponding type allows it. + + + Initializes the attribute with the specified return value condition. + + The return value condition. If the method returns this value, the associated parameter will not be null. + + + + Gets the return value condition. + + + Specifies that an output may be null even if the corresponding type disallows it. + + + Specifies that null is allowed as an input even if the corresponding type disallows it. + + + + Specifies that the method will not return if the associated Boolean parameter is passed the specified value. + + + + + Initializes a new instance of the class. + + + The condition parameter value. Code after the method will be considered unreachable by diagnostics if the argument to + the associated parameter matches this value. + + + + Gets the condition parameter value. + + + diff --git a/Test/dll/SharpDX.DXGI.dll b/Test/dll/SharpDX.DXGI.dll new file mode 100644 index 00000000..8a4f50af Binary files /dev/null and b/Test/dll/SharpDX.DXGI.dll differ diff --git a/Test/dll/SharpDX.DXGI.xml b/Test/dll/SharpDX.DXGI.xml new file mode 100644 index 00000000..7b4cd9c7 --- /dev/null +++ b/Test/dll/SharpDX.DXGI.xml @@ -0,0 +1,8737 @@ + + + + SharpDX.DXGI + + + + + Gets all outputs from this adapter. + + bb174525 + HRESULT IDXGIAdapter::EnumOutputs([In] unsigned int Output,[Out] IDXGIOutput** ppOutput) + IDXGIAdapter::EnumOutputs + + + + Checks to see if a device interface for a graphics component is supported by the system. + + The GUID of the interface of the device version for which support is being checked. For example, typeof(ID3D10Device).GUID. + + true if the interface is supported; otherwise, false. + + Bb174524 + HRESULT IDXGIAdapter::CheckInterfaceSupport([In] const GUID& InterfaceName,[Out] LARGE_INTEGER* pUMDVersion) + IDXGIAdapter::CheckInterfaceSupport + + + + Checks to see if a device interface for a graphics component is supported by the system. + + the interface of the device version for which support is being checked. + + true if the interface is supported; otherwise, false. + + Bb174524 + HRESULT IDXGIAdapter::CheckInterfaceSupport([In] const GUID& InterfaceName,[Out] LARGE_INTEGER* pUMDVersion) + IDXGIAdapter::CheckInterfaceSupport + + + + Checks to see if a device interface for a graphics component is supported by the system. + + the interface of the device version for which support is being checked. + The user mode driver version of InterfaceName. This is only returned if the interface is supported. + + true if the interface is supported; otherwise, false. + + Bb174524 + HRESULT IDXGIAdapter::CheckInterfaceSupport([In] const GUID& InterfaceName,[Out] LARGE_INTEGER* pUMDVersion) + IDXGIAdapter::CheckInterfaceSupport + + + + Checks to see if a device interface for a graphics component is supported by the system. + + The GUID of the interface of the device version for which support is being checked. For example, typeof(ID3D10Device).GUID. + The user mode driver version of InterfaceName. This is only returned if the interface is supported. + + true if the interface is supported; otherwise, false. + + Bb174524 + HRESULT IDXGIAdapter::CheckInterfaceSupport([In] const GUID& InterfaceName,[Out] LARGE_INTEGER* pUMDVersion) + IDXGIAdapter::CheckInterfaceSupport + + + + Gets an adapter (video card) outputs. + + The index of the output. + + An instance of + + HRESULT IDXGIAdapter::EnumOutputs([In] unsigned int Output,[Out] IDXGIOutput** ppOutput) + + When the EnumOutputs method succeeds and fills the ppOutput parameter with the address of the reference to the output interface, EnumOutputs increments the output interface's reference count. To avoid a memory leak, when you finish using the output interface, call the Release method to decrement the reference count.EnumOutputs first returns the output on which the desktop primary is displayed. This adapter corresponds with an index of zero. EnumOutputs then returns other outputs. + + if the index is greater than the number of outputs, result code + bb174525 + HRESULT IDXGIAdapter::EnumOutputs([In] unsigned int Output,[Out] IDXGIOutput** ppOutput) + IDXGIAdapter::EnumOutputs + + + + Return the number of available outputs from this adapter. + + The number of outputs + bb174525 + HRESULT IDXGIAdapter::EnumOutputs([In] unsigned int Output,[Out] IDXGIOutput** ppOutput) + IDXGIAdapter::EnumOutputs + + + +

Gets a DXGI 1.0 description of an adapter (or video card).

+
+ +

Graphics apps can use the DXGI API to retrieve an accurate set of graphics memory values on systems that have Windows Display Driver Model (WDDM) drivers. The following are the critical steps involved.

  • Graphics driver model determination ? Because DXGI is only available on systems with WDDM drivers, the app must first confirm the driver model by using the following API.
     HasWDDMDriver()
    +            { LPDIRECT3DCREATE9EX pD3D9Create9Ex = null; HMODULE             hD3D9          = null; hD3D9 = LoadLibrary( L"d3d9.dll" ); if ( null == hD3D9 ) { return false; } // /*  Try to create IDirect3D9Ex interface (also known as a DX9L interface). This interface can only be created if the driver is a WDDM driver. */ // pD3D9Create9Ex = (LPDIRECT3DCREATE9EX) GetProcAddress( hD3D9, "Direct3DCreate9Ex" ); return pD3D9Create9Ex != null;
    +            } 
  • Retrieval of graphics memory values.? After the app determines the driver model to be WDDM, the app can use the Direct3D 10 or later API and DXGI to get the amount of graphics memory. After you create a Direct3D device, use this code to obtain a structure that contains the amount of available graphics memory.
      * pDXGIDevice;
    +            hr = g_pd3dDevice->QueryInterface(__uuidof(), (void **)&pDXGIDevice);
    +             * pDXGIAdapter;
    +            pDXGIDevice->GetAdapter(&pDXGIAdapter);
    +             adapterDesc;
    +            pDXGIAdapter->GetDesc(&adapterDesc); 
+
+ bb174526 + GetDesc + GetDesc +
+ + +

Enumerate adapter (video card) outputs.

+
+

The index of the output.

+

The address of a reference to an interface at the position specified by the Output parameter.

+

A code that indicates success or failure (see DXGI_ERROR). is returned if the index is greater than the number of outputs.

If the adapter came from a device created using D3D_DRIVER_TYPE_WARP, then the adapter has no outputs, so is returned.

+ + Note??If you call this API in a Session 0 process, it returns .?

When the EnumOutputs method succeeds and fills the ppOutput parameter with the address of the reference to the output interface, EnumOutputs increments the output interface's reference count. To avoid a memory leak, when you finish using the output interface, call the Release method to decrement the reference count.

EnumOutputs first returns the output on which the desktop primary is displayed. This output corresponds with an index of zero. EnumOutputs then returns other outputs.

+
+ bb174525 + HRESULT IDXGIAdapter::EnumOutputs([In] unsigned int Output,[Out] IDXGIOutput** ppOutput) + IDXGIAdapter::EnumOutputs +
+ + +

Gets a DXGI 1.0 description of an adapter (or video card).

+
+

A reference to a structure that describes the adapter. This parameter must not be null. On feature level 9 graphics hardware, GetDesc returns zeros for the PCI ID in the VendorId, DeviceId, SubSysId, and Revision members of and ?Software Adapter? for the description string in the Description member.

+

Returns if successful; otherwise returns E_INVALIDARG if the pDesc parameter is null.

+ +

Graphics apps can use the DXGI API to retrieve an accurate set of graphics memory values on systems that have Windows Display Driver Model (WDDM) drivers. The following are the critical steps involved.

  • Graphics driver model determination ? Because DXGI is only available on systems with WDDM drivers, the app must first confirm the driver model by using the following API.
     HasWDDMDriver()
    +            { LPDIRECT3DCREATE9EX pD3D9Create9Ex = null; HMODULE             hD3D9          = null; hD3D9 = LoadLibrary( L"d3d9.dll" ); if ( null == hD3D9 ) { return false; } // /*  Try to create IDirect3D9Ex interface (also known as a DX9L interface). This interface can only be created if the driver is a WDDM driver. */ // pD3D9Create9Ex = (LPDIRECT3DCREATE9EX) GetProcAddress( hD3D9, "Direct3DCreate9Ex" ); return pD3D9Create9Ex != null;
    +            } 
  • Retrieval of graphics memory values.? After the app determines the driver model to be WDDM, the app can use the Direct3D 10 or later API and DXGI to get the amount of graphics memory. After you create a Direct3D device, use this code to obtain a structure that contains the amount of available graphics memory.
      * pDXGIDevice;
    +            hr = g_pd3dDevice->QueryInterface(__uuidof(), (void **)&pDXGIDevice);
    +             * pDXGIAdapter;
    +            pDXGIDevice->GetAdapter(&pDXGIAdapter);
    +             adapterDesc;
    +            pDXGIAdapter->GetDesc(&adapterDesc); 
+
+ bb174526 + HRESULT IDXGIAdapter::GetDesc([Out] DXGI_ADAPTER_DESC* pDesc) + IDXGIAdapter::GetDesc +
+ + +

Checks whether the system supports a device interface for a graphics component.

+
+

The of the interface of the device version for which support is being checked. For example, __uuidof(ID3D10Device).

+

The user mode driver version of InterfaceName. This is returned only if the interface is supported, otherwise this parameter will be null.

+

indicates that the interface is supported, otherwise is returned (For more information, see DXGI_ERROR).

+ + Note??You can use CheckInterfaceSupport only to check whether a Direct3D 10.x interface is supported, and only on Windows Vista SP1 and later versions of the operating system. If you try to use CheckInterfaceSupport to check whether a Direct3D 11.x and later version interface is supported, CheckInterfaceSupport returns . Therefore, do not use CheckInterfaceSupport. Instead, to verify whether the operating system supports a particular interface, try to create the interface. For example, if you call the ID3D11Device::CreateBlendState method and it fails, the operating system does not support the interface.? + + bb174524 + HRESULT IDXGIAdapter::CheckInterfaceSupport([In] const GUID& InterfaceName,[Out] LARGE_INTEGER* pUMDVersion) + IDXGIAdapter::CheckInterfaceSupport +
+ + + The assembly provides managed DXGI API. + + hh404534 + DXGI + DXGI + + + + Gets the residency status of an array of resources. + + + The information returned by the pResidencyStatus argument array describes the residency status at the time that the QueryResourceResidency method was called. Note that the residency status will constantly change. If you call the QueryResourceResidency method during a device removed state, the pResidencyStatus argument will return the DXGI_RESIDENCY_EVICTED_TO_DISK flag. Note??This method should not be called every frame as it incurs a non-trivial amount of overhead. + + An array of interfaces. + Returns an array of flags. Each element describes the residency status for corresponding element in the ppResources argument array. + HRESULT IDXGIDevice::QueryResourceResidency([In, Buffer] const IUnknown** ppResources,[Out, Buffer] DXGI_RESIDENCY* pResidencyStatus,[None] int NumResources) + + + +

Returns the adapter for the specified device.

+
+ +

If the GetAdapter method succeeds, the reference count on the adapter interface will be incremented. To avoid a memory leak, be sure to release the interface when you are finished using it.

+
+ bb174531 + GetAdapter + GetAdapter +
+ + +

Gets or sets the GPU thread priority.

+
+ bb174532 + GetGPUThreadPriority / SetGPUThreadPriority + GetGPUThreadPriority +
+ + +

Returns the adapter for the specified device.

+
+

The address of an interface reference to the adapter. This parameter must not be null.

+

Returns if successful; otherwise, returns one of the DXGI_ERROR that indicates failure. If the pAdapter parameter is null this method returns E_INVALIDARG.

+ +

If the GetAdapter method succeeds, the reference count on the adapter interface will be incremented. To avoid a memory leak, be sure to release the interface when you are finished using it.

+
+ bb174531 + HRESULT IDXGIDevice::GetAdapter([Out] IDXGIAdapter** pAdapter) + IDXGIDevice::GetAdapter +
+ + +

Returns a surface. This method is used internally and you should not call it directly in your application.

+
+

A reference to a structure that describes the surface.

+

The number of surfaces to create.

+

A DXGI_USAGE flag that specifies how the surface is expected to be used.

+

An optional reference to a structure that contains shared resource information for opening views of such resources.

+

The address of an interface reference to the first created surface.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ +

The CreateSurface method creates a buffer to exchange data between one or more devices. It is used internally, and you should not directly call it.

The runtime automatically creates an interface when it creates a Direct3D resource object that represents a surface. For example, the runtime creates an interface when it calls ID3D11Device::CreateTexture2D or ID3D10Device::CreateTexture2D to create a 2D texture. To retrieve the interface that represents the 2D texture surface, call ID3D11Texture2D::QueryInterface or ID3D10Texture2D::QueryInterface. In this call, you must pass the identifier of . If the 2D texture has only a single MIP-map level and does not consist of an array of textures, QueryInterface succeeds and returns a reference to the interface reference. Otherwise, QueryInterface fails and does not return the reference to . +

+
+ bb174530 + HRESULT IDXGIDevice::CreateSurface([In] const DXGI_SURFACE_DESC* pDesc,[In] unsigned int NumSurfaces,[In] unsigned int Usage,[In, Optional] const DXGI_SHARED_RESOURCE* pSharedResource,[Out] IDXGISurface** ppSurface) + IDXGIDevice::CreateSurface +
+ + +

Gets the residency status of an array of resources.

+
+

An array of interfaces.

+

An array of flags. Each element describes the residency status for corresponding element in the ppResources argument array.

+

The number of resources in the ppResources argument array and pResidencyStatus argument array.

+

Returns if successful; otherwise, returns , E_INVALIDARG, or E_POINTER (see Common Values and WinError.h for more information).

+ +

The information returned by the pResidencyStatus argument array describes the residency status at the time that the QueryResourceResidency method was called.

Note??The residency status will constantly change.?

If you call the QueryResourceResidency method during a device removed state, the pResidencyStatus argument will return the DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY flag.

Note??This method should not be called every frame as it incurs a non-trivial amount of overhead.? +
+ bb174533 + HRESULT IDXGIDevice::QueryResourceResidency([In, Buffer] const IUnknown** ppResources,[Out, Buffer] DXGI_RESIDENCY* pResidencyStatus,[In] unsigned int NumResources) + IDXGIDevice::QueryResourceResidency +
+ + +

Sets the GPU thread priority.

+
+

A value that specifies the required GPU thread priority. This value must be between -7 and 7, inclusive, where 0 represents normal priority.

+

Return if successful; otherwise, returns E_INVALIDARG if the Priority parameter is invalid.

+ +

The values for the Priority parameter function as follows:

  • Positive values increase the likelihood that the GPU scheduler will grant GPU execution cycles to the device when rendering.
  • Negative values lessen the likelihood that the device will receive GPU execution cycles when devices compete for them.
  • The device is guaranteed to receive some GPU execution cycles at all settings.

To use the SetGPUThreadPriority method, you should have a comprehensive understanding of GPU scheduling. You should profile your application to ensure that it behaves as intended. If used inappropriately, the SetGPUThreadPriority method can impede rendering speed and result in a poor user experience.

+
+ bb174534 + HRESULT IDXGIDevice::SetGPUThreadPriority([In] int Priority) + IDXGIDevice::SetGPUThreadPriority +
+ + +

Gets the GPU thread priority.

+
+

A reference to a variable that receives a value that indicates the current GPU thread priority. The value will be between -7 and 7, inclusive, where 0 represents normal priority.

+

Return if successful; otherwise, returns E_POINTER if the pPriority parameter is null.

+ bb174532 + HRESULT IDXGIDevice::GetGPUThreadPriority([Out] int* pPriority) + IDXGIDevice::GetGPUThreadPriority +
+ + + Retrieves the device. + + The interface that is returned can be any interface published by the device. + The associated device. + HRESULT IDXGIDeviceSubObject::GetDevice([In] GUID* riid,[Out] void** ppDevice) + + + + Gets or sets the debug-name for this object. + + + The debug name. + + + + +

Retrieves the device.

+
+

The reference id for the device.

+

The address of a reference to the device.

+

A code that indicates success or failure (see DXGI_ERROR).

+ +

The type of interface that is returned can be any interface published by the device. For example, it could be an * called pDevice, and therefore the REFIID would be obtained by calling __uuidof(pDevice).

+
+ bb174529 + HRESULT IDXGIDeviceSubObject::GetDevice([In] const GUID& riid,[Out] void** ppDevice) + IDXGIDeviceSubObject::GetDevice +
+ + + If the DXGI debug layer is installed (e.g. on developer machines), creates the DXGI Debug object. + Otherwise, returns null. + + + Currently doesn't work for Windows Store (aka UWP) apps + + + + +

Reports info about the lifetime of an object or objects.

+
+

The globally unique identifier () of the object or objects to get info about. Use one of the DXGI_DEBUG_ID GUIDs.

+

A -typed value that specifies the amount of info to report.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780352 + HRESULT IDXGIDebug::ReportLiveObjects([In] GUID apiid,[In] DXGI_DEBUG_RLO_FLAGS flags) + IDXGIDebug::ReportLiveObjects +
+ + + If the DXGI debug layer is installed (e.g. on developer machines), creates the DXGI Debug1 object. + Otherwise, returns null. + + + Currently doesn't work for Windows Store (aka UWP) apps + + + + + No documentation. + + IsLeakTrackingEnabledForThread + IsLeakTrackingEnabledForThread + + + + No documentation. + + void IDXGIDebug1::EnableLeakTrackingForThread() + IDXGIDebug1::EnableLeakTrackingForThread + + + + No documentation. + + void IDXGIDebug1::DisableLeakTrackingForThread() + IDXGIDebug1::DisableLeakTrackingForThread + + + + No documentation. + + No documentation. + BOOL IDXGIDebug1::IsLeakTrackingEnabledForThread() + IDXGIDebug1::IsLeakTrackingEnabledForThread + + + + Gets the parent of the object. + + Type of the parent object + Returns the parent object based on the GUID of the type of the parent object. + bb174542 + HRESULT IDXGIObject::GetParent([In] const GUID& riid,[Out] void** ppParent) + IDXGIObject::GetParent + + + +

Sets application-defined data to the object and associates that data with a .

+
+

A that identifies the data. Use this in a call to GetPrivateData to get the data.

+

The size of the object's data.

+

A reference to the object's data.

+

Returns one of the DXGI_ERROR values.

+ +

SetPrivateData makes a copy of the specified data and stores it with the object.

Private data that SetPrivateData stores in the object occupies the same storage space as private data that is stored by associated Direct3D objects (for example, by a Microsoft Direct3D?11 device through ID3D11Device::SetPrivateData or by a Direct3D?11 child device through ID3D11DeviceChild::SetPrivateData).

The debug layer reports memory leaks by outputting a list of object interface references along with their friendly names. The default friendly name is "<unnamed>". You can set the friendly name so that you can determine if the corresponding object interface reference caused the leak. To set the friendly name, use the SetPrivateData method and the well-known private data () that is in D3Dcommon.h. For example, to give pContext a friendly name of My name, use the following code:

 static const char c_szName[] = "My name";
+            hr = pContext->SetPrivateData( , sizeof( c_szName ) - 1, c_szName );
+            

You can use to track down memory leaks and understand performance characteristics of your applications. This information is reflected in the output of the debug layer that is related to memory leaks (ID3D11Debug::ReportLiveDeviceObjects) and with the event tracing for Windows events that we've added to Windows?8. +

+
+ bb174544 + HRESULT IDXGIObject::SetPrivateData([In] const GUID& Name,[In] unsigned int DataSize,[In, Buffer] const void* pData) + IDXGIObject::SetPrivateData +
+ + +

Set an interface in the object's private data.

+
+

A identifying the interface.

+

The interface to set.

+

Returns one of the following DXGI_ERROR.

+ +

This API associates an interface reference with the object.

When the interface is set its reference count is incremented. When the data are overwritten (by calling SPD or SPDI with the same ) or the object is destroyed, ::Release() is called and the interface's reference count is decremented.

+
+ bb174545 + HRESULT IDXGIObject::SetPrivateDataInterface([In] const GUID& Name,[In, Optional] const IUnknown* pUnknown) + IDXGIObject::SetPrivateDataInterface +
+ + +

Get a reference to the object's data.

+
+

A identifying the data.

+

The size of the data.

+

Pointer to the data.

+

Returns one of the following DXGI_ERROR.

+ +

If the data returned is a reference to an , or one of its derivative classes, previously set by IDXGIObject::SetPrivateDataInterface, you must call ::Release() on the reference before the reference is freed to decrement the reference count.

You can pass GUID_DeviceType in the Name parameter of GetPrivateData to retrieve the device type from the display adapter object (, , ).

To get the type of device on which the display adapter was created

  1. Call IUnknown::QueryInterface on the or ID3D10Device object to retrieve the object.
  2. Call GetParent on the object to retrieve the object.
  3. Call GetPrivateData on the object with GUID_DeviceType to retrieve the type of device on which the display adapter was created. pData will point to a value from the driver-type enumeration (for example, a value from ).

On Windows?7 or earlier, this type is either a value from D3D10_DRIVER_TYPE or depending on which kind of device was created. On Windows?8, this type is always a value from . Don't use IDXGIObject::SetPrivateData with GUID_DeviceType because the behavior when doing so is undefined.

+
+ bb174543 + HRESULT IDXGIObject::GetPrivateData([In] const GUID& Name,[InOut] unsigned int* pDataSize,[Out, Buffer] void* pData) + IDXGIObject::GetPrivateData +
+ + +

Gets the parent of the object.

+
+

The ID of the requested interface.

+

The address of a reference to the parent object.

+

Returns one of the DXGI_ERROR values.

+ bb174542 + HRESULT IDXGIObject::GetParent([In] const GUID& riid,[Out] void** ppParent) + IDXGIObject::GetParent +
+ + + Gets both adapters (video cards) with or without outputs. + + The index of the adapter to enumerate. + a reference to an interface at the position specified by the Adapter parameter + + When you create a factory, the factory enumerates the set of adapters that are available in the system. Therefore, if you change the adapters in a system, you must destroy and recreate the object. The number of adapters in a system changes when you add or remove a display card, or dock or undock a laptop.When the EnumAdapters method succeeds and fills the ppAdapter parameter with the address of the reference to the adapter interface, EnumAdapters increments the adapter interface's reference count. When you finish using the adapter interface, call the Release method to decrement the reference count before you destroy the reference.EnumAdapters first returns the local adapter with the output on which the desktop primary is displayed. This adapter corresponds with an index of zero. EnumAdapters then returns other adapters with outputs. + + HRESULT IDXGIFactory::EnumAdapters([In] unsigned int Adapter,[Out] IDXGIAdapter** ppAdapter) + + + + Return an array of available from this factory. + + HRESULT IDXGIFactory::EnumAdapters([In] unsigned int Adapter,[Out] IDXGIAdapter** ppAdapter) + + + + Return the number of available adapters from this factory. + + The number of adapters + HRESULT IDXGIFactory::EnumAdapters([In] unsigned int Adapter,[Out] IDXGIAdapter** ppAdapter) + + + +

Enumerates the adapters (video cards).

+
+

The index of the adapter to enumerate.

+

The address of a reference to an interface at the position specified by the Adapter parameter. This parameter must not be null.

+

Returns if successful; otherwise, returns if the index is greater than or equal to the number of adapters in the local system, or if ppAdapter parameter is null.

+ +

When you create a factory, the factory enumerates the set of adapters that are available in the system. Therefore, if you change the adapters in a system, you must destroy and recreate the object. The number of adapters in a system changes when you add or remove a display card, or dock or undock a laptop.

When the EnumAdapters method succeeds and fills the ppAdapter parameter with the address of the reference to the adapter interface, EnumAdapters increments the adapter interface's reference count. When you finish using the adapter interface, call the Release method to decrement the reference count before you destroy the reference.

EnumAdapters first returns the adapter with the output on which the desktop primary is displayed. This adapter corresponds with an index of zero. EnumAdapters next returns other adapters with outputs. EnumAdapters finally returns adapters without outputs.

+
+ bb174538 + HRESULT IDXGIFactory::EnumAdapters([In] unsigned int Adapter,[Out] IDXGIAdapter** ppAdapter) + IDXGIFactory::EnumAdapters +
+ + +

Allows DXGI to monitor an application's message queue for the alt-enter key sequence (which causes the application to switch from windowed to full screen or vice versa).

+
+

The handle of the window that is to be monitored. This parameter can be null; but only if the flags are also 0.

+

One or more of the following values:

  • DXGI_MWA_NO_WINDOW_CHANGES - Prevent DXGI from monitoring an applications message queue; this makes DXGI unable to respond to mode changes.
  • DXGI_MWA_NO_ALT_ENTER - Prevent DXGI from responding to an alt-enter sequence.
  • DXGI_MWA_NO_PRINT_SCREEN - Prevent DXGI from responding to a print-screen key.
+

if WindowHandle is invalid, or E_OUTOFMEMORY.

+ + Note??If you call this API in a Session 0 process, it returns .?

The combination of WindowHandle and Flags informs DXGI to stop monitoring window messages for the previously-associated window.

If the application switches to full-screen mode, DXGI will choose a full-screen resolution to be the smallest supported resolution that is larger or the same size as the current back buffer size.

Applications can make some changes to make the transition from windowed to full screen more efficient. For example, on a WM_SIZE message, the application should release any outstanding swap-chain back buffers, call IDXGISwapChain::ResizeBuffers, then re-acquire the back buffers from the swap chain(s). This gives the swap chain(s) an opportunity to resize the back buffers, and/or recreate them to enable full-screen flipping operation. If the application does not perform this sequence, DXGI will still make the full-screen/windowed transition, but may be forced to use a stretch operation (since the back buffers may not be the correct size), which may be less efficient. Even if a stretch is not required, presentation may not be optimal because the back buffers might not be directly interchangeable with the front buffer. Thus, a call to ResizeBuffers on WM_SIZE is always recommended, since WM_SIZE is always sent during a fullscreen transition.

While windowed, the application can, if it chooses, restrict the size of its window's client area to sizes to which it is comfortable rendering. A fully flexible application would make no such restriction, but UI elements or other design considerations can, of course, make this flexibility untenable. If the application further chooses to restrict its window's client area to just those that match supported full-screen resolutions, the application can field WM_SIZING, then check against IDXGIOutput::FindClosestMatchingMode. If a matching mode is found, allow the resize. (The can be retrieved from IDXGISwapChain::GetContainingOutput. Absent subsequent changes to desktop topology, this will be the same output that will be chosen when alt-enter is fielded and fullscreen mode is begun for that swap chain.)

Applications that want to handle mode changes or Alt+Enter themselves should call MakeWindowAssociation with the DXGI_MWA_NO_WINDOW_CHANGES flag after swap chain creation. The WindowHandle argument, if non-null, specifies that the application message queues will not be handled by the DXGI runtime for all swap chains of a particular target . Calling MakeWindowAssociation with the DXGI_MWA_NO_WINDOW_CHANGES flag after swapchain creation ensures that DXGI will not interfere with application's handling of window mode changes or Alt+Enter.

+
+ bb174540 + HRESULT IDXGIFactory::MakeWindowAssociation([In] HWND WindowHandle,[In] unsigned int Flags) + IDXGIFactory::MakeWindowAssociation +
+ + +

Get the window through which the user controls the transition to and from full screen.

+
+

A reference to a window handle.

+ + Note??If you call this API in a Session 0 process, it returns .? + + bb174539 + HRESULT IDXGIFactory::GetWindowAssociation([Out] HWND* pWindowHandle) + IDXGIFactory::GetWindowAssociation +
+ + +

[Starting with Direct3D 11.1, we recommend not to use CreateSwapChain anymore to create a swap chain. Instead, use CreateSwapChainForHwnd, CreateSwapChainForCoreWindow, or CreateSwapChainForComposition depending on how you want to create the swap chain.]

Creates a swap chain.

+
+ No documentation. + No documentation. + No documentation. +

if pDesc or ppSwapChain is null, DXGI_STATUS_OCCLUDED if you request full-screen mode and it is unavailable, or E_OUTOFMEMORY. Other error codes defined by the type of device passed in may also be returned.

+ + Note??If you call this API in a Session 0 process, it returns .?

If you attempt to create a swap chain in full-screen mode, and full-screen mode is unavailable, the swap chain will be created in windowed mode and DXGI_STATUS_OCCLUDED will be returned.

If the buffer width or the buffer height is zero, the sizes will be inferred from the output window size in the swap-chain description.

Because the target output can't be chosen explicitly when the swap chain is created, we recommend not to create a full-screen swap chain. This can reduce presentation performance if the swap chain size and the output window size do not match. Here are two ways to ensure that the sizes match:

  • Create a windowed swap chain and then set it full-screen using IDXGISwapChain::SetFullscreenState.
  • Save a reference to the swap chain immediately after creation, and use it to get the output window size during a WM_SIZE event. Then resize the swap chain buffers (with IDXGISwapChain::ResizeBuffers) during the transition from windowed to full-screen.

If the swap chain is in full-screen mode, before you release it you must use SetFullscreenState to switch it to windowed mode. For more information about releasing a swap chain, see the "Destroying a Swap Chain" section of DXGI Overview.

After the runtime renders the initial frame in full screen, the runtime might unexpectedly exit full screen during a call to IDXGISwapChain::Present. To work around this issue, we recommend that you execute the following code right after you call CreateSwapChain to create a full-screen swap chain (Windowed member of set to ). +

 // Detect if newly created full-screen swap chain isn't actually full screen.
+            * pTarget;  bFullscreen;
+            if (SUCCEEDED(pSwapChain->GetFullscreenState(&bFullscreen, &pTarget)))
+            { pTarget->Release();
+            }
+            else bFullscreen = ;
+            // If not full screen, enable full screen again.
+            if (!bFullscreen)
+            { ShowWindow(hWnd, SW_MINIMIZE); ShowWindow(hWnd, SW_RESTORE); pSwapChain->SetFullscreenState(TRUE, null);
+            }
+            

You can specify and values in the swap-chain description that pDesc points to. These values allow you to use features like flip-model presentation and content protection by using pre-Windows?8 APIs.

However, to use stereo presentation and to change resize behavior for the flip model, applications must use the IDXGIFactory2::CreateSwapChainForHwnd method. Otherwise, the back-buffer contents implicitly scale to fit the presentation target size; that is, you can't turn off scaling.

+
+ bb174537 + HRESULT IDXGIFactory::CreateSwapChain([In] IUnknown* pDevice,[In] DXGI_SWAP_CHAIN_DESC* pDesc,[Out, Fast] IDXGISwapChain** ppSwapChain) + IDXGIFactory::CreateSwapChain +
+ + +

Create an adapter interface that represents a software adapter.

+
+

Handle to the software adapter's dll. HMODULE can be obtained with GetModuleHandle or LoadLibrary.

+

Address of a reference to an adapter (see ).

+ +

A software adapter is a DLL that implements the entirety of a device driver interface, plus emulation, if necessary, of kernel-mode graphics components for Windows. Details on implementing a software adapter can be found in the Windows Vista Driver Development Kit. This is a very complex development task, and is not recommended for general readers.

Calling this method will increment the module's reference count by one. The reference count can be decremented by calling FreeLibrary.

The typical calling scenario is to call LoadLibrary, pass the handle to CreateSoftwareAdapter, then immediately call FreeLibrary on the DLL and forget the DLL's HMODULE. Since the software adapter calls FreeLibrary when it is destroyed, the lifetime of the DLL will now be owned by the adapter, and the application is free of any further consideration of its lifetime.

+
+ bb174536 + HRESULT IDXGIFactory::CreateSoftwareAdapter([In] HINSTANCE Module,[Out] IDXGIAdapter** ppAdapter) + IDXGIFactory::CreateSoftwareAdapter +
+ + + Default Constructor for Factory1. + + + + + Gets both adapters (video cards) with or without outputs. + + The index of the adapter to enumerate. + a reference to an interface at the position specified by the Adapter parameter + + This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).When you create a factory, the factory enumerates the set of adapters that are available in the system. Therefore, if you change the adapters in a system, you must destroy and recreate the object. The number of adapters in a system changes when you add or remove a display card, or dock or undock a laptop.When the EnumAdapters1 method succeeds and fills the ppAdapter parameter with the address of the reference to the adapter interface, EnumAdapters1 increments the adapter interface's reference count. When you finish using the adapter interface, call the Release method to decrement the reference count before you destroy the reference.EnumAdapters1 first returns the local adapter with the output on which the desktop primary is displayed. This adapter corresponds with an index of zero. EnumAdapters1 next returns other adapters with outputs. EnumAdapters1 finally returns adapters without outputs. + + HRESULT IDXGIFactory1::EnumAdapters1([In] unsigned int Adapter,[Out] IDXGIAdapter1** ppAdapter) + + + + Return an array of available from this factory. + + HRESULT IDXGIFactory1::EnumAdapters1([In] unsigned int Adapter,[Out] IDXGIAdapter1** ppAdapter) + + + + Return the number of available adapters from this factory. + + The number of adapters + HRESULT IDXGIFactory1::EnumAdapters1([In] unsigned int Adapter,[Out] IDXGIAdapter1** ppAdapter) + + + +

Informs an application of the possible need to re-enumerate adapters.

+
+ +

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

+
+ ff471337 + IsCurrent + IsCurrent +
+ + +

Enumerates both adapters (video cards) with or without outputs.

+
+

The index of the adapter to enumerate.

+

The address of a reference to an interface at the position specified by the Adapter parameter. This parameter must not be null.

+

Returns if successful; otherwise, returns if the index is greater than or equal to the number of adapters in the local system, or if ppAdapter parameter is null.

+ +

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

When you create a factory, the factory enumerates the set of adapters that are available in the system. Therefore, if you change the adapters in a system, you must destroy and recreate the object. The number of adapters in a system changes when you add or remove a display card, or dock or undock a laptop.

When the EnumAdapters1 method succeeds and fills the ppAdapter parameter with the address of the reference to the adapter interface, EnumAdapters1 increments the adapter interface's reference count. When you finish using the adapter interface, call the Release method to decrement the reference count before you destroy the reference.

EnumAdapters1 first returns the adapter with the output on which the desktop primary is displayed. This adapter corresponds with an index of zero. EnumAdapters1 next returns other adapters with outputs. EnumAdapters1 finally returns adapters without outputs.

+
+ ff471336 + HRESULT IDXGIFactory1::EnumAdapters1([In] unsigned int Adapter,[Out] IDXGIAdapter1** ppAdapter) + IDXGIFactory1::EnumAdapters1 +
+ + +

Informs an application of the possible need to re-enumerate adapters.

+
+

, if a new adapter is becoming available or the current adapter is going away. TRUE, no adapter changes.

IsCurrent returns to inform the calling application to re-enumerate adapters.

+ +

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

+
+ ff471337 + BOOL IDXGIFactory1::IsCurrent() + IDXGIFactory1::IsCurrent +
+ + + Initializes a new instance of class. + + True - to set the DXGI_CREATE_FACTORY_DEBUG flag. + + + +

Determines whether to use stereo mode.

+
+ +

We recommend that windowed applications call IsWindowedStereoEnabled before they attempt to use stereo. IsWindowedStereoEnabled returns TRUE if both of the following items are true:

  • All adapters in the computer have drivers that are capable of stereo. This only means that the driver is implemented to the Windows Display Driver Model (WDDM) for Windows?8 (WDDM 1.2). However, the adapter does not necessarily have to be able to scan out stereo.
  • The current desktop mode (desktop modes are mono) and system policy and hardware are configured so that the Desktop Window Manager (DWM) performs stereo composition on at least one adapter output.

The creation of a windowed stereo swap chain succeeds if the first requirement is met. However, if the adapter can't scan out stereo, the output on that adapter is reduced to mono.

The Direct3D 11.1 Simple Stereo 3D Sample shows how to add a stereoscopic 3D effect and how to respond to system stereo changes.

+
+ hh404561 + IsWindowedStereoEnabled + IsWindowedStereoEnabled +
+ + +

Determines whether to use stereo mode.

+
+

Indicates whether to use stereo mode. TRUE indicates that you can use stereo mode; otherwise, .

Platform Update for Windows?7:??On Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed, IsWindowedStereoEnabled always returns because stereoscopic 3D display behavior isn?t available with the Platform Update for Windows?7. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+ +

We recommend that windowed applications call IsWindowedStereoEnabled before they attempt to use stereo. IsWindowedStereoEnabled returns TRUE if both of the following items are true:

  • All adapters in the computer have drivers that are capable of stereo. This only means that the driver is implemented to the Windows Display Driver Model (WDDM) for Windows?8 (WDDM 1.2). However, the adapter does not necessarily have to be able to scan out stereo.
  • The current desktop mode (desktop modes are mono) and system policy and hardware are configured so that the Desktop Window Manager (DWM) performs stereo composition on at least one adapter output.

The creation of a windowed stereo swap chain succeeds if the first requirement is met. However, if the adapter can't scan out stereo, the output on that adapter is reduced to mono.

The Direct3D 11.1 Simple Stereo 3D Sample shows how to add a stereoscopic 3D effect and how to respond to system stereo changes.

+
+ hh404561 + BOOL IDXGIFactory2::IsWindowedStereoEnabled() + IDXGIFactory2::IsWindowedStereoEnabled +
+ + +

Creates a swap chain that is associated with an handle to the output window for the swap chain.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

CreateSwapChainForHwnd returns:

  • if it successfully created a swap chain.
  • E_OUTOFMEMORY if memory is unavailable to complete the operation.
  • if the calling application provided invalid data, for example, if pDesc or ppSwapChain is null.
  • Possibly other error codes that are described in the DXGI_ERROR topic that are defined by the type of device that you pass to pDevice.

Platform Update for Windows?7:??DXGI_SCALING_NONE is not supported on Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed and causes CreateSwapChainForHwnd to return when called. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+ + Note??Do not use this method in Windows Store apps. Instead, use IDXGIFactory2::CreateSwapChainForCoreWindow.?

If you specify the width, height, or both (Width and Height members of that pDesc points to) of the swap chain as zero, the runtime obtains the size from the output window that the hWnd parameter specifies. You can subsequently call the IDXGISwapChain1::GetDesc1 method to retrieve the assigned width or height value.

Because you can associate only one flip presentation model swap chain at a time with an , the Microsoft Direct3D?11 policy of deferring the destruction of objects can cause problems if you attempt to destroy a flip presentation model swap chain and replace it with another swap chain. For more info about this situation, see Deferred Destruction Issues with Flip Presentation Swap Chains.

For info about how to choose a format for the swap chain's back buffer, see Converting data for the color space.

+
+ hh404557 + HRESULT IDXGIFactory2::CreateSwapChainForHwnd([In] IUnknown* pDevice,[In] HWND hWnd,[In] const DXGI_SWAP_CHAIN_DESC1* pDesc,[In, Optional] const DXGI_SWAP_CHAIN_FULLSCREEN_DESC* pFullscreenDesc,[In, Optional] IDXGIOutput* pRestrictToOutput,[Out, Fast] IDXGISwapChain1** ppSwapChain) + IDXGIFactory2::CreateSwapChainForHwnd +
+ + +

Creates a swap chain that is associated with the CoreWindow object for the output window for the swap chain.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

CreateSwapChainForCoreWindow returns:

  • if it successfully created a swap chain.
  • E_OUTOFMEMORY if memory is unavailable to complete the operation.
  • if the calling application provided invalid data, for example, if pDesc or ppSwapChain is null.
  • Possibly other error codes that are described in the DXGI_ERROR topic that are defined by the type of device that you pass to pDevice.

Platform Update for Windows?7:??On Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed, CreateSwapChainForCoreWindow fails with E_NOTIMPL. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+ + Note??Use this method in Windows Store apps rather than IDXGIFactory2::CreateSwapChainForHwnd.?

If you specify the width, height, or both (Width and Height members of that pDesc points to) of the swap chain as zero, the runtime obtains the size from the output window that the pWindow parameter specifies. You can subsequently call the IDXGISwapChain1::GetDesc1 method to retrieve the assigned width or height value.

Because you can associate only one flip presentation model swap chain (per layer) at a time with a CoreWindow, the Microsoft Direct3D?11 policy of deferring the destruction of objects can cause problems if you attempt to destroy a flip presentation model swap chain and replace it with another swap chain. For more info about this situation, see Deferred Destruction Issues with Flip Presentation Swap Chains.

For info about how to choose a format for the swap chain's back buffer, see Converting data for the color space.

+
+ hh404559 + HRESULT IDXGIFactory2::CreateSwapChainForCoreWindow([In] IUnknown* pDevice,[In] IUnknown* pWindow,[In] const DXGI_SWAP_CHAIN_DESC1* pDesc,[In, Optional] IDXGIOutput* pRestrictToOutput,[Out, Fast] IDXGISwapChain1** ppSwapChain) + IDXGIFactory2::CreateSwapChainForCoreWindow +
+ + +

Identifies the adapter on which a shared resource object was created.

+
+

A handle to a shared resource object. The IDXGIResource1::CreateSharedHandle method returns this handle.

+

A reference to a variable that receives a locally unique identifier () value that identifies the adapter. is defined in Dxgi.h. An is a 64-bit value that is guaranteed to be unique only on the operating system on which it was generated. The uniqueness of an is guaranteed only until the operating system is restarted.

+

GetSharedResourceAdapterLuid returns:

  • if it identified the adapter.
  • if hResource is invalid.
  • Possibly other error codes that are described in the DXGI_ERROR topic.

Platform Update for Windows?7:??On Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed, GetSharedResourceAdapterLuid fails with E_NOTIMPL. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+ +

You cannot share resources across adapters. Therefore, you cannot open a shared resource on an adapter other than the adapter on which the resource was created. Call GetSharedResourceAdapterLuid before you open a shared resource to ensure that the resource was created on the appropriate adapter. To open a shared resource, call the ID3D11Device1::OpenSharedResource1 or ID3D11Device1::OpenSharedResourceByName method.

+
+ hh404560 + HRESULT IDXGIFactory2::GetSharedResourceAdapterLuid([In] void* hResource,[Out] LUID* pLuid) + IDXGIFactory2::GetSharedResourceAdapterLuid +
+ + +

Registers an application window to receive notification messages of changes of stereo status.

+
+

The handle of the window to send a notification message to when stereo status change occurs.

+

Identifies the notification message to send.

+

A reference to a key value that an application can pass to the IDXGIFactory2::UnregisterStereoStatus method to unregister the notification message that wMsg specifies.

+

RegisterStereoStatusWindow returns:

  • if it successfully registered the window.
  • E_OUTOFMEMORY if memory is unavailable to complete the operation.
  • Possibly other error codes that are described in the DXGI_ERROR topic.

Platform Update for Windows?7:??On Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed, RegisterStereoStatusWindow fails with E_NOTIMPL. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+ hh404587 + HRESULT IDXGIFactory2::RegisterStereoStatusWindow([In] HWND WindowHandle,[In] unsigned int wMsg,[Out] DWORD* pdwCookie) + IDXGIFactory2::RegisterStereoStatusWindow +
+ + +

Registers to receive notification of changes in stereo status by using event signaling.

+
+

A handle to the event object that the operating system sets when notification of stereo status change occurs. The CreateEvent or OpenEvent function returns this handle.

+

A reference to a key value that an application can pass to the IDXGIFactory2::UnregisterStereoStatus method to unregister the notification event that hEvent specifies.

+

RegisterStereoStatusEvent returns:

  • if it successfully registered the event.
  • E_OUTOFMEMORY if memory is unavailable to complete the operation.
  • Possibly other error codes that are described in the DXGI_ERROR topic.

Platform Update for Windows?7:??On Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed, RegisterStereoStatusEvent fails with E_NOTIMPL. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+ hh404584 + HRESULT IDXGIFactory2::RegisterStereoStatusEvent([In] void* hEvent,[Out] DWORD* pdwCookie) + IDXGIFactory2::RegisterStereoStatusEvent +
+ + +

Unregisters a window or an event to stop it from receiving notification when stereo status changes.

+
+

A key value for the window or event to unregister. The IDXGIFactory2::RegisterStereoStatusWindow or IDXGIFactory2::RegisterStereoStatusEvent method returns this value.

+ +

Platform Update for Windows?7:??On Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed, UnregisterStereoStatus has no effect. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+
+ hh404593 + void IDXGIFactory2::UnregisterStereoStatus([In] DWORD dwCookie) + IDXGIFactory2::UnregisterStereoStatus +
+ + +

Registers an application window to receive notification messages of changes of occlusion status.

+
+

The handle of the window to send a notification message to when occlusion status change occurs.

+

Identifies the notification message to send.

+

A reference to a key value that an application can pass to the IDXGIFactory2::UnregisterOcclusionStatus method to unregister the notification message that wMsg specifies.

+

RegisterOcclusionStatusWindow returns:

  • if it successfully registered the window.
  • E_OUTOFMEMORY if memory is unavailable to complete the operation.
  • if WindowHandle is not a valid window handle or not the window handle that the current process owns.
  • Possibly other error codes that are described in the DXGI_ERROR topic.

Platform Update for Windows?7:??On Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed, RegisterOcclusionStatusWindow fails with E_NOTIMPL. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+ +

Apps choose the Windows message that Windows sends when occlusion status changes.

+
+ hh404581 + HRESULT IDXGIFactory2::RegisterOcclusionStatusWindow([In] HWND WindowHandle,[In] unsigned int wMsg,[Out] DWORD* pdwCookie) + IDXGIFactory2::RegisterOcclusionStatusWindow +
+ + +

Registers to receive notification of changes in occlusion status by using event signaling.

+
+

A handle to the event object that the operating system sets when notification of occlusion status change occurs. The CreateEvent or OpenEvent function returns this handle.

+

A reference to a key value that an application can pass to the IDXGIFactory2::UnregisterOcclusionStatus method to unregister the notification event that hEvent specifies.

+

RegisterOcclusionStatusEvent returns:

  • if the method successfully registered the event.
  • E_OUTOFMEMORY if memory is unavailable to complete the operation.
  • if hEvent is not a valid handle or not an event handle.
  • Possibly other error codes that are described in the DXGI_ERROR topic.

Platform Update for Windows?7:??On Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed, RegisterOcclusionStatusEvent fails with E_NOTIMPL. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+ +

If you call RegisterOcclusionStatusEvent multiple times with the same event handle, RegisterOcclusionStatusEvent fails with .

If you call RegisterOcclusionStatusEvent multiple times with the different event handles, RegisterOcclusionStatusEvent properly registers the events.

+
+ hh404578 + HRESULT IDXGIFactory2::RegisterOcclusionStatusEvent([In] void* hEvent,[Out] DWORD* pdwCookie) + IDXGIFactory2::RegisterOcclusionStatusEvent +
+ + +

Unregisters a window or an event to stop it from receiving notification when occlusion status changes.

+
+

A key value for the window or event to unregister. The IDXGIFactory2::RegisterOcclusionStatusWindow or IDXGIFactory2::RegisterOcclusionStatusEvent method returns this value.

+ +

Platform Update for Windows?7:??On Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed, UnregisterOcclusionStatus has no effect. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+
+ hh404590 + void IDXGIFactory2::UnregisterOcclusionStatus([In] DWORD dwCookie) + IDXGIFactory2::UnregisterOcclusionStatus +
+ + +

Creates a swap chain that you can use to send Direct3D content into the DirectComposition API or the Windows.UI.Xaml framework to compose in a window.

+
+ No documentation. + No documentation. + No documentation. + No documentation. +

CreateSwapChainForComposition returns:

  • if it successfully created a swap chain.
  • E_OUTOFMEMORY if memory is unavailable to complete the operation.
  • if the calling application provided invalid data, for example, if pDesc or ppSwapChain is null.
  • Possibly other error codes that are described in the DXGI_ERROR topic that are defined by the type of device that you pass to pDevice.

Platform Update for Windows?7:??On Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed, CreateSwapChainForComposition fails with E_NOTIMPL. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+ +

You can use composition swap chains with either DirectComposition?s interface or XAML?s SwapChainBackgroundPanel class. For DirectComposition, you can call the IDCompositionVisual::SetContent method to set the swap chain as the content of a visual object, which then allows you to bind the swap chain to the visual tree. For XAML, the SwapChainBackgroundPanel class exposes a classic COM interface . You can use the ISwapChainBackgroundPanelNative::SetSwapChain method to bind to the XAML UI graph. For info about how to use composition swap chains with XAML?s SwapChainBackgroundPanel class, see DirectX and XAML interop.

The IDXGISwapChain::SetFullscreenState, IDXGISwapChain::ResizeTarget, IDXGISwapChain::GetContainingOutput, IDXGISwapChain1::GetHwnd, and IDXGISwapChain::GetCoreWindow methods aren't valid on this type of swap chain. If you call any of these methods on this type of swap chain, they fail.

For info about how to choose a format for the swap chain's back buffer, see Converting data for the color space.

+
+ hh404558 + HRESULT IDXGIFactory2::CreateSwapChainForComposition([In] IUnknown* pDevice,[In] const DXGI_SWAP_CHAIN_DESC1* pDesc,[In, Optional] IDXGIOutput* pRestrictToOutput,[Out, Fast] IDXGISwapChain1** ppSwapChain) + IDXGIFactory2::CreateSwapChainForComposition +
+ + + Initializes a new instance of class. + + + + + Gets the default warp adapter. + + The warp adapter. + + + + Gets the adapter for the specified LUID. + + A unique value that identifies the adapter. + The adapter. + + + +

Outputs the for the specified .

+
+ No documentation. + No documentation. + No documentation. +

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR. See also Direct3D 12 Return Codes.

+ +

For Direct3D 12, it's no longer possible to backtrack from a device to the that was used to create it. IDXGIFactory4::EnumAdapterByLuid enables an app to retrieve information about the adapter where a D3D12 device was created. IDXGIFactory4::EnumAdapterByLuid is designed to be paired with ID3D12Device::GetAdapterLuid. For more information, see DXGI 1.4 Improvements.

+
+ mt427786 + HRESULT IDXGIFactory4::EnumAdapterByLuid([In] LUID AdapterLuid,[In] const GUID& riid,[Out] void** ppvAdapter) + IDXGIFactory4::EnumAdapterByLuid +
+ + +

Provides an adapter which can be provided to D3D12CreateDevice to use the WARP renderer.

+
+

The globally unique identifier () of the object referenced by the ppvAdapter parameter.

+

The address of an interface reference to the adapter. This parameter must not be null.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR. See also Direct3D 12 Return Codes.

+ +

For more information, see DXGI 1.4 Improvements.

+
+ mt427787 + HRESULT IDXGIFactory4::EnumWarpAdapter([In] const GUID& riid,[Out] void** ppvAdapter) + IDXGIFactory4::EnumWarpAdapter +
+ + + Helper to use with . + + + + + Calculates the size of a in bytes. Can be 0 for compressed format (as they are less than 1 byte) + + The DXGI format. + size of in bytes + + + + Calculates the size of a in bits. + + The DXGI format. + size of in bits + + + + Returns true if the is valid. + + A format to validate + True if the is valid. + + + + Returns true if the is a compressed format. + + The format to check for compressed. + True if the is a compressed format + + + + Determines whether the specified is packed. + + The DXGI Format. + true if the specified is packed; otherwise, false. + + + + Determines whether the specified is video. + + The . + true if the specified is video; otherwise, false. + + + + Determines whether the specified is a SRGB format. + + The . + true if the specified is a SRGB format; otherwise, false. + + + + Determines whether the specified is typeless. + + The . + true if the specified is typeless; otherwise, false. + + + + Computes the scanline count (number of scanlines). + + The . + The height. + The scanline count. + + + + Static initializer to speed up size calculation (not sure the JIT is enough "smart" for this kind of thing). + + + + + If the DXGI debug layer is installed (e.g. on developer machines), creates the DXGI InfoQueue object. + Otherwise, returns null. + + + Currently doesn't work for Windows Store (aka UWP) apps + + + + +

Sets the maximum number of messages that can be added to the message queue.

+
+

A DXGI_DEBUG_ID value that identifies the entity that sets the limit on the number of messages.

+

The maximum number of messages that can be added to the queue. ?1 means no limit.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780391 + HRESULT IDXGIInfoQueue::SetMessageCountLimit([In] GUID Producer,[In] unsigned longlong MessageCountLimit) + IDXGIInfoQueue::SetMessageCountLimit +
+ + +

Clears all messages from the message queue.

+
+

A DXGI_DEBUG_ID value that identifies the entity that clears the messages.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780362 + void IDXGIInfoQueue::ClearStoredMessages([In] GUID Producer) + IDXGIInfoQueue::ClearStoredMessages +
+ + +

Gets a message from the message queue.

+
+

A DXGI_DEBUG_ID value that identifies the entity that gets the message.

+

An index into the message queue after an optional retrieval filter has been applied. This can be between 0 and the number of messages in the message queue that pass through the retrieval filter. Call IDXGIInfoQueue::GetNumStoredMessagesAllowedByRetrievalFilters to obtain this number. 0 is the message at the beginning of the message queue.

+

A reference to a structure that describes the message.

+

A reference to a variable that receives the size, in bytes, of the message description that pMessage points to. This size includes the size of the message string that pMessage points to.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ +

This method doesn't remove any messages from the message queue.

This method gets a message from the message queue after an optional retrieval filter has been applied.

Call this method twice to retrieve a message, first to obtain the size of the message and second to get the message. Here is a typical example:

 // Get the size of the message.
+             messageLength = 0;
+             hr = pInfoQueue->GetMessage(DXGI_DEBUG_ALL, 0, null, &messageLength); // Allocate space and get the message.
+             * pMessage = (*)malloc(messageLength);
+            hr = pInfoQueue->GetMessage(DXGI_DEBUG_ALL, 0, pMessage, &messageLength);
+            
Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? +
+ hh780366 + HRESULT IDXGIInfoQueue::GetMessageW([In] GUID Producer,[In] unsigned longlong MessageIndex,[Out, Buffer, Optional] DXGI_INFO_QUEUE_MESSAGE* pMessage,[InOut] SIZE_T* pMessageByteLength) + IDXGIInfoQueue::GetMessageW +
+ + +

Gets the number of messages that can pass through a retrieval filter.

+
+

A DXGI_DEBUG_ID value that identifies the entity that gets the number.

+

Returns the number of messages that can pass through a retrieval filter.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780373 + unsigned longlong IDXGIInfoQueue::GetNumStoredMessagesAllowedByRetrievalFilters([In] GUID Producer) + IDXGIInfoQueue::GetNumStoredMessagesAllowedByRetrievalFilters +
+ + +

Gets the number of messages currently stored in the message queue.

+
+

A DXGI_DEBUG_ID value that identifies the entity that gets the number.

+

Returns the number of messages currently stored in the message queue.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780372 + unsigned longlong IDXGIInfoQueue::GetNumStoredMessages([In] GUID Producer) + IDXGIInfoQueue::GetNumStoredMessages +
+ + +

Gets the number of messages that were discarded due to the message count limit.

+
+

A DXGI_DEBUG_ID value that identifies the entity that gets the number.

+

Returns the number of messages that were discarded.

+ +

Get and set the message count limit with IDXGIInfoQueue::GetMessageCountLimit and IDXGIInfoQueue::SetMessageCountLimit, respectively.

Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? +
+ hh780371 + unsigned longlong IDXGIInfoQueue::GetNumMessagesDiscardedByMessageCountLimit([In] GUID Producer) + IDXGIInfoQueue::GetNumMessagesDiscardedByMessageCountLimit +
+ + +

Gets the maximum number of messages that can be added to the message queue.

+
+

A DXGI_DEBUG_ID value that identifies the entity that gets the number.

+

Returns the maximum number of messages that can be added to the queue. ?1 means no limit.

+ +

When the number of messages in the message queue reaches the maximum limit, new messages coming in push old messages out.

Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? +
+ hh780367 + unsigned longlong IDXGIInfoQueue::GetMessageCountLimit([In] GUID Producer) + IDXGIInfoQueue::GetMessageCountLimit +
+ + +

Gets the number of messages that a storage filter allowed to pass through.

+
+

A DXGI_DEBUG_ID value that identifies the entity that gets the number.

+

Returns the number of messages allowed by a storage filter.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780369 + unsigned longlong IDXGIInfoQueue::GetNumMessagesAllowedByStorageFilter([In] GUID Producer) + IDXGIInfoQueue::GetNumMessagesAllowedByStorageFilter +
+ + +

Gets the number of messages that were denied passage through a storage filter.

+
+

A DXGI_DEBUG_ID value that identifies the entity that gets the number.

+

Returns the number of messages denied by a storage filter.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780370 + unsigned longlong IDXGIInfoQueue::GetNumMessagesDeniedByStorageFilter([In] GUID Producer) + IDXGIInfoQueue::GetNumMessagesDeniedByStorageFilter +
+ + +

Adds storage filters to the top of the storage-filter stack.

+
+

A DXGI_DEBUG_ID value that identifies the entity that produced the filters.

+

An array of structures that describe the filters.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780359 + HRESULT IDXGIInfoQueue::AddStorageFilterEntries([In] GUID Producer,[In] DXGI_INFO_QUEUE_FILTER* pFilter) + IDXGIInfoQueue::AddStorageFilterEntries +
+ + +

Gets the storage filter at the top of the storage-filter stack.

+
+

A DXGI_DEBUG_ID value that identifies the entity that gets the filter.

+

A reference to a structure that describes the filter.

+

A reference to a variable that receives the size, in bytes, of the filter description to which pFilter points. If pFilter is null, GetStorageFilter outputs the size of the storage filter.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780376 + HRESULT IDXGIInfoQueue::GetStorageFilter([In] GUID Producer,[Out, Buffer, Optional] DXGI_INFO_QUEUE_FILTER* pFilter,[InOut] SIZE_T* pFilterByteLength) + IDXGIInfoQueue::GetStorageFilter +
+ + +

Removes a storage filter from the top of the storage-filter stack.

+
+

A DXGI_DEBUG_ID value that identifies the entity that removes the filter.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780361 + void IDXGIInfoQueue::ClearStorageFilter([In] GUID Producer) + IDXGIInfoQueue::ClearStorageFilter +
+ + +

Pushes an empty storage filter onto the storage-filter stack.

+
+

A DXGI_DEBUG_ID value that identifies the entity that pushes the empty storage filter.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ +

An empty storage filter allows all messages to pass through.

Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? +
+ hh780385 + HRESULT IDXGIInfoQueue::PushEmptyStorageFilter([In] GUID Producer) + IDXGIInfoQueue::PushEmptyStorageFilter +
+ + +

Pushes a deny-all storage filter onto the storage-filter stack.

+
+

A DXGI_DEBUG_ID value that identifies the entity that pushes the filter.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ +

A deny-all storage filter prevents all messages from passing through.

Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? +
+ hh780383 + HRESULT IDXGIInfoQueue::PushDenyAllStorageFilter([In] GUID Producer) + IDXGIInfoQueue::PushDenyAllStorageFilter +
+ + +

Pushes a copy of the storage filter that is currently on the top of the storage-filter stack onto the storage-filter stack.

+
+

A DXGI_DEBUG_ID value that identifies the entity that pushes the copy of the storage filter.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780381 + HRESULT IDXGIInfoQueue::PushCopyOfStorageFilter([In] GUID Producer) + IDXGIInfoQueue::PushCopyOfStorageFilter +
+ + +

Pushes a storage filter onto the storage-filter stack.

+
+

A DXGI_DEBUG_ID value that identifies the entity that pushes the filter.

+

A reference to a structure that describes the filter.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780387 + HRESULT IDXGIInfoQueue::PushStorageFilter([In] GUID Producer,[In] DXGI_INFO_QUEUE_FILTER* pFilter) + IDXGIInfoQueue::PushStorageFilter +
+ + +

Pops a storage filter from the top of the storage-filter stack.

+
+

A DXGI_DEBUG_ID value that identifies the entity that pops the filter.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780379 + void IDXGIInfoQueue::PopStorageFilter([In] GUID Producer) + IDXGIInfoQueue::PopStorageFilter +
+ + +

Gets the size of the storage-filter stack in bytes.

+
+

A DXGI_DEBUG_ID value that identifies the entity that gets the size.

+

Returns the size of the storage-filter stack in bytes.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780377 + unsigned int IDXGIInfoQueue::GetStorageFilterStackSize([In] GUID Producer) + IDXGIInfoQueue::GetStorageFilterStackSize +
+ + +

Adds retrieval filters to the top of the retrieval-filter stack.

+
+

A DXGI_DEBUG_ID value that identifies the entity that produced the filters.

+

An array of structures that describe the filters.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780358 + HRESULT IDXGIInfoQueue::AddRetrievalFilterEntries([In] GUID Producer,[In] DXGI_INFO_QUEUE_FILTER* pFilter) + IDXGIInfoQueue::AddRetrievalFilterEntries +
+ + +

Gets the retrieval filter at the top of the retrieval-filter stack.

+
+

A DXGI_DEBUG_ID value that identifies the entity that gets the filter.

+

A reference to a structure that describes the filter.

+

A reference to a variable that receives the size, in bytes, of the filter description to which pFilter points. If pFilter is null, GetRetrievalFilter outputs the size of the retrieval filter.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780374 + HRESULT IDXGIInfoQueue::GetRetrievalFilter([In] GUID Producer,[Out, Buffer, Optional] DXGI_INFO_QUEUE_FILTER* pFilter,[InOut] SIZE_T* pFilterByteLength) + IDXGIInfoQueue::GetRetrievalFilter +
+ + +

Removes a retrieval filter from the top of the retrieval-filter stack.

+
+

A DXGI_DEBUG_ID value that identifies the entity that removes the filter.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780360 + void IDXGIInfoQueue::ClearRetrievalFilter([In] GUID Producer) + IDXGIInfoQueue::ClearRetrievalFilter +
+ + +

Pushes an empty retrieval filter onto the retrieval-filter stack.

+
+

A DXGI_DEBUG_ID value that identifies the entity that pushes the empty retrieval filter.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ +

An empty retrieval filter allows all messages to pass through.

Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? +
+ hh780384 + HRESULT IDXGIInfoQueue::PushEmptyRetrievalFilter([In] GUID Producer) + IDXGIInfoQueue::PushEmptyRetrievalFilter +
+ + +

Pushes a deny-all retrieval filter onto the retrieval-filter stack.

+
+

A DXGI_DEBUG_ID value that identifies the entity that pushes the deny-all retrieval filter.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ +

A deny-all retrieval filter prevents all messages from passing through.

Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? +
+ hh780382 + HRESULT IDXGIInfoQueue::PushDenyAllRetrievalFilter([In] GUID Producer) + IDXGIInfoQueue::PushDenyAllRetrievalFilter +
+ + +

Pushes a copy of the retrieval filter that is currently on the top of the retrieval-filter stack onto the retrieval-filter stack.

+
+

A DXGI_DEBUG_ID value that identifies the entity that pushes the copy of the retrieval filter.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780380 + HRESULT IDXGIInfoQueue::PushCopyOfRetrievalFilter([In] GUID Producer) + IDXGIInfoQueue::PushCopyOfRetrievalFilter +
+ + +

Pushes a retrieval filter onto the retrieval-filter stack.

+
+

A DXGI_DEBUG_ID value that identifies the entity that pushes the filter.

+

A reference to a structure that describes the filter.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780386 + HRESULT IDXGIInfoQueue::PushRetrievalFilter([In] GUID Producer,[In] DXGI_INFO_QUEUE_FILTER* pFilter) + IDXGIInfoQueue::PushRetrievalFilter +
+ + +

Pops a retrieval filter from the top of the retrieval-filter stack.

+
+

A DXGI_DEBUG_ID value that identifies the entity that pops the filter.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780378 + void IDXGIInfoQueue::PopRetrievalFilter([In] GUID Producer) + IDXGIInfoQueue::PopRetrievalFilter +
+ + +

Gets the size of the retrieval-filter stack in bytes.

+
+

A DXGI_DEBUG_ID value that identifies the entity that gets the size.

+

Returns the size of the retrieval-filter stack in bytes.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780375 + unsigned int IDXGIInfoQueue::GetRetrievalFilterStackSize([In] GUID Producer) + IDXGIInfoQueue::GetRetrievalFilterStackSize +
+ + +

Adds a debug message to the message queue and sends that message to the debug output.

+
+

A DXGI_DEBUG_ID value that identifies the entity that produced the message.

+

A -typed value that specifies the category of the message.

+

A -typed value that specifies the severity of the message.

+

An integer that uniquely identifies the message.

+

The message string.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780357 + HRESULT IDXGIInfoQueue::AddMessage([In] GUID Producer,[In] DXGI_INFO_QUEUE_MESSAGE_CATEGORY Category,[In] DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity,[In] int ID,[In] const char* pDescription) + IDXGIInfoQueue::AddMessage +
+ + +

Adds a user-defined message to the message queue and sends that message to the debug output.

+
+

A -typed value that specifies the severity of the message.

+

The message string.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780356 + HRESULT IDXGIInfoQueue::AddApplicationMessage([In] DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity,[In] const char* pDescription) + IDXGIInfoQueue::AddApplicationMessage +
+ + +

Sets a message category to break on when a message with that category passes through the storage filter.

+
+

A DXGI_DEBUG_ID value that identifies the entity that sets the breaking condition.

+

A -typed value that specifies the category of the message.

+

A Boolean value that specifies whether SetBreakOnCategory turns on or off this breaking condition (TRUE for on, for off).

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780388 + HRESULT IDXGIInfoQueue::SetBreakOnCategory([In] GUID Producer,[In] DXGI_INFO_QUEUE_MESSAGE_CATEGORY Category,[In] BOOL bEnable) + IDXGIInfoQueue::SetBreakOnCategory +
+ + +

Sets a message severity level to break on when a message with that severity level passes through the storage filter.

+
+

A DXGI_DEBUG_ID value that identifies the entity that sets the breaking condition.

+

A -typed value that specifies the severity of the message.

+

A Boolean value that specifies whether SetBreakOnSeverity turns on or off this breaking condition (TRUE for on, for off).

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780390 + HRESULT IDXGIInfoQueue::SetBreakOnSeverity([In] GUID Producer,[In] DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity,[In] BOOL bEnable) + IDXGIInfoQueue::SetBreakOnSeverity +
+ + +

Sets a message identifier to break on when a message with that identifier passes through the storage filter.

+
+

A DXGI_DEBUG_ID value that identifies the entity that sets the breaking condition.

+

An integer value that specifies the identifier of the message.

+

A Boolean value that specifies whether SetBreakOnID turns on or off this breaking condition (TRUE for on, for off).

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780389 + HRESULT IDXGIInfoQueue::SetBreakOnID([In] GUID Producer,[In] int ID,[In] BOOL bEnable) + IDXGIInfoQueue::SetBreakOnID +
+ + +

Determines whether the break on a message category is turned on or off.

+
+

A DXGI_DEBUG_ID value that identifies the entity that gets the breaking status.

+

A -typed value that specifies the category of the message.

+

Returns a Boolean value that specifies whether this category of breaking condition is turned on or off (TRUE for on, for off).

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780363 + BOOL IDXGIInfoQueue::GetBreakOnCategory([In] GUID Producer,[In] DXGI_INFO_QUEUE_MESSAGE_CATEGORY Category) + IDXGIInfoQueue::GetBreakOnCategory +
+ + +

Determines whether the break on a message severity level is turned on or off.

+
+

A DXGI_DEBUG_ID value that identifies the entity that gets the breaking status.

+

A -typed value that specifies the severity of the message.

+

Returns a Boolean value that specifies whether this severity of breaking condition is turned on or off (TRUE for on, for off).

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780365 + BOOL IDXGIInfoQueue::GetBreakOnSeverity([In] GUID Producer,[In] DXGI_INFO_QUEUE_MESSAGE_SEVERITY Severity) + IDXGIInfoQueue::GetBreakOnSeverity +
+ + +

Determines whether the break on a message identifier is turned on or off.

+
+

A DXGI_DEBUG_ID value that identifies the entity that gets the breaking status.

+

An integer value that specifies the identifier of the message.

+

Returns a Boolean value that specifies whether this break on a message identifier is turned on or off (TRUE for on, for off).

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780364 + BOOL IDXGIInfoQueue::GetBreakOnID([In] GUID Producer,[In] int ID) + IDXGIInfoQueue::GetBreakOnID +
+ + +

Turns the debug output on or off.

+
+

A DXGI_DEBUG_ID value that identifies the entity that gets the mute status.

+

A Boolean value that specifies whether to turn the debug output on or off (TRUE for on, for off).

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780392 + void IDXGIInfoQueue::SetMuteDebugOutput([In] GUID Producer,[In] BOOL bMute) + IDXGIInfoQueue::SetMuteDebugOutput +
+ + +

Determines whether the debug output is turned on or off.

+
+

A DXGI_DEBUG_ID value that identifies the entity that gets the mute status.

+

Returns a Boolean value that specifies whether the debug output is turned on or off (TRUE for on, for off).

+ + Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? + + hh780368 + BOOL IDXGIInfoQueue::GetMuteDebugOutput([In] GUID Producer) + IDXGIInfoQueue::GetMuteDebugOutput +
+ + + Gets the set of regions that must be updated on the shared surface. + + + + + Event fired when an update is needed. Use to get the region to update. + + + + +

Gets the boundaries of the visible region of the shared surface.

+
+ hh848331 + GetVisibleBounds + GetVisibleBounds +
+ + +

Invalidates a specific region of the shared surface for drawing.

+
+

The region of the surface to invalidate.

+

If this method succeeds, it returns . Otherwise, it returns an error code.

+ hh848332 + HRESULT IVirtualSurfaceImageSourceNative::Invalidate([In] RECT updateRect) + IVirtualSurfaceImageSourceNative::Invalidate +
+ + +

Gets the total number of regions of the surface that must be updated.

+
+

Receives the number of regions to update.

+ hh848329 + HRESULT IVirtualSurfaceImageSourceNative::GetUpdateRectCount([Out] DWORD* count) + IVirtualSurfaceImageSourceNative::GetUpdateRectCount +
+ + +

Gets the set of regions that must be updated on the shared surface.

+
+

The number of regions that must be updated. You obtain this by calling GetUpdateRectCount.

+

Receives a list of regions that must be updated.

+

If this method succeeds, it returns . Otherwise, it returns an error code.

+ hh848330 + HRESULT IVirtualSurfaceImageSourceNative::GetUpdateRects([Out, Buffer] RECT* updates,[In] DWORD count) + IVirtualSurfaceImageSourceNative::GetUpdateRects +
+ + +

Gets the boundaries of the visible region of the shared surface.

+
+

Receives a rectangle that specifies the visible region of the shared surface.

+

If this method succeeds, it returns . Otherwise, it returns an error code.

+ hh848331 + HRESULT IVirtualSurfaceImageSourceNative::GetVisibleBounds([Out] RECT* bounds) + IVirtualSurfaceImageSourceNative::GetVisibleBounds +
+ + +

Registers for the callback that will perform the drawing when an update to the shared surface is requested.

+
+

Pointer to an implementation of .

+

If this method succeeds, it returns . Otherwise, it returns an error code.

+ hh848334 + HRESULT IVirtualSurfaceImageSourceNative::RegisterForUpdatesNeeded([In, Optional] IVirtualSurfaceUpdatesCallbackNative* callback) + IVirtualSurfaceImageSourceNative::RegisterForUpdatesNeeded +
+ + +

Resizes the surface.

+
+

The updated width of the surface.

+

The updated height of the surface.

+

If this method succeeds, it returns . Otherwise, it returns an error code.

+ hh848335 + HRESULT IVirtualSurfaceImageSourceNative::Resize([In] int newWidth,[In] int newHeight) + IVirtualSurfaceImageSourceNative::Resize +
+ + + Callback method for IVirtualSurfaceUpdatesCallbackNative + + HRESULT IVirtualSurfaceUpdatesCallbackNative::UpdatesNeeded() + + + +

Performs the drawing behaviors when an update to VirtualSurfaceImageSource is requested.

+
+

If this method succeeds, it returns . Otherwise, it returns an error code.

+ +

This method is implemented by the developer.

+
+ hh848337 + HRESULT IVirtualSurfaceUpdatesCallbackNative::UpdatesNeeded() + IVirtualSurfaceUpdatesCallbackNative::UpdatesNeeded +
+ + +

Describes a display mode.

+
+ +

This structure is used by the GetDisplayModeList and FindClosestMatchingMode methods.

The following format values are valid for display modes and when you create a bit-block transfer (bitblt) model swap chain. The valid values depend on the feature level that you are working with.

  • Feature level >= 9.1

    • DXGI_FORMAT_R8G8B8A8_UNORM
    • DXGI_FORMAT_R8G8B8A8_UNORM_SRGB
    • DXGI_FORMAT_B8G8R8A8_UNORM (except 10.x on Windows?Vista)
    • DXGI_FORMAT_B8G8R8A8_UNORM_SRGB (except 10.x on Windows?Vista)
  • Feature level >= 10.0

    • DXGI_FORMAT_R16G16B16A16_FLOAT
    • DXGI_FORMAT_R10G10B10A2_UNORM
  • Feature level >= 11.0

    • DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM

You can pass one of these format values to ID3D11Device::CheckFormatSupport to determine if it is a valid format for displaying on screen. If ID3D11Device::CheckFormatSupport returns D3D11_FORMAT_SUPPORT_DISPLAY in the bit field to which the pFormatSupport parameter points, the format is valid for displaying on screen.

Starting with Windows?8 for a flip model swap chain (that is, a swap chain that has the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL value set in the SwapEffect member of ), you must set the Format member of to DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_B8G8R8A8_UNORM, or DXGI_FORMAT_R8G8B8A8_UNORM.

Because of the relaxed render target creation rules that Direct3D 11 has for back buffers, applications can create a DXGI_FORMAT_B8G8R8A8_UNORM_SRGB render target view from a DXGI_FORMAT_B8G8R8A8_UNORM swap chain so they can use automatic color space conversion when they render the swap chain.

+
+ bb173064 + DXGI_MODE_DESC + DXGI_MODE_DESC +
+ + + Initializes a new instance of the structure. + + The width. + The height. + The refresh rate. + The format. + + + + Initializes a new instance of the struct. + + The format. + + + +

A value that describes the resolution width. If you specify the width as zero when you call the IDXGIFactory::CreateSwapChain method to create a swap chain, the runtime obtains the width from the output window and assigns this width value to the swap-chain description. You can subsequently call the IDXGISwapChain::GetDesc method to retrieve the assigned width value.

+
+ bb173064 + Width + Width +
+ + +

A value describing the resolution height. If you specify the height as zero when you call the IDXGIFactory::CreateSwapChain method to create a swap chain, the runtime obtains the height from the output window and assigns this height value to the swap-chain description. You can subsequently call the IDXGISwapChain::GetDesc method to retrieve the assigned height value.

+
+ bb173064 + Height + Height +
+ + +

A structure describing the refresh rate in hertz

+
+ bb173064 + RefreshRate + RefreshRate +
+ + +

A structure describing the display format.

+
+ bb173064 + Format + Format +
+ + +

A member of the enumerated type describing the scanline drawing mode.

+
+ bb173064 + ScanlineOrdering + ScanlineOrdering +
+ + +

A member of the enumerated type describing the scaling mode.

+
+ bb173064 + Scaling + Scaling +
+ + + Internal class used to initialize this assembly. + + + + + Initializes this assembly. + + + This method is called when the assembly is loaded. + + + + + The namespace provides a managed DXGI API. + + hh404534 + DXGI + DXGI + + + + Find the display mode that most closely matches the requested display mode. + + + Direct3D devices require UNORM formats. This method finds the closest matching available display mode to the mode specified in pModeToMatch. Similarly ranked fields (i.e. all specified, or all unspecified, etc) are resolved in the following order. ScanlineOrdering Scaling Format Resolution RefreshRate When determining the closest value for a particular field, previously matched fields are used to filter the display mode list choices, and other fields are ignored. For example, when matching Resolution, the display mode list will have already been filtered by a certain ScanlineOrdering, Scaling, and Format, while RefreshRate is ignored. This ordering doesn't define the absolute ordering for every usage scenario of FindClosestMatchingMode, because the application can choose some values initially, effectively changing the order that fields are chosen. Fields of the display mode are matched one at a time, generally in a specified order. If a field is unspecified, FindClosestMatchingMode gravitates toward the values for the desktop related to this output. If this output is not part of the desktop, then the default desktop output is used to find values. If an application uses a fully unspecified display mode, FindClosestMatchingMode will typically return a display mode that matches the desktop settings for this output. Unspecified fields are lower priority than specified fields and will be resolved later than specified fields. + + A reference to the Direct3D device interface. If this parameter is NULL, only modes whose format matches that of pModeToMatch will be returned; otherwise, only those formats that are supported for scan-out by the device are returned. + The desired display mode (see ). Members of DXGI_MODE_DESC can be unspecified indicating no preference for that member. A value of 0 for Width or Height indicates the value is unspecified. If either Width or Height are 0 both must be 0. A numerator and denominator of 0 in RefreshRate indicate it is unspecified. Other members of DXGI_MODE_DESC have enumeration values indicating the member is unspecified. If pConnectedDevice is NULL Format cannot be DXGI_FORMAT_UNKNOWN. + The mode that most closely matches pModeToMatch. + Returns one of the following . + HRESULT IDXGIOutput::FindClosestMatchingMode([In] const DXGI_MODE_DESC* pModeToMatch,[Out] DXGI_MODE_DESC* pClosestMatch,[In, Optional] IUnknown* pConcernedDevice) + + + + Gets the display modes that match the requested format and other input options. + + + In general, when switching from windowed to full-screen mode, a swap chain automatically chooses a display mode that meets (or exceeds) the resolution, color depth and refresh rate of the swap chain. To exercise more control over the display mode, use this API to poll the set of display modes that are validated against monitor capabilities, or all modes that match the desktop (if the desktop settings are not validated against the monitor). As shown, this API is designed to be called twice. First to get the number of modes available, and second to return a description of the modes. + UINT num = 0; + DXGI_FORMAT format = DXGI_FORMAT_R32G32B32A32_FLOAT; + UINT flags = DXGI_ENUM_MODES_INTERLACED; pOutput->GetDisplayModeList( format, flags, &num, 0); ... DXGI_MODE_DESC * pDescs = new DXGI_MODE_DESC[num]; + pOutput->GetDisplayModeList( format, flags, &num, pDescs); + + + + The color format (see ). + format for modes to include (see {{DXGI_ENUM_MODES}}). DXGI_ENUM_MODES_SCALING needs to be specified to expose the display modes that require scaling. Centered modes, requiring no scaling and corresponding directly to the display output, are enumerated by default. + Returns a list of display modes (see ); + HRESULT IDXGIOutput::GetDisplayModeList([None] DXGI_FORMAT EnumFormat,[None] int Flags,[InOut] int* pNumModes,[Out, Buffer, Optional] DXGI_MODE_DESC* pDesc) + + + +

Get a description of the output.

+
+ +

On a high DPI desktop, GetDesc returns the visualized screen size unless the app is marked high DPI aware. For info about writing DPI-aware Win32 apps, see High DPI.

+
+ bb174548 + GetDesc + GetDesc +
+ + +

Gets a description of the gamma-control capabilities.

+
+ +

Note??Calling this method is only supported while in full-screen mode.?

For info about using gamma correction, see Using gamma correction.

+
+ bb174553 + GetGammaControlCapabilities + GetGammaControlCapabilities +
+ + +

Gets or sets the gamma control settings.

+
+ +

Note??Calling this method is only supported while in full-screen mode.?

For info about using gamma correction, see Using gamma correction.

+
+ bb174552 + GetGammaControl / SetGammaControl + GetGammaControl +
+ + +

Gets statistics about recently rendered frames.

+
+ +

This API is similar to IDXGISwapChain::GetFrameStatistics.

Note??Calling this method is only supported while in full-screen mode.? +
+ bb174551 + GetFrameStatistics + GetFrameStatistics +
+ + +

Get a description of the output.

+
+

A reference to the output description (see ).

+

Returns a code that indicates success or failure. if successful, if pDesc is passed in as null.

+ +

On a high DPI desktop, GetDesc returns the visualized screen size unless the app is marked high DPI aware. For info about writing DPI-aware Win32 apps, see High DPI.

+
+ bb174548 + HRESULT IDXGIOutput::GetDesc([Out] DXGI_OUTPUT_DESC* pDesc) + IDXGIOutput::GetDesc +
+ + +

[Starting with Direct3D 11.1, we recommend not to use GetDisplayModeList anymore to retrieve the matching display mode. Instead, use IDXGIOutput1::GetDisplayModeList1, which supports stereo display mode.]

Gets the display modes that match the requested format and other input options.

+
+ No documentation. + No documentation. + No documentation. + No documentation. +

Returns one of the following DXGI_ERROR. It is rare, but possible, that the display modes available can change immediately after calling this method, in which case is returned (if there is not enough room for all the display modes). If GetDisplayModeList is called from a Remote Desktop Services session (formerly Terminal Services session), is returned.

+ +

In general, when switching from windowed to full-screen mode, a swap chain automatically chooses a display mode that meets (or exceeds) the resolution, color depth and refresh rate of the swap chain. To exercise more control over the display mode, use this API to poll the set of display modes that are validated against monitor capabilities, or all modes that match the desktop (if the desktop settings are not validated against the monitor).

As shown, this API is designed to be called twice. First to get the number of modes available, and second to return a description of the modes.

 UINT num = 0;
+             format = DXGI_FORMAT_R32G32B32A32_FLOAT;
+            UINT flags         = DXGI_ENUM_MODES_INTERLACED; pOutput->GetDisplayModeList( format, flags, &num, 0); ...  * pDescs = new [num];
+            pOutput->GetDisplayModeList( format, flags, &num, pDescs); 
+
+ bb174549 + HRESULT IDXGIOutput::GetDisplayModeList([In] DXGI_FORMAT EnumFormat,[In] unsigned int Flags,[InOut] unsigned int* pNumModes,[Out, Buffer, Optional] DXGI_MODE_DESC* pDesc) + IDXGIOutput::GetDisplayModeList +
+ + +

[Starting with Direct3D 11.1, we recommend not to use FindClosestMatchingMode anymore to find the display mode that most closely matches the requested display mode. Instead, use IDXGIOutput1::FindClosestMatchingMode1, which supports stereo display mode.]

Finds the display mode that most closely matches the requested display mode.

+
+ No documentation. + No documentation. + No documentation. +

Returns one of the following DXGI_ERROR.

+ +

FindClosestMatchingMode behaves similarly to the IDXGIOutput1::FindClosestMatchingMode1 except FindClosestMatchingMode considers only the mono display modes. IDXGIOutput1::FindClosestMatchingMode1 considers only stereo modes if you set the Stereo member in the structure that pModeToMatch points to, and considers only mono modes if Stereo is not set.

IDXGIOutput1::FindClosestMatchingMode1 returns a matched display-mode set with only stereo modes or only mono modes. + FindClosestMatchingMode behaves as though you specified the input mode as mono.

+
+ bb174547 + HRESULT IDXGIOutput::FindClosestMatchingMode([In] const DXGI_MODE_DESC* pModeToMatch,[Out] DXGI_MODE_DESC* pClosestMatch,[In, Optional] IUnknown* pConcernedDevice) + IDXGIOutput::FindClosestMatchingMode +
+ + +

Halt a thread until the next vertical blank occurs.

+
+

Returns one of the following DXGI_ERROR.

+ +

A vertical blank occurs when the raster moves from the lower right corner to the upper left corner to begin drawing the next frame.

+
+ bb174559 + HRESULT IDXGIOutput::WaitForVBlank() + IDXGIOutput::WaitForVBlank +
+ + +

Takes ownership of an output.

+
+

A reference to the interface of a device (such as an ID3D10Device).

+

Set to TRUE to enable other threads or applications to take ownership of the device; otherwise, set to .

+

Returns one of the DXGI_ERROR values.

+ +

When you are finished with the output, call IDXGIOutput::ReleaseOwnership.

TakeOwnership should not be called directly by applications, since results will be unpredictable. It is called implicitly by the DXGI swap chain object during full-screen transitions, and should not be used as a substitute for swap-chain methods.

+
+ bb174558 + HRESULT IDXGIOutput::TakeOwnership([In] IUnknown* pDevice,[In] BOOL Exclusive) + IDXGIOutput::TakeOwnership +
+ + +

Releases ownership of the output.

+
+ +

If you are not using a swap chain, get access to an output by calling IDXGIOutput::TakeOwnership and release it when you are finished by calling IDXGIOutput::ReleaseOwnership. An application that uses a swap chain will typically not call either of these methods.

+
+ bb174554 + void IDXGIOutput::ReleaseOwnership() + IDXGIOutput::ReleaseOwnership +
+ + +

Gets a description of the gamma-control capabilities.

+
+

A reference to a description of the gamma-control capabilities (see ).

+

Returns one of the DXGI_ERROR values.

+ +

Note??Calling this method is only supported while in full-screen mode.?

For info about using gamma correction, see Using gamma correction.

+
+ bb174553 + HRESULT IDXGIOutput::GetGammaControlCapabilities([Out] DXGI_GAMMA_CONTROL_CAPABILITIES* pGammaCaps) + IDXGIOutput::GetGammaControlCapabilities +
+ + +

Sets the gamma controls.

+
+

A reference to a structure that describes the gamma curve to set.

+

Returns one of the DXGI_ERROR values.

+ +

Note??Calling this method is only supported while in full-screen mode.?

For info about using gamma correction, see Using gamma correction.

+
+ bb174557 + HRESULT IDXGIOutput::SetGammaControl([In] const DXGI_GAMMA_CONTROL* pArray) + IDXGIOutput::SetGammaControl +
+ + +

Gets the gamma control settings.

+
+

An array of gamma control settings (see ).

+

Returns one of the DXGI_ERROR values.

+ +

Note??Calling this method is only supported while in full-screen mode.?

For info about using gamma correction, see Using gamma correction.

+
+ bb174552 + HRESULT IDXGIOutput::GetGammaControl([Out] DXGI_GAMMA_CONTROL* pArray) + IDXGIOutput::GetGammaControl +
+ + +

Changes the display mode.

+
+

A reference to a surface (see ) used for rendering an image to the screen. The surface must have been created as a back buffer (DXGI_USAGE_BACKBUFFER).

+

Returns one of the DXGI_ERROR values.

+ +

IDXGIOutput::SetDisplaySurface should not be called directly by applications, since results will be unpredictable. It is called implicitly by the DXGI swap chain object during full-screen transitions, and should not be used as a substitute for swap-chain methods.

This method should only be called between IDXGIOutput::TakeOwnership and IDXGIOutput::ReleaseOwnership calls.

+
+ bb174556 + HRESULT IDXGIOutput::SetDisplaySurface([In] IDXGISurface* pScanoutSurface) + IDXGIOutput::SetDisplaySurface +
+ + +

[Starting with Direct3D 11.1, we recommend not to use GetDisplaySurfaceData anymore to retrieve the current display surface. Instead, use IDXGIOutput1::GetDisplaySurfaceData1, which supports stereo display mode.]

Gets a copy of the current display surface.

+
+ No documentation. +

Returns one of the DXGI_ERROR values.

+ +

IDXGIOutput::GetDisplaySurfaceData can only be called when an output is in full-screen mode. If the method succeeds, DXGI fills the destination surface.

Use IDXGIOutput::GetDesc to determine the size (width and height) of the output when you want to allocate space for the destination surface. This is true regardless of target monitor rotation. A destination surface created by a graphics component (such as Direct3D 10) must be created with CPU-write permission (see D3D10_CPU_ACCESS_WRITE). Other surfaces should be created with CPU read-write permission (see D3D10_CPU_ACCESS_READ_WRITE). This method will modify the surface data to fit the destination surface (stretch, shrink, convert format, rotate). The stretch and shrink is performed with point-sampling.

+
+ bb174550 + HRESULT IDXGIOutput::GetDisplaySurfaceData([In] IDXGISurface* pDestination) + IDXGIOutput::GetDisplaySurfaceData +
+ + +

Gets statistics about recently rendered frames.

+
+

A reference to frame statistics (see ).

+

If this function succeeds, it returns . Otherwise, it might return .

+ +

This API is similar to IDXGISwapChain::GetFrameStatistics.

Note??Calling this method is only supported while in full-screen mode.? +
+ bb174551 + HRESULT IDXGIOutput::GetFrameStatistics([Out] DXGI_FRAME_STATISTICS* pStats) + IDXGIOutput::GetFrameStatistics +
+ + +

[This documentation is preliminary and is subject to change.]

Applies to: desktop apps | Metro style apps

Gets the display modes that match the requested format and other input options.

+
+

A -typed value for the color format.

+

A combination of DXGI_ENUM_MODES-typed values that are combined by using a bitwise OR operation. The resulting value specifies options for display modes to include. You must specify to expose the display modes that require scaling. Centered modes that require no scaling and correspond directly to the display output are enumerated by default.

+ A list of display modes + +

GetDisplayModeList1 is updated from GetDisplayModeList to return a list of structures, which are updated mode descriptions. GetDisplayModeList behaves as though it calls GetDisplayModeList1 because GetDisplayModeList can return all of the modes that are specified by DXGI_ENUM_MODES, including stereo mode. However, GetDisplayModeList returns a list of structures, which are the former mode descriptions and do not indicate stereo mode.

The GetDisplayModeList1 method does not enumerate stereo modes unless you specify the flag in the Flags parameter. If you specify , stereo modes are included in the list of returned modes that the pDesc parameter points to. In other words, the method returns both stereo and mono modes.

In general, when you switch from windowed to full-screen mode, a swap chain automatically chooses a display mode that meets (or exceeds) the resolution, color depth, and refresh rate of the swap chain. To exercise more control over the display mode, use GetDisplayModeList1 to poll the set of display modes that are validated against monitor capabilities, or all modes that match the desktop (if the desktop settings are not validated against the monitor).

The following example code shows that you need to call GetDisplayModeList1 twice. First call GetDisplayModeList1 to get the number of modes available, and second call GetDisplayModeList1 to return a description of the modes.

 UINT num = 0;	
+             format = ;	
+            UINT flags         = ; pOutput->GetDisplayModeList1( format, flags, &num, 0); ...  * pDescs = new [num];	
+            pOutput->GetDisplayModeList1( format, flags, &num, pDescs); 
+
+ hh404606 + HRESULT IDXGIOutput1::GetDisplayModeList1([In] DXGI_FORMAT EnumFormat,[In] unsigned int Flags,[InOut] unsigned int* pNumModes,[Out, Buffer, Optional] DXGI_MODE_DESC1* pDesc) + IDXGIOutput1::GetDisplayModeList1 +
+ + +

[Starting with Direct3D 11.1, we recommend not to use GetDisplayModeList anymore to retrieve the matching display mode. Instead, use IDXGIOutput1::GetDisplayModeList1, which supports stereo display mode.]

Gets the display modes that match the requested format and other input options.

+
+ No documentation. + No documentation. + No documentation. + No documentation. +

Returns one of the following DXGI_ERROR. It is rare, but possible, that the display modes available can change immediately after calling this method, in which case is returned (if there is not enough room for all the display modes). If GetDisplayModeList is called from a Remote Desktop Services session (formerly Terminal Services session), is returned.

+ +

In general, when switching from windowed to full-screen mode, a swap chain automatically chooses a display mode that meets (or exceeds) the resolution, color depth and refresh rate of the swap chain. To exercise more control over the display mode, use this API to poll the set of display modes that are validated against monitor capabilities, or all modes that match the desktop (if the desktop settings are not validated against the monitor).

As shown, this API is designed to be called twice. First to get the number of modes available, and second to return a description of the modes.

 UINT num = 0;
+             format = DXGI_FORMAT_R32G32B32A32_FLOAT;
+            UINT flags         = DXGI_ENUM_MODES_INTERLACED; pOutput->GetDisplayModeList( format, flags, &num, 0); ...  * pDescs = new [num];
+            pOutput->GetDisplayModeList( format, flags, &num, pDescs); 
+
+ bb174549 + HRESULT IDXGIOutput1::GetDisplayModeList1([In] DXGI_FORMAT EnumFormat,[In] unsigned int Flags,[InOut] unsigned int* pNumModes,[Out, Buffer, Optional] DXGI_MODE_DESC1* pDesc) + IDXGIOutput1::GetDisplayModeList1 +
+ + +

Finds the display mode that most closely matches the requested display mode.

+
+

A reference to the structure that describes the display mode to match. Members of can be unspecified, which indicates no preference for that member. A value of 0 for Width or Height indicates that the value is unspecified. If either Width or Height is 0, both must be 0. A numerator and denominator of 0 in RefreshRate indicate it is unspecified. Other members of have enumeration values that indicate that the member is unspecified. If pConcernedDevice is null, the Format member of cannot be DXGI_FORMAT_UNKNOWN.

+

A reference to the structure that receives a description of the display mode that most closely matches the display mode described at pModeToMatch.

+

A reference to the Direct3D device interface. If this parameter is null, FindClosestMatchingMode1 returns only modes whose format matches that of pModeToMatch; otherwise, FindClosestMatchingMode1 returns only those formats that are supported for scan-out by the device. For info about the formats that are supported for scan-out by the device at each feature level:

  • DXGI Format Support for Direct3D Feature Level 12.1 Hardware
  • DXGI Format Support for Direct3D Feature Level 12.0 Hardware
  • DXGI Format Support for Direct3D Feature Level 11.1 Hardware
  • DXGI Format Support for Direct3D Feature Level 11.0 Hardware
  • Hardware Support for Direct3D 10Level9 Formats
  • Hardware Support for Direct3D 10.1 Formats
  • Hardware Support for Direct3D 10 Formats
+

Returns one of the error codes described in the DXGI_ERROR topic.

+ +

Direct3D devices require UNORM formats.

FindClosestMatchingMode1 finds the closest matching available display mode to the mode that you specify in pModeToMatch.

If you set the Stereo member in the structure to which pModeToMatch points to specify a stereo mode as input, FindClosestMatchingMode1 considers only stereo modes. FindClosestMatchingMode1 considers only mono modes if Stereo is not set.

FindClosestMatchingMode1 resolves similarly ranked members of display modes (that is, all specified, or all unspecified, and so on) in the following order:

  1. ScanlineOrdering
  2. Scaling
  3. Format
  4. Resolution
  5. RefreshRate

When FindClosestMatchingMode1 determines the closest value for a particular member, it uses previously matched members to filter the display mode list choices, and ignores other members. For example, when FindClosestMatchingMode1 matches Resolution, it already filtered the display mode list by a certain ScanlineOrdering, Scaling, and Format, while it ignores RefreshRate. This ordering doesn't define the absolute ordering for every usage scenario of FindClosestMatchingMode1, because the application can choose some values initially, which effectively changes the order of resolving members.

FindClosestMatchingMode1 matches members of the display mode one at a time, generally in a specified order.

If a member is unspecified, FindClosestMatchingMode1 gravitates toward the values for the desktop related to this output. If this output is not part of the desktop, FindClosestMatchingMode1 uses the default desktop output to find values. If an application uses a fully unspecified display mode, FindClosestMatchingMode1 typically returns a display mode that matches the desktop settings for this output. Because unspecified members are lower priority than specified members, FindClosestMatchingMode1 resolves unspecified members later than specified members.

+
+ hh404603 + HRESULT IDXGIOutput1::FindClosestMatchingMode1([In] const DXGI_MODE_DESC1* pModeToMatch,[Out] DXGI_MODE_DESC1* pClosestMatch,[In, Optional] IUnknown* pConcernedDevice) + IDXGIOutput1::FindClosestMatchingMode1 +
+ + +

Copies the display surface (front buffer) to a user-provided resource.

+
+

A reference to a resource interface that represents the resource to which GetDisplaySurfaceData1 copies the display surface.

+

Returns one of the error codes described in the DXGI_ERROR topic.

+ +

GetDisplaySurfaceData1 is similar to IDXGIOutput::GetDisplaySurfaceData except GetDisplaySurfaceData1 takes an and IDXGIOutput::GetDisplaySurfaceData takes an .

GetDisplaySurfaceData1 returns an error if the input resource is not a 2D texture (represented by the interface) with an array size (ArraySize member of the structure) that is equal to the swap chain buffers.

The original IDXGIOutput::GetDisplaySurfaceData and the updated GetDisplaySurfaceData1 behave exactly the same. GetDisplaySurfaceData1 was required because textures with an array size equal to 2 (ArraySize = 2) do not implement .

You can call GetDisplaySurfaceData1 only when an output is in full-screen mode. If GetDisplaySurfaceData1 succeeds, it fills the destination resource.

Use IDXGIOutput::GetDesc to determine the size (width and height) of the output when you want to allocate space for the destination resource. This is true regardless of target monitor rotation. A destination resource created by a graphics component (such as Direct3D 11) must be created with CPU write permission (see D3D11_CPU_ACCESS_WRITE). Other surfaces can be created with CPU read-write permission (D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE). GetDisplaySurfaceData1 modifies the surface data to fit the destination resource (stretch, shrink, convert format, rotate). GetDisplaySurfaceData1 performs the stretch and shrink with point sampling.

+
+ hh404609 + HRESULT IDXGIOutput1::GetDisplaySurfaceData1([In] IDXGIResource* pDestination) + IDXGIOutput1::GetDisplaySurfaceData1 +
+ + +

Creates a desktop duplication interface from the interface that represents an adapter output.

+
+ No documentation. + No documentation. + +

If an application wants to duplicate the entire desktop, it must create a desktop duplication interface on each active output on the desktop. This interface does not provide an explicit way to synchronize the timing of each output image. Instead, the application must use the time stamp of each output, and then determine how to combine the images.

For DuplicateOutput to succeed, you must create pDevice from or a later version of a DXGI factory interface that inherits from .

If the current mode is a stereo mode, the desktop duplication interface provides the image for the left stereo image only.

By default, only four processes can use a interface at the same time within a single session. A process can have only one desktop duplication interface on a single desktop output; however, that process can have a desktop duplication interface for each output that is part of the desktop.

For improved performance, consider using DuplicateOutput1.

+
+ hh404600 + HRESULT IDXGIOutput1::DuplicateOutput([In] IUnknown* pDevice,[Out] IDXGIOutputDuplication** ppOutputDuplication) + IDXGIOutput1::DuplicateOutput +
+ + +

[This documentation is preliminary and is subject to change.]

Queries an adapter output for multiplane overlay support.

+
+

TRUE if the output adapter is the primary adapter and it supports multiplane overlays, otherwise returns .

+ + dn280411 + BOOL IDXGIOutput2::SupportsOverlays() + IDXGIOutput2::SupportsOverlays +
+ + +

Queries an adapter output for multiplane overlay support. If this API returns ?TRUE?, multiple swap chain composition takes place in a performant manner using overlay hardware. If this API returns false, apps should avoid using foreground swap chains (that is, avoid using swap chains created with the DXGI_SWAP_CHAIN_FLAG_FOREGROUND_LAYER flag).

+
+

TRUE if the output adapter is the primary adapter and it supports multiplane overlays, otherwise returns .

+ +

See CreateSwapChainForCoreWindow for info on creating a foreground swap chain.

+
+ dn280411 + BOOL IDXGIOutput2::SupportsOverlays() + IDXGIOutput2::SupportsOverlays +
+ + HRESULT IDXGIOutputDuplication::MapDesktopSurface([Out] DXGI_MAPPED_RECT* pLockedRect) + + + +

Indicates that the application is ready to process the next desktop image.

+
+

The time-out interval, in milliseconds. This interval specifies the amount of time that this method waits for a new frame before it returns to the caller. This method returns if the interval elapses, and a new desktop image is not available.

For more information about the time-out interval, see Remarks.

+

A reference to a memory location that receives the structure that describes timing and presentation statistics for a frame.

+

A reference to a variable that receives the interface of the surface that contains the desktop bitmap.

+ +

When AcquireNextFrame returns successfully, the calling application can access the desktop image that AcquireNextFrame returns in the variable at ppDesktopResource. + If the caller specifies a zero time-out interval in the TimeoutInMilliseconds parameter, AcquireNextFrame verifies whether there is a new desktop image available, returns immediately, and indicates its outcome with the return value. If the caller specifies an INFINITE time-out interval in the TimeoutInMilliseconds parameter, the time-out interval never elapses.

Note??You cannot cancel the wait that you specified in the TimeoutInMilliseconds parameter. Therefore, if you must periodically check for other conditions (for example, a terminate signal), you should specify a non-INFINITE time-out interval. After the time-out interval elapses, you can check for these other conditions and then call AcquireNextFrame again to wait for the next frame.?

AcquireNextFrame acquires a new desktop frame when the operating system either updates the desktop bitmap image or changes the shape or position of a hardware reference. The new frame that AcquireNextFrame acquires might have only the desktop image updated, only the reference shape or position updated, or both.

+
+ + hh404615 + HRESULT IDXGIOutputDuplication::AcquireNextFrame([In] unsigned int TimeoutInMilliseconds,[Out] DXGI_OUTDUPL_FRAME_INFO* pFrameInfo,[Out] IDXGIResource** ppDesktopResource) + IDXGIOutputDuplication::AcquireNextFrame +
+ + +

Retrieves a description of a duplicated output. This description specifies the dimensions of the surface that contains the desktop image.

+
+ +

After an application creates an interface, it calls GetDesc to retrieve the dimensions of the surface that contains the desktop image. The format of the desktop image is always DXGI_FORMAT_B8G8R8A8_UNORM.

+
+ hh404618 + GetDesc + GetDesc +
+ + +

Retrieves a description of a duplicated output. This description specifies the dimensions of the surface that contains the desktop image.

+
+

A reference to a structure that describes the duplicated output. This parameter must not be null.

+ +

After an application creates an interface, it calls GetDesc to retrieve the dimensions of the surface that contains the desktop image. The format of the desktop image is always DXGI_FORMAT_B8G8R8A8_UNORM.

+
+ hh404618 + void IDXGIOutputDuplication::GetDesc([Out] DXGI_OUTDUPL_DESC* pDesc) + IDXGIOutputDuplication::GetDesc +
+ + +

Indicates that the application is ready to process the next desktop image.

+
+

The time-out interval, in milliseconds. This interval specifies the amount of time that this method waits for a new frame before it returns to the caller. This method returns if the interval elapses, and a new desktop image is not available.

For more information about the time-out interval, see Remarks.

+

A reference to a memory location that receives the structure that describes timing and presentation statistics for a frame.

+

A reference to a variable that receives the interface of the surface that contains the desktop bitmap.

+

AcquireNextFrame returns:

  • if it successfully received the next desktop image.
  • if the desktop duplication interface is invalid. The desktop duplication interface typically becomes invalid when a different type of image is displayed on the desktop. Examples of this situation are:
    • Desktop switch
    • Mode change
    • Switch from DWM on, DWM off, or other full-screen application
    In this situation, the application must release the interface and create a new for the new content.
  • if the time-out interval elapsed before the next desktop frame was available.
  • if the application called AcquireNextFrame without releasing the previous frame.
  • E_INVALIDARG if one of the parameters to AcquireNextFrame is incorrect; for example, if pFrameInfo is null.
  • Possibly other error codes that are described in the DXGI_ERROR topic.
+ +

When AcquireNextFrame returns successfully, the calling application can access the desktop image that AcquireNextFrame returns in the variable at ppDesktopResource. + If the caller specifies a zero time-out interval in the TimeoutInMilliseconds parameter, AcquireNextFrame verifies whether there is a new desktop image available, returns immediately, and indicates its outcome with the return value. If the caller specifies an INFINITE time-out interval in the TimeoutInMilliseconds parameter, the time-out interval never elapses.

Note??You cannot cancel the wait that you specified in the TimeoutInMilliseconds parameter. Therefore, if you must periodically check for other conditions (for example, a terminate signal), you should specify a non-INFINITE time-out interval. After the time-out interval elapses, you can check for these other conditions and then call AcquireNextFrame again to wait for the next frame.?

AcquireNextFrame acquires a new desktop frame when the operating system either updates the desktop bitmap image or changes the shape or position of a hardware reference. The new frame that AcquireNextFrame acquires might have only the desktop image updated, only the reference shape or position updated, or both.

+
+ hh404615 + HRESULT IDXGIOutputDuplication::AcquireNextFrame([In] unsigned int TimeoutInMilliseconds,[Out] DXGI_OUTDUPL_FRAME_INFO* pFrameInfo,[Out] IDXGIResource** ppDesktopResource) + IDXGIOutputDuplication::AcquireNextFrame +
+ + +

Gets information about dirty rectangles for the current desktop frame.

+
+

The size in bytes of the buffer that the caller passed to the pDirtyRectsBuffer parameter.

+

A reference to an array of structures that identifies the dirty rectangle regions for the desktop frame.

+

Pointer to a variable that receives the number of bytes that GetFrameDirtyRects needs to store information about dirty regions in the buffer at pDirtyRectsBuffer.

For more information about returning the required buffer size, see Remarks.

+

GetFrameDirtyRects returns:

  • if it successfully retrieved information about dirty rectangles.
  • if the desktop duplication interface is invalid. The desktop duplication interface typically becomes invalid when a different type of image is displayed on the desktop. Examples of this situation are:
    • Desktop switch
    • Mode change
    • Switch from DWM on, DWM off, or other full-screen application
    In this situation, the application must release the interface and create a new for the new content.
  • if the buffer that the calling application provided was not big enough.
  • if the application called GetFrameDirtyRects without owning the desktop image.
  • E_INVALIDARG if one of the parameters to GetFrameDirtyRects is incorrect; for example, if pDirtyRectsBuffer is null.
  • Possibly other error codes that are described in the DXGI_ERROR topic.
+ +

GetFrameDirtyRects stores a size value in the variable at pDirtyRectsBufferSizeRequired. This value specifies the number of bytes that GetFrameDirtyRects needs to store information about dirty regions. You can use this value in the following situations to determine the amount of memory to allocate for future buffers that you pass to pDirtyRectsBuffer:

  • GetFrameDirtyRects fails with because the buffer is not big enough.
  • GetFrameDirtyRects supplies a buffer that is bigger than necessary. The size value returned at pDirtyRectsBufferSizeRequired informs the caller how much buffer space was actually used compared to how much buffer space the caller allocated and specified in the DirtyRectsBufferSize parameter.

The caller can also use the value returned at pDirtyRectsBufferSizeRequired to determine the number of s returned in the pDirtyRectsBuffer array.

The buffer contains the list of dirty s for the current frame.

Note??To produce a visually accurate copy of the desktop, an application must first process all move s before it processes dirty s.? +
+ hh404619 + HRESULT IDXGIOutputDuplication::GetFrameDirtyRects([In] unsigned int DirtyRectsBufferSize,[Out, Buffer] RECT* pDirtyRectsBuffer,[Out] unsigned int* pDirtyRectsBufferSizeRequired) + IDXGIOutputDuplication::GetFrameDirtyRects +
+ + +

Gets information about the moved rectangles for the current desktop frame.

+
+

The size in bytes of the buffer that the caller passed to the pMoveRectBuffer parameter.

+

A reference to an array of structures that identifies the moved rectangle regions for the desktop frame.

+

Pointer to a variable that receives the number of bytes that GetFrameMoveRects needs to store information about moved regions in the buffer at pMoveRectBuffer.

For more information about returning the required buffer size, see Remarks.

+

GetFrameMoveRects returns:

  • if it successfully retrieved information about moved rectangles.
  • if the desktop duplication interface is invalid. The desktop duplication interface typically becomes invalid when a different type of image is displayed on the desktop. Examples of this situation are:
    • Desktop switch
    • Mode change
    • Switch from DWM on, DWM off, or other full-screen application
    In this situation, the application must release the interface and create a new for the new content.
  • if the buffer that the calling application provided is not big enough.
  • if the application called GetFrameMoveRects without owning the desktop image.
  • E_INVALIDARG if one of the parameters to GetFrameMoveRects is incorrect; for example, if pMoveRectBuffer is null.
  • Possibly other error codes that are described in the DXGI_ERROR topic.
+ +

GetFrameMoveRects stores a size value in the variable at pMoveRectsBufferSizeRequired. This value specifies the number of bytes that GetFrameMoveRects needs to store information about moved regions. You can use this value in the following situations to determine the amount of memory to allocate for future buffers that you pass to pMoveRectBuffer:

  • GetFrameMoveRects fails with because the buffer is not big enough.
  • GetFrameMoveRects supplies a buffer that is bigger than necessary. The size value returned at pMoveRectsBufferSizeRequired informs the caller how much buffer space was actually used compared to how much buffer space the caller allocated and specified in the MoveRectsBufferSize parameter.

The caller can also use the value returned at pMoveRectsBufferSizeRequired to determine the number of structures returned.

The buffer contains the list of move RECTs for the current frame.

Note??To produce a visually accurate copy of the desktop, an application must first process all move RECTs before it processes dirty RECTs.? +
+ hh404620 + HRESULT IDXGIOutputDuplication::GetFrameMoveRects([In] unsigned int MoveRectsBufferSize,[Out, Buffer] DXGI_OUTDUPL_MOVE_RECT* pMoveRectBuffer,[Out] unsigned int* pMoveRectsBufferSizeRequired) + IDXGIOutputDuplication::GetFrameMoveRects +
+ + +

Gets information about the new reference shape for the current desktop frame.

+
+

The size in bytes of the buffer that the caller passed to the pPointerShapeBuffer parameter.

+

A reference to a buffer to which GetFramePointerShape copies and returns pixel data for the new reference shape.

+

Pointer to a variable that receives the number of bytes that GetFramePointerShape needs to store the new reference shape pixel data in the buffer at pPointerShapeBuffer.

For more information about returning the required buffer size, see Remarks.

+

Pointer to a structure that receives the reference shape information.

+

GetFramePointerShape returns:

  • if it successfully retrieved information about the new reference shape.
  • if the desktop duplication interface is invalid. The desktop duplication interface typically becomes invalid when a different type of image is displayed on the desktop. Examples of this situation are:
    • Desktop switch
    • Mode change
    • Switch from DWM on, DWM off, or other full-screen application
    In this situation, the application must release the interface and create a new for the new content.
  • if the buffer that the calling application provided was not big enough.
  • if the application called GetFramePointerShape without owning the desktop image.
  • E_INVALIDARG if one of the parameters to GetFramePointerShape is incorrect; for example, if pPointerShapeInfo is null.
  • Possibly other error codes that are described in the DXGI_ERROR topic.
+ +

GetFramePointerShape stores a size value in the variable at pPointerShapeBufferSizeRequired. This value specifies the number of bytes that pPointerShapeBufferSizeRequired needs to store the new reference shape pixel data. You can use the value in the following situations to determine the amount of memory to allocate for future buffers that you pass to pPointerShapeBuffer:

  • GetFramePointerShape fails with because the buffer is not big enough.
  • GetFramePointerShape supplies a bigger than necessary buffer. The size value returned at pPointerShapeBufferSizeRequired informs the caller how much buffer space was actually used compared to how much buffer space the caller allocated and specified in the PointerShapeBufferSize parameter.

The pPointerShapeInfo parameter describes the new reference shape.

+
+ hh404621 + HRESULT IDXGIOutputDuplication::GetFramePointerShape([In] unsigned int PointerShapeBufferSize,[Out, Buffer] void* pPointerShapeBuffer,[Out] unsigned int* pPointerShapeBufferSizeRequired,[Out] DXGI_OUTDUPL_POINTER_SHAPE_INFO* pPointerShapeInfo) + IDXGIOutputDuplication::GetFramePointerShape +
+ + +

Provides the CPU with efficient access to a desktop image if that desktop image is already in system memory.

+
+

A reference to a structure that receives the surface data that the CPU needs to directly access the surface data.

+

MapDesktopSurface returns:

  • if it successfully retrieved the surface data.
  • if the desktop duplication interface is invalid. The desktop duplication interface typically becomes invalid when a different type of image is displayed on the desktop. Examples of this situation are:
    • Desktop switch
    • Mode change
    • Switch from DWM on, DWM off, or other full-screen application
    In this situation, the application must release the interface and create a new for the new content.
  • if the application already has an outstanding map on the desktop image. The application must call UnMapDesktopSurface before it calls MapDesktopSurface again. is also returned if the application did not own the desktop image when it called MapDesktopSurface.
  • if the desktop image is not in system memory. In this situation, the application must first transfer the image to a staging surface and then lock the image by calling the IDXGISurface::Map method.
  • E_INVALIDARG if the pLockedRect parameter is incorrect; for example, if pLockedRect is null.
  • Possibly other error codes that are described in the DXGI_ERROR topic.
+ +

You can successfully call MapDesktopSurface if the DesktopImageInSystemMemory member of the structure is set to TRUE. If DesktopImageInSystemMemory is , MapDesktopSurface returns . Call IDXGIOutputDuplication::GetDesc to retrieve the structure.

+
+ hh404622 + HRESULT IDXGIOutputDuplication::MapDesktopSurface([Out] DXGI_MAPPED_RECT* pLockedRect) + IDXGIOutputDuplication::MapDesktopSurface +
+ + +

Invalidates the reference to the desktop image that was retrieved by using IDXGIOutputDuplication::MapDesktopSurface.

+
+

UnMapDesktopSurface returns:

  • if it successfully completed.
  • if the application did not map the desktop surface by calling IDXGIOutputDuplication::MapDesktopSurface.
  • Possibly other error codes that are described in the DXGI_ERROR topic.
+ hh404624 + HRESULT IDXGIOutputDuplication::UnMapDesktopSurface() + IDXGIOutputDuplication::UnMapDesktopSurface +
+ + +

Indicates that the application finished processing the frame.

+
+

ReleaseFrame returns:

  • if it successfully completed.
  • if the application already released the frame.
  • if the desktop duplication interface is invalid. The desktop duplication interface typically becomes invalid when a different type of image is displayed on the desktop. Examples of this situation are:
    • Desktop switch
    • Mode change
    • Switch from DWM on, DWM off, or other full-screen application
    In this situation, the application must release the interface and create a new for the new content.
  • Possibly other error codes that are described in the DXGI_ERROR topic.
+ +

The application must release the frame before it acquires the next frame. After the frame is released, the surface that contains the desktop bitmap becomes invalid; you will not be able to use the surface in a DirectX graphics operation.

For performance reasons, we recommend that you release the frame just before you call the IDXGIOutputDuplication::AcquireNextFrame method to acquire the next frame. When the client does not own the frame, the operating system copies all desktop updates to the surface. This can result in wasted GPU cycles if the operating system updates the same region for each frame that occurs. When the client acquires the frame, the client is aware of only the final update to this region; therefore, any overlapping updates during previous frames are wasted. When the client acquires a frame, the client owns the surface; therefore, the operating system can track only the updated regions and cannot copy desktop updates to the surface. Because of this behavior, we recommend that you minimize the time between the call to release the current frame and the call to acquire the next frame.

+
+ hh404623 + HRESULT IDXGIOutputDuplication::ReleaseFrame() + IDXGIOutputDuplication::ReleaseFrame +
+ + +

Describes information about present that helps the operating system optimize presentation.

+
+ +

This structure is used by the Present1 method.

The scroll rectangle and the list of dirty rectangles could overlap. In this situation, the dirty rectangles take priority. Applications can then have pieces of dynamic content on top of a scrolled area. For example, an application could scroll a page and play video at the same time.

The following diagram and coordinates illustrate this example.

DirtyRectsCount = 2 + pDirtyRects[ 0 ] = { 10, 30, 40, 50 } // Video + pDirtyRects[ 1 ] = { 0, 70, 50, 80 } // New line + *pScrollRect = { 0, 0, 50, 70 } + *pScrollOffset = { 0, -10 } +

Parts of the previous frame and content that the application renders are combined to produce the final frame that the operating system presents on the display screen. Most of the window is scrolled from the previous frame. The application must update the video frame with the new chunk of content that appears due to scrolling.

The dashed rectangle shows the scroll rectangle in the current frame. The scroll rectangle is specified by the pScrollRect member. + The arrow shows the scroll offset. The scroll offset is specified by the pScrollOffset member. + Filled rectangles show dirty rectangles that the application updated with new content. The filled rectangles are specified by the DirtyRectsCount and pDirtyRects members.

The scroll rectangle and offset are not supported for the DXGI_SWAP_EFFECT_DISCARD or DXGI_SWAP_EFFECT_SEQUENTIAL present option. Dirty rectangles and scroll rectangle are not supported for multisampled swap chains.

The actual implementation of composition and necessary bitblts is different for the bitblt model and the flip model. For more info about these models, see DXGI Flip Model.

For more info about the flip-model swap chain and optimizing presentation, see Enhancing presentation with the flip model, dirty rectangles, and scrolled areas.

+
+ hh404522 + DXGI_PRESENT_PARAMETERS + DXGI_PRESENT_PARAMETERS +
+ + + A list of updated rectangles that you update in the back buffer for the presented frame. An application must update every single pixel in each rectangle that it reports to the runtime; the application cannot assume that the pixels are saved from the previous frame. For more information about updating dirty rectangles, see Remarks. You can set this member to null if DirtyRectsCount is 0. An application must not update any pixel outside of the dirty rectangles. + + RECT* pDirtyRects + + + + A reference to the scrolled rectangle. The scrolled rectangle is the rectangle of the previous frame from which the runtime bit-block transfers (bitblts) content. The runtime also uses the scrolled rectangle to optimize presentation in terminal server and indirect display scenarios. + The scrolled rectangle also describes the destination rectangle, that is, the region on the current frame that is filled with scrolled content. You can set this member to null to indicate that no content is scrolled from the previous frame. + + RECT* pScrollRect + + + + A reference to the offset of the scrolled area that goes from the source rectangle (of previous frame) to the destination rectangle (of current frame). You can set this member to null to indicate no offset. + + POINT* pScrollOffset + + + +

The number of updated rectangles that you update in the back buffer for the presented frame. The operating system uses this information to optimize presentation. You can set this member to 0 to indicate that you update the whole frame.

+
+ hh404522 + DirtyRectsCount + DirtyRectsCount +
+ + +

A list of updated rectangles that you update in the back buffer for the presented frame. An application must update every single pixel in each rectangle that it reports to the runtime; the application cannot assume that the pixels are saved from the previous frame. For more information about updating dirty rectangles, see Remarks. You can set this member to null if DirtyRectsCount is 0. An application must not update any pixel outside of the dirty rectangles.

+
+ hh404522 + pDirtyRects + pDirtyRects +
+ + +

A reference to the scrolled rectangle. The scrolled rectangle is the rectangle of the previous frame from which the runtime bit-block transfers (bitblts) content. The runtime also uses the scrolled rectangle to optimize presentation in terminal server and indirect display scenarios.

The scrolled rectangle also describes the destination rectangle, that is, the region on the current frame that is filled with scrolled content. You can set this member to null to indicate that no content is scrolled from the previous frame.

+
+ hh404522 + pScrollRect + pScrollRect +
+ + +

A reference to the offset of the scrolled area that goes from the source rectangle (of previous frame) to the destination rectangle (of current frame). You can set this member to null to indicate no offset.

+
+ hh404522 + pScrollOffset + pScrollOffset +
+ + +

Represents a rational number.

+
+ +

This structure is a member of the structure.

The structure operates under the following rules:

  • 0/0 is legal and will be interpreted as 0/1.
  • 0/anything is interpreted as zero.
  • If you are representing a whole number, the denominator should be 1.
+
+ bb173069 + DXGI_RATIONAL + DXGI_RATIONAL +
+ + + An empty rational that can be used for comparisons. + + + + + Initializes a new instance of the structure. + + The numerator of the rational pair. + The denominator of the rational pair. + + + +

An unsigned integer value representing the top of the rational number.

+
+ bb173069 + Numerator + Numerator +
+ + +

An unsigned integer value representing the bottom of the rational number.

+
+ bb173069 + Denominator + Denominator +
+ + + Creates a handle to a shared resource. You can then use the returned handle with multiple Direct3D devices. + + A reference to a structure that contains two separate but related data members: an optional security descriptor, and a Boolean value that determines whether child processes can inherit the returned handle. Set this parameter to null if you want child processes that the application might create to not inherit the handle returned by CreateSharedHandle, and if you want the resource that is associated with the returned handle to get a default security descriptor. The lpSecurityDescriptor member of the structure specifies a SECURITY_DESCRIPTOR for the resource. Set this member to null if you want the runtime to assign a default security descriptor to the resource that is associated with the returned handle. + The requested access rights to the resource. In addition to the generic access rights, DXGI defines the following values: ( 0x80000000L ) - specifies read access to the resource. ( 1 ) - specifies write access to the resource. You can combine these values by using a bitwise OR operation. + The name of the resource to share. You will need the resource name if you call the method to access the shared resource by name. If you instead call the method to access the shared resource by handle, set this parameter to null. + A reference to a variable that receives the NT HANDLE value to the resource to share. You can use this handle in calls to access the resource. + + If you created the resource as shared and specified that it uses NT handles (that is, you set the flag), you must use CreateSharedHandle to get a handle for sharing. In this situation, you cannot use the method because it will fail. Similarly, if you created the resource as shared and did not specify that it uses NT handles, you cannot use CreateSharedHandle to get a handle for sharing because CreateSharedHandle will fail.You can pass the handle that CreateSharedHandle returns in a call to the or method to give a device access to a shared resource that you created on a different device.CreateSharedHandle only returns the NT handle when you created the resource as shared (that is, you set the and flags).Because the handle that CreateSharedHandle returns is an NT handle, you can use the handle with CloseHandle, DuplicateHandle, and so on. You can call CreateSharedHandle only once for a shared resource; later calls fail. If you need more handles to the same shared resource, call DuplicateHandle. When you no longer need the shared resource handle, call CloseHandle to close the handle, in order to avoid memory leaks.The creator of a shared resource must not destroy the resource until all entities that opened the resource have destroyed the resource. The validity of the handle is tied to the lifetime of the underlying video memory. If no resource objects exist on any devices that refer to this resource, the handle is no longer valid. To extend the lifetime of the handle and video memory, you must open the shared resource on a device. + + HRESULT IDXGIResource1::CreateSharedHandle([In, Optional] const SECURITY_ATTRIBUTES* pAttributes,[In] DXGI_SHARED_RESOURCE_FLAGS dwAccess,[In, Optional] const wchar_t* name,[Out] void** pHandle) + + + +

Creates a subresource surface object.

+
+

The index of the subresource surface object to enumerate.

+

The address of a reference to a interface that represents the created subresource surface object at the position specified by the index parameter.

+

Returns if successful; otherwise, returns one of the following values:

  • if the index is out of range or if the subresource is not a valid surface.
  • E_OUTOFMEMORY if insufficient memory is available to create the subresource surface object.

A subresource is a valid surface if the original resource would have been a valid surface had its array size been equal to 1.

+ +

Subresource surface objects implement the interface, which inherits from and indirectly . Therefore, the GDI-interoperable methods of work if the original resource interface object was created with the GDI-interoperable flag (D3D11_RESOURCE_MISC_GDI_COMPATIBLE).

CreateSubresourceSurface creates a subresource surface that is based on the resource interface on which CreateSubresourceSurface is called. For example, if the original resource interface object is a 2D texture, the created subresource surface is also a 2D texture.

You can use CreateSubresourceSurface to create parts of a stereo resource so you can use Direct2D on either the left or right part of the stereo resource.

+
+ hh404627 + HRESULT IDXGIResource1::CreateSubresourceSurface([In] unsigned int index,[Out, Fast] IDXGISurface2** ppSurface) + IDXGIResource1::CreateSubresourceSurface +
+ + +

Creates a handle to a shared resource. You can then use the returned handle with multiple Direct3D devices.

+
+

A reference to a structure that contains two separate but related data members: an optional security descriptor, and a Boolean value that determines whether child processes can inherit the returned handle.

Set this parameter to null if you want child processes that the application might create to not inherit the handle returned by CreateSharedHandle, and if you want the resource that is associated with the returned handle to get a default security descriptor.

The lpSecurityDescriptor member of the structure specifies a SECURITY_DESCRIPTOR for the resource. Set this member to null if you want the runtime to assign a default security descriptor to the resource that is associated with the returned handle. The ACLs in the default security descriptor for the resource come from the primary or impersonation token of the creator. For more info, see Synchronization Object Security and Access Rights.

+

The requested access rights to the resource. In addition to the generic access rights, DXGI defines the following values:

  • DXGI_SHARED_RESOURCE_READ ( 0x80000000L ) - specifies read access to the resource.
  • DXGI_SHARED_RESOURCE_WRITE ( 1 ) - specifies write access to the resource.

You can combine these values by using a bitwise OR operation.

+

The name of the resource to share. The name is limited to MAX_PATH characters. Name comparison is case sensitive. You will need the resource name if you call the ID3D11Device1::OpenSharedResourceByName method to access the shared resource by name. If you instead call the ID3D11Device1::OpenSharedResource1 method to access the shared resource by handle, set this parameter to null.

If lpName matches the name of an existing resource, CreateSharedHandle fails with . This occurs because these objects share the same namespace.

The name can have a "Global\" or "Local\" prefix to explicitly create the object in the global or session namespace. The remainder of the name can contain any character except the backslash character (\). For more information, see Kernel Object Namespaces. Fast user switching is implemented using Terminal Services sessions. Kernel object names must follow the guidelines outlined for Terminal Services so that applications can support multiple users.

The object can be created in a private namespace. For more information, see Object Namespaces.

+

A reference to a variable that receives the NT HANDLE value to the resource to share. You can use this handle in calls to access the resource.

+ +

CreateSharedHandle only returns the NT handle when you created the resource as shared and specified that it uses NT handles (that is, you set the D3D11_RESOURCE_MISC_SHARED_NTHANDLE and D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX flags). If you created the resource as shared and specified that it uses NT handles, you must use CreateSharedHandle to get a handle for sharing. In this situation, you can't use the IDXGIResource::GetSharedHandle method because it will fail.

You can pass the handle that CreateSharedHandle returns in a call to the ID3D11Device1::OpenSharedResource1 method to give a device access to a shared resource that you created on a different device.

Because the handle that CreateSharedHandle returns is an NT handle, you can use the handle with CloseHandle, DuplicateHandle, and so on. You can call CreateSharedHandle only once for a shared resource; later calls fail. If you need more handles to the same shared resource, call DuplicateHandle. When you no longer need the shared resource handle, call CloseHandle to close the handle, in order to avoid memory leaks.

If you pass a name for the resource to lpName when you call CreateSharedHandle to share the resource, you can subsequently pass this name in a call to the ID3D11Device1::OpenSharedResourceByName method to give another device access to the shared resource. If you use a named resource, a malicious user can use this named resource before you do and prevent your app from starting. To prevent this situation, create a randomly named resource and store the name so that it can only be obtained by an authorized user. Alternatively, you can use a file for this purpose. To limit your app to one instance per user, create a locked file in the user's profile directory.

If you created the resource as shared and did not specify that it uses NT handles, you cannot use CreateSharedHandle to get a handle for sharing because CreateSharedHandle will fail.

+
+ hh404626 + HRESULT IDXGIResource1::CreateSharedHandle([In, Optional] const SECURITY_ATTRIBUTES* pAttributes,[In] DWORD dwAccess,[In, Optional] const wchar_t* lpName,[Out] void** pHandle) + IDXGIResource1::CreateSharedHandle +
+ + +

Describes multi-sampling parameters for a resource.

+
+ +

This structure is a member of the structure.

The default sampler mode, with no anti-aliasing, has a count of 1 and a quality level of 0.

If multi-sample antialiasing is being used, all bound render targets and depth buffers must have the same sample counts and quality levels.

Differences between Direct3D 10.0 and Direct3D 10.1 and between Direct3D 10.0 and Direct3D 11:

Direct3D 10.1 has defined two standard quality levels: D3D10_STANDARD_MULTISAMPLE_PATTERN and D3D10_CENTER_MULTISAMPLE_PATTERN in the D3D10_STANDARD_MULTISAMPLE_QUALITY_LEVELS enumeration in D3D10_1.h.

Direct3D 11 has defined two standard quality levels: D3D11_STANDARD_MULTISAMPLE_PATTERN and D3D11_CENTER_MULTISAMPLE_PATTERN in the enumeration in D3D11.h.

?

+
+ bb173072 + DXGI_SAMPLE_DESC + DXGI_SAMPLE_DESC +
+ + + Initializes a new instance of the structure. + + The sample count. + The sample quality. + + + +

The number of multisamples per pixel.

+
+ bb173072 + Count + Count +
+ + +

The image quality level. The higher the quality, the lower the performance. The valid range is between zero and one less than the level returned by ID3D10Device::CheckMultisampleQualityLevels for Direct3D 10 or ID3D11Device::CheckMultisampleQualityLevels for Direct3D 11.

For Direct3D 10.1 and Direct3D 11, you can use two special quality level values. For more information about these quality level values, see Remarks.

+
+ bb173072 + Quality + Quality +
+ + + Acquires access to the surface data. + + Flags specifying CPU access permissions. + A for accessing the mapped data, or null on failure.. + + + + Acquires access to the surface data. + + Flags specifying CPU access permissions. + Stream to contain the surface data. + A for accessing the mapped data, or null on failure.. + + + + Gets a swap chain back buffer. + + The swap chain to get the buffer from. + The index of the desired buffer. + The buffer interface, or null on failure. + + + +

Get a description of the surface.

+
+ bb174566 + GetDesc + GetDesc +
+ + +

Get a description of the surface.

+
+

A reference to the surface description (see ).

+

Returns if successful; otherwise, returns one of the error codes that are described in the DXGI_ERROR topic.

+ bb174566 + HRESULT IDXGISurface::GetDesc([Out] DXGI_SURFACE_DESC* pDesc) + IDXGISurface::GetDesc +
+ + +

Get a reference to the data contained in the surface, and deny GPU access to the surface.

+
+

A reference to the surface data (see ).

+

CPU read-write flags. These flags can be combined with a logical OR.

  • DXGI_MAP_READ - Allow CPU read access.
  • DXGI_MAP_WRITE - Allow CPU write access.
  • DXGI_MAP_DISCARD - Discard the previous contents of a resource when it is mapped.
+

Returns if successful; otherwise, returns one of the error codes that are described in the DXGI_ERROR topic.

+ +

Use IDXGISurface::Map to access a surface from the CPU. To release a mapped surface (and allow GPU access) call IDXGISurface::Unmap.

+
+ bb174567 + HRESULT IDXGISurface::Map([Out] DXGI_MAPPED_RECT* pLockedRect,[In] unsigned int MapFlags) + IDXGISurface::Map +
+ + +

Get a reference to the data contained in the surface, and deny GPU access to the surface.

+
+

Returns if successful; otherwise, returns one of the error codes that are described in the DXGI_ERROR topic.

+ +

Use IDXGISurface::Map to access a surface from the CPU. To release a mapped surface (and allow GPU access) call IDXGISurface::Unmap.

+
+ bb174567 + HRESULT IDXGISurface::Unmap() + IDXGISurface::Unmap +
+ + + Releases the GDI device context (DC) associated with the current surface and allows rendering using Direct3D. The whole surface to be considered dirty. + + + Use the ReleaseDC method to release the DC and indicate that your application has finished all GDI rendering to this surface. You must call the ReleaseDC method before you perform addition rendering using Direct3D. Prior to resizing buffers all outstanding DCs must be released. + + If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. + HRESULT IDXGISurface1::ReleaseDC([In, Optional] RECT* pDirtyRect) + + + + Releases the GDI device context (DC) associated with the current surface and allows rendering using Direct3D. + + + Use the ReleaseDC method to release the DC and indicate that your application has finished all GDI rendering to this surface. You must call the ReleaseDC method before you perform addition rendering using Direct3D. Prior to resizing buffers all outstanding DCs must be released. + + A reference to a structure that identifies the dirty region of the surface. A dirty region is any part of the surface that you have used for GDI rendering and that you want to preserve. This is used as a performance hint to graphics subsystem in certain scenarios. Do not use this parameter to restrict rendering to the specified rectangular region. The area specified by the will be used as a performance hint to indicate what areas have been manipulated by GDI rendering. + If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. + HRESULT IDXGISurface1::ReleaseDC([In, Optional] RECT* pDirtyRect) + + + +

Returns a device context (DC) that allows you to render to a Microsoft DirectX Graphics Infrastructure (DXGI) surface using Windows Graphics Device Interface (GDI).

+
+

A Boolean value that specifies whether to preserve Direct3D contents in the GDI DC. TRUE directs the runtime not to preserve Direct3D contents in the GDI DC; that is, the runtime discards the Direct3D contents. guarantees that Direct3D contents are available in the GDI DC.

+

A reference to an handle that represents the current device context for GDI rendering.

+ +

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

After you use the GetDC method to retrieve a DC, you can render to the DXGI surface by using GDI. The GetDC method readies the surface for GDI rendering and allows inter-operation between DXGI and GDI technologies.

Keep the following in mind when using this method:

  • You must create the surface by using the D3D11_RESOURCE_MISC_GDI_COMPATIBLE flag for a surface or by using the DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE flag for swap chains, otherwise this method fails.
  • You must release the device and call the IDXGISurface1::ReleaseDC method before you issue any new Direct3D commands.
  • This method fails if an outstanding DC has already been created by this method.
  • The format for the surface or swap chain must be DXGI_FORMAT_B8G8R8A8_UNORM_SRGB or DXGI_FORMAT_B8G8R8A8_UNORM.
  • On GetDC, the render target in the output merger of the Direct3D pipeline is unbound from the surface. You must call the ID3D11DeviceContext::OMSetRenderTargets method on the device prior to Direct3D rendering after GDI rendering.
  • Prior to resizing buffers you must release all outstanding DCs.

You can also call GetDC on the back buffer at index 0 of a swap chain by obtaining an from the swap chain. The following code illustrates the process.

 * g_pSwapChain = null;
+            * g_pSurface1 = null;
+            ...
+            //Setup the device and and swapchain
+            g_pSwapChain->GetBuffer(0, __uuidof(), (void**) &g_pSurface1);
+            g_pSurface1->GetDC( , &g_hDC );
+            ...      
+            //Draw on the DC using GDI
+            ...
+            //When finish drawing release the DC
+            g_pSurface1->ReleaseDC( null ); 
+
+ ff471345 + HRESULT IDXGISurface1::GetDC([In] BOOL Discard,[Out] HDC* phdc) + IDXGISurface1::GetDC +
+ + +

Releases the GDI device context (DC) that is associated with the current surface and allows you to use Direct3D to render.

+
+

A reference to a structure that identifies the dirty region of the surface. A dirty region is any part of the surface that you used for GDI rendering and that you want to preserve. This area is used as a performance hint to graphics subsystem in certain scenarios. Do not use this parameter to restrict rendering to the specified rectangular region. If you pass in null, ReleaseDC considers the whole surface as dirty. Otherwise, ReleaseDC uses the area specified by the as a performance hint to indicate what areas have been manipulated by GDI rendering.

You can pass a reference to an empty structure (a rectangle with no position or area) if you didn't change any content.

+

If this method succeeds, it returns . Otherwise, it returns an error code.

+ +

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

Use the ReleaseDC method to release the DC and indicate that your application finished all GDI rendering to this surface. You must call the ReleaseDC method before you can use Direct3D to perform additional rendering.

Prior to resizing buffers you must release all outstanding DCs.

+
+ ff471346 + HRESULT IDXGISurface1::ReleaseDC([In, Optional] RECT* pDirtyRect) + IDXGISurface1::ReleaseDC +
+ + + Initializes a new sub resource surface instance of class. + + + + + + +

Gets the parent resource and subresource index that support a subresource surface.

+
+

The globally unique identifier () of the requested interface type.

+

A reference to a buffer that receives a reference to the parent resource object for the subresource surface.

+

A reference to a variable that receives the index of the subresource surface.

+

Returns if successful; otherwise, returns one of the following values:

  • E_NOINTERFACE if the object does not implement the that the riid parameter specifies.
  • Possibly other error codes that are described in the DXGI_ERROR topic.
+ +

For subresource surface objects that the IDXGIResource1::CreateSubresourceSurface method creates, GetResource simply returns the values that were used to create the subresource surface.

Current objects that implement are either resources or views. GetResource for these objects returns ?this? or the resource that supports the view respectively. In this situation, the subresource index is 0.

+
+ hh404629 + HRESULT IDXGISurface2::GetResource([In] const GUID& riid,[Out] void** ppParentResource,[Out] unsigned int* pSubresourceIndex) + IDXGISurface2::GetResource +
+ + + Creates a swap chain. + + + If you attempt to create a swap chain in full-screen mode, and full-screen mode is unavailable, the swap chain will be created in windowed mode and DXGI_STATUS_OCCLUDED will be returned. If the buffer width or the buffer height are zero, the sizes will be inferred from the output window size in the swap-chain description. Since the target output cannot be chosen explicitly when the swap-chain is created, you should not create a full-screen swap chain. This can reduce presentation performance if the swap chain size and the output window size do not match. Here are two ways to ensure the sizes match: Create a windowed swap chain and then set it full-screen using . Save a reference to the swap-chain immediately after creation, and use it to get the output window size during a WM_SIZE event. Then resize the swap chain buffers (with ) during the transition from windowed to full-screen. If the swap chain is in full-screen mode, before you release it, you must use {{SetFullscreenState}} to switch it to windowed mode. For more information about releasing a swap chain, see the Destroying a Swap Chain section of {{DXGI Overview}}. + + a reference to a . + A reference to the device that will write 2D images to the swap chain. + A reference to the swap-chain description (see ). + HRESULT IDXGIFactory::CreateSwapChain([In] IUnknown* pDevice,[In] DXGI_SWAP_CHAIN_DESC* pDesc,[Out] IDXGISwapChain** ppSwapChain) + bb174537 + HRESULT IDXGIFactory::CreateSwapChain([In] IUnknown* pDevice,[In] DXGI_SWAP_CHAIN_DESC* pDesc,[Out, Fast] IDXGISwapChain** ppSwapChain) + IDXGIFactory::CreateSwapChain + + + + Access one of the swap-chain back buffers. + + The interface of the surface to resolve from the back buffer + A zero-based buffer index. If the swap effect is not DXGI_SWAP_EFFECT_SEQUENTIAL, this method only has access to the first buffer; for this case, set the index to zero. + + Returns a reference to a back-buffer interface. + + bb174570 + HRESULT IDXGISwapChain::GetBuffer([In] unsigned int Buffer,[In] const GUID& riid,[Out] void** ppSurface) + IDXGISwapChain::GetBuffer + + + +

Gets performance statistics about the last render frame.

+
+ +

You cannot use GetFrameStatistics for swap chains that both use the bit-block transfer (bitblt) presentation model and draw in windowed mode.

You can only use GetFrameStatistics for swap chains that either use the flip presentation model or draw in full-screen mode. You set the value in the SwapEffect member of the structure to specify that the swap chain uses the flip presentation model.

+
+ + bb174573 + GetFrameStatistics + GetFrameStatistics + HRESULT IDXGISwapChain::GetFrameStatistics([Out] DXGI_FRAME_STATISTICS* pStats) +
+ + + Gets or sets a value indicating whether the swapchain is in fullscreen. + + + true if this swapchain is in fullscreen; otherwise, false. + + bb174574 + HRESULT IDXGISwapChain::GetFullscreenState([Out] BOOL* pFullscreen,[Out] IDXGIOutput** ppTarget) + IDXGISwapChain::GetFullscreenState + + + +

[Starting with Direct3D 11.1, we recommend not to use Present anymore to present a rendered image. Instead, use . For more info, see Remarks.]

Presents a rendered image to the user.

+
+ No documentation. + No documentation. +

Possible return values include: , or (see DXGI_ERROR), (see ), or D3DDDIERR_DEVICEREMOVED.

Note??The Present method can return either or D3DDDIERR_DEVICEREMOVED if a video card has been physically removed from the computer, or a driver upgrade for the video card has occurred.

+ +

Starting with Direct3D 11.1, we recommend to instead use because you can then use dirty rectangles and the scroll rectangle in the swap chain presentation and as such use less memory bandwidth and as a result less system power. For more info about using dirty rectangles and the scroll rectangle in swap chain presentation, see Using dirty rectangles and the scroll rectangle in swap chain presentation.

For the best performance when flipping swap-chain buffers in a full-screen application, see Full-Screen Application Performance Hints.

Because calling Present might cause the render thread to wait on the message-pump thread, be careful when calling this method in an application that uses multiple threads. For more details, see Multithreading Considerations.

Differences between Direct3D 9 and Direct3D 10:

Specifying in the Flags parameter is analogous to IDirect3DDevice9::TestCooperativeLevel in Direct3D 9.

?

For flip presentation model swap chains that you create with the value set, a successful presentation unbinds back buffer 0 from the graphics pipeline, except for when you pass the flag in the Flags parameter.

For info about how data values change when you present content to the screen, see Converting data for the color space.

+
+ + bb174576 + HRESULT IDXGISwapChain::Present([In] unsigned int SyncInterval,[In] DXGI_PRESENT_FLAGS Flags) + IDXGISwapChain::Present +
+ + +

[Starting with Direct3D 11.1, we recommend not to use GetDesc anymore to get a description of the swap chain. Instead, use IDXGISwapChain1::GetDesc1.]

Get a description of the swap chain.

+
+ bb174572 + GetDesc + GetDesc +
+ + +

Get the output (the display monitor) that contains the majority of the client area of the target window.

+
+ +

If the method succeeds, the output interface will be filled and its reference count incremented. When you are finished with it, be sure to release the interface to avoid a memory leak.

The output is also owned by the adapter on which the swap chain's device was created.

You cannot call GetContainingOutput on a swap chain that you created with IDXGIFactory2::CreateSwapChainForComposition.

+
+ bb174571 + GetContainingOutput + GetContainingOutput +
+ + +

Gets the number of times that IDXGISwapChain::Present or IDXGISwapChain1::Present1 has been called.

+
+ +

For info about presentation statistics for a frame, see .

+
+ bb174575 + GetLastPresentCount + GetLastPresentCount +
+ + +

Presents a rendered image to the user.

+
+

An integer that specifies how to synchronize presentation of a frame with the vertical blank.

For the bit-block transfer (bitblt) model (DXGI_SWAP_EFFECT_DISCARD or DXGI_SWAP_EFFECT_SEQUENTIAL), values are:

  • 0 - The presentation occurs immediately, there is no synchronization.
  • 1 through 4 - Synchronize presentation after the nth vertical blank.

For the flip model (DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL), values are:

  • 0 - Cancel the remaining time on the previously presented frame and discard this frame if a newer frame is queued.
  • 1 through 4 - Synchronize presentation for at least n vertical blanks.

For an example that shows how sync-interval values affect a flip presentation queue, see Remarks.

If the update region straddles more than one output (each represented by ), Present performs the synchronization to the output that contains the largest sub-rectangle of the target window's client area.

+

An integer value that contains swap-chain presentation options. These options are defined by the DXGI_PRESENT constants.

+

Possible return values include: , or (see DXGI_ERROR), DXGI_STATUS_OCCLUDED (see ), or D3DDDIERR_DEVICEREMOVED.

Note??The Present method can return either or D3DDDIERR_DEVICEREMOVED if a video card has been physically removed from the computer, or a driver upgrade for the video card has occurred.?
+ +

Starting with Direct3D 11.1, consider using IDXGISwapChain1::Present1 because you can then use dirty rectangles and the scroll rectangle in the swap chain presentation and as such use less memory bandwidth and as a result less system power. For more info about using dirty rectangles and the scroll rectangle in swap chain presentation, see Using dirty rectangles and the scroll rectangle in swap chain presentation.

For the best performance when flipping swap-chain buffers in a full-screen application, see Full-Screen Application Performance Hints.

Because calling Present might cause the render thread to wait on the message-pump thread, be careful when calling this method in an application that uses multiple threads. For more details, see Multithreading Considerations.

Differences between Direct3D 9 and Direct3D 10:

Specifying DXGI_PRESENT_TEST in the Flags parameter is analogous to IDirect3DDevice9::TestCooperativeLevel in Direct3D 9.

?

For flip presentation model swap chains that you create with the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL value set, a successful presentation unbinds back buffer 0 from the graphics pipeline, except for when you pass the DXGI_PRESENT_DO_NOT_SEQUENCE flag in the Flags parameter.

For info about how data values change when you present content to the screen, see Converting data for the color space.

+
+ bb174576 + HRESULT IDXGISwapChain::Present([In] unsigned int SyncInterval,[In] unsigned int Flags) + IDXGISwapChain::Present +
+ + +

Accesses one of the swap-chain's back buffers.

+
+

A zero-based buffer index.

If the swap chain's swap effect is DXGI_SWAP_EFFECT_DISCARD, this method can only access the first buffer; for this situation, set the index to zero.

If the swap chain's swap effect is either DXGI_SWAP_EFFECT_SEQUENTIAL or DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, only the swap chain's zero-index buffer can be read from and written to. The swap chain's buffers with indexes greater than zero can only be read from; so if you call the IDXGIResource::GetUsage method for such buffers, they have the DXGI_USAGE_READ_ONLY flag set.

+

The type of interface used to manipulate the buffer.

+

A reference to a back-buffer interface.

+

Returns one of the following DXGI_ERROR.

+ bb174570 + HRESULT IDXGISwapChain::GetBuffer([In] unsigned int Buffer,[In] const GUID& riid,[Out] void** ppSurface) + IDXGISwapChain::GetBuffer +
+ + +

Sets the display state to windowed or full screen.

+
+

A Boolean value that specifies whether to set the display state to windowed or full screen. TRUE for full screen, and for windowed.

+

If you pass TRUE to the Fullscreen parameter to set the display state to full screen, you can optionally set this parameter to a reference to an interface for the output target that contains the swap chain. If you set this parameter to null, DXGI will choose the output based on the swap-chain's device and the output window's placement. If you pass to Fullscreen, you must set this parameter to null.

+

This methods returns:

  • if the action succeeded and the swap chain was placed in the requested state.
  • if the action failed. There are many reasons why a windowed-mode swap chain cannot switch to full-screen mode. For instance:
    • The application is running over Terminal Server.
    • The output window is occluded.
    • The output window does not have keyboard focus.
    • Another application is already in full-screen mode.

    When this error is returned, an application can continue to run in windowed mode and try to switch to full-screen mode later.

  • DXGI_STATUS_MODE_CHANGE_IN_PROGRESS is returned if a fullscreen/windowed mode transition is occurring when this API is called.
  • Other error codes if you run out of memory or encounter another unexpected fault; these codes may be treated as hard, non-continuable errors.
+ +

DXGI may change the display state of a swap chain in response to end user or system requests.

We recommend that you create a windowed swap chain and allow the end user to change the swap chain to full screen through SetFullscreenState; that is, do not set the Windowed member of to to force the swap chain to be full screen. However, if you create the swap chain as full screen, also provide the end user with a list of supported display modes because a swap chain that is created with an unsupported display mode might cause the display to go black and prevent the end user from seeing anything. Also, we recommend that you have a time-out confirmation screen or other fallback mechanism when you allow the end user to change display modes.

+
+ bb174579 + HRESULT IDXGISwapChain::SetFullscreenState([In] BOOL Fullscreen,[In, Optional] IDXGIOutput* pTarget) + IDXGISwapChain::SetFullscreenState +
+ + +

Get the state associated with full-screen mode.

+
+

A reference to a boolean whose value is either:

  • TRUE if the swap chain is in full-screen mode
  • if the swap chain is in windowed mode
+

A reference to the output target (see ) when the mode is full screen; otherwise null.

+

Returns one of the following DXGI_ERROR.

+ +

When the swap chain is in full-screen mode, a reference to the target output will be returned and its reference count will be incremented.

+
+ bb174574 + HRESULT IDXGISwapChain::GetFullscreenState([Out, Optional] BOOL* pFullscreen,[Out, Optional] IDXGIOutput** ppTarget) + IDXGISwapChain::GetFullscreenState +
+ + +

[Starting with Direct3D 11.1, we recommend not to use GetDesc anymore to get a description of the swap chain. Instead, use IDXGISwapChain1::GetDesc1.]

Get a description of the swap chain.

+
+ No documentation. +

Returns one of the following DXGI_ERROR.

+ bb174572 + HRESULT IDXGISwapChain::GetDesc([Out] DXGI_SWAP_CHAIN_DESC* pDesc) + IDXGISwapChain::GetDesc +
+ + +

Changes the swap chain's back buffer size, format, and number of buffers. This should be called when the application window is resized.

+
+

The number of buffers in the swap chain (including all back and front buffers). This number can be different from the number of buffers with which you created the swap chain. This number can't be greater than DXGI_MAX_SWAP_CHAIN_BUFFERS. Set this number to zero to preserve the existing number of buffers in the swap chain. You can't specify less than two buffers for the flip presentation model.

+

The new width of the back buffer. If you specify zero, DXGI will use the width of the client area of the target window. You can't specify the width as zero if you called the IDXGIFactory2::CreateSwapChainForComposition method to create the swap chain for a composition surface.

+

The new height of the back buffer. If you specify zero, DXGI will use the height of the client area of the target window. You can't specify the height as zero if you called the IDXGIFactory2::CreateSwapChainForComposition method to create the swap chain for a composition surface.

+

A -typed value for the new format of the back buffer. Set this value to DXGI_FORMAT_UNKNOWN to preserve the existing format of the back buffer. The flip presentation model supports a more restricted set of formats than the bit-block transfer (bitblt) model.

+

A combination of -typed values that are combined by using a bitwise OR operation. The resulting value specifies options for swap-chain behavior.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ +

You can't resize a swap chain unless you release all outstanding references to its back buffers. You must release all of its direct and indirect references on the back buffers in order for ResizeBuffers to succeed.

Direct references are held by the application after it calls AddRef on a resource.

Indirect references are held by views to a resource, binding a view of the resource to a device context, a command list that used the resource, a command list that used a view to that resource, a command list that executed another command list that used the resource, and so on.

Before you call ResizeBuffers, ensure that the application releases all references (by calling the appropriate number of Release invocations) on the resources, any views to the resource, and any command lists that use either the resources or views, and ensure that neither the resource nor a view is still bound to a device context. You can use ID3D11DeviceContext::ClearState to ensure that all references are released. If a view is bound to a deferred context, you must discard the partially built command list as well (by calling ID3D11DeviceContext::ClearState, then ID3D11DeviceContext::FinishCommandList, then Release on the command list). After you call ResizeBuffers, you can re-query interfaces via IDXGISwapChain::GetBuffer.

For swap chains that you created with DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE, before you call ResizeBuffers, also call IDXGISurface1::ReleaseDC on the swap chain's back-buffer surface to ensure that you have no outstanding GDI device contexts (DCs) open.

We recommend that you call ResizeBuffers when a client window is resized (that is, when an application receives a WM_SIZE message).

The only difference between IDXGISwapChain::ResizeBuffers in Windows?8 versus Windows?7 is with flip presentation model swap chains that you create with the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL or DXGI_SWAP_EFFECT_FLIP_DISCARD value set. In Windows?8, you must call ResizeBuffers to realize a transition between full-screen mode and windowed mode; otherwise, your next call to the IDXGISwapChain::Present method fails.

+
+ bb174577 + HRESULT IDXGISwapChain::ResizeBuffers([In] unsigned int BufferCount,[In] unsigned int Width,[In] unsigned int Height,[In] DXGI_FORMAT NewFormat,[In] unsigned int SwapChainFlags) + IDXGISwapChain::ResizeBuffers +
+ + +

Resizes the output target.

+
+

A reference to a structure that describes the mode, which specifies the new width, height, format, and refresh rate of the target. If the format is DXGI_FORMAT_UNKNOWN, ResizeTarget uses the existing format. We only recommend that you use DXGI_FORMAT_UNKNOWN when the swap chain is in full-screen mode as this method is not thread safe.

+

Returns a code that indicates success or failure. DXGI_STATUS_MODE_CHANGE_IN_PROGRESS is returned if a full-screen/windowed mode transition is occurring when this API is called. See DXGI_ERROR for additional DXGI error codes.

+ +

ResizeTarget resizes the target window when the swap chain is in windowed mode, and changes the display mode on the target output when the swap chain is in full-screen mode. Therefore, apps can call ResizeTarget to resize the target window (rather than a Microsoft Win32API such as SetWindowPos) without knowledge of the swap chain display mode.

If a Windows Store app calls ResizeTarget, it fails with .

You cannot call ResizeTarget on a swap chain that you created with IDXGIFactory2::CreateSwapChainForComposition.

Apps must still call IDXGISwapChain::ResizeBuffers after they call ResizeTarget because only ResizeBuffers can change the back buffers. But, if those apps have implemented window resize processing to call ResizeBuffers, they don't need to explicitly call ResizeBuffers after they call ResizeTarget because the window resize processing will achieve what the app requires.

+
+ bb174578 + HRESULT IDXGISwapChain::ResizeTarget([In] const DXGI_MODE_DESC* pNewTargetParameters) + IDXGISwapChain::ResizeTarget +
+ + +

Get the output (the display monitor) that contains the majority of the client area of the target window.

+
+

A reference to the output interface (see ).

+

Returns one of the following DXGI_ERROR.

+ +

If the method succeeds, the output interface will be filled and its reference count incremented. When you are finished with it, be sure to release the interface to avoid a memory leak.

The output is also owned by the adapter on which the swap chain's device was created.

You cannot call GetContainingOutput on a swap chain that you created with IDXGIFactory2::CreateSwapChainForComposition.

+
+ bb174571 + HRESULT IDXGISwapChain::GetContainingOutput([Out] IDXGIOutput** ppOutput) + IDXGISwapChain::GetContainingOutput +
+ + +

Gets performance statistics about the last render frame.

+
+

A reference to a structure for the frame statistics.

+

Returns one of the DXGI_ERROR values.

+ +

You cannot use GetFrameStatistics for swap chains that both use the bit-block transfer (bitblt) presentation model and draw in windowed mode.

You can only use GetFrameStatistics for swap chains that either use the flip presentation model or draw in full-screen mode. You set the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL value in the SwapEffect member of the structure to specify that the swap chain uses the flip presentation model.

+
+ bb174573 + HRESULT IDXGISwapChain::GetFrameStatistics([Out] DXGI_FRAME_STATISTICS* pStats) + IDXGISwapChain::GetFrameStatistics +
+ + +

Gets the number of times that IDXGISwapChain::Present or IDXGISwapChain1::Present1 has been called.

+
+ No documentation. +

Returns one of the DXGI_ERROR values.

+ +

For info about presentation statistics for a frame, see .

+
+ bb174575 + HRESULT IDXGISwapChain::GetLastPresentCount([Out] unsigned int* pLastPresentCount) + IDXGISwapChain::GetLastPresentCount +
+ + + Creates a swapchain associated to the specified HWND. This is applicable only for Desktop platform. + + The DXGI Factory used to create the swapchain. + The associated device instance. + The HWND of the window to which this swapchain is associated. + The swap chain description. + The fullscreen description of the swap chain. Default is null. + The output to which this swap chain should be restricted. Default is null, meaning that there is no restriction. + + + + Creates a swapchain associated to the specified CoreWindow. This is applicable only for WinRT platform. + + The DXGI Factory used to create the swapchain. + The associated device instance. + The HWND of the window to which this swapchain is associated. + The swap chain description. + The output to which this swap chain should be restricted. Default is null, meaning that there is no restriction. + + + + Creates a swapchain for DirectComposition API or WinRT XAML framework. This is applicable only for WinRT platform. + + The DXGI Factory used to create the swapchain. + The associated device instance. + The swap chain description. + The output to which this swap chain should be restricted. Default is null, meaning that there is no restriction. + + + + Presents a frame on the display screen, internally using the Present1 method. + + An integer that specifies how to synchronize presentation of a frame with the vertical blank. For the bit-block transfer (bitblt) model, values are: 0 - The presentation occurs immediately, there is no synchronization. 1,2,3,4 - Synchronize presentation after the nth vertical blank. For the flip model, values are: 0 - Discard this frame if you submitted a more recent presentation. n > 0 - Synchronize presentation for at least n vertical blanks. For an example that shows how sync-interval values affect a flip presentation queue, see Remarks. If the update region straddles more than one output (each represented by ), Present1 performs the synchronization to the output that contains the largest subrectangle of the target window's client area. + An integer value that contains swap-chain presentation options. These options are defined by the DXGI_PRESENT constants. + A reference to a structure that describes updated rectangles and scroll information of the frame to present. + Possible return values include: , , , , or E_OUTOFMEMORY. + + An application can use Present1 to optimize presentation by specifying scroll and dirty rectangles. When the runtime has information about these rectangles, the runtime can then perform necessary bitblts during presentation more efficiently and pass this metadata to the Desktop Window Manager (DWM). The DWM can then use the metadata to optimize presentation and pass the metadata to indirect displays and terminal servers to optimize traffic over the wire. An application must confine its modifications to only the dirty regions that it passes to Present1, as well as modify the entire dirty region to avoid undefined resource contents from being exposed.For flip presentation model swap chains that you create with the value set, a successful presentation results in an unbind of back buffer 0 from the graphics pipeline, except for when you pass the flag in the Flags parameter.Flip presentation model queueSuppose the following frames with sync-interval values are queued from oldest (A) to newest (E) before you call Present1.A: 3, B: 0, C: 0, D: 1, E: 0When you call Present1, the runtime shows frame A for 3 vertical blank intervals, then frame D for 1 vertical blank interval, and then frame E until you submit a new presentation. The runtime discards frames C and D. + + + HRESULT IDXGISwapChain1::Present1([In] unsigned int SyncInterval,[In] unsigned int PresentFlags,[In] const void* pPresentParameters) + + + +

Gets a description of the swap chain.

+
+ hh404640 + GetDesc1 + GetDesc1 +
+ + +

Gets a description of a full-screen swap chain.

+
+ +

The semantics of GetFullscreenDesc are identical to that of the IDXGISwapchain::GetDesc method for -based swap chains.

+
+ hh404644 + GetFullscreenDesc + GetFullscreenDesc +
+ + +

Retrieves the underlying for this swap-chain object.

+
+ +

Applications call the IDXGIFactory2::CreateSwapChainForHwnd method to create a swap chain that is associated with an .

+
+ hh404647 + GetHwnd + GetHwnd +
+ + +

Determines whether a swap chain supports ?temporary mono.?

+
+ +

Temporary mono is a feature where a stereo swap chain can be presented using only the content in the left buffer. To present using the left buffer as a mono buffer, an application calls the IDXGISwapChain1::Present1 method with the DXGI_PRESENT_STEREO_TEMPORARY_MONO flag. All windowed swap chains support temporary mono. However, full-screen swap chains optionally support temporary mono because not all hardware supports temporary mono on full-screen swap chains efficiently.

+
+ hh446794 + IsTemporaryMonoSupported + IsTemporaryMonoSupported +
+ + +

Gets the output (the display monitor) to which you can restrict the contents of a present operation.

+
+ +

If the method succeeds, the runtime fills the buffer at ppRestrictToOutput with a reference to the restrict-to output interface. This restrict-to output interface has its reference count incremented. When you are finished with it, be sure to release the interface to avoid a memory leak.

The output is also owned by the adapter on which the swap chain's device was created.

+
+ hh446788 + GetRestrictToOutput + GetRestrictToOutput +
+ + +

Retrieves or sets the background color of the swap chain.

+
+ + Note??The background color that GetBackgroundColor retrieves does not indicate what the screen currently displays. The background color indicates what the screen will display with your next call to the IDXGISwapChain1::Present1 method. The default value of the background color is black with full opacity: 0,0,0,1.? + + hh404634 + GetBackgroundColor / SetBackgroundColor + GetBackgroundColor +
+ + +

Gets or sets the rotation of the back buffers for the swap chain.

+
+ hh446791 + GetRotation / SetRotation + GetRotation +
+ + +

Gets a description of the swap chain.

+
+

A reference to a structure that describes the swap chain.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ hh404640 + HRESULT IDXGISwapChain1::GetDesc1([Out] DXGI_SWAP_CHAIN_DESC1* pDesc) + IDXGISwapChain1::GetDesc1 +
+ + +

Gets a description of a full-screen swap chain.

+
+

A reference to a structure that describes the full-screen swap chain.

+

GetFullscreenDesc returns:

  • if it successfully retrieved the description of the full-screen swap chain.
  • for non- swap chains or if pDesc is null.
  • Possibly other error codes that are described in the DXGI_ERROR topic.
+ +

The semantics of GetFullscreenDesc are identical to that of the IDXGISwapchain::GetDesc method for -based swap chains.

+
+ hh404644 + HRESULT IDXGISwapChain1::GetFullscreenDesc([Out] DXGI_SWAP_CHAIN_FULLSCREEN_DESC* pDesc) + IDXGISwapChain1::GetFullscreenDesc +
+ + +

Retrieves the underlying for this swap-chain object.

+
+ No documentation. +

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

If pHwnd receives null (that is, the swap chain is not -based), GetHwnd returns .

+ +

Applications call the IDXGIFactory2::CreateSwapChainForHwnd method to create a swap chain that is associated with an .

+
+ hh404647 + HRESULT IDXGISwapChain1::GetHwnd([Out] HWND* pHwnd) + IDXGISwapChain1::GetHwnd +
+ + +

Retrieves the underlying CoreWindow object for this swap-chain object.

+
+ No documentation. + No documentation. +

GetCoreWindow returns:

  • if it successfully retrieved the underlying CoreWindow object.
  • if ppUnk is null; that is, the swap chain is not associated with a CoreWindow object.
  • Any that a call to QueryInterface to query for an CoreWindow object might typically return.
  • Possibly other error codes that are described in the DXGI_ERROR topic.

Platform Update for Windows?7:??On Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed, GetCoreWindow fails with E_NOTIMPL. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+ +

Applications call the IDXGIFactory2::CreateSwapChainForCoreWindow method to create a swap chain that is associated with an CoreWindow object.

+
+ hh404650 + HRESULT IDXGISwapChain1::GetCoreWindow([In] const GUID& refiid,[Out] void** ppUnk) + IDXGISwapChain1::GetCoreWindow +
+ + +

Presents a frame on the display screen.

+
+

An integer that specifies how to synchronize presentation of a frame with the vertical blank.

For the bit-block transfer (bitblt) model (DXGI_SWAP_EFFECT_DISCARD or DXGI_SWAP_EFFECT_SEQUENTIAL), values are:

  • 0 - The presentation occurs immediately, there is no synchronization.
  • 1 through 4 - Synchronize presentation after the nth vertical blank.

For the flip model (DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL), values are:

  • 0 - Cancel the remaining time on the previously presented frame and discard this frame if a newer frame is queued.
  • 1 through 4 - Synchronize presentation for at least n vertical blanks.

For an example that shows how sync-interval values affect a flip presentation queue, see Remarks.

If the update region straddles more than one output (each represented by ), Present1 performs the synchronization to the output that contains the largest sub-rectangle of the target window's client area.

+

An integer value that contains swap-chain presentation options. These options are defined by the DXGI_PRESENT constants.

+

A reference to a structure that describes updated rectangles and scroll information of the frame to present.

+

Possible return values include: , , DXGI_STATUS_OCCLUDED, , or E_OUTOFMEMORY.

+ +

An app can use Present1 to optimize presentation by specifying scroll and dirty rectangles. When the runtime has information about these rectangles, the runtime can then perform necessary bitblts during presentation more efficiently and pass this metadata to the Desktop Window Manager (DWM). The DWM can then use the metadata to optimize presentation and pass the metadata to indirect displays and terminal servers to optimize traffic over the wire. An app must confine its modifications to only the dirty regions that it passes to Present1, as well as modify the entire dirty region to avoid undefined resource contents from being exposed.

For flip presentation model swap chains that you create with the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL value set, a successful presentation results in an unbind of back buffer 0 from the graphics pipeline, except for when you pass the DXGI_PRESENT_DO_NOT_SEQUENCE flag in the Flags parameter.

For info about how data values change when you present content to the screen, see Converting data for the color space.

For info about calling Present1 when your app uses multiple threads, see Multithread Considerations and Multithreading and DXGI.

+
+ hh446797 + HRESULT IDXGISwapChain1::Present1([In] unsigned int SyncInterval,[In] unsigned int PresentFlags,[In] const DXGI_PRESENT_PARAMETERS* pPresentParameters) + IDXGISwapChain1::Present1 +
+ + +

Determines whether a swap chain supports ?temporary mono.?

+
+

Indicates whether to use the swap chain in temporary mono mode. TRUE indicates that you can use temporary-mono mode; otherwise, .

Platform Update for Windows?7:??On Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed, IsTemporaryMonoSupported always returns because stereoscopic 3D display behavior isn?t available with the Platform Update for Windows?7. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+ +

Temporary mono is a feature where a stereo swap chain can be presented using only the content in the left buffer. To present using the left buffer as a mono buffer, an application calls the IDXGISwapChain1::Present1 method with the DXGI_PRESENT_STEREO_TEMPORARY_MONO flag. All windowed swap chains support temporary mono. However, full-screen swap chains optionally support temporary mono because not all hardware supports temporary mono on full-screen swap chains efficiently.

+
+ hh446794 + BOOL IDXGISwapChain1::IsTemporaryMonoSupported() + IDXGISwapChain1::IsTemporaryMonoSupported +
+ + +

Gets the output (the display monitor) to which you can restrict the contents of a present operation.

+
+

A reference to a buffer that receives a reference to the interface for the restrict-to output. An application passes this reference to in a call to the IDXGIFactory2::CreateSwapChainForHwnd, IDXGIFactory2::CreateSwapChainForCoreWindow, or IDXGIFactory2::CreateSwapChainForComposition method to create the swap chain.

+

Returns if the restrict-to output was successfully retrieved; otherwise, returns E_INVALIDARG if the reference is invalid.

+ +

If the method succeeds, the runtime fills the buffer at ppRestrictToOutput with a reference to the restrict-to output interface. This restrict-to output interface has its reference count incremented. When you are finished with it, be sure to release the interface to avoid a memory leak.

The output is also owned by the adapter on which the swap chain's device was created.

+
+ hh446788 + HRESULT IDXGISwapChain1::GetRestrictToOutput([Out] IDXGIOutput** ppRestrictToOutput) + IDXGISwapChain1::GetRestrictToOutput +
+ + +

Changes the background color of the swap chain.

+
+

A reference to a DXGI_RGBA structure that specifies the background color to set.

+

SetBackgroundColor returns:

  • if it successfully set the background color.
  • E_INVALIDARG if the pColor parameter is incorrect, for example, pColor is null or any of the floating-point values of the members of DXGI_RGBA to which pColor points are outside the range from 0.0 through 1.0.
  • Possibly other error codes that are described in the DXGI_ERROR topic.

Platform Update for Windows?7:??On Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed, SetBackgroundColor fails with E_NOTIMPL. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+ +

The background color affects only swap chains that you create with DXGI_SCALING_NONE in windowed mode. You pass this value in a call to IDXGIFactory2::CreateSwapChainForHwnd, IDXGIFactory2::CreateSwapChainForCoreWindow, or IDXGIFactory2::CreateSwapChainForComposition. Typically, the background color is not visible unless the swap-chain contents are smaller than the destination window.

When you set the background color, it is not immediately realized. It takes effect in conjunction with your next call to the IDXGISwapChain1::Present1 method. The DXGI_PRESENT flags that you pass to IDXGISwapChain1::Present1 can help achieve the effect that you require. For example, if you call SetBackgroundColor and then call IDXGISwapChain1::Present1 with the Flags parameter set to DXGI_PRESENT_DO_NOT_SEQUENCE, you change only the background color without changing the displayed contents of the swap chain.

When you call the IDXGISwapChain1::Present1 method to display contents of the swap chain, IDXGISwapChain1::Present1 uses the value that is specified in the AlphaMode member of the structure to determine how to handle the a member of the DXGI_RGBA structure, the alpha value of the background color, that achieves window transparency. For example, if AlphaMode is DXGI_ALPHA_MODE_IGNORE, IDXGISwapChain1::Present1 ignores the a member of DXGI_RGBA.

Note??Like all presentation data, we recommend that you perform floating point operations in a linear color space. When the desktop is in a fixed bit color depth mode, the operating system converts linear color data to standard RGB data (sRGB, gamma 2.2 corrected space) to compose to the screen. For more info, see Converting data for the color space.? +
+ hh446799 + HRESULT IDXGISwapChain1::SetBackgroundColor([In] const D3DCOLORVALUE* pColor) + IDXGISwapChain1::SetBackgroundColor +
+ + +

Retrieves the background color of the swap chain.

+
+

A reference to a DXGI_RGBA structure that receives the background color of the swap chain.

+

GetBackgroundColor returns:

  • if it successfully retrieves the background color.
  • if the pColor parameter is invalid, for example, pColor is null.
  • Possibly other error codes that are described in the DXGI_ERROR topic.
+ + Note??The background color that GetBackgroundColor retrieves does not indicate what the screen currently displays. The background color indicates what the screen will display with your next call to the IDXGISwapChain1::Present1 method. The default value of the background color is black with full opacity: 0,0,0,1.? + + hh404634 + HRESULT IDXGISwapChain1::GetBackgroundColor([Out] D3DCOLORVALUE* pColor) + IDXGISwapChain1::GetBackgroundColor +
+ + +

Sets the rotation of the back buffers for the swap chain.

+
+

A -typed value that specifies how to set the rotation of the back buffers for the swap chain.

+

SetRotation returns:

  • if it successfully set the rotation.
  • if the swap chain is bit-block transfer (bitblt) model. The swap chain must be flip model to successfully call SetRotation.
  • Possibly other error codes that are described in the DXGI_ERROR topic.

Platform Update for Windows?7:??On Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed, SetRotation fails with . For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+ +

You can only use SetRotation to rotate the back buffers for flip-model swap chains that you present in windowed mode.

SetRotation isn't supported for rotating the back buffers for flip-model swap chains that you present in full-screen mode. In this situation, SetRotation doesn't fail, but you must ensure that you specify no rotation (DXGI_MODE_ROTATION_IDENTITY) for the swap chain. Otherwise, when you call IDXGISwapChain1::Present1 or IDXGISwapChain::Present to present a frame, the presentation fails.

+
+ hh446801 + HRESULT IDXGISwapChain1::SetRotation([In] DXGI_MODE_ROTATION Rotation) + IDXGISwapChain1::SetRotation +
+ + +

Gets the rotation of the back buffers for the swap chain.

+
+

A reference to a variable that receives a -typed value that specifies the rotation of the back buffers for the swap chain.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

Platform Update for Windows?7:??On Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed, GetRotation fails with . For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+ hh446791 + HRESULT IDXGISwapChain1::GetRotation([Out] DXGI_MODE_ROTATION* pRotation) + IDXGISwapChain1::GetRotation +
+ + +

[This documentation is preliminary and is subject to change.]

Gets the source region used for the swap chain.

Use GetSourceSize to get the portion of the swap chain from which the operating system presents. The source rectangle is always defined by the region [0, 0, Width, Height]. Use SetSourceSize to set this portion of the swap chain.

+
+

This method can return error codes that are described in the DXGI_ERROR topic.

+ + dn280408 + HRESULT IDXGISwapChain2::GetSourceSize([Out] unsigned int* pWidth,[Out] unsigned int* pHeight) + IDXGISwapChain2::GetSourceSize +
+ + +

Gets or sets the number of frames that the swap chain is allowed to queue for rendering.

+
+ dn268311 + GetMaximumFrameLatency / SetMaximumFrameLatency + GetMaximumFrameLatency +
+ + +

Returns a waitable handle that signals when the DXGI adapter has finished presenting a new frame.

Windows?8.1 introduces new APIs that allow lower-latency rendering by waiting until the previous frame is presented to the display before drawing the next frame. To use this method, first create the DXGI swap chain with the DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT flag set, then call GetFrameLatencyWaitableObject to retrieve the waitable handle. Use the waitable handle with WaitForSingleObjectEx to synchronize rendering of each new frame with the end of the previous frame. For every frame it renders, the app should wait on this handle before starting any rendering operations. Note that this requirement includes the first frame the app renders with the swap chain. See the DirectXLatency sample.

+
+ dn268309 + GetFrameLatencyWaitableObject + GetFrameLatencyWaitableObject +
+ + +

Gets or sets the transform matrix that will be applied to a composition swap chain upon the next present.

Starting with Windows?8.1, Windows Store apps are able to place DirectX swap chain visuals in XAML pages using the SwapChainPanel element, which can be placed and sized arbitrarily. This exposes the DirectX swap chain visuals to touch scaling and translation scenarios using touch UI. The GetMatrixTransform and SetMatrixTransform methods are used to synchronize scaling of the DirectX swap chain with its associated SwapChainPanel element. Only simple scale/translation elements in the matrix are allowed ? the call will fail if the matrix contains skew/rotation elements.

+
+ dn268310 + GetMatrixTransform / SetMatrixTransform + GetMatrixTransform +
+ + +

Sets the source region to be used for the swap chain.

Use SetSourceSize to specify the portion of the swap chain from which the operating system presents. This allows an effective resize without calling the more-expensive IDXGISwapChain::ResizeBuffers method. Prior to Windows?8.1, calling IDXGISwapChain::ResizeBuffers was the only way to resize the swap chain. The source rectangle is always defined by the region [0, 0, Width, Height].

+
+ No documentation. + No documentation. +

This method can return:

  • E_INVALIDARG if one or more parameters exceed the size of the back buffer.
  • Possibly other error codes that are described in the DXGI_ERROR topic.
+ dn280409 + HRESULT IDXGISwapChain2::SetSourceSize([In] unsigned int Width,[In] unsigned int Height) + IDXGISwapChain2::SetSourceSize +
+ + +

Gets the source region used for the swap chain.

Use GetSourceSize to get the portion of the swap chain from which the operating system presents. The source rectangle is always defined by the region [0, 0, Width, Height]. Use SetSourceSize to set this portion of the swap chain.

+
+ No documentation. + No documentation. +

This method can return error codes that are described in the DXGI_ERROR topic.

+ dn280408 + HRESULT IDXGISwapChain2::GetSourceSize([Out] unsigned int* pWidth,[Out] unsigned int* pHeight) + IDXGISwapChain2::GetSourceSize +
+ + +

Sets the number of frames that the swap chain is allowed to queue for rendering.

+
+

The maximum number of back buffer frames that will be queued for the swap chain. This value is 3 by default.

+

Returns if successful; otherwise, if the device was removed.

+ +

This method is only valid for use on swap chains created with DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT. Otherwise, the result will be .

+
+ dn268313 + HRESULT IDXGISwapChain2::SetMaximumFrameLatency([In] unsigned int MaxLatency) + IDXGISwapChain2::SetMaximumFrameLatency +
+ + +

Gets the number of frames that the swap chain is allowed to queue for rendering.

+
+

The maximum number of back buffer frames that will be queued for the swap chain. This value is 1 by default, but should be set to 2 if the scene takes longer than it takes for one vertical refresh (typically about 16ms) to draw.

+

Returns if successful; otherwise, returns one of the following members of the D3DERR enumerated type:

  • D3DERR_DEVICELOST
  • D3DERR_DEVICEREMOVED
  • D3DERR_DRIVERINTERNALERROR
  • D3DERR_INVALIDCALL
  • D3DERR_OUTOFVIDEOMEMORY
+ dn268311 + HRESULT IDXGISwapChain2::GetMaximumFrameLatency([Out] unsigned int* pMaxLatency) + IDXGISwapChain2::GetMaximumFrameLatency +
+ + +

Returns a waitable handle that signals when the DXGI adapter has finished presenting a new frame.

Windows?8.1 introduces new APIs that allow lower-latency rendering by waiting until the previous frame is presented to the display before drawing the next frame. To use this method, first create the DXGI swap chain with the DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT flag set, then call GetFrameLatencyWaitableObject to retrieve the waitable handle. Use the waitable handle with WaitForSingleObjectEx to synchronize rendering of each new frame with the end of the previous frame. For every frame it renders, the app should wait on this handle before starting any rendering operations. Note that this requirement includes the first frame the app renders with the swap chain. See the DirectXLatency sample.

+
+

A handle to the waitable object, or null if the swap chain was not created with DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT.

+ dn268309 + void* IDXGISwapChain2::GetFrameLatencyWaitableObject() + IDXGISwapChain2::GetFrameLatencyWaitableObject +
+ + +

Sets the transform matrix that will be applied to a composition swap chain upon the next present.

Starting with Windows?8.1, Windows Store apps are able to place DirectX swap chain visuals in XAML pages using the SwapChainPanel element, which can be placed and sized arbitrarily. This exposes the DirectX swap chain visuals to touch scaling and translation scenarios using touch UI. The GetMatrixTransform and SetMatrixTransform methods are used to synchronize scaling of the DirectX swap chain with its associated SwapChainPanel element. Only simple scale/translation elements in the matrix are allowed ? the call will fail if the matrix contains skew/rotation elements.

+
+ No documentation. +

SetMatrixTransform returns:

  • if it successfully retrieves the transform matrix.
  • E_INVALIDARG if the pMatrix parameter is incorrect, for example, pMatrix is null or the matrix represented by includes components other than scale and translation.
  • if the method is called on a swap chain that was not created with CreateSwapChainForComposition.
  • Possibly other error codes that are described in the DXGI_ERROR topic.
+ dn268312 + HRESULT IDXGISwapChain2::SetMatrixTransform([In] const DXGI_MATRIX_3X2_F* pMatrix) + IDXGISwapChain2::SetMatrixTransform +
+ + +

Gets the transform matrix that will be applied to a composition swap chain upon the next present.

Starting with Windows?8.1, Windows Store apps are able to place DirectX swap chain visuals in XAML pages using the SwapChainPanel element, which can be placed and sized arbitrarily. This exposes the DirectX swap chain visuals to touch scaling and translation scenarios using touch UI. The GetMatrixTransform and SetMatrixTransform methods are used to synchronize scaling of the DirectX swap chain with its associated SwapChainPanel element. Only simple scale/translation elements in the matrix are allowed ? the call will fail if the matrix contains skew/rotation elements.

+
+ No documentation. +

GetMatrixTransform returns:

  • if it successfully retrieves the transform matrix.
  • if the method is called on a swap chain that was not created with CreateSwapChainForComposition.
  • Possibly other error codes that are described in the DXGI_ERROR topic.
+ dn268310 + HRESULT IDXGISwapChain2::GetMatrixTransform([Out] DXGI_MATRIX_3X2_F* pMatrix) + IDXGISwapChain2::GetMatrixTransform +
+ + + Internal VirtualSurfaceUpdatesCallbackNative Callback + + + + + Get a native callback pointer from a managed callback. + + The geometry sink. + A pointer to the unmanaged geometry sink counterpart + + + +

Specifies no flags.

+
+ ff471327 + DXGI_ADAPTER_FLAG_NONE + DXGI_ADAPTER_FLAG_NONE +
+ + +

Value always set to 0. This flag is reserved.

+
+ ff471327 + DXGI_ADAPTER_FLAG_REMOTE + DXGI_ADAPTER_FLAG_REMOTE +
+ + +

Specifies a software adapter. For more info about this flag, see new info in Windows?8 about enumerating adapters.

Direct3D 11:??This enumeration value is supported starting with Windows?8.

+
+ ff471327 + DXGI_ADAPTER_FLAG_SOFTWARE + DXGI_ADAPTER_FLAG_SOFTWARE +
+ + +

Identifies the type of DXGI adapter.

+
+ +

The enumerated type is used by the Flags member of the or structure to identify the type of DXGI adapter.

+
+ ff471327 + DXGI_ADAPTER_FLAG3 + DXGI_ADAPTER_FLAG3 +
+ + +

Specifies no flags.

+
+ ff471327 + DXGI_ADAPTER_FLAG3_NONE + DXGI_ADAPTER_FLAG3_NONE +
+ + +

Value always set to 0. This flag is reserved.

+
+ ff471327 + DXGI_ADAPTER_FLAG3_REMOTE + DXGI_ADAPTER_FLAG3_REMOTE +
+ + +

Specifies a software adapter. For more info about this flag, see new info in Windows?8 about enumerating adapters.

Direct3D 11:??This enumeration value is supported starting with Windows?8.

+
+ ff471327 + DXGI_ADAPTER_FLAG3_SOFTWARE + DXGI_ADAPTER_FLAG3_SOFTWARE +
+ + +

Forces this enumeration to compile to 32 bits in size. Without this value, some compilers would allow this enumeration to compile to a size other than 32 bits. This value is not used.

+
+ ff471327 + DXGI_ADAPTER_FLAG3_ACG_COMPATIBLE + DXGI_ADAPTER_FLAG3_ACG_COMPATIBLE +
+ + + No documentation. + + ff471327 + DXGI_ADAPTER_FLAG3_SUPPORT_MONITORED_FENCES + DXGI_ADAPTER_FLAG3_SUPPORT_MONITORED_FENCES + + + + No documentation. + + ff471327 + DXGI_ADAPTER_FLAG3_SUPPORT_NON_MONITORED_FENCES + DXGI_ADAPTER_FLAG3_SUPPORT_NON_MONITORED_FENCES + + + + No documentation. + + ff471327 + DXGI_ADAPTER_FLAG3_KEYED_MUTEX_CONFORMANCE + DXGI_ADAPTER_FLAG3_KEYED_MUTEX_CONFORMANCE + + + +

Identifies the alpha value, transparency behavior, of a surface.

+
+ +

For more information about alpha mode, see .

+
+ hh404496 + DXGI_ALPHA_MODE + DXGI_ALPHA_MODE +
+ + +

Indicates that the transparency behavior is not specified.

+
+ hh404496 + DXGI_ALPHA_MODE_UNSPECIFIED + DXGI_ALPHA_MODE_UNSPECIFIED +
+ + +

Indicates that the transparency behavior is premultiplied. Each color is first scaled by the alpha value. The alpha value itself is the same in both straight and premultiplied alpha. Typically, no color channel value is greater than the alpha channel value. If a color channel value in a premultiplied format is greater than the alpha channel, the standard source-over blending math results in an additive blend.

+
+ hh404496 + DXGI_ALPHA_MODE_PREMULTIPLIED + DXGI_ALPHA_MODE_PREMULTIPLIED +
+ + +

Indicates that the transparency behavior is not premultiplied. The alpha channel indicates the transparency of the color.

+
+ hh404496 + DXGI_ALPHA_MODE_STRAIGHT + DXGI_ALPHA_MODE_STRAIGHT +
+ + +

Indicates to ignore the transparency behavior.

+
+ hh404496 + DXGI_ALPHA_MODE_IGNORE + DXGI_ALPHA_MODE_IGNORE +
+ + +

Specifies color space types.

+
+ +

This enum is used within DXGI in the CheckColorSpaceSupport, SetColorSpace1 and CheckOverlayColorSpaceSupport methods. It is also referenced in D3D11 video methods such as ID3D11VideoContext1::VideoProcessorSetOutputColorSpace1, and D2D methods such as ID2D1DeviceContext2::CreateImageSourceFromDxgi.

The following color parameters are defined:

+
+ dn903661 + DXGI_COLOR_SPACE_TYPE + DXGI_COLOR_SPACE_TYPE +
+ + +
PropertyValue
ColorspaceRGB
Range0-255
Gamma2.2
SitingImage
PrimariesBT.709

?

This is the standard definition for sRGB. Note that this is often implemented with a linear segment, but in that case the exponent is corrected to stay aligned with a gamma 2.2 curve. This is usually used with 8 bit and 10 bit color channels. +

+
+ dn903661 + DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 + DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 +
+ + +
PropertyValue
ColorspaceRGB
Range0-255
Gamma1.0
SitingImage
PrimariesBT.709

?

This is the standard definition for scRGB, and is usually used with 16 bit integer, 16 bit floating point, and 32 bit floating point channels. +

+
+ dn903661 + DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 + DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 +
+ + +
PropertyValue
ColorspaceRGB
Range16-235
Gamma2.2
SitingImage
PrimariesBT.709

?

This is the standard definition for ITU-R Recommendation BT.709. Note that due to the inclusion of a linear segment, the transfer curve looks similar to a pure exponential gamma of 1.9. This is usually used with 8 bit and 10 bit color channels. +

+
+ dn903661 + DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P709 + DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P709 +
+ + +
PropertyValue
ColorspaceRGB
Range16-235
Gamma2.2
SitingImage
PrimariesBT.2020

?

This is usually used with 10, 12, or 16 bit color channels. +

+
+ dn903661 + DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P2020 + DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P2020 +
+ + +

Reserved.

+
+ dn903661 + DXGI_COLOR_SPACE_RESERVED + DXGI_COLOR_SPACE_RESERVED +
+ + +
PropertyValue
ColorspaceYCbCr
Range0-255
Gamma2.2
SitingImage
PrimariesBT.709
TransferBT.601

?

This definition is commonly used for JPG, and is usually used with 8, 10, 12, or 16 bit color channels. +

+
+ dn903661 + DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 + DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 +
+ + +
PropertyValue
ColorspaceYCbCr
Range16-235
Gamma2.2
SitingVideo
PrimariesBT.601

?

This definition is commonly used for MPEG2, and is usually used with 8, 10, 12, or 16 bit color channels. +

+
+ dn903661 + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 +
+ + +
PropertyValue
ColorspaceYCbCr
Range0-255
Gamma2.2
SitingVideo
PrimariesBT.601

?

This is sometimes used for H.264 camera capture, and is usually used with 8, 10, 12, or 16 bit color channels. +

+
+ dn903661 + DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601 + DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601 +
+ + +
PropertyValue
ColorspaceYCbCr
Range16-235
Gamma2.2
SitingVideo
PrimariesBT.709

?

This definition is commonly used for H.264 and HEVC, and is usually used with 8, 10, 12, or 16 bit color channels. +

+
+ dn903661 + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 +
+ + +
PropertyValue
ColorspaceYCbCr
Range0-255
Gamma2.2
SitingVideo
PrimariesBT.709

?

This is sometimes used for H.264 camera capture, and is usually used with 8, 10, 12, or 16 bit color channels. +

+
+ dn903661 + DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709 + DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709 +
+ + +
PropertyValue
ColorspaceYCbCr
Range16-235
Gamma2.2
SitingVideo
PrimariesBT.2020

?

This definition may be used by HEVC, and is usually used with 10, 12, or 16 bit color channels. +

+
+ dn903661 + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 +
+ + +
PropertyValue
ColorspaceYCbCr
Range0-255
Gamma2.2
SitingVideo
PrimariesBT.2020

?

This is usually used with 10, 12, or 16 bit color channels.

+
+ dn903661 + DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 + DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 +
+ + +
PropertyValue
ColorspaceRGB
Range0-255
Gamma2084
SitingImage
PrimariesBT.2020

?

This is usually used with 10, 12, or 16 bit color channels.

+
+ dn903661 + DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 + DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 +
+ + +
PropertyValue
ColorspaceYCbCr
Range16-235
Gamma2084
SitingVideo
PrimariesBT.2020

?

This is usually used with 10, 12, or 16 bit color channels.

+
+ dn903661 + DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_LEFT_P2020 + DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_LEFT_P2020 +
+ + +
PropertyValue
ColorspaceRGB
Range16-235
Gamma2084
SitingImage
PrimariesBT.2020

?

This is usually used with 10, 12, or 16 bit color channels.

+
+ dn903661 + DXGI_COLOR_SPACE_RGB_STUDIO_G2084_NONE_P2020 + DXGI_COLOR_SPACE_RGB_STUDIO_G2084_NONE_P2020 +
+ + +
PropertyValue
ColorspaceYCbCr
Range16-235
Gamma2.2
SitingVideo
PrimariesBT.2020

?

This is usually used with 10, 12, or 16 bit color channels.

+
+ dn903661 + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_TOPLEFT_P2020 + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_TOPLEFT_P2020 +
+ + +
PropertyValue
ColorspaceYCbCr
Range16-235
Gamma2084
SitingVideo
PrimariesBT.2020

?

This is usually used with 10, 12, or 16 bit color channels.

+
+ dn903661 + DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_TOPLEFT_P2020 + DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_TOPLEFT_P2020 +
+ + +
PropertyValue
ColorspaceRGB
Range0-255
Gamma2.2
SitingImage
PrimariesBT.2020

?

This is usually used with 10, 12, or 16 bit color channels.

+
+ dn903661 + DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P2020 + DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P2020 +
+ + +

A custom color definition is used.

+
+ dn903661 + DXGI_COLOR_SPACE_YCBCR_STUDIO_GHLG_TOPLEFT_P2020 + DXGI_COLOR_SPACE_YCBCR_STUDIO_GHLG_TOPLEFT_P2020 +
+ + + No documentation. + + dn903661 + DXGI_COLOR_SPACE_YCBCR_FULL_GHLG_TOPLEFT_P2020 + DXGI_COLOR_SPACE_YCBCR_FULL_GHLG_TOPLEFT_P2020 + + + + No documentation. + + dn903661 + DXGI_COLOR_SPACE_RGB_STUDIO_G24_NONE_P709 + DXGI_COLOR_SPACE_RGB_STUDIO_G24_NONE_P709 + + + + No documentation. + + dn903661 + DXGI_COLOR_SPACE_RGB_STUDIO_G24_NONE_P2020 + DXGI_COLOR_SPACE_RGB_STUDIO_G24_NONE_P2020 + + + + No documentation. + + dn903661 + DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_LEFT_P709 + DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_LEFT_P709 + + + + No documentation. + + dn903661 + DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_LEFT_P2020 + DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_LEFT_P2020 + + + + No documentation. + + dn903661 + DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_TOPLEFT_P2020 + DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_TOPLEFT_P2020 + + + +

A custom color definition is used.

+
+ dn903661 + DXGI_COLOR_SPACE_CUSTOM + DXGI_COLOR_SPACE_CUSTOM +
+ + +

Identifies the granularity at which the graphics processing unit (GPU) can be preempted from performing its current compute task.

+
+ +

You call the IDXGIAdapter2::GetDesc2 method to retrieve the granularity level at which the GPU can be preempted from performing its current compute task. The operating system specifies the compute granularity level in the ComputePreemptionGranularity member of the structure.

+
+ hh404499 + DXGI_COMPUTE_PREEMPTION_GRANULARITY + DXGI_COMPUTE_PREEMPTION_GRANULARITY +
+ + +

Indicates the preemption granularity as a compute packet.

+
+ hh404499 + DXGI_COMPUTE_PREEMPTION_DMA_BUFFER_BOUNDARY + DXGI_COMPUTE_PREEMPTION_DMA_BUFFER_BOUNDARY +
+ + +

Indicates the preemption granularity as a dispatch (for example, a call to the ID3D11DeviceContext::Dispatch method). A dispatch is a part of a compute packet.

+
+ hh404499 + DXGI_COMPUTE_PREEMPTION_DISPATCH_BOUNDARY + DXGI_COMPUTE_PREEMPTION_DISPATCH_BOUNDARY +
+ + +

Indicates the preemption granularity as a thread group. A thread group is a part of a dispatch.

+
+ hh404499 + DXGI_COMPUTE_PREEMPTION_THREAD_GROUP_BOUNDARY + DXGI_COMPUTE_PREEMPTION_THREAD_GROUP_BOUNDARY +
+ + +

Indicates the preemption granularity as a thread in a thread group. A thread is a part of a thread group.

+
+ hh404499 + DXGI_COMPUTE_PREEMPTION_THREAD_BOUNDARY + DXGI_COMPUTE_PREEMPTION_THREAD_BOUNDARY +
+ + +

Indicates the preemption granularity as a compute instruction in a thread.

+
+ hh404499 + DXGI_COMPUTE_PREEMPTION_INSTRUCTION_BOUNDARY + DXGI_COMPUTE_PREEMPTION_INSTRUCTION_BOUNDARY +
+ + + No documentation. + + hh780345 + DXGI_DEBUG_RLO_SUMMARY + DXGI_DEBUG_RLO_SUMMARY + + + + No documentation. + + hh780345 + DXGI_DEBUG_RLO_DETAIL + DXGI_DEBUG_RLO_DETAIL + + + + No documentation. + + hh780345 + DXGI_DEBUG_RLO_IGNORE_INTERNAL + DXGI_DEBUG_RLO_IGNORE_INTERNAL + + + + No documentation. + + hh780345 + DXGI_DEBUG_RLO_ALL + DXGI_DEBUG_RLO_ALL + + + + None + + None + None + + + + No documentation. + + DXGI_ENUM_MODES_INTERLACED + DXGI_ENUM_MODES_INTERLACED + + + + No documentation. + + DXGI_ENUM_MODES_SCALING + DXGI_ENUM_MODES_SCALING + + + + No documentation. + + DXGI_ENUM_MODES_STEREO + DXGI_ENUM_MODES_STEREO + + + + No documentation. + + DXGI_ENUM_MODES_DISABLED_STEREO + DXGI_ENUM_MODES_DISABLED_STEREO + + + +

Flags that indicate how the back buffers should be rotated to fit the physical rotation of a monitor.

+
+ bb173065 + DXGI_MODE_ROTATION + DXGI_MODE_ROTATION +
+ + +

Unspecified rotation.

+
+ bb173065 + DXGI_MODE_ROTATION_UNSPECIFIED + DXGI_MODE_ROTATION_UNSPECIFIED +
+ + +

Specifies no rotation.

+
+ bb173065 + DXGI_MODE_ROTATION_IDENTITY + DXGI_MODE_ROTATION_IDENTITY +
+ + +

Specifies 90 degrees of rotation.

+
+ bb173065 + DXGI_MODE_ROTATION_ROTATE90 + DXGI_MODE_ROTATION_ROTATE90 +
+ + +

Specifies 180 degrees of rotation.

+
+ bb173065 + DXGI_MODE_ROTATION_ROTATE180 + DXGI_MODE_ROTATION_ROTATE180 +
+ + +

Specifies 270 degrees of rotation.

+
+ bb173065 + DXGI_MODE_ROTATION_ROTATE270 + DXGI_MODE_ROTATION_ROTATE270 +
+ + +

Flags indicating how an image is stretched to fit a given monitor's resolution.

+
+ +

Selecting the CENTERED or STRETCHED modes can result in a mode change even if you specify the native resolution of the display in the . If you know the native resolution of the display and want to make sure that you do not initiate a mode change when transitioning a swap chain to full screen (either via ALT+ENTER or IDXGISwapChain::SetFullscreenState), you should use UNSPECIFIED.

This enum is used by the and structures.

+
+ bb173066 + DXGI_MODE_SCALING + DXGI_MODE_SCALING +
+ + +

Unspecified scaling.

+
+ bb173066 + DXGI_MODE_SCALING_UNSPECIFIED + DXGI_MODE_SCALING_UNSPECIFIED +
+ + +

Specifies no scaling. The image is centered on the display. This flag is typically used for a fixed-dot-pitch display (such as an LED display).

+
+ bb173066 + DXGI_MODE_SCALING_CENTERED + DXGI_MODE_SCALING_CENTERED +
+ + +

Specifies stretched scaling.

+
+ bb173066 + DXGI_MODE_SCALING_STRETCHED + DXGI_MODE_SCALING_STRETCHED +
+ + +

Flags indicating the method the raster uses to create an image on a surface.

+
+ +

This enum is used by the and structures.

+
+ bb173067 + DXGI_MODE_SCANLINE_ORDER + DXGI_MODE_SCANLINE_ORDER +
+ + +

Scanline order is unspecified.

+
+ bb173067 + DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED + DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED +
+ + +

The image is created from the first scanline to the last without skipping any.

+
+ bb173067 + DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE + DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE +
+ + +

The image is created beginning with the upper field.

+
+ bb173067 + DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST + DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST +
+ + +

The image is created beginning with the lower field.

+
+ bb173067 + DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST + DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST +
+ + +

Status codes that can be returned by DXGI functions.

+
+ +

The value for each value is determined from this macro that is defined in DXGItype.h:

 #define _FACDXGI    0x87a
+            #define MAKE_DXGI_STATUS(code)  MAKE_HRESULT(0, _FACDXGI, code)
+            

For example, DXGI_STATUS_OCCLUDED is defined as 0x087A0001:

 #define DXGI_STATUS_OCCLUDED                    MAKE_DXGI_STATUS(1)
+            
+
+ cc308061 + DXGI_STATUS + DXGI_STATUS +
+ + + No documentation. + + cc308061 + DXGI_STATUS_OCCLUDED + DXGI_STATUS_OCCLUDED + + + + No documentation. + + cc308061 + DXGI_STATUS_CLIPPED + DXGI_STATUS_CLIPPED + + + + No documentation. + + cc308061 + DXGI_STATUS_NO_REDIRECTION + DXGI_STATUS_NO_REDIRECTION + + + + No documentation. + + cc308061 + DXGI_STATUS_NO_DESKTOP_ACCESS + DXGI_STATUS_NO_DESKTOP_ACCESS + + + + No documentation. + + cc308061 + DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE + DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE + + + + No documentation. + + cc308061 + DXGI_STATUS_MODE_CHANGED + DXGI_STATUS_MODE_CHANGED + + + + No documentation. + + cc308061 + DXGI_STATUS_MODE_CHANGE_IN_PROGRESS + DXGI_STATUS_MODE_CHANGE_IN_PROGRESS + + + + No documentation. + + cc308061 + DXGI_STATUS_UNOCCLUDED + DXGI_STATUS_UNOCCLUDED + + + + No documentation. + + cc308061 + DXGI_STATUS_DDA_WAS_STILL_DRAWING + DXGI_STATUS_DDA_WAS_STILL_DRAWING + + + + No documentation. + + cc308061 + DXGI_STATUS_PRESENT_REQUIRED + DXGI_STATUS_PRESENT_REQUIRED + + + +

Specifies a range of hardware features, to be used when checking for feature support.

+
+ +

This enum is used by the CheckFeatureSupport method.

+
+ mt722565 + DXGI_FEATURE + DXGI_FEATURE +
+ + +

The display supports tearing, a requirement of variable refresh rate displays.

+
+ mt722565 + DXGI_FEATURE_PRESENT_ALLOW_TEARING + DXGI_FEATURE_PRESENT_ALLOW_TEARING +
+ + +

Resource data formats, including fully-typed and typeless formats. A list of modifiers at the bottom of the page more fully describes each format type.

+
+ bb173059 + DXGI_FORMAT + DXGI_FORMAT +
+ + +

The format is not known.

+
+ bb173059 + DXGI_FORMAT_UNKNOWN + DXGI_FORMAT_UNKNOWN +
+ + +

A four-component, 128-bit typeless format that supports 32 bits per channel including alpha. ?

+
+ bb173059 + DXGI_FORMAT_R32G32B32A32_TYPELESS + DXGI_FORMAT_R32G32B32A32_TYPELESS +
+ + +

A four-component, 128-bit floating-point format that supports 32 bits per channel including alpha. 1,5,8

+
+ bb173059 + DXGI_FORMAT_R32G32B32A32_FLOAT + DXGI_FORMAT_R32G32B32A32_FLOAT +
+ + +

A four-component, 128-bit unsigned-integer format that supports 32 bits per channel including alpha. ?

+
+ bb173059 + DXGI_FORMAT_R32G32B32A32_UINT + DXGI_FORMAT_R32G32B32A32_UINT +
+ + +

A four-component, 128-bit signed-integer format that supports 32 bits per channel including alpha. ?

+
+ bb173059 + DXGI_FORMAT_R32G32B32A32_SINT + DXGI_FORMAT_R32G32B32A32_SINT +
+ + +

A three-component, 96-bit typeless format that supports 32 bits per color channel.

+
+ bb173059 + DXGI_FORMAT_R32G32B32_TYPELESS + DXGI_FORMAT_R32G32B32_TYPELESS +
+ + +

A three-component, 96-bit floating-point format that supports 32 bits per color channel.5,8

+
+ bb173059 + DXGI_FORMAT_R32G32B32_FLOAT + DXGI_FORMAT_R32G32B32_FLOAT +
+ + +

A three-component, 96-bit unsigned-integer format that supports 32 bits per color channel.

+
+ bb173059 + DXGI_FORMAT_R32G32B32_UINT + DXGI_FORMAT_R32G32B32_UINT +
+ + +

A three-component, 96-bit signed-integer format that supports 32 bits per color channel.

+
+ bb173059 + DXGI_FORMAT_R32G32B32_SINT + DXGI_FORMAT_R32G32B32_SINT +
+ + +

A four-component, 64-bit typeless format that supports 16 bits per channel including alpha.

+
+ bb173059 + DXGI_FORMAT_R16G16B16A16_TYPELESS + DXGI_FORMAT_R16G16B16A16_TYPELESS +
+ + +

A four-component, 64-bit floating-point format that supports 16 bits per channel including alpha.5,7

+
+ bb173059 + DXGI_FORMAT_R16G16B16A16_FLOAT + DXGI_FORMAT_R16G16B16A16_FLOAT +
+ + +

A four-component, 64-bit unsigned-normalized-integer format that supports 16 bits per channel including alpha.

+
+ bb173059 + DXGI_FORMAT_R16G16B16A16_UNORM + DXGI_FORMAT_R16G16B16A16_UNORM +
+ + +

A four-component, 64-bit unsigned-integer format that supports 16 bits per channel including alpha.

+
+ bb173059 + DXGI_FORMAT_R16G16B16A16_UINT + DXGI_FORMAT_R16G16B16A16_UINT +
+ + +

A four-component, 64-bit signed-normalized-integer format that supports 16 bits per channel including alpha.

+
+ bb173059 + DXGI_FORMAT_R16G16B16A16_SNORM + DXGI_FORMAT_R16G16B16A16_SNORM +
+ + +

A four-component, 64-bit signed-integer format that supports 16 bits per channel including alpha.

+
+ bb173059 + DXGI_FORMAT_R16G16B16A16_SINT + DXGI_FORMAT_R16G16B16A16_SINT +
+ + +

A two-component, 64-bit typeless format that supports 32 bits for the red channel and 32 bits for the green channel.

+
+ bb173059 + DXGI_FORMAT_R32G32_TYPELESS + DXGI_FORMAT_R32G32_TYPELESS +
+ + +

A two-component, 64-bit floating-point format that supports 32 bits for the red channel and 32 bits for the green channel.5,8

+
+ bb173059 + DXGI_FORMAT_R32G32_FLOAT + DXGI_FORMAT_R32G32_FLOAT +
+ + +

A two-component, 64-bit unsigned-integer format that supports 32 bits for the red channel and 32 bits for the green channel.

+
+ bb173059 + DXGI_FORMAT_R32G32_UINT + DXGI_FORMAT_R32G32_UINT +
+ + +

A two-component, 64-bit signed-integer format that supports 32 bits for the red channel and 32 bits for the green channel.

+
+ bb173059 + DXGI_FORMAT_R32G32_SINT + DXGI_FORMAT_R32G32_SINT +
+ + +

A two-component, 64-bit typeless format that supports 32 bits for the red channel, 8 bits for the green channel, and 24 bits are unused.

+
+ bb173059 + DXGI_FORMAT_R32G8X24_TYPELESS + DXGI_FORMAT_R32G8X24_TYPELESS +
+ + +

A 32-bit floating-point component, and two unsigned-integer components (with an additional 32 bits). This format supports 32-bit depth, 8-bit stencil, and 24 bits are unused.?

+
+ bb173059 + DXGI_FORMAT_D32_FLOAT_S8X24_UINT + DXGI_FORMAT_D32_FLOAT_S8X24_UINT +
+ + +

A 32-bit floating-point component, and two typeless components (with an additional 32 bits). This format supports 32-bit red channel, 8 bits are unused, and 24 bits are unused.?

+
+ bb173059 + DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS + DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS +
+ + +

A 32-bit typeless component, and two unsigned-integer components (with an additional 32 bits). This format has 32 bits unused, 8 bits for green channel, and 24 bits are unused.

+
+ bb173059 + DXGI_FORMAT_X32_TYPELESS_G8X24_UINT + DXGI_FORMAT_X32_TYPELESS_G8X24_UINT +
+ + +

A four-component, 32-bit typeless format that supports 10 bits for each color and 2 bits for alpha.

+
+ bb173059 + DXGI_FORMAT_R10G10B10A2_TYPELESS + DXGI_FORMAT_R10G10B10A2_TYPELESS +
+ + +

A four-component, 32-bit unsigned-normalized-integer format that supports 10 bits for each color and 2 bits for alpha.

+
+ bb173059 + DXGI_FORMAT_R10G10B10A2_UNORM + DXGI_FORMAT_R10G10B10A2_UNORM +
+ + +

A four-component, 32-bit unsigned-integer format that supports 10 bits for each color and 2 bits for alpha.

+
+ bb173059 + DXGI_FORMAT_R10G10B10A2_UINT + DXGI_FORMAT_R10G10B10A2_UINT +
+ + +

Three partial-precision floating-point numbers encoded into a single 32-bit value (a variant of s10e5, which is sign bit, 10-bit mantissa, and 5-bit biased (15) exponent). There are no sign bits, and there is a 5-bit biased (15) exponent for each channel, 6-bit mantissa for R and G, and a 5-bit mantissa for B, as shown in the following illustration.5,7

+
+ bb173059 + DXGI_FORMAT_R11G11B10_FLOAT + DXGI_FORMAT_R11G11B10_FLOAT +
+ + +

A four-component, 32-bit typeless format that supports 8 bits per channel including alpha.

+
+ bb173059 + DXGI_FORMAT_R8G8B8A8_TYPELESS + DXGI_FORMAT_R8G8B8A8_TYPELESS +
+ + +

A four-component, 32-bit unsigned-normalized-integer format that supports 8 bits per channel including alpha.

+
+ bb173059 + DXGI_FORMAT_R8G8B8A8_UNORM + DXGI_FORMAT_R8G8B8A8_UNORM +
+ + +

A four-component, 32-bit unsigned-normalized integer sRGB format that supports 8 bits per channel including alpha.

+
+ bb173059 + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB +
+ + +

A four-component, 32-bit unsigned-integer format that supports 8 bits per channel including alpha.

+
+ bb173059 + DXGI_FORMAT_R8G8B8A8_UINT + DXGI_FORMAT_R8G8B8A8_UINT +
+ + +

A four-component, 32-bit signed-normalized-integer format that supports 8 bits per channel including alpha.

+
+ bb173059 + DXGI_FORMAT_R8G8B8A8_SNORM + DXGI_FORMAT_R8G8B8A8_SNORM +
+ + +

A four-component, 32-bit signed-integer format that supports 8 bits per channel including alpha.

+
+ bb173059 + DXGI_FORMAT_R8G8B8A8_SINT + DXGI_FORMAT_R8G8B8A8_SINT +
+ + +

A two-component, 32-bit typeless format that supports 16 bits for the red channel and 16 bits for the green channel.

+
+ bb173059 + DXGI_FORMAT_R16G16_TYPELESS + DXGI_FORMAT_R16G16_TYPELESS +
+ + +

A two-component, 32-bit floating-point format that supports 16 bits for the red channel and 16 bits for the green channel.5,7

+
+ bb173059 + DXGI_FORMAT_R16G16_FLOAT + DXGI_FORMAT_R16G16_FLOAT +
+ + +

A two-component, 32-bit unsigned-normalized-integer format that supports 16 bits each for the green and red channels.

+
+ bb173059 + DXGI_FORMAT_R16G16_UNORM + DXGI_FORMAT_R16G16_UNORM +
+ + +

A two-component, 32-bit unsigned-integer format that supports 16 bits for the red channel and 16 bits for the green channel.

+
+ bb173059 + DXGI_FORMAT_R16G16_UINT + DXGI_FORMAT_R16G16_UINT +
+ + +

A two-component, 32-bit signed-normalized-integer format that supports 16 bits for the red channel and 16 bits for the green channel.

+
+ bb173059 + DXGI_FORMAT_R16G16_SNORM + DXGI_FORMAT_R16G16_SNORM +
+ + +

A two-component, 32-bit signed-integer format that supports 16 bits for the red channel and 16 bits for the green channel.

+
+ bb173059 + DXGI_FORMAT_R16G16_SINT + DXGI_FORMAT_R16G16_SINT +
+ + +

A single-component, 32-bit typeless format that supports 32 bits for the red channel.

+
+ bb173059 + DXGI_FORMAT_R32_TYPELESS + DXGI_FORMAT_R32_TYPELESS +
+ + +

A single-component, 32-bit floating-point format that supports 32 bits for depth.5,8

+
+ bb173059 + DXGI_FORMAT_D32_FLOAT + DXGI_FORMAT_D32_FLOAT +
+ + +

A single-component, 32-bit floating-point format that supports 32 bits for the red channel.5,8

+
+ bb173059 + DXGI_FORMAT_R32_FLOAT + DXGI_FORMAT_R32_FLOAT +
+ + +

A single-component, 32-bit unsigned-integer format that supports 32 bits for the red channel.

+
+ bb173059 + DXGI_FORMAT_R32_UINT + DXGI_FORMAT_R32_UINT +
+ + +

A single-component, 32-bit signed-integer format that supports 32 bits for the red channel.

+
+ bb173059 + DXGI_FORMAT_R32_SINT + DXGI_FORMAT_R32_SINT +
+ + +

A two-component, 32-bit typeless format that supports 24 bits for the red channel and 8 bits for the green channel.

+
+ bb173059 + DXGI_FORMAT_R24G8_TYPELESS + DXGI_FORMAT_R24G8_TYPELESS +
+ + +

A 32-bit z-buffer format that supports 24 bits for depth and 8 bits for stencil.

+
+ bb173059 + DXGI_FORMAT_D24_UNORM_S8_UINT + DXGI_FORMAT_D24_UNORM_S8_UINT +
+ + +

A 32-bit format, that contains a 24 bit, single-component, unsigned-normalized integer, with an additional typeless 8 bits. This format has 24 bits red channel and 8 bits unused.

+
+ bb173059 + DXGI_FORMAT_R24_UNORM_X8_TYPELESS + DXGI_FORMAT_R24_UNORM_X8_TYPELESS +
+ + +

A 32-bit format, that contains a 24 bit, single-component, typeless format, with an additional 8 bit unsigned integer component. This format has 24 bits unused and 8 bits green channel.

+
+ bb173059 + DXGI_FORMAT_X24_TYPELESS_G8_UINT + DXGI_FORMAT_X24_TYPELESS_G8_UINT +
+ + +

A two-component, 16-bit typeless format that supports 8 bits for the red channel and 8 bits for the green channel.

+
+ bb173059 + DXGI_FORMAT_R8G8_TYPELESS + DXGI_FORMAT_R8G8_TYPELESS +
+ + +

A two-component, 16-bit unsigned-normalized-integer format that supports 8 bits for the red channel and 8 bits for the green channel.

+
+ bb173059 + DXGI_FORMAT_R8G8_UNORM + DXGI_FORMAT_R8G8_UNORM +
+ + +

A two-component, 16-bit unsigned-integer format that supports 8 bits for the red channel and 8 bits for the green channel.

+
+ bb173059 + DXGI_FORMAT_R8G8_UINT + DXGI_FORMAT_R8G8_UINT +
+ + +

A two-component, 16-bit signed-normalized-integer format that supports 8 bits for the red channel and 8 bits for the green channel.

+
+ bb173059 + DXGI_FORMAT_R8G8_SNORM + DXGI_FORMAT_R8G8_SNORM +
+ + +

A two-component, 16-bit signed-integer format that supports 8 bits for the red channel and 8 bits for the green channel.

+
+ bb173059 + DXGI_FORMAT_R8G8_SINT + DXGI_FORMAT_R8G8_SINT +
+ + +

A single-component, 16-bit typeless format that supports 16 bits for the red channel.

+
+ bb173059 + DXGI_FORMAT_R16_TYPELESS + DXGI_FORMAT_R16_TYPELESS +
+ + +

A single-component, 16-bit floating-point format that supports 16 bits for the red channel.5,7

+
+ bb173059 + DXGI_FORMAT_R16_FLOAT + DXGI_FORMAT_R16_FLOAT +
+ + +

A single-component, 16-bit unsigned-normalized-integer format that supports 16 bits for depth.

+
+ bb173059 + DXGI_FORMAT_D16_UNORM + DXGI_FORMAT_D16_UNORM +
+ + +

A single-component, 16-bit unsigned-normalized-integer format that supports 16 bits for the red channel.

+
+ bb173059 + DXGI_FORMAT_R16_UNORM + DXGI_FORMAT_R16_UNORM +
+ + +

A single-component, 16-bit unsigned-integer format that supports 16 bits for the red channel.

+
+ bb173059 + DXGI_FORMAT_R16_UINT + DXGI_FORMAT_R16_UINT +
+ + +

A single-component, 16-bit signed-normalized-integer format that supports 16 bits for the red channel.

+
+ bb173059 + DXGI_FORMAT_R16_SNORM + DXGI_FORMAT_R16_SNORM +
+ + +

A single-component, 16-bit signed-integer format that supports 16 bits for the red channel.

+
+ bb173059 + DXGI_FORMAT_R16_SINT + DXGI_FORMAT_R16_SINT +
+ + +

A single-component, 8-bit typeless format that supports 8 bits for the red channel.

+
+ bb173059 + DXGI_FORMAT_R8_TYPELESS + DXGI_FORMAT_R8_TYPELESS +
+ + +

A single-component, 8-bit unsigned-normalized-integer format that supports 8 bits for the red channel.

+
+ bb173059 + DXGI_FORMAT_R8_UNORM + DXGI_FORMAT_R8_UNORM +
+ + +

A single-component, 8-bit unsigned-integer format that supports 8 bits for the red channel.

+
+ bb173059 + DXGI_FORMAT_R8_UINT + DXGI_FORMAT_R8_UINT +
+ + +

A single-component, 8-bit signed-normalized-integer format that supports 8 bits for the red channel.

+
+ bb173059 + DXGI_FORMAT_R8_SNORM + DXGI_FORMAT_R8_SNORM +
+ + +

A single-component, 8-bit signed-integer format that supports 8 bits for the red channel.

+
+ bb173059 + DXGI_FORMAT_R8_SINT + DXGI_FORMAT_R8_SINT +
+ + +

A single-component, 8-bit unsigned-normalized-integer format for alpha only.

+
+ bb173059 + DXGI_FORMAT_A8_UNORM + DXGI_FORMAT_A8_UNORM +
+ + +

A single-component, 1-bit unsigned-normalized integer format that supports 1 bit for the red channel. ?.

+
+ bb173059 + DXGI_FORMAT_R1_UNORM + DXGI_FORMAT_R1_UNORM +
+ + +

Three partial-precision floating-point numbers encoded into a single 32-bit value all sharing the same 5-bit exponent (variant of s10e5, which is sign bit, 10-bit mantissa, and 5-bit biased (15) exponent). There is no sign bit, and there is a shared 5-bit biased (15) exponent and a 9-bit mantissa for each channel, as shown in the following illustration. 2,6,7.

+
+ bb173059 + DXGI_FORMAT_R9G9B9E5_SHAREDEXP + DXGI_FORMAT_R9G9B9E5_SHAREDEXP +
+ + +

A four-component, 32-bit unsigned-normalized-integer format. This packed RGB format is analogous to the UYVY format. Each 32-bit block describes a pair of pixels: (R8, G8, B8) and (R8, G8, B8) where the R8/B8 values are repeated, and the G8 values are unique to each pixel. ?

Width must be even.

+
+ bb173059 + DXGI_FORMAT_R8G8_B8G8_UNORM + DXGI_FORMAT_R8G8_B8G8_UNORM +
+ + +

A four-component, 32-bit unsigned-normalized-integer format. This packed RGB format is analogous to the YUY2 format. Each 32-bit block describes a pair of pixels: (R8, G8, B8) and (R8, G8, B8) where the R8/B8 values are repeated, and the G8 values are unique to each pixel. ?

Width must be even.

+
+ bb173059 + DXGI_FORMAT_G8R8_G8B8_UNORM + DXGI_FORMAT_G8R8_G8B8_UNORM +
+ + +

Four-component typeless block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

+
+ bb173059 + DXGI_FORMAT_BC1_TYPELESS + DXGI_FORMAT_BC1_TYPELESS +
+ + +

Four-component block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

+
+ bb173059 + DXGI_FORMAT_BC1_UNORM + DXGI_FORMAT_BC1_UNORM +
+ + +

Four-component block-compression format for sRGB data. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

+
+ bb173059 + DXGI_FORMAT_BC1_UNORM_SRGB + DXGI_FORMAT_BC1_UNORM_SRGB +
+ + +

Four-component typeless block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

+
+ bb173059 + DXGI_FORMAT_BC2_TYPELESS + DXGI_FORMAT_BC2_TYPELESS +
+ + +

Four-component block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

+
+ bb173059 + DXGI_FORMAT_BC2_UNORM + DXGI_FORMAT_BC2_UNORM +
+ + +

Four-component block-compression format for sRGB data. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

+
+ bb173059 + DXGI_FORMAT_BC2_UNORM_SRGB + DXGI_FORMAT_BC2_UNORM_SRGB +
+ + +

Four-component typeless block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

+
+ bb173059 + DXGI_FORMAT_BC3_TYPELESS + DXGI_FORMAT_BC3_TYPELESS +
+ + +

Four-component block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

+
+ bb173059 + DXGI_FORMAT_BC3_UNORM + DXGI_FORMAT_BC3_UNORM +
+ + +

Four-component block-compression format for sRGB data. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

+
+ bb173059 + DXGI_FORMAT_BC3_UNORM_SRGB + DXGI_FORMAT_BC3_UNORM_SRGB +
+ + +

One-component typeless block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

+
+ bb173059 + DXGI_FORMAT_BC4_TYPELESS + DXGI_FORMAT_BC4_TYPELESS +
+ + +

One-component block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

+
+ bb173059 + DXGI_FORMAT_BC4_UNORM + DXGI_FORMAT_BC4_UNORM +
+ + +

One-component block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

+
+ bb173059 + DXGI_FORMAT_BC4_SNORM + DXGI_FORMAT_BC4_SNORM +
+ + +

Two-component typeless block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

+
+ bb173059 + DXGI_FORMAT_BC5_TYPELESS + DXGI_FORMAT_BC5_TYPELESS +
+ + +

Two-component block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

+
+ bb173059 + DXGI_FORMAT_BC5_UNORM + DXGI_FORMAT_BC5_UNORM +
+ + +

Two-component block-compression format. For information about block-compression formats, see Texture Block Compression in Direct3D 11.

+
+ bb173059 + DXGI_FORMAT_BC5_SNORM + DXGI_FORMAT_BC5_SNORM +
+ + +

A three-component, 16-bit unsigned-normalized-integer format that supports 5 bits for blue, 6 bits for green, and 5 bits for red.

Direct3D 10 through Direct3D 11:??This value is defined for DXGI. However, Direct3D 10, 10.1, or 11 devices do not support this format.

Direct3D 11.1:??This value is not supported until Windows?8.

+
+ bb173059 + DXGI_FORMAT_B5G6R5_UNORM + DXGI_FORMAT_B5G6R5_UNORM +
+ + +

A four-component, 16-bit unsigned-normalized-integer format that supports 5 bits for each color channel and 1-bit alpha.

Direct3D 10 through Direct3D 11:??This value is defined for DXGI. However, Direct3D 10, 10.1, or 11 devices do not support this format.

Direct3D 11.1:??This value is not supported until Windows?8.

+
+ bb173059 + DXGI_FORMAT_B5G5R5A1_UNORM + DXGI_FORMAT_B5G5R5A1_UNORM +
+ + +

A four-component, 32-bit unsigned-normalized-integer format that supports 8 bits for each color channel and 8-bit alpha.

+
+ bb173059 + DXGI_FORMAT_B8G8R8A8_UNORM + DXGI_FORMAT_B8G8R8A8_UNORM +
+ + +

A four-component, 32-bit unsigned-normalized-integer format that supports 8 bits for each color channel and 8 bits unused.

+
+ bb173059 + DXGI_FORMAT_B8G8R8X8_UNORM + DXGI_FORMAT_B8G8R8X8_UNORM +
+ + +

A four-component, 32-bit 2.8-biased fixed-point format that supports 10 bits for each color channel and 2-bit alpha.

+
+ bb173059 + DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM + DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM +
+ + +

A four-component, 32-bit typeless format that supports 8 bits for each channel including alpha. ?

+
+ bb173059 + DXGI_FORMAT_B8G8R8A8_TYPELESS + DXGI_FORMAT_B8G8R8A8_TYPELESS +
+ + +

A four-component, 32-bit unsigned-normalized standard RGB format that supports 8 bits for each channel including alpha. ?

+
+ bb173059 + DXGI_FORMAT_B8G8R8A8_UNORM_SRGB + DXGI_FORMAT_B8G8R8A8_UNORM_SRGB +
+ + +

A four-component, 32-bit typeless format that supports 8 bits for each color channel, and 8 bits are unused. ?

+
+ bb173059 + DXGI_FORMAT_B8G8R8X8_TYPELESS + DXGI_FORMAT_B8G8R8X8_TYPELESS +
+ + +

A four-component, 32-bit unsigned-normalized standard RGB format that supports 8 bits for each color channel, and 8 bits are unused. ?

+
+ bb173059 + DXGI_FORMAT_B8G8R8X8_UNORM_SRGB + DXGI_FORMAT_B8G8R8X8_UNORM_SRGB +
+ + +

A typeless block-compression format. ? For information about block-compression formats, see Texture Block Compression in Direct3D 11.

+
+ bb173059 + DXGI_FORMAT_BC6H_TYPELESS + DXGI_FORMAT_BC6H_TYPELESS +
+ + +

A block-compression format. ? For information about block-compression formats, see Texture Block Compression in Direct3D 11.?

+
+ bb173059 + DXGI_FORMAT_BC6H_UF16 + DXGI_FORMAT_BC6H_UF16 +
+ + +

A block-compression format. ? For information about block-compression formats, see Texture Block Compression in Direct3D 11.?

+
+ bb173059 + DXGI_FORMAT_BC6H_SF16 + DXGI_FORMAT_BC6H_SF16 +
+ + +

A typeless block-compression format. ? For information about block-compression formats, see Texture Block Compression in Direct3D 11.

+
+ bb173059 + DXGI_FORMAT_BC7_TYPELESS + DXGI_FORMAT_BC7_TYPELESS +
+ + +

A block-compression format. ? For information about block-compression formats, see Texture Block Compression in Direct3D 11.

+
+ bb173059 + DXGI_FORMAT_BC7_UNORM + DXGI_FORMAT_BC7_UNORM +
+ + +

A block-compression format. ? For information about block-compression formats, see Texture Block Compression in Direct3D 11.

+
+ bb173059 + DXGI_FORMAT_BC7_UNORM_SRGB + DXGI_FORMAT_BC7_UNORM_SRGB +
+ + +

Most common YUV 4:4:4 video resource format. Valid view formats for this video resource format are DXGI_FORMAT_R8G8B8A8_UNORM and DXGI_FORMAT_R8G8B8A8_UINT. For UAVs, an additional valid view format is DXGI_FORMAT_R32_UINT. By using DXGI_FORMAT_R32_UINT for UAVs, you can both read and write as opposed to just write for DXGI_FORMAT_R8G8B8A8_UNORM and DXGI_FORMAT_R8G8B8A8_UINT. Supported view types are SRV, RTV, and UAV. One view provides a straightforward mapping of the entire surface. The mapping to the view channel is V->R8, + U->G8, + Y->B8, + and A->A8.

For more info about YUV formats for video rendering, see Recommended 8-Bit YUV Formats for Video Rendering.

Direct3D 11.1:??This value is not supported until Windows?8.

+
+ bb173059 + DXGI_FORMAT_AYUV + DXGI_FORMAT_AYUV +
+ + +

10-bit per channel packed YUV 4:4:4 video resource format. Valid view formats for this video resource format are DXGI_FORMAT_R10G10B10A2_UNORM and DXGI_FORMAT_R10G10B10A2_UINT. For UAVs, an additional valid view format is DXGI_FORMAT_R32_UINT. By using DXGI_FORMAT_R32_UINT for UAVs, you can both read and write as opposed to just write for DXGI_FORMAT_R10G10B10A2_UNORM and DXGI_FORMAT_R10G10B10A2_UINT. Supported view types are SRV and UAV. One view provides a straightforward mapping of the entire surface. The mapping to the view channel is U->R10, + Y->G10, + V->B10, + and A->A2.

For more info about YUV formats for video rendering, see Recommended 8-Bit YUV Formats for Video Rendering.

Direct3D 11.1:??This value is not supported until Windows?8.

+
+ bb173059 + DXGI_FORMAT_Y410 + DXGI_FORMAT_Y410 +
+ + +

16-bit per channel packed YUV 4:4:4 video resource format. Valid view formats for this video resource format are DXGI_FORMAT_R16G16B16A16_UNORM and DXGI_FORMAT_R16G16B16A16_UINT. Supported view types are SRV and UAV. One view provides a straightforward mapping of the entire surface. The mapping to the view channel is U->R16, + Y->G16, + V->B16, + and A->A16.

For more info about YUV formats for video rendering, see Recommended 8-Bit YUV Formats for Video Rendering.

Direct3D 11.1:??This value is not supported until Windows?8.

+
+ bb173059 + DXGI_FORMAT_Y416 + DXGI_FORMAT_Y416 +
+ + +

Most common YUV 4:2:0 video resource format. Valid luminance data view formats for this video resource format are DXGI_FORMAT_R8_UNORM and DXGI_FORMAT_R8_UINT. Valid chrominance data view formats (width and height are each 1/2 of luminance view) for this video resource format are DXGI_FORMAT_R8G8_UNORM and DXGI_FORMAT_R8G8_UINT. Supported view types are SRV, RTV, and UAV. For luminance data view, the mapping to the view channel is Y->R8. For chrominance data view, the mapping to the view channel is U->R8 and + V->G8.

For more info about YUV formats for video rendering, see Recommended 8-Bit YUV Formats for Video Rendering.

Width and height must be even. Direct3D 11 staging resources and initData parameters for this format use (rowPitch * (height + (height / 2))) bytes. The first (SysMemPitch * height) bytes are the Y plane, the remaining (SysMemPitch * (height / 2)) bytes are the UV plane.

An app using the YUY 4:2:0 formats must map the luma (Y) plane separately from the chroma (UV) planes. Developers do this by calling ID3D12Device::CreateShaderResourceView twice for the same texture and passing in 1-channel and 2-channel formats. Passing in a 1-channel format compatible with the Y plane maps only the Y plane. Passing in a 2-channel format compatible with the UV planes (together) maps only the U and V planes as a single resource view.

Direct3D 11.1:??This value is not supported until Windows?8.

+
+ bb173059 + DXGI_FORMAT_NV12 + DXGI_FORMAT_NV12 +
+ + +

10-bit per channel planar YUV 4:2:0 video resource format. Valid luminance data view formats for this video resource format are DXGI_FORMAT_R16_UNORM and DXGI_FORMAT_R16_UINT. The runtime does not enforce whether the lowest 6 bits are 0 (given that this video resource format is a 10-bit format that uses 16 bits). If required, application shader code would have to enforce this manually. From the runtime's point of view, DXGI_FORMAT_P010 is no different than DXGI_FORMAT_P016. Valid chrominance data view formats (width and height are each 1/2 of luminance view) for this video resource format are DXGI_FORMAT_R16G16_UNORM and DXGI_FORMAT_R16G16_UINT. For UAVs, an additional valid chrominance data view format is DXGI_FORMAT_R32_UINT. By using DXGI_FORMAT_R32_UINT for UAVs, you can both read and write as opposed to just write for DXGI_FORMAT_R16G16_UNORM and DXGI_FORMAT_R16G16_UINT. Supported view types are SRV, RTV, and UAV. For luminance data view, the mapping to the view channel is Y->R16. For chrominance data view, the mapping to the view channel is U->R16 and + V->G16.

For more info about YUV formats for video rendering, see Recommended 8-Bit YUV Formats for Video Rendering.

Width and height must be even. Direct3D 11 staging resources and initData parameters for this format use (rowPitch * (height + (height / 2))) bytes. The first (SysMemPitch * height) bytes are the Y plane, the remaining (SysMemPitch * (height / 2)) bytes are the UV plane.

An app using the YUY 4:2:0 formats must map the luma (Y) plane separately from the chroma (UV) planes. Developers do this by calling ID3D12Device::CreateShaderResourceView twice for the same texture and passing in 1-channel and 2-channel formats. Passing in a 1-channel format compatible with the Y plane maps only the Y plane. Passing in a 2-channel format compatible with the UV planes (together) maps only the U and V planes as a single resource view.

Direct3D 11.1:??This value is not supported until Windows?8.

+
+ bb173059 + DXGI_FORMAT_P010 + DXGI_FORMAT_P010 +
+ + +

16-bit per channel planar YUV 4:2:0 video resource format. Valid luminance data view formats for this video resource format are DXGI_FORMAT_R16_UNORM and DXGI_FORMAT_R16_UINT. Valid chrominance data view formats (width and height are each 1/2 of luminance view) for this video resource format are DXGI_FORMAT_R16G16_UNORM and DXGI_FORMAT_R16G16_UINT. For UAVs, an additional valid chrominance data view format is DXGI_FORMAT_R32_UINT. By using DXGI_FORMAT_R32_UINT for UAVs, you can both read and write as opposed to just write for DXGI_FORMAT_R16G16_UNORM and DXGI_FORMAT_R16G16_UINT. Supported view types are SRV, RTV, and UAV. For luminance data view, the mapping to the view channel is Y->R16. For chrominance data view, the mapping to the view channel is U->R16 and + V->G16.

For more info about YUV formats for video rendering, see Recommended 8-Bit YUV Formats for Video Rendering.

Width and height must be even. Direct3D 11 staging resources and initData parameters for this format use (rowPitch * (height + (height / 2))) bytes. The first (SysMemPitch * height) bytes are the Y plane, the remaining (SysMemPitch * (height / 2)) bytes are the UV plane.

An app using the YUY 4:2:0 formats must map the luma (Y) plane separately from the chroma (UV) planes. Developers do this by calling ID3D12Device::CreateShaderResourceView twice for the same texture and passing in 1-channel and 2-channel formats. Passing in a 1-channel format compatible with the Y plane maps only the Y plane. Passing in a 2-channel format compatible with the UV planes (together) maps only the U and V planes as a single resource view.

Direct3D 11.1:??This value is not supported until Windows?8.

+
+ bb173059 + DXGI_FORMAT_P016 + DXGI_FORMAT_P016 +
+ + +

8-bit per channel planar YUV 4:2:0 video resource format. This format is subsampled where each pixel has its own Y value, but each 2x2 pixel block shares a single U and V value. The runtime requires that the width and height of all resources that are created with this format are multiples of 2. The runtime also requires that the left, right, top, and bottom members of any that are used for this format are multiples of 2. This format differs from DXGI_FORMAT_NV12 in that the layout of the data within the resource is completely opaque to applications. Applications cannot use the CPU to map the resource and then access the data within the resource. You cannot use shaders with this format. Because of this behavior, legacy hardware that supports a non-NV12 4:2:0 layout (for example, YV12, and so on) can be used. Also, new hardware that has a 4:2:0 implementation better than NV12 can be used when the application does not need the data to be in a standard layout.

For more info about YUV formats for video rendering, see Recommended 8-Bit YUV Formats for Video Rendering.

Width and height must be even. Direct3D 11 staging resources and initData parameters for this format use (rowPitch * (height + (height / 2))) bytes.

An app using the YUY 4:2:0 formats must map the luma (Y) plane separately from the chroma (UV) planes. Developers do this by calling ID3D12Device::CreateShaderResourceView twice for the same texture and passing in 1-channel and 2-channel formats. Passing in a 1-channel format compatible with the Y plane maps only the Y plane. Passing in a 2-channel format compatible with the UV planes (together) maps only the U and V planes as a single resource view.

Direct3D 11.1:??This value is not supported until Windows?8.

+
+ bb173059 + DXGI_FORMAT_420_OPAQUE + DXGI_FORMAT_420_OPAQUE +
+ + +

Most common YUV 4:2:2 video resource format. Valid view formats for this video resource format are DXGI_FORMAT_R8G8B8A8_UNORM and DXGI_FORMAT_R8G8B8A8_UINT. For UAVs, an additional valid view format is DXGI_FORMAT_R32_UINT. By using DXGI_FORMAT_R32_UINT for UAVs, you can both read and write as opposed to just write for DXGI_FORMAT_R8G8B8A8_UNORM and DXGI_FORMAT_R8G8B8A8_UINT. Supported view types are SRV and UAV. One view provides a straightforward mapping of the entire surface. The mapping to the view channel is Y0->R8, + U0->G8, + Y1->B8, + and V0->A8.

A unique valid view format for this video resource format is DXGI_FORMAT_R8G8_B8G8_UNORM. With this view format, the width of the view appears to be twice what the DXGI_FORMAT_R8G8B8A8_UNORM or DXGI_FORMAT_R8G8B8A8_UINT view would be when hardware reconstructs RGBA automatically on read and before filtering. This Direct3D hardware behavior is legacy and is likely not useful any more. With this view format, the mapping to the view channel is Y0->R8, + U0-> + G8[0], + Y1->B8, + and V0-> + G8[1].

For more info about YUV formats for video rendering, see Recommended 8-Bit YUV Formats for Video Rendering.

Width must be even.

Direct3D 11.1:??This value is not supported until Windows?8.

+
+ bb173059 + DXGI_FORMAT_YUY2 + DXGI_FORMAT_YUY2 +
+ + +

10-bit per channel packed YUV 4:2:2 video resource format. Valid view formats for this video resource format are DXGI_FORMAT_R16G16B16A16_UNORM and DXGI_FORMAT_R16G16B16A16_UINT. The runtime does not enforce whether the lowest 6 bits are 0 (given that this video resource format is a 10-bit format that uses 16 bits). If required, application shader code would have to enforce this manually. From the runtime's point of view, DXGI_FORMAT_Y210 is no different than DXGI_FORMAT_Y216. Supported view types are SRV and UAV. One view provides a straightforward mapping of the entire surface. The mapping to the view channel is Y0->R16, + U->G16, + Y1->B16, + and V->A16.

For more info about YUV formats for video rendering, see Recommended 8-Bit YUV Formats for Video Rendering.

Width must be even.

Direct3D 11.1:??This value is not supported until Windows?8.

+
+ bb173059 + DXGI_FORMAT_Y210 + DXGI_FORMAT_Y210 +
+ + +

16-bit per channel packed YUV 4:2:2 video resource format. Valid view formats for this video resource format are DXGI_FORMAT_R16G16B16A16_UNORM and DXGI_FORMAT_R16G16B16A16_UINT. Supported view types are SRV and UAV. One view provides a straightforward mapping of the entire surface. The mapping to the view channel is Y0->R16, + U->G16, + Y1->B16, + and V->A16.

For more info about YUV formats for video rendering, see Recommended 8-Bit YUV Formats for Video Rendering.

Width must be even.

Direct3D 11.1:??This value is not supported until Windows?8.

+
+ bb173059 + DXGI_FORMAT_Y216 + DXGI_FORMAT_Y216 +
+ + +

Most common planar YUV 4:1:1 video resource format. Valid luminance data view formats for this video resource format are DXGI_FORMAT_R8_UNORM and DXGI_FORMAT_R8_UINT. Valid chrominance data view formats (width and height are each 1/4 of luminance view) for this video resource format are DXGI_FORMAT_R8G8_UNORM and DXGI_FORMAT_R8G8_UINT. Supported view types are SRV, RTV, and UAV. For luminance data view, the mapping to the view channel is Y->R8. For chrominance data view, the mapping to the view channel is U->R8 and + V->G8.

For more info about YUV formats for video rendering, see Recommended 8-Bit YUV Formats for Video Rendering.

Width must be a multiple of 4. Direct3D11 staging resources and initData parameters for this format use (rowPitch * height * 2) bytes. The first (SysMemPitch * height) bytes are the Y plane, the next ((SysMemPitch / 2) * height) bytes are the UV plane, and the remainder is padding.

Direct3D 11.1:??This value is not supported until Windows?8.

+
+ bb173059 + DXGI_FORMAT_NV11 + DXGI_FORMAT_NV11 +
+ + +

4-bit palletized YUV format that is commonly used for DVD subpicture.

For more info about YUV formats for video rendering, see Recommended 8-Bit YUV Formats for Video Rendering.

Direct3D 11.1:??This value is not supported until Windows?8.

+
+ bb173059 + DXGI_FORMAT_AI44 + DXGI_FORMAT_AI44 +
+ + +

4-bit palletized YUV format that is commonly used for DVD subpicture.

For more info about YUV formats for video rendering, see Recommended 8-Bit YUV Formats for Video Rendering.

Direct3D 11.1:??This value is not supported until Windows?8.

+
+ bb173059 + DXGI_FORMAT_IA44 + DXGI_FORMAT_IA44 +
+ + +

8-bit palletized format that is used for palletized RGB data when the processor processes ISDB-T data and for palletized YUV data when the processor processes BluRay data.

For more info about YUV formats for video rendering, see Recommended 8-Bit YUV Formats for Video Rendering.

Direct3D 11.1:??This value is not supported until Windows?8.

+
+ bb173059 + DXGI_FORMAT_P8 + DXGI_FORMAT_P8 +
+ + +

8-bit palletized format with 8 bits of alpha that is used for palletized YUV data when the processor processes BluRay data.

For more info about YUV formats for video rendering, see Recommended 8-Bit YUV Formats for Video Rendering.

Direct3D 11.1:??This value is not supported until Windows?8.

+
+ bb173059 + DXGI_FORMAT_A8P8 + DXGI_FORMAT_A8P8 +
+ + +

A four-component, 16-bit unsigned-normalized integer format that supports 4 bits for each channel including alpha.

Direct3D 11.1:??This value is not supported until Windows?8.

+
+ bb173059 + DXGI_FORMAT_B4G4R4A4_UNORM + DXGI_FORMAT_B4G4R4A4_UNORM +
+ + +

A video format; an 8-bit version of a hybrid planar 4:2:2 format.

+
+ bb173059 + DXGI_FORMAT_P208 + DXGI_FORMAT_P208 +
+ + +

An 8 bit YCbCrA 4:4 rendering format.

+
+ bb173059 + DXGI_FORMAT_V208 + DXGI_FORMAT_V208 +
+ + +

An 8 bit YCbCrA 4:4:4:4 rendering format.

+
+ bb173059 + DXGI_FORMAT_V408 + DXGI_FORMAT_V408 +
+ + +

Indicates options for presenting frames to the swap chain.

+
+ +

This enum is used by the structure.

+
+ dn384107 + DXGI_FRAME_PRESENTATION_MODE + DXGI_FRAME_PRESENTATION_MODE +
+ + +

Specifies that the presentation mode is a composition surface, meaning that the conversion from YUV to RGB is happening once per output refresh (for example, 60 Hz). When this value is returned, the media app should discontinue use of the decode swap chain and perform YUV to RGB conversion itself, reducing the frequency of YUV to RGB conversion to once per video frame.

+
+ dn384107 + DXGI_FRAME_PRESENTATION_MODE_COMPOSED + DXGI_FRAME_PRESENTATION_MODE_COMPOSED +
+ + +

Specifies that the presentation mode is an overlay surface, meaning that the YUV to RGB conversion is happening efficiently in hardware (once per video frame). When this value is returned, the media app can continue to use the decode swap chain. See .

+
+ dn384107 + DXGI_FRAME_PRESENTATION_MODE_OVERLAY + DXGI_FRAME_PRESENTATION_MODE_OVERLAY +
+ + +

No presentation is specified.

+
+ dn384107 + DXGI_FRAME_PRESENTATION_MODE_NONE + DXGI_FRAME_PRESENTATION_MODE_NONE +
+ + +

An issue occurred that caused content protection to be invalidated in a swap-chain with hardware content protection, and is usually because the system ran out of hardware protected memory. The app will need to do one of the following:

  • Drastically reduce the amount of hardware protected memory used. For example, media applications might be able to reduce their buffering. +
  • Stop using hardware protection if possible.

Note that simply re-creating the swap chain or the device will usually have no impact as the DWM will continue to run out of memory and will return the same failure.

+
+ dn384107 + DXGI_FRAME_PRESENTATION_MODE_COMPOSITION_FAILURE + DXGI_FRAME_PRESENTATION_MODE_COMPOSITION_FAILURE +
+ + +

Identifies the granularity at which the graphics processing unit (GPU) can be preempted from performing its current graphics rendering task.

+
+ +

You call the IDXGIAdapter2::GetDesc2 method to retrieve the granularity level at which the GPU can be preempted from performing its current graphics rendering task. The operating system specifies the graphics granularity level in the GraphicsPreemptionGranularity member of the structure.

The following figure shows granularity of graphics rendering tasks.

+
+ hh404504 + DXGI_GRAPHICS_PREEMPTION_GRANULARITY + DXGI_GRAPHICS_PREEMPTION_GRANULARITY +
+ + +

Indicates the preemption granularity as a DMA buffer.

+
+ hh404504 + DXGI_GRAPHICS_PREEMPTION_DMA_BUFFER_BOUNDARY + DXGI_GRAPHICS_PREEMPTION_DMA_BUFFER_BOUNDARY +
+ + +

Indicates the preemption granularity as a graphics primitive. A primitive is a section in a DMA buffer and can be a group of triangles.

+
+ hh404504 + DXGI_GRAPHICS_PREEMPTION_PRIMITIVE_BOUNDARY + DXGI_GRAPHICS_PREEMPTION_PRIMITIVE_BOUNDARY +
+ + +

Indicates the preemption granularity as a triangle. A triangle is a part of a primitive.

+
+ hh404504 + DXGI_GRAPHICS_PREEMPTION_TRIANGLE_BOUNDARY + DXGI_GRAPHICS_PREEMPTION_TRIANGLE_BOUNDARY +
+ + +

Indicates the preemption granularity as a pixel. A pixel is a part of a triangle.

+
+ hh404504 + DXGI_GRAPHICS_PREEMPTION_PIXEL_BOUNDARY + DXGI_GRAPHICS_PREEMPTION_PIXEL_BOUNDARY +
+ + +

Indicates the preemption granularity as a graphics instruction. A graphics instruction operates on a pixel.

+
+ hh404504 + DXGI_GRAPHICS_PREEMPTION_INSTRUCTION_BOUNDARY + DXGI_GRAPHICS_PREEMPTION_INSTRUCTION_BOUNDARY +
+ + + No documentation. + + DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_FULLSCREEN + DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_FULLSCREEN + + + + No documentation. + + DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_WINDOWED + DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_WINDOWED + + + + No documentation. + + DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_CURSOR_STRETCHED + DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAG_CURSOR_STRETCHED + + + + None + + None + None + + + +

Specifies the header metadata type.

+
+ +

This enum is used by the SetHDRMetaData method.

+
+ mt732701 + DXGI_HDR_METADATA_TYPE + DXGI_HDR_METADATA_TYPE +
+ + +

Indicates there is no header metadata.

+
+ mt732701 + DXGI_HDR_METADATA_TYPE_NONE + DXGI_HDR_METADATA_TYPE_NONE +
+ + +

Indicates the header metadata is held by a structure.

+
+ mt732701 + DXGI_HDR_METADATA_TYPE_HDR10 + DXGI_HDR_METADATA_TYPE_HDR10 +
+ + +

Values that specify categories of debug messages.

+
+ +

Use this enumeration when you call IDXGIInfoQueue::GetMessage to retrieve a message and when you call IDXGIInfoQueue::AddMessage to add a message. When you create an info queue filter, you can use these values to allow or deny any categories of messages to pass through the storage and retrieval filters.

Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? +
+ hh780349 + DXGI_INFO_QUEUE_MESSAGE_CATEGORY + DXGI_INFO_QUEUE_MESSAGE_CATEGORY +
+ + +

Unknown category.

+
+ hh780349 + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_UNKNOWN + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_UNKNOWN +
+ + +

Miscellaneous category.

+
+ hh780349 + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_MISCELLANEOUS + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_MISCELLANEOUS +
+ + +

Initialization category.

+
+ hh780349 + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_INITIALIZATION + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_INITIALIZATION +
+ + +

Cleanup category.

+
+ hh780349 + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_CLEANUP + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_CLEANUP +
+ + +

Compilation category.

+
+ hh780349 + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_COMPILATION + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_COMPILATION +
+ + +

State creation category.

+
+ hh780349 + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_CREATION + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_CREATION +
+ + +

State setting category.

+
+ hh780349 + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_SETTING + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_SETTING +
+ + +

State getting category.

+
+ hh780349 + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_GETTING + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_GETTING +
+ + +

Resource manipulation category.

+
+ hh780349 + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_RESOURCE_MANIPULATION + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_RESOURCE_MANIPULATION +
+ + +

Execution category.

+
+ hh780349 + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_EXECUTION + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_EXECUTION +
+ + +

Shader category.

+
+ hh780349 + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_SHADER + DXGI_INFO_QUEUE_MESSAGE_CATEGORY_SHADER +
+ + +

Values that specify debug message severity levels for an information queue.

+
+ +

Use this enumeration when you call IDXGIInfoQueue::GetMessage to retrieve a message and when you call IDXGIInfoQueue::AddMessage to add a message. Also, use this enumeration with IDXGIInfoQueue::AddApplicationMessage.

Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? +
+ hh780350 + DXGI_INFO_QUEUE_MESSAGE_SEVERITY + DXGI_INFO_QUEUE_MESSAGE_SEVERITY +
+ + +

Defines some type of corruption that has occurred.

+
+ hh780350 + DXGI_INFO_QUEUE_MESSAGE_SEVERITY_CORRUPTION + DXGI_INFO_QUEUE_MESSAGE_SEVERITY_CORRUPTION +
+ + +

Defines an error message.

+
+ hh780350 + DXGI_INFO_QUEUE_MESSAGE_SEVERITY_ERROR + DXGI_INFO_QUEUE_MESSAGE_SEVERITY_ERROR +
+ + +

Defines a warning message.

+
+ hh780350 + DXGI_INFO_QUEUE_MESSAGE_SEVERITY_WARNING + DXGI_INFO_QUEUE_MESSAGE_SEVERITY_WARNING +
+ + +

Defines an information message.

+
+ hh780350 + DXGI_INFO_QUEUE_MESSAGE_SEVERITY_INFO + DXGI_INFO_QUEUE_MESSAGE_SEVERITY_INFO +
+ + +

Defines a message other than corruption, error, warning, or information.

+
+ hh780350 + DXGI_INFO_QUEUE_MESSAGE_SEVERITY_MESSAGE + DXGI_INFO_QUEUE_MESSAGE_SEVERITY_MESSAGE +
+ + +

A reference to the surface data (see ).

+
+ bb174567 + DXGI_MAP_READ + DXGI_MAP_READ +
+ + +

CPU read-write flags. These flags can be combined with a logical OR.

  • DXGI_MAP_READ - Allow CPU read access.
  • DXGI_MAP_WRITE - Allow CPU write access.
  • DXGI_MAP_DISCARD - Discard the previous contents of a resource when it is mapped.
+
+ bb174567 + DXGI_MAP_WRITE + DXGI_MAP_WRITE +
+ + + No documentation. + + bb174567 + DXGI_MAP_DISCARD + DXGI_MAP_DISCARD + + + +

Specifies the memory segment group to use.

+
+ +

This enum is used by QueryVideoMemoryInfo and SetVideoMemoryReservation.

Refer to the remarks for .

+
+ dn933219 + DXGI_MEMORY_SEGMENT_GROUP + DXGI_MEMORY_SEGMENT_GROUP +
+ + +

The grouping of segments which is considered local to the video adapter, and represents the fastest available memory to the GPU. Applications should target the local segment group as the target size for their working set.

+
+ dn933219 + DXGI_MEMORY_SEGMENT_GROUP_LOCAL + DXGI_MEMORY_SEGMENT_GROUP_LOCAL +
+ + +

The grouping of segments which is considered non-local to the video adapter, and may have slower performance than the local segment group.

+
+ dn933219 + DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL + DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL +
+ + +

Specifies nominal range YCbCr, which isn't an absolute color space, but a way of encoding RGB info.

+
+ dn313170 + DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAG_NOMINAL_RANGE + DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAG_NOMINAL_RANGE +
+ + +

Specifies BT.709, which standardizes the format of high-definition television and has 16:9 (widescreen) aspect ratio.

+
+ dn313170 + DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAG_BT709 + DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAG_BT709 +
+ + +

Specifies xvYCC or extended-gamut YCC (also x.v.Color) color space that can be used in the video electronics of television sets to support a gamut 1.8 times as large as that of the sRGB color space.

+
+ dn313170 + DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAG_xvYCC + DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAG_xvYCC +
+ + + None + + None + None + + + + No documentation. + + mt732702 + DXGI_OFFER_RESOURCE_FLAG_ALLOW_DECOMMIT + DXGI_OFFER_RESOURCE_FLAG_ALLOW_DECOMMIT + + + + None + + None + None + + + +

Identifies the importance of a resource?s content when you call the IDXGIDevice2::OfferResources method to offer the resource.

+
+ +

Priority determines how likely the operating system is to discard an offered resource. Resources offered with lower priority are discarded first.

+
+ dn933257 + DXGI_OFFER_RESOURCE_PRIORITY + DXGI_OFFER_RESOURCE_PRIORITY +
+ + + No documentation. + + dn933257 + DXGI_OFFER_RESOURCE_PRIORITY_LOW + DXGI_OFFER_RESOURCE_PRIORITY_LOW + + + + No documentation. + + dn933257 + DXGI_OFFER_RESOURCE_PRIORITY_NORMAL + DXGI_OFFER_RESOURCE_PRIORITY_NORMAL + + + + No documentation. + + dn933257 + DXGI_OFFER_RESOURCE_PRIORITY_HIGH + DXGI_OFFER_RESOURCE_PRIORITY_HIGH + + + + No documentation. + + DXGI_OUTDUPL_COMPOSITED_UI_CAPTURE_ONLY + DXGI_OUTDUPL_COMPOSITED_UI_CAPTURE_ONLY + + + + None + + None + None + + + +

Identifies the type of reference shape.

+
+ hh404520 + DXGI_OUTDUPL_POINTER_SHAPE_TYPE + DXGI_OUTDUPL_POINTER_SHAPE_TYPE +
+ + +

The reference type is a monochrome mouse reference, which is a monochrome bitmap. The bitmap's size is specified by width and height in a 1 bits per pixel (bpp) device independent bitmap (DIB) format AND mask that is followed by another 1 bpp DIB format XOR mask of the same size.

+
+ hh404520 + DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MONOCHROME + DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MONOCHROME +
+ + +

The reference type is a color mouse reference, which is a color bitmap. The bitmap's size is specified by width and height in a 32 bpp ARGB DIB format.

+
+ hh404520 + DXGI_OUTDUPL_POINTER_SHAPE_TYPE_COLOR + DXGI_OUTDUPL_POINTER_SHAPE_TYPE_COLOR +
+ + +

The reference type is a masked color mouse reference. A masked color mouse reference is a 32 bpp ARGB format bitmap with the mask value in the alpha bits. The only allowed mask values are 0 and 0xFF. When the mask value is 0, the RGB value should replace the screen pixel. When the mask value is 0xFF, an XOR operation is performed on the RGB value and the screen pixel; the result replaces the screen pixel.

+
+ hh404520 + DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MASKED_COLOR + DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MASKED_COLOR +
+ + +

Overlay color space support is present.

+
+ dn903665 + DXGI_OVERLAY_COLOR_SPACE_SUPPORT_FLAG_PRESENT + DXGI_OVERLAY_COLOR_SPACE_SUPPORT_FLAG_PRESENT +
+ + + None + + None + None + + + + No documentation. + + dn903667 + DXGI_OVERLAY_SUPPORT_FLAG_DIRECT + DXGI_OVERLAY_SUPPORT_FLAG_DIRECT + + + + No documentation. + + dn903667 + DXGI_OVERLAY_SUPPORT_FLAG_SCALING + DXGI_OVERLAY_SUPPORT_FLAG_SCALING + + + +

An integer that specifies how to synchronize presentation of a frame with the vertical blank. +

For the bit-block transfer (bitblt) model (DXGI_SWAP_EFFECT_DISCARD or DXGI_SWAP_EFFECT_SEQUENTIAL), values are:

  • 0 - The presentation occurs immediately, there is no synchronization.
  • 1 through 4 - Synchronize presentation after the nth vertical blank.

For the flip model (DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL), values are:

  • 0 - Cancel the remaining time on the previously presented frame and discard this frame if a newer frame is queued. +
  • 1 through 4 - Synchronize presentation for at least n vertical blanks.

For an example that shows how sync-interval values affect a flip presentation queue, see Remarks.

If the update region straddles more than one output (each represented by ), Present performs the synchronization to the output that contains the largest sub-rectangle of the target window's client area.

+
+ bb174576 + DXGI_PRESENT_TEST + DXGI_PRESENT_TEST +
+ + +

An integer value that contains swap-chain presentation options. These options are defined by the DXGI_PRESENT constants.

+
+ bb174576 + DXGI_PRESENT_DO_NOT_SEQUENCE + DXGI_PRESENT_DO_NOT_SEQUENCE +
+ + + No documentation. + + bb174576 + DXGI_PRESENT_RESTART + DXGI_PRESENT_RESTART + + + + No documentation. + + bb174576 + DXGI_PRESENT_DO_NOT_WAIT + DXGI_PRESENT_DO_NOT_WAIT + + + + No documentation. + + bb174576 + DXGI_PRESENT_STEREO_PREFER_RIGHT + DXGI_PRESENT_STEREO_PREFER_RIGHT + + + + No documentation. + + bb174576 + DXGI_PRESENT_STEREO_TEMPORARY_MONO + DXGI_PRESENT_STEREO_TEMPORARY_MONO + + + + No documentation. + + bb174576 + DXGI_PRESENT_RESTRICT_TO_OUTPUT + DXGI_PRESENT_RESTRICT_TO_OUTPUT + + + + No documentation. + + bb174576 + DXGI_PRESENT_USE_DURATION + DXGI_PRESENT_USE_DURATION + + + + No documentation. + + bb174576 + DXGI_PRESENT_ALLOW_TEARING + DXGI_PRESENT_ALLOW_TEARING + + + + None + + None + None + + + +

Specifies result flags for the ReclaimResources1 method.

+
+ mt732703 + DXGI_RECLAIM_RESOURCE_RESULTS + DXGI_RECLAIM_RESOURCE_RESULTS +
+ + + No documentation. + + mt732703 + DXGI_RECLAIM_RESOURCE_RESULT_OK + DXGI_RECLAIM_RESOURCE_RESULT_OK + + + + No documentation. + + mt732703 + DXGI_RECLAIM_RESOURCE_RESULT_DISCARDED + DXGI_RECLAIM_RESOURCE_RESULT_DISCARDED + + + + No documentation. + + mt732703 + DXGI_RECLAIM_RESOURCE_RESULT_NOT_COMMITTED + DXGI_RECLAIM_RESOURCE_RESULT_NOT_COMMITTED + + + +

Flags indicating the memory location of a resource.

+
+ +

This enum is used by QueryResourceResidency.

+
+ bb173070 + DXGI_RESIDENCY + DXGI_RESIDENCY +
+ + +

The resource is located in video memory.

+
+ bb173070 + DXGI_RESIDENCY_FULLY_RESIDENT + DXGI_RESIDENCY_FULLY_RESIDENT +
+ + +

At least some of the resource is located in CPU memory.

+
+ bb173070 + DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY + DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY +
+ + +

At least some of the resource has been paged out to the hard drive.

+
+ bb173070 + DXGI_RESIDENCY_EVICTED_TO_DISK + DXGI_RESIDENCY_EVICTED_TO_DISK +
+ + +

Set the priority for evicting the resource from memory.

+
+ +

The eviction priority is a memory-management variable that is used by DXGI for determining how to populate overcommitted memory.

You can set priority levels other than the defined values when appropriate. For example, you can set a resource with a priority level of 0x78000001 to indicate that the resource is slightly above normal.

+
+ bb174564 + DXGI_RESOURCE_PRIORITY + DXGI_RESOURCE_PRIORITY +
+ + +

The priority is one of the following values:

ValueMeaning
DXGI_RESOURCE_PRIORITY_MINIMUM (0x28000000)

The resource is unused and can be evicted as soon as another resource requires the memory that the resource occupies.

DXGI_RESOURCE_PRIORITY_LOW (0x50000000)

The eviction priority of the resource is low. The placement of the resource is not critical, and minimal work is performed to find a location for the resource. For example, if a GPU can render with a vertex buffer from either local or non-local memory with little difference in performance, that vertex buffer is low priority. Other more critical resources (for example, a render target or texture) can then occupy the faster memory.

DXGI_RESOURCE_PRIORITY_NORMAL (0x78000000)

The eviction priority of the resource is normal. The placement of the resource is important, but not critical, for performance. The resource is placed in its preferred location instead of a low-priority resource.

DXGI_RESOURCE_PRIORITY_HIGH (0xa0000000)

The eviction priority of the resource is high. The resource is placed in its preferred location instead of a low-priority or normal-priority resource.

DXGI_RESOURCE_PRIORITY_MAXIMUM (0xc8000000)

The resource is evicted from memory only if there is no other way of resolving the memory requirement.

?

+
+ bb174564 + DXGI_RESOURCE_PRIORITY_MINIMUM + DXGI_RESOURCE_PRIORITY_MINIMUM +
+ + + No documentation. + + bb174564 + DXGI_RESOURCE_PRIORITY_LOW + DXGI_RESOURCE_PRIORITY_LOW + + + + No documentation. + + bb174564 + DXGI_RESOURCE_PRIORITY_NORMAL + DXGI_RESOURCE_PRIORITY_NORMAL + + + + No documentation. + + bb174564 + DXGI_RESOURCE_PRIORITY_HIGH + DXGI_RESOURCE_PRIORITY_HIGH + + + + No documentation. + + bb174564 + DXGI_RESOURCE_PRIORITY_MAXIMUM + DXGI_RESOURCE_PRIORITY_MAXIMUM + + + +

Identifies resize behavior when the back-buffer size does not match the size of the target output.

+
+ +

The DXGI_SCALING_NONE value is supported only for flip presentation model swap chains that you create with the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL value. You pass these values in a call to IDXGIFactory2::CreateSwapChainForHwnd, IDXGIFactory2::CreateSwapChainForCoreWindow, or IDXGIFactory2::CreateSwapChainForComposition.

DXGI_SCALING_ASPECT_RATIO_STRETCH will prefer to use a horizontal fill, otherwise it will use a vertical fill, using the following logic.

float aspectRatio = backBufferWidth / float(backBufferHeight); // Horizontal fill float scaledWidth = outputWidth; float scaledHeight = outputWidth / aspectRatio; if (scaledHeight >= outputHeight) { // Do vertical fill scaledWidth = outputHeight * aspectRatio; scaledHeight = outputHeight; } float offsetX = (outputWidth - scaledWidth) * 0.5f; float offsetY = (outputHeight - scaledHeight) * 0.5f; rect.left = static_cast<>(offsetX); rect.top = static_cast<>(offsetY); rect.right = static_cast<>(offsetX + scaledWidth); rect.bottom = static_cast<>(offsetY + scaledHeight); rect.left = std::max<>(0, rect.left); rect.top = std::max<>(0, rect.top); rect.right = std::min<>(static_cast<>(outputWidth), rect.right); rect.bottom = std::min<>(static_cast<>(outputHeight), rect.bottom); +

Note that outputWidth and outputHeight are the pixel sizes of the presentation target size. In the case of CoreWindow, this requires converting the logicalWidth and logicalHeight values from DIPS to pixels using the window's DPI property.

+
+ hh404526 + DXGI_SCALING + DXGI_SCALING +
+ + +

Directs DXGI to make the back-buffer contents scale to fit the presentation target size. This is the implicit behavior of DXGI when you call the IDXGIFactory::CreateSwapChain method.

+
+ hh404526 + DXGI_SCALING_STRETCH + DXGI_SCALING_STRETCH +
+ + +

Directs DXGI to make the back-buffer contents appear without any scaling when the presentation target size is not equal to the back-buffer size. The top edges of the back buffer and presentation target are aligned together. If the WS_EX_LAYOUTRTL style is associated with the handle to the target output window, the right edges of the back buffer and presentation target are aligned together; otherwise, the left edges are aligned together. All target area outside the back buffer is filled with window background color.

This value specifies that all target areas outside the back buffer of a swap chain are filled with the background color that you specify in a call to IDXGISwapChain1::SetBackgroundColor.

+
+ hh404526 + DXGI_SCALING_NONE + DXGI_SCALING_NONE +
+ + +

Directs DXGI to make the back-buffer contents scale to fit the presentation target size, while preserving the aspect ratio of the back-buffer. If the scaled back-buffer does not fill the presentation area, it will be centered with black borders.

This constant is supported on Windows Phone 8 and Windows 10.

Note that with legacy Win32 window swapchains, this works the same as DXGI_SCALING_STRETCH. +

+
+ hh404526 + DXGI_SCALING_ASPECT_RATIO_STRETCH + DXGI_SCALING_ASPECT_RATIO_STRETCH +
+ + + No documentation. + + DXGI_SHARED_RESOURCE_READ + DXGI_SHARED_RESOURCE_READ + + + + No documentation. + + DXGI_SHARED_RESOURCE_WRITE + DXGI_SHARED_RESOURCE_WRITE + + + + None + + None + None + + + +

Color space support is present.

+
+ dn903668 + DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT + DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_PRESENT +
+ + +

Overlay color space support is present.

+
+ dn903668 + DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_OVERLAY_PRESENT + DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG_OVERLAY_PRESENT +
+ + + None + + None + None + + + +

Set this flag to turn off automatic image rotation; that is, do not perform a rotation when transferring the contents of the front buffer to the monitor. Use this flag to avoid a bandwidth penalty when an application expects to handle rotation. This option is valid only during full-screen mode.

+
+ bb173076 + DXGI_SWAP_CHAIN_FLAG_NONPREROTATED + DXGI_SWAP_CHAIN_FLAG_NONPREROTATED +
+ + +

Set this flag to enable an application to switch modes by calling IDXGISwapChain::ResizeTarget. When switching from windowed to full-screen mode, the display mode (or monitor resolution) will be changed to match the dimensions of the application window.

+
+ bb173076 + DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH + DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH +
+ + +

Set this flag to enable an application to render using GDI on a swap chain or a surface. This will allow the application to call IDXGISurface1::GetDC on the 0th back buffer or a surface.

+
+ bb173076 + DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE + DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE +
+ + +

Set this flag to indicate that the swap chain might contain protected content; therefore, the operating system supports the creation of the swap chain only when driver and hardware protection is used. If the driver and hardware do not support content protection, the call to create a resource for the swap chain fails.

Direct3D 11:??This enumeration value is supported starting with Windows?8.

+
+ bb173076 + DXGI_SWAP_CHAIN_FLAG_RESTRICTED_CONTENT + DXGI_SWAP_CHAIN_FLAG_RESTRICTED_CONTENT +
+ + +

Set this flag to indicate that shared resources that are created within the swap chain must be protected by using the driver?s mechanism for restricting access to shared surfaces.

Direct3D 11:??This enumeration value is supported starting with Windows?8.

+
+ bb173076 + DXGI_SWAP_CHAIN_FLAG_RESTRICT_SHARED_RESOURCE_DRIVER + DXGI_SWAP_CHAIN_FLAG_RESTRICT_SHARED_RESOURCE_DRIVER +
+ + +

Set this flag to restrict presented content to the local displays. Therefore, the presented content is not accessible via remote accessing or through the desktop duplication APIs.

This flag supports the window content protection features of Windows. Applications can use this flag to protect their own onscreen window content from being captured or copied through a specific set of public operating system features and APIs.

If you use this flag with windowed ( or IWindow) swap chains where another process created the , the owner of the must use the SetWindowDisplayAffinity function appropriately in order to allow calls to IDXGISwapChain::Present or IDXGISwapChain1::Present1 to succeed. +

Direct3D 11:??This enumeration value is supported starting with Windows?8.

+
+ bb173076 + DXGI_SWAP_CHAIN_FLAG_DISPLAY_ONLY + DXGI_SWAP_CHAIN_FLAG_DISPLAY_ONLY +
+ + +

Set this flag to create a waitable object you can use to ensure rendering does not begin while a frame is still being presented. When this flag is used, the swapchain's latency must be set with the IDXGISwapChain2::SetMaximumFrameLatency API instead of IDXGIDevice1::SetMaximumFrameLatency.

Note??This enumeration value is supported starting with Windows?8.1.

+
+ bb173076 + DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT + DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT +
+ + +

Set this flag to create a swap chain in the foreground layer for multi-plane rendering. This flag can only be used with CoreWindow swap chains, which are created with CreateSwapChainForCoreWindow. Apps should not create foreground swap chains if IDXGIOutput2::SupportsOverlays indicates that hardware support for overlays is not available.

Note that IDXGISwapChain::ResizeBuffers cannot be used to add or remove this flag.

Note??This enumeration value is supported starting with Windows?8.1.

+
+ bb173076 + DXGI_SWAP_CHAIN_FLAG_FOREGROUND_LAYER + DXGI_SWAP_CHAIN_FLAG_FOREGROUND_LAYER +
+ + +

Set this flag to create a swap chain for full-screen video.

Note??This enumeration value is supported starting with Windows?8.1.

+
+ bb173076 + DXGI_SWAP_CHAIN_FLAG_FULLSCREEN_VIDEO + DXGI_SWAP_CHAIN_FLAG_FULLSCREEN_VIDEO +
+ + +

Set this flag to create a swap chain for YUV video.

Note??This enumeration value is supported starting with Windows?8.1.

+
+ bb173076 + DXGI_SWAP_CHAIN_FLAG_YUV_VIDEO + DXGI_SWAP_CHAIN_FLAG_YUV_VIDEO +
+ + +

Indicates that the swap chain should be created such that all underlying resources can be protected by the hardware. Resource creation will fail if hardware content protection is not supported.

This flag has the following restrictions:

  • This flag can only be used with swap effect DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL.
Note??Creating a swap chain using this flag does not automatically guarantee that hardware protection will be enabled for the underlying allocation. Some implementations require that the DRM components are first initialized prior to any guarantees of protection. ?

Note??This enumeration value is supported starting with Windows?10.

+
+ bb173076 + DXGI_SWAP_CHAIN_FLAG_HW_PROTECTED + DXGI_SWAP_CHAIN_FLAG_HW_PROTECTED +
+ + +

Tearing support is a requirement to enable displays that support variable refresh rates to function properly when the application presents a swap chain tied to a full screen borderless window. Win32 apps can already achieve tearing in fullscreen exclusive mode by calling SetFullscreenState(TRUE), but the recommended approach for Win32 developers is to use this tearing flag instead.

To check for hardware support of this feature, refer to IDXGIFactory5::CheckFeatureSupport. For usage information refer to IDXGISwapChain::Present and the DXGI_PRESENT flags.

+
+ bb173076 + DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING + DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING +
+ + + No documentation. + + bb173076 + DXGI_SWAP_CHAIN_FLAG_RESTRICTED_TO_ALL_HOLOGRAPHIC_DISPLAYS + DXGI_SWAP_CHAIN_FLAG_RESTRICTED_TO_ALL_HOLOGRAPHIC_DISPLAYS + + + + None + + None + None + + + +

Options for handling pixels in a display surface after calling IDXGISwapChain1::Present1.

+
+ +

This enumeration is used by the and structures.

To use multisampling with DXGI_SWAP_EFFECT_SEQUENTIAL or DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, you must perform the multisampling in a separate render target. For example, create a multisampled texture by calling ID3D11Device::CreateTexture2D with a filled structure (BindFlags member set to D3D11_BIND_RENDER_TARGET and SampleDesc member with multisampling parameters). Next call ID3D11Device::CreateRenderTargetView to create a render-target view for the texture, and render your scene into the texture. Finally call ID3D11DeviceContext::ResolveSubresource to resolve the multisampled texture into your non-multisampled swap chain.

The primary difference between presentation models is how back-buffer contents get to the Desktop Window Manager (DWM) for composition. In the bitblt model, which is used with the DXGI_SWAP_EFFECT_DISCARD and DXGI_SWAP_EFFECT_SEQUENTIAL values, contents of the back buffer get copied into the redirection surface on each call to IDXGISwapChain1::Present1. In the flip model, which is used with the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL value, all back buffers are shared with the DWM. Therefore, the DWM can compose straight from those back buffers without any additional copy operations. In general, the flip model is the more efficient model. The flip model also provides more features, such as enhanced present statistics.

When you call IDXGISwapChain1::Present1 on a flip model swap chain (DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL) with 0 specified in the SyncInterval parameter, IDXGISwapChain1::Present1's behavior is the same as the behavior of Direct3D 9Ex's IDirect3DDevice9Ex::PresentEx with D3DSWAPEFFECT_FLIPEX and D3DPRESENT_FORCEIMMEDIATE. That is, the runtime not only presents the next frame instead of any previously queued frames, it also terminates any remaining time left on the previously queued frames.

Regardless of whether the flip model is more efficient, an application still might choose the bitblt model because the bitblt model is the only way to mix GDI and DirectX presentation. In the flip model, the application must create the swap chain with DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE, and then must use GetDC on the back buffer explicitly. After the first successful call to IDXGISwapChain1::Present1 on a flip-model swap chain, GDI no longer works with the that is associated with that swap chain, even after the destruction of the swap chain. This restriction even extends to methods like ScrollWindowEx.

For more info about the flip-model swap chain and optimizing presentation, see Enhancing presentation with the flip model, dirty rectangles, and scrolled areas.

+
+ bb173077 + DXGI_SWAP_EFFECT + DXGI_SWAP_EFFECT +
+ + + No documentation. + + bb173077 + DXGI_SWAP_EFFECT_DISCARD + DXGI_SWAP_EFFECT_DISCARD + + + + No documentation. + + bb173077 + DXGI_SWAP_EFFECT_SEQUENTIAL + DXGI_SWAP_EFFECT_SEQUENTIAL + + + + No documentation. + + bb173077 + DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL + DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL + + + + No documentation. + + bb173077 + DXGI_SWAP_EFFECT_FLIP_DISCARD + DXGI_SWAP_EFFECT_FLIP_DISCARD + + + + No documentation. + + DXGI_USAGE_SHADER_INPUT + DXGI_USAGE_SHADER_INPUT + + + + No documentation. + + DXGI_USAGE_RENDER_TARGET_OUTPUT + DXGI_USAGE_RENDER_TARGET_OUTPUT + + + + No documentation. + + DXGI_USAGE_BACK_BUFFER + DXGI_USAGE_BACK_BUFFER + + + + No documentation. + + DXGI_USAGE_SHARED + DXGI_USAGE_SHARED + + + + No documentation. + + DXGI_USAGE_READ_ONLY + DXGI_USAGE_READ_ONLY + + + + No documentation. + + DXGI_USAGE_DISCARD_ON_PRESENT + DXGI_USAGE_DISCARD_ON_PRESENT + + + + No documentation. + + DXGI_USAGE_UNORDERED_ACCESS + DXGI_USAGE_UNORDERED_ACCESS + + + + No documentation. + + DXGI_MWA_NO_WINDOW_CHANGES + DXGI_MWA_NO_WINDOW_CHANGES + + + + No documentation. + + DXGI_MWA_NO_ALT_ENTER + DXGI_MWA_NO_ALT_ENTER + + + + No documentation. + + DXGI_MWA_NO_PRINT_SCREEN + DXGI_MWA_NO_PRINT_SCREEN + + + + No documentation. + + DXGI_MWA_VALID + DXGI_MWA_VALID + + + + None + + None + None + + + + Functions + + + + Constant CreateFactoryDebug + DXGI_CREATE_FACTORY_DEBUG + + + +

Creates a DXGI 1.1 factory that you can use to generate other DXGI objects.

+
+

The globally unique identifier () of the object referenced by the ppFactory parameter.

+

Address of a reference to an object.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ +

Use a DXGI 1.1 factory to generate objects that enumerate adapters, create swap chains, and associate a window with the alt+enter key sequence for toggling to and from the full-screen display mode.

If the CreateDXGIFactory1 function succeeds, the reference count on the interface is incremented. To avoid a memory leak, when you finish using the interface, call the IDXGIFactory1::Release method to release the interface.

This entry point is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

Note??Do not mix the use of DXGI 1.0 () and DXGI 1.1 () in an application. Use or , but not both in an application.?Note??CreateDXGIFactory1 fails if your app's DllMain function calls it. For more info about how DXGI responds from DllMain, see DXGI Responses from DLLMain.?Note??Starting with Windows?8, all DXGI factories (regardless if they were created with CreateDXGIFactory or CreateDXGIFactory1) enumerate adapters identically. The enumeration order of adapters, which you retrieve with IDXGIFactory::EnumAdapters or IDXGIFactory1::EnumAdapters1, is as follows:
  • Adapter with the output on which the desktop primary is displayed. This adapter corresponds with an index of zero.
  • Adapters with outputs.
  • Adapters without outputs.
? +
+ ff471318 + HRESULT CreateDXGIFactory1([In] const GUID& riid,[Out] void** ppFactory) + CreateDXGIFactory1 +
+ + +

Creates a DXGI 1.3 factory that you can use to generate other DXGI objects.

In Windows?8, any DXGI factory created while DXGIDebug.dll was present on the system would load and use it. Starting in Windows?8.1, apps explicitly request that DXGIDebug.dll be loaded instead. Use CreateDXGIFactory2 and specify the flag to request DXGIDebug.dll; the DLL will be loaded if it is present on the system.

+
+

Valid values include the (0x01) flag, and zero.

Note??This flag will be set by the D3D runtime if:
  • The system creates an implicit factory during device creation.
  • The D3D11_CREATE_DEVICE_DEBUG flag is specified during device creation, for example using D3D11CreateDevice (or the swapchain method, or the Direct3D 10 equivalents).
?
+

The globally unique identifier () of the object referenced by the ppFactory parameter.

+

Address of a reference to an object.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ +

This function accepts a flag indicating whether DXGIDebug.dll is loaded. The function otherwise behaves identically to CreateDXGIFactory1.

+
+ dn268307 + HRESULT CreateDXGIFactory2([In] unsigned int Flags,[In] const GUID& riid,[Out] void** ppFactory) + CreateDXGIFactory2 +
+ + + Functions + + + + Constant InvalidCall + DXGI_ERROR_INVALID_CALL + + + Constant NotFound + DXGI_ERROR_NOT_FOUND + + + Constant MoreData + DXGI_ERROR_MORE_DATA + + + Constant Unsupported + DXGI_ERROR_UNSUPPORTED + + + Constant DeviceRemoved + DXGI_ERROR_DEVICE_REMOVED + + + Constant DeviceHung + DXGI_ERROR_DEVICE_HUNG + + + Constant DeviceReset + DXGI_ERROR_DEVICE_RESET + + + Constant WasStillDrawing + DXGI_ERROR_WAS_STILL_DRAWING + + + Constant FrameStatisticsDisjoint + DXGI_ERROR_FRAME_STATISTICS_DISJOINT + + + Constant GraphicsVidpnSourceInUse + DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE + + + Constant DriverInternalError + DXGI_ERROR_DRIVER_INTERNAL_ERROR + + + Constant Nonexclusive + DXGI_ERROR_NONEXCLUSIVE + + + Constant NotCurrentlyAvailable + DXGI_ERROR_NOT_CURRENTLY_AVAILABLE + + + Constant RemoteClientDisconnected + DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED + + + Constant RemoteOufOfMemory + DXGI_ERROR_REMOTE_OUTOFMEMORY + + + Constant AccessLost + DXGI_ERROR_ACCESS_LOST + + + Constant WaitTimeout + DXGI_ERROR_WAIT_TIMEOUT + + + Constant SessionDisconnected + DXGI_ERROR_SESSION_DISCONNECTED + + + Constant RestrictToOutputStale + DXGI_ERROR_RESTRICT_TO_OUTPUT_STALE + + + Constant CannotProtectContent + DXGI_ERROR_CANNOT_PROTECT_CONTENT + + + Constant AccessDenied + DXGI_ERROR_ACCESS_DENIED + + + Constant NameAlreadyExists + DXGI_ERROR_NAME_ALREADY_EXISTS + + + Constant SdkComponentMissing + DXGI_ERROR_SDK_COMPONENT_MISSING + + + Constant NotCurrent + DXGI_ERROR_NOT_CURRENT + + + Constant HwProtectionOufOfMemory + DXGI_ERROR_HW_PROTECTION_OUTOFMEMORY + + + Constant DynamicCodePolicyViolation + DXGI_ERROR_DYNAMIC_CODE_POLICY_VIOLATION + + + Constant NonCompositedUi + DXGI_ERROR_NON_COMPOSITED_UI + + + Constant ModeChangeInProgress + DXGI_ERROR_MODE_CHANGE_IN_PROGRESS + + + Constant CacheCorrupt + DXGI_ERROR_CACHE_CORRUPT + + + Constant CacheFull + DXGI_ERROR_CACHE_FULL + + + Constant CacheHashCollision + DXGI_ERROR_CACHE_HASH_COLLISION + + + Constant AlreadyExists + DXGI_ERROR_ALREADY_EXISTS + + + +

Gets a DXGI 1.1 description of an adapter (or video card).

+
+ +

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

Use the GetDesc1 method to get a DXGI 1.1 description of an adapter. To get a DXGI 1.0 description, use the method.

+
+ ff471330 + GetDesc1 + GetDesc1 +
+ + +

Gets a DXGI 1.1 description of an adapter (or video card).

+
+

A reference to a structure that describes the adapter. This parameter must not be null. On feature level 9 graphics hardware, GetDesc1 returns zeros for the PCI ID in the VendorId, DeviceId, SubSysId, and Revision members of and ?Software Adapter? for the description string in the Description member.

+

Returns if successful; otherwise, returns E_INVALIDARG if the pDesc parameter is null.

+ +

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

Use the GetDesc1 method to get a DXGI 1.1 description of an adapter. To get a DXGI 1.0 description, use the method.

+
+ ff471330 + HRESULT IDXGIAdapter1::GetDesc1([Out] DXGI_ADAPTER_DESC1* pDesc) + IDXGIAdapter1::GetDesc1 +
+ + +

Gets a Microsoft DirectX Graphics Infrastructure (DXGI) 1.2 description of an adapter or video card. This description includes information about the granularity at which the graphics processing unit (GPU) can be preempted from performing its current task.

+
+ +

Use the GetDesc2 method to get a DXGI 1.2 description of an adapter. To get a DXGI 1.1 description, use the IDXGIAdapter1::GetDesc1 method. To get a DXGI 1.0 description, use the IDXGIAdapter::GetDesc method.

The Windows Display Driver Model (WDDM) scheduler can preempt the GPU's execution of application tasks. The granularity at which the GPU can be preempted from performing its current task in the WDDM 1.1 or earlier driver model is a direct memory access (DMA) buffer for graphics tasks or a compute packet for compute tasks. The GPU can switch between tasks only after it completes the currently executing unit of work, a DMA buffer or a compute packet.

A DMA buffer is the largest independent unit of graphics work that the WDDM scheduler can submit to the GPU. This buffer contains a set of GPU instructions that the WDDM driver and GPU use. A compute packet is the largest independent unit of compute work that the WDDM scheduler can submit to the GPU. A compute packet contains dispatches (for example, calls to the ID3D11DeviceContext::Dispatch method), which contain thread groups. The WDDM 1.2 or later driver model allows the GPU to be preempted at finer granularity levels than a DMA buffer or compute packet. You can use the GetDesc2 method to retrieve the granularity levels for graphics and compute tasks.

+
+ hh404540 + GetDesc2 + GetDesc2 +
+ + +

Gets a Microsoft DirectX Graphics Infrastructure (DXGI) 1.2 description of an adapter or video card. This description includes information about the granularity at which the graphics processing unit (GPU) can be preempted from performing its current task.

+
+

A reference to a structure that describes the adapter. This parameter must not be null. On feature level 9 graphics hardware, earlier versions of GetDesc2 (GetDesc and GetDesc1) return zeros for the PCI ID in the VendorId, DeviceId, SubSysId, and Revision members of the adapter description structure and ?Software Adapter? for the description string in the Description member. GetDesc2 returns the actual feature level 9 hardware values in these members.

+

Returns if successful; otherwise, returns E_INVALIDARG if the pDesc parameter is null.

+ +

Use the GetDesc2 method to get a DXGI 1.2 description of an adapter. To get a DXGI 1.1 description, use the IDXGIAdapter1::GetDesc1 method. To get a DXGI 1.0 description, use the IDXGIAdapter::GetDesc method.

The Windows Display Driver Model (WDDM) scheduler can preempt the GPU's execution of application tasks. The granularity at which the GPU can be preempted from performing its current task in the WDDM 1.1 or earlier driver model is a direct memory access (DMA) buffer for graphics tasks or a compute packet for compute tasks. The GPU can switch between tasks only after it completes the currently executing unit of work, a DMA buffer or a compute packet.

A DMA buffer is the largest independent unit of graphics work that the WDDM scheduler can submit to the GPU. This buffer contains a set of GPU instructions that the WDDM driver and GPU use. A compute packet is the largest independent unit of compute work that the WDDM scheduler can submit to the GPU. A compute packet contains dispatches (for example, calls to the ID3D11DeviceContext::Dispatch method), which contain thread groups. The WDDM 1.2 or later driver model allows the GPU to be preempted at finer granularity levels than a DMA buffer or compute packet. You can use the GetDesc2 method to retrieve the granularity levels for graphics and compute tasks.

+
+ hh404540 + HRESULT IDXGIAdapter2::GetDesc2([Out] DXGI_ADAPTER_DESC2* pDesc) + IDXGIAdapter2::GetDesc2 +
+ + +

Registers to receive notification of hardware content protection teardown events.

+
+

A handle to the event object that the operating system sets when hardware content protection teardown occurs. The CreateEvent or OpenEvent function returns this handle.

+

A reference to a key value that an application can pass to the IDXGIAdapter3::UnregisterHardwareContentProtectionTeardownStatus method to unregister the notification event that hEvent specifies.

+ +

Call ID3D11VideoDevice::GetContentProtectionCaps() to check for the presence of the D3D11_CONTENT_PROTECTION_CAPS_HARDWARE_TEARDOWN capability to know whether the hardware contains an automatic teardown mechanism. After the event is signaled, the application can call ID3D11VideoContext1::CheckCryptoSessionStatus to determine the impact of the hardware teardown for a specific interface. +

+
+ dn933230 + HRESULT IDXGIAdapter3::RegisterHardwareContentProtectionTeardownStatusEvent([In] void* hEvent,[Out] DWORD* pdwCookie) + IDXGIAdapter3::RegisterHardwareContentProtectionTeardownStatusEvent +
+ + +

Unregisters an event to stop it from receiving notification of hardware content protection teardown events.

+
+

A key value for the window or event to unregister. The IDXGIAdapter3::RegisterHardwareContentProtectionTeardownStatusEvent method returns this value.

+ dn933233 + void IDXGIAdapter3::UnregisterHardwareContentProtectionTeardownStatus([In] DWORD dwCookie) + IDXGIAdapter3::UnregisterHardwareContentProtectionTeardownStatus +
+ + +

This method informs the process of the current budget and process usage.

+
+

Specifies the device's physical adapter for which the video memory information is queried. For single-GPU operation, set this to zero. If there are multiple GPU nodes, set this to the index of the node (the device's physical adapter) for which the video memory information is queried. See Multi-Adapter.

+

Specifies a that identifies the group as local or non-local.

+

Fills in a structure with the current values.

+ +

Applications must explicitly manage their usage of physical memory explicitly and keep usage within the budget assigned to the application process. Processes that cannot kept their usage within their assigned budgets will likely experience stuttering, as they are intermittently frozen and paged-out to allow other processes to run.

+
+ dn933223 + HRESULT IDXGIAdapter3::QueryVideoMemoryInfo([In] unsigned int NodeIndex,[In] DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup,[Out] DXGI_QUERY_VIDEO_MEMORY_INFO* pVideoMemoryInfo) + IDXGIAdapter3::QueryVideoMemoryInfo +
+ + +

This method sends the minimum required physical memory for an application, to the OS.

+
+

Specifies the device's physical adapter for which the video memory information is being set. For single-GPU operation, set this to zero. If there are multiple GPU nodes, set this to the index of the node (the device's physical adapter) for which the video memory information is being set. See Multi-Adapter.

+

Specifies a that identifies the group as local or non-local.

+

Specifies a UINT64 that sets the minimum required physical memory, in bytes.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ +

Applications are encouraged to set a video reservation to denote the amount of physical memory they cannot go without. This value helps the OS quickly minimize the impact of large memory pressure situations.

+
+ dn933232 + HRESULT IDXGIAdapter3::SetVideoMemoryReservation([In] unsigned int NodeIndex,[In] DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup,[In] unsigned longlong Reservation) + IDXGIAdapter3::SetVideoMemoryReservation +
+ + +

This method establishes a correlation between a CPU synchronization object and the budget change event.

+
+

Specifies a HANDLE for the event.

+

A key value for the window or event to unregister. The IDXGIAdapter3::RegisterHardwareContentProtectionTeardownStatusEvent method returns this value.

+ +

Instead of calling QueryVideoMemoryInfo regularly, applications can use CPU synchronization objects to efficiently wake threads when budget changes occur.

+
+ dn933231 + HRESULT IDXGIAdapter3::RegisterVideoMemoryBudgetChangeNotificationEvent([In] void* hEvent,[Out] DWORD* pdwCookie) + IDXGIAdapter3::RegisterVideoMemoryBudgetChangeNotificationEvent +
+ + +

This method stops notifying a CPU synchronization object whenever a budget change occurs. An application may switch back to polling the information regularly.

+
+

A key value for the window or event to unregister. The IDXGIAdapter3::RegisterHardwareContentProtectionTeardownStatusEvent method returns this value.

+ +

An application may switch back to polling for the information regularly.

+
+ dn933234 + void IDXGIAdapter3::UnregisterVideoMemoryBudgetChangeNotification([In] DWORD dwCookie) + IDXGIAdapter3::UnregisterVideoMemoryBudgetChangeNotification +
+ + + No documentation. + + GetDesc3 + GetDesc3 + + + + No documentation. + + No documentation. + No documentation. + HRESULT IDXGIAdapter4::GetDesc3([Out] DXGI_ADAPTER_DESC3* pDesc) + IDXGIAdapter4::GetDesc3 + + + +

Gets or sets the source region that is used for the swap chain.

+
+ dn384121 + GetSourceRect / SetSourceRect + GetSourceRect +
+ + +

Gets or sets the rectangle that defines the target region for the video processing blit operation.

+
+ dn384122 + GetTargetRect / SetTargetRect + GetTargetRect +
+ + +

Gets or sets the color space used by the swap chain.

+
+ dn384119 + GetColorSpace / SetColorSpace + GetColorSpace +
+ + +

Presents a frame on the output adapter. The frame is a subresource of the object that was used to create the decode swap chain.

+
+ No documentation. + No documentation. + No documentation. +

This method returns on success, or it returns one of the following error codes:

  • DXGI_STATUS_OCCLUDED
  • E_OUTOFMEMORY
+ dn384123 + HRESULT IDXGIDecodeSwapChain::PresentBuffer([In] unsigned int BufferToPresent,[In] unsigned int SyncInterval,[In] unsigned int Flags) + IDXGIDecodeSwapChain::PresentBuffer +
+ + +

Sets the rectangle that defines the source region for the video processing blit operation.

The source rectangle is the portion of the input surface that is blitted to the destination surface. The source rectangle is given in pixel coordinates, relative to the input surface.

+
+

A reference to a structure that contains the source region to set for the swap chain.

+

This method returns on success, or it returns one of the error codes that are described in the DXGI_ERROR topic.

+ dn384126 + HRESULT IDXGIDecodeSwapChain::SetSourceRect([In] const RECT* pRect) + IDXGIDecodeSwapChain::SetSourceRect +
+ + +

Sets the rectangle that defines the target region for the video processing blit operation.

The target rectangle is the area within the destination surface where the output will be drawn. The target rectangle is given in pixel coordinates, relative to the destination surface.

+
+

A reference to a structure that contains the target region to set for the swap chain.

+

This method returns on success, or it returns one of the error codes that are described in the DXGI_ERROR topic.

+ dn384127 + HRESULT IDXGIDecodeSwapChain::SetTargetRect([In] const RECT* pRect) + IDXGIDecodeSwapChain::SetTargetRect +
+ + +

Sets the size of the destination surface to use for the video processing blit operation.

The destination rectangle is the portion of the output surface that receives the blit for this stream. The destination rectangle is given in pixel coordinates, relative to the output surface.

+
+

The width of the destination size, in pixels.

+

The height of the destination size, in pixels.

+

This method returns on success, or it returns one of the error codes that are described in the DXGI_ERROR topic.

+ dn384125 + HRESULT IDXGIDecodeSwapChain::SetDestSize([In] unsigned int Width,[In] unsigned int Height) + IDXGIDecodeSwapChain::SetDestSize +
+ + +

Gets the source region that is used for the swap chain.

+
+

A reference to a structure that receives the source region for the swap chain.

+

This method returns on success, or it returns one of the error codes that are described in the DXGI_ERROR topic.

+ dn384121 + HRESULT IDXGIDecodeSwapChain::GetSourceRect([Out] RECT* pRect) + IDXGIDecodeSwapChain::GetSourceRect +
+ + +

Gets the rectangle that defines the target region for the video processing blit operation.

+
+

A reference to a structure that receives the target region for the swap chain.

+

This method returns on success, or it returns one of the error codes that are described in the DXGI_ERROR topic.

+ dn384122 + HRESULT IDXGIDecodeSwapChain::GetTargetRect([Out] RECT* pRect) + IDXGIDecodeSwapChain::GetTargetRect +
+ + +

Gets the size of the destination surface to use for the video processing blit operation.

+
+

A reference to a variable that receives the width in pixels.

+

A reference to a variable that receives the height in pixels.

+

This method returns on success, or it returns one of the error codes that are described in the DXGI_ERROR topic.

+ dn384120 + HRESULT IDXGIDecodeSwapChain::GetDestSize([Out] unsigned int* pWidth,[Out] unsigned int* pHeight) + IDXGIDecodeSwapChain::GetDestSize +
+ + +

Sets the color space used by the swap chain.

+
+

A reference to a combination of -typed values that are combined by using a bitwise OR operation. The resulting value specifies the color space to set for the swap chain.

+

This method returns on success, or it returns one of the error codes that are described in the DXGI_ERROR topic.

+ dn384124 + HRESULT IDXGIDecodeSwapChain::SetColorSpace([In] DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS ColorSpace) + IDXGIDecodeSwapChain::SetColorSpace +
+ + +

Gets the color space used by the swap chain.

+
+

A combination of -typed values that are combined by using a bitwise OR operation. The resulting value specifies the color space for the swap chain.

+ dn384119 + DXGI_MULTIPLANE_OVERLAY_YCbCr_FLAGS IDXGIDecodeSwapChain::GetColorSpace() + IDXGIDecodeSwapChain::GetColorSpace +
+ + +

Gets or sets the number of frames that the system is allowed to queue for rendering.

+
+ +

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

Frame latency is the number of frames that are allowed to be stored in a queue before submission for rendering. Latency is often used to control how the CPU chooses between responding to user input and frames that are in the render queue. It is often beneficial for applications that have no user input (for example, video playback) to queue more than 3 frames of data.

+
+ ff471332 + GetMaximumFrameLatency / SetMaximumFrameLatency + GetMaximumFrameLatency +
+ + +

Sets the number of frames that the system is allowed to queue for rendering.

+
+

The maximum number of back buffer frames that a driver can queue. The value defaults to 3, but can range from 1 to 16. A value of 0 will reset latency to the default. For multi-head devices, this value is specified per-head.

+

Returns if successful; otherwise, if the device was removed.

+ +

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

Frame latency is the number of frames that are allowed to be stored in a queue before submission for rendering. Latency is often used to control how the CPU chooses between responding to user input and frames that are in the render queue. It is often beneficial for applications that have no user input (for example, video playback) to queue more than 3 frames of data.

+
+ ff471334 + HRESULT IDXGIDevice1::SetMaximumFrameLatency([In] unsigned int MaxLatency) + IDXGIDevice1::SetMaximumFrameLatency +
+ + +

Gets the number of frames that the system is allowed to queue for rendering.

+
+

This value is set to the number of frames that can be queued for render. This value defaults to 3, but can range from 1 to 16.

+

Returns if successful; otherwise, returns one of the following members of the D3DERR enumerated type:

  • D3DERR_DEVICELOST
  • D3DERR_DEVICEREMOVED
  • D3DERR_DRIVERINTERNALERROR
  • D3DERR_INVALIDCALL
  • D3DERR_OUTOFVIDEOMEMORY
+ +

This method is not supported by DXGI 1.0, which shipped in Windows?Vista and Windows Server?2008. DXGI 1.1 support is required, which is available on Windows?7, Windows Server?2008?R2, and as an update to Windows?Vista with Service Pack?2 (SP2) (KB 971644) and Windows Server?2008 (KB 971512).

Frame latency is the number of frames that are allowed to be stored in a queue before submission for rendering. Latency is often used to control how the CPU chooses between responding to user input and frames that are in the render queue. It is often beneficial for applications that have no user input (for example, video playback) to queue more than 3 frames of data.

+
+ ff471332 + HRESULT IDXGIDevice1::GetMaximumFrameLatency([Out] unsigned int* pMaxLatency) + IDXGIDevice1::GetMaximumFrameLatency +
+ + +

Allows the operating system to free the video memory of resources by discarding their content.

+
+

The number of resources in the ppResources argument array.

+

An array of references to interfaces for the resources to offer.

+

A -typed value that indicates how valuable data is.

+

OfferResources returns:

  • if resources were successfully offered
  • E_INVALIDARG if a resource in the array or the priority is invalid
+ +

The priority value that the Priority parameter specifies describes how valuable the caller considers the content to be. The operating system uses the priority value to discard resources in order of priority. The operating system discards a resource that is offered with low priority before it discards a resource that is offered with a higher priority.

If you call OfferResources to offer a resource while the resource is bound to the pipeline, the resource is unbound. You cannot call OfferResources on a resource that is mapped. After you offer a resource, the resource cannot be mapped or bound to the pipeline until you call the IDXGIDevice2::ReclaimResource method to reclaim the resource. You cannot call OfferResources to offer immutable resources.

To offer shared resources, call OfferResources on only one of the sharing devices. To ensure exclusive access to the resources, you must use an object and then call OfferResources only while you hold the mutex. In fact, you can't offer shared resources unless you use because offering shared resources without using isn't supported.

Note??The user mode display driver might not immediately offer the resources that you specified in a call to OfferResources. The driver can postpone offering them until the next call to IDXGISwapChain::Present, IDXGISwapChain1::Present1, or ID3D11DeviceContext::Flush.?

Platform Update for Windows?7:??The runtime validates that OfferResources is used correctly on non-shared resources but doesn't perform the intended functionality. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+
+ hh404549 + HRESULT IDXGIDevice2::OfferResources([In] unsigned int NumResources,[In, Buffer] const IDXGIResource** ppResources,[In] DXGI_OFFER_RESOURCE_PRIORITY Priority) + IDXGIDevice2::OfferResources +
+ + +

Restores access to resources that were previously offered by calling IDXGIDevice2::OfferResources.

+
+ No documentation. + No documentation. + No documentation. +

ReclaimResources returns:

  • if resources were successfully reclaimed
  • E_INVALIDARG if the resources are invalid
+ +

After you call IDXGIDevice2::OfferResources to offer one or more resources, you must call ReclaimResources before you can use those resources again. You must check the values in the array at pDiscarded to determine whether each resource?s content was discarded. If a resource?s content was discarded while it was offered, its current content is undefined. Therefore, you must overwrite the resource?s content before you use the resource.

To reclaim shared resources, call ReclaimResources only on one of the sharing devices. To ensure exclusive access to the resources, you must use an object and then call ReclaimResources only while you hold the mutex.

Platform Update for Windows?7:??The runtime validates that ReclaimResources is used correctly on non-shared resources but doesn't perform the intended functionality. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+
+ hh404551 + HRESULT IDXGIDevice2::ReclaimResources([In] unsigned int NumResources,[In, Buffer] const IDXGIResource** ppResources,[Out, Buffer, Optional] BOOL* pDiscarded) + IDXGIDevice2::ReclaimResources +
+ + +

Flushes any outstanding rendering commands and sets the specified event object to the signaled state after all previously submitted rendering commands complete.

+
+

A handle to the event object. The CreateEvent or OpenEvent function returns this handle. All types of event objects (manual-reset, auto-reset, and so on) are supported.

The handle must have the EVENT_MODIFY_STATE access right. For more information about access rights, see Synchronization Object Security and Access Rights.

+

Returns if successful; otherwise, returns one of the following values:

  • E_OUTOFMEMORY if insufficient memory is available to complete the operation.
  • E_INVALIDARG if the parameter was validated and determined to be incorrect.

Platform Update for Windows?7:??On Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed, EnqueueSetEvent fails with E_NOTIMPL. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+ +

EnqueueSetEvent calls the SetEvent function on the event object after all previously submitted rendering commands complete or the device is removed.

After an application calls EnqueueSetEvent, it can immediately call the WaitForSingleObject function to put itself to sleep until rendering commands complete.

You cannot use EnqueueSetEvent to determine work completion that is associated with presentation (IDXGISwapChain::Present); instead, we recommend that you use IDXGISwapChain::GetFrameStatistics.

+
+ hh404546 + HRESULT IDXGIDevice2::EnqueueSetEvent([In] void* hEvent) + IDXGIDevice2::EnqueueSetEvent +
+ + +

Allows the operating system to free the video memory of resources by discarding their content.

+
+

The number of resources in the ppResources argument array.

+

An array of references to interfaces for the resources to offer.

+

A -typed value that indicates how valuable data is.

+

OfferResources returns:

  • if resources were successfully offered
  • E_INVALIDARG if a resource in the array or the priority is invalid
+ +

The priority value that the Priority parameter specifies describes how valuable the caller considers the content to be. The operating system uses the priority value to discard resources in order of priority. The operating system discards a resource that is offered with low priority before it discards a resource that is offered with a higher priority.

If you call OfferResources to offer a resource while the resource is bound to the pipeline, the resource is unbound. You cannot call OfferResources on a resource that is mapped. After you offer a resource, the resource cannot be mapped or bound to the pipeline until you call the IDXGIDevice2::ReclaimResource method to reclaim the resource. You cannot call OfferResources to offer immutable resources.

To offer shared resources, call OfferResources on only one of the sharing devices. To ensure exclusive access to the resources, you must use an object and then call OfferResources only while you hold the mutex. In fact, you can't offer shared resources unless you use because offering shared resources without using isn't supported.

Note??The user mode display driver might not immediately offer the resources that you specified in a call to OfferResources. The driver can postpone offering them until the next call to IDXGISwapChain::Present, IDXGISwapChain1::Present1, or ID3D11DeviceContext::Flush.?

Platform Update for Windows?7:??The runtime validates that OfferResources is used correctly on non-shared resources but doesn't perform the intended functionality. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+
+ hh404549 + HRESULT IDXGIDevice2::OfferResources([In] unsigned int NumResources,[In, Buffer] const IDXGIResource** ppResources,[In] DXGI_OFFER_RESOURCE_PRIORITY Priority) + IDXGIDevice2::OfferResources +
+ + +

Allows the operating system to free the video memory of resources by discarding their content.

+
+

The number of resources in the ppResources argument array.

+

An array of references to interfaces for the resources to offer.

+

A -typed value that indicates how valuable data is.

+

OfferResources returns:

  • if resources were successfully offered
  • E_INVALIDARG if a resource in the array or the priority is invalid
+ +

The priority value that the Priority parameter specifies describes how valuable the caller considers the content to be. The operating system uses the priority value to discard resources in order of priority. The operating system discards a resource that is offered with low priority before it discards a resource that is offered with a higher priority.

If you call OfferResources to offer a resource while the resource is bound to the pipeline, the resource is unbound. You cannot call OfferResources on a resource that is mapped. After you offer a resource, the resource cannot be mapped or bound to the pipeline until you call the IDXGIDevice2::ReclaimResource method to reclaim the resource. You cannot call OfferResources to offer immutable resources.

To offer shared resources, call OfferResources on only one of the sharing devices. To ensure exclusive access to the resources, you must use an object and then call OfferResources only while you hold the mutex. In fact, you can't offer shared resources unless you use because offering shared resources without using isn't supported.

Note??The user mode display driver might not immediately offer the resources that you specified in a call to OfferResources. The driver can postpone offering them until the next call to IDXGISwapChain::Present, IDXGISwapChain1::Present1, or ID3D11DeviceContext::Flush.?

Platform Update for Windows?7:??The runtime validates that OfferResources is used correctly on non-shared resources but doesn't perform the intended functionality. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+
+ hh404549 + HRESULT IDXGIDevice2::OfferResources([In] unsigned int NumResources,[In, Buffer] const IDXGIResource** ppResources,[In] DXGI_OFFER_RESOURCE_PRIORITY Priority) + IDXGIDevice2::OfferResources +
+ + +

Restores access to resources that were previously offered by calling IDXGIDevice2::OfferResources.

+
+ No documentation. + No documentation. + No documentation. +

ReclaimResources returns:

  • if resources were successfully reclaimed
  • E_INVALIDARG if the resources are invalid
+ +

After you call IDXGIDevice2::OfferResources to offer one or more resources, you must call ReclaimResources before you can use those resources again. You must check the values in the array at pDiscarded to determine whether each resource?s content was discarded. If a resource?s content was discarded while it was offered, its current content is undefined. Therefore, you must overwrite the resource?s content before you use the resource.

To reclaim shared resources, call ReclaimResources only on one of the sharing devices. To ensure exclusive access to the resources, you must use an object and then call ReclaimResources only while you hold the mutex.

Platform Update for Windows?7:??The runtime validates that ReclaimResources is used correctly on non-shared resources but doesn't perform the intended functionality. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+
+ hh404551 + HRESULT IDXGIDevice2::ReclaimResources([In] unsigned int NumResources,[In, Buffer] const IDXGIResource** ppResources,[Out, Buffer, Optional] BOOL* pDiscarded) + IDXGIDevice2::ReclaimResources +
+ + +

Restores access to resources that were previously offered by calling IDXGIDevice2::OfferResources.

+
+ No documentation. + No documentation. + No documentation. +

ReclaimResources returns:

  • if resources were successfully reclaimed
  • E_INVALIDARG if the resources are invalid
+ +

After you call IDXGIDevice2::OfferResources to offer one or more resources, you must call ReclaimResources before you can use those resources again. You must check the values in the array at pDiscarded to determine whether each resource?s content was discarded. If a resource?s content was discarded while it was offered, its current content is undefined. Therefore, you must overwrite the resource?s content before you use the resource.

To reclaim shared resources, call ReclaimResources only on one of the sharing devices. To ensure exclusive access to the resources, you must use an object and then call ReclaimResources only while you hold the mutex.

Platform Update for Windows?7:??The runtime validates that ReclaimResources is used correctly on non-shared resources but doesn't perform the intended functionality. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+
+ hh404551 + HRESULT IDXGIDevice2::ReclaimResources([In] unsigned int NumResources,[In, Buffer] const IDXGIResource** ppResources,[Out, Buffer, Optional] BOOL* pDiscarded) + IDXGIDevice2::ReclaimResources +
+ + +

Trims the graphics memory allocated by the DXGI device on the app's behalf.

For apps that render with DirectX, graphics drivers periodically allocate internal memory buffers in order to speed up subsequent rendering requests. These memory allocations count against the app's memory usage for PLM and in general lead to increased memory usage by the overall system.

Starting in Windows?8.1, apps that render with Direct2D and/or Direct3D (including CoreWindow and XAML interop) must call Trim in response to the PLM suspend callback. The Direct3D runtime and the graphics driver will discard internal memory buffers allocated for the app, reducing its memory footprint.

Calling this method does not change the rendering state of the graphics device and it has no effect on rendering operations. There is a brief performance hit when internal buffers are reallocated during the first rendering operations after the Trim call, therefore apps should only call Trim when going idle for a period of time (in response to PLM suspend, for example).

Apps should ensure that they call Trim as one of the last D3D operations done before going idle. Direct3D will normally defer the destruction of D3D objects. Calling Trim, however, forces Direct3D to destroy objects immediately. For this reason, it is not guaranteed that releasing the final reference on Direct3D objects after calling Trim will cause the object to be destroyed and memory to be deallocated before the app suspends.

Similar to ID3D11DeviceContext::Flush, apps should call ID3D11DeviceContext::ClearState before calling Trim. ClearState clears the Direct3D pipeline bindings, ensuring that Direct3D does not hold any references to the Direct3D objects you are trying to release.

It is also prudent to release references on middleware before calling Trim, as that middleware may also need to release references + to Direct3D objects.

+
+ dn280346 + void IDXGIDevice3::Trim() + IDXGIDevice3::Trim +
+ + +

Allows the operating system to free the video memory of resources, including both discarding the content and de-committing the memory.

+
+

The number of resources in the ppResources argument array.

+

An array of references to interfaces for the resources to offer.

+

A -typed value that indicates how valuable data is.

+

Specifies the .

+

This method returns an success or error code, which can include E_INVALIDARG if a resource in the array, or the priority, is invalid.

+ +

OfferResources1 (an extension of the original IDXGIDevice2::OfferResources API) enables D3D based applications to allow de-committing of an allocation?s backing store to reduce system commit under low memory conditions. + A de-committed allocation cannot be reused, so opting in to the new DXGI_OFFER_RESOURCE_FLAG_ALLOW_DECOMMIT flag means the new reclaim results must be properly handled. Refer to the flag descriptions in and the Example below.

OfferResources1 and ReclaimResources1 may not be used interchangeably with OfferResources and ReclaimResources. +

The priority value that the Priority parameter specifies describes how valuable the caller considers the content to be. The operating system uses the priority value to discard resources in order of priority. The operating system discards a resource that is offered with low priority before it discards a resource that is offered with a higher priority.

If you call OfferResources1 to offer a resource while the resource is bound to the pipeline, the resource is unbound. You cannot call OfferResources1 on a resource that is mapped. After you offer a resource, the resource cannot be mapped or bound to the pipeline until you call the ReclaimResources1 method to reclaim the resource. You cannot call OfferResources1 to offer immutable resources.

To offer shared resources, call OfferResources1 on only one of the sharing devices. To ensure exclusive access to the resources, you must use an object and then call OfferResources1 only while you hold the mutex. In fact, you can't offer shared resources unless you use because offering shared resources without using isn't supported.

The user mode display driver might not immediately offer the resources that you specified in a call to OfferResources1. The driver can postpone offering them until the next call to IDXGISwapChain::Present, IDXGISwapChain1::Present1, or ID3D11DeviceContext::Flush.

+
+ mt732705 + HRESULT IDXGIDevice4::OfferResources1([In] unsigned int NumResources,[In, Buffer] const IDXGIResource** ppResources,[In] DXGI_OFFER_RESOURCE_PRIORITY Priority,[In] unsigned int Flags) + IDXGIDevice4::OfferResources1 +
+ + +

Restores access to resources that were previously offered by calling IDXGIDevice4::OfferResources1.

+
+ No documentation. + No documentation. + No documentation. +

This method returns an success or error code, including E_INVALIDARG if the resources are invalid.

+ +

After you call OfferResources1 to offer one or more resources, you must call ReclaimResources1 before you can use those resources again.

To reclaim shared resources, call ReclaimResources1 only on one of the sharing devices. To ensure exclusive access to the resources, you must use an object and then call ReclaimResources1 only while you hold the mutex.

+
+ mt732706 + HRESULT IDXGIDevice4::ReclaimResources1([In] unsigned int NumResources,[In, Buffer] const IDXGIResource** ppResources,[Out, Buffer] DXGI_RECLAIM_RESOURCE_RESULTS* pResults) + IDXGIDevice4::ReclaimResources1 +
+ + +

Allows the operating system to free the video memory of resources, including both discarding the content and de-committing the memory.

+
+

The number of resources in the ppResources argument array.

+

An array of references to interfaces for the resources to offer.

+

A -typed value that indicates how valuable data is.

+

Specifies the .

+

This method returns an success or error code, which can include E_INVALIDARG if a resource in the array, or the priority, is invalid.

+ +

OfferResources1 (an extension of the original IDXGIDevice2::OfferResources API) enables D3D based applications to allow de-committing of an allocation?s backing store to reduce system commit under low memory conditions. + A de-committed allocation cannot be reused, so opting in to the new DXGI_OFFER_RESOURCE_FLAG_ALLOW_DECOMMIT flag means the new reclaim results must be properly handled. Refer to the flag descriptions in and the Example below.

OfferResources1 and ReclaimResources1 may not be used interchangeably with OfferResources and ReclaimResources. +

The priority value that the Priority parameter specifies describes how valuable the caller considers the content to be. The operating system uses the priority value to discard resources in order of priority. The operating system discards a resource that is offered with low priority before it discards a resource that is offered with a higher priority.

If you call OfferResources1 to offer a resource while the resource is bound to the pipeline, the resource is unbound. You cannot call OfferResources1 on a resource that is mapped. After you offer a resource, the resource cannot be mapped or bound to the pipeline until you call the ReclaimResources1 method to reclaim the resource. You cannot call OfferResources1 to offer immutable resources.

To offer shared resources, call OfferResources1 on only one of the sharing devices. To ensure exclusive access to the resources, you must use an object and then call OfferResources1 only while you hold the mutex. In fact, you can't offer shared resources unless you use because offering shared resources without using isn't supported.

The user mode display driver might not immediately offer the resources that you specified in a call to OfferResources1. The driver can postpone offering them until the next call to IDXGISwapChain::Present, IDXGISwapChain1::Present1, or ID3D11DeviceContext::Flush.

+
+ mt732705 + HRESULT IDXGIDevice4::OfferResources1([In] unsigned int NumResources,[In, Buffer] const IDXGIResource** ppResources,[In] DXGI_OFFER_RESOURCE_PRIORITY Priority,[In] unsigned int Flags) + IDXGIDevice4::OfferResources1 +
+ + +

Allows the operating system to free the video memory of resources, including both discarding the content and de-committing the memory.

+
+

The number of resources in the ppResources argument array.

+

An array of references to interfaces for the resources to offer.

+

A -typed value that indicates how valuable data is.

+

Specifies the .

+

This method returns an success or error code, which can include E_INVALIDARG if a resource in the array, or the priority, is invalid.

+ +

OfferResources1 (an extension of the original IDXGIDevice2::OfferResources API) enables D3D based applications to allow de-committing of an allocation?s backing store to reduce system commit under low memory conditions. + A de-committed allocation cannot be reused, so opting in to the new DXGI_OFFER_RESOURCE_FLAG_ALLOW_DECOMMIT flag means the new reclaim results must be properly handled. Refer to the flag descriptions in and the Example below.

OfferResources1 and ReclaimResources1 may not be used interchangeably with OfferResources and ReclaimResources. +

The priority value that the Priority parameter specifies describes how valuable the caller considers the content to be. The operating system uses the priority value to discard resources in order of priority. The operating system discards a resource that is offered with low priority before it discards a resource that is offered with a higher priority.

If you call OfferResources1 to offer a resource while the resource is bound to the pipeline, the resource is unbound. You cannot call OfferResources1 on a resource that is mapped. After you offer a resource, the resource cannot be mapped or bound to the pipeline until you call the ReclaimResources1 method to reclaim the resource. You cannot call OfferResources1 to offer immutable resources.

To offer shared resources, call OfferResources1 on only one of the sharing devices. To ensure exclusive access to the resources, you must use an object and then call OfferResources1 only while you hold the mutex. In fact, you can't offer shared resources unless you use because offering shared resources without using isn't supported.

The user mode display driver might not immediately offer the resources that you specified in a call to OfferResources1. The driver can postpone offering them until the next call to IDXGISwapChain::Present, IDXGISwapChain1::Present1, or ID3D11DeviceContext::Flush.

+
+ mt732705 + HRESULT IDXGIDevice4::OfferResources1([In] unsigned int NumResources,[In, Buffer] const IDXGIResource** ppResources,[In] DXGI_OFFER_RESOURCE_PRIORITY Priority,[In] unsigned int Flags) + IDXGIDevice4::OfferResources1 +
+ + +

Restores access to resources that were previously offered by calling IDXGIDevice4::OfferResources1.

+
+ No documentation. + No documentation. + No documentation. +

This method returns an success or error code, including E_INVALIDARG if the resources are invalid.

+ +

After you call OfferResources1 to offer one or more resources, you must call ReclaimResources1 before you can use those resources again.

To reclaim shared resources, call ReclaimResources1 only on one of the sharing devices. To ensure exclusive access to the resources, you must use an object and then call ReclaimResources1 only while you hold the mutex.

+
+ mt732706 + HRESULT IDXGIDevice4::ReclaimResources1([In] unsigned int NumResources,[In, Buffer] const IDXGIResource** ppResources,[Out, Buffer] DXGI_RECLAIM_RESOURCE_RESULTS* pResults) + IDXGIDevice4::ReclaimResources1 +
+ + +

Restores access to resources that were previously offered by calling IDXGIDevice4::OfferResources1.

+
+ No documentation. + No documentation. + No documentation. +

This method returns an success or error code, including E_INVALIDARG if the resources are invalid.

+ +

After you call OfferResources1 to offer one or more resources, you must call ReclaimResources1 before you can use those resources again.

To reclaim shared resources, call ReclaimResources1 only on one of the sharing devices. To ensure exclusive access to the resources, you must use an object and then call ReclaimResources1 only while you hold the mutex.

+
+ mt732706 + HRESULT IDXGIDevice4::ReclaimResources1([In] unsigned int NumResources,[In, Buffer] const IDXGIResource** ppResources,[Out, Buffer] DXGI_RECLAIM_RESOURCE_RESULTS* pResults) + IDXGIDevice4::ReclaimResources1 +
+ + +

Retrieves a Boolean value that indicates whether the operating system's stereoscopic 3D display behavior is enabled.

+
+ +

You pass a Boolean value to the IDXGIDisplayControl::SetStereoEnabled method to either enable or disable the operating system's stereoscopic 3D display behavior. TRUE enables the operating system's stereoscopic 3D display behavior and disables it.

+
+ hh404553 + IsStereoEnabled + IsStereoEnabled +
+ + +

Set a Boolean value to either enable or disable the operating system's stereoscopic 3D display behavior.

+
+ +

Platform Update for Windows?7:??On Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed, SetStereoEnabled doesn't change stereoscopic 3D display behavior because stereoscopic 3D display behavior isn?t available with the Platform Update for Windows?7. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+
+ hh404554 + SetStereoEnabled + SetStereoEnabled +
+ + +

Retrieves a Boolean value that indicates whether the operating system's stereoscopic 3D display behavior is enabled.

+
+

IsStereoEnabled returns TRUE when the operating system's stereoscopic 3D display behavior is enabled and when this behavior is disabled.

Platform Update for Windows?7:??On Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed, IsStereoEnabled always returns because stereoscopic 3D display behavior isn?t available with the Platform Update for Windows?7. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+ +

You pass a Boolean value to the IDXGIDisplayControl::SetStereoEnabled method to either enable or disable the operating system's stereoscopic 3D display behavior. TRUE enables the operating system's stereoscopic 3D display behavior and disables it.

+
+ hh404553 + BOOL IDXGIDisplayControl::IsStereoEnabled() + IDXGIDisplayControl::IsStereoEnabled +
+ + +

Set a Boolean value to either enable or disable the operating system's stereoscopic 3D display behavior.

+
+

A Boolean value that either enables or disables the operating system's stereoscopic 3D display behavior. TRUE enables the operating system's stereoscopic 3D display behavior and disables it.

+ +

Platform Update for Windows?7:??On Windows?7 or Windows Server?2008?R2 with the Platform Update for Windows?7 installed, SetStereoEnabled doesn't change stereoscopic 3D display behavior because stereoscopic 3D display behavior isn?t available with the Platform Update for Windows?7. For more info about the Platform Update for Windows?7, see Platform Update for Windows 7.

+
+ hh404554 + void IDXGIDisplayControl::SetStereoEnabled([In] BOOL enabled) + IDXGIDisplayControl::SetStereoEnabled +
+ + +

Gets the flags that were used when a Microsoft DirectX Graphics Infrastructure (DXGI) object was created.

+
+ +

The GetCreationFlags method returns flags that were passed to the CreateDXGIFactory2 function, or were implicitly constructed by CreateDXGIFactory, CreateDXGIFactory1, D3D11CreateDevice, or D3D11CreateDeviceAndSwapChain.

+
+ dn457943 + GetCreationFlags + GetCreationFlags +
+ + +

Gets the flags that were used when a Microsoft DirectX Graphics Infrastructure (DXGI) object was created.

+
+

The creation flags.

+ +

The GetCreationFlags method returns flags that were passed to the CreateDXGIFactory2 function, or were implicitly constructed by CreateDXGIFactory, CreateDXGIFactory1, D3D11CreateDevice, or D3D11CreateDeviceAndSwapChain.

+
+ dn457943 + unsigned int IDXGIFactory3::GetCreationFlags() + IDXGIFactory3::GetCreationFlags +
+ + +

Used to check for hardware feature support.

+
+

Specifies one member of to query support for.

+

Specifies a reference to a buffer that will be filled with data that describes the feature support.

+

The size, in bytes, of pFeatureSupportData.

+

This method returns an success or error code.

+ +

Refer to the description of DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING.

+
+ mt722567 + HRESULT IDXGIFactory5::CheckFeatureSupport([In] DXGI_FEATURE Feature,[Out, Buffer] void* pFeatureSupportData,[In] unsigned int FeatureSupportDataSize) + IDXGIFactory5::CheckFeatureSupport +
+ + +

Creates a YUV swap chain for an existing DirectComposition surface handle.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

CreateSwapChainForCompositionSurfaceHandle returns:

  • if it successfully created a swap chain.
  • E_OUTOFMEMORY if memory is unavailable to complete the operation.
  • if the calling application provided invalid data, for example, if pDesc, pYuvDecodeBuffers, or ppSwapChain is null.
  • Possibly other error codes that are described in the DXGI_ERROR topic that are defined by the type of device that you pass to pDevice.
+ dn384130 + HRESULT IDXGIFactoryMedia::CreateSwapChainForCompositionSurfaceHandle([In] IUnknown* pDevice,[In, Optional] void* hSurface,[In] const DXGI_SWAP_CHAIN_DESC1* pDesc,[In, Optional] IDXGIOutput* pRestrictToOutput,[Out] IDXGISwapChain1** ppSwapChain) + IDXGIFactoryMedia::CreateSwapChainForCompositionSurfaceHandle +
+ + +

Creates a YUV swap chain for an existing DirectComposition surface handle. The swap chain is created with pre-existing buffers and very few descriptive elements are required. Instead, this method requires a DirectComposition surface handle and an buffer to hold decoded frame data. The swap chain format is determined by the format of the subresources of the .

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

CreateDecodeSwapChainForCompositionSurfaceHandle returns:

  • if it successfully created a swap chain.
  • E_OUTOFMEMORY if memory is unavailable to complete the operation.
  • if the calling application provided invalid data, for example, if pDesc, pYuvDecodeBuffers, or ppSwapChain is null.
  • Possibly other error codes that are described in the DXGI_ERROR topic that are defined by the type of device that you pass to pDevice.
+ +

The provided via the pYuvDecodeBuffers parameter must point to at least one subresource, and all subresources must be created with the D3D11_BIND_DECODER flag.

+
+ dn384129 + HRESULT IDXGIFactoryMedia::CreateDecodeSwapChainForCompositionSurfaceHandle([In] IUnknown* pDevice,[In, Optional] void* hSurface,[In] DXGI_DECODE_SWAP_CHAIN_DESC* pDesc,[In] IDXGIResource* pYuvDecodeBuffers,[In, Optional] IDXGIOutput* pRestrictToOutput,[Out] IDXGIDecodeSwapChain** ppSwapChain) + IDXGIFactoryMedia::CreateDecodeSwapChainForCompositionSurfaceHandle +
+ + +

Flushes all current GPU work for all SurfaceImageSource or VirtualSurfaceImageSource objects associated with the given device.

+
+ No documentation. +

If this method succeeds, it returns . Otherwise, it returns an error code.

+ +

The FlushAllSurfacesWithDevice method flushes current GPU work for all SurfaceImageSource objects that were created with device. This GPU work includes Direct2D rendering work and internal GPU work done by the framework associated with rendering. This is useful if an application has created multiple SurfaceImageSource objects and needs to flush the GPU work for all of these surfaces from the background rendering thread. By flushing this work from the background thread the work can be better parallelized, with work being done on the UI thread to improve performance.

You can call the FlushAllSurfacesWithDevice method from a non-UI thread.

+
+ dn448960 + HRESULT ISurfaceImageSourceManagerNative::FlushAllSurfacesWithDevice([In] IUnknown* device) + ISurfaceImageSourceManagerNative::FlushAllSurfacesWithDevice +
+ + +

Sets the DXGI device, created with D3D11_CREATE_DEVICE_BGRA_SUPPORT, that will draw the surface. This method must be called from the UI thread.

+
+ hh848325 + SetDevice + SetDevice +
+ + +

Sets the DXGI device, created with D3D11_CREATE_DEVICE_BGRA_SUPPORT, that will draw the surface. This method must be called from the UI thread.

+
+

Pointer to the DXGI device interface.

+

If this method succeeds, it returns . Otherwise, it returns an error code.

+ hh848325 + HRESULT ISurfaceImageSourceNative::SetDevice([In] IDXGIDevice* device) + ISurfaceImageSourceNative::SetDevice +
+ + +

Opens the supplied DXGI surface for drawing.

+
+

The region of the surface that will be drawn into.

+

Receives the point (x,y) offset of the surface that will be drawn into.

+

Receives a reference to the surface for drawing.

+ +

If the app window that contains the SurfaceImageSource isn't active, like when it's suspended, calling the BeginDraw method returns an error.

+
+ hh848323 + HRESULT ISurfaceImageSourceNative::BeginDraw([In] RECT updateRect,[Out] IDXGISurface** surface,[Out] POINT* offset) + ISurfaceImageSourceNative::BeginDraw +
+ + +

Closes the surface draw operation.

+
+

If this method succeeds, it returns . Otherwise, it returns an error code.

+ hh848324 + HRESULT ISurfaceImageSourceNative::EndDraw() + ISurfaceImageSourceNative::EndDraw +
+ + +

Sets the Microsoft DirectX Graphics Infrastructure (DXGI) or Direct2D device, created with D3D11_CREATE_DEVICE_BGRA_SUPPORT, that will draw the surface.

+
+ dn302141 + SetDevice + SetDevice +
+ + +

Sets the Microsoft DirectX Graphics Infrastructure (DXGI) or Direct2D device, created with D3D11_CREATE_DEVICE_BGRA_SUPPORT, that will draw the surface.

+
+

Pointer to the DXGI device interface. You can pass an to signal that this surface participates in Direct2D batching to improve performance when updating Direct2D content across multiple surfaces. The device must have multithreading supported enabled if the app draws to the surface from a background thread.

+

This method fails when the SurfaceImageSource is larger than the maximum texture size supported by the Direct3D device. Apps should use VirtualSurfaceImageSource for surfaces larger than the maximum texture size supported by the Direct3D device.

+ dn302141 + HRESULT ISurfaceImageSourceNativeWithD2D::SetDevice([In] IUnknown* device) + ISurfaceImageSourceNativeWithD2D::SetDevice +
+ + +

Initiates an update to the associated SurfaceImageSource or VirtualSurfaceImageSource.

+
+ No documentation. + No documentation. + No documentation. + No documentation. +

If this method succeeds, it returns . Otherwise, it returns an error code.

+ dn302138 + HRESULT ISurfaceImageSourceNativeWithD2D::BeginDraw([In] const RECT& updateRect,[In] const GUID& iid,[Out] void** updateObject,[Out] POINT* offset) + ISurfaceImageSourceNativeWithD2D::BeginDraw +
+ + +

Closes the surface draw operation.

+
+

If this method succeeds, it returns . Otherwise, it returns an error code.

+ +

Always call the EndDraw method on the UI thread in order to synchronize updating the Microsoft DirectX content with the current XAML UI thread frame.

+
+ dn302139 + HRESULT ISurfaceImageSourceNativeWithD2D::EndDraw() + ISurfaceImageSourceNativeWithD2D::EndDraw +
+ + +

Suspends the drawing operation.

+
+

If this method succeeds, it returns . Otherwise, it returns an error code.

+ dn302142 + HRESULT ISurfaceImageSourceNativeWithD2D::SuspendDraw() + ISurfaceImageSourceNativeWithD2D::SuspendDraw +
+ + +

Resume the drawing operation.

+
+

If this method succeeds, it returns . Otherwise, it returns an error code.

+ dn302140 + HRESULT ISurfaceImageSourceNativeWithD2D::ResumeDraw() + ISurfaceImageSourceNativeWithD2D::ResumeDraw +
+ + +

Sets the DirectX swap chain for SwapChainBackgroundPanel.

+
+ hh848327 + SetSwapChain + SetSwapChain +
+ + +

Sets the DirectX swap chain for SwapChainBackgroundPanel.

+
+ No documentation. +

If this method succeeds, it returns . Otherwise, it returns an error code.

+ hh848327 + HRESULT ISwapChainBackgroundPanelNative::SetSwapChain([In] IDXGISwapChain* swapChain) + ISwapChainBackgroundPanelNative::SetSwapChain +
+ + +

Sets the DirectX swap chain for SwapChainPanel.

+
+ dn302144 + SetSwapChain + SetSwapChain +
+ + +

Sets the DirectX swap chain for SwapChainPanel.

+
+ No documentation. +

If this method succeeds, it returns . Otherwise, it returns an error code.

+ dn302144 + HRESULT ISwapChainPanelNative::SetSwapChain([In] IDXGISwapChain* swapChain) + ISwapChainPanelNative::SetSwapChain +
+ + +

Sets the DirectX swap chain for SwapChainPanel using a handle to the swap chain.

+
+ +

SetSwapChain(HANDLE swapChainHandle) allows a swap chain to be rendered by referencing a shared handle to the swap chain. This enables scenarios where a swap chain is created in one process and needs to be passed to another process.

XAML supports setting a DXGI swap chain as the content of a SwapChainPanel element. Apps accomplish this by querying for the interface from a SwapChainPanel instance and calling SetSwapChain( *swapChain).

This process works for references to in process swap chains. However, this doesn?t work for VoIP apps, which use a two-process model to enable continuing calls on a background process when a foreground process is suspended or shut down. This two-process implementation requires the ability to pass a shared handle to a swap chain, rather than a reference, created on the background process to the foreground process to be rendered in a XAML SwapChainPanel in the foreground app.

 <!-- XAML markup --> 
+            <Page>  <SwapChainPanel x:Name=?captureStreamDisplayPanel? /> 
+            </Page>  // Definitions 
+            ComPtr<> m_swapChain; 
+            HANDLE m_swapChainHandle; 
+            ComPtr<> m_d3dDevice; 
+            ComPtr<> dxgiAdapter; 
+            ComPtr<> dxgiFactory; 
+            ComPtr<> dxgiFactoryMedia; 
+            ComPtr<> dxgiDevice; 
+             swapChainDesc = {0};  // Get DXGI factory (assume standard boilerplate has created D3D11Device) 
+            m_d3dDevice.As(&dxgiDevice); 
+            dxgiDevice->GetAdapter(&dxgiAdapter); 
+            dxgiAdapter->GetParent(__uuidof(), &dxgiFactory);  // Create swap chain and get handle 
+            DCompositionCreateSurfaceHandle(GENERIC_ALL, nullptr, &m_swapChainHandle); 
+            dxgiFactory.As(&dxgiFactoryMedia); 
+            dxgiFactoryMedia->CreateSwapChainForCompositionSurfaceHandle(  m_d3dDevice.Get(),  m_swapChainHandle,  &swapChainDesc,  nullptr,  &m_swapChain 
+            );  // Set swap chain to display in a SwapChainPanel 
+            ComPtr<> panelNative; 
+            reinterpret_cast<*>(captureStreamDisplayPanel)->QueryInterface(IID_PPV_ARGS(&panelNative))); 
+            panelNative->SetSwapChainHandle(m_swapChainHandle);  
+
+ dn858173 + SetSwapChainHandle + SetSwapChainHandle +
+ + +

Sets the DirectX swap chain for SwapChainPanel using a handle to the swap chain.

+
+ No documentation. +

If this method succeeds, it returns . Otherwise, it returns an error code.

+ +

SetSwapChain(HANDLE swapChainHandle) allows a swap chain to be rendered by referencing a shared handle to the swap chain. This enables scenarios where a swap chain is created in one process and needs to be passed to another process.

XAML supports setting a DXGI swap chain as the content of a SwapChainPanel element. Apps accomplish this by querying for the interface from a SwapChainPanel instance and calling SetSwapChain( *swapChain).

This process works for references to in process swap chains. However, this doesn?t work for VoIP apps, which use a two-process model to enable continuing calls on a background process when a foreground process is suspended or shut down. This two-process implementation requires the ability to pass a shared handle to a swap chain, rather than a reference, created on the background process to the foreground process to be rendered in a XAML SwapChainPanel in the foreground app.

 <!-- XAML markup --> 
+            <Page>  <SwapChainPanel x:Name=?captureStreamDisplayPanel? /> 
+            </Page>  // Definitions 
+            ComPtr<> m_swapChain; 
+            HANDLE m_swapChainHandle; 
+            ComPtr<> m_d3dDevice; 
+            ComPtr<> dxgiAdapter; 
+            ComPtr<> dxgiFactory; 
+            ComPtr<> dxgiFactoryMedia; 
+            ComPtr<> dxgiDevice; 
+             swapChainDesc = {0};  // Get DXGI factory (assume standard boilerplate has created D3D11Device) 
+            m_d3dDevice.As(&dxgiDevice); 
+            dxgiDevice->GetAdapter(&dxgiAdapter); 
+            dxgiAdapter->GetParent(__uuidof(), &dxgiFactory);  // Create swap chain and get handle 
+            DCompositionCreateSurfaceHandle(GENERIC_ALL, nullptr, &m_swapChainHandle); 
+            dxgiFactory.As(&dxgiFactoryMedia); 
+            dxgiFactoryMedia->CreateSwapChainForCompositionSurfaceHandle(  m_d3dDevice.Get(),  m_swapChainHandle,  &swapChainDesc,  nullptr,  &m_swapChain 
+            );  // Set swap chain to display in a SwapChainPanel 
+            ComPtr<> panelNative; 
+            reinterpret_cast<*>(captureStreamDisplayPanel)->QueryInterface(IID_PPV_ARGS(&panelNative))); 
+            panelNative->SetSwapChainHandle(m_swapChainHandle);  
+
+ dn858173 + HRESULT ISwapChainPanelNative2::SetSwapChainHandle([In] void* swapChainHandle) + ISwapChainPanelNative2::SetSwapChainHandle +
+ + +

Using a key, acquires exclusive rendering access to a shared resource.

+
+

A value that indicates which device to give access to. This method will succeed when the device that currently owns the surface calls the IDXGIKeyedMutex::ReleaseSync method using the same value. This value can be any UINT64 value.

+

The time-out interval, in milliseconds. This method will return if the interval elapses, and the keyed mutex has not been released using the specified Key. If this value is set to zero, the AcquireSync method will test to see if the keyed mutex has been released and returns immediately. If this value is set to INFINITE, the time-out interval will never elapse.

+

Return if successful.

If the owning device attempted to create another keyed mutex on the same shared resource, AcquireSync returns E_FAIL.

AcquireSync can also return the following constants. Therefore, you should explicitly check for these constants. If you only use the SUCCEEDED macro on the return value to determine if AcquireSync succeeded, you will not catch these constants.

  • WAIT_ABANDONED - The shared surface and keyed mutex are no longer in a consistent state. If AcquireSync returns this value, you should release and recreate both the keyed mutex and the shared surface.
  • WAIT_TIMEOUT - The time-out interval elapsed before the specified key was released.
+ +

The AcquireSync method creates a lock to a surface that is shared between multiple devices, allowing only one device to render to a surface at a time. This method uses a key to determine which device currently has exclusive access to the surface.

When a surface is created using the D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX value of the D3D10_RESOURCE_MISC_FLAG enumeration, you must call the AcquireSync method before rendering to the surface. You must call the ReleaseSync method when you are done rendering to a surface.

To acquire a reference to the keyed mutex object of a shared resource, call the QueryInterface method of the resource and pass in the UUID of the interface. For more information about acquiring this reference, see the following code example.

The AcquireSync method uses the key as follows, depending on the state of the surface:

  • On initial creation, the surface is unowned and any device can call the AcquireSync method to gain access. For an unowned device, only a key of 0 will succeed. Calling the AcquireSync method for any other key will stall the calling CPU thread.
  • If the surface is owned by a device when you call the AcquireSync method, the CPU thread that called the AcquireSync method will stall until the owning device calls the ReleaseSync method using the same Key.
  • If the surface is unowned when you call the AcquireSync method (for example, the last owning device has already called the ReleaseSync method), the AcquireSync method will succeed if you specify the same key that was specified when the ReleaseSync method was last called. Calling the AcquireSync method using any other key will cause a stall.
  • When the owning device calls the ReleaseSync method with a particular key, and more than one device is waiting after calling the AcquireSync method using the same key, any one of the waiting devices could be woken up first. The order in which devices are woken up is undefined.
  • A keyed mutex does not support recursive calls to the AcquireSync method.
+
+ ff471339 + HRESULT IDXGIKeyedMutex::AcquireSync([In] unsigned longlong Key,[In] DWORD dwMilliseconds) + IDXGIKeyedMutex::AcquireSync +
+ + +

Using a key, releases exclusive rendering access to a shared resource.

+
+

A value that indicates which device to give access to. This method succeeds when the device that currently owns the surface calls the ReleaseSync method using the same value. This value can be any UINT64 value.

+

Returns if successful.

If the device attempted to release a keyed mutex that is not valid or owned by the device, ReleaseSync returns E_FAIL.

+ +

The ReleaseSync method releases a lock to a surface that is shared between multiple devices. This method uses a key to determine which device currently has exclusive access to the surface.

When a surface is created using the D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX value of the D3D10_RESOURCE_MISC_FLAG enumeration, you must call the IDXGIKeyedMutex::AcquireSync method before rendering to the surface. You must call the ReleaseSync method when you are done rendering to a surface.

After you call the ReleaseSync method, the shared resource is unset from the rendering pipeline.

To acquire a reference to the keyed mutex object of a shared resource, call the QueryInterface method of the resource and pass in the UUID of the interface. For more information about acquiring this reference, see the following code example.

+
+ ff471340 + HRESULT IDXGIKeyedMutex::ReleaseSync([In] unsigned longlong Key) + IDXGIKeyedMutex::ReleaseSync +
+ + +

Checks for overlay support.

+
+

A -typed value for the color format.

+

A reference to the Direct3D device interface. CheckOverlaySupport returns only support info about this scan-out device.

+

A reference to a variable that receives a combination of -typed values that are combined by using a bitwise OR operation. The resulting value specifies options for overlay support.

+ dn903670 + HRESULT IDXGIOutput3::CheckOverlaySupport([In] DXGI_FORMAT EnumFormat,[In] IUnknown* pConcernedDevice,[Out] unsigned int* pFlags) + IDXGIOutput3::CheckOverlaySupport +
+ + +

Checks for overlay color space support.

+
+

A -typed value for the color format.

+

A -typed value that specifies color space type to check overlay support for.

+

A reference to the Direct3D device interface. CheckOverlayColorSpaceSupport returns only support info about this scan-out device.

+

A reference to a variable that receives a combination of -typed values that are combined by using a bitwise OR operation. The resulting value specifies options for overlay color space support.

+ dn903672 + HRESULT IDXGIOutput4::CheckOverlayColorSpaceSupport([In] DXGI_FORMAT Format,[In] DXGI_COLOR_SPACE_TYPE ColorSpace,[In] IUnknown* pConcernedDevice,[Out] unsigned int* pFlags) + IDXGIOutput4::CheckOverlayColorSpaceSupport +
+ + +

Allows specifying a list of supported formats for fullscreen surfaces that can be returned by the object.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + +

This method allows directly receiving the original back buffer format used by a running fullscreen application. For comparison, using the original DuplicateOutput function always converts the fullscreen surface to a 32-bit BGRA format. In cases where the current fullscreen application is using a different buffer format, a conversion to 32-bit BGRA incurs a performance penalty. Besides the performance benefit of being able to skip format conversion, using DuplicateOutput1 also allows receiving the full gamut of colors in cases where a high-color format (such as R10G10B10A2) is being presented.

The pSupportedFormats array should only contain display scan-out formats. See Format Support for Direct3D Feature Level 11.0 Hardware for required scan-out formats at each feature level. If the current fullscreen buffer format is not contained in the pSupportedFormats array, DXGI will pick one of the supplied formats and convert the fullscreen buffer to that format before returning from IDXGIOutputDuplication::AcquireNextFrame. The list of supported formats should always contain DXGI_FORMAT_B8G8R8A8_UNORM, as this is the most common format for the desktop. +

+
+ mt679496 + HRESULT IDXGIOutput5::DuplicateOutput1([In] IUnknown* pDevice,[In] unsigned int Flags,[In] unsigned int SupportedFormatsCount,[In, Buffer] const DXGI_FORMAT* pSupportedFormats,[Out] IDXGIOutputDuplication** ppOutputDuplication) + IDXGIOutput5::DuplicateOutput1 +
+ + + No documentation. + + GetDesc1 + GetDesc1 + + + + No documentation. + + No documentation. + No documentation. + HRESULT IDXGIOutput6::GetDesc1([Out] DXGI_OUTPUT_DESC1* pDesc) + IDXGIOutput6::GetDesc1 + + + + No documentation. + + No documentation. + No documentation. + HRESULT IDXGIOutput6::CheckHardwareCompositionSupport([Out] unsigned int* pFlags) + IDXGIOutput6::CheckHardwareCompositionSupport + + + +

[Starting with Direct3D 11.1, we recommend not to use GetSharedHandle anymore to retrieve the handle to a shared resource. Instead, use IDXGIResource1::CreateSharedHandle to get a handle for sharing. To use IDXGIResource1::CreateSharedHandle, you must create the resource as shared and specify that it uses NT handles (that is, you set the D3D11_RESOURCE_MISC_SHARED_NTHANDLE flag). We also recommend that you create shared resources that use NT handles so you can use CloseHandle, DuplicateHandle, and so on on those shared resources.]

Gets the handle to a shared resource.

+
+ +

GetSharedHandle returns a handle for the resource that you created as shared (that is, you set the D3D11_RESOURCE_MISC_SHARED with or without the D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX flag). You can pass this handle to the ID3D11Device::OpenSharedResource method to give another device access to the shared resource. You can also marshal this handle to another process to share a resource with a device in another process. However, this handle is not an NT handle. Therefore, don't use the handle with CloseHandle, DuplicateHandle, and so on.

The creator of a shared resource must not destroy the resource until all intended entities have opened the resource. The validity of the handle is tied to the lifetime of the underlying video memory. If no resource objects exist on any devices that refer to this resource, the handle is no longer valid. To extend the lifetime of the handle and video memory, you must open the shared resource on a device.

GetSharedHandle can also return handles for resources that were passed into ID3D11Device::OpenSharedResource to open those resources.

GetSharedHandle fails if the resource to which it wants to get a handle is not shared.

+
+ bb174562 + GetSharedHandle + GetSharedHandle +
+ + +

Get or sets the eviction priority.

+
+ +

The eviction priority is a memory-management variable that is used by DXGI to determine how to manage overcommitted memory.

Priority levels other than the defined values are used when appropriate. For example, a resource with a priority level of 0x78000001 indicates that the resource is slightly above normal.

+
+ bb174561 + GetEvictionPriority / SetEvictionPriority + GetEvictionPriority +
+ + +

[Starting with Direct3D 11.1, we recommend not to use GetSharedHandle anymore to retrieve the handle to a shared resource. Instead, use IDXGIResource1::CreateSharedHandle to get a handle for sharing. To use IDXGIResource1::CreateSharedHandle, you must create the resource as shared and specify that it uses NT handles (that is, you set the D3D11_RESOURCE_MISC_SHARED_NTHANDLE flag). We also recommend that you create shared resources that use NT handles so you can use CloseHandle, DuplicateHandle, and so on on those shared resources.]

Gets the handle to a shared resource.

+
+ No documentation. +

Returns one of the DXGI_ERROR values.

+ +

GetSharedHandle returns a handle for the resource that you created as shared (that is, you set the D3D11_RESOURCE_MISC_SHARED with or without the D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX flag). You can pass this handle to the ID3D11Device::OpenSharedResource method to give another device access to the shared resource. You can also marshal this handle to another process to share a resource with a device in another process. However, this handle is not an NT handle. Therefore, don't use the handle with CloseHandle, DuplicateHandle, and so on.

The creator of a shared resource must not destroy the resource until all intended entities have opened the resource. The validity of the handle is tied to the lifetime of the underlying video memory. If no resource objects exist on any devices that refer to this resource, the handle is no longer valid. To extend the lifetime of the handle and video memory, you must open the shared resource on a device.

GetSharedHandle can also return handles for resources that were passed into ID3D11Device::OpenSharedResource to open those resources.

GetSharedHandle fails if the resource to which it wants to get a handle is not shared.

+
+ bb174562 + HRESULT IDXGIResource::GetSharedHandle([Out] void** pSharedHandle) + IDXGIResource::GetSharedHandle +
+ + +

Get the expected resource usage.

+
+

A reference to a usage flag (see DXGI_USAGE). For Direct3D 10, a surface can be used as a shader input or a render-target output.

+

Returns one of the following DXGI_ERROR.

+ bb174563 + HRESULT IDXGIResource::GetUsage([In] unsigned int* pUsage) + IDXGIResource::GetUsage +
+ + +

Set the priority for evicting the resource from memory.

+
+

The priority is one of the following values:

ValueMeaning
DXGI_RESOURCE_PRIORITY_MINIMUM (0x28000000)

The resource is unused and can be evicted as soon as another resource requires the memory that the resource occupies.

DXGI_RESOURCE_PRIORITY_LOW (0x50000000)

The eviction priority of the resource is low. The placement of the resource is not critical, and minimal work is performed to find a location for the resource. For example, if a GPU can render with a vertex buffer from either local or non-local memory with little difference in performance, that vertex buffer is low priority. Other more critical resources (for example, a render target or texture) can then occupy the faster memory.

DXGI_RESOURCE_PRIORITY_NORMAL (0x78000000)

The eviction priority of the resource is normal. The placement of the resource is important, but not critical, for performance. The resource is placed in its preferred location instead of a low-priority resource.

DXGI_RESOURCE_PRIORITY_HIGH (0xa0000000)

The eviction priority of the resource is high. The resource is placed in its preferred location instead of a low-priority or normal-priority resource.

DXGI_RESOURCE_PRIORITY_MAXIMUM (0xc8000000)

The resource is evicted from memory only if there is no other way of resolving the memory requirement.

?

+

Returns one of the following DXGI_ERROR.

+ +

The eviction priority is a memory-management variable that is used by DXGI for determining how to populate overcommitted memory.

You can set priority levels other than the defined values when appropriate. For example, you can set a resource with a priority level of 0x78000001 to indicate that the resource is slightly above normal.

+
+ bb174564 + HRESULT IDXGIResource::SetEvictionPriority([In] unsigned int EvictionPriority) + IDXGIResource::SetEvictionPriority +
+ + +

Get the eviction priority.

+
+

A reference to the eviction priority, which determines when a resource can be evicted from memory.

The following defined values are possible.

ValueMeaning
DXGI_RESOURCE_PRIORITY_MINIMUM (0x28000000)

The resource is unused and can be evicted as soon as another resource requires the memory that the resource occupies.

DXGI_RESOURCE_PRIORITY_LOW (0x50000000)

The eviction priority of the resource is low. The placement of the resource is not critical, and minimal work is performed to find a location for the resource. For example, if a GPU can render with a vertex buffer from either local or non-local memory with little difference in performance, that vertex buffer is low priority. Other more critical resources (for example, a render target or texture) can then occupy the faster memory.

DXGI_RESOURCE_PRIORITY_NORMAL (0x78000000)

The eviction priority of the resource is normal. The placement of the resource is important, but not critical, for performance. The resource is placed in its preferred location instead of a low-priority resource.

DXGI_RESOURCE_PRIORITY_HIGH (0xa0000000)

The eviction priority of the resource is high. The resource is placed in its preferred location instead of a low-priority or normal-priority resource.

DXGI_RESOURCE_PRIORITY_MAXIMUM (0xc8000000)

The resource is evicted from memory only if there is no other way of resolving the memory requirement.

?

+

Returns one of the following DXGI_ERROR.

+ +

The eviction priority is a memory-management variable that is used by DXGI to determine how to manage overcommitted memory.

Priority levels other than the defined values are used when appropriate. For example, a resource with a priority level of 0x78000001 indicates that the resource is slightly above normal.

+
+ bb174561 + HRESULT IDXGIResource::GetEvictionPriority([Out] unsigned int* pEvictionPriority) + IDXGIResource::GetEvictionPriority +
+ + +

Gets the index of the swap chain's current back buffer.

+
+ dn903675 + GetCurrentBackBufferIndex + GetCurrentBackBufferIndex +
+ + +

Sets the color space used by the swap chain.

+
+ dn903676 + SetColorSpace1 + SetColorSpace1 +
+ + +

Gets the index of the swap chain's current back buffer.

+
+

Returns the index of the current back buffer.

+ dn903675 + unsigned int IDXGISwapChain3::GetCurrentBackBufferIndex() + IDXGISwapChain3::GetCurrentBackBufferIndex +
+ + +

Checks the swap chain's support for color space.

+
+

A -typed value that specifies color space type to check support for.

+

A reference to a variable that receives a combination of -typed values that are combined by using a bitwise OR operation. The resulting value specifies options for color space support.

+ dn903674 + HRESULT IDXGISwapChain3::CheckColorSpaceSupport([In] DXGI_COLOR_SPACE_TYPE ColorSpace,[Out] unsigned int* pColorSpaceSupport) + IDXGISwapChain3::CheckColorSpaceSupport +
+ + +

Sets the color space used by the swap chain.

+
+

A -typed value that specifies the color space to set.

+

This method returns on success, or it returns one of the error codes that are described in the DXGI_ERROR topic.

+ dn903676 + HRESULT IDXGISwapChain3::SetColorSpace1([In] DXGI_COLOR_SPACE_TYPE ColorSpace) + IDXGISwapChain3::SetColorSpace1 +
+ + +

Changes the swap chain's back buffer size, format, and number of buffers, where the swap chain was created using a D3D12 command queue as an input device. This should be called when the application window is resized.

+
+

The number of buffers in the swap chain (including all back and front buffers). This number can be different from the number of buffers with which you created the swap chain. This number can't be greater than DXGI_MAX_SWAP_CHAIN_BUFFERS. Set this number to zero to preserve the existing number of buffers in the swap chain. You can't specify less than two buffers for the flip presentation model.

+

The new width of the back buffer. If you specify zero, DXGI will use the width of the client area of the target window. You can't specify the width as zero if you called the IDXGIFactory2::CreateSwapChainForComposition method to create the swap chain for a composition surface.

+

The new height of the back buffer. If you specify zero, DXGI will use the height of the client area of the target window. You can't specify the height as zero if you called the IDXGIFactory2::CreateSwapChainForComposition method to create the swap chain for a composition surface.

+

A -typed value for the new format of the back buffer. Set this value to DXGI_FORMAT_UNKNOWN to preserve the existing format of the back buffer. The flip presentation model supports a more restricted set of formats than the bit-block transfer (bitblt) model.

+

A combination of -typed values that are combined by using a bitwise OR operation. The resulting value specifies options for swap-chain behavior.

+

An array of UINTs, of total size BufferCount, where the value indicates which node the back buffer should be created on. Buffers created using ResizeBuffers1 with a non-null pCreationNodeMask array are visible to all nodes.

+

An array of command queues ( instances), of total size BufferCount. Each queue provided must match the corresponding creation node mask specified in the pCreationNodeMask array. When Present() is called, in addition to rotating to the next buffer for the next frame, the swapchain will also rotate through these command queues. This allows the app to control which queue requires synchronization for a given present operation.

+

Returns if successful; an error code otherwise. For a list of error codes, see DXGI_ERROR.

+ +

This method is only valid to call when the swapchain was created using a D3D12 command queue () as an input device.

When a swapchain is created on a multi-GPU adapter, the backbuffers are all created on node 1 and only a single command queue is supported. ResizeBuffers1 enables applications to create backbuffers on different nodes, allowing a different command queue to be used with each node. These capabilities enable Alternate Frame Rendering (AFR) techniques to be used with the swapchain. See Direct3D 12 Multi-Adapters.

The only difference between IDXGISwapChain::ResizeBuffers in Windows?8 versus Windows?7 is with flip presentation model swap chains that you create with the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL or DXGI_SWAP_EFFECT_FLIP_DISCARD value set. In Windows?8, you must call ResizeBuffers to realize a transition between full-screen mode and windowed mode; otherwise, your next call to the IDXGISwapChain::Present method fails.

Also see the Remarks section in IDXGISwapChain::ResizeBuffers, all of which is relevant to ResizeBuffers1.

+
+ mt403341 + HRESULT IDXGISwapChain3::ResizeBuffers1([In] unsigned int BufferCount,[In] unsigned int Width,[In] unsigned int Height,[In] DXGI_FORMAT Format,[In] unsigned int SwapChainFlags,[In, Buffer] const unsigned int* pCreationNodeMask,[In, Buffer] const IUnknown** ppPresentQueue) + IDXGISwapChain3::ResizeBuffers1 +
+ + +

This method sets High Dynamic Range (HDR) and Wide Color Gamut (WCG) header metadata.

+
+

Specifies one member of the enum.

+

Specifies the size of pMetaData, in bytes.

+

Specifies a void reference that references the metadata, if it exists. Refer to the structure.

+

This method returns an success or error code.

+ +

This method sets metadata to enable a monitor's output to be adjusted depending on its capabilities.

+
+ mt732708 + HRESULT IDXGISwapChain4::SetHDRMetaData([In] DXGI_HDR_METADATA_TYPE Type,[In] unsigned int Size,[In, Buffer, Optional] void* pMetaData) + IDXGISwapChain4::SetHDRMetaData +
+ + +

Queries the system for a structure that indicates whether a custom refresh rate is currently approved by the system.

+
+ dn384133 + GetFrameStatisticsMedia + GetFrameStatisticsMedia +
+ + +

Requests a custom presentation duration (custom refresh rate).

+
+ dn384134 + SetPresentDuration + SetPresentDuration +
+ + +

Queries the system for a structure that indicates whether a custom refresh rate is currently approved by the system.

+
+ No documentation. +

This method returns on success, or a DXGI error code on failure.

+ dn384133 + HRESULT IDXGISwapChainMedia::GetFrameStatisticsMedia([Out] DXGI_FRAME_STATISTICS_MEDIA* pStats) + IDXGISwapChainMedia::GetFrameStatisticsMedia +
+ + +

Requests a custom presentation duration (custom refresh rate).

+
+

The custom presentation duration, specified in hundreds of nanoseconds.

+

This method returns on success, or a DXGI error code on failure.

+ dn384134 + HRESULT IDXGISwapChainMedia::SetPresentDuration([In] unsigned int Duration) + IDXGISwapChainMedia::SetPresentDuration +
+ + +

Queries the graphics driver for a supported frame present duration corresponding to a custom refresh rate.

+
+

Indicates the frame duration to check. This value is the duration of one frame at the desired refresh rate, specified in hundreds of nanoseconds. For example, set this field to 167777 to check for 60 Hz refresh rate support.

+

A variable that will be set to the closest supported frame present duration that's smaller than the requested value, or zero if the device does not support any lower duration.

+

A variable that will be set to the closest supported frame present duration that's larger than the requested value, or zero if the device does not support any higher duration.

+

This method returns on success, or a DXGI error code on failure.

+ +

If the DXGI output adapter does not support custom refresh rates (for example, an external display) then the display driver will set upper and lower bounds to (0, 0).

+
+ dn384132 + HRESULT IDXGISwapChainMedia::CheckPresentDurationSupport([In] unsigned int DesiredPresentDuration,[Out] unsigned int* pClosestSmallerPresentDuration,[Out] unsigned int* pClosestLargerPresentDuration) + IDXGISwapChainMedia::CheckPresentDurationSupport +
+ + +

Describes an adapter (or video card) by using DXGI 1.0.

+
+ +

The structure provides a description of an adapter. This structure is initialized by using the IDXGIAdapter::GetDesc method.

+
+ bb173058 + DXGI_ADAPTER_DESC + DXGI_ADAPTER_DESC +
+ + +

A string that contains the adapter description. On feature level 9 graphics hardware, GetDesc returns ?Software Adapter? for the description string.

+
+ bb173058 + Description + Description +
+ + +

The PCI ID of the hardware vendor. On feature level 9 graphics hardware, GetDesc returns zeros for the PCI ID of the hardware vendor.

+
+ bb173058 + VendorId + VendorId +
+ + +

The PCI ID of the hardware device. On feature level 9 graphics hardware, GetDesc returns zeros for the PCI ID of the hardware device.

+
+ bb173058 + DeviceId + DeviceId +
+ + +

The PCI ID of the sub system. On feature level 9 graphics hardware, GetDesc returns zeros for the PCI ID of the sub system.

+
+ bb173058 + SubSysId + SubSysId +
+ + +

The PCI ID of the revision number of the adapter. On feature level 9 graphics hardware, GetDesc returns zeros for the PCI ID of the revision number of the adapter.

+
+ bb173058 + Revision + Revision +
+ + +

The number of bytes of dedicated video memory that are not shared with the CPU.

+
+ bb173058 + DedicatedVideoMemory + DedicatedVideoMemory +
+ + +

The number of bytes of dedicated system memory that are not shared with the CPU. This memory is allocated from available system memory at boot time.

+
+ bb173058 + DedicatedSystemMemory + DedicatedSystemMemory +
+ + +

The number of bytes of shared system memory. This is the maximum value of system memory that may be consumed by the adapter during operation. Any incidental memory consumed by the driver as it manages and uses video memory is additional.

+
+ bb173058 + SharedSystemMemory + SharedSystemMemory +
+ + +

A unique value that identifies the adapter. See for a definition of the structure. is defined in dxgi.h.

+
+ bb173058 + AdapterLuid + AdapterLuid +
+ + +

Describes an adapter (or video card) using DXGI 1.1.

+
+ +

The structure provides a DXGI 1.1 description of an adapter. This structure is initialized by using the IDXGIAdapter1::GetDesc1 method.

+
+ ff471326 + DXGI_ADAPTER_DESC1 + DXGI_ADAPTER_DESC1 +
+ + +

A string that contains the adapter description. On feature level 9 graphics hardware, GetDesc1 returns ?Software Adapter? for the description string.

+
+ ff471326 + Description + Description +
+ + +

The PCI ID of the hardware vendor. On feature level 9 graphics hardware, GetDesc1 returns zeros for the PCI ID of the hardware vendor.

+
+ ff471326 + VendorId + VendorId +
+ + +

The PCI ID of the hardware device. On feature level 9 graphics hardware, GetDesc1 returns zeros for the PCI ID of the hardware device.

+
+ ff471326 + DeviceId + DeviceId +
+ + +

The PCI ID of the sub system. On feature level 9 graphics hardware, GetDesc1 returns zeros for the PCI ID of the sub system.

+
+ ff471326 + SubSysId + SubSysId +
+ + +

The PCI ID of the revision number of the adapter. On feature level 9 graphics hardware, GetDesc1 returns zeros for the PCI ID of the revision number of the adapter.

+
+ ff471326 + Revision + Revision +
+ + +

The number of bytes of dedicated video memory that are not shared with the CPU.

+
+ ff471326 + DedicatedVideoMemory + DedicatedVideoMemory +
+ + +

The number of bytes of dedicated system memory that are not shared with the CPU. This memory is allocated from available system memory at boot time.

+
+ ff471326 + DedicatedSystemMemory + DedicatedSystemMemory +
+ + +

The number of bytes of shared system memory. This is the maximum value of system memory that may be consumed by the adapter during operation. Any incidental memory consumed by the driver as it manages and uses video memory is additional.

+
+ ff471326 + SharedSystemMemory + SharedSystemMemory +
+ + +

A unique value that identifies the adapter. See for a definition of the structure. is defined in dxgi.h.

+
+ ff471326 + AdapterLuid + AdapterLuid +
+ + +

A value of the enumerated type that describes the adapter type. The DXGI_ADAPTER_FLAG_REMOTE flag is reserved.

+
+ ff471326 + Flags + Flags +
+ + +

Describes an adapter (or video card) that uses Microsoft DirectX Graphics Infrastructure (DXGI) 1.2.

+
+ +

The structure provides a DXGI 1.2 description of an adapter. This structure is initialized by using the IDXGIAdapter2::GetDesc2 method.

+
+ hh404493 + DXGI_ADAPTER_DESC2 + DXGI_ADAPTER_DESC2 +
+ + +

A string that contains the adapter description.

+
+ hh404493 + Description + Description +
+ + +

The PCI ID of the hardware vendor.

+
+ hh404493 + VendorId + VendorId +
+ + +

The PCI ID of the hardware device.

+
+ hh404493 + DeviceId + DeviceId +
+ + +

The PCI ID of the sub system.

+
+ hh404493 + SubSysId + SubSysId +
+ + +

The PCI ID of the revision number of the adapter.

+
+ hh404493 + Revision + Revision +
+ + +

The number of bytes of dedicated video memory that are not shared with the CPU.

+
+ hh404493 + DedicatedVideoMemory + DedicatedVideoMemory +
+ + +

The number of bytes of dedicated system memory that are not shared with the CPU. This memory is allocated from available system memory at boot time.

+
+ hh404493 + DedicatedSystemMemory + DedicatedSystemMemory +
+ + +

The number of bytes of shared system memory. This is the maximum value of system memory that may be consumed by the adapter during operation. Any incidental memory consumed by the driver as it manages and uses video memory is additional.

+
+ hh404493 + SharedSystemMemory + SharedSystemMemory +
+ + +

A unique value that identifies the adapter. See for a definition of the structure. is defined in dxgi.h.

+
+ hh404493 + AdapterLuid + AdapterLuid +
+ + +

A value of the enumerated type that describes the adapter type. The DXGI_ADAPTER_FLAG_REMOTE flag is reserved.

+
+ hh404493 + Flags + Flags +
+ + +

A value of the enumerated type that describes the granularity level at which the GPU can be preempted from performing its current graphics rendering task.

+
+ hh404493 + GraphicsPreemptionGranularity + GraphicsPreemptionGranularity +
+ + +

A value of the enumerated type that describes the granularity level at which the GPU can be preempted from performing its current compute task.

+
+ hh404493 + ComputePreemptionGranularity + ComputePreemptionGranularity +
+ + +

Describes an adapter (or video card) by using DXGI 1.0.

+
+ +

The structure provides a description of an adapter. This structure is initialized by using the IDXGIAdapter::GetDesc method.

+
+ bb173058 + DXGI_ADAPTER_DESC3 + DXGI_ADAPTER_DESC3 +
+ + +

A string that contains the adapter description. On feature level 9 graphics hardware, GetDesc returns ?Software Adapter? for the description string.

+
+ bb173058 + Description + Description +
+ + +

The PCI ID of the hardware vendor. On feature level 9 graphics hardware, GetDesc returns zeros for the PCI ID of the hardware vendor.

+
+ bb173058 + VendorId + VendorId +
+ + +

The PCI ID of the hardware device. On feature level 9 graphics hardware, GetDesc returns zeros for the PCI ID of the hardware device.

+
+ bb173058 + DeviceId + DeviceId +
+ + +

The PCI ID of the sub system. On feature level 9 graphics hardware, GetDesc returns zeros for the PCI ID of the sub system.

+
+ bb173058 + SubSysId + SubSysId +
+ + +

The PCI ID of the revision number of the adapter. On feature level 9 graphics hardware, GetDesc returns zeros for the PCI ID of the revision number of the adapter.

+
+ bb173058 + Revision + Revision +
+ + +

The number of bytes of dedicated video memory that are not shared with the CPU.

+
+ bb173058 + DedicatedVideoMemory + DedicatedVideoMemory +
+ + +

The number of bytes of dedicated system memory that are not shared with the CPU. This memory is allocated from available system memory at boot time.

+
+ bb173058 + DedicatedSystemMemory + DedicatedSystemMemory +
+ + +

The number of bytes of shared system memory. This is the maximum value of system memory that may be consumed by the adapter during operation. Any incidental memory consumed by the driver as it manages and uses video memory is additional.

+
+ bb173058 + SharedSystemMemory + SharedSystemMemory +
+ + +

A unique value that identifies the adapter. See for a definition of the structure. is defined in dxgi.h.

+
+ bb173058 + AdapterLuid + AdapterLuid +
+ + + No documentation. + + bb173058 + Flags + Flags + + + + No documentation. + + bb173058 + GraphicsPreemptionGranularity + GraphicsPreemptionGranularity + + + + No documentation. + + bb173058 + ComputePreemptionGranularity + ComputePreemptionGranularity + + + +

Used with ::CreateDecodeSwapChainForCompositionSurfaceHandle to describe a decode swap chain.

+
+ dn384106 + DXGI_DECODE_SWAP_CHAIN_DESC + DXGI_DECODE_SWAP_CHAIN_DESC +
+ + + No documentation. + + dn384106 + Flags + Flags + + + +

Describes timing and presentation statistics for a frame.

+
+ +

You initialize the structure with the IDXGIOutput::GetFrameStatistics or IDXGISwapChain::GetFrameStatistics method.

You can only use IDXGISwapChain::GetFrameStatistics for swap chains that either use the flip presentation model or draw in full-screen mode. You set the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL value in the SwapEffect member of the structure to specify that the swap chain uses the flip presentation model.

The values in the PresentCount and PresentRefreshCount members indicate information about when a frame was presented on the display screen. You can use these values to determine whether a glitch occurred. The values in the SyncRefreshCount and SyncQPCTime members indicate timing information that you can use for audio and video synchronization or very precise animation. If the swap chain draws in full-screen mode, these values are based on when the computer booted. + If the swap chain draws in windowed mode, these values are based on when the swap chain is created.

+
+ bb173060 + DXGI_FRAME_STATISTICS + DXGI_FRAME_STATISTICS +
+ + +

A value that represents the running total count of times that an image was presented to the monitor since the computer booted.

Note??The number of times that an image was presented to the monitor is not necessarily the same as the number of times that you called IDXGISwapChain::Present or IDXGISwapChain1::Present1. ?
+
+ bb173060 + PresentCount + PresentCount +
+ + +

A value that represents the running total count of v-blanks at which the last image was presented to the monitor and that have happened since the computer booted (for windowed mode, since the swap chain was created).

+
+ bb173060 + PresentRefreshCount + PresentRefreshCount +
+ + +

A value that represents the running total count of v-blanks when the scheduler last sampled the machine time by calling QueryPerformanceCounter and that have happened since the computer booted (for windowed mode, since the swap chain was created).

+
+ bb173060 + SyncRefreshCount + SyncRefreshCount +
+ + +

A value that represents the high-resolution performance counter timer. This value is the same as the value returned by the QueryPerformanceCounter function.

+
+ bb173060 + SyncQPCTime + SyncQPCTime +
+ + +

Reserved. Always returns 0.

+
+ bb173060 + SyncGPUTime + SyncGPUTime +
+ + +

Used to verify system approval for the app's custom present duration (custom refresh rate). Approval should be continuously verified on a frame-by-frame basis.

+
+ +

This structure is used with the GetFrameStatisticsMedia method.

+
+ dn384108 + DXGI_FRAME_STATISTICS_MEDIA + DXGI_FRAME_STATISTICS_MEDIA +
+ + +

A value that represents the running total count of times that an image was presented to the monitor since the computer booted.

Note??The number of times that an image was presented to the monitor is not necessarily the same as the number of times that you called IDXGISwapChain::Present or IDXGISwapChain1::Present1. ?
+
+ dn384108 + PresentCount + PresentCount +
+ + +

A value that represents the running total count of v-blanks at which the last image was presented to the monitor and that have happened since the computer booted (for windowed mode, since the swap chain was created).

+
+ dn384108 + PresentRefreshCount + PresentRefreshCount +
+ + +

A value that represents the running total count of v-blanks when the scheduler last sampled the machine time by calling QueryPerformanceCounter and that have happened since the computer booted (for windowed mode, since the swap chain was created).

+
+ dn384108 + SyncRefreshCount + SyncRefreshCount +
+ + +

A value that represents the high-resolution performance counter timer. This value is the same as the value returned by the QueryPerformanceCounter function.

+
+ dn384108 + SyncQPCTime + SyncQPCTime +
+ + +

Reserved. Always returns 0.

+
+ dn384108 + SyncGPUTime + SyncGPUTime +
+ + +

A value indicating the composition presentation mode. This value is used to determine whether the app should continue to use the decode swap chain. See .

+
+ dn384108 + CompositionMode + CompositionMode +
+ + +

If the system approves an app's custom present duration request, this field is set to the approved custom present duration.

If the app's custom present duration request is not approved, this field is set to zero.

+
+ dn384108 + ApprovedPresentDuration + ApprovedPresentDuration +
+ + +

Controls the settings of a gamma curve.

+
+ +

The structure is used by the IDXGIOutput::SetGammaControl method.

For info about using gamma correction, see Using gamma correction.

+
+ bb173061 + DXGI_GAMMA_CONTROL + DXGI_GAMMA_CONTROL +
+ + +

A structure with scalar values that are applied to rgb values before being sent to the gamma look up table.

+
+ bb173061 + Scale + Scale +
+ + +

A structure with offset values that are applied to the rgb values before being sent to the gamma look up table.

+
+ bb173061 + Offset + Offset +
+ + +

An array of structures that control the points of a gamma curve.

+
+ bb173061 + GammaCurve + GammaCurve +
+ + +

Controls the gamma capabilities of an adapter.

+
+ +

To get a list of the capabilities for controlling gamma correction, call IDXGIOutput::GetGammaControlCapabilities.

For info about using gamma correction, see Using gamma correction.

+
+ bb173062 + DXGI_GAMMA_CONTROL_CAPABILITIES + DXGI_GAMMA_CONTROL_CAPABILITIES +
+ + +

True if scaling and offset operations are supported during gamma correction; otherwise, false.

+
+ bb173062 + ScaleAndOffsetSupported + ScaleAndOffsetSupported +
+ + +

A value describing the maximum range of the control-point positions.

+
+ bb173062 + MaxConvertedValue + MaxConvertedValue +
+ + +

A value describing the minimum range of the control-point positions.

+
+ bb173062 + MinConvertedValue + MinConvertedValue +
+ + +

A value describing the number of control points in the array.

+
+ bb173062 + NumGammaControlPoints + NumGammaControlPoints +
+ + +

An array of values describing control points; the maximum length of control points is 1025.

+
+ bb173062 + ControlPointPositions + ControlPointPositions +
+ + +

Describes the 10 bit display metadata, and is usually used for video. This is used to adjust the output to best match a display's capabilities.

+
+ +

The X and Y coordinates of the parameters mean the xy chromacity coordinate in the CIE1931 color space. The values are normalized to 50000, so to get a value between 0.0 and 1.0, divide by 50000.

This structure is used in conjunction with the SetHDRMetaData method.

+
+ mt732700 + DXGI_HDR_METADATA_HDR10 + DXGI_HDR_METADATA_HDR10 +
+ + +

The chromaticity coordinates of the 1.0 red value. Index 0 contains the X coordinate and index 1 contains the Y coordinate.

+
+ mt732700 + RedPrimary + RedPrimary +
+ + +

The chromaticity coordinates of the 1.0 green value. Index 0 contains the X coordinate and index 1 contains the Y coordinate.

+
+ mt732700 + GreenPrimary + GreenPrimary +
+ + +

The chromaticity coordinates of the 1.0 blue value. Index 0 contains the X coordinate and index 1 contains the Y coordinate.

+
+ mt732700 + BluePrimary + BluePrimary +
+ + +

The chromaticity coordinates of the white point. Index 0 contains the X coordinate and index 1 contains the Y coordinate.

+
+ mt732700 + WhitePoint + WhitePoint +
+ + +

The maximum number of nits of the display used to master the content. Units are 0.0001 nit, so if the value is 1 nit, the value should be 10,000.

+
+ mt732700 + MaxMasteringLuminance + MaxMasteringLuminance +
+ + +

The minimum number of nits (in units of 0.00001 nit) of the display used to master the content.

+
+ mt732700 + MinMasteringLuminance + MinMasteringLuminance +
+ + +

The maximum nit value (in units of 0.00001 nit) used anywhere in the content.

+
+ mt732700 + MaxContentLightLevel + MaxContentLightLevel +
+ + +

The per-frame average of the maximum nit values (in units of 0.00001 nit).

+
+ mt732700 + MaxFrameAverageLightLevel + MaxFrameAverageLightLevel +
+ + +

Describes a debug message filter, which contains lists of message types to allow and deny.

+
+ +

Use with an interface.

Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? +
+ hh780346 + DXGI_INFO_QUEUE_FILTER + DXGI_INFO_QUEUE_FILTER +
+ + +

A structure that describes the types of messages to allow.

+
+ hh780346 + AllowList + AllowList +
+ + +

A structure that describes the types of messages to deny.

+
+ hh780346 + DenyList + DenyList +
+ + +

Describes the types of messages to allow or deny to pass through a filter.

+
+ +

This structure is a member of the structure.

This API requires the Windows Software Development Kit (SDK) for Windows?8.

+
+ hh780347 + DXGI_INFO_QUEUE_FILTER_DESC + DXGI_INFO_QUEUE_FILTER_DESC +
+ + +

The number of message categories to allow or deny.

+
+ hh780347 + NumCategories + NumCategories +
+ + +

An array of enumeration values that describe the message categories to allow or deny. The array must have at least NumCategories number of elements.

+
+ hh780347 + pCategoryList + pCategoryList +
+ + +

The number of message severity levels to allow or deny.

+
+ hh780347 + NumSeverities + NumSeverities +
+ + +

An array of enumeration values that describe the message severity levels to allow or deny. The array must have at least NumSeverities number of elements.

+
+ hh780347 + pSeverityList + pSeverityList +
+ + +

The number of message IDs to allow or deny.

+
+ hh780347 + NumIDs + NumIDs +
+ + +

An array of integers that represent the message IDs to allow or deny. The array must have at least NumIDs number of elements.

+
+ hh780347 + pIDList + pIDList +
+ + +

Describes a debug message in the information queue.

+
+ +

IDXGIInfoQueue::GetMessage returns a reference to this structure.

Note??This API requires the Windows Software Development Kit (SDK) for Windows?8.? +
+ hh780348 + DXGI_INFO_QUEUE_MESSAGE + DXGI_INFO_QUEUE_MESSAGE +
+ + +

A DXGI_DEBUG_ID value that identifies the entity that produced the message.

+
+ hh780348 + Producer + Producer +
+ + +

A -typed value that specifies the category of the message.

+
+ hh780348 + Category + Category +
+ + +

A -typed value that specifies the severity of the message.

+
+ hh780348 + Severity + Severity +
+ + +

An integer that uniquely identifies the message.

+
+ hh780348 + ID + ID +
+ + +

The message string.

+
+ hh780348 + pDescription + pDescription +
+ + +

The length of the message string at pDescription, in bytes.

+
+ hh780348 + DescriptionByteLength + DescriptionByteLength +
+ + +

Describes a JPEG AC huffman table.

+
+ dn903662 + DXGI_JPEG_AC_HUFFMAN_TABLE + DXGI_JPEG_AC_HUFFMAN_TABLE +
+ + +

The number of codes for each code length.

+
+ dn903662 + CodeCounts + CodeCounts +
+ + +

The Huffman code values, in order of increasing code length.

+
+ dn903662 + CodeValues + CodeValues +
+ + +

Describes a JPEG DC huffman table.

+
+ dn903663 + DXGI_JPEG_DC_HUFFMAN_TABLE + DXGI_JPEG_DC_HUFFMAN_TABLE +
+ + +

The number of codes for each code length.

+
+ dn903663 + CodeCounts + CodeCounts +
+ + +

The Huffman code values, in order of increasing code length.

+
+ dn903663 + CodeValues + CodeValues +
+ + +

Describes a JPEG quantization table.

+
+ dn903664 + DXGI_JPEG_QUANTIZATION_TABLE + DXGI_JPEG_QUANTIZATION_TABLE +
+ + +

An array of bytes containing the elements of the quantization table.

+
+ dn903664 + Elements + Elements +
+ + +

Describes a mapped rectangle that is used to access a surface.

+
+ +

The structure is initialized by the IDXGISurface::Map method.

+
+ bb173063 + DXGI_MAPPED_RECT + DXGI_MAPPED_RECT +
+ + +

A value that describes the width, in bytes, of the surface.

+
+ bb173063 + Pitch + Pitch +
+ + +

A reference to the image buffer of the surface.

+
+ bb173063 + pBits + pBits +
+ + +

Describes a display mode and whether the display mode supports stereo.

+
+ +

is identical to except that includes the Stereo member.

This structure is used by the GetDisplayModeList1 and FindClosestMatchingMode1 methods.

+
+ hh404507 + DXGI_MODE_DESC1 + DXGI_MODE_DESC1 +
+ + +

A value that describes the resolution width.

+
+ hh404507 + Width + Width +
+ + +

A value that describes the resolution height.

+
+ hh404507 + Height + Height +
+ + +

A structure that describes the refresh rate in hertz.

+
+ hh404507 + RefreshRate + RefreshRate +
+ + +

A -typed value that describes the display format.

+
+ hh404507 + Format + Format +
+ + +

A -typed value that describes the scan-line drawing mode.

+
+ hh404507 + ScanlineOrdering + ScanlineOrdering +
+ + +

A -typed value that describes the scaling mode.

+
+ hh404507 + Scaling + Scaling +
+ + +

Specifies whether the full-screen display mode is stereo. TRUE if stereo; otherwise, .

+
+ hh404507 + Stereo + Stereo +
+ + +

Describes an output or physical connection between the adapter (video card) and a device.

+
+ +

The structure is initialized by the IDXGIOutput::GetDesc method.

+
+ bb173068 + DXGI_OUTPUT_DESC + DXGI_OUTPUT_DESC +
+ + +

A string that contains the name of the output device.

+
+ bb173068 + DeviceName + DeviceName +
+ + +

A structure containing the bounds of the output in desktop coordinates. Desktop coordinates depend on the dots per inch (DPI) of the desktop. + For info about writing DPI-aware Win32 apps, see High DPI.

+
+ bb173068 + DesktopCoordinates + DesktopCoordinates +
+ + +

True if the output is attached to the desktop; otherwise, false.

+
+ bb173068 + AttachedToDesktop + AttachedToDesktop +
+ + +

A member of the enumerated type describing on how an image is rotated by the output.

+
+ bb173068 + Rotation + Rotation +
+ + +

An handle that represents the display monitor. For more information, see and the Device Context.

+
+ bb173068 + Monitor + Monitor +
+ + +

Describes an output or physical connection between the adapter (video card) and a device.

+
+ +

The structure is initialized by the IDXGIOutput::GetDesc method.

+
+ bb173068 + DXGI_OUTPUT_DESC1 + DXGI_OUTPUT_DESC1 +
+ + +

A string that contains the name of the output device.

+
+ bb173068 + DeviceName + DeviceName +
+ + +

A structure containing the bounds of the output in desktop coordinates. Desktop coordinates depend on the dots per inch (DPI) of the desktop. + For info about writing DPI-aware Win32 apps, see High DPI.

+
+ bb173068 + DesktopCoordinates + DesktopCoordinates +
+ + +

True if the output is attached to the desktop; otherwise, false.

+
+ bb173068 + AttachedToDesktop + AttachedToDesktop +
+ + +

A member of the enumerated type describing on how an image is rotated by the output.

+
+ bb173068 + Rotation + Rotation +
+ + +

An handle that represents the display monitor. For more information, see and the Device Context.

+
+ bb173068 + Monitor + Monitor +
+ + + No documentation. + + bb173068 + BitsPerColor + BitsPerColor + + + + No documentation. + + bb173068 + ColorSpace + ColorSpace + + + + No documentation. + + bb173068 + RedPrimary + RedPrimary + + + + No documentation. + + bb173068 + GreenPrimary + GreenPrimary + + + + No documentation. + + bb173068 + BluePrimary + BluePrimary + + + + No documentation. + + bb173068 + WhitePoint + WhitePoint + + + + No documentation. + + bb173068 + MinLuminance + MinLuminance + + + + No documentation. + + bb173068 + MaxLuminance + MaxLuminance + + + + No documentation. + + bb173068 + MaxFullFrameLuminance + MaxFullFrameLuminance + + + +

The structure describes the dimension of the output and the surface that contains the desktop image. The format of the desktop image is always DXGI_FORMAT_B8G8R8A8_UNORM.

+
+ +

This structure is used by GetDesc.

+
+ hh404510 + DXGI_OUTDUPL_DESC + DXGI_OUTDUPL_DESC +
+ + + No documentation. + + hh404510 + ModeDesc + ModeDesc + + + + No documentation. + + hh404510 + Rotation + Rotation + + + + No documentation. + + hh404510 + DesktopImageInSystemMemory + DesktopImageInSystemMemory + + + +

The structure describes the current desktop image.

+
+ +

A non-zero LastMouseUpdateTime indicates an update to either a mouse reference position or a mouse reference position and shape. That is, the mouse reference position is always valid for a non-zero LastMouseUpdateTime; however, the application must check the value of the PointerShapeBufferSize member to determine whether the shape was updated too.

If only the reference was updated (that is, the desktop image was not updated), the AccumulatedFrames, TotalMetadataBufferSize, and LastPresentTime members are set to zero.

An AccumulatedFrames value of one indicates that the application completed processing the last frame before a new desktop image was presented. If the AccumulatedFrames value is greater than one, more desktop image updates have occurred while the application processed the last desktop update. In this situation, the operating system accumulated the update regions. For more information about desktop updates, see Desktop Update Data.

A non-zero TotalMetadataBufferSize indicates the total size of the buffers that are required to store all the desktop update metadata. An application cannot determine the size of each type of metadata. The application must call the IDXGIOutputDuplication::GetFrameDirtyRects, IDXGIOutputDuplication::GetFrameMoveRects, or IDXGIOutputDuplication::GetFramePointerShape method to obtain information about each type of metadata.

Note??To correct visual effects, an application must process the move region data before it processes the dirty rectangles.? +
+ hh404512 + DXGI_OUTDUPL_FRAME_INFO + DXGI_OUTDUPL_FRAME_INFO +
+ + +

The time stamp of the last update of the desktop image. The operating system calls the QueryPerformanceCounter function to obtain the value. A zero value indicates that the desktop image was not updated since an application last called the IDXGIOutputDuplication::AcquireNextFrame method to acquire the next frame of the desktop image.

+
+ hh404512 + LastPresentTime + LastPresentTime +
+ + +

The time stamp of the last update to the mouse. The operating system calls the QueryPerformanceCounter function to obtain the value. A zero value indicates that the position or shape of the mouse was not updated since an application last called the IDXGIOutputDuplication::AcquireNextFrame method to acquire the next frame of the desktop image. The mouse position is always supplied for a mouse update. A new reference shape is indicated by a non-zero value in the PointerShapeBufferSize member.

+
+ hh404512 + LastMouseUpdateTime + LastMouseUpdateTime +
+ + +

The number of frames that the operating system accumulated in the desktop image surface since the calling application processed the last desktop image. For more information about this number, see Remarks.

+
+ hh404512 + AccumulatedFrames + AccumulatedFrames +
+ + +

Specifies whether the operating system accumulated updates by coalescing dirty regions. Therefore, the dirty regions might contain unmodified pixels. TRUE if dirty regions were accumulated; otherwise, .

+
+ hh404512 + RectsCoalesced + RectsCoalesced +
+ + +

Specifies whether the desktop image might contain protected content that was already blacked out in the desktop image. TRUE if protected content was already blacked; otherwise, . The application can use this information to notify the remote user that some of the desktop content might be protected and therefore not visible.

+
+ hh404512 + ProtectedContentMaskedOut + ProtectedContentMaskedOut +
+ + +

A structure that describes the most recent mouse position if the LastMouseUpdateTime member is a non-zero value; otherwise, this value is ignored. This value provides the coordinates of the location where the top-left-hand corner of the reference shape is drawn; this value is not the desktop position of the hot spot.

+
+ hh404512 + PointerPosition + PointerPosition +
+ + +

Size in bytes of the buffers to store all the desktop update metadata for this frame. For more information about this size, see Remarks.

+
+ hh404512 + TotalMetadataBufferSize + TotalMetadataBufferSize +
+ + +

Size in bytes of the buffer to hold the new pixel data for the mouse shape. For more information about this size, see Remarks.

+
+ hh404512 + PointerShapeBufferSize + PointerShapeBufferSize +
+ + +

The structure describes the movement of a rectangle.

+
+ +

This structure is used by GetFrameMoveRects.

+
+ hh404514 + DXGI_OUTDUPL_MOVE_RECT + DXGI_OUTDUPL_MOVE_RECT +
+ + +

The starting position of a rectangle.

+
+ hh404514 + SourcePoint + SourcePoint +
+ + +

The target region to which to move a rectangle.

+
+ hh404514 + DestinationRect + DestinationRect +
+ + +

The structure describes the position of the hardware cursor.

+
+ +

The Position member is valid only if the Visible member?s value is set to TRUE.

+
+ hh404516 + DXGI_OUTDUPL_POINTER_POSITION + DXGI_OUTDUPL_POINTER_POSITION +
+ + +

The position of the hardware cursor relative to the top-left of the adapter output.

+
+ hh404516 + Position + Position +
+ + +

Specifies whether the hardware cursor is visible. TRUE if visible; otherwise, . If the hardware cursor is not visible, the calling application does not display the cursor in the client.

+
+ hh404516 + Visible + Visible +
+ + +

The structure describes information about the cursor shape.

+
+ +

An application draws the cursor shape with the top-left-hand corner drawn at the position that the Position member of the structure specifies; the application does not use the hot spot to draw the cursor shape.

An application calls the IDXGIOutputDuplication::GetFramePointerShape method to retrieve cursor shape information in a structure.

+
+ hh404518 + DXGI_OUTDUPL_POINTER_SHAPE_INFO + DXGI_OUTDUPL_POINTER_SHAPE_INFO +
+ + +

A -typed value that specifies the type of cursor shape.

+
+ hh404518 + Type + Type +
+ + +

The width in pixels of the mouse cursor.

+
+ hh404518 + Width + Width +
+ + +

The height in scan lines of the mouse cursor.

+
+ hh404518 + Height + Height +
+ + +

The width in bytes of the mouse cursor.

+
+ hh404518 + Pitch + Pitch +
+ + +

The position of the cursor's hot spot relative to its upper-left pixel. An application does not use the hot spot when it determines where to draw the cursor shape.

+
+ hh404518 + HotSpot + HotSpot +
+ + +

Describes the current video memory budgeting parameters.

+
+ +

Use this structure with QueryVideoMemoryInfo.

Refer to the remarks for .

+
+ dn933220 + DXGI_QUERY_VIDEO_MEMORY_INFO + DXGI_QUERY_VIDEO_MEMORY_INFO +
+ + +

Specifies the OS-provided video memory budget, in bytes, that the application should target. If CurrentUsage is greater than Budget, the application may incur stuttering or performance penalties due to background activity by the OS to provide other applications with a fair usage of video memory.

+
+ dn933220 + Budget + Budget +
+ + +

Specifies the application?s current video memory usage, in bytes.

+
+ dn933220 + CurrentUsage + CurrentUsage +
+ + +

The amount of video memory, in bytes, that the application has available for reservation. To reserve this video memory, the application should call IDXGIAdapter3::SetVideoMemoryReservation.

+
+ dn933220 + AvailableForReservation + AvailableForReservation +
+ + +

The amount of video memory, in bytes, that is reserved by the application. The OS uses the reservation as a hint to determine the application?s minimum working set. Applications should attempt to ensure that their video memory usage can be trimmed to meet this requirement.

+
+ dn933220 + CurrentReservation + CurrentReservation +
+ + +

Represents a handle to a shared resource.

+
+ +

To create a shared surface, pass a shared-resource handle into the IDXGIDevice::CreateSurface method.

+
+ bb173073 + DXGI_SHARED_RESOURCE + DXGI_SHARED_RESOURCE +
+ + +

A handle to a shared resource.

+
+ bb173073 + Handle + Handle +
+ + +

Describes a surface.

+
+ +

This structure is used by the GetDesc and CreateSurface methods.

+
+ bb173074 + DXGI_SURFACE_DESC + DXGI_SURFACE_DESC +
+ + +

A value describing the surface width.

+
+ bb173074 + Width + Width +
+ + +

A value describing the surface height.

+
+ bb173074 + Height + Height +
+ + +

A member of the enumerated type that describes the surface format.

+
+ bb173074 + Format + Format +
+ + +

A member of the structure that describes multi-sampling parameters for the surface.

+
+ bb173074 + SampleDesc + SampleDesc +
+ + +

Describes a swap chain.

+
+ +

This structure is used by the GetDesc and CreateSwapChain methods.

In full-screen mode, there is a dedicated front buffer; in windowed mode, the desktop is the front buffer.

If you create a swap chain with one buffer, specifying DXGI_SWAP_EFFECT_SEQUENTIAL does not cause the contents of the single buffer to be swapped with the front buffer.

For performance information about flipping swap-chain buffers in full-screen application, see Full-Screen Application Performance Hints.

+
+ bb173075 + DXGI_SWAP_CHAIN_DESC + DXGI_SWAP_CHAIN_DESC +
+ + +

A structure that describes the backbuffer display mode.

+
+ bb173075 + BufferDesc + BufferDesc +
+ + +

A structure that describes multi-sampling parameters.

+
+ bb173075 + SampleDesc + SampleDesc +
+ + +

A member of the DXGI_USAGE enumerated type that describes the surface usage and CPU access options for the back buffer. The back buffer can be used for shader input or render-target output.

+
+ bb173075 + BufferUsage + BufferUsage +
+ + +

A value that describes the number of buffers in the swap chain. When you call IDXGIFactory::CreateSwapChain to create a full-screen swap chain, you typically include the front buffer in this value. For more information about swap-chain buffers, see Remarks.

+
+ bb173075 + BufferCount + BufferCount +
+ + +

An handle to the output window. This member must not be null.

+
+ bb173075 + OutputWindow + OutputWindow +
+ + +

A Boolean value that specifies whether the output is in windowed mode. TRUE if the output is in windowed mode; otherwise, .

We recommend that you create a windowed swap chain and allow the end user to change the swap chain to full screen through IDXGISwapChain::SetFullscreenState; that is, do not set this member to to force the swap chain to be full screen. However, if you create the swap chain as full screen, also provide the end user with a list of supported display modes through the BufferDesc member because a swap chain that is created with an unsupported display mode might cause the display to go black and prevent the end user from seeing anything.

For more information about choosing windowed verses full screen, see IDXGIFactory::CreateSwapChain.

+
+ bb173075 + Windowed + Windowed +
+ + +

A member of the enumerated type that describes options for handling the contents of the presentation buffer after presenting a surface.

+
+ bb173075 + SwapEffect + SwapEffect +
+ + +

A member of the enumerated type that describes options for swap-chain behavior.

+
+ bb173075 + Flags + Flags +
+ + +

Describes a swap chain.

+
+ +

This structure is used by the CreateSwapChainForHwnd, CreateSwapChainForCoreWindow, CreateSwapChainForComposition, CreateSwapChainForCompositionSurfaceHandle, and GetDesc1 methods.

Note??You cannot cast a to a and vice versa. An application must explicitly use the IDXGISwapChain1::GetDesc1 method to retrieve the newer version of the swap-chain description structure.?

In full-screen mode, there is a dedicated front buffer; in windowed mode, the desktop is the front buffer.

For a flip-model swap chain (that is, a swap chain that has the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL value set in the SwapEffect member), you must set the Format member to DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_B8G8R8A8_UNORM, or DXGI_FORMAT_R8G8B8A8_UNORM; you must set the Count member of the structure that the SampleDesc member specifies to one and the Quality member of to zero because multiple sample antialiasing (MSAA) is not supported; you must set the BufferCount member to from two to sixteen. For more info about flip-model swap chain, see DXGI Flip Model.

+
+ hh404528 + DXGI_SWAP_CHAIN_DESC1 + DXGI_SWAP_CHAIN_DESC1 +
+ + +

A value that describes the resolution width. If you specify the width as zero when you call the IDXGIFactory2::CreateSwapChainForHwnd method to create a swap chain, the runtime obtains the width from the output window and assigns this width value to the swap-chain description. You can subsequently call the IDXGISwapChain1::GetDesc1 method to retrieve the assigned width value. You cannot specify the width as zero when you call the IDXGIFactory2::CreateSwapChainForComposition method.

+
+ hh404528 + Width + Width +
+ + +

A value that describes the resolution height. If you specify the height as zero when you call the IDXGIFactory2::CreateSwapChainForHwnd method to create a swap chain, the runtime obtains the height from the output window and assigns this height value to the swap-chain description. You can subsequently call the IDXGISwapChain1::GetDesc1 method to retrieve the assigned height value. You cannot specify the height as zero when you call the IDXGIFactory2::CreateSwapChainForComposition method.

+
+ hh404528 + Height + Height +
+ + +

A structure that describes the display format.

+
+ hh404528 + Format + Format +
+ + +

Specifies whether the full-screen display mode or the swap-chain back buffer is stereo. TRUE if stereo; otherwise, . If you specify stereo, you must also specify a flip-model swap chain (that is, a swap chain that has the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL value set in the SwapEffect member).

+
+ hh404528 + Stereo + Stereo +
+ + +

A structure that describes multi-sampling parameters. This member is valid only with bit-block transfer (bitblt) model swap chains.

+
+ hh404528 + SampleDesc + SampleDesc +
+ + +

A DXGI_USAGE-typed value that describes the surface usage and CPU access options for the back buffer. The back buffer can be used for shader input or render-target output.

+
+ hh404528 + BufferUsage + BufferUsage +
+ + +

A value that describes the number of buffers in the swap chain. When you create a full-screen swap chain, you typically include the front buffer in this value.

+
+ hh404528 + BufferCount + BufferCount +
+ + +

A -typed value that identifies resize behavior if the size of the back buffer is not equal to the target output.

+
+ hh404528 + Scaling + Scaling +
+ + +

A -typed value that describes the presentation model that is used by the swap chain and options for handling the contents of the presentation buffer after presenting a surface. You must specify the DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL value when you call the IDXGIFactory2::CreateSwapChainForComposition method because this method supports only flip presentation model.

+
+ hh404528 + SwapEffect + SwapEffect +
+ + +

A -typed value that identifies the transparency behavior of the swap-chain back buffer.

+
+ hh404528 + AlphaMode + AlphaMode +
+ + +

A combination of -typed values that are combined by using a bitwise OR operation. The resulting value specifies options for swap-chain behavior.

+
+ hh404528 + Flags + Flags +
+ + +

Describes full-screen mode for a swap chain.

+
+ +

This structure is used by the CreateSwapChainForHwnd and GetFullscreenDesc methods.

+
+ hh404531 + DXGI_SWAP_CHAIN_FULLSCREEN_DESC + DXGI_SWAP_CHAIN_FULLSCREEN_DESC +
+ + +

A structure that describes the refresh rate in hertz.

+
+ hh404531 + RefreshRate + RefreshRate +
+ + +

A member of the enumerated type that describes the scan-line drawing mode.

+
+ hh404531 + ScanlineOrdering + ScanlineOrdering +
+ + +

A member of the enumerated type that describes the scaling mode.

+
+ hh404531 + Scaling + Scaling +
+ + +

A Boolean value that specifies whether the swap chain is in windowed mode. TRUE if the swap chain is in windowed mode; otherwise, .

+
+ hh404531 + Windowed + Windowed +
+
+
diff --git a/Test/dll/SharpDX.Direct3D9.dll b/Test/dll/SharpDX.Direct3D9.dll new file mode 100644 index 00000000..54d16343 Binary files /dev/null and b/Test/dll/SharpDX.Direct3D9.dll differ diff --git a/Test/dll/SharpDX.Direct3D9.xml b/Test/dll/SharpDX.Direct3D9.xml new file mode 100644 index 00000000..cc900c37 --- /dev/null +++ b/Test/dll/SharpDX.Direct3D9.xml @@ -0,0 +1,36489 @@ + + + + SharpDX.Direct3D9 + + + + + A collection of . + + + + +

Contains information identifying the adapter.

+
+ +

The following pseudocode example illustrates the version format encoded in the DriverVersion, DriverVersionLowPart, and DriverVersionHighPart members.

 Product = HIWORD(DriverVersion.HighPart)	
+            Version = LOWORD(DriverVersion.HighPart)	
+            SubVersion = HIWORD(DriverVersion.LowPart)	
+            Build = LOWORD(DriverVersion.LowPart)	
+            

See the Platform SDK for more information about the HIWORD macro, the LOWORD macro, and the structure.

MAX_DEVICE_IDENTIFIER_STRING is a constant with the following definition.

#define MAX_DEVICE_IDENTIFIER_STRING        512

The VendorId, DeviceId, SubSysId, and Revision members can be used in tandem to identify particular chip sets. However, use these members with caution.

+
+ + bb172505 + D3DADAPTER_IDENTIFIER9 + D3DADAPTER_IDENTIFIER9 +
+ + + Gets a value indicating whether the adapter is WHQL certified. + + + true if certified; otherwise, false. + + + + + Gets the driver version. + + + + + Gets the certification date. + + + + +

Used for presentation to the user. This should not be used to identify particular drivers, because many different strings might be associated with the same device and driver from different vendors.

+
+ + bb172505 + char Driver[512] + char Driver +
+ + +

Used for presentation to the user.

+
+ + bb172505 + char Description[512] + char Description +
+ + +

Device name for GDI.

+
+ + bb172505 + char DeviceName[32] + char DeviceName +
+ + +

Identify the version of the Direct3D driver. It is legal to do less than and greater than comparisons on the 64-bit signed integer value. However, exercise caution if you use this element to identify problematic drivers. Instead, you should use DeviceIdentifier. See Remarks.

+
+ + bb172505 + LARGE_INTEGER DriverVersion + LARGE_INTEGER DriverVersion +
+ + +

Can be used to help identify a particular chip set. Query this member to identify the manufacturer. The value can be zero if unknown.

+
+ + bb172505 + unsigned int VendorId + unsigned int VendorId +
+ + +

Can be used to help identify a particular chip set. Query this member to identify the type of chip set. The value can be zero if unknown.

+
+ + bb172505 + unsigned int DeviceId + unsigned int DeviceId +
+ + +

Can be used to help identify a particular chip set. Query this member to identify the subsystem, typically the particular board. The value can be zero if unknown.

+
+ + bb172505 + unsigned int SubSysId + unsigned int SubSysId +
+ + +

Can be used to help identify a particular chip set. Query this member to identify the revision level of the chip set. The value can be zero if unknown.

+
+ + bb172505 + unsigned int Revision + unsigned int Revision +
+ + +

Can be queried to check changes in the driver and chip set. This is a unique identifier for the driver and chip set pair. Query this member to track changes to the driver and chip set in order to generate a new profile for the graphics subsystem. DeviceIdentifier can also be used to identify particular problematic drivers.

+
+ + bb172505 + GUID DeviceIdentifier + GUID DeviceIdentifier +
+ + +

Used to determine the Windows Hardware Quality Labs (WHQL) validation level for this driver and device pair. The DWORD is a packed date structure defining the date of the release of the most recent WHQL test passed by the driver. It is legal to perform < and > operations on this value. The following illustrates the date format.

Bits
31-16The year, a decimal number from 1999 upwards.
15-8The month, a decimal number from 1 to 12.
7-0The day, a decimal number from 1 to 31.

?

The following values are also used.

0Not certified.
1WHQL validated, but no date information is available.

?

Differences between Direct3D 9 and Direct3D 9Ex:

For Direct3D9Ex running on Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2 (or more current operating system), returns 1 for the WHQL level without checking the status of the driver.

+
+ + bb172505 + unsigned int WHQLLevel + unsigned int WHQLLevel +
+ + + A collection of . + + + + + Adapter information. + + + + + Gets the capabilities of this adapter. + + The type. + The capabilities + + + + Gets the display modes supported by this adapter. + + The format. + The display modes supported by this adapter. + + + + Gets the adapter ordinal. + + + + + Gets the current display mode. + + + + + Gets the details. + + + + + Gets the monitor. + + + + + Adapter information. + + + + + Gets the capabilities of this adapter. + + The type. + The capabilities + + + + Gets the display modes supported by this adapter. + + The filter. + + The display modes supported by this adapter. + + + + + Gets the adapter ordinal. + + + + + Gets the current display mode. + + + + + Gets the details. + + + + + Gets the monitor. + + + + + The assembly provides managed Direct3D9 API. + + bb219837 + Direct3D9 + Direct3D9 + + + + No documentation. + + + bb280470 + ID3DXBaseEffect + ID3DXBaseEffect + + + + Gets the string. + + The parameter. + + HRESULT ID3DXBaseEffect::GetString([In] D3DXHANDLE hParameter,[Out] const void** ppString) + + + + Gets the value of the specified parameter. + + Handle of the parameter. + The value of the parameter. + HRESULT ID3DXBaseEffect::GetValue([In] D3DXHANDLE hParameter,[In] void* pData,[In] unsigned int Bytes) + + + + Gets the value of the specified parameter. + + + Handle of the parameter. + The count. + + The value of the parameter. + + HRESULT ID3DXBaseEffect::GetValue([In] D3DXHANDLE hParameter,[In] void* pData,[In] unsigned int Bytes) + + + + Sets a bool value. + + The effect handle. + The value. + + A object describing the result of the operation. + + HRESULT ID3DXBaseEffect::SetBool([In] D3DXHANDLE hConstant,[In] BOOL b) + + + + Sets a float value. + + The effect handle. + The value. + + A object describing the result of the operation. + + HRESULT ID3DXBaseEffect::SetFloat([In] D3DXHANDLE hConstant,[In] float f) + + + + Sets an int value. + + The effect handle. + The value. + + A object describing the result of the operation. + + HRESULT ID3DXBaseEffect::SetInt([In] D3DXHANDLE hConstant,[In] int n) + + + + Sets a matrix. + + The effect handle. + The value. + + A object describing the result of the operation. + + HRESULT ID3DXBaseEffect::SetMatrix([In] D3DXHANDLE hConstant,[In] const D3DXMATRIX* pMatrix) + + + + Sets a 4D vector. + + The effect handle. + The value. + + A object describing the result of the operation. + + HRESULT ID3DXBaseEffect::SetVector([In] D3DXHANDLE hConstant,[In] const D3DXVECTOR4* pVector) + + + + Sets a typed value. + + Type of the value to set + The effect handle. + The value. + + A object describing the result of the operation. + + HRESULT ID3DXBaseEffect::SetValue([In] D3DXHANDLE hConstant,[In] const void* pData,[In] unsigned int Bytes) + + + + Sets an array of bools. + + The effect handle. + The values. + + A object describing the result of the operation. + + HRESULT ID3DXBaseEffect::SetBoolArray([In] D3DXHANDLE hConstant,[In, Buffer] const BOOL* pb,[In] unsigned int Count) + + + + Sets an array of floats. + + The effect handle. + The values. + + A object describing the result of the operation. + + HRESULT ID3DXBaseEffect::SetFloatArray([In] D3DXHANDLE hConstant,[In, Buffer] const float* pf,[In] unsigned int Count) + + + + Sets an array of ints. + + The effect handle. + The values. + + A object describing the result of the operation. + + HRESULT ID3DXBaseEffect::SetIntArray([In] D3DXHANDLE hConstant,[In, Buffer] const int* pn,[In] unsigned int Count) + + + + Sets an array of matrices. + + The effect handle. + The values. + + A object describing the result of the operation. + + HRESULT ID3DXBaseEffect::SetMatrixArray([In] D3DXHANDLE hConstant,[In, Buffer] const D3DXMATRIX* pMatrix,[In] unsigned int Count) + + + + Sets an array of 4D vectors. + + The effect handle. + The values. + + A object describing the result of the operation. + + HRESULT ID3DXBaseEffect::SetVectorArray([In] D3DXHANDLE hConstant,[In, Buffer] const D3DXVECTOR4* pVector,[In] unsigned int Count) + + + + Sets an array of elements. + + Type of the array element + The effect handle. + The values. + + A object describing the result of the operation. + + HRESULT ID3DXBaseEffect::SetValue([In] D3DXHANDLE hConstant,[In] const void* pData,[In] unsigned int Bytes) + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Gets the effect description.

+
+ + bb205681 + GetDesc + GetDesc + HRESULT ID3DXBaseEffect::GetDesc([Out] D3DXEFFECT_DESC* pDesc) +
+ + +

Gets the effect description.

+
+

Returns a description of the effect. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205681 + HRESULT ID3DXBaseEffect::GetDesc([Out] D3DXEFFECT_DESC* pDesc) + ID3DXBaseEffect::GetDesc +
+ + +

Gets a parameter or annotation description.

+
+

Parameter or annotation handle. See Handles (Direct3D 9).

+

Returns a description of the specified parameter or annotation. See .

+ + bb205698 + HRESULT ID3DXBaseEffect::GetParameterDesc([In] D3DXHANDLE hParameter,[Out] D3DXPARAMETER_DESC* pDesc) + ID3DXBaseEffect::GetParameterDesc +
+ + +

Gets a technique description.

+
+

Technique handle. See Handles (Direct3D 9).

+

Returns a description of the technique. See .

+ + bb205707 + HRESULT ID3DXBaseEffect::GetTechniqueDesc([In] D3DXHANDLE hTechnique,[Out] D3DXTECHNIQUE_DESC* pDesc) + ID3DXBaseEffect::GetTechniqueDesc +
+ + +

Gets a pass description.

+
+

Pass handle. See Handles (Direct3D 9).

+

Returns a description of the specified pass. See .

+ +

Note??If an effect is created with , this method will return null references (in ) to the shader functions.

+
+ + bb205702 + HRESULT ID3DXBaseEffect::GetPassDesc([In] D3DXHANDLE hPass,[Out] D3DXPASS_DESC* pDesc) + ID3DXBaseEffect::GetPassDesc +
+ + +

Gets a function description.

+
+

Function handle. See Handles (Direct3D 9).

+

Returns a description of the function. See .

+ + bb205686 + HRESULT ID3DXBaseEffect::GetFunctionDesc([In] D3DXHANDLE hShader,[Out] D3DXFUNCTION_DESC* pDesc) + ID3DXBaseEffect::GetFunctionDesc +
+ + +

Gets the handle of a top-level parameter or a structure member parameter.

+
+

Handle of the parameter, or null for top-level parameters. See Handles (Direct3D 9).

+

Parameter index.

+

Returns the handle of the specified parameter, or null if the index was invalid. See Handles (Direct3D 9).

+ + bb205695 + D3DXHANDLE ID3DXBaseEffect::GetParameter([In] D3DXHANDLE hParameter,[In] unsigned int Index) + ID3DXBaseEffect::GetParameter +
+ + +

Gets the handle of a top-level parameter or a structure member parameter by looking up its name.

+
+

Handle of the parameter, or null for top-level parameters. See Handles (Direct3D 9).

+

String containing the parameter name.

+

Returns the handle of the specified parameter, or null if the index was invalid. See Handles (Direct3D 9).

+ + bb205696 + D3DXHANDLE ID3DXBaseEffect::GetParameterByName([In] D3DXHANDLE hParameter,[In] const char* pName) + ID3DXBaseEffect::GetParameterByName +
+ + +

Gets the handle of a top-level parameter or a structure member parameter by looking up its semantic with a case-insensitive search.

+
+

Handle of the parameter, or null for top-level parameters. See Handles (Direct3D 9).

+

String containing the semantic name.

+

Returns the handle of the first parameter that matches the specified semantic, or null if the semantic was not found. See Handles (Direct3D 9).

+ + bb205697 + D3DXHANDLE ID3DXBaseEffect::GetParameterBySemantic([In] D3DXHANDLE hParameter,[In] const char* pSemantic) + ID3DXBaseEffect::GetParameterBySemantic +
+ + +

Get the handle of an array element parameter.

+
+

Handle of the array. See Handles (Direct3D 9).

+

Array element index.

+

Returns the handle of the specified parameter, or null if either hParameter or ElementIndex is invalid. See Handles (Direct3D 9).

+ +

This method is used to get an element of a parameter that is an array.

+
+ + bb205699 + D3DXHANDLE ID3DXBaseEffect::GetParameterElement([In] D3DXHANDLE hParameter,[In] unsigned int Index) + ID3DXBaseEffect::GetParameterElement +
+ + +

Gets the handle of a technique.

+
+

Technique index.

+

Returns the handle of the specified technique, or null if the index was invalid. See Handles (Direct3D 9).

+ + bb205705 + D3DXHANDLE ID3DXBaseEffect::GetTechnique([In] unsigned int Index) + ID3DXBaseEffect::GetTechnique +
+ + +

Gets the handle of a technique by looking up its name.

+
+

String containing the technique name.

+

Returns the handle of the first technique that has the specified name, or null if the name was not found. See Handles (Direct3D 9).

+ + bb205706 + D3DXHANDLE ID3DXBaseEffect::GetTechniqueByName([In] const char* pName) + ID3DXBaseEffect::GetTechniqueByName +
+ + +

Gets the handle of a pass.

+
+

Handle of the parent technique. See Handles (Direct3D 9).

+

Index for the pass.

+

Returns the handle of the specified pass inside the specified technique, or null if the index was invalid. See Handles (Direct3D 9).

+ + bb205700 + D3DXHANDLE ID3DXBaseEffect::GetPass([In] D3DXHANDLE hTechnique,[In] unsigned int Index) + ID3DXBaseEffect::GetPass +
+ + +

Gets the handle of a pass by looking up its name.

+
+

Handle of the parent technique. See Handles (Direct3D 9).

+

String containing the pass name.

+

Returns the handle of the first pass inside the specified technique that has the specified name, or null if the name was not found. See Handles (Direct3D 9).

+ + bb205701 + D3DXHANDLE ID3DXBaseEffect::GetPassByName([In] D3DXHANDLE hTechnique,[In] const char* pName) + ID3DXBaseEffect::GetPassByName +
+ + +

Gets the handle of a function.

+
+

Function index.

+

Returns the handle of the specified function, or null if the index was invalid. See Handles (Direct3D 9).

+ + bb205684 + D3DXHANDLE ID3DXBaseEffect::GetFunction([In] unsigned int Index) + ID3DXBaseEffect::GetFunction +
+ + +

Gets the handle of a function by looking up its name.

+
+

String containing the function name.

+

Returns the handle of the specified function, or null if the name was not found. See Handles (Direct3D 9).

+ + bb205685 + D3DXHANDLE ID3DXBaseEffect::GetFunctionByName([In] const char* pName) + ID3DXBaseEffect::GetFunctionByName +
+ + +

Gets the handle of an annotation.

+
+

Handle of a technique, pass, or top-level parameter. See Handles (Direct3D 9).

+

Annotation index.

+

Returns the handle of the specified annotation, or null if the index was invalid. See Handles (Direct3D 9).

+ +

Annotations are user-specific data that can be attached to any technique, pass, or parameter. See Handles (Direct3D 9).

+
+ + bb205677 + D3DXHANDLE ID3DXBaseEffect::GetAnnotation([In] D3DXHANDLE hObject,[In] unsigned int Index) + ID3DXBaseEffect::GetAnnotation +
+ + +

Gets the handle of an annotation by looking up its name.

+
+

Handle of a technique, pass, or top-level parameter. See Handles (Direct3D 9).

+

String containing the annotation name.

+

Returns the handle of the specified annotation, or null if the name was not found. See Handles (Direct3D 9).

+ + bb205678 + D3DXHANDLE ID3DXBaseEffect::GetAnnotationByName([In] D3DXHANDLE hObject,[In] const char* pName) + ID3DXBaseEffect::GetAnnotationByName +
+ + +

Set the value of an arbitrary parameter or annotation, including simple types, structs, arrays, strings, shaders and textures.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Pointer to a buffer containing data.

+

[in] Number of bytes in the buffer. Pass in D3DX_DEFAULT if you know your buffer is large enough to contain the entire parameter, and you want to skip size validation.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

This method can be used in place of nearly all the effect set API calls.

+
+ + bb205728 + HRESULT ID3DXBaseEffect::SetValue([In] D3DXHANDLE hParameter,[In] const void* pData,[In] unsigned int Bytes) + ID3DXBaseEffect::SetValue +
+ + +

Get the value of an arbitrary parameter or annotation, including simple types, structs, arrays, strings, shaders and textures. This method can be used in place of nearly all the Getxxx calls in .

+
+ No documentation. + No documentation. + No documentation. +

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205709 + HRESULT ID3DXBaseEffect::GetValue([In] D3DXHANDLE hParameter,[In] void* pData,[In] unsigned int Bytes) + ID3DXBaseEffect::GetValue +
+ + +

Sets a value.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Boolean value.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205714 + HRESULT ID3DXBaseEffect::SetBool([In] D3DXHANDLE hParameter,[In] BOOL b) + ID3DXBaseEffect::SetBool +
+ + +

Gets a value.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Returns a Boolean value.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205679 + HRESULT ID3DXBaseEffect::GetBool([In] D3DXHANDLE hParameter,[Out] BOOL* pb) + ID3DXBaseEffect::GetBool +
+ + +

Sets an array of Boolean values.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Array of Boolean values.

+

Number of Boolean values in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205715 + HRESULT ID3DXBaseEffect::SetBoolArray([In] D3DXHANDLE hParameter,[In, Buffer] const BOOL* pb,[In] unsigned int Count) + ID3DXBaseEffect::SetBoolArray +
+ + +

Gets an array of values.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Returns an array of Boolean values.

+

Number of Boolean values in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205680 + HRESULT ID3DXBaseEffect::GetBoolArray([In] D3DXHANDLE hParameter,[Out, Buffer] BOOL* pb,[In] unsigned int Count) + ID3DXBaseEffect::GetBoolArray +
+ + +

Sets an integer.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Integer value.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205718 + HRESULT ID3DXBaseEffect::SetInt([In] D3DXHANDLE hParameter,[In] int n) + ID3DXBaseEffect::SetInt +
+ + +

Gets an integer.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Returns an integer.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205687 + HRESULT ID3DXBaseEffect::GetInt([In] D3DXHANDLE hParameter,[Out] int* pn) + ID3DXBaseEffect::GetInt +
+ + +

Sets an array of integers.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Array of integers.

+

Number of integers in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205719 + HRESULT ID3DXBaseEffect::SetIntArray([In] D3DXHANDLE hParameter,[In, Buffer] const int* pn,[In] unsigned int Count) + ID3DXBaseEffect::SetIntArray +
+ + +

Gets an array of integers.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Returns an array of integers.

+

Number of integers in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205688 + HRESULT ID3DXBaseEffect::GetIntArray([In] D3DXHANDLE hParameter,[Out, Buffer] int* pn,[In] unsigned int Count) + ID3DXBaseEffect::GetIntArray +
+ + +

Sets a floating point value.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Floating point value.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205716 + HRESULT ID3DXBaseEffect::SetFloat([In] D3DXHANDLE hParameter,[In] float f) + ID3DXBaseEffect::SetFloat +
+ + +

Gets a floating point value.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Returns a floating point value.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205682 + HRESULT ID3DXBaseEffect::GetFloat([In] D3DXHANDLE hParameter,[Out] float* pf) + ID3DXBaseEffect::GetFloat +
+ + +

Sets an array of floating point values.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Array of floating point values.

+

Number of floating point values in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205717 + HRESULT ID3DXBaseEffect::SetFloatArray([In] D3DXHANDLE hParameter,[In, Buffer] const float* pf,[In] unsigned int Count) + ID3DXBaseEffect::SetFloatArray +
+ + +

Gets an array of floating point values.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Returns an array of floating point values.

+

Number of floating point values in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205683 + HRESULT ID3DXBaseEffect::GetFloatArray([In] D3DXHANDLE hParameter,[Out, Buffer] float* pf,[In] unsigned int Count) + ID3DXBaseEffect::GetFloatArray +
+ + +

Sets a vector.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Pointer to a 4D vector.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

If the destination vector is smaller than the source vector, the additional components of the source vector will be ignored.

+
+ + bb205729 + HRESULT ID3DXBaseEffect::SetVector([In] D3DXHANDLE hParameter,[In] const D3DXVECTOR4* pVector) + ID3DXBaseEffect::SetVector +
+ + +

Gets a vector.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Returns a 4D vector.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

If the destination vector is larger than the source vector, only the initial components of the destination vector will be filled, and the remaining components will be set to zero.

+
+ + bb205710 + HRESULT ID3DXBaseEffect::GetVector([In] D3DXHANDLE hParameter,[Out] D3DXVECTOR4* pVector) + ID3DXBaseEffect::GetVector +
+ + +

Sets an array of vectors.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Array of 4D floating point vectors.

+

Number of vectors in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

If the destination vectors are smaller than the source vectors, the additional components of the source vectors will be ignored.

+
+ + bb205730 + HRESULT ID3DXBaseEffect::SetVectorArray([In] D3DXHANDLE hParameter,[In, Buffer] const D3DXVECTOR4* pVector,[In] unsigned int Count) + ID3DXBaseEffect::SetVectorArray +
+ + +

Gets an array of vectors.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Returns an array of 4D floating point vectors.

+

Number of vectors in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

If the destination vectors are larger than the source vectors, only the initial components of each destination vector will be filled, and the remaining destination vector components will be set to zero.

+
+ + bb205711 + HRESULT ID3DXBaseEffect::GetVectorArray([In] D3DXHANDLE hParameter,[Out, Buffer] D3DXVECTOR4* pVector,[In] unsigned int Count) + ID3DXBaseEffect::GetVectorArray +
+ + +

Sets a non-transposed matrix.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Pointer to a nontransposed matrix. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A non-transposed matrix contains row-major data. In other words, each vector is contained in a row.

If the destination matrix is smaller than the source matrix, the additional components of the source matrix will be ignored.

+
+ + bb205720 + HRESULT ID3DXBaseEffect::SetMatrix([In] D3DXHANDLE hParameter,[In] const D3DXMATRIX* pMatrix) + ID3DXBaseEffect::SetMatrix +
+ + +

Gets a nontransposed matrix.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Returns a nontransposed matrix. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A nontransposed matrix contains row-major data; that is, each vector is contained in a row.

If the destination matrix is larger than the source matrix, only the upper-left components of the destination matrix will be filled, and the remaining components will be set to zero.

+
+ + bb205689 + HRESULT ID3DXBaseEffect::GetMatrix([In] D3DXHANDLE hParameter,[Out] D3DXMATRIX* pMatrix) + ID3DXBaseEffect::GetMatrix +
+ + +

Sets an array of nontransposed matrices.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Array of nontransposed matrices. See .

+

Number of matrices in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A nontransposed matrix contains row-major data; that is, each vector is contained in a row.

If the destination matrices are smaller than the source matrices, the additional components of the source matrices will be ignored.

+
+ + bb205721 + HRESULT ID3DXBaseEffect::SetMatrixArray([In] D3DXHANDLE hParameter,[In, Buffer] const D3DXMATRIX* pMatrix,[In] unsigned int Count) + ID3DXBaseEffect::SetMatrixArray +
+ + +

Gets an array of nontransposed matrices.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Returns an array of nontransposed matrices. See .

+

Number of matrices in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A nontransposed matrix contains row-major data; that is, each vector is contained in a row.

If the destination matrices are larger than the source matrices, only the upper-left components of each destination matrix will be filled, and the remaining destination matrix components will be set to zero.

+
+ + bb205690 + HRESULT ID3DXBaseEffect::GetMatrixArray([In] D3DXHANDLE hParameter,[Out, Buffer] D3DXMATRIX* pMatrix,[In] unsigned int Count) + ID3DXBaseEffect::GetMatrixArray +
+ + +

Sets an array of references to nontransposed matrices.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Array of references to nontransposed matrices. See .

+

Number of matrices in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A nontransposed matrix contains row-major data; that is, each vector is contained in a row.

If the destination matrices are smaller than the source matrices, the additional components of the source matrices will be ignored.

+
+ + bb205722 + HRESULT ID3DXBaseEffect::SetMatrixPointerArray([In] D3DXHANDLE hParameter,[In] const D3DXMATRIX** ppMatrix,[In] unsigned int Count) + ID3DXBaseEffect::SetMatrixPointerArray +
+ + +

Gets an array of references to nontransposed matrices.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Array of references to nontransposed matrices. See .

+

Number of matrices in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A nontransposed matrix contains row-major data; that is, each vector is contained in a row.

If the destination matrices are larger than the source matrices, only the upper-left components of each destination matrix will be filled, and the remaining destination matrix components will be set to zero.

+
+ + bb205691 + HRESULT ID3DXBaseEffect::GetMatrixPointerArray([In] D3DXHANDLE hParameter,[Out] D3DXMATRIX** ppMatrix,[In] unsigned int Count) + ID3DXBaseEffect::GetMatrixPointerArray +
+ + +

Sets a transposed matrix.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Pointer to a transposed matrix. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A transposed matrix contains column-major data; that is, each vector is contained in a column.

If the destination matrix is smaller than the source matrix, the additional components of the source matrix will be ignored.

+
+ + bb205723 + HRESULT ID3DXBaseEffect::SetMatrixTranspose([In] D3DXHANDLE hParameter,[In] const D3DXMATRIX* pMatrix) + ID3DXBaseEffect::SetMatrixTranspose +
+ + +

Gets a transposed matrix.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Returns a transposed matrix. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A transposed matrix contains column-major data; that is, each vector is contained in a column.

If the destination matrix is larger than the source matrix, only the upper-left elements of the destination matrix will be filled, and the remaining destination matrix components will be set to zero.

+
+ + bb205692 + HRESULT ID3DXBaseEffect::GetMatrixTranspose([In] D3DXHANDLE hParameter,[Out] D3DXMATRIX* pMatrix) + ID3DXBaseEffect::GetMatrixTranspose +
+ + +

Sets an array of transposed matrices.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Array of transposed matrices. See .

+

Number of matrices in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A transposed matrix contains column-major data; that is, each vector is contained in a column.

If the destination matrices are smaller than the source matrices, the additional components of the source matrices will be ignored.

+
+ + bb205724 + HRESULT ID3DXBaseEffect::SetMatrixTransposeArray([In] D3DXHANDLE hParameter,[In, Buffer] const D3DXMATRIX* pMatrix,[In] unsigned int Count) + ID3DXBaseEffect::SetMatrixTransposeArray +
+ + +

Gets an array of transposed matrices.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Returns an array of transposed matrices. See .

+

Number of matrices in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A transposed matrix contains column-major data; that is, each vector is contained in a column.

If the destination matrices are larger than the source matrices, only the upper-left components of each destination matrix will be filled, and the remaining destination matrix components will be set to zero.

+
+ + bb205693 + HRESULT ID3DXBaseEffect::GetMatrixTransposeArray([In] D3DXHANDLE hParameter,[Out, Buffer] D3DXMATRIX* pMatrix,[In] unsigned int Count) + ID3DXBaseEffect::GetMatrixTransposeArray +
+ + +

Sets an array of references to transposed matrices.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Array of references to transposed matrices. See .

+

Number of matrices in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A transposed matrix contains column-major data; that is, each vector is contained in a column.

If the destination matrices are smaller than the source matrices, the additional components of the source matrices will be ignored.

+
+ + bb205725 + HRESULT ID3DXBaseEffect::SetMatrixTransposePointerArray([In] D3DXHANDLE hParameter,[In] const D3DXMATRIX** ppMatrix,[In] unsigned int Count) + ID3DXBaseEffect::SetMatrixTransposePointerArray +
+ + +

Gets an array of references to transposed matrices.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Array of references to transposed matrices. See .

+

Number of matrices in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A transposed matrix contains column-major data; that is, each vector is contained in a column.

If the destination matrices are larger than the source matrices, only the upper-left components of each destination matrix will be filled, and the remaining destination matrix components will be set to zero.

+
+ + bb205694 + HRESULT ID3DXBaseEffect::GetMatrixTransposePointerArray([In] D3DXHANDLE hParameter,[Out] D3DXMATRIX** ppMatrix,[In] unsigned int Count) + ID3DXBaseEffect::GetMatrixTransposePointerArray +
+ + +

Sets a string.

+
+

Unique identifier. See Handles (Direct3D 9).

+

String to set.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205726 + HRESULT ID3DXBaseEffect::SetString([In] D3DXHANDLE hParameter,[In] const char* pString) + ID3DXBaseEffect::SetString +
+ + +

Gets a string.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Returns a string identified by hParameter.

+ + bb205704 + HRESULT ID3DXBaseEffect::GetString([In] D3DXHANDLE hParameter,[Out] const void** ppString) + ID3DXBaseEffect::GetString +
+ + +

Sets a texture.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Texture object. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205727 + HRESULT ID3DXBaseEffect::SetTexture([In] D3DXHANDLE hParameter,[In] IDirect3DBaseTexture9* pTexture) + ID3DXBaseEffect::SetTexture +
+ + +

Gets a texture.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Returns a texture object. See .

+ + bb205708 + HRESULT ID3DXBaseEffect::GetTexture([In] D3DXHANDLE hParameter,[Out] IDirect3DBaseTexture9** ppTexture) + ID3DXBaseEffect::GetTexture +
+ + +

Gets a pixel shader.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Returns a pixel shader object. See object.

+ + bb205703 + HRESULT ID3DXBaseEffect::GetPixelShader([In] D3DXHANDLE hParameter,[Out] IDirect3DPixelShader9** ppPShader) + ID3DXBaseEffect::GetPixelShader +
+ + +

Gets a vertex shader.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Returns a vertex shader object. See .

+ + bb205712 + HRESULT ID3DXBaseEffect::GetVertexShader([In] D3DXHANDLE hParameter,[Out] IDirect3DVertexShader9** ppVShader) + ID3DXBaseEffect::GetVertexShader +
+ + +

Set the range of an array to pass to the device.

+
+

Unique identifier. See Handles (Direct3D 9).

+

Start index.

+

Stop index.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205713 + HRESULT ID3DXBaseEffect::SetArrayRange([In] D3DXHANDLE hParameter,[In] unsigned int uStart,[In] unsigned int uEnd) + ID3DXBaseEffect::SetArrayRange +
+ + +

Applications use the methods of the interface to manipulate texture resources including cube and volume textures.

+
+ +

The interface assigned to a particular stage for a device is obtained by calling the GetTexture method.

The LPDIRECT3DBASETEXTURE9 and PDIRECT3DBASETEXTURE9 types are defined as references to the interface.

typedef struct  *LPDIRECT3DBASETEXTURE9, *PDIRECT3DBASETEXTURE9;
+
+ + bb174322 + IDirect3DBaseTexture9 + IDirect3DBaseTexture9 +
+ + + Filters mipmap levels of a texture. + + The source level. + The filter. + + A object describing the result of the operation. + + HRESULT D3DXFilterTexture([In] IDirect3DBaseTexture9* pBaseTexture,[In, Buffer] const PALETTEENTRY* pPalette,[In] unsigned int SrcLevel,[In] D3DX_FILTER Filter) + + + + Filters mipmap levels of a texture. + + The source level. + The filter. + The palette. + + A object describing the result of the operation. + + HRESULT D3DXFilterTexture([In] IDirect3DBaseTexture9* pBaseTexture,[In, Buffer] const PALETTEENTRY* pPalette,[In] unsigned int SrcLevel,[In] D3DX_FILTER Filter) + + + + Saves a texture to a file. + + The texture. + Name of the file. + The format. + + A object describing the result of the operation. + + HRESULT D3DXSaveTextureToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DBaseTexture9* pSrcTexture,[In, Buffer] const PALETTEENTRY* pSrcPalette) + + + + Saves a texture to a file. + + The texture. + Name of the file. + The format. + The palette. + A object describing the result of the operation. + HRESULT D3DXSaveTextureToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DBaseTexture9* pSrcTexture,[In, Buffer] const PALETTEENTRY* pSrcPalette) + + + + Saves a texture to a stream. + + The texture. + The format. + A containing the saved texture. + HRESULT D3DXSaveTextureToFileInMemory([Out] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DBaseTexture9* pSrcTexture,[In, Buffer] const PALETTEENTRY* pSrcPalette) + + + + Saves a texture to a stream. + + The texture. + The format. + The palette. + A containing the saved texture. + HRESULT D3DXSaveTextureToFileInMemory([Out] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DBaseTexture9* pSrcTexture,[In, Buffer] const PALETTEENTRY* pSrcPalette) + + + + Gets or sets the level of details. + + + The level of details. + + unsigned int IDirect3DBaseTexture9::GetLOD() + unsigned int IDirect3DBaseTexture9::SetLOD([In] unsigned int LODNew) + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Returns the number of texture levels in a multilevel texture.

+
+ +

Warning??If you create a texture with to make that texture automatically generate sublevels, GetLevelCount always returns 1 for the number of levels.

This method applies to the following interfaces, which inherit from .

+
+ + bb174325 + GetLevelCount + GetLevelCount + unsigned int IDirect3DBaseTexture9::GetLevelCount() +
+ + +

Get or sets the filter type that is used for automatically generated mipmap sublevels.

+
+ +

Changing the filter type "dirties" the mipmap sublevels and causes them to be regenerated.

The (default) filter type set at texture creation time is . If the driver doesn't support a linear filter, the filter type will be set to . All filter types supported by the driver for regular texture filtering are supported for autogeneration except . For each resource type, drivers should support all the filter types reported in the corresponding texture, CubeTexture, and volumetexture filter caps. For more information about texture types, see .

This method has no effect if the texture is not created with .

+
+ + bb174324 + GetAutoGenFilterType / SetAutoGenFilterType + GetAutoGenFilterType + D3DTEXTUREFILTERTYPE IDirect3DBaseTexture9::GetAutoGenFilterType() +
+ + +

Sets the most detailed level-of-detail for a managed texture.

+
+

Most detailed level-of-detail value to set for the mipmap chain.

+

A DWORD value, clamped to the maximum level-of-detail value (one less than the total number of levels). Subsequent calls to this method will return the clamped value, not the level-of-detail value that was previously set.

+ +

This method applies to the following interfaces, which inherit from .

SetLOD is used for level-of-detail control of managed textures. This method returns 0 on nonmanaged textures.

SetLOD communicates to the Direct3D texture manager the most detailed mipmap in the chain that should be loaded into local video memory. For example, in a five-level mipmap chain, setting LODNew to 2 indicates that the texture manager should load only mipmap levels 2 through 4 into local video memory at any given time.

More specifically, if the texture was created with the dimensions of 256x256, setting the most detailed level to 0 indicates that 256 x 256 is the largest mipmap available, setting the most detailed level to 1 indicates that 128 x 128 is the largest mipmap available, and so on, up to the most detailed mip level (the smallest texture size) for the chain.

+
+ + bb174328 + unsigned int IDirect3DBaseTexture9::SetLOD([In] unsigned int LODNew) + IDirect3DBaseTexture9::SetLOD +
+ + +

Returns a value clamped to the maximum level-of-detail set for a managed texture (this method is not supported for an unmanaged texture).

+
+

A DWORD value, clamped to the maximum level-of-detail value (one less than the total number of levels). Calling GetLOD on an unmanaged texture is not supported and will result in a D3DERR error code being returned.

+ + bb174326 + unsigned int IDirect3DBaseTexture9::GetLOD() + IDirect3DBaseTexture9::GetLOD +
+ + +

Returns the number of texture levels in a multilevel texture.

+
+

A DWORD value that indicates the number of texture levels in a multilevel texture.

+ +

Warning??If you create a texture with to make that texture automatically generate sublevels, GetLevelCount always returns 1 for the number of levels.

This method applies to the following interfaces, which inherit from .

+
+ + bb174325 + unsigned int IDirect3DBaseTexture9::GetLevelCount() + IDirect3DBaseTexture9::GetLevelCount +
+ + +

Set the filter type that is used for automatically generated mipmap sublevels.

+
+

Filter type. See . This method will fail if the filter type is invalid or not supported.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

Changing the filter type "dirties" the mipmap sublevels and causes them to be regenerated.

The (default) filter type set at texture creation time is . If the driver does not support a linear filter, the filter type will be set to . All filter types supported by the driver for regular texture filtering are supported for autogeneration except . SetAutoGenFilterType will fail unless the driver sets the appropriate D3DPTFILTERCAPS_MINFxxx caps. These values are specified in the TextureFilterCaps and/or CubeTextureFilterCaps members of . For more information about texture filter types, see .

This method has no effect if the texture is not created with . In this case, no failure is returned. For more information about usage constants, see .

+
+ + bb174327 + HRESULT IDirect3DBaseTexture9::SetAutoGenFilterType([In] D3DTEXTUREFILTERTYPE FilterType) + IDirect3DBaseTexture9::SetAutoGenFilterType +
+ + +

Get the filter type that is used for automatically generated mipmap sublevels.

+
+

Filter type. See . A texture must be created with to use this method. Any other usage value will cause this method to return .

+ +

Changing the filter type "dirties" the mipmap sublevels and causes them to be regenerated.

The (default) filter type set at texture creation time is . If the driver doesn't support a linear filter, the filter type will be set to . All filter types supported by the driver for regular texture filtering are supported for autogeneration except . For each resource type, drivers should support all the filter types reported in the corresponding texture, CubeTexture, and volumetexture filter caps. For more information about texture types, see .

This method has no effect if the texture is not created with .

+
+ + bb174324 + D3DTEXTUREFILTERTYPE IDirect3DBaseTexture9::GetAutoGenFilterType() + IDirect3DBaseTexture9::GetAutoGenFilterType +
+ + +

Generate mipmap sublevels.

+
+ +

An application can generate mipmap sublevels at any time by calling GenerateMipSubLevels. To have mipmap sublevels generated automatically at texture creation time (see Automatic Generation of Mipmaps (Direct3D 9)), specify during CreateTexture, CreateCubeTexture, and CreateVolumeTexture. For more information about usage constants, see .

+
+ + bb174323 + void IDirect3DBaseTexture9::GenerateMipSubLevels() + IDirect3DBaseTexture9::GenerateMipSubLevels +
+ + + No documentation. + + + bb280322 + D3DXBONECOMBINATION + D3DXBONECOMBINATION + + + + Get the bone identifiers. + + + + + No documentation. + + + bb280322 + unsigned int AttribId + unsigned int AttribId + + + + No documentation. + + + bb280322 + unsigned int FaceStart + unsigned int FaceStart + + + + No documentation. + + + bb280322 + unsigned int FaceCount + unsigned int FaceCount + + + + No documentation. + + + bb280322 + unsigned int VertexStart + unsigned int VertexStart + + + + No documentation. + + + bb280322 + unsigned int VertexCount + unsigned int VertexCount + + + + No documentation. + + + bb280322 + unsigned int* BoneId + unsigned int BoneId + + + +

Represents the capabilities of the hardware exposed through the Direct3D object.

+
+ +

The MaxTextureBlendStages and MaxSimultaneousTextures members might seem similar, but they contain different information. The MaxTextureBlendStages member contains the total number of texture-blending stages supported by the current device, and the MaxSimultaneousTextures member describes how many of those stages can have textures bound to them by using the SetTexture method.

When the driver fills this structure, it can set values for execute-buffer capabilities, even when the interface being used to retrieve the capabilities (such as ) does not support execute buffers.

In general, performance problems may occur if you use a texture and then modify it during a scene. Ensure that no texture used in the current BeginScene and EndScene block is evicted unless absolutely necessary. In the case of extremely high texture usage within a scene, the results are undefined. This occurs when you modify a texture that you have used in the scene and there is no spare texture memory available. For such systems, the contents of the z-buffer become invalid at EndScene. Applications should not call UpdateSurface to or from the back buffer on this type of hardware inside a BeginScene/EndScene pair. In addition, applications should not try to access the z-buffer if the capability flag is set. Finally, applications should not lock the back buffer or the z-buffer inside a BeginScene/EndScene pair.

The following flags concerning mipmapped textures are not supported in Direct3D 9.

  • D3DPTFILTERCAPS_LINEAR
  • D3DPTFILTERCAPS_LINEARMIPLINEAR
  • D3DPTFILTERCAPS_LINEARMIPNEAREST
  • D3DPTFILTERCAPS_MIPNEAREST
  • D3DPTFILTERCAPS_NEAREST
+
+ + bb172513 + D3DCAPS9 + D3DCAPS9 +
+ + + Gets the pixel shader version. + + + + + Gets the vertex shader version. + + + + +

Member of the enumerated type, which identifies what type of resources are used for processing vertices.

+
+ + bb172513 + D3DDEVTYPE DeviceType + D3DDEVTYPE DeviceType +
+ + +

Adapter on which this Direct3D device was created. This ordinal is valid only to pass to methods of the interface that created this Direct3D device. The interface can always be retrieved by calling GetDirect3D.

+
+ + bb172513 + unsigned int AdapterOrdinal + unsigned int AdapterOrdinal +
+ + +

The following driver-specific capability.

ValueMeaning

Display hardware is capable of returning the current scan line.

The display driver supports an overlay DDI that allows for verification of overlay capabilities. For more information about the overlay DDI, see Overlay DDI.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

?

+
+ + bb172513 + D3DCAPS Caps + D3DCAPS Caps +
+ + +

Driver-specific capabilities identified in .

+
+ + bb172513 + D3DCAPS2 Caps2 + D3DCAPS2 Caps2 +
+ + +

Driver-specific capabilities identified in .

+
+ + bb172513 + D3DCAPS3 Caps3 + D3DCAPS3 Caps3 +
+ + +

Bit mask of values representing what presentation swap intervals are available.

ValueMeaning

The driver supports an immediate presentation swap interval.

The driver supports a presentation swap interval of every screen refresh.

The driver supports a presentation swap interval of every second screen refresh.

The driver supports a presentation swap interval of every third screen refresh.

The driver supports a presentation swap interval of every fourth screen refresh.

?

+
+ + bb172513 + D3DPRESENT_INTERVAL PresentationIntervals + D3DPRESENT_INTERVAL PresentationIntervals +
+ + +

Bit mask indicating what hardware support is available for cursors. Direct3D 9 does not define alpha-blending cursor capabilities.

ValueMeaning

A full-color cursor is supported in hardware. Specifically, this flag indicates that the driver supports at least a hardware color cursor in high-resolution modes (with scan lines greater than or equal to 400).

A full-color cursor is supported in hardware. Specifically, this flag indicates that the driver supports a hardware color cursor in both high-resolution and low-resolution modes (with scan lines less than 400).

?

+
+ + bb172513 + D3DCURSORCAPS CursorCaps + D3DCURSORCAPS CursorCaps +
+ + +

Flags identifying the capabilities of the device.

ValueMeaning

Device supports blits from system-memory textures to nonlocal video-memory textures.

Device can queue rendering commands after a page flip. Applications do not change their behavior if this flag is set; this capability means that the device is relatively fast.

Device can support at least a DirectX 5-compliant driver.

Device can support at least a DirectX 7-compliant driver.

Device exports an -aware hal.

Device can use execute buffers from system memory.

Device can use execute buffers from video memory.

Device has hardware acceleration for scene rasterization.

Device can support transformation and lighting in hardware.

Device supports N patches.

Device can support rasterization, transform, lighting, and shading in hardware.

Device supports quintic B?zier curves and B-splines.

Device supports rectangular and triangular patches.

When this device capability is set, the hardware architecture does not require caching of any information, and uncached patches (handle zero) will be drawn as efficiently as cached ones. Note that setting does not mean that a patch with handle zero can be drawn. A handle-zero patch can always be drawn whether this cap is set or not.

Device is texturing from separate memory pools.

Device can retrieve textures from non-local video memory.

Device can retrieve textures from system memory.

Device can retrieve textures from device memory.

Device can use buffers from system memory for transformed and lit vertices.

Device can use buffers from video memory for transformed and lit vertices.

?

+
+ + bb172513 + D3DDEVCAPS DevCaps + D3DDEVCAPS DevCaps +
+ + +

Miscellaneous driver primitive capabilities. See .

+
+ + bb172513 + D3DPMISCCAPS PrimitiveMiscCaps + D3DPMISCCAPS PrimitiveMiscCaps +
+ + +

Information on raster-drawing capabilities. This member can be one or more of the following flags.

ValueMeaning

Device supports anisotropic filtering.

Device iterates colors perspective correctly.

Device can dither to improve color resolution.

Device supports legacy depth bias. For true depth bias, see .

Device supports range-based fog. In range-based fog, the distance of an object from the viewer is used to compute fog effects, not the depth of the object (that is, the z-coordinate) in the scene.

Device calculates the fog value by referring to a lookup table containing fog values that are indexed to the depth of a given pixel.

Device calculates the fog value during the lighting operation and interpolates the fog value during rasterization.

Device supports level-of-detail bias adjustments. These bias adjustments enable an application to make a mipmap appear crisper or less sharp than it normally would. For more information about level-of-detail bias in mipmaps, see .

Device supports toggling multisampling on and off between and (using ).

Device supports scissor test. See Scissor Test (Direct3D 9).

Device performs true slope-scale based depth bias. This is in contrast to the legacy style depth bias.

Device supports depth buffering using w.

Device supports w-based fog. W-based fog is used when a perspective projection matrix is specified, but affine projections still use z-based fog. The system considers a projection matrix that contains a nonzero value in the [3][4] element to be a perspective projection matrix.

Device can perform hidden-surface removal (HSR) without requiring the application to sort polygons and without requiring the allocation of a depth-buffer. This leaves more video memory for textures. The method used to perform HSR is hardware-dependent and is transparent to the application.

Z-bufferless HSR is performed if no depth-buffer surface is associated with the rendering-target surface and the depth-buffer comparison test is enabled (that is, when the state value associated with the enumeration constant is set to TRUE).

Device supports z-based fog.

Device can perform z-test operations. This effectively renders a primitive and indicates whether any z pixels have been rendered.

?

+
+ + bb172513 + D3DPRASTERCAPS RasterCaps + D3DPRASTERCAPS RasterCaps +
+ + +

Z-buffer comparison capabilities. This member can be one or more of the following flags.

ValueMeaning

Always pass the z-test.

Pass the z-test if the new z equals the current z.

Pass the z-test if the new z is greater than the current z.

Pass the z-test if the new z is greater than or equal to the current z.

Pass the z-test if the new z is less than the current z.

Pass the z-test if the new z is less than or equal to the current z.

Always fail the z-test.

Pass the z-test if the new z does not equal the current z.

?

+
+ + bb172513 + D3DPCMPCAPS ZCmpCaps + D3DPCMPCAPS ZCmpCaps +
+ + +

Source-blending capabilities. This member can be one or more of the following flags. (The RGBA values of the source and destination are indicated by the subscripts s and d.)

ValueMeaning

The driver supports both and . See .

Source blend factor is (1 - As, 1 - As, 1 - As, 1 - As) and destination blend factor is (As, As, As, As); the destination blend selection is overridden.

The driver supports the blend mode. (This blend mode is obsolete. For more information, see .)

Blend factor is (Ad, Ad, Ad, Ad).

Blend factor is (Rd, Gd, Bd, Ad).

Blend factor is (1 - Ad, 1 - Ad, 1 - Ad, 1 - Ad).

Blend factor is (1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad).

Blend factor is (1 - As, 1 - As, 1 - As, 1 - As).

Blend factor is (1 - Rs, 1 - Gs, 1 - Bs, 1 - As).

Blend factor is (1 - PSOutColor[1]r, 1 - PSOutColor[1]g, 1 - PSOutColor[1]b, not used)). See Render Target Blending.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

Blend factor is (1, 1, 1, 1).

Blend factor is (As, As, As, As).

Blend factor is (f, f, f, 1); f = min(As, 1 - Ad).

Blend factor is (Rs, Gs, Bs, As).

Blend factor is (PSOutColor[1]r, PSOutColor[1]g, PSOutColor[1]b, not used). See Render Target Blending.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

Blend factor is (0, 0, 0, 0).

?

+
+ + bb172513 + D3DPBLENDCAPS SrcBlendCaps + D3DPBLENDCAPS SrcBlendCaps +
+ + +

Destination-blending capabilities. This member can be the same capabilities that are defined for the SrcBlendCaps member.

+
+ + bb172513 + D3DPBLENDCAPS DestBlendCaps + D3DPBLENDCAPS DestBlendCaps +
+ + +

Alpha-test comparison capabilities. This member can include the same capability flags defined for the ZCmpCaps member. If this member contains only the capability or only the capability, the driver does not support alpha tests. Otherwise, the flags identify the individual comparisons that are supported for alpha testing.

+
+ + bb172513 + D3DPCMPCAPS AlphaCmpCaps + D3DPCMPCAPS AlphaCmpCaps +
+ + +

Shading operations capabilities. It is assumed, in general, that if a device supports a given command at all, it supports the mode (as specified in the enumerated type). This flag specifies whether the driver can also support Gouraud shading and whether alpha color components are supported. When alpha components are not supported, the alpha value of colors generated is implicitly 255. This is the maximum possible alpha (that is, the alpha component is at full intensity).

The color, specular highlights, fog, and alpha interpolants of a triangle each have capability flags that an application can use to find out how they are implemented by the device driver.

This member can be one or more of the following flags.

ValueMeaning

Device can support an alpha component for Gouraud-blended transparency (the state for the enumerated type). In this mode, the alpha color component of a primitive is provided at vertices and interpolated across a face along with the other color components.

Device can support colored Gouraud shading. In this mode, the per-vertex color components (red, green, and blue) are interpolated across a triangle face.

Device can support fog in the Gouraud shading mode.

Device supports Gouraud shading of specular highlights.

?

+
+ + bb172513 + D3DPSHADECAPS ShadeCaps + D3DPSHADECAPS ShadeCaps +
+ + +

Miscellaneous texture-mapping capabilities. This member can be one or more of the following flags.

ValueMeaning

Alpha in texture pixels is supported.

Device can draw alpha from texture palettes.

Supports cube textures.

Device requires that cube texture maps have dimensions specified as powers of two.

Device supports mipmapped cube textures.

Device supports mipmapped textures.

Device supports mipmapped volume textures.

is also set, conditionally supports the use of 2D textures with dimensions that are not powers of two. A device that exposes this capability can use such a texture if all of the following requirements are met.

  • The texture addressing mode for the texture stage is set to .
  • Texture wrapping for the texture stage is disabled (D3DRS_WRAP n set to 0).
  • Mipmapping is not in use (use magnification filter only).
  • Texture formats must not be through .

If this flag is not set, and is also not set, then unconditional support is provided for 2D textures with dimensions that are not powers of two.

A texture that is not a power of two cannot be set at a stage that will be read based on a shader computation (such as the bem - ps and texm3x3 - ps instructions in pixel shaders versions 1_0 to 1_3). For example, these textures can be used to store bumps that will be fed into texture reads, but not the environment maps that are used in texbem - ps, texbeml - ps, and texm3x3spec - ps. This means that a texture with dimensions that are not powers of two cannot be addressed or sampled using texture coordinates computed within the shader. This type of operation is known as a dependent read and cannot be performed on these types of textures.

Device does not support a projected bump-environment loopkup operation in programmable and fixed function shaders.

Perspective correction texturing is supported.

If is not set, all textures must have widths and heights specified as powers of two. This requirement does not apply to either cube textures or volume textures.

If is also set, conditionally supports the use of 2D textures with dimensions that are not powers of two. See description.

If this flag is not set, and is also not set, then unconditional support is provided for 2D textures with dimensions that are not powers of two.

Supports the texture transformation flag. When applied, the device divides transformed texture coordinates by the last texture coordinate. If this capability is present, then the projective divide occurs per pixel. If this capability is not present, but the projective divide needs to occur anyway, then it is performed on a per-vertex basis by the Direct3D runtime.

All textures must be square.

Texture indices are not scaled by the texture size prior to interpolation.

Device supports volume textures.

Device requires that volume texture maps have dimensions specified as powers of two.

?

+
+ + bb172513 + D3DPTEXTURECAPS TextureCaps + D3DPTEXTURECAPS TextureCaps +
+ + +

Texture-filtering capabilities for a texture. Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture blending. This member can be any combination of the per-stage texture-filtering flags defined in .

+
+ + bb172513 + D3DPTFILTERCAPS TextureFilterCaps + D3DPTFILTERCAPS TextureFilterCaps +
+ + +

Texture-filtering capabilities for a cube texture. Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture blending. This member can be any combination of the per-stage texture-filtering flags defined in .

+
+ + bb172513 + D3DPTFILTERCAPS CubeTextureFilterCaps + D3DPTFILTERCAPS CubeTextureFilterCaps +
+ + +

Texture-filtering capabilities for a volume texture. Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture blending. This member can be any combination of the per-stage texture-filtering flags defined in .

+
+ + bb172513 + D3DPTFILTERCAPS VolumeTextureFilterCaps + D3DPTFILTERCAPS VolumeTextureFilterCaps +
+ + +

Texture-addressing capabilities for texture objects. This member can be one or more of the following flags.

ValueMeaning

Device supports setting coordinates outside the range [0.0, 1.0] to the border color, as specified by the texture-stage state.

Device can clamp textures to addresses.

Device can separate the texture-addressing modes of the u and v coordinates of the texture. This ability corresponds to the and render-state values.

Device can mirror textures to addresses.

Device can take the absolute value of the texture coordinate (thus, mirroring around 0) and then clamp to the maximum value.

Device can wrap textures to addresses.

?

+
+ + bb172513 + D3DPTADDRESSCAPS TextureAddressCaps + D3DPTADDRESSCAPS TextureAddressCaps +
+ + +

Texture-addressing capabilities for a volume texture. This member can be one or more of the flags defined for the TextureAddressCaps member.

+
+ + bb172513 + D3DPTADDRESSCAPS VolumeTextureAddressCaps + D3DPTADDRESSCAPS VolumeTextureAddressCaps +
+ + +

Defines the capabilities for line-drawing primitives.

ValueMeaning

Supports alpha-test comparisons.

Antialiased lines are supported.

Supports source-blending.

Supports fog.

Supports texture-mapping.

Supports z-buffer comparisons.

?

+
+ + bb172513 + D3DLINECAPS LineCaps + D3DLINECAPS LineCaps +
+ + +

Maximum texture width for this device.

+
+ + bb172513 + unsigned int MaxTextureWidth + unsigned int MaxTextureWidth +
+ + +

Maximum texture height for this device.

+
+ + bb172513 + unsigned int MaxTextureHeight + unsigned int MaxTextureHeight +
+ + +

Maximum value for any of the three dimensions (width, height, and depth) of a volume texture.

+
+ + bb172513 + unsigned int MaxVolumeExtent + unsigned int MaxVolumeExtent +
+ + +

This number represents the maximum range of the integer bits of the post-normalized texture coordinates. A texture coordinate is stored as a 32-bit signed integer using 27 bits to store the integer part and 5 bits for the floating point fraction. The maximum integer index, 227, is used to determine the maximum texture coordinate, depending on how the hardware does texture-coordinate scaling.

Some hardware reports the cap . For this case, the device defers scaling texture coordinates by the texture size until after interpolation and application of the texture address mode, so the number of times a texture can be wrapped is given by the integer value in MaxTextureRepeat.

Less desirably, on some hardware is not set and the device scales the texture coordinates by the texture size (using the highest level of detail) prior to interpolation. This limits the number of times a texture can be wrapped to MaxTextureRepeat / texture size.

For example, assume that MaxTextureRepeat is equal to 32k and the size of the texture is 4k. If the hardware sets , then the number of times a texture can be wrapped is equal to MaxTextureRepeat, which is 32k in this example. Otherwise, the number of times a texture can be wrapped is equal to MaxTextureRepeat divided by texture size, which is 32k/4k in this example.

+
+ + bb172513 + unsigned int MaxTextureRepeat + unsigned int MaxTextureRepeat +
+ + +

Maximum texture aspect ratio supported by the hardware, typically a power of 2.

+
+ + bb172513 + unsigned int MaxTextureAspectRatio + unsigned int MaxTextureAspectRatio +
+ + +

Maximum valid value for the texture-stage state.

+
+ + bb172513 + unsigned int MaxAnisotropy + unsigned int MaxAnisotropy +
+ + +

Maximum W-based depth value that the device supports.

+
+ + bb172513 + float MaxVertexW + float MaxVertexW +
+ + +

Screen-space coordinate of the guard-band clipping region. Coordinates inside this rectangle but outside the viewport rectangle are automatically clipped.

+
+ + bb172513 + float GuardBandLeft + float GuardBandLeft +
+ + +

Screen-space coordinate of the guard-band clipping region. Coordinates inside this rectangle but outside the viewport rectangle are automatically clipped.

+
+ + bb172513 + float GuardBandTop + float GuardBandTop +
+ + +

Screen-space coordinate of the guard-band clipping region. Coordinates inside this rectangle but outside the viewport rectangle are automatically clipped.

+
+ + bb172513 + float GuardBandRight + float GuardBandRight +
+ + +

Screen-space coordinate of the guard-band clipping region. Coordinates inside this rectangle but outside the viewport rectangle are automatically clipped.

+
+ + bb172513 + float GuardBandBottom + float GuardBandBottom +
+ + +

Number of pixels to adjust the extents rectangle outward to accommodate antialiasing kernels.

+
+ + bb172513 + float ExtentsAdjust + float ExtentsAdjust +
+ + +

Flags specifying supported stencil-buffer operations. Stencil operations are assumed to be valid for all three stencil-buffer operation render states (, , and ).

For more information, see .

+
+ + bb172513 + D3DSTENCILCAPS StencilCaps + D3DSTENCILCAPS StencilCaps +
+ + +

Flexible vertex format capabilities.

ValueMeaning

It is preferable that vertex elements not be stripped. That is, if the vertex format contains elements that are not used with the current render states, there is no need to regenerate the vertices. If this capability flag is not present, stripping extraneous elements from the vertex format provides better performance.

Point size is determined by either the render state or the vertex data. If an FVF is used, point size can come from point size data in the vertex declaration. Otherwise, point size is determined by the render state . If the application provides point size in both (the render state and the vertex declaration), the vertex data overrides the render-state data.

Masks the low WORD of FVFCaps. These bits, cast to the WORD data type, describe the total number of texture coordinate sets that the device can simultaneously use for multiple texture blending. (You can use up to eight texture coordinate sets for any vertex, but the device can blend using only the specified number of texture coordinate sets.)

?

+
+ + bb172513 + D3DFVFCAPS FVFCaps + D3DFVFCAPS FVFCaps +
+ + +

Combination of flags describing the texture operations supported by this device. The following flags are defined.

ValueMeaning

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

?

+
+ + bb172513 + D3DTEXOPCAPS TextureOpCaps + D3DTEXOPCAPS TextureOpCaps +
+ + +

Maximum number of texture-blending stages supported in the fixed function pipeline. This value is the number of blenders available. In the programmable pixel pipeline, this corresponds to the number of unique texture registers used by pixel shader instructions.

+
+ + bb172513 + unsigned int MaxTextureBlendStages + unsigned int MaxTextureBlendStages +
+ + +

Maximum number of textures that can be simultaneously bound to the fixed-function pipeline sampler stages. If the same texture is bound to two sampler stages, it counts as two textures.

This value has no meaning in the programmable pipeline where the number of sampler stages is determined by each pixel shader version. Each pixel shader version also determines the number of texture declaration instructions. See Pixel Shaders.

+
+ + bb172513 + unsigned int MaxSimultaneousTextures + unsigned int MaxSimultaneousTextures +
+ + +

Vertex processing capabilities. For a given physical device, this capability might vary across Direct3D devices depending on the parameters supplied to CreateDevice. See .

+
+ + bb172513 + D3DVTXPCAPS VertexProcessingCaps + D3DVTXPCAPS VertexProcessingCaps +
+ + +

Maximum number of lights that can be active simultaneously. For a given physical device, this capability might vary across Direct3D devices depending on the parameters supplied to CreateDevice.

+
+ + bb172513 + unsigned int MaxActiveLights + unsigned int MaxActiveLights +
+ + +

Maximum number of user-defined clipping planes supported. This member can be 0. For a given physical device, this capability may vary across Direct3D devices depending on the parameters supplied to CreateDevice.

+
+ + bb172513 + unsigned int MaxUserClipPlanes + unsigned int MaxUserClipPlanes +
+ + +

Maximum number of matrices that this device can apply when performing multimatrix vertex blending. For a given physical device, this capability may vary across Direct3D devices depending on the parameters supplied to CreateDevice.

+
+ + bb172513 + unsigned int MaxVertexBlendMatrices + unsigned int MaxVertexBlendMatrices +
+ + +

DWORD value that specifies the maximum matrix index that can be indexed into using the per-vertex indices. The number of matrices is MaxVertexBlendMatrixIndex + 1, which is the size of the matrix palette. If normals are present in the vertex data that needs to be blended for lighting, then the number of matrices is half the number specified by this capability flag. If MaxVertexBlendMatrixIndex is set to zero, the driver does not support indexed vertex blending. If this value is not zero then the valid range of indices is zero through MaxVertexBlendMatrixIndex.

A zero value for MaxVertexBlendMatrixIndex indicates that the driver does not support indexed matrices.

When software vertex processing is used, 256 matrices could be used for indexed vertex blending, with or without normal blending.

For a given physical device, this capability may vary across Direct3D devices depending on the parameters supplied to CreateDevice.

+
+ + bb172513 + unsigned int MaxVertexBlendMatrixIndex + unsigned int MaxVertexBlendMatrixIndex +
+ + +

Maximum size of a point primitive. If set to 1.0f then device does not support point size control. The range is greater than or equal to 1.0f.

+
+ + bb172513 + float MaxPointSize + float MaxPointSize +
+ + +

Maximum number of primitives for each DrawPrimitive call. There are two cases: +

  • If MaxPrimitiveCount is not equal to 0xffff, you can draw at most MaxPrimitiveCount primitives with each draw call.
  • However, if MaxPrimitiveCount equals 0xffff, you can still draw at most MaxPrimitiveCount primitive, but you may also use no more than MaxPrimitiveCount unique vertices (since each primitive can potentially use three different vertices).
+
+ + bb172513 + unsigned int MaxPrimitiveCount + unsigned int MaxPrimitiveCount +
+ + +

Maximum size of indices supported for hardware vertex processing. It is possible to create 32-bit index buffers; however, you will not be able to render with the index buffer unless this value is greater than 0x0000FFFF.

+
+ + bb172513 + unsigned int MaxVertexIndex + unsigned int MaxVertexIndex +
+ + +

Maximum number of concurrent data streams for SetStreamSource. The valid range is 1 to 16. Note that if this value is 0, then the driver is not a Direct3D 9 driver.

+
+ + bb172513 + unsigned int MaxStreams + unsigned int MaxStreams +
+ + +

Maximum stride for SetStreamSource.

+
+ + bb172513 + unsigned int MaxStreamStride + unsigned int MaxStreamStride +
+ + +

Two numbers that represent the vertex shader main and sub versions. For more information about the instructions supported for each vertex shader version, see Version 1_x, Version 2_0, Version 2_0 Extended, or Version 3_0.

+
+ + bb172513 + unsigned int VertexShaderVersion + unsigned int VertexShaderVersion +
+ + +

The number of vertex shader Vertex Shader Registers that are reserved for constants.

+
+ + bb172513 + unsigned int MaxVertexShaderConst + unsigned int MaxVertexShaderConst +
+ + +

Two numbers that represent the pixel shader main and sub versions. For more information about the instructions supported for each pixel shader version, see Version 1_x, Version 2_0, Version 2_0 Extended, or Version 3_0.

+
+ + bb172513 + unsigned int PixelShaderVersion + unsigned int PixelShaderVersion +
+ + +

Maximum value of pixel shader arithmetic component. This value indicates the internal range of values supported for pixel color blending operations. Within the range that they report to, implementations must allow data to pass through pixel processing unmodified (unclamped). Normally, the value of this member is an absolute value. For example, a 1.0 indicates that the range is -1.0 to 1, and an 8.0 indicates that the range is -8.0 to 8.0. The value must be >= 1.0 for any hardware that supports pixel shaders.

+
+ + bb172513 + float PixelShader1xMaxValue + float PixelShader1xMaxValue +
+ + +

Device driver capabilities for adaptive tessellation. For more information, see

+
+ + bb172513 + D3DDEVCAPS2 DevCaps2 + D3DDEVCAPS2 DevCaps2 +
+ + +

This number indicates which device is the master for this subordinate. This number is taken from the same space as the adapter values.

For multihead support, one head will be denoted the master head, and all other heads on the same card will be denoted subordinate heads. If more than one multihead adapter is present in a system, the master and its subordinates from one multihead adapter are called a group.

+
+ + bb172513 + float MaxNpatchTessellationLevel + float MaxNpatchTessellationLevel +
+ + +

This number indicates the order in which heads are referenced by the API. The value for the master adapter is always 0. These values do not correspond to the adapter ordinals. They apply only to heads within a group.

+
+ + bb172513 + unsigned int Reserved5 + unsigned int Reserved5 +
+ + +

This number indicates which device is the master for this subordinate. This number is taken from the same space as the adapter values.

For multihead support, one head will be denoted the master head, and all other heads on the same card will be denoted subordinate heads. If more than one multihead adapter is present in a system, the master and its subordinates from one multihead adapter are called a group.

+
+ + bb172513 + unsigned int MasterAdapterOrdinal + unsigned int MasterAdapterOrdinal +
+ + +

This number indicates the order in which heads are referenced by the API. The value for the master adapter is always 0. These values do not correspond to the adapter ordinals. They apply only to heads within a group.

+
+ + bb172513 + unsigned int AdapterOrdinalInGroup + unsigned int AdapterOrdinalInGroup +
+ + +

Number of adapters in this adapter group (only if master). This will be 1 for conventional adapters. The value will be greater than 1 for the master adapter of a multihead card. The value will be 0 for a subordinate adapter of a multihead card. Each card can have at most one master, but may have many subordinates.

+
+ + bb172513 + unsigned int NumberOfAdaptersInGroup + unsigned int NumberOfAdaptersInGroup +
+ + +

A combination of one or more data types contained in a vertex declaration. See .

+
+ + bb172513 + D3DDTCAPS DeclTypes + D3DDTCAPS DeclTypes +
+ + +

Number of simultaneous render targets. This number must be at least one.

+
+ + bb172513 + unsigned int NumSimultaneousRTs + unsigned int NumSimultaneousRTs +
+ + +

Combination of constants that describe the operations supported by StretchRect. The flags that may be set in this field are:

ConstantDescription
Device supports point-sample filtering for minifying rectangles. This filter type is requested by calling StretchRect using .
Device supports point-sample filtering for magnifying rectangles. This filter type is requested by calling StretchRect using .
Device supports bilinear interpolation filtering for minifying rectangles. This filter type is requested by calling StretchRect using .
Device supports bilinear interpolation filtering for magnifying rectangles. This filter type is requested by calling StretchRect using .

?

For more information, see and .

+
+ + bb172513 + D3DPTFILTERCAPS StretchRectFilterCaps + D3DPTFILTERCAPS StretchRectFilterCaps +
+ + +

Device supports vertex shader version 2_0 extended capability. See .

+
+ + bb172513 + D3DVSHADERCAPS2_0 VS20Caps + D3DVSHADERCAPS2_0 VS20Caps +
+ + +

Device supports pixel shader version 2_0 extended capability. See .

+
+ + bb172513 + D3DPSHADERCAPS2_0 PS20Caps + D3DPSHADERCAPS2_0 PS20Caps +
+ + +

Device supports vertex shader texture filter capability. See .

+
+ + bb172513 + D3DPTFILTERCAPS VertexTextureFilterCaps + D3DPTFILTERCAPS VertexTextureFilterCaps +
+ + +

Maximum number of vertex shader instructions that can be run when using flow control. The maximum number of instructions that can be programmed is MaxVertexShader30InstructionSlots.

+
+ + bb172513 + unsigned int MaxVShaderInstructionsExecuted + unsigned int MaxVShaderInstructionsExecuted +
+ + +

Maximum number of pixel shader instructions that can be run when using flow control. The maximum number of instructions that can be programmed is MaxPixelShader30InstructionSlots.

+
+ + bb172513 + unsigned int MaxPShaderInstructionsExecuted + unsigned int MaxPShaderInstructionsExecuted +
+ + +

Maximum number of vertex shader instruction slots supported. The maximum value that can be set on this cap is 32768. Devices that support vs_3_0 are required to support at least 512 instruction slots.

+
+ + bb172513 + unsigned int MaxVertexShader30InstructionSlots + unsigned int MaxVertexShader30InstructionSlots +
+ + +

Maximum number of pixel shader instruction slots supported. The maximum value that can be set on this cap is 32768. Devices that support ps_3_0 are required to support at least 512 instruction slots.

+
+ + bb172513 + unsigned int MaxPixelShader30InstructionSlots + unsigned int MaxPixelShader30InstructionSlots +
+ + + Shader compilation results. + + + + + Initializes a new instance of the class. + + The bytecode. + The result code. + The message. + + + + Performs an implicit conversion from to . + + The input. + + The result of the conversion. + + + + +

The interface is used to access the constant table. This table contains the variables that are used by high-level language shaders and effects.

+
+ +

The LPD3DXCONSTANTTABLE type is defined as a reference to the interface.

 typedef interface  ;	
+            typedef interface  *LPD3DXCONSTANTTABLE;	
+            
+
+ + bb205762 + ID3DXConstantTable + ID3DXConstantTable +
+ + + Gets the buffer. + + + + + Gets a single constant description in the constant table. + + The effect handle. + The constant description + HRESULT ID3DXConstantTable::GetConstantDesc([In] D3DXHANDLE hConstant,[Out, Buffer] D3DXCONSTANT_DESC* pConstantDesc,[InOut] unsigned int* pCount) + + + + Gets an array of constant descriptions in the constant table. + + The effect handle. + An array of constant descriptions + HRESULT ID3DXConstantTable::GetConstantDesc([In] D3DXHANDLE hConstant,[Out, Buffer] D3DXCONSTANT_DESC* pConstantDesc,[InOut] unsigned int* pCount) + + + + Sets a bool value. + + The device. + The effect handle. + The value. + + A object describing the result of the operation. + + HRESULT ID3DXConstantTable::SetBool([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] BOOL b) + + + + Sets a float value. + + The device. + The effect handle. + The value. + + A object describing the result of the operation. + + HRESULT ID3DXConstantTable::SetFloat([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] float f) + + + + Sets an int value. + + The device. + The effect handle. + The value. + + A object describing the result of the operation. + + HRESULT ID3DXConstantTable::SetInt([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] int n) + + + + Sets a matrix. + + The device. + The effect handle. + The value. + + A object describing the result of the operation. + + HRESULT ID3DXConstantTable::SetMatrix([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const D3DXMATRIX* pMatrix) + + + + Sets a 4D vector. + + The device. + The effect handle. + The value. + + A object describing the result of the operation. + + HRESULT ID3DXConstantTable::SetVector([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const D3DXVECTOR4* pVector) + + + + Sets a typed value. + + Type of the value to set + The device. + The effect handle. + The value. + + A object describing the result of the operation. + + HRESULT ID3DXConstantTable::SetValue([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const void* pData,[In] unsigned int Bytes) + + + + Sets an array of bools. + + The device. + The effect handle. + The values. + A object describing the result of the operation. + HRESULT ID3DXConstantTable::SetBoolArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const BOOL* pb,[In] unsigned int Count) + + + + Sets an array of floats. + + The device. + The effect handle. + The values. + A object describing the result of the operation. + HRESULT ID3DXConstantTable::SetFloatArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const float* pf,[In] unsigned int Count) + + + + Sets an array of ints. + + The device. + The effect handle. + The values. + A object describing the result of the operation. + HRESULT ID3DXConstantTable::SetIntArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const int* pn,[In] unsigned int Count) + + + + Sets an array of matrices. + + The device. + The effect handle. + The values. + A object describing the result of the operation. + HRESULT ID3DXConstantTable::SetMatrixArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const D3DXMATRIX* pMatrix,[In] unsigned int Count) + + + + Sets an array of 4D vectors. + + The device. + The effect handle. + The values. + A object describing the result of the operation. + HRESULT ID3DXConstantTable::SetVectorArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const D3DXVECTOR4* pVector,[In] unsigned int Count) + + + + Sets an array of elements. + + Type of the array element + The device. + The effect handle. + The values. + + A object describing the result of the operation. + + HRESULT ID3DXConstantTable::SetValue([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const void* pData,[In] unsigned int Bytes) + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Gets a reference to the buffer that contains the constant table.

+
+ + bb205763 + GetBufferPointer + GetBufferPointer + void* ID3DXConstantTable::GetBufferPointer() +
+ + +

Gets the buffer size of the constant table.

+
+ + bb205764 + GetBufferSize + GetBufferSize + unsigned int ID3DXConstantTable::GetBufferSize() +
+ + +

Gets a description of the constant table.

+
+ + bb205769 + GetDesc + GetDesc + HRESULT ID3DXConstantTable::GetDesc([Out] D3DXCONSTANTTABLE_DESC* pDesc) +
+ + +

Gets a reference to the buffer that contains the constant table.

+
+

Returns a reference the buffer.

+ + bb205763 + void* ID3DXConstantTable::GetBufferPointer() + ID3DXConstantTable::GetBufferPointer +
+ + +

Gets the buffer size of the constant table.

+
+

Returns the size of the buffer, in bytes.

+ + bb205764 + unsigned int ID3DXConstantTable::GetBufferSize() + ID3DXConstantTable::GetBufferSize +
+ + +

Gets a description of the constant table.

+
+

Description of the constant table. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ + bb205769 + HRESULT ID3DXConstantTable::GetDesc([Out] D3DXCONSTANTTABLE_DESC* pDesc) + ID3DXConstantTable::GetDesc +
+ + +

Gets a reference to an array of constant descriptions in the constant table.

+
+

Unique identifier to a constant. See .

+

Returns a reference to an array of descriptions. See .

+

The input supplied must be the maximum size of the array. The output is the number of elements that are filled in the array when the function returns.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

will sometimes return a with a Register_Count of 0. This will happen with a constant appears in more than one Register_Set but does not have space in that register set allocated.

Because a sampler can appear more than once in a constant table, this method can return an array of descriptions, each one with a different register index.

+
+ + bb205767 + HRESULT ID3DXConstantTable::GetConstantDesc([In] D3DXHANDLE hConstant,[Out, Buffer] D3DXCONSTANT_DESC* pConstantDesc,[InOut] unsigned int* pCount) + ID3DXConstantTable::GetConstantDesc +
+ + +

Returns the sampler index.

+
+

The sampler handle.

+

Returns the sampler index number from the constant table.

+ + bb205770 + unsigned int ID3DXConstantTable::GetSamplerIndex([In] D3DXHANDLE hConstant) + ID3DXConstantTable::GetSamplerIndex +
+ + +

Gets a constant by looking up its index.

+
+

Unique identifier to the parent data structure. If the constant is a top-level parameter (there is no parent data structure), use null.

+

Zero-based index of the constant.

+

Returns a unique identifier to the constant.

+ +

To get a constant from an array of constants, use .

+
+ + bb205765 + D3DXHANDLE ID3DXConstantTable::GetConstant([In] D3DXHANDLE hConstant,[In] unsigned int Index) + ID3DXConstantTable::GetConstant +
+ + +

Gets a constant by looking up its name.

+
+

Unique identifier to the parent data structure. If the constant is a top-level parameter (there is no parent data structure), use null.

+

Name of the constant.

+

Returns a unique identifier to the constant.

+ + bb205766 + D3DXHANDLE ID3DXConstantTable::GetConstantByName([In] D3DXHANDLE hConstant,[In] const char* pName) + ID3DXConstantTable::GetConstantByName +
+ + +

Gets a constant from an array of constants. An array is made up of elements.

+
+

Unique identifier to the array of constants. This value may not be null.

+

Zero-based index of the element in the array.

+

Returns a unique identifier to the element constant.

+ +

To get a constant that is not part of an array, use or .

+
+ + bb205768 + D3DXHANDLE ID3DXConstantTable::GetConstantElement([In] D3DXHANDLE hConstant,[In] unsigned int Index) + ID3DXConstantTable::GetConstantElement +
+ + +

Sets the constants to their default values. The default values are declared in the variable declarations in the shader.

+
+

Pointer to an interface, representing the device associated with the constant table.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205773 + HRESULT ID3DXConstantTable::SetDefaults([In] IDirect3DDevice9* pDevice) + ID3DXConstantTable::SetDefaults +
+ + +

Sets the contents of the buffer to the constant table.

+
+

Pointer to an interface, representing the device associated with the constant table.

+

Unique identifier to a constant. See .

+

Buffer containing data.

+

Size of the buffer, in bytes.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205785 + HRESULT ID3DXConstantTable::SetValue([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const void* pData,[In] unsigned int Bytes) + ID3DXConstantTable::SetValue +
+ + +

Sets a Boolean value.

+
+

Pointer to an interface, representing the device associated with the constant table.

+

Unique identifier to the constant. See .

+

Boolean value.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205771 + HRESULT ID3DXConstantTable::SetBool([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] BOOL b) + ID3DXConstantTable::SetBool +
+ + +

Sets an array of Boolean values.

+
+

Pointer to an interface, representing the device associated with the constant table.

+

Unique identifier to the array of constants. See .

+

Array of Boolean values.

+

Number of Boolean values in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205772 + HRESULT ID3DXConstantTable::SetBoolArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const BOOL* pb,[In] unsigned int Count) + ID3DXConstantTable::SetBoolArray +
+ + +

Sets an integer value.

+
+

Pointer to an interface, representing the device associated with the constant table.

+

Unique identifier to the constant. See .

+

Integer.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205776 + HRESULT ID3DXConstantTable::SetInt([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] int n) + ID3DXConstantTable::SetInt +
+ + +

Sets an array of integers.

+
+

Pointer to an interface, representing the device associated with the constant table.

+

Unique identifier to the array of constants. See .

+

Array of integers.

+

Number of integers in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205778 + HRESULT ID3DXConstantTable::SetIntArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const int* pn,[In] unsigned int Count) + ID3DXConstantTable::SetIntArray +
+ + +

Sets a floating-point number.

+
+

Pointer to an interface, representing the device associated with the constant table.

+

Unique identifier to the constant. See .

+

Floating-point number.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205774 + HRESULT ID3DXConstantTable::SetFloat([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] float f) + ID3DXConstantTable::SetFloat +
+ + +

Sets an array of floating-point numbers.

+
+

Pointer to an interface, representing the device associated with the constant table.

+

Unique identifier to the array of constants. See .

+

Array of floating-point numbers.

+

Number of floating-point values in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205775 + HRESULT ID3DXConstantTable::SetFloatArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const float* pf,[In] unsigned int Count) + ID3DXConstantTable::SetFloatArray +
+ + +

Sets a 4D vector.

+
+

Pointer to an interface, representing the device associated with the constant table.

+

Unique identifier to the vector constant. See .

+

Pointer to a 4D vector.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205786 + HRESULT ID3DXConstantTable::SetVector([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const D3DXVECTOR4* pVector) + ID3DXConstantTable::SetVector +
+ + +

Sets an array of 4D vectors.

+
+

Pointer to an interface, representing the device associated with the constant table.

+

Unique identifier to the array of vector constants. See .

+

Array of 4D vectors.

+

Number of vectors in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205787 + HRESULT ID3DXConstantTable::SetVectorArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const D3DXVECTOR4* pVector,[In] unsigned int Count) + ID3DXConstantTable::SetVectorArray +
+ + +

Sets a nontransposed matrix.

+
+

Pointer to an interface, representing the device associated with the constant table.

+

Unique identifier to the matrix of constants. See .

+

Pointer to a nontransposed matrix. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205779 + HRESULT ID3DXConstantTable::SetMatrix([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const D3DXMATRIX* pMatrix) + ID3DXConstantTable::SetMatrix +
+ + +

Sets an array of nontransposed matrices.

+
+

Pointer to an interface, representing the device associated with the constant table.

+

Unique identifier to the array of constant matrices. See .

+

Array of nontransposed matrices. See .

+

Number of matrices in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205780 + HRESULT ID3DXConstantTable::SetMatrixArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const D3DXMATRIX* pMatrix,[In] unsigned int Count) + ID3DXConstantTable::SetMatrixArray +
+ + +

Sets an array of references to nontransposed matrices.

+
+

Pointer to an interface, representing the device associated with the constant table.

+

Unique identifier to an array of constant matrices. See .

+

Array of references to nontransposed matrices. See .

+

Number of matrices in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A nontransposed matrix contains row-major data; that is, each vector is contained in a row.

+
+ + bb205781 + HRESULT ID3DXConstantTable::SetMatrixPointerArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const D3DXMATRIX** ppMatrix,[In] unsigned int Count) + ID3DXConstantTable::SetMatrixPointerArray +
+ + +

Sets a transposed matrix.

+
+

Pointer to an interface, representing the device associated with the constant table.

+

Unique identifier to the matrix of constants. See .

+

Pointer to a transposed matrix. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205782 + HRESULT ID3DXConstantTable::SetMatrixTranspose([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const D3DXMATRIX* pMatrix) + ID3DXConstantTable::SetMatrixTranspose +
+ + +

Sets an array of transposed matrices.

+
+

Pointer to an interface, representing the device associated with the constant table.

+

Unique identifier to the array of matrix constants. See .

+

Array of transposed matrices. See .

+

Number of matrices in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205783 + HRESULT ID3DXConstantTable::SetMatrixTransposeArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const D3DXMATRIX* pMatrix,[In] unsigned int Count) + ID3DXConstantTable::SetMatrixTransposeArray +
+ + +

Sets an array of references to transposed matrices.

+
+

Pointer to an interface, representing the device associated with the constant table.

+

Unique identifier to the array of matrix constants. See .

+

Array of references to transposed matrices. See .

+

Number of matrices in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A transposed matrix contains column-major data; that is, each vector is contained in a column.

+
+ + bb205784 + HRESULT ID3DXConstantTable::SetMatrixTransposePointerArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const D3DXMATRIX** ppMatrix,[In] unsigned int Count) + ID3DXConstantTable::SetMatrixTransposePointerArray +
+ + +

Applications use the methods of the interface to manipulate a cube texture resource.

+
+ +

The interface can be obtained by calling the method or one of the xxx functions.

This interface inherits additional functionality from the interface.

This interface, like all COM interfaces, inherits additional functionality from the interface.

The LPDIRECT3DCUBETEXTURE9 and PDIRECT3DCubeTexture9 types are defined as references to the interface.

 typedef struct  *LPDIRECT3DCUBETEXTURE9, *PDIRECT3DCubeTexture9;	
+            
+
+ + bb174329 + IDirect3DCubeTexture9 + IDirect3DCubeTexture9 +
+ + + Initializes a new instance of the class. + + The device. + Length of the edge. + The level count. + The usage. + The format. + The pool. + + + + Initializes a new instance of the class. + + The device. + Length of the edge. + The level count. + The usage. + The format. + The pool. + The shared handle. + + + + Checks texture-creation parameters. + + Device associated with the texture. + Requested size of the texture. Null if + Requested number of mipmap levels for the texture. + The requested usage for the texture. + Requested format for the texture. + Memory class where the resource will be placed. + A value type containing the proposed values to pass to the texture creation functions. + HRESULT D3DXCheckCubeTextureRequirements([In] IDirect3DDevice9* pDevice,[InOut] unsigned int* pSize,[InOut] unsigned int* pNumMipLevels,[In] unsigned int Usage,[InOut] D3DFORMAT* pFormat,[In] D3DPOOL Pool) + + + + Uses a user-provided function to fill each texel of each mip level of a given cube texture. + + A function that is used to fill the texture. + A object describing the result of the operation. + + + + Uses a compiled high-level shader language (HLSL) function to fill each texel of each mipmap level of a texture. + + A texture shader object that is used to fill the texture. + A object describing the result of the operation. + + + + Locks a rectangle on a cube texture resource. + + Type of the face. + The level. + The flags. + + A describing the region locked. + + HRESULT IDirect3DCubeTexture9::LockRect([In] D3DCUBEMAP_FACES FaceType,[In] unsigned int Level,[In] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) + + + + Locks a rectangle on a cube texture resource. + + Type of the face. + The level. + The flags. + The stream pointing to the locked region. + + A describing the region locked. + + HRESULT IDirect3DCubeTexture9::LockRect([In] D3DCUBEMAP_FACES FaceType,[In] unsigned int Level,[In] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) + + + + Locks a rectangle on a cube texture resource. + + Type of the face. + The level. + The rectangle. + The flags. + + A describing the region locked. + + HRESULT IDirect3DCubeTexture9::LockRect([In] D3DCUBEMAP_FACES FaceType,[In] unsigned int Level,[In] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) + + + + Locks a rectangle on a cube texture resource. + + Type of the face. + The level. + The rectangle. + The flags. + The stream pointing to the locked region. + + A describing the region locked. + + HRESULT IDirect3DCubeTexture9::LockRect([In] D3DCUBEMAP_FACES FaceType,[In] unsigned int Level,[In] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) + + + + Adds a dirty region to a cube texture resource. + + Type of the face. + A object describing the result of the operation. + HRESULT IDirect3DCubeTexture9::AddDirtyRect([In] D3DCUBEMAP_FACES FaceType,[In] const void* pDirtyRect) + + + + Adds a dirty region to a cube texture resource. + + Type of the face. + The dirty rect ref. + A object describing the result of the operation. + HRESULT IDirect3DCubeTexture9::AddDirtyRect([In] D3DCUBEMAP_FACES FaceType,[In] const void* pDirtyRect) + + + + Creates a from a file + + The device. + The filename. + + A + + HRESULT D3DXCreateCubeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Creates a from a file + + The device. + The filename. + The usage. + The pool. + + A + + HRESULT D3DXCreateCubeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Creates a from a file + + The device. + The filename. + The size. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + + A + + HRESULT D3DXCreateCubeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Creates a from a file + + The device. + The filename. + The size. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + + A + + HRESULT D3DXCreateCubeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Creates a from a file + + The device. + The filename. + The size. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + + A + + HRESULT D3DXCreateCubeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Creates a from a memory buffer. + + The device. + The buffer. + + A + + HRESULT D3DXCreateCubeTextureFromFileInMemory([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Creates a from a memory buffer. + + The device. + The buffer. + The usage. + The pool. + + A + + HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Creates a from a memory buffer. + + The device. + The buffer. + The size. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + + A + + HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Creates a from a memory buffer. + + The device. + The buffer. + The size. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + + A + + HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Creates a from a memory buffer. + + The device. + The buffer. + The size. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + + A + + HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Creates a from a stream. + + The device. + The stream. + A + HRESULT D3DXCreateCubeTextureFromFileInMemory([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Creates a from a stream. + + The device. + The stream. + The usage. + The pool. + + A + + HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Creates a from a stream. + + The device. + The stream. + The size. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + + A + + HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Creates a from a stream. + + The device. + The stream. + The size bytes. + The size. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + + A + + HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Creates a from a stream. + + The device. + The stream. + The size bytes. + The size. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + + A + + HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Creates a from a stream. + + The device. + The stream. + The size bytes. + The size. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + + A + + HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Creates a from a stream. + + The device. + The buffer. + The size. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + + A + + HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Creates a from a stream. + + The device. + The stream. + The size bytes. + The size. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + A + HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Creates a from a stream. + + The device. + The pointer. + The size in bytes. + The size. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + + A + + HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Creates a from a stream. + + The device. + Name of the file. + The size. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + + A + + HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Retrieves a description of one face of the specified cube texture level.

+
+

Specifies a level of a mipmapped cube texture.

+

Pointer to a structure, describing one face of the specified cube texture level.

+ +

The structure contains Width and Height members, which describe the size of one face in the cube. To get the size of the entire cube, multiply six (the number of cube faces) by the product of Width and Height.

+
+ + bb174332 + HRESULT IDirect3DCubeTexture9::GetLevelDesc([In] unsigned int Level,[Out] D3DSURFACE_DESC* pDesc) + IDirect3DCubeTexture9::GetLevelDesc +
+ + +

Retrieves a cube texture map surface.

+
+

Member of the enumerated type, identifying a cube map face.

+

Specifies a level of a mipmapped cube texture.

+

Address of a reference to an interface, representing the returned cube texture map surface.

+ +

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

+
+ + bb174331 + HRESULT IDirect3DCubeTexture9::GetCubeMapSurface([In] D3DCUBEMAP_FACES FaceType,[In] unsigned int Level,[Out] IDirect3DSurface9** ppCubeMapSurface) + IDirect3DCubeTexture9::GetCubeMapSurface +
+ + +

Locks a rectangle on a cube texture resource.

+
+

Member of the enumerated type, identifying a cube map face.

+

Specifies a level of a mipmapped cube texture.

+

Pointer to a structure, describing the region to lock.

+

Pointer to a rectangle to lock. Specified by a reference to a structure. Specifying null for this parameter expands the dirty region to cover the entire cube texture.

+

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

You may not specify a subrect when using . For a description of the flags, see .

+

If the method succeeds, the return value is . is returned if one or more of the arguments is invalid.

+ +

For performance reasons, dirty regions are only recorded for level zero of a texture. Dirty regions are automatically recorded when is called without or . See for more information.

Cube textures created with are not lockable. Cube textures created in video memory are lockable when created with USAGE_DYNAMIC.

The only lockable format for a depth-stencil texture is .

+
+ + bb174334 + HRESULT IDirect3DCubeTexture9::LockRect([In] D3DCUBEMAP_FACES FaceType,[In] unsigned int Level,[Out] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) + IDirect3DCubeTexture9::LockRect +
+ + +

Unlocks a rectangle on a cube texture resource.

+
+

Member of the enumerated type, identifying a cube map face.

+

Specifies a level of a mipmapped cube texture.

+

If the method succeeds, the return value is . If the method fails, the return value can be: .

+ + bb174335 + HRESULT IDirect3DCubeTexture9::UnlockRect([In] D3DCUBEMAP_FACES FaceType,[In] unsigned int Level) + IDirect3DCubeTexture9::UnlockRect +
+ + +

Adds a dirty region to a cube texture resource.

+
+

Member of the enumerated type, identifying the cube map face.

+

Pointer to a structure, specifying the dirty region. Specifying null expands the dirty region to cover the entire cube texture.

+

If the method succeeds, the return value is . If the method fails, the return value can be: .

+ +

For performance reasons, dirty regions are only recorded for level zero of a texture. For sublevels, it is assumed that the corresponding (scaled) rectangle or box is also dirty. Dirty regions are automatically recorded when is called without or . The destination surface of is also marked dirty automatically.

Using and explicitly specifying dirty regions can be used to increase the efficiency of . Using this method, applications can optimize what subset of a resource is copied by specifying dirty regions on the resource. However, the dirty regions may be expanded to optimize alignment.

+
+ + bb174330 + HRESULT IDirect3DCubeTexture9::AddDirtyRect([In] D3DCUBEMAP_FACES FaceType,[In] const void* pDirtyRect) + IDirect3DCubeTexture9::AddDirtyRect +
+ + + A Cube Texture requirement. + + + + + The corrected size of the texture, in pixels. + + + + + The corrected surface format. + + + + + The corrected mip level count. + + + + + D3DX constants and methods + + + + + The value used to signify that the default value for a parameter should be used. + + D3DX_DEFAULT + + + + The default value for non power-of-two textures. + + D3DX_DEFAULT_NONPOW2 + + + + Indicates that the method should format from file. + + D3DFMT_FROM_FILE + + + + Indicates that the method should load from file. + + D3DX_FROM_FILE + + + + Checks the D3DX runtime version against this compiled version. + + True if version are compatible + BOOL D3DXCheckVersion([In] unsigned int D3DSdkVersion,[In] unsigned int D3DXSdkVersion) + + + + Get and set debug mute mode. + + if set to true [mute]. + Return the debug mute mode + BOOL D3DXDebugMute([In] BOOL Mute) + + + + Converts a declarator from a flexible vertex format (FVF) code. + + Combination of that describes the FVF from which to generate the returned declarator array.. + + A declarator from a flexible vertex format (FVF) code. + + HRESULT D3DXDeclaratorFromFVF([In] D3DFVF FVF,[In, Buffer] D3DVERTEXELEMENT9* pDeclarator) + + + + Converts a flexible vertex format (FVF) code from a declarator. + + The declarator array. + A that describes the vertex format returned from the declarator. + HRESULT D3DXFVFFromDeclarator([In, Buffer] const D3DVERTEXELEMENT9* pDeclarator,[Out] D3DFVF* pFVF) + + + + Generates an output vertex declaration from the input declaration. The output declaration is intended for use by the mesh tessellation functions. + + The input declaration. + The output declaration + HRESULT D3DXGenerateOutputDecl([In, Buffer] D3DVERTEXELEMENT9* pOutput,[In, Buffer] const D3DVERTEXELEMENT9* pInput) + + + + Gets the number of elements in the vertex declaration. + + The declaration. + The number of elements in the vertex declaration. + unsigned int D3DXGetDeclLength([In, Buffer] const D3DVERTEXELEMENT9* pDecl) + + + + Gets the size of a vertex from the vertex declaration. + + The elements. + The stream. + The vertex declaration size, in bytes. + unsigned int D3DXGetDeclVertexSize([In, Buffer] const D3DVERTEXELEMENT9* pDecl,[In] unsigned int Stream) + + + + Returns the size of a vertex for a flexible vertex format (FVF). + + The vertex format. + The FVF vertex size, in bytes. + unsigned int D3DXGetFVFVertexSize([In] D3DFVF FVF) + + + + Gets the size of the rectangle patch. + + The segment count. + The triangle count. + The vertex count. + A object describing the result of the operation. + HRESULT D3DXRectPatchSize([In] const float* pfNumSegs,[In] unsigned int* pdwTriangles,[In] unsigned int* pdwVertices) + + + + Gets the size of the triangle patch. + + The segment count. + The triangle count. + The vertex count. + A object describing the result of the operation. + HRESULT D3DXTriPatchSize([In] const float* pfNumSegs,[In] unsigned int* pdwTriangles,[In] unsigned int* pdwVertices) + + + + Gets an array of from a . + + The stream. + The vertex count. + The format. + An array of + + + + Gets an array of from a . + + The stream. + The vertex count. + The stride. + An array of + + + + Creates a FOURCC Format code from bytes description. + + The c1. + The c2. + The c3. + The c4. + A Format FourCC + MAKEFOURCC + + + + Generates an optimized face remapping for a triangle list. + + The indices. + The face count. + The vertex count. + The original mesh face that was split to generate the current face. + HRESULT D3DXOptimizeFaces([In] const void* pbIndices,[In] unsigned int cFaces,[In] unsigned int cVertices,[In] BOOL b32BitIndices,[In, Buffer] int* pFaceRemap) + + + + Generates an optimized vertex remapping for a triangle list. This function is commonly used after applying the face remapping generated by D3DXOptimizeFaces. + + The indices. + The face count. + The vertex count. + The original mesh face that was split to generate the current face. + HRESULT D3DXOptimizeFaces([In] const void* pbIndices,[In] unsigned int cFaces,[In] unsigned int cVertices,[In] BOOL b32BitIndices,[In, Buffer] int* pFaceRemap) + + + + Generates an optimized vertex remapping for a triangle list. This function is commonly used after applying the face remapping generated by . + + The indices. + The face count. + The vertex count. + A buffer that will contain the new index for each vertex. The value stored in pVertexRemap for a given element is the source vertex location in the new vertex ordering. + HRESULT D3DXOptimizeVertices([In] const void* pbIndices,[In] unsigned int cFaces,[In] unsigned int cVertices,[In] BOOL b32BitIndices,[In, Buffer] int* pVertexRemap) + + + + Generates an optimized vertex remapping for a triangle list. This function is commonly used after applying the face remapping generated by . + + The indices. + The face count. + The vertex count. + A buffer that will contain the new index for each vertex. The value stored in pVertexRemap for a given element is the source vertex location in the new vertex ordering. + HRESULT D3DXOptimizeVertices([In] const void* pbIndices,[In] unsigned int cFaces,[In] unsigned int cVertices,[In] BOOL b32BitIndices,[In, Buffer] int* pVertexRemap) + + + +

Applications use the methods of the interface to perform DrawPrimitive-based rendering, create resources, work with system-level variables, adjust gamma ramp levels, work with palettes, and create shaders.

+
+ +

The interface is obtained by calling the method.

This interface, like all COM interfaces, inherits the interface methods.

The LPDIRECT3DDEVICE9 and PDIRECT3DDEVICE9 types are defined as references to the interface.

 typedef struct  *LPDIRECT3DDEVICE9, *PDIRECT3DDEVICE9;	
+            
+
+ + bb174336 + IDirect3DDevice9 + IDirect3DDevice9 +
+ + + Creates a device to represent the display adapter. + + + This method returns a fully working device interface, set to the required display mode (or windowed), and allocated with the appropriate back buffers. To begin rendering, the application needs only to create and set a depth buffer (assuming EnableAutoDepthStencil is FALSE in ). When you create a Direct3D device, you supply two different window parameters: a focus window (hFocusWindow) and a device window (the hDeviceWindow in ). The purpose of each window is: The focus window alerts Direct3D when an application switches from foreground mode to background mode (via Alt-Tab, a mouse click, or some other method). A single focus window is shared by each device created by an application. The device window determines the location and size of the back buffer on screen. This is used by Direct3D when the back buffer contents are copied to the front buffer during {{Present}}. This method should not be run during the handling of WM_CREATE. An application should never pass a window handle to Direct3D while handling WM_CREATE. Any call to create, release, or reset the device must be done using the same thread as the window procedure of the focus window. Note that D3DCREATE_HARDWARE_VERTEXPROCESSING, D3DCREATE_MIXED_VERTEXPROCESSING, and D3DCREATE_SOFTWARE_VERTEXPROCESSING are mutually exclusive flags, and at least one of these vertex processing flags must be specified when calling this method. Back buffers created as part of the device are only lockable if D3DPRESENTFLAG_LOCKABLE_BACKBUFFER is specified in the presentation parameters. (Multisampled back buffers and depth surfaces are never lockable.) The methods {{Reset}}, , and {{TestCooperativeLevel}} must be called from the same thread that used this method to create a device. D3DFMT_UNKNOWN can be specified for the windowed mode back buffer format when calling CreateDevice, {{Reset}}, and {{CreateAdditionalSwapChain}}. This means the application does not have to query the current desktop format before calling CreateDevice for windowed mode. For full-screen mode, the back buffer format must be specified. If you attempt to create a device on a 0x0 sized window, CreateDevice will fail. + + an instance of + Ordinal number that denotes the display adapter. {{D3DADAPTER_DEFAULT}} is always the primary display adapter. + Member of the enumerated type that denotes the desired device type. If the desired device type is not available, the method will fail. + The focus window alerts Direct3D when an application switches from foreground mode to background mode. See Remarks. For full-screen mode, the window specified must be a top-level window. For windowed mode, this parameter may be NULL only if the hDeviceWindow member of pPresentationParameters is set to a valid, non-NULL value. + Combination of one or more options that control device creation. For more information, see {{D3DCREATE}}. + Pointer to a structure, describing the presentation parameters for the device to be created. If BehaviorFlags specifies {{D3DCREATE_ADAPTERGROUP_DEVICE}}, pPresentationParameters is an array. Regardless of the number of heads that exist, only one depth/stencil surface is automatically created. For Windows 2000 and Windows XP, the full-screen device display refresh rate is set in the following order: User-specified nonzero ForcedRefreshRate registry key, if supported by the device. Application-specified nonzero refresh rate value in the presentation parameter. Refresh rate of the latest desktop mode, if supported by the device. 75 hertz if supported by the device. 60 hertz if supported by the device. Device default. An unsupported refresh rate will default to the closest supported refresh rate below it. For example, if the application specifies 63 hertz, 60 hertz will be used. There are no supported refresh rates below 57 hertz. pPresentationParameters is both an input and an output parameter. Calling this method may change several members including: If BackBufferCount, BackBufferWidth, and BackBufferHeight are 0 before the method is called, they will be changed when the method returns. If BackBufferFormat equals before the method is called, it will be changed when the method returns. + If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be one of the following: D3DERR_DEVICELOST, D3DERR_INVALIDCALL, D3DERR_NOTAVAILABLE, D3DERR_OUTOFVIDEOMEMORY. + HRESULT CreateDevice([None] UINT Adapter,[None] D3DDEVTYPE DeviceType,[None] HWND hFocusWindow,[None] int BehaviorFlags,[None] D3DPRESENT_PARAMETERS* pPresentationParameters,[None] IDirect3DDevice9** ppReturnedDeviceInterface) + + + + Gets the available texture memory. + + + + + Gets the driver level. + + + + + Gets the pixel shader profile. + + + + + Gets the vertex shader profile. + + + + + Clears one or more surfaces such as a render target, a stencil buffer, and a depth buffer. + + Flags that specify which surfaces will be cleared. + The color that will be used to fill the cleared render target. + The value that will be used to fill the cleared depth buffer. + The value that will be used to fill the cleared stencil buffer. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::Clear([None] int Count,[In, Buffer, Optional] const D3DRECT* pRects,[None] int Flags,[None] D3DCOLOR Color,[None] float Z,[None] int Stencil) + + + + Clears one or more surfaces such as a render target, a stencil buffer, and a depth buffer. + + Flags that specify which surfaces will be cleared. + The color that will be used to fill the cleared render target. + The value that will be used to fill the cleared depth buffer. + The value that will be used to fill the cleared stencil buffer. + The areas on the surfaces that will be cleared. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::Clear([None] int Count,[In, Buffer, Optional] const D3DRECT* pRects,[None] int Flags,[None] D3DCOLOR Color,[None] float Z,[None] int Stencil) + + + + Allows an application to fill a rectangular area of a D3DPOOL_DEFAULT surface with a specified color. + + + This method can only be applied to a render target, a render-target texture surface, or an off-screen plain surface with a pool type of D3DPOOL_DEFAULT. IDirect3DDevice9::ColorFill will work with all formats. However, when using a reference or software device, the only formats supported are D3DFMT_X1R5G5B5, D3DFMT_A1R5G5B5, D3DFMT_R5G6B5, D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_YUY2, D3DFMT_G8R8_G8B8, D3DFMT_UYVY, D3DFMT_R8G8_B8G8, D3DFMT_R16F, D3DFMT_G16R16F, D3DFMT_A16B16G16R16F, D3DFMT_R32F, D3DFMT_G32R32F, and D3DFMT_A32B32G32R32F. When using a DirectX 7 or DirectX 8.x driver, the only YUV formats supported are D3DFMT_UYVY and D3DFMT_YUY2. + + Pointer to the surface to be filled. + Color used for filling. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::ColorFill([None] IDirect3DSurface9* pSurface,[In, Optional] const RECT* pRect,[None] D3DCOLOR color) + + + + Draws the indexed user primitives. + + + + Type of the primitive. + Minimum index of the vertex. + The vertex count. + The primitive count. + The index data. + The index data format. + The vertex data. + The vertex stride. + A object describing the result of the operation. + + + + Draws the indexed user primitives. + + + + Type of the primitive. + The start index. + Minimum index of the vertex. + The vertex count. + The primitive count. + The index data. + The index data format. + The vertex data. + A object describing the result of the operation. + + + + Draws the indexed user primitives. + + + + Type of the primitive. + The start index. + The start vertex. + Minimum index of the vertex. + The vertex count. + The primitive count. + The index data. + The index data format. + The vertex data. + A object describing the result of the operation. + + + + Draws the rectangle patch. + + The handle. + The segment counts. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::DrawRectPatch([In] unsigned int Handle,[In, Buffer] const float* pNumSegs,[In] const void* pRectPatchInfo) + + + + Draws the rectangle patch. + + The handle. + The segment counts. + The info. + + A object describing the result of the operation. + + IDirect3DDevice9::DrawRectPatch + + + + Draws the triangle patch. + + The handle. + The segment counts. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::DrawTriPatch([In] unsigned int Handle,[In, Buffer] const float* pNumSegs,[In] const void* pTriPatchInfo) + + + + Draws the triangle patch. + + The handle. + The segment counts. + The info. + + A object describing the result of the operation. + + + + + Draws the user primitives. + + + Type of the primitive. + The primitive count. + The data. + + A object describing the result of the operation. + + + + + Draws the user primitives. + + + Type of the primitive. + The start index. + The primitive count. + The data. + + A object describing the result of the operation. + + + + + Gets the back buffer. + + The swap chain. + The back buffer. + A object describing the result of the operation. + + + + Gets the palette entries. + + The palette number. + An array of + + + + Gets the pixel shader boolean constant. + + The start register. + The count. + An array of boolean constants + + + + Gets the pixel shader float constant. + + The start register. + The count. + An array of float constants + + + + Gets the pixel shader integer constant. + + The start register. + The count. + An array of int constants + + + + Gets the state of the render. + + The state. + The render state value + HRESULT IDirect3DDevice9::GetRenderState([In] D3DRENDERSTATETYPE State,[In] void* pValue) + + + + Gets the state of the render. + + Type of the state value. + The state. + + The render state value + + HRESULT IDirect3DDevice9::GetRenderState([In] D3DRENDERSTATETYPE State,[In] void* pValue) + + + + Gets the state of the sampler. + + The sampler. + The state. + + The sampler state value + + HRESULT IDirect3DDevice9::GetSamplerState([In] unsigned int Sampler,[In] D3DSAMPLERSTATETYPE Type,[In] void* pValue) + + + + Gets the state of the sampler. + + Type of the sampler state value + The sampler. + The state. + + The sampler state value + + HRESULT IDirect3DDevice9::GetSamplerState([In] unsigned int Sampler,[In] D3DSAMPLERSTATETYPE Type,[In] void* pValue) + + + + Gets the state of the texture stage. + + The stage. + The type. + + The texture stage state. + + HRESULT IDirect3DDevice9::GetTextureStageState([In] unsigned int Stage,[In] D3DTEXTURESTAGESTATETYPE Type,[In] void* pValue) + + + + Gets the state of the texture stage. + + Type of the texture stage state + The stage. + The type. + + The texture stage state. + + HRESULT IDirect3DDevice9::GetTextureStageState([In] unsigned int Stage,[In] D3DTEXTURESTAGESTATETYPE Type,[In] void* pValue) + + + + Gets the vertex shader boolean constant. + + The start register. + The count. + An array of boolean constants + HRESULT IDirect3DDevice9::GetVertexShaderConstantB([In] unsigned int StartRegister,[In] void* pConstantData,[In] unsigned int BoolCount) + + + + Gets the vertex shader float constant. + + The start register. + The count. + An array of float constants + HRESULT IDirect3DDevice9::GetVertexShaderConstantF([In] unsigned int StartRegister,[In, Buffer] float* pConstantData,[In] unsigned int Vector4fCount) + + + + Gets the vertex shader integer constant. + + The start register. + The count. + An array of int constants + HRESULT IDirect3DDevice9::GetVertexShaderConstantI([In] unsigned int StartRegister,[Out] int* pConstantData,[In] unsigned int Vector4iCount) + + + + Sets the cursor position. + + The point. + if set to true [flags]. + void IDirect3DDevice9::SetCursorPosition([In] int X,[In] int Y,[In] unsigned int Flags) + + + + Sets the cursor position. + + The x. + The y. + if set to true [flags]. + void IDirect3DDevice9::SetCursorPosition([In] int X,[In] int Y,[In] unsigned int Flags) + + + + Sets the cursor properties. + + The point. + The cursor bitmap ref. + + HRESULT IDirect3DDevice9::SetCursorProperties([In] unsigned int XHotSpot,[In] unsigned int YHotSpot,[In] IDirect3DSurface9* pCursorBitmap) + + + + Sets the gamma ramp. + + The swap chain. + The ramp ref. + if set to true [calibrate]. + void IDirect3DDevice9::SetGammaRamp([In] unsigned int iSwapChain,[In] unsigned int Flags,[In] const D3DGAMMARAMP* pRamp) + + + + Presents the contents of the next buffer in the sequence of back buffers to the screen. + + A object describing the result of the operation. + IDirect3DDevice9::Present + + + + Presents the contents of the next buffer in the sequence of back buffers to the screen. + + The area of the back buffer that should be presented. + The area of the front buffer that should receive the result of the presentation. + A object describing the result of the operation. + IDirect3DDevice9::Present + + + + Presents the contents of the next buffer in the sequence of back buffers to the screen. + + The area of the back buffer that should be presented. + The area of the front buffer that should receive the result of the presentation. + The destination window whose client area is taken as the target for this presentation. + A object describing the result of the operation. + IDirect3DDevice9::Present + + + + Presents the contents of the next buffer in the sequence of back buffers to the screen. + + The area of the back buffer that should be presented. + The area of the front buffer that should receive the result of the presentation. + The destination window whose client area is taken as the target for this presentation. + Specifies a region on the back buffer that contains the minimal amount of pixels that need to be updated. + A object describing the result of the operation. + IDirect3DDevice9::Present + + + + Resets the stream source frequency by setting the frequency to 1. + + The stream index. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::SetStreamSourceFreq([In] unsigned int StreamNumber,[In] unsigned int Setting) + + + + Sets the pixel shader constant. + + The start register. + The data. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + + + + Sets the pixel shader constant. + + The start register. + The data. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + + + + Sets the pixel shader constant. + + The start register. + The data. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetPixelShaderConstantB([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int BoolCount) + + + + Sets the pixel shader constant. + + The start register. + The data. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetPixelShaderConstantI([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4iCount) + + + + Sets the pixel shader constant. + + The start register. + The data. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + + + + Sets the pixel shader constant. + + The start register. + The data. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + + + + Sets the pixel shader constant. + + The start register. + The data. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + + + + Sets the pixel shader constant. + + The start register. + The data. + The count. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + + + + Sets the pixel shader constant. + + The start register. + The data. + The offset. + The count. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + + + + Sets the pixel shader constant. + + The start register. + The data. + The offset. + The count. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + + + + Sets the pixel shader constant. + + The start register. + The data. + The offset. + The count. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::SetPixelShaderConstantB([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int BoolCount) + + + + Sets the pixel shader constant. + + The start register. + The data. + The offset. + The count. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::SetPixelShaderConstantI([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4iCount) + + + + Sets the pixel shader constant. + + The start register. + The data. + The offset. + The count. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + + + + Sets the RenderState. + + State of the render. + if set to true [enable]. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::SetRenderState([In] D3DRENDERSTATETYPE State,[In] unsigned int Value) + + + + Sets the RenderState. + + State of the render. + A float value. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::SetRenderState([In] D3DRENDERSTATETYPE State,[In] unsigned int Value) + + + + Sets the RenderState. + + Type of the enum value + State of the render. + An enum value. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::SetRenderState([In] D3DRENDERSTATETYPE State,[In] unsigned int Value) + + + + Sets the SamplerState. + + The sampler. + The type. + The texture filter. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::SetSamplerState([In] unsigned int Sampler,[In] D3DSAMPLERSTATETYPE Type,[In] unsigned int Value) + + + + Sets the SamplerState. + + The sampler. + The type. + The texture address. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::SetSamplerState([In] unsigned int Sampler,[In] D3DSAMPLERSTATETYPE Type,[In] unsigned int Value) + + + + Sets the SamplerState. + + The sampler. + The type. + A float value. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::SetSamplerState([In] unsigned int Sampler,[In] D3DSAMPLERSTATETYPE Type,[In] unsigned int Value) + + + + Sets the stream source frequency. + + The stream. + The frequency. + The source. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::SetStreamSourceFreq([In] unsigned int StreamNumber,[In] unsigned int Setting) + + + + Sets the state of the texture stage. + + The stage. + The type. + The texture argument. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::SetTextureStageState([In] unsigned int Stage,[In] D3DTEXTURESTAGESTATETYPE Type,[In] unsigned int Value) + + + + Sets the state of the texture stage. + + The stage. + The type. + The texture operation. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetTextureStageState([In] unsigned int Stage,[In] D3DTEXTURESTAGESTATETYPE Type,[In] unsigned int Value) + + + + Sets the state of the texture stage. + + The stage. + The type. + The texture transform. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetTextureStageState([In] unsigned int Stage,[In] D3DTEXTURESTAGESTATETYPE Type,[In] unsigned int Value) + + + + Sets the state of the texture stage. + + The stage. + The type. + The value. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetTextureStageState([In] unsigned int Stage,[In] D3DTEXTURESTAGESTATETYPE Type,[In] unsigned int Value) + + + + Sets the transform. + + The state. + The matrix ref. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetTransform([In] D3DTRANSFORMSTATETYPE State,[In] const D3DMATRIX* pMatrix) + + + + Sets the transform. + + The index. + The matrix ref. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetTransform([In] D3DTRANSFORMSTATETYPE State,[In] const D3DMATRIX* pMatrix) + + + + Sets the transform. + + The state. + The matrix ref. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetTransform([In] D3DTRANSFORMSTATETYPE State,[In] const D3DMATRIX* pMatrix) + + + + Sets the transform. + + The index. + The matrix ref. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetTransform([In] D3DTRANSFORMSTATETYPE State,[In] const D3DMATRIX* pMatrix) + + + + Sets the vertex shader constant. + + The start register. + The data. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + + + + Sets the vertex shader constant. + + The start register. + The data. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + + + + Sets the vertex shader constant. + + The start register. + The data. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetVertexShaderConstantB([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int BoolCount) + + + + Sets the vertex shader constant. + + The start register. + The data. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetVertexShaderConstantI([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4iCount) + + + + Sets the vertex shader constant. + + The start register. + The data. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + + + + Sets the vertex shader constant. + + The start register. + The data. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + + + + Sets the vertex shader constant. + + The start register. + The data. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + + + + Sets the vertex shader constant. + + The start register. + The data. + The count. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + + + + Sets the vertex shader constant. + + The start register. + The data. + The offset. + The count. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + + + + Sets the vertex shader constant. + + The start register. + The data. + The offset. + The count. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + + + + Sets the vertex shader constant. + + The start register. + The data. + The offset. + The count. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::SetVertexShaderConstantB([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int BoolCount) + + + + Sets the vertex shader constant. + + The start register. + The data. + The offset. + The count. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::SetVertexShaderConstantI([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4iCount) + + + + Sets the vertex shader constant. + + The start register. + The data. + The offset. + The count. + A object describing the result of the operation. + HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + + + + Stretches the rectangle. + + The source surface ref. + The dest surface ref. + The filter. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::StretchRect([In] IDirect3DSurface9* pSourceSurface,[In, Optional] const RECT* pSourceRect,[In] IDirect3DSurface9* pDestSurface,[In, Optional] const RECT* pDestRect,[In] D3DTEXTUREFILTERTYPE Filter) + + + + Gets or sets a value indicating whether the cursor can be displayed. + + + true if the cursor can be displayed; otherwise, false. + + + + + Updates the surface. + + The source surface ref. + The destination surface ref. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9::UpdateSurface([In] IDirect3DSurface9* pSourceSurface,[In] const RECT* pSourceRect,[In] IDirect3DSurface9* pDestinationSurface,[In] const POINT* pDestPoint) + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Returns an interface to the instance of the Direct3D object that created the device.

+
+ +

Calling will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

+
+ + bb174386 + GetDirect3D + GetDirect3D + HRESULT IDirect3DDevice9::GetDirect3D([Out] IDirect3D9** ppD3D9) +
+ + +

Retrieves the capabilities of the rendering device.

+
+ +

retrieves the software vertex pipeline capabilities when the device is being used in software vertex processing mode.

+
+ + bb174385 + GetDeviceCaps + GetDeviceCaps + HRESULT IDirect3DDevice9::GetDeviceCaps([Out] D3DCAPS9* pCaps) +
+ + +

Retrieves the creation parameters of the device.

+
+ +

You can query the AdapterOrdinal member of the returned structure to retrieve the ordinal of the adapter represented by this device.

+
+ + bb174382 + GetCreationParameters + GetCreationParameters + HRESULT IDirect3DDevice9::GetCreationParameters([Out] D3DDEVICE_CREATION_PARAMETERS* pParameters) +
+ + +

Gets the number of implicit swap chains.

+
+ +

Implicit swap chains are created by the device during . This method returns the number of swap chains created by CreateDevice.

An application may create additional swap chains using .

+
+ + bb174396 + GetNumberOfSwapChains + GetNumberOfSwapChains + unsigned int IDirect3DDevice9::GetNumberOfSwapChains() +
+ + +

This method allows the use of GDI dialog boxes in full-screen mode applications.

+
+ +

The GDI dialog boxes must be created as child to the device window. They should also be created within the same thread that created the device because this enables the parent window to manage redrawing the child window.

The method has no effect for windowed mode applications, but this setting will be respected if the application resets the device into full-screen mode. If SetDialogBoxMode succeeds in a windowed mode application, any subsequent reset to full-screen mode will be checked against the restrictions listed above. Also, SetDialogBoxMode causes all back buffers on the swap chain to be discarded, so an application is expected to refresh its content for all back buffers after this call.

+
+ + bb174432 + SetDialogBoxMode + SetDialogBoxMode + HRESULT IDirect3DDevice9::SetDialogBoxMode([In] BOOL bEnableDialogs) +
+ + +

Gets or sets the depth-stencil surface owned by the Direct3DDevice object.

+
+ +

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

+
+ + bb174384 + GetDepthStencilSurface / SetDepthStencilSurface + GetDepthStencilSurface + HRESULT IDirect3DDevice9::GetDepthStencilSurface([Out] IDirect3DSurface9** ppZStencilSurface) +
+ + +

Retrieves or sets the viewport parameters currently set for the device.

+
+ +

Typically, methods that return state will not work on a device that is created using . This method however, will work even on a pure device.

+
+ + bb174420 + GetViewport / SetViewport + GetViewport + HRESULT IDirect3DDevice9::GetViewport([Out] D3DVIEWPORT9* pViewport) +
+ + +

Retrieves or sets the current material properties for the device.

+
+ +

This method will not return device state for a device that is created using . If you want to use this method, you must create your device with any of the other values in .

+
+ + bb174394 + GetMaterial / SetMaterial + GetMaterial + HRESULT IDirect3DDevice9::GetMaterial([Out] D3DMATERIAL9* pMaterial) +
+ + +

Retrieves or sets the clip status.

+
+ +

When clipping is enabled during vertex processing (by , , or other drawing functions), Direct3D computes a clip code for every vertex. The clip code is a combination of D3DCS_* bits. When a vertex is outside a particular clipping plane, the corresponding bit is set in the clipping code. Direct3D maintains the clip status using , which has ClipUnion and ClipIntersection members. ClipUnion is a bitwise "OR" of all vertex clip codes and ClipIntersection is a bitwise "AND" of all vertex clip codes. Initial values are zero for ClipUnion and 0xFFFFFFFF for ClipIntersection. When is set to , ClipUnion and ClipIntersection are set to zero. Direct3D updates the clip status during drawing calls. To compute clip status for a particular object, set ClipUnion and ClipIntersection to their initial value and continue drawing.

Clip status is not updated by and because there is no software emulation for them.

Clip status is used during software vertex processing. Therefore, this method is not supported on pure or nonpure hardware processing devices. For more information about pure devices, see .

+
+ + bb174381 + GetClipStatus / SetClipStatus + GetClipStatus + HRESULT IDirect3DDevice9::GetClipStatus([Out] D3DCLIPSTATUS9* pClipStatus) +
+ + +

Retrieves or sets the current texture palette.

+
+ + bb174383 + GetCurrentTexturePalette / SetCurrentTexturePalette + GetCurrentTexturePalette + HRESULT IDirect3DDevice9::GetCurrentTexturePalette([Out] unsigned int* PaletteNumber) +
+ + +

Gets or sets the scissor rectangle.

+
+ +

The scissor rectangle is used as a rectangular clipping region.

See Rectangles (Direct3D 9) for further information on the use of rectangles in DirectX.

+
+ + bb174407 + GetScissorRect / SetScissorRect + GetScissorRect + HRESULT IDirect3DDevice9::GetScissorRect([Out] RECT* pRect) +
+ + +

Gets or sets the vertex processing (hardware or software) mode.

+
+ +

An application can create a mixed-mode device to use both the software vertex processing and the hardware vertex processing. To switch between the two vertex processing modes in DirectX 8.x, use with the render state D3DRS_SOFTWAREVERTEXPROCESSING and the appropriate argument. The drawback of the render state approach was the difficulty in defining the semantics for state blocks. Applications and the runtime had to do extra work and be careful while recording and playing back state blocks.

In Direct3D 9, use instead. This new API is not recorded by StateBlocks.

+
+ + bb174408 + GetSoftwareVertexProcessing / SetSoftwareVertexProcessing + GetSoftwareVertexProcessing + BOOL IDirect3DDevice9::GetSoftwareVertexProcessing() +
+ + +

Gets or sets the N-patch mode segments.

+
+ + bb174395 + GetNPatchMode / SetNPatchMode + GetNPatchMode + float IDirect3DDevice9::GetNPatchMode() +
+ + +

Gets or sets a vertex shader declaration.

+
+ + bb174415 + GetVertexDeclaration / SetVertexDeclaration + GetVertexDeclaration + HRESULT IDirect3DDevice9::GetVertexDeclaration([Out] IDirect3DVertexDeclaration9** ppDecl) +
+ + +

Gets or sets the fixed vertex function declaration.

+
+ +

The fixed vertex function declaration is a set of FVF flags that determine how vertices processed by the fixed function pipeline will be used.

+
+ + bb174389 + GetFVF / SetFVF + GetFVF + HRESULT IDirect3DDevice9::GetFVF([Out] D3DFVF* pFVF) +
+ + +

Retrieves or sets the currently set vertex shader.

+
+ +

Typically, methods that return state will not work on a device that is created using . This method however, will work even on a pure device because it returns an interface.

+
+ + bb174416 + GetVertexShader / SetVertexShader + GetVertexShader + HRESULT IDirect3DDevice9::GetVertexShader([Out] IDirect3DVertexShader9** ppShader) +
+ + +

Retrieves or sets index data.

+
+ +

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

+
+ + bb174391 + GetIndices / SetIndices + GetIndices + HRESULT IDirect3DDevice9::GetIndices([Out] IDirect3DIndexBuffer9** ppIndexData) +
+ + +

Retrieves or sets the currently set pixel shader.

+
+ +

This method will not work on a device that is created using .

+
+ + bb174398 + GetPixelShader / SetPixelShader + GetPixelShader + HRESULT IDirect3DDevice9::GetPixelShader([Out] IDirect3DPixelShader9** ppShader) +
+ + +

Reports the current cooperative-level status of the Direct3D device for a windowed or full-screen application.

+
+

If the method succeeds, the return value is , indicating that the device is operational and the calling application can continue. If the method fails, the return value can be one of the following values: , , .

+ +

If the device is lost but cannot be restored at the current time, returns the return code. This would be the case, for example, when a full-screen device has lost focus. If an application detects a lost device, it should pause and periodically call until it receives a return value of . The application may then attempt to reset the device by calling and, if this succeeds, restore the necessary resources and resume normal operation. Note that will return if the device is either "lost" or "not reset".

A call to will fail if called on a different thread than that used to create the device being reset.

+
+ + bb174472 + HRESULT IDirect3DDevice9::TestCooperativeLevel() + IDirect3DDevice9::TestCooperativeLevel +
+ + +

Returns an estimate of the amount of available texture memory.

+
+

The function returns an estimate of the available texture memory.

+ +

The returned value is rounded to the nearest MB. This is done to reflect the fact that video memory estimates are never precise due to alignment and other issues that affect consumption by certain resources. Applications can use this value to make gross estimates of memory availability to make large-scale resource decisions such as how many levels of a mipmap to attempt to allocate, but applications cannot use this value to make small-scale decisions such as if there is enough memory left to allocate another resource.

+
+ + bb174378 + unsigned int IDirect3DDevice9::GetAvailableTextureMem() + IDirect3DDevice9::GetAvailableTextureMem +
+ + +

Evicts all managed resources, including both Direct3D and driver-managed resources.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be , D3DERR_COMMAND_UNPARSED.

+ +

This function causes only the copy of resources to be evicted. The resource copy in system memory is retained. See .

+
+ + bb174377 + HRESULT IDirect3DDevice9::EvictManagedResources() + IDirect3DDevice9::EvictManagedResources +
+ + +

Returns an interface to the instance of the Direct3D object that created the device.

+
+

Address of a reference to an interface, representing the interface of the Direct3D object that created the device.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

Calling will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

+
+ + bb174386 + HRESULT IDirect3DDevice9::GetDirect3D([Out] IDirect3D9** ppD3D9) + IDirect3DDevice9::GetDirect3D +
+ + +

Retrieves the capabilities of the rendering device.

+
+

Pointer to a structure, describing the returned device.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

retrieves the software vertex pipeline capabilities when the device is being used in software vertex processing mode.

+
+ + bb174385 + HRESULT IDirect3DDevice9::GetDeviceCaps([Out] D3DCAPS9* pCaps) + IDirect3DDevice9::GetDeviceCaps +
+ + +

Retrieves the display mode's spatial resolution, color resolution, and refresh frequency.

+
+

An unsigned integer specifying the swap chain.

+

Pointer to a structure containing data about the display mode of the adapter. As opposed to the display mode of the device, which may not be active if the device does not own full-screen mode.

+ + bb174387 + HRESULT IDirect3DDevice9::GetDisplayMode([In] unsigned int iSwapChain,[Out] D3DDISPLAYMODE* pMode) + IDirect3DDevice9::GetDisplayMode +
+ + +

Retrieves the creation parameters of the device.

+
+

Pointer to a structure, describing the creation parameters of the device.

+

If the method succeeds, the return value is .

is returned if the argument is invalid.

+ +

You can query the AdapterOrdinal member of the returned structure to retrieve the ordinal of the adapter represented by this device.

+
+ + bb174382 + HRESULT IDirect3DDevice9::GetCreationParameters([Out] D3DDEVICE_CREATION_PARAMETERS* pParameters) + IDirect3DDevice9::GetCreationParameters +
+ + +

Sets properties for the cursor.

+
+

X-coordinate offset (in pixels) that marks the center of the cursor. The offset is relative to the upper-left corner of the cursor. When the cursor is given a new position, the image is drawn at an offset from this new position determined by subtracting the hot spot coordinates from the position.

+

Y-coordinate offset (in pixels) that marks the center of the cursor. The offset is relative to the upper-left corner of the cursor. When the cursor is given a new position, the image is drawn at an offset from this new position determined by subtracting the hot spot coordinates from the position.

+

Pointer to an interface. This parameter must point to an 8888 ARGB surface (format ). The contents of this surface will be copied and potentially format-converted into an internal buffer from which the cursor is displayed. The dimensions of this surface must be less than the dimensions of the display mode, and must be a power of two in each direction, although not necessarily the same power of two. The alpha channel must be either 0.0 or 1.0.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

An operating system cursor is created and used under either of these conditions:

  • The hardware has set (see ), and the cursor size is 32x32 (which is the cursor size in the operating system).
  • The application is running in windowed mode.

Otherwise, DirectX uses an emulated cursor. An application uses to move an emulated cursor to follow mouse movement.

It is recommended for applications to always trap WM_MOUSEMOVE events and call DXSetCursorPosition.

Direct3D cursor functions use either GDI cursor or software emulation, depending on the hardware. Users typically want to respond to a WM_SETCURSOR message. For example, they might want to write the message handler as follows:

 case WM_SETCURSOR:	
+            // Turn off window cursor. 	
+            SetCursor( null );	
+            m_pd3dDevice->ShowCursor( TRUE );	
+            return TRUE; // Prevent Windows from setting cursor to window class cursor.	
+            break;	
+            

Or, users might want to call the method if they want to change the cursor.

The application can determine what hardware support is available for cursors by examining appropriate members of the structure. Typically, hardware supports only 32x32 cursors and, when windowed, the system might support only 32x32 cursors. In this case, still succeeds but the cursor might be reduced to that size. The hot spot is scaled appropriately.

The cursor does not survive when the device is lost. This method must be called after the device is reset.

+
+ + bb174430 + HRESULT IDirect3DDevice9::SetCursorProperties([In] unsigned int XHotSpot,[In] unsigned int YHotSpot,[In] IDirect3DSurface9* pCursorBitmap) + IDirect3DDevice9::SetCursorProperties +
+ + +

Sets the cursor position and update options.

+
+

The new X-position of the cursor in virtual desktop coordinates. See Remarks.

+

The new Y-position of the cursor in virtual desktop coordinates. See Remarks.

+

Specifies the update options for the cursor. Currently, only one flag is defined.

ValueMeaning
D3DCURSOR_IMMEDIATE_UPDATE

Update cursor at the refresh rate.

If this flag is specified, the system guarantees that the cursor will be updated at a minimum of half the display refresh rate, but never more frequently than the display refresh rate. Otherwise, the method delays cursor updates until the next call. Not setting this flag usually results in better performance than if the flag is set. However, applications should set this flag if the rate of calls to Present is low enough that users would notice a significant delay in cursor motion. This flag has no effect in a windowed-mode application. Some video cards implement hardware color cursors. This flag does not have an effect on these cards.

?

+ +

When running in full-screen mode, screen space coordinates are the back buffer coordinates appropriately scaled to the current display mode. When running in windowed mode, screen space coordinates are the desktop coordinates. The cursor image is drawn at the specified position minus the hotspot-offset specified by the SetCursorProperties method.

If the cursor has been hidden by ShowCursor, the cursor is not drawn.

+
+ + bb174429 + void IDirect3DDevice9::SetCursorPosition([In] int X,[In] int Y,[In] unsigned int Flags) + IDirect3DDevice9::SetCursorPosition +
+ + +

Displays or hides the cursor.

+
+

If bShow is TRUE, the cursor is shown. If bShow is , the cursor is hidden.

+

Value indicating whether the cursor was previously visible. TRUE if the cursor was previously visible, or if the cursor was not previously visible.

+ +

Direct3D cursor functions use either GDI cursor or software emulation, depending on the hardware. Users usually want to respond to a WM_SETCURSOR message. For example, the users might want to write the message handler like this:

 case WM_SETCURSOR: // Turn off window cursor  SetCursor( null ); m_pd3dDevice->ShowCursor( TRUE ); return TRUE; // prevent Windows from setting cursor to window class cursor break;	
+            

Or users might want to call the method if they want to change the cursor. See the code in the DirectX Graphics C/C++ Samples for more detail.

+
+ + bb174470 + BOOL IDirect3DDevice9::ShowCursor([In] BOOL bShow) + IDirect3DDevice9::ShowCursor +
+ + +

Creates an additional swap chain for rendering multiple views.

+
+

Pointer to a structure, containing the presentation parameters for the new swap chain. This value cannot be null.

Calling this method changes the value of members of the structure.

  • If BackBufferCount == 0, calling CreateAdditionalSwapChain will increase it to 1.
  • If the application is in windowed mode, and if either the BackBufferWidth or the BackBufferHeight == 0, they will be set to the client area width and height of the hwnd.
+

Address of a reference to an interface, representing the additional swap chain.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , , , E_OUTOFMEMORY.

+ +

There is always at least one swap chain (the implicit swap chain) for each device because Direct3D 9 has one swap chain as a property of the device.

Note that any given device can support only one full-screen swap chain.

can be specified for the windowed mode back buffer format when calling , and CreateAdditionalSwapChain. This means the application does not have to query the current desktop format before calling CreateDevice for windowed mode. For full-screen mode, the back buffer format must be specified.

+
+ + bb174354 + HRESULT IDirect3DDevice9::CreateAdditionalSwapChain([In] D3DPRESENT_PARAMETERS* pPresentationParameters,[Out, Fast] IDirect3DSwapChain9** pSwapChain) + IDirect3DDevice9::CreateAdditionalSwapChain +
+ + +

Gets a reference to a swap chain.

+
+

The swap chain ordinal value. For more information, see NumberOfAdaptersInGroup in .

+

Pointer to an interface that will receive a copy of swap chain.

+ + bb174411 + HRESULT IDirect3DDevice9::GetSwapChain([In] unsigned int iSwapChain,[Out] IDirect3DSwapChain9** pSwapChain) + IDirect3DDevice9::GetSwapChain +
+ + +

Gets the number of implicit swap chains.

+
+

Number of implicit swap chains. See Remarks.

+ +

Implicit swap chains are created by the device during . This method returns the number of swap chains created by CreateDevice.

An application may create additional swap chains using .

+
+ + bb174396 + unsigned int IDirect3DDevice9::GetNumberOfSwapChains() + IDirect3DDevice9::GetNumberOfSwapChains +
+ + +

Resets the type, size, and format of the swap chain.

+
+

Pointer to a structure, describing the new presentation parameters. This value cannot be null.

When switching to full-screen mode, Direct3D will try to find a desktop format that matches the back buffer format, so that back buffer and front buffer formats will be identical (to eliminate the need for color conversion).

When this method returns:

  • BackBufferCount, BackBufferWidth, and BackBufferHeight are set to zero.
  • BackBufferFormat is set to for windowed mode only; a full-screen mode must specify a format.
+

Possible return values include: , , , , or (see D3DERR).

+ +

If a call to fails, the device will be placed in the "lost" state (as indicated by a return value of from a call to ) unless it is already in the "not reset" state (as indicated by a return value of from a call to ). Refer to and Lost Devices (Direct3D 9) for further information concerning the use of in the context of lost devices.

Calling causes all texture memory surfaces to be lost, managed textures to be flushed from video memory, and all state information to be lost. Before calling the method for a device, an application should release any explicit render targets, depth stencil surfaces, additional swap chains, state blocks, and resources associated with the device.

There are two different types of swap chains: full-screen or windowed. If the new swap chain is full-screen, the adapter will be placed in the display mode that matches the new size.

Direct3D 9 applications can expect messages to be sent to them during this call (for example, before this call is returned); applications should take precautions not to call into Direct3D at this time. In addition, when fails, the only valid methods that can be called are , , and the various Release member functions. Calling any other method can result in an exception.

A call to will fail if called on a different thread than that used to create the device being reset.

Pixel shaders and vertex shaders survive calls for Direct3D 9. They do not need to be re-created explicitly by the application.

can be specified for the windowed mode back buffer format when calling , , and . This means the application does not have to query the current desktop format before calling for windowed mode. For full-screen mode, the back buffer format must be specified. Setting BackBufferCount equal to zero (BackBufferCount = 0) results in one back buffer.

When trying to reset more than one display adapter in a group, set pPresentationParameters to point to an array of structures, one for each display in the adapter group.

If a multihead device was created with , requires an array of structures wherein each structure must specify a full-screen display. To switch back to windowed mode, the application must destroy the device and re-create a non-multihead device in windowed mode.

+
+ + bb174425 + HRESULT IDirect3DDevice9::Reset([In, Out, Params] D3DPRESENT_PARAMETERS* pPresentationParameters) + IDirect3DDevice9::Reset +
+ + +

Presents the contents of the next buffer in the sequence of back buffers owned by the device.

+
+

Pointer to a value that must be null unless the swap chain was created with . pSourceRect is a reference to a structure containing the source rectangle. If null, the entire source surface is presented. If the rectangle exceeds the source surface, the rectangle is clipped to the source surface.

+

Pointer to a value that must be null unless the swap chain was created with . pDestRect is a reference to a structure containing the destination rectangle, in window client coordinates. If null, the entire client area is filled. If the rectangle exceeds the destination client area, the rectangle is clipped to the destination client area.

+

Pointer to a destination window whose client area is taken as the target for this presentation. If this value is null, the runtime uses the hDeviceWindow member of for the presentation.

+

Value must be null unless the swap chain was created with . For more information about swap chains, see Flipping Surfaces (Direct3D 9) and . If this value is non-null, the contained region is expressed in back buffer coordinates. The rectangles within the region are the minimal set of pixels that need to be updated. This method takes these rectangles into account when optimizing the presentation by copying only the pixels within the region, or some suitably expanded set of rectangles. This is an aid to optimization only, and the application should not rely on the region being copied exactly. The implementation can choose to copy the whole source rectangle.

+

Possible return values include: or (see D3DERR).

+ +

If necessary, a stretch operation is applied to transfer the pixels within the source rectangle to the destination rectangle in the client area of the target window.

Present will fail, returning , if called between BeginScene and EndScene pairs unless the render target is not the current render target (such as the back buffer you get from creating an additional swap chain). This is a new behavior for Direct3D 9.

+
+ + bb174423 + HRESULT IDirect3DDevice9::Present([In] const void* pSourceRect,[In] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const void* pDirtyRegion) + IDirect3DDevice9::Present +
+ + +

Retrieves a back buffer from the device's swap chain.

+
+

An unsigned integer specifying the swap chain.

+

Index of the back buffer object to return. Back buffers are numbered from 0 to the total number of back buffers minus one. A value of 0 returns the first back buffer, not the front buffer. The front buffer is not accessible through this method. Use to retrieve a copy of the front buffer.

+

Stereo view is not supported in Direct3D 9, so the only valid value for this parameter is .

+

Address of a reference to an interface, representing the returned back buffer surface.

+ +

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

+
+ + bb174379 + HRESULT IDirect3DDevice9::GetBackBuffer([In] unsigned int iSwapChain,[In] unsigned int iBackBuffer,[In] D3DBACKBUFFER_TYPE Type,[Out] IDirect3DSurface9** ppBackBuffer) + IDirect3DDevice9::GetBackBuffer +
+ + +

Returns information describing the raster of the monitor on which the swap chain is presented.

+
+

An unsigned integer specifying the swap chain.

+

Pointer to a structure filled with information about the position or other status of the raster on the monitor driven by this adapter.

+ + bb174402 + HRESULT IDirect3DDevice9::GetRasterStatus([In] unsigned int iSwapChain,[Out] D3DRASTER_STATUS* pRasterStatus) + IDirect3DDevice9::GetRasterStatus +
+ + +

This method allows the use of GDI dialog boxes in full-screen mode applications.

+
+

TRUE to enable GDI dialog boxes, and to disable them.

+

If the method succeeds, the return value is . If the method fails, the return value can be unless all of the following are true.

  • The application specified a back buffer format compatible with GDI, in other words, one of , , or .
  • The application specified no multisampling.
  • The application specified .
  • The application specified .
  • The application did not specify .
  • The application is not between BeginScene and EndScene.
+ +

The GDI dialog boxes must be created as child to the device window. They should also be created within the same thread that created the device because this enables the parent window to manage redrawing the child window.

The method has no effect for windowed mode applications, but this setting will be respected if the application resets the device into full-screen mode. If SetDialogBoxMode succeeds in a windowed mode application, any subsequent reset to full-screen mode will be checked against the restrictions listed above. Also, SetDialogBoxMode causes all back buffers on the swap chain to be discarded, so an application is expected to refresh its content for all back buffers after this call.

+
+ + bb174432 + HRESULT IDirect3DDevice9::SetDialogBoxMode([In] BOOL bEnableDialogs) + IDirect3DDevice9::SetDialogBoxMode +
+ + +

Sets the gamma correction ramp for the implicit swap chain. This method will affect the entire screen (not just the active window if you are running in windowed mode).

+
+

Unsigned integer specifying the swap chain.

+

Indicates whether correction should be applied. Gamma correction results in a more consistent display, but can incur processing overhead and should not be used frequently. Short-duration effects, such as flashing the whole screen red, should not be calibrated, but long-duration gamma changes should be calibrated. One of the following values can be set:

ItemDescription

D3DSGR_CALIBRATE

If a gamma calibrator is installed, the ramp will be modified before being sent to the device to account for the system and monitor response curves. If a calibrator is not installed, the ramp will be passed directly to the device.

D3DSGR_NO_CALIBRATION

No gamma correction is applied. The supplied gamma table is transferred directly to the device.

?

+

Pointer to a structure, representing the gamma correction ramp to be set for the implicit swap chain.

+ +

There is always at least one swap chain (the implicit swap chain) for each device, because Direct3D 9 has one swap chain as a property of the device. The gamma ramp takes effect immediately; there is no wait for a vertical sync.

If the device does not support gamma ramps in the swap chain's current presentation mode (full-screen or windowed), no error return is given. Applications can check the and capability bits in the Caps2 member of the structure to determine the capabilities of the device and whether a calibrator is installed.

For windowed gamma correction presentation, use if the hardware supports the feature. In DirectX 8, SetGammaRamp will set the gamma ramp only on a full-screen mode application. For more information about gamma correction, see Gamma (Direct3D 9).

+
+ + bb174434 + void IDirect3DDevice9::SetGammaRamp([In] unsigned int iSwapChain,[In] unsigned int Flags,[In] const D3DGAMMARAMP* pRamp) + IDirect3DDevice9::SetGammaRamp +
+ + +

Retrieves the gamma correction ramp for the swap chain.

+
+

An unsigned integer specifying the swap chain.

+ + bb174390 + void IDirect3DDevice9::GetGammaRamp([In] unsigned int iSwapChain,[Out] D3DGAMMARAMP* pRamp) + IDirect3DDevice9::GetGammaRamp +
+ + +

Creates a texture resource.

+
+

Width of the top-level of the texture, in pixels. The pixel dimensions of subsequent levels will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by 2 results in 0, 1 will be taken instead.

+

Height of the top-level of the texture, in pixels. The pixel dimensions of subsequent levels will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by 2 results in 0, 1 will be taken instead.

+

Number of levels in the texture. If this is zero, Direct3D will generate all texture sublevels down to 1 by 1 pixels for hardware that supports mipmapped textures. Call to see the number of levels generated.

+

Usage can be 0, which indicates no usage value. However, if usage is desired, use a combination of one or more constants. It is good practice to match the usage parameter with the behavior flags in .

+

Member of the enumerated type, describing the format of all levels in the texture.

+

Member of the enumerated type, describing the memory class into which the texture should be placed.

+

Pointer to an interface, representing the created texture resource.

+

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , E_OUTOFMEMORY.

+ +

An application can discover support for Automatic Generation of Mipmaps (Direct3D 9) in a particular format by calling with . If returns , will succeed but it will return a one-level texture.

In Windows Vista CreateTexture can create a texture from a system memory reference allowing the application more flexibility over the use, allocation and deletion of the system memory. For example, an application could pass a GDI system memory bitmap reference and get a Direct3D texture interface around it. Using a system memory reference with CreateTexture has the following restrictions.

  • The pitch of the texture must be equal to the width multiplied by the number of bytes per pixel.
  • Only textures with a single mipmap level are supported. The Levels argument must be 1.
  • The Pool argument must be .
  • The pSharedHandle argument must be a valid reference to a buffer that can hold the system memory point; *pSharedHandle must be a valid reference to system memory with a size in bytes of texture width * texture height * bytes per pixel of the texture format.
+
+ + bb174363 + HRESULT IDirect3DDevice9::CreateTexture([In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Levels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DTexture9** ppTexture,[In] void** pSharedHandle) + IDirect3DDevice9::CreateTexture +
+ + +

Creates a volume texture resource.

+
+

Width of the top-level of the volume texture, in pixels. This value must be a power of two if the member of is set. The pixel dimensions of subsequent levels will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by two results in 0 (zero), 1 will be taken instead. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in .

+

Height of the top-level of the volume texture, in pixels. This value must be a power of two if the member of is set. The pixel dimensions of subsequent levels will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by 2 results in 0 (zero), 1 will be taken instead. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in .

+

Depth of the top-level of the volume texture, in pixels. This value must be a power of two if the member of is set. The pixel dimensions of subsequent levels will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by 2 results in 0 (zero), 1 will be taken instead. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in .

+

Number of levels in the texture. If this is zero, Direct3D will generate all texture sublevels down to 1x1 pixels for hardware that supports mipmapped volume textures. Call to see the number of levels generated.

+

Usage can be 0, which indicates no usage value. If usage is desired, use or . For more information, see .

+

Member of the enumerated type, describing the format of all levels in the volume texture.

+

Member of the enumerated type, describing the memory class into which the volume texture should be placed.

+

Address of a reference to an interface, representing the created volume texture resource.

+

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , E_OUTOFMEMORY.

+ + bb174367 + HRESULT IDirect3DDevice9::CreateVolumeTexture([In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Depth,[In] unsigned int Levels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DVolumeTexture9** ppVolumeTexture,[In] void** pSharedHandle) + IDirect3DDevice9::CreateVolumeTexture +
+ + +

Creates a cube texture resource.

+
+

Size of the edges of all the top-level faces of the cube texture. The pixel dimensions of subsequent levels of each face will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by 2 results in 0 (zero), 1 will be taken instead.

+

Number of levels in each face of the cube texture. If this is zero, Direct3D will generate all cube texture sublevels down to 1x1 pixels for each face for hardware that supports mipmapped cube textures. Call to see the number of levels generated.

+

Usage can be 0, which indicates no usage value. However, if usage is desired, use a combination of one or more constants. It is good practice to match the usage parameter in CreateCubeTexture with the behavior flags in . For more information, see Remarks.

+

Member of the enumerated type, describing the format of all levels in all faces of the cube texture.

+

Member of the enumerated type, describing the memory class into which the cube texture should be placed.

+

Address of a reference to an interface, representing the created cube texture resource.

+

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , E_OUTOFMEMORY.

+ +

A mipmap (texture) is a collection of successively downsampled (mipmapped) surfaces. On the other hand, a cube texture (created by ) is a collection of six textures (mipmaps), one for each face. All faces must be present in the cube texture. Also, a cube map surface must be the same pixel size in all three dimensions (x, y, and z).

An application can discover support for Automatic Generation of Mipmaps (Direct3D 9) in a particular format by calling with . If returns , will succeed but it will return a one-level texture.

+
+ + bb174355 + HRESULT IDirect3DDevice9::CreateCubeTexture([In] unsigned int EdgeLength,[In] unsigned int Levels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DCubeTexture9** ppCubeTexture,[In] void** pSharedHandle) + IDirect3DDevice9::CreateCubeTexture +
+ + +

Creates a vertex buffer.

+
+

Size of the vertex buffer, in bytes. For FVF vertex buffers, Length must be large enough to contain at least one vertex, but it need not be a multiple of the vertex size. Length is not validated for non-FVF buffers. See Remarks.

+

Usage can be 0, which indicates no usage value. However, if usage is desired, use a combination of one or more constants. It is good practice to match the usage parameter in CreateVertexBuffer with the behavior flags in . For more information, see Remarks.

+

Combination of , a usage specifier that describes the vertex format of the vertices in this buffer. If this parameter is set to a valid FVF code, the created vertex buffer is an FVF vertex buffer (see Remarks). Otherwise, if this parameter is set to zero, the vertex buffer is a non-FVF vertex buffer.

+

Member of the enumerated type, describing a valid memory class into which to place the resource. Do not set to .

+

Address of a reference to an interface, representing the created vertex buffer resource.

+

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , E_OUTOFMEMORY.

+ +

A vertex buffer can be used with either hardware or software vertex processing. This is determined by how the device and the vertex buffer are created.

When a device is created, CreateDevice uses the behavior flag to determine whether to process vertices in hardware or software. There are three possibilities:

  • Process vertices in hardware by setting .
  • Process vertices in software by setting .
  • Process vertices in either hardware or software by setting .

Mixed-mode devices might need to switch between software and hardware processing (using ) after the device is created.

When a vertex buffer is created, CreateVertexBuffer uses the usage parameter to decide whether to process vertices in hardware or software.

  • If CreateDevice uses , CreateVertexBuffer must use 0.
  • If CreateDevice uses , CreateVertexBuffer must use either 0 or . For either value, vertices will be processed in software.
  • If CreateDevice uses , CreateVertexBuffer can use either 0 or .

To use a vertex buffer with a mixed mode device, create a single vertex buffer which can be used for both hardware or software processing. Use to set the current vertex buffer and use , if necessary, to change the device behavior to match. It is recommended that the vertex buffer usage matches the device behavior. Note that a vertex buffer created for software processing cannot be located in video memory.

The interface supports rendering of primitives using vertex data stored in vertex buffer objects. Vertex buffers are created from the , and are usable only with the object from which they are created.

When set to a nonzero value, which must be a valid FVF code, the FVF parameter indicates that the buffer content is to be characterized by an FVF code. A vertex buffer that is created with an FVF code is referred to as an FVF vertex buffer. For more information, see FVF Vertex Buffers (Direct3D 9).

Non-FVF buffers can be used to interleave data during multipass rendering or multitexture rendering in a single pass. To do this, one buffer contains geometry data and the others contain texture coordinates for each texture to be rendered. When rendering, the buffer containing the geometry data is interleaved with each of the buffers containing the texture coordinates. If FVF buffers were used instead, each of them would need to contain identical geometry data in addition to the texture coordinate data specific to each texture rendered. This would result in either a speed or memory penalty, depending on the strategy used. For more information about texture coordinates, see Texture Coordinates (Direct3D 9).

+
+ + bb174364 + HRESULT IDirect3DDevice9::CreateVertexBuffer([In] unsigned int Length,[In] D3DUSAGE Usage,[In] D3DFVF FVF,[In] D3DPOOL Pool,[Out, Fast] IDirect3DVertexBuffer9** ppVertexBuffer,[In] void** pSharedHandle) + IDirect3DDevice9::CreateVertexBuffer +
+ + +

Creates an index buffer.

+
+

Size of the index buffer, in bytes.

+

Usage can be 0, which indicates no usage value. However, if usage is desired, use a combination of one or more constants. It is good practice to match the usage parameter in CreateIndexBuffer with the behavior flags in . For more information, see Remarks.

+

Member of the enumerated type, describing the format of the index buffer. For more information, see Remarks. The valid settings are the following:

ItemDescription

Indices are 16 bits each.

Indices are 32 bits each.

?

+

Member of the enumerated type, describing a valid memory class into which to place the resource.

+

Address of a reference to an interface, representing the created index buffer resource.

+

This parameter can be used in Direct3D?9 for Windows?Vista to share resources; set it to null to not share a resource. This parameter is not used in Direct3D?9 for operating systems earlier than Windows?Vista; set it to null.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

Index buffers are memory resources used to hold indices, they are similar to both surfaces and vertex buffers. The use of index buffers enables Direct3D to avoid unnecessary data copying and to place the buffer in the optimal memory type for the expected usage.

To use index buffers, create an index buffer, lock it, fill it with indices, unlock it, pass it to , set up the vertices, set up the vertex shader, and call for rendering.

The MaxVertexIndex member of the structure indicates the types of index buffers that are valid for rendering.

+
+ + bb174357 + HRESULT IDirect3DDevice9::CreateIndexBuffer([In] unsigned int Length,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DIndexBuffer9** ppIndexBuffer,[In] void** pSharedHandle) + IDirect3DDevice9::CreateIndexBuffer +
+ + +

Creates a render-target surface.

+
+

Width of the render-target surface, in pixels.

+

Height of the render-target surface, in pixels.

+

Member of the enumerated type, describing the format of the render target.

+

Member of the enumerated type, which describes the multisampling buffer type. This parameter specifies the antialiasing type for this render target. When this surface is passed to , its multisample type must be the same as that of the depth-stencil set by .

+

Quality level. The valid range is between zero and one less than the level returned by pQualityLevels used by . Passing a larger value returns the error, . The MultisampleQuality values of paired render targets, depth stencil surfaces, and the multisample type must all match.

+

Render targets are not lockable unless the application specifies TRUE for Lockable.

Note that lockable render targets reduce performance on some graphics hardware. The readback performance (moving data from video memory to system memory) depends on the type of hardware used (AGP vs. PCI Express) and is usually far lower than upload performance (moving data from system to video memory). If you need read access to render targets, use GetRenderTargetData instead of lockable render targets.

+

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

+

Address of a reference to an interface.

+ +

Render-target surfaces are placed in the memory class.

The creation of lockable, multisampled render targets is not supported.

+
+ + bb174361 + HRESULT IDirect3DDevice9::CreateRenderTarget([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Lockable,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle) + IDirect3DDevice9::CreateRenderTarget +
+ + +

Creates a depth-stencil resource.

+
+

Width of the depth-stencil surface, in pixels.

+

Height of the depth-stencil surface, in pixels.

+

Member of the enumerated type, describing the format of the depth-stencil surface. This value must be one of the enumerated depth-stencil formats for this device.

+

Member of the enumerated type, describing the multisampling buffer type. This value must be one of the allowed multisample types. When this surface is passed to , its multisample type must be the same as that of the render target set by .

+

Quality level. The valid range is between zero and one less than the level returned by pQualityLevels used by . Passing a larger value returns the error . The MultisampleQuality values of paired render targets, depth stencil surfaces, and the MultiSample type must all match.

+

Set this flag to TRUE to enable z-buffer discarding, and otherwise. If this flag is set, the contents of the depth stencil buffer will be invalid after calling either or with a different depth surface.

This flag has the same behavior as the constant, , in .

+

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

+

Address of a reference to an interface, representing the created depth-stencil surface resource.

+ +

The memory class of the depth-stencil buffer is always .

+
+ + bb174356 + HRESULT IDirect3DDevice9::CreateDepthStencilSurface([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Discard,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle) + IDirect3DDevice9::CreateDepthStencilSurface +
+ + +

Copies rectangular subsets of pixels from one surface to another.

+
+

Pointer to an interface, representing the source surface. This parameter must point to a different surface than pDestinationSurface.

+

Pointer to a rectangle on the source surface. Specifying null for this parameter causes the entire surface to be copied.

+

Pointer to an interface, representing the destination surface.

+

Pointer to the upper left corner of the destination rectangle. Specifying null for this parameter causes the entire surface to be copied.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: .

+ +

This method is similar to CopyRects in DirectX 8.

This function has the following restrictions.

  • The source surface must have been created with .
  • The destination surface must have been created with .
  • Neither surface can be locked or holding an outstanding device context.
  • Neither surface can be created with multisampling. The only valid flag for both surfaces is .
  • The surface format cannot be a depth stencil format.
  • The source and dest rects must fit within the surface.
  • No stretching or shrinking is allowed (the rects must be the same size).
  • The source format must match the dest format.

The following table shows the supported combinations.

Dest formats
TextureRT textureRTOff-screen plain
Src formatsTextureYesYesYes*Yes
RT textureNoNoNoNo
RTNoNoNoNo
Off-screen plainYesYesYesYes

?

* If the driver does not support the requested copy, it will be emulated using lock and copy.

If the application needs to copy data from a render target to a surface, it can use GetRenderTargetData.

+
+ + bb205857 + HRESULT IDirect3DDevice9::UpdateSurface([In] IDirect3DSurface9* pSourceSurface,[In, Optional] const RECT* pSourceRect,[In] IDirect3DSurface9* pDestinationSurface,[In, Optional] const POINT* pDestPoint) + IDirect3DDevice9::UpdateSurface +
+ + +

Updates the dirty portions of a texture.

+
+

Pointer to an interface, representing the source texture. The source texture must be in system memory ().

+

Pointer to an interface, representing the destination texture. The destination texture must be in the memory pool.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

You can dirty a portion of a texture by locking it, or by calling one of the following methods.

retrieves the dirty portions of the texture by calculating what has been accumulated since the last update operation.

For performance reasons, dirty regions are only recorded for level zero of a texture. For sublevels, it is assumed that the corresponding (scaled) rectangle or box is also dirty. Dirty regions are automatically recorded when LockRect or is called without or . Also, the destination surface of is marked dirty.

This method fails if the textures are of different types, if their bottom-level buffers are of different sizes, or if their matching levels do not match. For example, consider a six-level source texture with the following dimensions.

 32x16, 16x8, 8x4, 4x2, 2x1, 1x1	
+            

This six-level source texture could be the source for the following one-level destination.

 1x1	
+            

For the following two-level destination.

 2x1, 1x1	
+            

Or, for the following three-level destination.

 4x2, 2x1, 1x1	
+            

In addition, this method will fail if the textures are of different formats. If the destination texture has fewer levels than the source, only the matching levels are copied. If the source texture has fewer levels than the destination, the method will fail.

If the source texture has dirty regions, the copy can be optimized by restricting the copy to only those regions. It is not guaranteed that only those bytes marked dirty will be copied.

Here are the possibilities for source and destination surface combinations:

  • If pSourceTexture is a non-autogenerated mipmap and pDestinationTexture is an autogenerated mipmap, only the topmost matching level is updated, and the destination sublevels are regenerated. All other source sublevels are ignored.
  • If both pSourceTexture and pDestinationTexture are autogenerated mipmaps, only the topmost matching level is updated. The sublevels from the source are ignored and the destination sublevels are regenerated.
  • If pSourceTexture is an autogenerated mipmap and pDestinationTexture a non-autogenerated mipmap, UpdateTexture will fail.
+
+ + bb205858 + HRESULT IDirect3DDevice9::UpdateTexture([In] IDirect3DBaseTexture9* pSourceTexture,[In] IDirect3DBaseTexture9* pDestinationTexture) + IDirect3DDevice9::UpdateTexture +
+ + +

Copies the render-target data from device memory to system memory.

+
+

Pointer to an object, representing a render target.

+

Pointer to an object, representing a destination surface.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , .

+ +

The destination surface must be either an off-screen plain surface or a level of a texture (mipmap or cube texture) created with .

The source surface must be a regular render target or a level of a render-target texture (mipmap or cube texture) created with POOL_DEFAULT.

This method will fail if:

  • The render target is multisampled.
  • The source render target is a different size than the destination surface.
  • The source render target and destination surface formats do not match.
+
+ + bb174405 + HRESULT IDirect3DDevice9::GetRenderTargetData([In] IDirect3DSurface9* pRenderTarget,[In] IDirect3DSurface9* pDestSurface) + IDirect3DDevice9::GetRenderTargetData +
+ + +

Generates a copy of the device's front buffer and places that copy in a system memory buffer provided by the application.

+
+

An unsigned integer specifying the swap chain.

+

Pointer to an interface that will receive a copy of the contents of the front buffer. The data is returned in successive rows with no intervening space, starting from the vertically highest row on the device's output to the lowest.

For windowed mode, the size of the destination surface should be the size of the desktop. For full-screen mode, the size of the destination surface should be the screen size.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , ,

+ +

The buffer pointed to by pDestSurface will be filled with a representation of the front buffer, converted to the standard 32 bits per pixel format .

This method is the only way to capture an antialiased screen shot.

This function is very slow, by design, and should not be used in any performance-critical path.

For more information, see Lost Devices and Retrieved Data.

+
+ + bb174388 + HRESULT IDirect3DDevice9::GetFrontBufferData([In] unsigned int iSwapChain,[In] IDirect3DSurface9* pDestSurface) + IDirect3DDevice9::GetFrontBufferData +
+ + +

Copy the contents of the source rectangle to the destination rectangle. The source rectangle can be stretched and filtered by the copy. This function is often used to change the aspect ratio of a video stream.

+
+

Pointer to the source surface. See .

+

Pointer to the source rectangle. A null for this parameter causes the entire source surface to be used.

+

Pointer to the destination surface. See .

+

Pointer to the destination rectangle. A null for this parameter causes the entire destination surface to be used.

+

Filter type. Allowable values are , , or . For more information, see .

+

If the method succeeds, the return value is . If the method fails, the return value can be: .

+ +

StretchRect Restrictions

  • Driver support varies. See the section on driver support (below) to see which drivers support which source and destination formats.
  • The source and destination surfaces must be created in the default memory pool.
  • If filtering is specified, you must set the appropriate filter caps (see StretchRectFilterCaps in ).
  • Stretching is not supported between source and destination rectangles on the same surface.
  • Stretching is not supported if the destination surface is an off-screen plain surface but the source is not.
  • You many not stretch between source and destination rectangles if either surface is in a compressed format (see Using Compressed Textures (Direct3D 9)).
  • Stretching supports color-space conversion from YUV to high-precision RGBA only. Since color conversion support is not supported by software emulation, use to test the hardware for color conversion support.
  • If the source or destination surface is a texture surface (or a cube texture surface), you must use a Direct3D 9 driver that supports (see ).

Additional Restrictions for Depth and Stencil Surfaces

  • The source and destination surfaces must be plain depth stencil surfaces (not textures) (see ).
  • Neither of the surfaces can be discardable.
  • The entire surface must be copied (that is: sub-rectangle copies are not allowed).
  • Format conversion, stretching, and shrinking are not supported.
  • StretchRect cannot be called inside of a BeginScene/EndScene pair.

Using StretchRect to downsample a Multisample Rendertarget

You can use StretchRect to copy from one rendertarget to another. If the source rendertarget is multisampled, this results in downsampling the source rendertarget. For instance you could:

  • Create a multisampled rendertarget.
  • Create a second rendertarget of the same size, that is not multisampled.
  • Copy (using StretchRect the multisample rendertarget to the second rendertarget.

Note that use of the extra surface involved in using StretchRect to downsample a Multisample Rendertarget will result in a performance hit.

Driver Support

There are many restrictions as to which surface combinations are valid for StretchRect. Factors include whether the driver is a Direct3D 9 driver or older, and whether the operation will result in stretching/shrinking. Since applications are not expected to recognize if the driver is a Direct3D 9 driver or not, the runtime will automatically set a new cap, cap (see ), for Direct3D 9-level drivers and above.

DirectX 8 Driver (no stretching)
Dest formats
TextureRT textureRTOff-screen plain
Src formatsTextureNoNoNoNo
RT textureNoYesYesNo
RTNoYesYesNo
Off-screen plainYesYesYesYes

?

DirectX 8 Driver (stretching)
Dest formats
TextureRT textureRTOff-screen plain
Src formatsTextureNoNoNoNo
RT textureNoNoNoNo
RTNoYesYesNo
Off-screen plainNoYesYesNo

?

Direct3D 9 Driver (no stretching)
Dest formats
TextureRT textureRTOff-screen plain
Src formatsTextureNoYesYesNo
RT textureNoYesYesNo
RTNoYesYesNo
Off-screen plainNoYesYesYes

?

Direct3D 9 Driver (stretching)
Dest formats
TextureRT textureRTOff-screen plain
Src formatsTextureNoYesYesNo
RT textureNoYesYesNo
RTNoYesYesNo
Off-screen plainNoYesYesNo

?

+
+ + bb174471 + HRESULT IDirect3DDevice9::StretchRect([In] IDirect3DSurface9* pSourceSurface,[In, Optional] const RECT* pSourceRect,[In] IDirect3DSurface9* pDestSurface,[In, Optional] const RECT* pDestRect,[In] D3DTEXTUREFILTERTYPE Filter) + IDirect3DDevice9::StretchRect +
+ + +

Allows an application to fill a rectangular area of a surface with a specified color.

+
+

Pointer to the surface to be filled.

+

Pointer to the source rectangle. Using null means that the entire surface will be filled.

+

Color used for filling.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

This method can only be applied to a render target, a render-target texture surface, or an off-screen plain surface with a pool type of .

will work with all formats. However, when using a reference or software device, the only formats supported are , , , , , , , , , , , , , , and .

When using a DirectX 7 or DirectX 8.x driver, the only YUV formats supported are and .

+
+ + bb174353 + HRESULT IDirect3DDevice9::ColorFill([In] IDirect3DSurface9* pSurface,[In, Optional] const RECT* pRect,[In] D3DCOLOR color) + IDirect3DDevice9::ColorFill +
+ + +

Create an off-screen surface.

+
+

Width of the surface.

+

Height of the surface.

+

Format of the surface. See .

+

Surface pool type. See .

+

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

+

Pointer to the interface created.

+ +

will return a surface that has identical characteristics to a surface created by the DirectX 8.x method CreateImageSurface.

is the appropriate pool for use with the and .

is not allowed when creating an offscreen plain surface. For more information about memory pools, see .

Off-screen plain surfaces are always lockable, regardless of their pool types.

+
+ + bb174358 + HRESULT IDirect3DDevice9::CreateOffscreenPlainSurface([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle) + IDirect3DDevice9::CreateOffscreenPlainSurface +
+ + +

Sets a new color buffer for the device.

+
+

Index of the render target. See Remarks.

+

Pointer to a new color buffer. If null, the color buffer for the corresponding RenderTargetIndex is disabled. Devices always must be associated with a color buffer. The new render-target surface must have at least specified.

+

If the method succeeds, the return value is . This method will return if either:

  • pRenderTarget = null and RenderTargetIndex = 0
  • pRenderTarget is != null and the render target is invalid.
+ +

The device can support multiple render targets. The number of render targets supported by a device is contained in the NumSimultaneousRTs member of . See Multiple Render Targets (Direct3D 9).

Setting a new render target will cause the viewport (see Viewports and Clipping (Direct3D 9)) to be set to the full size of the new render target.

Some hardware tests the compatibility of the depth stencil buffer with the color buffer. If this is done, it is only done in a debug build.

Restrictions for using this method include the following:

  • The multisample type must be the same for the render target and the depth stencil surface.
  • The formats must be compatible for the render target and the depth stencil surface. See .
  • The size of the depth stencil surface must be greater than or equal to the size of the render target.

These restrictions are validated only when using the debug runtime when any of the Draw methods are called.

Cube textures differ from other surfaces in that they are collections of surfaces. To call with a cube texture, you must select an individual face using and pass the resulting surface to .

+
+ + bb174455 + HRESULT IDirect3DDevice9::SetRenderTarget([In] unsigned int RenderTargetIndex,[In] IDirect3DSurface9* pRenderTarget) + IDirect3DDevice9::SetRenderTarget +
+ + +

Retrieves a render-target surface.

+
+

Index of the render target. See Remarks.

+

Address of a reference to an interface, representing the returned render-target surface for this device.

+ +

Typically, methods that return state will not work on a device that is created using . This method however, will work even on a pure device because it returns an interface.

The device can now support multiple render targets. The number of render targets supported by a device is contained in the NumSimultaneousRTs member of . See Multiple Render Targets (Direct3D 9).

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using the interface results in a memory leak.

+
+ + bb174404 + HRESULT IDirect3DDevice9::GetRenderTarget([In] unsigned int RenderTargetIndex,[Out] IDirect3DSurface9** ppRenderTarget) + IDirect3DDevice9::GetRenderTarget +
+ + +

Sets the depth stencil surface.

+
+

Address of a reference to an interface representing the depth stencil surface. Setting this to null disables the depth stencil operation.

+

If the method succeeds, the return value is . If pZStencilSurface is other than null, the return value is when the stencil surface is invalid.

+ +

Restrictions for using this method include the following:

  • The multisample type must be the same for the render target and the depth stencil surface.
  • The formats must be compatible for the render target and the depth stencil surface. See .
  • The size of the depth stencil surface must be greater than or equal to the size of the render target.

These restrictions are validated only when using the debug runtime when any of the Draw methods are called.

Cube textures differ from other surfaces in that they are collections of surfaces. To call with a cube texture, you must select an individual face using and pass the resulting surface to .

+
+ + bb174431 + HRESULT IDirect3DDevice9::SetDepthStencilSurface([In] IDirect3DSurface9* pNewZStencil) + IDirect3DDevice9::SetDepthStencilSurface +
+ + +

Gets the depth-stencil surface owned by the Direct3DDevice object.

+
+

Address of a reference to an interface, representing the returned depth-stencil surface.

+

If the method succeeds, the return value is .If the device doesn't have a depth stencil buffer associated with it, the return value will be . Otherwise, if the method fails, the return value can be .

+ +

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

+
+ + bb174384 + HRESULT IDirect3DDevice9::GetDepthStencilSurface([Out] IDirect3DSurface9** ppZStencilSurface) + IDirect3DDevice9::GetDepthStencilSurface +
+ + +

Begins a scene.

+
+

If the method succeeds, the return value is . The method will fail with if is called while already in a / pair. This happens only when is called twice without first calling .

+ +

Applications must call before performing any rendering and must call when rendering is complete and before calling again.

If fails, the device was unable to begin the scene, and there is no need to call . In fact, calls to will fail if the previous failed. This applies to any application that creates multiple swap chains.

There should be one / pair between any successive calls to present (either or ). should be called once before any rendering is performed, and should be called once after all rendering for a frame has been submitted to the runtime. Multiple non-nested / pairs between calls to present are legal, but having more than one pair may incur a performance hit. To enable maximal parallelism between the CPU and the graphics accelerator, it is advantageous to call as far ahead of calling present as possible.

+
+ + bb174350 + HRESULT IDirect3DDevice9::BeginScene() + IDirect3DDevice9::BeginScene +
+ + +

Ends a scene that was begun by calling .

+
+

If the method succeeds, the return value is . The method will fail with if is called while already in a / pair. This happens only when is called twice without first calling .

+ +

When this method succeeds, the scene has been queued up for rendering by the driver. This is not a synchronous method, so the scene is not guaranteed to have completed rendering when this method returns.

Applications must call before performing any rendering and must call when rendering is complete and before calling again.

If fails, the device was unable to begin the scene, and there is no need to call . In fact, calls to will fail if the previous failed. This applies to any application that creates multiple swap chains.

There should be at most one / pair between any successive calls to present (either or ). should be called once before any rendering is performed, and should be called once after all rendering for a frame has been submitted to the runtime. To enable maximal parallelism between the CPU and the graphics accelerator, it is advantageous to call as far ahead of calling present as possible.

+
+ + bb174375 + HRESULT IDirect3DDevice9::EndScene() + IDirect3DDevice9::EndScene +
+ + +

Clears one or more surfaces such as a render target, multiple render targets, a stencil buffer, and a depth buffer.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the method succeeds, the return value is . If the method fails, the return value can be: .

+ +

Use this method to clear a surface including: a render target, all render targets in an MRT, a stencil buffer, or a depth buffer. Flags determines how many surfaces are cleared. Use pRects to clear a subset of a surface defined by an array of rectangles.

will fail if you:

  • Try to clear either the depth buffer or the stencil buffer of a render target that does not have an attached depth buffer.
  • Try to clear the stencil buffer when the depth buffer does not contain stencil data.
+
+ + bb174352 + HRESULT IDirect3DDevice9::Clear([In] unsigned int Count,[In, Buffer, Optional] const D3DRECT* pRects,[In] D3DCLEAR Flags,[In] D3DCOLOR Color,[In] float Z,[In] unsigned int Stencil) + IDirect3DDevice9::Clear +
+ + +

Sets a single device transformation-related state.

+
+

Device-state variable that is being modified. This parameter can be any member of the enumerated type, or the D3DTS_WORLDMATRIX macro.

+

Pointer to a structure that modifies the current transformation.

+

If the method succeeds, the return value is . is returned if one of the arguments is invalid.

+ + bb174463 + HRESULT IDirect3DDevice9::SetTransform([In] int State,[In] const D3DMATRIX* pMatrix) + IDirect3DDevice9::SetTransform +
+ + +

Retrieves a matrix describing a transformation state.

+
+

Device state variable that is being modified. This parameter can be any member of the enumerated type, or the D3DTS_WORLDMATRIX macro.

+

Pointer to a structure, describing the returned transformation state.

+ +

This method will not return device state for a device that is created using . If you want to use this method, you must create your device with any of the other flag values in .

+
+ + bb174414 + HRESULT IDirect3DDevice9::GetTransform([In] D3DTRANSFORMSTATETYPE State,[Out] D3DMATRIX* pMatrix) + IDirect3DDevice9::GetTransform +
+ + +

Multiplies a device's world, view, or projection matrices by a specified matrix.

+
+

Member of the enumerated type, or the D3DTS_WORLDMATRIX macro that identifies which device matrix is to be modified. The most common setting, D3DTS_WORLDMATRIX(0), modifies the world matrix, but you can specify that the method modify the view or projection matrices, if needed.

+

Pointer to a structure that modifies the current transformation.

+

If the method succeeds, the return value is . if one of the arguments is invalid.

+ +

The multiplication order is pMatrix times State.

An application might use the method to work with hierarchies of transformations. For example, the geometry and transformations describing an arm might be arranged in the following hierarchy.

 shoulder_transformation upper_arm geometry elbow transformation lower_arm geometry wrist transformation hand geometry	
+            

An application might use the following series of calls to render this hierarchy. Not all the parameters are shown in this pseudocode.

 (D3DTS_WORLDMATRIX(0),  shoulder_transform)	
+            (upper_arm)	
+            (D3DTS_WORLDMATRIX(0),  elbow_transform)	
+            (lower_arm)	
+            (D3DTS_WORLDMATRIX(0),  wrist_transform)	
+            (hand)
+
+ + bb174422 + HRESULT IDirect3DDevice9::MultiplyTransform([In] D3DTRANSFORMSTATETYPE arg0,[In] const D3DMATRIX* arg1) + IDirect3DDevice9::MultiplyTransform +
+ + +

Sets the viewport parameters for the device.

+
+

Pointer to a structure, specifying the viewport parameters to set.

+

If the method succeeds, the return value is . If the method fails, it will return . This will happen if pViewport is invalid, or if pViewport describes a region that cannot exist within the render target surface.

+ +

Direct3D sets the following default values for the viewport.

  vp;	
+            vp.X      = 0;	
+            vp.Y      = 0;	
+            vp.Width  = RenderTarget.Width;	
+            vp.Height = RenderTarget.Height;	
+            vp.MinZ   = 0.0f;	
+            vp.MaxZ   = 1.0f;	
+            

can be used to draw on part of the screen. Make sure to call it before any geometry is drawn so the viewport settings will take effect.

To draw multiple views within a scene, repeat the and draw geometry sequence for each view.

+
+ + bb174469 + HRESULT IDirect3DDevice9::SetViewport([In] const D3DVIEWPORT9* pViewport) + IDirect3DDevice9::SetViewport +
+ + +

Retrieves the viewport parameters currently set for the device.

+
+

Pointer to a structure, representing the returned viewport parameters.

+

If the method succeeds, the return value is . is returned if the pViewport parameter is invalid.

+ +

Typically, methods that return state will not work on a device that is created using . This method however, will work even on a pure device.

+
+ + bb174420 + HRESULT IDirect3DDevice9::GetViewport([Out] D3DVIEWPORT9* pViewport) + IDirect3DDevice9::GetViewport +
+ + +

Sets the material properties for the device.

+
+

Pointer to a structure, describing the material properties to set.

+

If the method succeeds, the return value is . if the pMaterial parameter is invalid.

+ + bb174437 + HRESULT IDirect3DDevice9::SetMaterial([In] const D3DMATERIAL9* pMaterial) + IDirect3DDevice9::SetMaterial +
+ + +

Retrieves the current material properties for the device.

+
+

Pointer to a structure to fill with the currently set material properties.

+

If the method succeeds, the return value is . if the pMaterial parameter is invalid.

+ +

This method will not return device state for a device that is created using . If you want to use this method, you must create your device with any of the other values in .

+
+ + bb174394 + HRESULT IDirect3DDevice9::GetMaterial([Out] D3DMATERIAL9* pMaterial) + IDirect3DDevice9::GetMaterial +
+ + +

Assigns a set of lighting properties for this device.

+
+

Zero-based index of the set of lighting properties to set. If a set of lighting properties exists at this index, it is overwritten by the new properties specified in pLight.

+

Pointer to a structure, containing the lighting parameters to set.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

Set light properties by preparing a structure and then calling the method. The method accepts the index at which the device should place the set of light properties to its internal list of light properties, and the address of a prepared structure that defines those properties. You can call with new information as needed to update the light's illumination properties.

The system allocates memory to accommodate a set of lighting properties each time you call the method with an index that has never been assigned properties. Applications can set a number of lights, with only a subset of the assigned lights enabled at a time. Check the MaxActiveLights member of the structure when you retrieve device capabilities to determine the maximum number of active lights supported by that device. If you no longer need a light, you can disable it or overwrite it with a new set of light properties.

The following example prepares and sets properties for a white point-light whose emitted light will not attenuate over distance.

 // Assume d3dDevice is a valid reference to an  interface.	
+             d3dLight;	
+               hr; // Initialize the structure.	
+            ZeroMemory(&d3dLight, sizeof(d3dLight)); // Set up a white point light.	
+            d3dLight.Type = ;	
+            d3dLight.Diffuse.r  = 1.0f;	
+            d3dLight.Diffuse.g  = 1.0f;	
+            d3dLight.Diffuse.b  = 1.0f;	
+            d3dLight.Ambient.r  = 1.0f;	
+            d3dLight.Ambient.g  = 1.0f;	
+            d3dLight.Ambient.b  = 1.0f;	
+            d3dLight.Specular.r = 1.0f;	
+            d3dLight.Specular.g = 1.0f;	
+            d3dLight.Specular.b = 1.0f; // Position it high in the scene and behind the user.	
+            // Remember, these coordinates are in world space, so	
+            // the user could be anywhere in world space, too. 	
+            // For the purposes of this example, assume the user	
+            // is at the origin of world space.	
+            d3dLight.Position.x = 0.0f;	
+            d3dLight.Position.y = 1000.0f;	
+            d3dLight.Position.z = -100.0f; // Don't attenuate.	
+            d3dLight.Attenuation0 = 1.0f; 	
+            d3dLight.Range        = 1000.0f; // Set the property information for the first light.	
+            hr = d3dDevice->SetLight(0, &d3dLight);	
+            if (SUCCEEDED(hr)) // Handle Success	
+            else // Handle failure	
+            

Enable a light source by calling the method for the device.

+
+ + bb174436 + HRESULT IDirect3DDevice9::SetLight([In] unsigned int Index,[In] const D3DLIGHT9* arg1) + IDirect3DDevice9::SetLight +
+ + +

Retrieves a set of lighting properties that this device uses.

+
+

Zero-based index of the lighting property set to retrieve. This method will fail if a lighting property has not been set for this index by calling the method.

+

Pointer to a structure that is filled with the retrieved lighting-parameter set.

+ +

This method will not return device state for a device that is created using . If you want to use this method, you must create your device with any of the other values in .

Retrieve all the properties for an existing light source by calling the method for the device. When calling the method, pass the zero-based index of the light source for which the properties will be retrieved as the first parameter, and supply the address of a structure as the second parameter. The device fills the structure to describe the lighting properties it uses for the light source at that index.

 // Assume d3dDevice is a valid reference to an  interface.	
+             hr;	
+            D3DLight9 light; // Get the property information for the first light.	
+            hr = pd3dDevice->GetLight(0, &light);	
+            if (SUCCEEDED(hr)) // Handle Success	
+            else // Handle failure	
+            

If you supply an index outside the range of the light sources assigned in the device, the method fails, returning .

When you assign a set of light properties for a light source in a scene, the light source can be activated by calling the method for the device. New light sources are disabled by default. The method accepts two parameters. Set the first parameter to the zero-based index of the light source to be affected by the method, and set the second parameter to TRUE to enable the light or to disable it. The following code example illustrates the use of this method by enabling the first light source in the device's list of light source properties.

 // Assume d3dDevice is a valid reference to an  interface.	
+             hr; hr = pd3dDevice->LightEnable(0, TRUE);	
+            if (SUCCEEDED(hr)) // Handle Success	
+            else // Handle failure	
+            

Check the MaxActiveLights member of the structure when you retrieve device capabilities to determine the maximum number of active lights supported by that device.

If you enable or disable a light that has no properties that are set with , the method creates a light source with the properties listed in following table and enables or disables it.

+
+ + bb174392 + HRESULT IDirect3DDevice9::GetLight([In] unsigned int Index,[Out] D3DLIGHT9* arg1) + IDirect3DDevice9::GetLight +
+ + +

Enables or disables a set of lighting parameters within a device.

+
+

Zero-based index of the set of lighting parameters that are the target of this method.

+

Value that indicates if the set of lighting parameters are being enabled or disabled. Set this parameter to TRUE to enable lighting with the parameters at the specified index, or to disable it.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

If a value for LightIndex is outside the range of the light property sets assigned within the device, the method creates a light source represented by a structure with the following properties and sets its enabled state to the value specified in bEnable.

MemberDefault
Type
Diffuse (R:1, G:1, B:1, A:0)
Specular (R:0, G:0, B:0, A:0)
Ambient (R:0, G:0, B:0, A:0)
Position (0, 0, 0)
Direction (0, 0, 1)
Range 0
Falloff 0
Attenuation0 0
Attenuation1 0
Attenuation2 0
Theta 0
Phi 0

?

+
+ + bb174421 + HRESULT IDirect3DDevice9::LightEnable([In] unsigned int Index,[In] BOOL Enable) + IDirect3DDevice9::LightEnable +
+ + +

Retrieves the activity status - enabled or disabled - for a set of lighting parameters within a device.

+
+

Zero-based index of the set of lighting parameters that are the target of this method.

+

Pointer to a variable to fill with the status of the specified lighting parameters. After the call, a nonzero value at this address indicates that the specified lighting parameters are enabled; a value of 0 indicates that they are disabled.

+ +

This method will not return device state for a device that is created using . If you want to use this method, you must create your device with any of the other values in .

+
+ + bb174393 + HRESULT IDirect3DDevice9::GetLightEnable([In] unsigned int Index,[Out] BOOL* pEnable) + IDirect3DDevice9::GetLightEnable +
+ + +

Sets the coefficients of a user-defined clipping plane for the device.

+
+

Index of the clipping plane for which the plane equation coefficients are to be set.

+

Pointer to an address of a four-element array of values that represent the clipping plane coefficients to be set, in the form of the general plane equation. See Remarks.

+

If the method succeeds, the return value is . If the method fails, the return value is . This error indicates that the value in Index exceeds the maximum clipping plane index supported by the device or that the array at pPlane is not large enough to contain four floating-point values.

+ +

The coefficients that this method sets take the form of the general plane equation. If the values in the array at pPlane were labeled A, B, C, and D in the order that they appear in the array, they would fit into the general plane equation so that Ax + By + Cz + Dw = 0. A point with homogeneous coordinates (x, y, z, w) is visible in the half space of the plane if Ax + By + Cz + Dw >= 0. Points that exist behind the clipping plane are clipped from the scene.

When the fixed function pipeline is used the plane equations are assumed to be in world space. When the programmable pipeline is used the plane equations are assumed to be in the clipping space (the same space as output vertices).

This method does not enable the clipping plane equation being set. To enable a clipping plane, set the corresponding bit in the DWORD value applied to the render state.

+
+ + bb174426 + HRESULT IDirect3DDevice9::SetClipPlane([In] unsigned int Index,[In] const SHARPDX_VECTOR4* pPlane) + IDirect3DDevice9::SetClipPlane +
+ + +

Retrieves the coefficients of a user-defined clipping plane for the device.

+
+

Index of the clipping plane for which the plane equation coefficients are retrieved.

+

Pointer to a four-element array of values that represent the coefficients of the clipping plane in the form of the general plane equation. See Remarks.

+ +

This method will not return device state for a device that is created using . If you want to use this method, you must create your device with any of the other values in ."

The coefficients that this method reports take the form of the general plane equation. If the values in the array at pPlane were labeled A, B, C, and D in the order that they appear in the array, they would fit into the general plane equation so that Ax + By + Cz + Dw = 0. A point with homogeneous coordinates (x, y, z, w) is visible in the half space of the plane if Ax + By + Cz + Dw >= 0. Points that exist on or behind the clipping plane are clipped from the scene.

The plane equation used by this method exists in world space and is set by a previous call to the method.

+
+ + bb174380 + HRESULT IDirect3DDevice9::GetClipPlane([In] unsigned int Index,[Out] float* pPlane) + IDirect3DDevice9::GetClipPlane +
+ + +

Sets a single device render-state parameter.

+
+

Device state variable that is being modified. This parameter can be any member of the enumerated type.

+

New value for the device render state to be set. The meaning of this parameter is dependent on the value specified for State. For example, if State were , the second parameter would be one member of the enumerated type.

+

If the method succeeds, the return value is . is returned if one of the arguments is invalid.

+ + bb174454 + HRESULT IDirect3DDevice9::SetRenderState([In] D3DRENDERSTATETYPE State,[In] unsigned int Value) + IDirect3DDevice9::SetRenderState +
+ + +

Retrieves a render-state value for a device.

+
+

Device state variable that is being queried. This parameter can be any member of the enumerated type.

+

Pointer to a variable that receives the value of the queried render state variable when the method returns.

+

If the method succeeds, the return value is . if one of the arguments is invalid.

+ +

This method will not return device state for a device that is created using . If you want to use this method, you must create your device with any of the other values in ."

+
+ + bb174403 + HRESULT IDirect3DDevice9::GetRenderState([In] D3DRENDERSTATETYPE State,[In] void* pValue) + IDirect3DDevice9::GetRenderState +
+ + +

Creates a new state block that contains the values for all device states, vertex-related states, or pixel-related states.

+
+

Type of state data that the method should capture. This parameter can be set to a value defined in the enumerated type.

+

Pointer to a state block interface. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , E_OUTOFMEMORY.

+ +

Vertex-related device states typically refer to those states that affect how the system processes vertices. Pixel-related states generally refer to device states that affect how the system processes pixel or depth-buffer data during rasterization. Some states are contained in both groups.

Differences between Direct3D 9 and Direct3D 10:

In Direct3D 9, a state block contains state data, for the states it was requested to capture, when the object is created. To change the value of the state block, call or /. There is no state saved when a state block object is created in Direct3D 10.

?

+
+ + bb174362 + HRESULT IDirect3DDevice9::CreateStateBlock([In] D3DSTATEBLOCKTYPE Type,[Out, Fast] IDirect3DStateBlock9** ppSB) + IDirect3DDevice9::CreateStateBlock +
+ + +

Signals Direct3D to begin recording a device-state block.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

Applications can ensure that all recorded states are valid by calling the method prior to calling this method.

The following methods can be recorded in a state block, after calling and before .

The ordering of state changes in a state block is not guaranteed. If the same state is specified multiple times in a state block, only the last value is used.

+
+ + bb174351 + HRESULT IDirect3DDevice9::BeginStateBlock() + IDirect3DDevice9::BeginStateBlock +
+ + +

Signals Direct3D to stop recording a device-state block and retrieve a reference to the state block interface.

+
+

Pointer to a state block interface. See .

+ + bb174376 + HRESULT IDirect3DDevice9::EndStateBlock([In] IDirect3DStateBlock9** ppSB) + IDirect3DDevice9::EndStateBlock +
+ + +

Sets the clip status.

+
+

Pointer to a structure, describing the clip status settings to be set.

+

If the method succeeds, the return value is . If one of the arguments is invalid, the return value is .

+ +

Clip status is used during software vertex processing. Therefore, this method is not supported on pure or nonpure hardware processing devices. For more information about pure devices, see .

When clipping is enabled during vertex processing (by , , or other drawing functions), Direct3D computes a clip code for every vertex. The clip code is a combination of D3DCS_* bits. When a vertex is outside a particular clipping plane, the corresponding bit is set in the clipping code. Direct3D maintains the clip status using , which has ClipUnion and ClipIntersection members. ClipUnion is a bitwise "OR" of all vertex clip codes and ClipIntersection is a bitwise "AND" of all vertex clip codes. Initial values are zero for ClipUnion and 0xFFFFFFFF for ClipIntersection. When is set to , ClipUnion and ClipIntersection are set to zero. Direct3D updates the clip status during drawing calls. To compute clip status for a particular object, set ClipUnion and ClipIntersection to their initial value and continue drawing.

Clip status is not updated by and because there is no software emulation for them.

+
+ + bb174427 + HRESULT IDirect3DDevice9::SetClipStatus([In] const D3DCLIPSTATUS9* pClipStatus) + IDirect3DDevice9::SetClipStatus +
+ + +

Retrieves the clip status.

+
+

Pointer to a structure that describes the clip status.

+

If the method succeeds, the return value is .

is returned if the argument is invalid.

+ +

When clipping is enabled during vertex processing (by , , or other drawing functions), Direct3D computes a clip code for every vertex. The clip code is a combination of D3DCS_* bits. When a vertex is outside a particular clipping plane, the corresponding bit is set in the clipping code. Direct3D maintains the clip status using , which has ClipUnion and ClipIntersection members. ClipUnion is a bitwise "OR" of all vertex clip codes and ClipIntersection is a bitwise "AND" of all vertex clip codes. Initial values are zero for ClipUnion and 0xFFFFFFFF for ClipIntersection. When is set to , ClipUnion and ClipIntersection are set to zero. Direct3D updates the clip status during drawing calls. To compute clip status for a particular object, set ClipUnion and ClipIntersection to their initial value and continue drawing.

Clip status is not updated by and because there is no software emulation for them.

Clip status is used during software vertex processing. Therefore, this method is not supported on pure or nonpure hardware processing devices. For more information about pure devices, see .

+
+ + bb174381 + HRESULT IDirect3DDevice9::GetClipStatus([Out] D3DCLIPSTATUS9* pClipStatus) + IDirect3DDevice9::GetClipStatus +
+ + +

Retrieves a texture assigned to a stage for a device.

+
+

Stage identifier of the texture to retrieve. Stage identifiers are zero-based.

+

Address of a reference to an interface, representing the returned texture.

+ +

Typically, methods that return state will not work on a device that is created using . This method however, will work even on a pure device because it returns an interface.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

+
+ + bb174412 + HRESULT IDirect3DDevice9::GetTexture([In] unsigned int Stage,[Out] IDirect3DBaseTexture9** ppTexture) + IDirect3DDevice9::GetTexture +
+ + +

Assigns a texture to a stage for a device.

+
+

Zero based sampler number. Textures are bound to samplers; samplers define sampling state such as the filtering mode and the address wrapping mode. Textures are referenced differently by the programmable and the fixed function pipeline:

  • Programmable shaders reference textures using the sampler number. The number of samplers available to a programmable shader is dependent on the shader version. For vertex shaders, see Sampler (Direct3D 9 asm-vs). For pixel shaders see Sampler (Direct3D 9 asm-ps).
  • The fixed function pipeline on the other hand, references textures by texture stage number. The maximum number of samplers is determined from two caps: MaxSimultaneousTextures and MaxTextureBlendStages of the structure.

There are two other special cases for stage/sampler numbers.

  • A special number called D3DDMAPSAMPLER is used for Displacement Mapping (Direct3D 9).
  • A programmable vertex shader uses a special number defined by a when accessing Vertex Textures in vs_3_0 (DirectX HLSL).
+

Pointer to an interface, representing the texture being set.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

SetTexture is not allowed if the texture is created with a pool type of . SetTexture is not allowed with a pool type of texture unless DevCaps is set with .

+
+ + bb174461 + HRESULT IDirect3DDevice9::SetTexture([In] unsigned int Stage,[In] IDirect3DBaseTexture9* pTexture) + IDirect3DDevice9::SetTexture +
+ + +

Retrieves a state value for an assigned texture.

+
+

Stage identifier of the texture for which the state is retrieved. Stage identifiers are zero-based. Devices can have up to eight set textures, so the maximum value allowed for Stage is 7.

+

Texture state to retrieve. This parameter can be any member of the enumerated type.

+

Pointer a variable to fill with the retrieved state value. The meaning of the retrieved value is determined by the Type parameter.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

This method will not return device state for a device that is created using . If you want to use this method, you must create your device with any of the other flag values in ."

+
+ + bb174413 + HRESULT IDirect3DDevice9::GetTextureStageState([In] unsigned int Stage,[In] D3DTEXTURESTAGESTATETYPE Type,[In] void* pValue) + IDirect3DDevice9::GetTextureStageState +
+ + +

Sets the state value for the currently assigned texture.

+
+

Stage identifier of the texture for which the state value is set. Stage identifiers are zero-based. Devices can have up to eight set textures, so the maximum value allowed for Stage is 7.

+

Texture state to set. This parameter can be any member of the enumerated type.

+

State value to set. The meaning of this value is determined by the Type parameter.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174462 + HRESULT IDirect3DDevice9::SetTextureStageState([In] unsigned int Stage,[In] D3DTEXTURESTAGESTATETYPE Type,[In] unsigned int Value) + IDirect3DDevice9::SetTextureStageState +
+ + +

Gets the sampler state value.

+
+

The sampler stage index.

+

This parameter can be any member of the enumerated type.

+

State value to get. The meaning of this value is determined by the Type parameter.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

This method will not return device state for a device that is created using . If you want to use this method, you must create your device with any of the other values in ."

+
+ + bb174406 + HRESULT IDirect3DDevice9::GetSamplerState([In] unsigned int Sampler,[In] D3DSAMPLERSTATETYPE Type,[In] void* pValue) + IDirect3DDevice9::GetSamplerState +
+ + +

Sets the sampler state value.

+
+

The sampler stage index. For more info about sampler stage, see Sampling Stage Registers in vs_3_0 (DirectX HLSL).

+

This parameter can be any member of the enumerated type.

+

State value to set. The meaning of this value is determined by the Type parameter.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174456 + HRESULT IDirect3DDevice9::SetSamplerState([In] unsigned int Sampler,[In] D3DSAMPLERSTATETYPE Type,[In] unsigned int Value) + IDirect3DDevice9::SetSamplerState +
+ + +

Reports the device's ability to render the current texture-blending operations and arguments in a single pass.

+
+

Pointer to a DWORD value to fill with the number of rendering passes needed to complete the desired effect through multipass rendering.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , , , , , , , , , , ,.

+ +

The method should be used to validate scenarios only when other capabilities are deficient. For example, in a multistage texturing scenario, you could query the MaxTextureBlendStages and MaxSimultaneousTextures members of a structure to determine if multistage texturing is possible on the device.

Current hardware does not necessarily implement all possible combinations of operations and arguments. You can determine whether a particular blending operation can be performed with given arguments by setting the desired blending operation, and then calling the method.

The method uses the current render states, textures, and texture-stage states to perform validation at the time of the call. Changes to these factors after the call invalidate the previous result, and the method must be called again before rendering a scene.

For best performance, call at initialization time; do not use it within a render loop.

Using diffuse iterated values, either as an argument or as an operation (D3DTA_DIFFUSED3DTOP_BLENDDIFFUSEALPHA) is rarely supported on current hardware. Most hardware can introduce iterated color data only at the last texture operation stage.

Try to specify the texture () for each stage as the first argument, rather than the second argument.

Many cards do not support use of diffuse or scalar values at arbitrary texture stages. Often, these are available only at the first or last texture-blending stage.

Many cards do not have a blending unit associated with the first texture that is capable of more than replicating alpha to color channels or inverting the input. Therefore, your application might need to use only the second texture stage, if possible. On such hardware, the first unit is presumed to be in its default state, which has the first color argument set to with the operation.

Operations on the output alpha that are more intricate than or substantially different from the color operations are less likely to be supported.

Some hardware does not support simultaneous use of and .

Many cards do not support simultaneous use of multiple textures and mipmapped trilinear filtering. If trilinear filtering has been requested for a texture involved in multitexture blending operations and validation fails, turn off trilinear filtering and revalidate. In this case, you might want to perform multipass rendering instead.

+
+ + bb205859 + HRESULT IDirect3DDevice9::ValidateDevice([In] unsigned int* pNumPasses) + IDirect3DDevice9::ValidateDevice +
+ + +

Sets palette entries.

+
+

An ordinal value identifying the particular palette upon which the operation is to be performed.

+

Pointer to a structure, representing the palette entries to set. The number of structures pointed to by pEntries is assumed to be 256. See Remarks.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

For Direct3D 9 applications, any palette sent to this method must conform to the capability bit of the structure. If is not set, every entry in the palette must have alpha set to 1.0 or this method will fail with . If is set, then any set of alpha values are allowed. Note that the debug runtime will print a warning message if all palette entries have alpha set to 0.

A single logical palette is associated with the device, and is shared by all texture stages.

+
+ + bb174439 + HRESULT IDirect3DDevice9::SetPaletteEntries([In] unsigned int PaletteNumber,[In, Buffer] const PALETTEENTRY* pEntries) + IDirect3DDevice9::SetPaletteEntries +
+ + +

Retrieves palette entries.

+
+

An ordinal value identifying the particular palette to retrieve.

+

Pointer to a structure, representing the returned palette entries.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

For more information about , see the Platform SDK.

Note??As of Direct3D 9, the peFlags member of the structure does not work the way it is documented in the Platform SDK. The peFlags member is now the alpha channel for 8-bit palettized formats.

+
+ + bb174397 + HRESULT IDirect3DDevice9::GetPaletteEntries([In] unsigned int PaletteNumber,[In, Buffer] PALETTEENTRY* pEntries) + IDirect3DDevice9::GetPaletteEntries +
+ + +

Sets the current texture palette.

+
+

Value that specifies the texture palette to set as the current texture palette.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A single logical palette is associated with the device, and is shared by all texture stages.

+
+ + bb174428 + HRESULT IDirect3DDevice9::SetCurrentTexturePalette([In] unsigned int PaletteNumber) + IDirect3DDevice9::SetCurrentTexturePalette +
+ + +

Retrieves the current texture palette.

+
+

Pointer to a returned value that identifies the current texture palette.

+

If the method succeeds, the return value is . If the method fails, the return value can be: .

+ + bb174383 + HRESULT IDirect3DDevice9::GetCurrentTexturePalette([Out] unsigned int* PaletteNumber) + IDirect3DDevice9::GetCurrentTexturePalette +
+ + +

Sets the scissor rectangle.

+
+

Pointer to a structure that defines the rendering area within the render target if scissor test is enabled. This parameter may not be null.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

The scissor rectangle is used as a rectangular clipping region.

See Rectangles (Direct3D 9) for further information on the use of rectangles in DirectX.

+
+ + bb174457 + HRESULT IDirect3DDevice9::SetScissorRect([In] const RECT* pRect) + IDirect3DDevice9::SetScissorRect +
+ + +

Gets the scissor rectangle.

+
+

Returns a reference to a structure that defines the rendering area within the render target if scissor test is enabled.

+

If the method succeeds, the return value is . If the method fails, the return value can be the following: .

+ +

The scissor rectangle is used as a rectangular clipping region.

See Rectangles (Direct3D 9) for further information on the use of rectangles in DirectX.

+
+ + bb174407 + HRESULT IDirect3DDevice9::GetScissorRect([Out] RECT* pRect) + IDirect3DDevice9::GetScissorRect +
+ + +

Use this method to switch between software and hardware vertex processing.

+
+

TRUE to specify software vertex processing; to specify hardware vertex processing.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

The restrictions for changing modes are as follows:

  • If a device is created with , the vertex processing will be done in software and cannot be changed.
  • If a device is created with , the vertex processing will be done in hardware and cannot be changed.
  • If a device is created with , the vertex processing will be done in hardware by default. The processing can be switched to software (or back to hardware) using .

An application can create a mixed-mode device to use both the software vertex processing and the hardware vertex processing. To switch between the two vertex processing modes in DirectX 8.x, use IDirect3DDevice8::SetRenderState with the render state D3DRS_SOFTWAREVERTEXPROCESSING and the appropriate DWORD argument. The drawback of the render state approach was the difficulty in defining the semantics for state blocks. Applications and the runtime had to do extra work and be careful while recording and playing back state blocks.

In Direct3D 9, use SetSoftwareVertexProcessing instead. This new API is not recorded by StateBlocks.

+
+ + bb174458 + HRESULT IDirect3DDevice9::SetSoftwareVertexProcessing([In] BOOL bSoftware) + IDirect3DDevice9::SetSoftwareVertexProcessing +
+ + +

Gets the vertex processing (hardware or software) mode.

+
+

Returns TRUE if software vertex processing is set. Otherwise, it returns .

+ +

An application can create a mixed-mode device to use both the software vertex processing and the hardware vertex processing. To switch between the two vertex processing modes in DirectX 8.x, use with the render state D3DRS_SOFTWAREVERTEXPROCESSING and the appropriate argument. The drawback of the render state approach was the difficulty in defining the semantics for state blocks. Applications and the runtime had to do extra work and be careful while recording and playing back state blocks.

In Direct3D 9, use instead. This new API is not recorded by StateBlocks.

+
+ + bb174408 + BOOL IDirect3DDevice9::GetSoftwareVertexProcessing() + IDirect3DDevice9::GetSoftwareVertexProcessing +
+ + +

Enable or disable N-patches.

+
+

Specifies the number of subdivision segments. If the number of segments is less than 1.0, N-patches are disabled. The default value is 0.0.

+

If the method succeeds, the return value is .

+ + bb174438 + HRESULT IDirect3DDevice9::SetNPatchMode([In] float nSegments) + IDirect3DDevice9::SetNPatchMode +
+ + +

Gets the N-patch mode segments.

+
+

Specifies the number of subdivision segments. If the number of segments is less than 1.0, N-patches are disabled. The default value is 0.0.

+ + bb174395 + float IDirect3DDevice9::GetNPatchMode() + IDirect3DDevice9::GetNPatchMode +
+ + +

Renders a sequence of nonindexed, geometric primitives of the specified type from the current set of data input streams.

+
+

Member of the enumerated type, describing the type of primitive to render.

+

Index of the first vertex to load. Beginning at StartVertex the correct number of vertices will be read out of the vertex buffer.

+

Number of primitives to render. The maximum number of primitives allowed is determined by checking the MaxPrimitiveCount member of the structure. PrimitiveCount is the number of primitives as determined by the primitive type. If it is a line list, each primitive has two vertices. If it is a triangle list, each primitive has three vertices.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

When converting a legacy application to Direct3D 9, you must add a call to either to use the fixed function pipeline, or to use a vertex shader before you make any Draw calls.

+
+ + bb174371 + HRESULT IDirect3DDevice9::DrawPrimitive([In] D3DPRIMITIVETYPE PrimitiveType,[In] unsigned int StartVertex,[In] unsigned int PrimitiveCount) + IDirect3DDevice9::DrawPrimitive +
+ + +

Based on indexing, renders the specified geometric primitive into an array of vertices.

+
+

Member of the enumerated type, describing the type of primitive to render. is not supported with this method. See Remarks.

+

Offset from the start of the vertex buffer to the first vertex. See Scenario 4.

+

Minimum vertex index for vertices used during this call. This is a zero based index relative to BaseVertexIndex.

+

Number of vertices used during this call. The first vertex is located at index: BaseVertexIndex + MinIndex.

+

Index of the first index to use when accesssing the vertex buffer. Beginning at StartIndex to index vertices from the vertex buffer.

+

Number of primitives to render. The number of vertices used is a function of the primitive count and the primitive type. The maximum number of primitives allowed is determined by checking the MaxPrimitiveCount member of the structure.

+

If the method succeeds, the return value is . If the method fails, the return value can be the following: .

+ +

This method draws indexed primitives from the current set of data input streams. MinIndex and all the indices in the index stream are relative to the BaseVertexIndex.

The MinIndex and NumVertices parameters specify the range of vertex indices used for each call. These are used to optimize vertex processing of indexed primitives by processing a sequential range of vertices prior to indexing into these vertices. It is invalid for any indices used during this call to reference any vertices outside of this range.

fails if no index array is set.

The member of the enumerated type is not supported and is not a valid type for this method.

When converting a legacy application to Direct3D 9, you must add a call to either to use the fixed function pipeline, or to use a vertex shader before you make any Draw calls.

+
+ + bb174369 + HRESULT IDirect3DDevice9::DrawIndexedPrimitive([In] D3DPRIMITIVETYPE arg0,[In] int BaseVertexIndex,[In] unsigned int MinVertexIndex,[In] unsigned int NumVertices,[In] unsigned int startIndex,[In] unsigned int primCount) + IDirect3DDevice9::DrawIndexedPrimitive +
+ + +

Renders data specified by a user memory reference as a sequence of geometric primitives of the specified type.

+
+

Member of the enumerated type, describing the type of primitive to render.

+

Number of primitives to render. The maximum number of primitives allowed is determined by checking the MaxPrimitiveCount member of the structure.

+

User memory reference to the vertex data.

+

The number of bytes of data for each vertex. This value may not be 0.

+

If the method succeeds, the return value is . If the method fails, the return value can be: .

+ +

This method is intended for use in applications that are unable to store their vertex data in vertex buffers. This method supports only a single vertex stream. The effect of this call is to use the provided vertex data reference and stride for vertex stream 0. It is invalid to have the declaration of the current vertex shader refer to vertex streams other than stream 0.

Following any call, the stream 0 settings, referenced by , are set to null.

The vertex data passed to does not need to persist after the call. Direct3D completes its access to that data prior to returning from the call.

When converting a legacy application to Direct3D 9, you must add a call to either to use the fixed function pipeline, or to use a vertex shader before you make any Draw calls.

+
+ + bb174372 + HRESULT IDirect3DDevice9::DrawPrimitiveUP([In] D3DPRIMITIVETYPE PrimitiveType,[In] unsigned int PrimitiveCount,[In] const void* pVertexStreamZeroData,[In] unsigned int VertexStreamZeroStride) + IDirect3DDevice9::DrawPrimitiveUP +
+ + +

Renders the specified geometric primitive with data specified by a user memory reference.

+
+

Member of the enumerated type, describing the type of primitive to render.

+

Minimum vertex index. This is a zero-based index.

+

Number of vertices used during this call. The first vertex is located at index: MinVertexIndex.

+

Number of primitives to render. The maximum number of primitives allowed is determined by checking the MaxPrimitiveCount member of the structure (the number of indices is a function of the primitive count and the primitive type).

+

User memory reference to the index data.

+

Member of the enumerated type, describing the format of the index data. The valid settings are either:

+

User memory reference to the vertex data. The vertex data must be in stream 0.

+

The number of bytes of data for each vertex. This value may not be 0.

+

If the method succeeds, the return value is . If the method fails, the return value can be the following: .

+ +

This method is intended for use in applications that are unable to store their vertex data in vertex buffers. This method supports only a single vertex stream, which must be declared as stream 0.

Following any call, the stream 0 settings, referenced by , are set to null. Also, the index buffer setting for is set to null.

The vertex data passed to does not need to persist after the call. Direct3D completes its access to that data prior to returning from the call.

When converting a legacy application to Direct3D 9, you must add a call to either to use the fixed function pipeline, or to use a vertex shader before you make any Draw calls.

+
+ + bb174370 + HRESULT IDirect3DDevice9::DrawIndexedPrimitiveUP([In] D3DPRIMITIVETYPE PrimitiveType,[In] unsigned int MinVertexIndex,[In] unsigned int NumVertices,[In] unsigned int PrimitiveCount,[In] const void* pIndexData,[In] D3DFORMAT IndexDataFormat,[In] const void* pVertexStreamZeroData,[In] unsigned int VertexStreamZeroStride) + IDirect3DDevice9::DrawIndexedPrimitiveUP +
+ + +

Applies the vertex processing defined by the vertex shader to the set of input data streams, generating a single stream of interleaved vertex data to the destination vertex buffer.

+
+

Index of first vertex to load.

+

Index of first vertex in the destination vertex buffer into which the results are placed.

+

Number of vertices to process.

+

Pointer to an interface, the destination vertex buffer representing the stream of interleaved vertex data.

+

Pointer to an interface that represents the output vertex data declaration. When vertex shader 3.0 or above is set as the current vertex shader, the output vertex declaration must be present.

+

Processing options. Set this parameter to 0 for default processing. Set to D3DPV_DONOTCOPYDATA to prevent the system from copying vertex data not affected by the vertex operation into the destination buffer. The D3DPV_DONOTCOPYDATA value may be combined with one or more values appropriate for the destination buffer.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

The order of operations for this method is as follows:

  • Transform vertices to projection space using the world + view + projection matrix.
  • Compute screen coordinates using viewport settings.
  • If clipping is enabled, compute clipping codes and store them in an internal buffer, associated with the destination vertex buffer. If a vertex is inside the viewing frustum, its screen coordinates are computed. If the vertex is outside the viewing frustum, the vertex is stored in the destination vertex buffer in projection space coordinates.
  • Other notes: The user does not have access to the internal clip code buffer. No clipping is done on triangles or any other primitives.

The destination vertex buffer, pDestBuffer, must be created with a nonzero FVF parameter in . The FVF code specified during the call to the method specifies the vertex elements present in the destination vertex buffer.

When Direct3D generates texture coordinates, or copies or transforms input texture coordinates, and the output texture coordinate format defines more texture coordinate components than Direct3D generates, Direct3D does not change these extra components.

+
+ + bb174424 + HRESULT IDirect3DDevice9::ProcessVertices([In] unsigned int SrcStartIndex,[In] unsigned int DestIndex,[In] unsigned int VertexCount,[In] IDirect3DVertexBuffer9* pDestBuffer,[In] IDirect3DVertexDeclaration9* pVertexDecl,[In] D3DLOCK Flags) + IDirect3DDevice9::ProcessVertices +
+ + +

Create a vertex shader declaration from the device and the vertex elements.

+
+

An array of vertex elements.

+

Pointer to an reference that returns the created vertex shader declaration.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

See the Vertex Declaration (Direct3D 9) page for a detailed description of how to map vertex declarations between different versions of DirectX.

+
+ + bb174365 + HRESULT IDirect3DDevice9::CreateVertexDeclaration([In, Buffer] const D3DVERTEXELEMENT9* pVertexElements,[Out, Fast] IDirect3DVertexDeclaration9** ppDecl) + IDirect3DDevice9::CreateVertexDeclaration +
+ + +

Sets a Vertex Declaration (Direct3D 9).

+
+ No documentation. +

If the method succeeds, the return value is . The return value can be .

+ +

A vertex declaration is an object that defines the data members of a vertex (i.e. texture coordinates, colors, normals, etc.). This data can be useful for implementing vertex shaders and pixel shaders.

+
+ + bb174464 + HRESULT IDirect3DDevice9::SetVertexDeclaration([In] IDirect3DVertexDeclaration9* pDecl) + IDirect3DDevice9::SetVertexDeclaration +
+ + +

Gets a vertex shader declaration.

+
+

Pointer to an object that is returned.

+

If the method succeeds, the return value is . The return value can be .

+ + bb174415 + HRESULT IDirect3DDevice9::GetVertexDeclaration([Out] IDirect3DVertexDeclaration9** ppDecl) + IDirect3DDevice9::GetVertexDeclaration +
+ + +

Sets the current vertex stream declaration.

+
+

DWORD containing the fixed function vertex type. For more information, see .

+

If the method succeeds, the return value is . If the method fails, the return value can be: .

+ +

Here are the steps necessary to initialize and use vertices that have a position, diffuse and specular color, and texture coordinates:

  1. Define the custom vertex type and FVF code.
     struct LVertex	
    +            { FLOAT    x, y, z;  specular, diffuse; FLOAT    tu, tv;	
    +            }; const DWORD VertexFVF = ( |  |  |  );	
    +            
  2. Create a vertex buffer with enough room for four vertices using .
     g_d3dDevice->CreateVertexBuffer( 4*sizeof(LVertex),   , VertexFVF, , &pBigSquareVB, null );	
    +            
  3. Set the values for each vertex.
     LVertex * v;	
    +            pBigSquareVB->Lock( 0, 0, (BYTE**)&v, 0 ); v[0].x  = 0.0f;  v[0].y  = 10.0;  v[0].z  = 10.0f;	
    +            v[0].diffuse  = 0xffff0000;	
    +            v[0].specular = 0xff00ff00;	
    +            v[0].tu = 0.0f;  v[0].tv = 0.0f; v[1].x  = 0.0f;  v[1].y  = 0.0f;  v[1].z  = 10.0f;	
    +            v[1].diffuse  = 0xff00ff00;	
    +            v[1].specular = 0xff00ffff;	
    +            v[1].tu = 0.0f;  v[1].tv = 0.0f; v[2].x  = 10.0f; v[2].y  = 10.0f; v[2].z  = 10.0f;	
    +            v[2].diffuse  = 0xffff00ff;	
    +            v[2].specular = 0xff000000;	
    +            v[2].tu = 0.0f;  v[2].tv = 0.0f; v[3].x  = 0.0f; v[3].y  = 10.0f;  v[3].z = 10.0f;	
    +            v[3].diffuse  = 0xffffff00;	
    +            v[3].specular = 0xffff0000;	
    +            v[3].tu = 0.0f; v[3].tv = 0.0f; pBigSquareVB->Unlock();	
    +            
  4. The vertex buffer has been initialized and is ready to render. The following code example shows how to use the legacy FVF to draw a square.
     g_d3dDevice->SetFVF(VertexFVF);	
    +            g_d3dDevice->SetStreamSource(0, pBigSquareVB, 0, sizeof(LVertex));	
    +            g_d3dDevice->DrawPrimitive(, 0 ,2);	
    +            

Here are the steps necessary to initialize and use vertices that have a position, a normal, and texture coordinates:

  1. Define the custom vertex type and FVF code.
     struct Vertex	
    +            { FLOAT x, y, z; FLOAT nx, ny, nz; FLOAT tu, tv;	
    +            }; const DWORD VertexFVF = (  |  |  );	
    +            
  2. Create a vertex buffer with enough room for four vertices using (similar to the example above).
  3. Set the values for each vertex.
     Vertex * v;	
    +            pBigSquareVB->Lock(0, 0, (BYTE**)&v, 0); v[0].x  = 0.0f;  v[0].y  = 10.0;  v[0].z  = 10.0f;	
    +            v[0].nx = 0.0f;  v[0].ny = 1.0f;  v[0].nz = 0.0f;	
    +            v[0].tu = 0.0f;  v[0].tv = 0.0f; v[1].x  = 0.0f;  v[1].y  = 0.0f;  v[1].z  = 10.0f;	
    +            v[1].nx = 0.0f;  v[1].ny = 1.0f;  v[1].nz = 0.0f;	
    +            v[1].tu = 0.0f;  v[1].tv = 0.0f; v[2].x  = 10.0f; v[2].y  = 10.0f; v[2].z  = 10.0f;	
    +            v[2].nx = 0.0f;  v[2].ny = 1.0f;  v[2].nz = 0.0f;	
    +            v[2].tu = 0.0f;  v[2].tv = 0.0f; v[3].x  = 0.0f; v[3].y  = 10.0f;  v[3].z = 10.0f;	
    +            v[3].nx = 0.0f; v[3].ny = 1.0f;   v[3].nz = 0.0f;	
    +            v[3].tu = 0.0f; v[3].tv = 0.0f; pBigSquareVB->Unlock();	
    +            
  4. Draw the object (similar to the example above).
+
+ + bb174433 + HRESULT IDirect3DDevice9::SetFVF([In] D3DFVF FVF) + IDirect3DDevice9::SetFVF +
+ + +

Gets the fixed vertex function declaration.

+
+

A DWORD reference to the fixed function vertex type. For more information, see .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

The fixed vertex function declaration is a set of FVF flags that determine how vertices processed by the fixed function pipeline will be used.

+
+ + bb174389 + HRESULT IDirect3DDevice9::GetFVF([Out] D3DFVF* pFVF) + IDirect3DDevice9::GetFVF +
+ + +

Creates a vertex shader.

+
+

Pointer to an array of tokens that represents the vertex shader, including any embedded debug and symbol table information.

  • Use a function such as to create the array from a HLSL shader.
  • Use a function like to create the token array from an assembly language shader.
  • Use a function like to create the array from an effect.
+

Pointer to the returned vertex shader interface (see ).

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , E_OUTOFMEMORY.

+ +

When a device is created, uses the behavior flag to determine whether to process vertices in hardware or software. There are three possibilities:

  • Process vertices in hardware by setting .
  • Process vertices in software by setting .
  • Process vertices in either hardware or software by setting . To switch a mixed-mode device between software and hardware processing, use .

For an example using , see HLSLwithoutEffects Sample.

+
+ + bb174366 + HRESULT IDirect3DDevice9::CreateVertexShader([In] const void* pFunction,[Out, Fast] IDirect3DVertexShader9** ppShader) + IDirect3DDevice9::CreateVertexShader +
+ + +

Sets the vertex shader.

+
+

Vertex shader interface. For more information, see .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

To set a fixed-function vertex shader (after having set a programmable vertex shader), call (null) to release the programmable shader, and then call with the fixed-function vertex format.

+
+ + bb174465 + HRESULT IDirect3DDevice9::SetVertexShader([In] IDirect3DVertexShader9* pShader) + IDirect3DDevice9::SetVertexShader +
+ + +

Retrieves the currently set vertex shader.

+
+

Pointer to a vertex shader interface.

+

If the method succeeds, the return value is . If ppShader is invalid, is returned.

+ +

Typically, methods that return state will not work on a device that is created using . This method however, will work even on a pure device because it returns an interface.

+
+ + bb174416 + HRESULT IDirect3DDevice9::GetVertexShader([Out] IDirect3DVertexShader9** ppShader) + IDirect3DDevice9::GetVertexShader +
+ + +

Sets a floating-point vertex shader constant.

+
+

Register number that will contain the first constant value.

+

Pointer to an array of constants.

+

Number of four float vectors in the array of constants.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174467 + HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + IDirect3DDevice9::SetVertexShaderConstantF +
+ + +

Gets a floating-point vertex shader constant.

+
+

Register number that will contain the first constant value.

+

Pointer to an array of constants.

+

Number of four float vectors in the array of constants.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174418 + HRESULT IDirect3DDevice9::GetVertexShaderConstantF([In] unsigned int StartRegister,[In, Buffer] float* pConstantData,[In] unsigned int Vector4fCount) + IDirect3DDevice9::GetVertexShaderConstantF +
+ + +

Sets an integer vertex shader constant.

+
+

Register number that will contain the first constant value.

+

Pointer to an array of constants.

+

Number of four integer vectors in the array of constants.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174468 + HRESULT IDirect3DDevice9::SetVertexShaderConstantI([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4iCount) + IDirect3DDevice9::SetVertexShaderConstantI +
+ + +

Gets an integer vertex shader constant.

+
+

Register number that will contain the first constant value.

+

Pointer to an array of constants.

+

Number of four integer vectors in the array of constants.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174419 + HRESULT IDirect3DDevice9::GetVertexShaderConstantI([In] unsigned int StartRegister,[In, Buffer] int* pConstantData,[In] unsigned int Vector4iCount) + IDirect3DDevice9::GetVertexShaderConstantI +
+ + +

Sets a Boolean vertex shader constant.

+
+

Register number that will contain the first constant value.

+

Pointer to an array of constants.

+

Number of boolean values in the array of constants.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174466 + HRESULT IDirect3DDevice9::SetVertexShaderConstantB([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int BoolCount) + IDirect3DDevice9::SetVertexShaderConstantB +
+ + +

Gets a Boolean vertex shader constant.

+
+

Register number that will contain the first constant value.

+

Pointer to an array of constants.

+

Number of Boolean values in the array of constants.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174417 + HRESULT IDirect3DDevice9::GetVertexShaderConstantB([In] unsigned int StartRegister,[In] void* pConstantData,[In] unsigned int BoolCount) + IDirect3DDevice9::GetVertexShaderConstantB +
+ + +

Binds a vertex buffer to a device data stream. For more information, see Setting the Stream Source (Direct3D 9).

+
+ No documentation. + No documentation. + No documentation. + No documentation. +

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

When a FVF vertex shader is used, the stride of the vertex stream must match the vertex size, computed from the FVF. When a declaration is used, the stride should be greater than or equal to the stream size computed from the declaration.

When calling SetStreamSource, the stride is normally required to be equal to the vertex size. However, there are times when you may want to draw multiple instances of the same or similar geometry (such as when using instancing to draw). For this case, use a zero stride to tell the runtime not to increment the vertex buffer offset (ie: use the same vertex data for all instances). For more information about instancing, see Efficiently Drawing Multiple Instances of Geometry (Direct3D 9).

+
+ + bb174459 + HRESULT IDirect3DDevice9::SetStreamSource([In] unsigned int StreamNumber,[In] IDirect3DVertexBuffer9* pStreamData,[In] unsigned int OffsetInBytes,[In] unsigned int Stride) + IDirect3DDevice9::SetStreamSource +
+ + +

Retrieves a vertex buffer bound to the specified data stream.

+
+

Specifies the data stream, in the range from 0 to the maximum number of streams minus one.

+

Address of a reference to an interface, representing the returned vertex buffer bound to the specified data stream.

+

Pointer containing the offset from the beginning of the stream to the beginning of the vertex data. The offset is measured in bytes. See Remarks.

+

Pointer to a returned stride of the component, in bytes. See Remarks.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A stream is defined as a uniform array of component data, where each component consists of one or more elements representing a single entity such as position, normal, color, and so on.

When a FVF vertex shader is used, the stride of the vertex stream must match the vertex size, computed from the FVF. When a declaration is used, the stride should be greater than or equal to the stream size computed from the declaration.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

+
+ + bb174409 + HRESULT IDirect3DDevice9::GetStreamSource([In] unsigned int StreamNumber,[Out] IDirect3DVertexBuffer9** ppStreamData,[Out] unsigned int* pOffsetInBytes,[Out] unsigned int* pStride) + IDirect3DDevice9::GetStreamSource +
+ + +

Sets the stream source frequency divider value. This may be used to draw several instances of geometry.

+
+

Stream source number.

+

This parameter may have two different values. See remarks.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

There are two constants defined in d3d9types.h that are designed to use with SetStreamSourceFreq: and . To see how to use the constants, see Efficiently Drawing Multiple Instances of Geometry (Direct3D 9).

+
+ + bb174460 + HRESULT IDirect3DDevice9::SetStreamSourceFreq([In] unsigned int StreamNumber,[In] unsigned int Setting) + IDirect3DDevice9::SetStreamSourceFreq +
+ + +

Gets the stream source frequency divider value.

+
+

Stream source number.

+

Returns the frequency divider value.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

Vertex shaders can now be invoked more than once per vertex. See Drawing Non-Indexed Geometry.

+
+ + bb174410 + HRESULT IDirect3DDevice9::GetStreamSourceFreq([In] unsigned int StreamNumber,[Out] unsigned int* pSetting) + IDirect3DDevice9::GetStreamSourceFreq +
+ + +

Sets index data.

+
+

Pointer to an interface, representing the index data to be set.

+

If the method succeeds, the return value is . If the method fails, the return value can be: .

+ +

When an application no longer holds a references to this interface, the interface will automatically be freed.

The method sets the current index array to an index buffer. The single set of indices is used to index all streams.

+
+ + bb174435 + HRESULT IDirect3DDevice9::SetIndices([In] IDirect3DIndexBuffer9* pIndexData) + IDirect3DDevice9::SetIndices +
+ + +

Retrieves index data.

+
+

Address of a reference to an interface, representing the returned index data.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

+
+ + bb174391 + HRESULT IDirect3DDevice9::GetIndices([Out] IDirect3DIndexBuffer9** ppIndexData) + IDirect3DDevice9::GetIndices +
+ + +

Creates a pixel shader.

+
+

Pointer to the pixel shader function token array, specifying the blending operations. This value cannot be null.

+

Pointer to the returned pixel shader interface. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , E_OUTOFMEMORY.

+ + bb174359 + HRESULT IDirect3DDevice9::CreatePixelShader([In] const void* pFunction,[Out, Fast] IDirect3DPixelShader9** ppShader) + IDirect3DDevice9::CreatePixelShader +
+ + +

Sets the current pixel shader to a previously created pixel shader.

+
+

Pixel shader interface.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174450 + HRESULT IDirect3DDevice9::SetPixelShader([In] IDirect3DPixelShader9* pShader) + IDirect3DDevice9::SetPixelShader +
+ + +

Retrieves the currently set pixel shader.

+
+

Pointer to a pixel shader interface.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

This method will not work on a device that is created using .

+
+ + bb174398 + HRESULT IDirect3DDevice9::GetPixelShader([Out] IDirect3DPixelShader9** ppShader) + IDirect3DDevice9::GetPixelShader +
+ + +

Sets a floating-point shader constant.

+
+

Register number that will contain the first constant value.

+

Pointer to an array of constants.

+

Number of four float vectors in the array of constants.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174452 + HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) + IDirect3DDevice9::SetPixelShaderConstantF +
+ + +

Gets a floating-point shader constant.

+
+

Register number that will contain the first constant value.

+

Pointer to an array of constants.

+

Number of four float vectors in the array of constants.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174400 + HRESULT IDirect3DDevice9::GetPixelShaderConstantF([In] unsigned int StartRegister,[In, Buffer] float* pConstantData,[In] unsigned int Vector4fCount) + IDirect3DDevice9::GetPixelShaderConstantF +
+ + +

Sets an integer shader constant.

+
+

Register number that will contain the first constant value.

+

Pointer to an array of constants.

+

Number of four integer vectors in the array of constants.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174453 + HRESULT IDirect3DDevice9::SetPixelShaderConstantI([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4iCount) + IDirect3DDevice9::SetPixelShaderConstantI +
+ + +

Gets an integer shader constant.

+
+

Register number that will contain the first constant value.

+

Pointer to an array of constants.

+

Number of four integer vectors in the array of constants.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174401 + HRESULT IDirect3DDevice9::GetPixelShaderConstantI([In] unsigned int StartRegister,[In, Buffer] int* pConstantData,[In] unsigned int Vector4iCount) + IDirect3DDevice9::GetPixelShaderConstantI +
+ + +

Sets a Boolean shader constant.

+
+

Register number that will contain the first constant value.

+

Pointer to an array of constants.

+

Number of boolean values in the array of constants.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174451 + HRESULT IDirect3DDevice9::SetPixelShaderConstantB([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int BoolCount) + IDirect3DDevice9::SetPixelShaderConstantB +
+ + +

Gets a Boolean shader constant.

+
+

Register number that will contain the first constant value.

+

Pointer to an array of constants.

+

Number of Boolean values in the array of constants.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174399 + HRESULT IDirect3DDevice9::GetPixelShaderConstantB([In] unsigned int StartRegister,[In] void* pConstantData,[In] unsigned int BoolCount) + IDirect3DDevice9::GetPixelShaderConstantB +
+ + +

Draws a rectangular patch using the currently set streams.

+
+

Handle to the rectangular patch to draw.

+

Pointer to an array of four floating-point values that identify the number of segments each edge of the rectangle patch should be divided into when tessellated. See .

+

Pointer to a structure, describing the rectangular patch to draw.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

For static patches: Set the vertex shader, set the appropriate streams, supply patch information in the pRectPatchInfo parameter, and specify a handle so that Direct3D can capture and cache information. Call subsequently with pRectPatchInfo set to null to efficiently draw the patch. When drawing a cached patch, the currently set streams are ignored. Override the cached pNumSegs by specifying a new value for pNumSegs. When rendering a cached patch, you must set the same vertex shader that was set when it was captured.

Calling with a handle invalidates the same handle cached by a previous call.

For dynamic patches, the patch data changes for every rendering of the patch, so it is not efficient to cache information. The application can convey this to Direct3D by setting Handle to 0. In this case, Direct3D draws the patch using the currently set streams and the pNumSegs values, and does not cache any information. It is not valid to simultaneously set Handle to 0 and pRectPatchInfo to null.

+
+ + bb174373 + HRESULT IDirect3DDevice9::DrawRectPatch([In] unsigned int Handle,[In, Buffer] const float* pNumSegs,[In] const void* pRectPatchInfo) + IDirect3DDevice9::DrawRectPatch +
+ + +

Draws a triangular patch using the currently set streams.

+
+

Handle to the triangular patch to draw.

+

Pointer to an array of three floating-point values that identify the number of segments each edge of the triangle patch should be divided into when tessellated. See .

+

Pointer to a structure, describing the triangular high-order patch to draw.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

For static patches: Set the vertex shader, set the appropriate streams, supply patch information in the pTriPatchInfo parameter, and specify a handle so that Direct3D can capture and cache information. To efficiently draw the patch, call with pTriPatchInfo set to null. When drawing a cached patch, the currently set streams are ignored. Override the cached pNumSegs by specifying a new value for pNumSegs. When rendering a cached patch, you must set the same vertex shader that was set when it was captured.

Calling with a handle invalidates the same handle cached by a previous call.

For dynamic patches, the patch data changes for every rendering of the patch so it is not efficient to cache information. The application can convey this to Direct3D by setting Handle to 0. In this case, Direct3D draws the patch using the currently set streams and the pNumSegs values, and does not cache any information. It is not valid to simultaneously set Handle to 0 and pTriPatchInfo to null.

+
+ + bb174374 + HRESULT IDirect3DDevice9::DrawTriPatch([In] unsigned int Handle,[In, Buffer] const float* pNumSegs,[In] const void* pTriPatchInfo) + IDirect3DDevice9::DrawTriPatch +
+ + +

Frees a cached high-order patch.

+
+

Handle of the cached high-order patch to delete.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174368 + HRESULT IDirect3DDevice9::DeletePatch([In] unsigned int Handle) + IDirect3DDevice9::DeletePatch +
+ + +

Creates a status query.

+
+

Identifies the query type. For more information, see .

+

Returns a reference to the query interface that manages the query object. See .

This parameter can be set to null to see if a query is supported. If the query is not supported, the method returns .

+

If the method succeeds, the return value is . If the method fails, the return value can be or E_OUTOFMEMORY.

+ +

This method is provided for both synchronous and asynchronous queries. It takes the place of GetInfo, which is no longer supported in Direct3D 9.

Synchronous and asynchronous queries are created with with . When a query has been created and the API calls have been made that are being queried, use to issue a query and to get the results of the query.

+
+ + bb174360 + HRESULT IDirect3DDevice9::CreateQuery([In] D3DQUERYTYPE Type,[Out, Fast] IDirect3DQuery9** ppQuery) + IDirect3DDevice9::CreateQuery +
+ + +

Applications use the methods of the interface to render primitives, create resources, work with system-level variables, adjust gamma ramp levels, work with palettes, and create shaders. The interface derives from the interface.

+
+ +

The interface is obtained by calling .

The LPDIRECT3DDEVICE9EX and PDIRECT3DDEVICE9EX types are defined as references to the interface:

 typedef struct  *LPDIRECT3DDEVICE9EX, *PDIRECT3DDEVICE9EX;	
+            
+
+ + bb174337 + IDirect3DDevice9Ex + IDirect3DDevice9Ex +
+ + + Creates a device to represent the display adapter. + + an instance of + Ordinal number that denotes the display adapter. {{D3DADAPTER_DEFAULT}} is always the primary display adapter. + Member of the enumerated type that denotes the desired device type. If the desired device type is not available, the method will fail. + The focus window alerts Direct3D when an application switches from foreground mode to background mode. See Remarks. For full-screen mode, the window specified must be a top-level window. For windowed mode, this parameter may be NULL only if the hDeviceWindow member of pPresentationParameters is set to a valid, non-NULL value. + Combination of one or more options that control device creation. For more information, see {{D3DCREATE}}. + Pointer to a structure, describing the presentation parameters for the device to be created. If BehaviorFlags specifies {{D3DCREATE_ADAPTERGROUP_DEVICE}}, pPresentationParameters is an array. Regardless of the number of heads that exist, only one depth/stencil surface is automatically created. For Windows 2000 and Windows XP, the full-screen device display refresh rate is set in the following order: User-specified nonzero ForcedRefreshRate registry key, if supported by the device. Application-specified nonzero refresh rate value in the presentation parameter. Refresh rate of the latest desktop mode, if supported by the device. 75 hertz if supported by the device. 60 hertz if supported by the device. Device default. An unsupported refresh rate will default to the closest supported refresh rate below it. For example, if the application specifies 63 hertz, 60 hertz will be used. There are no supported refresh rates below 57 hertz. pPresentationParameters is both an input and an output parameter. Calling this method may change several members including: If BackBufferCount, BackBufferWidth, and BackBufferHeight are 0 before the method is called, they will be changed when the method returns. If BackBufferFormat equals before the method is called, it will be changed when the method returns. + + This method returns a fully working device interface, set to the required display mode (or windowed), and allocated with the appropriate back buffers. To begin rendering, the application needs only to create and set a depth buffer (assuming EnableAutoDepthStencil is FALSE in ). When you create a Direct3D device, you supply two different window parameters: a focus window (hFocusWindow) and a device window (the hDeviceWindow in ). The purpose of each window is: The focus window alerts Direct3D when an application switches from foreground mode to background mode (via Alt-Tab, a mouse click, or some other method). A single focus window is shared by each device created by an application. The device window determines the location and size of the back buffer on screen. This is used by Direct3D when the back buffer contents are copied to the front buffer during {{Present}}. This method should not be run during the handling of WM_CREATE. An application should never pass a window handle to Direct3D while handling WM_CREATE. Any call to create, release, or reset the device must be done using the same thread as the window procedure of the focus window. Note that D3DCREATE_HARDWARE_VERTEXPROCESSING, D3DCREATE_MIXED_VERTEXPROCESSING, and D3DCREATE_SOFTWARE_VERTEXPROCESSING are mutually exclusive flags, and at least one of these vertex processing flags must be specified when calling this method. Back buffers created as part of the device are only lockable if D3DPRESENTFLAG_LOCKABLE_BACKBUFFER is specified in the presentation parameters. (Multisampled back buffers and depth surfaces are never lockable.) The methods {{Reset}}, , and {{TestCooperativeLevel}} must be called from the same thread that used this method to create a device. D3DFMT_UNKNOWN can be specified for the windowed mode back buffer format when calling CreateDevice, {{Reset}}, and {{CreateAdditionalSwapChain}}. This means the application does not have to query the current desktop format before calling CreateDevice for windowed mode. For full-screen mode, the back buffer format must be specified. If you attempt to create a device on a 0x0 sized window, CreateDevice will fail. + + HRESULT CreateDevice([None] UINT Adapter,[None] D3DDEVTYPE DeviceType,[None] HWND hFocusWindow,[None] int BehaviorFlags,[None] D3DPRESENT_PARAMETERS* pPresentationParameters,[None] IDirect3DDevice9** ppReturnedDeviceInterface) + + + + Creates a device to represent the display adapter. + + an instance of + Ordinal number that denotes the display adapter. {{D3DADAPTER_DEFAULT}} is always the primary display adapter. + Member of the enumerated type that denotes the desired device type. If the desired device type is not available, the method will fail. + The focus window alerts Direct3D when an application switches from foreground mode to background mode. See Remarks. For full-screen mode, the window specified must be a top-level window. For windowed mode, this parameter may be NULL only if the hDeviceWindow member of pPresentationParameters is set to a valid, non-NULL value. + Combination of one or more options that control device creation. For more information, see {{D3DCREATE}}. + Pointer to a structure, describing the presentation parameters for the device to be created. If BehaviorFlags specifies {{D3DCREATE_ADAPTERGROUP_DEVICE}}, pPresentationParameters is an array. Regardless of the number of heads that exist, only one depth/stencil surface is automatically created. For Windows 2000 and Windows XP, the full-screen device display refresh rate is set in the following order: User-specified nonzero ForcedRefreshRate registry key, if supported by the device. Application-specified nonzero refresh rate value in the presentation parameter. Refresh rate of the latest desktop mode, if supported by the device. 75 hertz if supported by the device. 60 hertz if supported by the device. Device default. An unsupported refresh rate will default to the closest supported refresh rate below it. For example, if the application specifies 63 hertz, 60 hertz will be used. There are no supported refresh rates below 57 hertz. pPresentationParameters is both an input and an output parameter. Calling this method may change several members including: If BackBufferCount, BackBufferWidth, and BackBufferHeight are 0 before the method is called, they will be changed when the method returns. If BackBufferFormat equals before the method is called, it will be changed when the method returns. + + This method returns a fully working device interface, set to the required display mode (or windowed), and allocated with the appropriate back buffers. To begin rendering, the application needs only to create and set a depth buffer (assuming EnableAutoDepthStencil is FALSE in ). When you create a Direct3D device, you supply two different window parameters: a focus window (hFocusWindow) and a device window (the hDeviceWindow in ). The purpose of each window is: The focus window alerts Direct3D when an application switches from foreground mode to background mode (via Alt-Tab, a mouse click, or some other method). A single focus window is shared by each device created by an application. The device window determines the location and size of the back buffer on screen. This is used by Direct3D when the back buffer contents are copied to the front buffer during {{Present}}. This method should not be run during the handling of WM_CREATE. An application should never pass a window handle to Direct3D while handling WM_CREATE. Any call to create, release, or reset the device must be done using the same thread as the window procedure of the focus window. Note that D3DCREATE_HARDWARE_VERTEXPROCESSING, D3DCREATE_MIXED_VERTEXPROCESSING, and D3DCREATE_SOFTWARE_VERTEXPROCESSING are mutually exclusive flags, and at least one of these vertex processing flags must be specified when calling this method. Back buffers created as part of the device are only lockable if D3DPRESENTFLAG_LOCKABLE_BACKBUFFER is specified in the presentation parameters. (Multisampled back buffers and depth surfaces are never lockable.) The methods {{Reset}}, , and {{TestCooperativeLevel}} must be called from the same thread that used this method to create a device. D3DFMT_UNKNOWN can be specified for the windowed mode back buffer format when calling CreateDevice, {{Reset}}, and {{CreateAdditionalSwapChain}}. This means the application does not have to query the current desktop format before calling CreateDevice for windowed mode. For full-screen mode, the back buffer format must be specified. If you attempt to create a device on a 0x0 sized window, CreateDevice will fail. + + HRESULT CreateDevice([None] UINT Adapter,[None] D3DDEVTYPE DeviceType,[None] HWND hFocusWindow,[None] int BehaviorFlags,[None] D3DPRESENT_PARAMETERS* pPresentationParameters,[None] IDirect3DDevice9** ppReturnedDeviceInterface) + + + + Creates a device to represent the display adapter. + + an instance of + Ordinal number that denotes the display adapter. {{D3DADAPTER_DEFAULT}} is always the primary display adapter. + Member of the enumerated type that denotes the desired device type. If the desired device type is not available, the method will fail. + The focus window alerts Direct3D when an application switches from foreground mode to background mode. See Remarks. For full-screen mode, the window specified must be a top-level window. For windowed mode, this parameter may be NULL only if the hDeviceWindow member of pPresentationParameters is set to a valid, non-NULL value. + Combination of one or more options that control device creation. For more information, see {{D3DCREATE}}. + Pointer to a structure, describing the presentation parameters for the device to be created. If BehaviorFlags specifies {{D3DCREATE_ADAPTERGROUP_DEVICE}}, pPresentationParameters is an array. Regardless of the number of heads that exist, only one depth/stencil surface is automatically created. For Windows 2000 and Windows XP, the full-screen device display refresh rate is set in the following order: User-specified nonzero ForcedRefreshRate registry key, if supported by the device. Application-specified nonzero refresh rate value in the presentation parameter. Refresh rate of the latest desktop mode, if supported by the device. 75 hertz if supported by the device. 60 hertz if supported by the device. Device default. An unsupported refresh rate will default to the closest supported refresh rate below it. For example, if the application specifies 63 hertz, 60 hertz will be used. There are no supported refresh rates below 57 hertz. pPresentationParameters is both an input and an output parameter. Calling this method may change several members including: If BackBufferCount, BackBufferWidth, and BackBufferHeight are 0 before the method is called, they will be changed when the method returns. If BackBufferFormat equals before the method is called, it will be changed when the method returns. + The full screen display mode. + + This method returns a fully working device interface, set to the required display mode (or windowed), and allocated with the appropriate back buffers. To begin rendering, the application needs only to create and set a depth buffer (assuming EnableAutoDepthStencil is FALSE in ). When you create a Direct3D device, you supply two different window parameters: a focus window (hFocusWindow) and a device window (the hDeviceWindow in ). The purpose of each window is: The focus window alerts Direct3D when an application switches from foreground mode to background mode (via Alt-Tab, a mouse click, or some other method). A single focus window is shared by each device created by an application. The device window determines the location and size of the back buffer on screen. This is used by Direct3D when the back buffer contents are copied to the front buffer during {{Present}}. This method should not be run during the handling of WM_CREATE. An application should never pass a window handle to Direct3D while handling WM_CREATE. Any call to create, release, or reset the device must be done using the same thread as the window procedure of the focus window. Note that D3DCREATE_HARDWARE_VERTEXPROCESSING, D3DCREATE_MIXED_VERTEXPROCESSING, and D3DCREATE_SOFTWARE_VERTEXPROCESSING are mutually exclusive flags, and at least one of these vertex processing flags must be specified when calling this method. Back buffers created as part of the device are only lockable if D3DPRESENTFLAG_LOCKABLE_BACKBUFFER is specified in the presentation parameters. (Multisampled back buffers and depth surfaces are never lockable.) The methods {{Reset}}, , and {{TestCooperativeLevel}} must be called from the same thread that used this method to create a device. D3DFMT_UNKNOWN can be specified for the windowed mode back buffer format when calling CreateDevice, {{Reset}}, and {{CreateAdditionalSwapChain}}. This means the application does not have to query the current desktop format before calling CreateDevice for windowed mode. For full-screen mode, the back buffer format must be specified. If you attempt to create a device on a 0x0 sized window, CreateDevice will fail. + + HRESULT CreateDevice([None] UINT Adapter,[None] D3DDEVTYPE DeviceType,[None] HWND hFocusWindow,[None] int BehaviorFlags,[None] D3DPRESENT_PARAMETERS* pPresentationParameters,[None] IDirect3DDevice9** ppReturnedDeviceInterface) + + + + Creates a device to represent the display adapter. + + an instance of + Ordinal number that denotes the display adapter. {{D3DADAPTER_DEFAULT}} is always the primary display adapter. + Member of the enumerated type that denotes the desired device type. If the desired device type is not available, the method will fail. + The focus window alerts Direct3D when an application switches from foreground mode to background mode. See Remarks. For full-screen mode, the window specified must be a top-level window. For windowed mode, this parameter may be NULL only if the hDeviceWindow member of pPresentationParameters is set to a valid, non-NULL value. + Combination of one or more options that control device creation. For more information, see {{D3DCREATE}}. + Pointer to a structure, describing the presentation parameters for the device to be created. If BehaviorFlags specifies {{D3DCREATE_ADAPTERGROUP_DEVICE}}, pPresentationParameters is an array. Regardless of the number of heads that exist, only one depth/stencil surface is automatically created. For Windows 2000 and Windows XP, the full-screen device display refresh rate is set in the following order: User-specified nonzero ForcedRefreshRate registry key, if supported by the device. Application-specified nonzero refresh rate value in the presentation parameter. Refresh rate of the latest desktop mode, if supported by the device. 75 hertz if supported by the device. 60 hertz if supported by the device. Device default. An unsupported refresh rate will default to the closest supported refresh rate below it. For example, if the application specifies 63 hertz, 60 hertz will be used. There are no supported refresh rates below 57 hertz. pPresentationParameters is both an input and an output parameter. Calling this method may change several members including: If BackBufferCount, BackBufferWidth, and BackBufferHeight are 0 before the method is called, they will be changed when the method returns. If BackBufferFormat equals before the method is called, it will be changed when the method returns. + The full screen display mode. + + This method returns a fully working device interface, set to the required display mode (or windowed), and allocated with the appropriate back buffers. To begin rendering, the application needs only to create and set a depth buffer (assuming EnableAutoDepthStencil is FALSE in ). When you create a Direct3D device, you supply two different window parameters: a focus window (hFocusWindow) and a device window (the hDeviceWindow in ). The purpose of each window is: The focus window alerts Direct3D when an application switches from foreground mode to background mode (via Alt-Tab, a mouse click, or some other method). A single focus window is shared by each device created by an application. The device window determines the location and size of the back buffer on screen. This is used by Direct3D when the back buffer contents are copied to the front buffer during {{Present}}. This method should not be run during the handling of WM_CREATE. An application should never pass a window handle to Direct3D while handling WM_CREATE. Any call to create, release, or reset the device must be done using the same thread as the window procedure of the focus window. Note that D3DCREATE_HARDWARE_VERTEXPROCESSING, D3DCREATE_MIXED_VERTEXPROCESSING, and D3DCREATE_SOFTWARE_VERTEXPROCESSING are mutually exclusive flags, and at least one of these vertex processing flags must be specified when calling this method. Back buffers created as part of the device are only lockable if D3DPRESENTFLAG_LOCKABLE_BACKBUFFER is specified in the presentation parameters. (Multisampled back buffers and depth surfaces are never lockable.) The methods {{Reset}}, , and {{TestCooperativeLevel}} must be called from the same thread that used this method to create a device. D3DFMT_UNKNOWN can be specified for the windowed mode back buffer format when calling CreateDevice, {{Reset}}, and {{CreateAdditionalSwapChain}}. This means the application does not have to query the current desktop format before calling CreateDevice for windowed mode. For full-screen mode, the back buffer format must be specified. If you attempt to create a device on a 0x0 sized window, CreateDevice will fail. + + HRESULT CreateDevice([None] UINT Adapter,[None] D3DDEVTYPE DeviceType,[None] HWND hFocusWindow,[None] int BehaviorFlags,[None] D3DPRESENT_PARAMETERS* pPresentationParameters,[None] IDirect3DDevice9** ppReturnedDeviceInterface) + + + + Reports the current cooperative-level status of the Direct3D device for a windowed or full-screen application. + + The window handle. + State of the device + HRESULT IDirect3DDevice9Ex::CheckDeviceState([In] HWND hDestinationWindow) + + + + Checks an array of resources to determine if it is likely that they will cause a large stall at Draw time because the system must make the resources GPU-accessible. + + An array of that indicate the resources to check. + The status. + HRESULT IDirect3DDevice9Ex::CheckDeviceState([In] HWND hDestinationWindow) + + + + Retrieves the display mode's spatial resolution, color resolution, refresh frequency, and rotation settings. + + The swap chain. + structure containing data about the display mode of the adapter + HRESULT IDirect3DDevice9Ex::GetDisplayModeEx([In] unsigned int iSwapChain,[Out] D3DDISPLAYMODEEX* pMode,[In] void* pRotation) + + + + Retrieves the display mode's spatial resolution, color resolution, refresh frequency, and rotation settings. + + The swap chain. + The structure indicating the type of screen rotation the application will do. + structure containing data about the display mode of the adapter + HRESULT IDirect3DDevice9Ex::GetDisplayModeEx([In] unsigned int iSwapChain,[Out] D3DDISPLAYMODEEX* pMode,[In] void* pRotation) + + + + Swap the swapchain's next buffer with the front buffer. + + The flags. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9Ex::PresentEx([In] const void* pSourceRect,[In] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags) + + + + Swap the swapchain's next buffer with the front buffer. + + The flags. + The source rectangle. + The destination rectangle. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9Ex::PresentEx([In] const void* pSourceRect,[In] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags) + + + + Swap the swapchain's next buffer with the front buffer. + + The flags. + The source rectangle. + The destination rectangle. + The window override. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9Ex::PresentEx([In] const void* pSourceRect,[In] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags) + + + + Swap the swapchain's next buffer with the front buffer. + + The flags. + The source rectangle. + The destination rectangle. + The window override. + The region. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9Ex::PresentEx([In] const void* pSourceRect,[In] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags) + + + + Resets the type, size, and format of the swap chain with all other surfaces persistent. + + A reference describing the new presentation parameters. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9Ex::ResetEx([In] D3DPRESENT_PARAMETERS* pPresentationParameters,[In] void* pFullscreenDisplayMode) + + + + Resets the type, size, and format of the swap chain with all other surfaces persistent. + + A reference describing the new presentation parameters. + The full screen display mode. + + A object describing the result of the operation. + + HRESULT IDirect3DDevice9Ex::ResetEx([In] D3DPRESENT_PARAMETERS* pPresentationParameters,[In] void* pFullscreenDisplayMode) + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Get or sets the priority of the GPU thread.

+
+ +

Use to set the priority of a thread.

This method will retrieve the priority of the thread stored with the Direct3D device even if it was created with the flag.

+
+ + bb174341 + GetGPUThreadPriority / SetGPUThreadPriority + GetGPUThreadPriority + HRESULT IDirect3DDevice9Ex::GetGPUThreadPriority([Out] int* pPriority) +
+ + +

Retrieves or sets the number of frames of data that the system is allowed to queue.

+
+ +

Frame latency is the number of frames that are allowed to be stored in a queue, before submission for rendering. Latency is often used to control how the CPU chooses between responding to user input and frames that are in the render queue.

It is often beneficial for applications that have no user input (for example, video playback) to queue more than 3 frames of data.

+
+ + bb174342 + GetMaximumFrameLatency / SetMaximumFrameLatency + GetMaximumFrameLatency + HRESULT IDirect3DDevice9Ex::GetMaximumFrameLatency([Out] unsigned int* pMaxLatency) +
+ + +

Prepare the texture sampler for monochrome convolution filtering on a single-color texture.

+
+

The width of the filter kernel; ranging from 1 - D3DCONVOLUTIONMONO_MAXWIDTH. The default value is 1.

+

The height of the filter kernel; ranging from 1 - D3DCONVOLUTIONMONO_MAXHEIGHT. The default value is 1.

+

An array of weights, one weight for each kernel sub-element in the width. This parameter must be null, which will set the weights equal to the default value.

+

An array of weights, one weight for each kernel sub-element in the height. This parameter must be null, which will set the weights equal to the default value.

+

If the method succeeds, the return value is .

+ +

This method is designed to filter a single color texture. A monochrome convolution filter is a 2D box filter with all of the weights set to 1.0; the filter kernel resolution ranges from 1 x 1 to 7 x 7. When monochrome texture filtering is set to a texture sampler and texture sampling is performed at location, then Direct3D performs convolution.

Restrictions include:

  • The filter specified by this method is recorded in state blocks as a part of .
  • The only texture address mode supported is: ; the border color is always 0.
  • This method is not supported for mipmaps.
  • Using a non-monochrome texture with convolution filtering will generate a driver error.
+
+ + bb174345 + HRESULT IDirect3DDevice9Ex::SetConvolutionMonoKernel([In] unsigned int width,[In] unsigned int height,[In, Buffer] float* rows,[In, Buffer] float* columns) + IDirect3DDevice9Ex::SetConvolutionMonoKernel +
+ + +

Copy a text string to one surface using an alphabet of glyphs on another surface. Composition is done by the GPU using bitwise operations.

+
+

A reference to a source surface (prepared by ) that supplies the alphabet glyphs. This surface must be created with the flag.

+

A reference to the destination surface (prepared by ) that receives the glyph data. The surface must be part of a texture.

+

A reference to a vertex buffer (see ) containing rectangles (see D3DCOMPOSERECTDESC) that enclose the desired glyphs in the source surface.

+

The number of rectangles or glyphs that are used in the operation. The number applies to both the source and destination surfaces. The range is 0 to D3DCOMPOSERECTS_MAXNUMRECTS.

+

A reference to a vertex buffer (see ) containing rectangles (see D3DCOMPOSERECTDESTINATION) that describe the destination to which the indicated glyph from the source surface will be copied.

+

Specifies how to combine the source and destination surfaces. See .

+

A value added to the x coordinates of all destination rectangles. This value can be negative, which may cause the glyph to be rejected or clipped if the result is beyond the bounds of the surface.

+

A value added to the y coordinates of all destination rectangles. This value can be negative, which may cause the glyph to be rejected or clipped if the result is beyond the bounds of the surface.

+

If the method succeeds, the return value is .

+ +

Glyphs from a one-bit source surface are put together into another one-bit texture surface with this method. The destination surface can then be used as the source for a normal texturing operation that will filter and scale the strings of text onto some other non-monochrome surface.

This method has several constraints (which are similar to StretchRect):

  • Surfaces cannot be locked.
  • The source and destination surfaces cannot be the same surface.
  • The source and destination surfaces must be created with the format.
  • The source surface and both vertex buffers must be created with the flag.
  • The destination surface must be created with either the or flags.
  • The source rectangles must be within the source surface.

The method is not recorded in state blocks.

+
+ + bb174340 + HRESULT IDirect3DDevice9Ex::ComposeRects([In] IDirect3DSurface9* pSrc,[In] IDirect3DSurface9* pDst,[In] IDirect3DVertexBuffer9* pSrcRectDescs,[In] unsigned int NumRects,[In] IDirect3DVertexBuffer9* pDstRectDescs,[In] D3DCOMPOSERECTSOP Operation,[In] int Xoffset,[In] int Yoffset) + IDirect3DDevice9Ex::ComposeRects +
+ + +

Swap the swapchain's next buffer with the front buffer.

+
+

Pointer to a structure indicating region on the source surface to copy in window client coordinates. Only applies when the swapchain was created with the flag. If null, the entire source surface is presented. If the rectangle exceeds the source surface, it is clipped to the source surface.

+

Pointer to structure indicating the target region on the destination surface in window client coordinates. Only applies when the swapchain was created with the flag. If null, the entire client area is filled. If the rectangle exceeds the destination client area, it is clipped to the destination client area.

+

Pointer to a destination window whose client area is taken as the target for this presentation. If this value is null, the runtime uses the hDeviceWindow member of for the presentation.

Note??If you create a swap chain with , you must pass null to hDestWindowOverride

+

Pointer to a structure indicating the smallest set of pixels that need to be transferred. This value must be null unless the swapchain was created with the flag. For more information about swapchains, see Flipping Surfaces (Direct3D 9).

If this value is non-null, the contained region is expressed in back buffer coordinates. The method takes these rectangles into account when optimizing the presentation by copying only the pixels within the region, or some suitably expanded set of rectangles. This is an aid to optimization only, and the application should not rely on the region being copied exactly. The implementation can choose to copy the whole source rectangle.

+

Allows the application to request that the method return immediately when the driver reports that it cannot schedule a presentation. Valid values are 0, or any combination of flags.

  • If dwFlags = 0, this method behaves as it did prior to Direct3D 9. Present will spin until the hardware is free, without returning an error.
  • If dwFlags = the display driver is called with the front buffer as both the source and target surface. The driver responds by scheduling a frame synch, but not changing the displayed surface. This flag is only available in full-screen mode or when using in windowed mode.
  • If dwFlags = , and the hardware is busy processing or waiting for a vertical sync interval, the method will return .
  • If dwFlags = , is enforced on this Present call. This flag can only be specified when using . This behavior is the same for windowed and full-screen modes.
  • If dwFlags = , gamma correction is performed from linear space to sRGB for windowed swap chains. This flag will take effect only when the driver exposes (see Gamma (Direct3D 9)).
+

Possible return values include: , , , , or (see D3DERR). See Lost Device Behavior Changes for more information about lost, hung, and removed devices.

Differences between Direct3D 9 and Direct3D 9Ex:

is only available in Direct3D9Ex running on Windows 7 (or more current operating system).

?

+ +

Similar to the Method, PresentEx adds a dwflags parameter.

When the swapchain is created with flag, pSourceRect, pDestRect and pDirtyRegion values must be set to null.

+
+ + bb174343 + HRESULT IDirect3DDevice9Ex::PresentEx([In] const void* pSourceRect,[In] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags) + IDirect3DDevice9Ex::PresentEx +
+ + +

Get the priority of the GPU thread.

+
+

Current GPU priority. Valid values range from -7 to 7.

+

Possible return values include: or (see D3DERR).

+ +

Use to set the priority of a thread.

This method will retrieve the priority of the thread stored with the Direct3D device even if it was created with the flag.

+
+ + bb174341 + HRESULT IDirect3DDevice9Ex::GetGPUThreadPriority([Out] int* pPriority) + IDirect3DDevice9Ex::GetGPUThreadPriority +
+ + +

Set the priority on the GPU thread.

+
+

The thread priority, ranging from -7 to 7.

+

Possible return values include: , , or (see D3DERR).

+ +

GPU thread priority is not reset when a device is lost. The effects of calls to this method are not recorded in state blocks.

+
+ + bb174346 + HRESULT IDirect3DDevice9Ex::SetGPUThreadPriority([In] int Priority) + IDirect3DDevice9Ex::SetGPUThreadPriority +
+ + +

Suspend execution of the calling thread until the next vertical blank signal.

+
+

Swap chain index. This is an optional, zero-based index used to specify a swap chain on a multihead card.

+

This method will always return .

+ +

This method allows applications to efficiently throttle their frame rate to that of the monitor associated with the device. Following a vertical blank, the amount of time it takes for the thread to wake up is typically very short.

In some scenarios the hardware may stop generating vertical blank signals when nothing is being displayed on the monitor. In this case, the method will wait approximately 100ms and return with .

+
+ + bb174349 + HRESULT IDirect3DDevice9Ex::WaitForVBlank([In] unsigned int iSwapChain) + IDirect3DDevice9Ex::WaitForVBlank +
+ + +

Checks an array of resources to determine if it is likely that they will cause a large stall at Draw time because the system must make the resources GPU-accessible.

+
+

An array of references that indicate the resources to check.

+

A value indicating the number of resources passed into the pResourceArray parameter up to a maximum of 65535.

+

If all the resources are in GPU-accessible memory, the method will return . The system may need to perform a remapping operation to promote the resources, but will not have to copy data.

If no allocation that comprises the resources is on disk, but at least one allocation is not in GPU-accessible memory, the method will return . The system may need to perform a copy to promote the resource.

If at least one allocation that comprises the resources is on disk, this method will return S_NOT_RESIDENT. The system may need to perform a copy to promote the resource.

+ +

This API is no more than a reasonable guess at residency, since resources may have been demoted by the time the application uses them.

The expected usage pattern is as follows. If the application determines that a set of resources are not resident, then the application will substitute a lower-LOD version of the resource and continue with rendering. The video memory manager API, offers a feature to allow the application to express that it would like these lower-LOD resources to be made more likely to stay resident in GPU-accessible memory. It is the app's responsibility to create, fill and destroy these lower-LOD versions, if it so chooses.

The application also needs to begin promotion of the higher-LOD versions when the residency check indicates that the resource is not resident in GPU-accessible memory. Since a per-process lock exists in kernel mode, a performant implementation will spawn a separate process whose sole job is to promote resources. The application communicates resource identity between the two process by means of the Sharing Resources shared surfaces API and promotes them by means of the SetPriority.

+
+ + bb174339 + HRESULT IDirect3DDevice9Ex::CheckResourceResidency([In, Buffer] IDirect3DResource9** pResourceArray,[In] unsigned int NumResources) + IDirect3DDevice9Ex::CheckResourceResidency +
+ + +

Checks an array of resources to determine if it is likely that they will cause a large stall at Draw time because the system must make the resources GPU-accessible.

+
+

An array of references that indicate the resources to check.

+

A value indicating the number of resources passed into the pResourceArray parameter up to a maximum of 65535.

+

If all the resources are in GPU-accessible memory, the method will return . The system may need to perform a remapping operation to promote the resources, but will not have to copy data.

If no allocation that comprises the resources is on disk, but at least one allocation is not in GPU-accessible memory, the method will return . The system may need to perform a copy to promote the resource.

If at least one allocation that comprises the resources is on disk, this method will return S_NOT_RESIDENT. The system may need to perform a copy to promote the resource.

+ +

This API is no more than a reasonable guess at residency, since resources may have been demoted by the time the application uses them.

The expected usage pattern is as follows. If the application determines that a set of resources are not resident, then the application will substitute a lower-LOD version of the resource and continue with rendering. The video memory manager API, offers a feature to allow the application to express that it would like these lower-LOD resources to be made more likely to stay resident in GPU-accessible memory. It is the app's responsibility to create, fill and destroy these lower-LOD versions, if it so chooses.

The application also needs to begin promotion of the higher-LOD versions when the residency check indicates that the resource is not resident in GPU-accessible memory. Since a per-process lock exists in kernel mode, a performant implementation will spawn a separate process whose sole job is to promote resources. The application communicates resource identity between the two process by means of the Sharing Resources shared surfaces API and promotes them by means of the SetPriority.

+
+ + bb174339 + HRESULT IDirect3DDevice9Ex::CheckResourceResidency([In, Buffer] IDirect3DResource9** pResourceArray,[In] unsigned int NumResources) + IDirect3DDevice9Ex::CheckResourceResidency +
+ + +

Checks an array of resources to determine if it is likely that they will cause a large stall at Draw time because the system must make the resources GPU-accessible.

+
+

An array of references that indicate the resources to check.

+

A value indicating the number of resources passed into the pResourceArray parameter up to a maximum of 65535.

+

If all the resources are in GPU-accessible memory, the method will return . The system may need to perform a remapping operation to promote the resources, but will not have to copy data.

If no allocation that comprises the resources is on disk, but at least one allocation is not in GPU-accessible memory, the method will return . The system may need to perform a copy to promote the resource.

If at least one allocation that comprises the resources is on disk, this method will return S_NOT_RESIDENT. The system may need to perform a copy to promote the resource.

+ +

This API is no more than a reasonable guess at residency, since resources may have been demoted by the time the application uses them.

The expected usage pattern is as follows. If the application determines that a set of resources are not resident, then the application will substitute a lower-LOD version of the resource and continue with rendering. The video memory manager API, offers a feature to allow the application to express that it would like these lower-LOD resources to be made more likely to stay resident in GPU-accessible memory. It is the app's responsibility to create, fill and destroy these lower-LOD versions, if it so chooses.

The application also needs to begin promotion of the higher-LOD versions when the residency check indicates that the resource is not resident in GPU-accessible memory. Since a per-process lock exists in kernel mode, a performant implementation will spawn a separate process whose sole job is to promote resources. The application communicates resource identity between the two process by means of the Sharing Resources shared surfaces API and promotes them by means of the SetPriority.

+
+ + bb174339 + HRESULT IDirect3DDevice9Ex::CheckResourceResidency([In, Buffer] IDirect3DResource9** pResourceArray,[In] unsigned int NumResources) + IDirect3DDevice9Ex::CheckResourceResidency +
+ + +

Set the number of frames that the system is allowed to queue for rendering.

+
+

The maximum number of back buffer frames that a driver can queue. The value is typically 3, but can range from 1 to 20. A value of 0 will reset latency to the default. For multi-head devices, MaxLatency is specified per-head.

+

Possible return values include: or (see D3DERR).

+ +

Frame latency is the number of frames that are allowed to be stored in a queue, before submission for rendering. Latency is often used to control how the CPU chooses between responding to user input and frames that are in the render queue.

It is often beneficial for applications that have no user input (for example, video playback) to queue more than 3 frames of data.

+
+ + bb174347 + HRESULT IDirect3DDevice9Ex::SetMaximumFrameLatency([In] unsigned int MaxLatency) + IDirect3DDevice9Ex::SetMaximumFrameLatency +
+ + +

Retrieves the number of frames of data that the system is allowed to queue.

+
+

Returns the number of frames that can be queued for render. The value is typically 3, but can range from 1 to 20.

+

Possible return values include: , , , , , or (see D3DERR).

+ +

Frame latency is the number of frames that are allowed to be stored in a queue, before submission for rendering. Latency is often used to control how the CPU chooses between responding to user input and frames that are in the render queue.

It is often beneficial for applications that have no user input (for example, video playback) to queue more than 3 frames of data.

+
+ + bb174342 + HRESULT IDirect3DDevice9Ex::GetMaximumFrameLatency([Out] unsigned int* pMaxLatency) + IDirect3DDevice9Ex::GetMaximumFrameLatency +
+ + +

Reports the current cooperative-level status of the Direct3D device for a windowed or full-screen application.

+
+

The destination window handle to check for occlusion. When this parameter is null, is returned when another device has fullscreen ownership. When the window handle is not null, window's client area is checked for occlusion. A window is occluded if any part of it is obscured by another application.

+

Possible return values include: , , , , or (see D3DERR), or , or (see S_PRESENT).

+ +

This method replaces , which always returns in Direct3D 9Ex applications.

We recommend not to call CheckDeviceState every frame. Instead, call CheckDeviceState only if the method returns a failure code.

See Lost Device Behavior Changes for more information about lost, hung, and removed devices.

+
+ + bb174338 + HRESULT IDirect3DDevice9Ex::CheckDeviceState([In] HWND hDestinationWindow) + IDirect3DDevice9Ex::CheckDeviceState +
+ + +

Creates a render-target surface.

+
+

Width of the render-target surface, in pixels.

+

Height of the render-target surface, in pixels.

+

Member of the enumerated type, describing the format of the render target.

+

Member of the enumerated type, which describes the multisampling buffer type. This parameter specifies the antialiasing type for this render target. When this surface is passed to , its multisample type must be the same as that of the depth-stencil set by .

+

Quality level. The valid range is between zero and one less than the level returned by pQualityLevels used by . Passing a larger value returns the error, . The MultisampleQuality values of paired render targets, depth stencil surfaces, and the multisample type must all match.

+

Render targets are not lockable unless the application specifies TRUE for Lockable.

Note that lockable render targets reduce performance on some graphics hardware. The readback performance (moving data from video memory to system memory) depends on the type of hardware used (AGP vs. PCI Express) and is usually far lower than upload performance (moving data from system to video memory). If you need read access to render targets, use GetRenderTargetData instead of lockable render targets.

+

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

+

Combination of one or more constants which can be OR'd together. Value of 0 indicates no usage.

+

Address of a reference to an interface.

+ +

Render-target surfaces are placed in the memory class.

The creation of lockable, multisampled render targets is not supported.

+
+ + bb509713 + HRESULT IDirect3DDevice9Ex::CreateRenderTargetEx([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Lockable,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle,[In] unsigned int Usage) + IDirect3DDevice9Ex::CreateRenderTargetEx +
+ + +

Create an off-screen surface.

+
+

Width of the surface.

+

Height of the surface.

+

Format of the surface. See .

+

Surface pool type. See .

+

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

+

Combination of one or more constants which can be OR'd together. Value of 0 indicates no usage.

+

Pointer to the interface created.

+ +

will return a surface that has identical characteristics to a surface created by the DirectX 8.x method CreateImageSurface.

is the appropriate pool for use with the and .

is not allowed when creating an offscreen plain surface. For more information about memory pools, see .

Off-screen plain surfaces are always lockable, regardless of their pool types.

+
+ + bb509712 + HRESULT IDirect3DDevice9Ex::CreateOffscreenPlainSurfaceEx([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle,[In] unsigned int Usage) + IDirect3DDevice9Ex::CreateOffscreenPlainSurfaceEx +
+ + +

Creates a depth-stencil surface.

+
+

Width of the depth-stencil surface, in pixels.

+

Height of the depth-stencil surface, in pixels.

+

Member of the enumerated type, describing the format of the depth-stencil surface. This value must be one of the enumerated depth-stencil formats for this device.

+

Member of the enumerated type, describing the multisampling buffer type. This value must be one of the allowed multisample types. When this surface is passed to , its multisample type must be the same as that of the render target set by .

+

Quality level. The valid range is between zero and one less than the level returned by pQualityLevels used by . Passing a larger value returns the error . The MultisampleQuality values of paired render targets, depth stencil surfaces, and the MultiSample type must all match.

+

Set this flag to TRUE to enable z-buffer discarding, and otherwise. If this flag is set, the contents of the depth stencil buffer will be invalid after calling either or with a different depth surface.

This flag has the same behavior as the constant, , in .

+

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

+

Combination of one or more constants which can be OR'd together. Value of 0 indicates no usage.

+

Address of a reference to an interface, representing the created depth-stencil surface resource.

+ +

The memory class of the depth-stencil buffer is always .

+
+ + bb509711 + HRESULT IDirect3DDevice9Ex::CreateDepthStencilSurfaceEx([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Discard,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle,[In] unsigned int Usage) + IDirect3DDevice9Ex::CreateDepthStencilSurfaceEx +
+ + +

Resets the type, size, and format of the swap chain with all other surfaces persistent.

+
+

Pointer to a structure, describing the new presentation parameters. This value cannot be null.

When switching to full-screen mode, Direct3D will try to find a desktop format that matches the back buffer format, so that back buffer and front buffer formats will be identical (to eliminate the need for color conversion).

When this method returns:

  • BackBufferCount, BackBufferWidth, and BackBufferHeight are set to zero.
  • BackBufferFormat is set to for windowed mode only; a full-screen mode must specify a format.
+

Pointer to a structure that describes the properties of the desired display mode. This value must be provided for fullscreen applications, but can be null for windowed applications.

+

The method can return: , or (see D3DERR).

If this method returns or then the application can only call , or release the interface reference; any other API call will cause an exception.

+ +

If a call to fails, the device will be placed in the lost state (as indicated by a return value of from a call to ). Refer to and Lost Device Behavior Changes for further information concerning the use of in the context of lost devices.

Unlike previous versions of DirectX, calling does not cause surfaces, textures or state information to be lost.

Pixel shaders and vertex shaders survive calls for Direct3D 9. They do not need to be re-created explicitly by the application.

There are two different types of swap chains: full-screen or windowed. If the new swap chain is full-screen, the adapter will be placed in the display mode that matches the new size.

Applications can expect messages to be sent to them during this call (for example, before this call is returned); applications should take precautions not to call into Direct3D at this time.

A call to will fail if called on a different thread than that used to create the device being reset.

can be specified for the windowed mode back buffer format when calling , , and . This means the application does not have to query the current desktop format before calling for windowed mode. For full-screen mode, the back buffer format must be specified. Setting BackBufferCount equal to zero (BackBufferCount = 0) results in one back buffer.

When trying to reset more than one display adapter in a group, set pPresentationParameters to point to an array of structures, one for each display in the adapter group.

If a multihead device was created with , requires an array of structures wherein each structure must specify a full-screen display. To switch back to windowed mode, the application must destroy the device and re-create a non-multihead device in windowed mode.

+
+ + bb174344 + HRESULT IDirect3DDevice9Ex::ResetEx([In] D3DPRESENT_PARAMETERS* pPresentationParameters,[In] void* pFullscreenDisplayMode) + IDirect3DDevice9Ex::ResetEx +
+ + +

Retrieves the display mode's spatial resolution, color resolution, refresh frequency, and rotation settings.

+
+

An unsigned integer specifying the swap chain.

+

Pointer to a indicating the type of screen rotation the application will do. The value returned through this reference is important when the flag is used; otherwise, it can be set to null.

+

Pointer to a structure containing data about the display mode of the adapter. As opposed to the display mode of the device, which may not be active if the device does not own full-screen mode. Can be set to null.

+ + bb509714 + HRESULT IDirect3DDevice9Ex::GetDisplayModeEx([In] unsigned int iSwapChain,[Out] D3DDISPLAYMODEEX* pMode,[In] void* pRotation) + IDirect3DDevice9Ex::GetDisplayModeEx +
+ + +

Applications use the methods of the interface to create Microsoft Direct3D objects and set up the environment. This interface includes methods for enumerating and retrieving capabilities of the device.

+
+ +

The interface is obtained by calling the Direct3DCreate9 function.

The LPDIRECT3D9 and PDIRECT3D9 types are defined as references to the interface.

typedef struct  *LPDIRECT3D9, *PDIRECT3D9;
+
+ + bb174300 + IDirect3D9 + IDirect3D9 +
+ + + Create an IDirect3D9 object and return an interface to it. + + + The Direct3D object is the first Direct3D COM object that your graphical application needs to create and the last object that your application needs to release. Functions for enumerating and retrieving capabilities of a device are accessible through the Direct3D object. This enables applications to select devices without creating them. Create an IDirect3D9 object as shown here: + LPDIRECT3D9 g_pD3D = NULL; if( NULL == (g_pD3D = Direct3DCreate9(D3D_SDK_VERSION))) return E_FAIL; + + The IDirect3D9 interface supports enumeration of active display adapters and allows the creation of objects. If the user dynamically adds adapters (either by adding devices to the desktop, or by hot-docking a laptop), those devices will not be included in the enumeration. Creating a new IDirect3D9 interface will expose the new devices. D3D_SDK_VERSION is passed to this function to ensure that the header files against which an application is compiled match the version of the runtime DLL's that are installed on the machine. D3D_SDK_VERSION is only changed in the runtime when a header change (or other code change) would require an application to be rebuilt. If this function fails, it indicates that the header file version does not match the runtime DLL version. For an example, see {{Creating a Device (Direct3D 9)}}. + + + + + Checks the version of D3DX runtime against the version of this library.. + + + + + Gets the adapters. + + + + + Determines whether a depth-stencil format is compatible with a render-target format in a particular display mode. + + The adapter. + Type of the device. + The adapter format. + The render target format. + The depth stencil format. + If the depth-stencil format is compatible with the render-target format in the display mode, this method returns true + HRESULT IDirect3D9::CheckDepthStencilMatch([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT AdapterFormat,[In] D3DFORMAT RenderTargetFormat,[In] D3DFORMAT DepthStencilFormat) + + + + Determines whether a depth-stencil format is compatible with a render-target format in a particular display mode. + + The adapter. + Type of the device. + The adapter format. + The render target format. + The depth stencil format. + The result. + + If the depth-stencil format is compatible with the render-target format in the display mode, this method returns true + + HRESULT IDirect3D9::CheckDepthStencilMatch([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT AdapterFormat,[In] D3DFORMAT RenderTargetFormat,[In] D3DFORMAT DepthStencilFormat) + + + + Determines whether a surface format is available as a specified resource type and can be used as a texture, depth-stencil buffer, or render target, or any combination of the three, on a device representing this adapter. + + The adapter. + Type of the device. + The adapter format. + The usage. + Type of the resource. + The check format. + + If the format is compatible with the specified device for the requested usage, this method returns true + + HRESULT IDirect3D9::CheckDeviceFormat([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT AdapterFormat,[In] unsigned int Usage,[In] D3DRESOURCETYPE RType,[In] D3DFORMAT CheckFormat) + + + + Determines whether a surface format is available as a specified resource type and can be used as a texture, depth-stencil buffer, or render target, or any combination of the three, on a device representing this adapter. + + The adapter. + Type of the device. + The adapter format. + The usage. + Type of the resource. + The check format. + The result. + If the format is compatible with the specified device for the requested usage, this method returns true + HRESULT IDirect3D9::CheckDeviceFormat([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT AdapterFormat,[In] unsigned int Usage,[In] D3DRESOURCETYPE RType,[In] D3DFORMAT CheckFormat) + + + + Tests the device to see if it supports conversion from one display format to another. + + The adapter. + Type of the device. + The source format. + The target format. + + True if the method succeeds. + + HRESULT IDirect3D9::CheckDeviceFormatConversion([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT SourceFormat,[In] D3DFORMAT TargetFormat) + + + + Tests the device to see if it supports conversion from one display format to another. + + The adapter. + Type of the device. + The source format. + The target format. + The result. + True if the method succeeds. + HRESULT IDirect3D9::CheckDeviceFormatConversion([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT SourceFormat,[In] D3DFORMAT TargetFormat) + + + + Determines if a multisampling technique is available on this device. + + The adapter. + Type of the device. + The surface format. + if set to true [windowed]. + Type of the multisample. + + f the device can perform the specified multisampling method, this method returns true + + HRESULT IDirect3D9::CheckDeviceMultiSampleType([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT SurfaceFormat,[In] BOOL Windowed,[In] D3DMULTISAMPLE_TYPE MultiSampleType,[Out] unsigned int* pQualityLevels) + + + + Determines if a multisampling technique is available on this device. + + The adapter. + Type of the device. + The surface format. + if set to true [windowed]. + Type of the multisample. + The quality levels. + + f the device can perform the specified multisampling method, this method returns true + + HRESULT IDirect3D9::CheckDeviceMultiSampleType([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT SurfaceFormat,[In] BOOL Windowed,[In] D3DMULTISAMPLE_TYPE MultiSampleType,[Out] unsigned int* pQualityLevels) + + + + Determines if a multisampling technique is available on this device. + + The adapter. + Type of the device. + The surface format. + if set to true [windowed]. + Type of the multisample. + The quality levels. + The result. + f the device can perform the specified multisampling method, this method returns true + HRESULT IDirect3D9::CheckDeviceMultiSampleType([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT SurfaceFormat,[In] BOOL Windowed,[In] D3DMULTISAMPLE_TYPE MultiSampleType,[Out] unsigned int* pQualityLevels) + + + + Verifies whether a hardware accelerated device type can be used on this adapter. + + The adapter. + Type of the device. + The adapter format. + The back buffer format. + if set to true [windowed]. + + true if the device can be used on this adapter + + HRESULT IDirect3D9::CheckDeviceType([In] unsigned int Adapter,[In] D3DDEVTYPE DevType,[In] D3DFORMAT AdapterFormat,[In] D3DFORMAT BackBufferFormat,[In] BOOL bWindowed) + + + + Verifies whether a hardware accelerated device type can be used on this adapter. + + The adapter. + Type of the device. + The adapter format. + The back buffer format. + if set to true [windowed]. + The result. + true if the device can be used on this adapter + HRESULT IDirect3D9::CheckDeviceType([In] unsigned int Adapter,[In] D3DDEVTYPE DevType,[In] D3DFORMAT AdapterFormat,[In] D3DFORMAT BackBufferFormat,[In] BOOL bWindowed) + + + + Get the physical display adapters present in the system when this was instantiated. + + The adapter. + The physical display adapters + HRESULT IDirect3D9::GetAdapterIdentifier([In] unsigned int Adapter,[In] unsigned int Flags,[Out] D3DADAPTER_IDENTIFIER9* pIdentifier) + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Returns the number of adapters on the system.

+
+ + bb174315 + GetAdapterCount + GetAdapterCount + unsigned int IDirect3D9::GetAdapterCount() +
+ + +

Registers a pluggable software device. Software devices provide software rasterization enabling applications to access a variety of software rasterizers.

+
+

Pointer to the initialization function for the software device to be registered.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: . The method call is invalid. For example, a method's parameter may have an invalid value: .

+ +

If the user's computer provides no special hardware acceleration for 3D operations, your application might emulate 3D hardware in software. Software rasterization devices emulate the functions of color 3D hardware in software. A software device runs more slowly than a hal. However, software devices take advantage of any special instructions supported by the CPU to increase performance. Instruction sets include the AMD 3DNow! instruction set on some AMD processors and the MMX instruction set supported by many Intel processors. Direct3D uses the 3D-Now! instruction set to accelerate transformation and lighting operations and the MMX instruction set to accelerate rasterization.

Software devices communicate with Direct3D through an interface similar to the hardware device driver interface (DDI).

Software devices are loaded by the application and registered with the object. Direct3D uses the software device for rendering.

The Direct3D Driver Development Kit (DDK) provides the documentation and headers for developing pluggable software devices.

+
+ + bb174321 + HRESULT IDirect3D9::RegisterSoftwareDevice([In] void* pInitializeFunction) + IDirect3D9::RegisterSoftwareDevice +
+ + +

Returns the number of adapters on the system.

+
+

A UINT value that denotes the number of adapters on the system at the time this interface was instantiated.

+ + bb174315 + unsigned int IDirect3D9::GetAdapterCount() + IDirect3D9::GetAdapterCount +
+ + +

Describes the physical display adapters present in the system when the interface was instantiated.

+
+ No documentation. + No documentation. + No documentation. + + bb174317 + HRESULT IDirect3D9::GetAdapterIdentifier([In] unsigned int Adapter,[In] unsigned int Flags,[Out] D3DADAPTER_IDENTIFIER9* pIdentifier) + IDirect3D9::GetAdapterIdentifier +
+ + +

Returns the number of display modes available on this adapter.

+
+

Ordinal number that denotes the display adapter. D3DADAPTER_DEFAULT is always the primary display adapter.

+

Identifies the format of the surface type using . Use EnumAdapterModes to see the valid formats.

+

This method returns the number of display modes on this adapter or zero if Adapter is greater than or equal to the number of adapters on the system.

+ + bb174318 + unsigned int IDirect3D9::GetAdapterModeCount([In] unsigned int Adapter,[In] D3DFORMAT Format) + IDirect3D9::GetAdapterModeCount +
+ + +

Queries the device to determine whether the specified adapter supports the requested format and display mode. This method could be used in a loop to enumerate all the available adapter modes.

+
+

Ordinal number denoting the display adapter to enumerate. D3DADAPTER_DEFAULT is always the primary display adapter. This method returns when this value equals or exceeds the number of display adapters in the system.

+

Allowable pixel formats. See Remarks.

+

Represents the display-mode index which is an unsigned integer between zero and the value returned by GetAdapterModeCount minus one.

+

A reference to the available display mode of type . See Remarks.

+ +

An application supplies a display mode and a format to EnumAdapterModes which returns a display mode. This method could be used in a loop to enumerate all available display modes.

The application specifies a format and the enumeration is restricted to those display modes that exactly match the format (alpha is ignored). Allowed formats (which are members of ) are as follows:

In addition, EnumAdapterModes treats pixel formats 565 and 555 as equivalent, and returns the correct version. The difference comes into play only when the application locks the back buffer and there is an explicit flag that the application must set in order to accomplish this.

+
+ + bb174314 + HRESULT IDirect3D9::EnumAdapterModes([In] unsigned int Adapter,[In] D3DFORMAT Format,[In] unsigned int Mode,[Out] D3DDISPLAYMODE* pMode) + IDirect3D9::EnumAdapterModes +
+ + +

Retrieves the current display mode of the adapter.

+
+

Ordinal number that denotes the display adapter to query. D3DADAPTER_DEFAULT is always the primary display adapter.

+

Pointer to a structure, to be filled with information describing the current adapter's mode.

+ +

GetAdapterDisplayMode will not return the correct format when the display is in an extended format, such as 2:10:10:10. Instead, it returns the format X8R8G8B8.

+
+ + bb174316 + HRESULT IDirect3D9::GetAdapterDisplayMode([In] unsigned int Adapter,[Out] D3DDISPLAYMODE* pMode) + IDirect3D9::GetAdapterDisplayMode +
+ + +

Verifies whether a hardware accelerated device type can be used on this adapter.

+
+

Ordinal number denoting the display adapter to enumerate. D3DADAPTER_DEFAULT is always the primary display adapter. This method returns when this value equals or exceeds the number of display adapters in the system.

+

Member of the enumerated type, indicating the device type to check.

+

Member of the enumerated type, indicating the format of the adapter display mode for which the device type is to be checked. For example, some devices will operate only in 16-bits-per-pixel modes.

+

Back buffer format. For more information about formats, see . This value must be one of the render-target formats. You can use GetAdapterDisplayMode to obtain the current format. For windowed applications, the back buffer format does not need to match the display mode format if the hardware supports color conversion. The set of possible back buffer formats is constrained, but the runtime will allow any valid back buffer format to be presented to any desktop format. There is the additional requirement that the device be operable in the desktop because devices typically do not operate in 8 bits per pixel modes. Full-screen applications cannot do color conversion. is allowed for windowed mode.

+

Value indicating whether the device type will be used in full-screen or windowed mode. If set to TRUE, the query is performed for windowed applications; otherwise, this value should be set .

+

If the device can be used on this adapter, is returned. is returned if Adapter equals or exceeds the number of display adapters in the system. is also returned if CheckDeviceType specified a device that does not exist. is returned if the requested back buffer format is not supported, or if hardware acceleration is not available for the specified formats.

+ +

A hal device type requires hardware acceleration. Applications can use CheckDeviceType to determine if the needed hardware and drivers are present to support a hal device.

Full-screen applications should not specify a DisplayFormat that contains an alpha channel. This will result in a failed call. Note that an alpha channel can be present in the back buffer but the two display formats must be identical in all other respects. For example, if DisplayFormat = , valid values for BackBufferFormat include and but exclude .

The following code fragment shows how you could use CheckDeviceType to test whether a certain device type can be used on this adapter.

 if(SUCCEEDED(pD3Device->CheckDeviceType(D3DADAPTER_DEFAULT,  ,  DisplayFormat,  BackBufferFormat,  bIsWindowed))) return ;	
+            // There is no HAL on this adapter using this render-target format. 	
+            // Try again, using another format.	
+            

This code returns if the device can be used on the default adapter with the specified surface format.

Using CheckDeviceType to test for compatibility between a back buffer that differs from the display format will return appropriate values. This means that the call will reflect device capabilities. If the device cannot render to the requested back-buffer format, the call will still return . If the device can render to the format, but cannot perform the color-converting presentation, the return value will also be . Applications can discover hardware support for the presentation itself by calling CheckDeviceFormatConversion. No software emulation for the color-converting presentation itself will be offered.

+
+ + bb174312 + HRESULT IDirect3D9::CheckDeviceType([In] unsigned int Adapter,[In] D3DDEVTYPE DevType,[In] D3DFORMAT AdapterFormat,[In] D3DFORMAT BackBufferFormat,[In] BOOL bWindowed) + IDirect3D9::CheckDeviceType +
+ + +

Determines whether a surface format is available as a specified resource type and can be used as a texture, depth-stencil buffer, or render target, or any combination of the three, on a device representing this adapter.

+
+

Ordinal number denoting the display adapter to query. D3DADAPTER_DEFAULT is always the primary display adapter. This method returns when this value equals or exceeds the number of display adapters in the system.

+

Member of the enumerated type, identifying the device type.

+

Member of the enumerated type, identifying the format of the display mode into which the adapter will be placed.

+

Requested usage options for the surface. Usage options are any combination of and D3DUSAGE_QUERY constants (only a subset of the constants are valid for CheckDeviceFormat; see the table on the page).

+

Resource type requested for use with the queried format. Member of .

+

Format of the surfaces which may be used, as defined by Usage. Member of .

+

If the format is compatible with the specified device for the requested usage, this method returns .

is returned if Adapter equals or exceeds the number of display adapters in the system, or if DeviceType is unsupported.

is returned if the format is not acceptable to the device for this usage.

+ +

Here are some examples using CheckDeviceFormat to check for hardware support of:

  • An off-screen plain surface format - Specify Usage = 0 and RType = .
  • A depth-stencil format - The following snippet tests for the passed in depth-stencil format:
      IsDepthFormatExisting(  DepthFormat,  AdapterFormat ) 	
    +            {  hr = pD3D->CheckDeviceFormat( D3DADAPTER_DEFAULT, , AdapterFormat, , , DepthFormat); return SUCCEEDED( hr );	
    +            }

    See Selecting a Device (Direct3D 9) for more detail on the enumeration process.

  • Can this texture be rendered in a particular format - Given the current display mode, this example shows how to verify that the texture format is compatible with the specific back-buffer format:
      IsTextureFormatOk(  TextureFormat,  AdapterFormat ) 	
    +            {  hr = pD3D->CheckDeviceFormat( D3DADAPTER_DEFAULT, , AdapterFormat, 0, , TextureFormat); return SUCCEEDED( hr );	
    +            }
  • Alpha blending in a pixel shader - Set Usage to . Expect this to fail for all floating-point render targets.
  • Autogeneration of mipmaps - Set Usage to . If the mipmap automatic generation fails, the application will get a non-mipmapped texture. Calling this method is considered a hint, so this method can return (a valid success code) if the only thing that fails is the mipmap generation. For more information about mipmap generation, see Automatic Generation of Mipmaps (Direct3D 9).

When migrating code from Direct3D 9 to Direct3D 10, the Direct3D 10 equivalent to CheckDeviceFormat is CheckFormatSupport.

+
+ + bb174309 + HRESULT IDirect3D9::CheckDeviceFormat([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT AdapterFormat,[In] unsigned int Usage,[In] D3DRESOURCETYPE RType,[In] D3DFORMAT CheckFormat) + IDirect3D9::CheckDeviceFormat +
+ + +

Determines if a multisampling technique is available on this device.

+
+

Ordinal number denoting the display adapter to query. D3DADAPTER_DEFAULT is always the primary display adapter. This method returns when this value equals or exceeds the number of display adapters in the system. See Remarks.

+

Member of the enumerated type, identifying the device type.

+

Member of the enumerated type that specifies the format of the surface to be multisampled. For more information, see Remarks.

+

bool value. Specify TRUE to inquire about windowed multisampling, and specify to inquire about full-screen multisampling.

+

Member of the enumerated type, identifying the multisampling technique to test.

+

pQualityLevels returns the number of device-specific sampling variations available with the given sample type. For example, if the returned value is 3, then quality levels 0, 1 and 2 can be used when creating resources with the given sample count. The meanings of these quality levels are defined by the device manufacturer and cannot be queried through D3D. For example, for a particular device different quality levels at a fixed sample count might refer to different spatial layouts of the sample locations or different methods of resolving. This can be null if it is not necessary to return the quality levels.

+

If the device can perform the specified multisampling method, this method returns . is returned if the Adapter or MultiSampleType parameters are invalid. This method returns if the queried multisampling technique is not supported by this device. is returned if DeviceType does not apply to this adapter.

+ +

This method is intended for use with both render-target and depth-stencil surfaces because you must create both surfaces multisampled if you want to use them together.

The following code fragment shows how you could use CheckDeviceMultiSampleType to test for devices that support a specific multisampling method.

 if( SUCCEEDED(pD3D->CheckDeviceMultiSampleType( pCaps->AdapterOrdinal,  pCaps->DeviceType, BackBufferFormat,  , , null ) ) && SUCCEEDED(pD3D->CheckDeviceMultiSampleType( pCaps->AdapterOrdinal,  pCaps->DeviceType, DepthBufferFormat,  , , null ) ) ) return ;	
+            

The preceding code will return if the device supports the full-screen multisampling method with the surface format.

See the remarks in for additional information on working with and setting multisample types and quality levels.

+
+ + bb174311 + HRESULT IDirect3D9::CheckDeviceMultiSampleType([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT SurfaceFormat,[In] BOOL Windowed,[In] D3DMULTISAMPLE_TYPE MultiSampleType,[Out] unsigned int* pQualityLevels) + IDirect3D9::CheckDeviceMultiSampleType +
+ + +

Determines whether a depth-stencil format is compatible with a render-target format in a particular display mode.

+
+

Ordinal number denoting the display adapter to query. D3DADAPTER_DEFAULT is always the primary display adapter.

+

Member of the enumerated type, identifying the device type.

+

Member of the enumerated type, identifying the format of the display mode into which the adapter will be placed.

+

Member of the enumerated type, identifying the format of the render-target surface to be tested.

+

Member of the enumerated type, identifying the format of the depth-stencil surface to be tested.

+

If the depth-stencil format is compatible with the render-target format in the display mode, this method returns . can be returned if one or more of the parameters is invalid. If a depth-stencil format is not compatible with the render target in the display mode, then this method returns .

+ +

This method is provided to enable applications to work with hardware requiring that certain depth formats can only work with certain render-target formats.

The behavior of this method has been changed for DirectX 8.1. This method now pays attention to the D24x8 and D32 depth-stencil formats. The previous version assumed that these formats would always be usable with 32- or 16-bit render targets. This method will now return for these formats only if the device is capable of mixed-depth operations.

The following code fragment shows how you could use CheckDeviceFormat to validate a depth stencil format.

  IsDepthFormatOk( DepthFormat,   AdapterFormat,   BackBufferFormat)	
+            { // Verify that the depth format exists  hr = pD3D->CheckDeviceFormat(D3DADAPTER_DEFAULT, , AdapterFormat, , , DepthFormat); if(FAILED(hr)) return ; // Verify that the depth format is compatible hr = pD3D->CheckDepthStencilMatch(D3DADAPTER_DEFAULT, , AdapterFormat, BackBufferFormat, DepthFormat); return SUCCEEDED(hr); }	
+            

The preceding call will return if DepthFormat cannot be used in conjunction with AdapterFormat and BackBufferFormat.

+
+ + bb174308 + HRESULT IDirect3D9::CheckDepthStencilMatch([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT AdapterFormat,[In] D3DFORMAT RenderTargetFormat,[In] D3DFORMAT DepthStencilFormat) + IDirect3D9::CheckDepthStencilMatch +
+ + +

Tests the device to see if it supports conversion from one display format to another.

+
+

Display adapter ordinal number. D3DADAPTER_DEFAULT is always the primary display adapter. This method returns when this value equals or exceeds the number of display adapters in the system.

+

Device type. Member of the enumerated type.

+

Source adapter format. Member of the enumerated type.

+

Target adapter format. Member of the enumerated type.

+

If the method succeeds, the return value is . If the method fails, the return value is . The method will return when the hardware does not support conversion between the two formats.

+ +

Using CheckDeviceType to test for compatibility between a back buffer that differs from the display format will return appropriate values. This means that the call will reflect device capabilities. If the device cannot render to the requested back buffer format, the call will still return . If the device can render to the format, but cannot perform the color-converting presentation, the return value will also be . Applications can discover hardware support for the presentation itself by calling CheckDeviceFormatConversion. No software emulation for the color-converting presentation itself will be offered.

CheckDeviceFormatConversion can also be used to determine which combinations of source surface formats and destination surface formats are permissible in calls to StretchRect.

Color conversion is restricted to the following source and target formats.

  • The source format must be a FOURCC format or a valid back buffer format. For a list of these, see FourCC Formats and BackBuffer or Display Formats.
  • The target format must be one of these unsigned formats:

    ?

+
+ + bb174310 + HRESULT IDirect3D9::CheckDeviceFormatConversion([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT SourceFormat,[In] D3DFORMAT TargetFormat) + IDirect3D9::CheckDeviceFormatConversion +
+ + +

Retrieves device-specific information about a device.

+
+

Ordinal number that denotes the display adapter. D3DADAPTER_DEFAULT is always the primary display adapter.

+

Member of the enumerated type. Denotes the device type.

+

Pointer to a structure to be filled with information describing the capabilities of the device.

+ +

The application should not assume the persistence of vertex processing capabilities across Direct3D device objects. The particular capabilities that a physical device exposes may depend on parameters supplied to CreateDevice. For example, the capabilities may yield different vertex processing capabilities before and after creating a Direct3D Device Object with hardware vertex processing enabled. For more information see the description of .

+
+ + bb174320 + HRESULT IDirect3D9::GetDeviceCaps([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[Out] D3DCAPS9* pCaps) + IDirect3D9::GetDeviceCaps +
+ + +

Returns the handle of the monitor associated with the Direct3D object.

+
+

Ordinal number that denotes the display adapter. D3DADAPTER_DEFAULT is always the primary display adapter.

+

Handle of the monitor associated with the Direct3D object.

+ +

As shown in the following code fragment, which illustrates how to obtain a handle to the monitor associated with a given device, use GetDirect3D to return the Direct3D enumerator from the device and use GetCreationParameters to retrieve the value for Adapter.

 if( FAILED( pDevice->GetCreationParameters(  &Parameters ) ) ) return ; if( FAILED( pDevice->GetDirect3D(&pD3D) ) ) return ; hMonitor = pD3D->GetAdapterMonitor(Parameters.AdapterOrdinal); pD3D->Release();	
+            
+
+ + bb174319 + HMONITOR IDirect3D9::GetAdapterMonitor([In] unsigned int Adapter) + IDirect3D9::GetAdapterMonitor +
+ + +

Creates a device to represent the display adapter.

+
+

Ordinal number that denotes the display adapter. D3DADAPTER_DEFAULT is always the primary display adapter.

+

Member of the enumerated type that denotes the desired device type. If the desired device type is not available, the method will fail.

+

The focus window alerts Direct3D when an application switches from foreground mode to background mode. See Remarks.

  • For full-screen mode, the window specified must be a top-level window.
  • For windowed mode, this parameter may be null only if the hDeviceWindow member of pPresentationParameters is set to a valid, non-null value.
+

Combination of one or more options that control device creation. For more information, see .

+

Pointer to a structure, describing the presentation parameters for the device to be created. If BehaviorFlags specifies , pPresentationParameters is an array. Regardless of the number of heads that exist, only one depth/stencil surface is automatically created.

For Windows 2000 and Windows XP, the full-screen device display refresh rate is set in the following order:

  1. User-specified nonzero ForcedRefreshRate registry key, if supported by the device.
  2. Application-specified nonzero refresh rate value in the presentation parameter.
  3. Refresh rate of the latest desktop, if supported by the device.
  4. 75 hertz if supported by the device.
  5. 60 hertz if supported by the device.
  6. Device default.

An unsupported refresh rate will default to the closest supported refresh rate below it. For example, if the application specifies 63 hertz, 60 hertz will be used. There are no supported refresh rates below 57 hertz.

pPresentationParameters is both an input and an output parameter. Calling this method may change several members including:

  • If BackBufferCount, BackBufferWidth, and BackBufferHeight are 0 before the method is called, they will be changed when the method returns.
  • If BackBufferFormat equals before the method is called, it will be changed when the method returns.
+

Address of a reference to the returned interface, which represents the created device.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , , .

+ +

This method returns a fully working device interface, set to the required display mode (or windowed), and allocated with the appropriate back buffers. To begin rendering, the application needs only to create and set a depth buffer (assuming EnableAutoDepthStencil is in ).

When you create a Direct3D device, you supply two different window parameters: a focus window (hFocusWindow) and a device window (the hDeviceWindow in ). The purpose of each window is:

  • The focus window alerts Direct3D when an application switches from foreground mode to background mode (via Alt-Tab, a mouse click, or some other method). A single focus window is shared by each device created by an application.
  • The device window determines the location and size of the back buffer on screen. This is used by Direct3D when the back buffer contents are copied to the front buffer during Present.

This method should not be run during the handling of WM_CREATE. An application should never pass a window handle to Direct3D while handling WM_CREATE. Any call to create, release, or reset the device must be done using the same thread as the window procedure of the focus window.

Note that , , and are mutually exclusive flags, and at least one of these vertex processing flags must be specified when calling this method.

Back buffers created as part of the device are only lockable if is specified in the presentation parameters. (Multisampled back buffers and depth surfaces are never lockable.)

The methods Reset, , and TestCooperativeLevel must be called from the same thread that used this method to create a device.

can be specified for the windowed mode back buffer format when calling CreateDevice, Reset, and CreateAdditionalSwapChain. This means the application does not have to query the current desktop format before calling CreateDevice for windowed mode. For full-screen mode, the back buffer format must be specified.

If you attempt to create a device on a 0x0 sized window, CreateDevice will fail.

+
+ + bb174313 + HRESULT IDirect3D9::CreateDevice([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] HWND hFocusWindow,[In] D3DCREATE BehaviorFlags,[In, Buffer] D3DPRESENT_PARAMETERS* pPresentationParameters,[Out, Fast] IDirect3DDevice9** ppReturnedDeviceInterface) + IDirect3D9::CreateDevice +
+ + +

Applications use the methods of the interface (which inherits from ) to create Microsoft Direct3D 9Ex objects and set up the environment. This interface includes methods for enumerating and retrieving capabilities of the device and is available when the underlying device implementation is compliant with Windows Vista.

+
+ +

The interface is obtained by calling the Direct3DCreate9Ex function.

The LPDIRECT3D9EX and PDIRECT3D9EX types are defined as references to the interface:

 typedef struct  *LPDIRECT3D9EX, *PDIRECT3D9EX;	
+            
+
+ + bb174301 + IDirect3D9Ex + IDirect3D9Ex +
+ + + Creates an object and returns an interface to it. + + + The object is the first object that the application creates and the last object that the application releases. Functions for enumerating and retrieving capabilities of a device are accessible through the IDirect3D9Ex object. This enables applications to select devices without creating them. The interface supports enumeration of active display adapters and allows the creation of IDirect3D9Ex objects. If the user dynamically adds adapters (either by adding devices to the desktop, or by hot-docking a laptop), these devices are not included in the enumeration. Creating a new IDirect3D9Ex interface will expose the new devices. Pass the D3D_SDK_VERSION flag to this function to ensure that header files used in the compiled application match the version of the installed runtime DLLs. D3D_SDK_VERSION is changed in the runtime only when a header or another code change would require rebuilding the application. If this function fails, it indicates that the versions of the header file and the runtime DLL do not match. Note??Direct3DCreate9Ex is supported only in Windows Vista, Windows Server 2008, and Windows 7. Earlier versions of the D3D9.dll library do not include Direct3D9Ex and Direct3DCreate9Ex. + + D3DERR_NOTAVAILABLE if Direct3DEx features are not supported (no WDDM driver is installed) or if the SDKVersion does not match the version of the DLL. D3DERR_OUTOFMEMORY if out-of-memory conditions are detected when creating the enumerator object. S_OK if the creation of the enumerator object is successful. + HRESULT Direct3DCreate9Ex([None] int SDKVersion,[None] IDirect3D9Ex** arg1) + + + + Retrieves the current display mode and rotation settings of the adapter. + + The adapter. + structure containing data about the display mode of the adapter + HRESULT IDirect3D9Ex::GetAdapterDisplayModeEx([In] unsigned int Adapter,[Out] D3DDISPLAYMODEEX* pMode,[Out] D3DDISPLAYROTATION* pRotation) + + + + Gets a collection of installed extended adapters. + + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Returns the number of display modes available.

+
+

Ordinal number denoting the display adapter from which to retrieve the display mode count.

+

Specifies the characteristics of the desired display mode. See .

+

The number of display modes available. A return of value zero from this method is an indication that no such display mode is supported or simply this monitor is no longer available.

+ +

Events such as display mode changes on other heads of the same hardware, monitor change or its connection status change, and desktop extension/unextension could all affect the number of display mode available.

To fullscreen applications, returned from PresentEx or CheckDeviceState is the indication of display mode setting failure due to those events.

To increase the chance of setting a currently available display mode successfully, fullscreen applications should try to requery the available display mode list upon receiving .

+
+ + bb174306 + unsigned int IDirect3D9Ex::GetAdapterModeCountEx([In] unsigned int Adapter,[In] const D3DDISPLAYMODEFILTER* pFilter) + IDirect3D9Ex::GetAdapterModeCountEx +
+ + +

This method returns the actual display mode info based on the given mode index.

+
+

Ordinal number denoting the display adapter to enumerate. D3DADAPTER_DEFAULT is always the primary display adapter. This method returns when this value equals or exceeds the number of display adapters in the system.

+

See .

+

Represents the display-mode index which is an unsigned integer between zero and the value returned by GetAdapterModeCount minus one.

+

A reference to the available display mode of type .

+ + bb174303 + HRESULT IDirect3D9Ex::EnumAdapterModesEx([In] unsigned int Adapter,[In] const D3DDISPLAYMODEFILTER* pFilter,[In] unsigned int Mode,[Out] D3DDISPLAYMODEEX* pMode) + IDirect3D9Ex::EnumAdapterModesEx +
+ + +

Retrieves the current display mode and rotation settings of the adapter.

+
+

Ordinal number that denotes the display adapter to query. D3DADAPTER_DEFAULT is always the primary display adapter.

+

Pointer to a structure indicating the type of screen rotation the application will do. The value returned through this reference is important when the flag is used; otherwise, it can be set to null.

+

Pointer to a structure containing data about the display mode of the adapter. As opposed to the display mode of the device, which may not be active if the device does not own full-screen mode. Can be set to null.

+ +

GetAdapterDisplayModeEx does not return the correct format when the display is in an extended format, such as 2:10:10:10. Instead, it returns the format X8R8G8B8.

To windowed applications, a value of returned from PresentEx or CheckDeviceState indicates that the display mode changed and that the current display mode might have a different format. To avoid a color-converting Present blt, windowed applications can optionally get new display mode information by using this method and adjusting its swap chain format accordingly. This method returns if this head is no longer part of the desktop or if the monitor is disconnected.

+
+ + bb174304 + HRESULT IDirect3D9Ex::GetAdapterDisplayModeEx([In] unsigned int Adapter,[Out] D3DDISPLAYMODEEX* pMode,[Out] D3DDISPLAYROTATION* pRotation) + IDirect3D9Ex::GetAdapterDisplayModeEx +
+ + +

Creates a device to represent the display adapter.

+
+

Ordinal number that denotes the display adapter. D3DADAPTER_DEFAULT is always the primary display adapter.

+

Specifies the type of device. See . If the desired device type is not available, the method will fail.

+

The focus window alerts Direct3D when an application switches from foreground mode to background mode. For full-screen mode, the window specified must be a top-level window. For windowed mode, this parameter may be null only if the hDeviceWindow member of pPresentationParameters is set to a valid, non-null value.

+

Combination of one or more options (see ) that control device creation.

+

Pointer to a structure, describing the presentation parameters for the device to be created. If BehaviorFlags specifies , this parameter is an array. Regardless of the number of heads that exist, only one depth/stencil surface is automatically created.

This parameter is both an input and an output parameter. Calling this method may change several members including:

  • If BackBufferCount, BackBufferWidth, and BackBufferHeight are 0 before the method is called, they will be changed when the method returns.
  • If BackBufferFormat equals before the method is called, it will be changed when the method returns.
+

The display mode for when the device is set to fullscreen. See . If BehaviorFlags specifies , this parameter is an array. This parameter must be null for windowed mode.

+

Address of a reference to the returned , which represents the created device.

+

This method returns when rendering device along with swapchain buffers are created successfully. is returned when any error other than invalid caller input is encountered.

+ + bb174302 + HRESULT IDirect3D9Ex::CreateDeviceEx([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] HWND hFocusWindow,[In] unsigned int BehaviorFlags,[In, Buffer] D3DPRESENT_PARAMETERS* pPresentationParameters,[In, Buffer, Optional] D3DDISPLAYMODEEX* pFullscreenDisplayMode,[Out, Fast] IDirect3DDevice9Ex** ppReturnedDeviceInterface) + IDirect3D9Ex::CreateDeviceEx +
+ + +

This method returns a unique identifier for the adapter that is specific to the adapter hardware. Applications can use this identifier to define robust mappings across various APIs (Direct3D 9, DXGI).

+
+

Ordinal number denoting the display adapter from which to retrieve the .

+

A unique identifier for the given adapter.

+ + bb174305 + HRESULT IDirect3D9Ex::GetAdapterLUID([In] unsigned int Adapter,[Out] LUID* pLUID) + IDirect3D9Ex::GetAdapterLUID +
+ + +

Describes the display mode.

+
+ + bb172548 + D3DDISPLAYMODE + D3DDISPLAYMODE +
+ + + Gets the aspect ratio. + + + + +

Screen width, in pixels.

+
+ + bb172548 + unsigned int Width + unsigned int Width +
+ + +

Screen height, in pixels.

+
+ + bb172548 + unsigned int Height + unsigned int Height +
+ + +

Refresh rate. The value of 0 indicates an adapter default.

+
+ + bb172548 + unsigned int RefreshRate + unsigned int RefreshRate +
+ + +

Member of the enumerated type, describing the surface format of the display mode.

+
+ + bb172548 + D3DFORMAT Format + D3DFORMAT Format +
+ + + A collection of + + + + +

Information about the properties of a display mode.

+
+ +

This structure is used in various methods to create and manage Direct3D 9Ex devices () and swapchains ().

+
+ + bb172549 + D3DDISPLAYMODEEX + D3DDISPLAYMODEEX +
+ + + Initializes a new instance of the class. + + + + + Gets the aspect ratio. + + + + +

The size of this structure. This should always be set to sizeof().

+
+ + bb172549 + unsigned int Size + unsigned int Size +
+ + +

Width of the display mode.

+
+ + bb172549 + unsigned int Width + unsigned int Width +
+ + +

Height of the display mode.

+
+ + bb172549 + unsigned int Height + unsigned int Height +
+ + +

Refresh rate of the display mode.

+
+ + bb172549 + unsigned int RefreshRate + unsigned int RefreshRate +
+ + +

Format of the display mode. See .

+
+ + bb172549 + D3DFORMAT Format + D3DFORMAT Format +
+ + +

Indicates whether the scanline order is progressive or interlaced. See .

+
+ + bb172549 + D3DSCANLINEORDERING ScanLineOrdering + D3DSCANLINEORDERING ScanLineOrdering +
+ + + A collection of + + + + + Driver levels support. + + None + + + + Supports for Direct3D7. + + + + + Supports for Direct3D8. + + + + + Supports for Direct3D9. + + + + +

Used to set and query effects, and to choose techniques. An effect object can contain multiple techniques to render the same effect.

+
+ +

The interface is obtained by calling , , or .

The LPD3DXEFFECT type is defined as a reference to this interface.

 typedef interface  ;	
+            typedef interface  *LPD3DXEFFECT;	
+            
+
+ + bb205788 + ID3DXEffect + ID3DXEffect +
+ + + Starts an active technique. + + The number of passes needed to render the current technique. + HRESULT ID3DXEffect::Begin([Out] unsigned int* pPasses,[In] D3DXFX Flags) + + + + Gets or sets the current technique. + + + The technique. + + D3DXHANDLE ID3DXEffect::GetCurrentTechnique() + HRESULT ID3DXEffect::SetTechnique([In] D3DXHANDLE hTechnique) + + + + Compiles an effect from a file. + + The device. + Name of the file. + The flags. + + An + + HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) + + + + Compiles an effect from a file. + + The device. + Name of the file. + The preprocessor defines. + The include file. + The skip constants. + The flags. + + An + + HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) + + + + Compiles an effect from a file. + + The device. + Name of the file. + The preprocessor defines. + The include file. + The skip constants. + The flags. + The pool. + + An + + HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) + + + + Compiles an effect from a memory buffer. + + The device. + The buffer. + The flags. + + An + + HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) + + + + Compiles an effect from a memory buffer. + + The device. + The buffer. + The preprocessor defines. + The include file. + The skip constants. + The flags. + + An + + HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) + + + + Compiles an effect from a memory buffer. + + The device. + The buffer. + The preprocessor defines. + The include file. + The skip constants. + The flags. + The pool. + An + HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) + + + + Compiles an effect from a stream. + + The device. + The stream. + The flags. + + An + + HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) + + + + Compiles an effect from a stream. + + The device. + The stream. + The preprocessor defines. + The include file. + The skip constants. + The flags. + + An + + HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) + + + + Compiles an effect from a stream. + + The device. + The stream. + The preprocessor defines. + The include file. + The skip constants. + The flags. + The pool. + An + HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) + + + + Compiles an effect from a string. + + The device. + The source data. + The flags. + + An + + HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) + + + + Compiles an effect from a string. + + The device. + The source data. + The preprocessor defines. + The include file. + The skip constants. + The flags. + + An + + HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) + + + + Compiles an effect from a string. + + The device. + The source data. + The preprocessor defines. + The include file. + The skip constants. + The flags. + The pool. + + An + + HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) + + + + Set a contiguous range of shader constants with a memory copy. + + The handle. + The data. + + A object describing the result of the operation. + + HRESULT ID3DXEffect::SetRawValue([In] D3DXHANDLE hParameter,[In] const void* pData,[In] unsigned int ByteOffset,[In] unsigned int Bytes) + + + + Set a contiguous range of shader constants with a memory copy. + + The handle. + The data. + + A object describing the result of the operation. + + HRESULT ID3DXEffect::SetRawValue([In] D3DXHANDLE hParameter,[In] const void* pData,[In] unsigned int ByteOffset,[In] unsigned int Bytes) + + + + Set a contiguous range of shader constants with a memory copy. + + The handle. + The data. + The offset. + The count in bytes. + + A object describing the result of the operation. + + HRESULT ID3DXEffect::SetRawValue([In] D3DXHANDLE hParameter,[In] const void* pData,[In] unsigned int ByteOffset,[In] unsigned int Bytes) + + + + Set a contiguous range of shader constants with a memory copy. + + The handle. + The data. + The start index. + The count. + A object describing the result of the operation. + HRESULT ID3DXEffect::SetRawValue([In] D3DXHANDLE hParameter,[In] const void* pData,[In] unsigned int ByteOffset,[In] unsigned int Bytes) + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Gets a reference to the pool of shared parameters.

+
+ +

Pools contain shared parameters between effects. See Cloning and Sharing (Direct3D 9).

+
+ + bb205827 + GetPool + GetPool + HRESULT ID3DXEffect::GetPool([Out] ID3DXEffectPool** ppPool) +
+ + +

Retrieves the device associated with the effect.

+
+ +

Calling this method will increase the internal reference count for the interface. Be sure to call IUnknown::Release when you are done using the interface or you will have a memory leak.

+
+ + bb205826 + GetDevice + GetDevice + HRESULT ID3DXEffect::GetDevice([Out] IDirect3DDevice9** ppDevice) +
+ + +

Get or sets the effect state manager.

+
+ +

The is a user-implemented interface that furnishes callbacks into an application for setting device state from an effect.

+
+ + bb205828 + GetStateManager / SetStateManager + GetStateManager + HRESULT ID3DXEffect::GetStateManager([Out] ID3DXEffectStateManager** ppManager) +
+ + +

Gets a reference to the pool of shared parameters.

+
+

Pointer to a object.

+

This method always returns the value .

+ +

Pools contain shared parameters between effects. See Cloning and Sharing (Direct3D 9).

+
+ + bb205827 + HRESULT ID3DXEffect::GetPool([Out] ID3DXEffectPool** ppPool) + ID3DXEffect::GetPool +
+ + +

Sets the active technique.

+
+

Unique handle to the technique. See Handles (Direct3D 9).

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205834 + HRESULT ID3DXEffect::SetTechnique([In] D3DXHANDLE hTechnique) + ID3DXEffect::SetTechnique +
+ + +

Gets the current technique.

+
+

A unique identifier to the current technique. See Handles (Direct3D 9).

+ + bb205825 + D3DXHANDLE ID3DXEffect::GetCurrentTechnique() + ID3DXEffect::GetCurrentTechnique +
+ + +

Validate a technique.

+
+

Unique identifier. See Handles (Direct3D 9).

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , , , , , , , , , , , and .

+ + bb205835 + HRESULT ID3DXEffect::ValidateTechnique([In] D3DXHANDLE hTechnique) + ID3DXEffect::ValidateTechnique +
+ + +

Searches for the next valid technique, starting at the technique after the specified technique.

+
+

Unique identifier to a technique. See Handles (Direct3D 9). Specify null for this parameter to find the first valid technique.

+

Pointer to an identifier for the next technique. null is returned if this is the last technique. See Handles (Direct3D 9).

+ + bb205824 + HRESULT ID3DXEffect::FindNextValidTechnique([In] D3DXHANDLE hTechnique,[Out] D3DXHANDLE* pTechnique) + ID3DXEffect::FindNextValidTechnique +
+ + +

Determines if a parameter is used by the technique.

+
+

Unique identifier for the parameter. See Handles (Direct3D 9).

+

Unique identifier for the technique. See Handles (Direct3D 9).

+

Returns TRUE if the parameter is being used and returns if the parameter is not being used.

+ + bb205829 + BOOL ID3DXEffect::IsParameterUsed([In] D3DXHANDLE hParameter,[In] D3DXHANDLE hTechnique) + ID3DXEffect::IsParameterUsed +
+ + +

Starts an active technique.

+
+

DWORD that determines if state modified by an effect is saved and restored. The default value 0 specifies that and will save and restore all state modified by the effect (including pixel and vertex shader constants). Valid flags can be seen at Effect State Save and Restore Flags.

+

Pointer to a value returned that indicates the number of passes needed to render the current technique.

+ +

An application sets one active technique in the effect system by calling . The effect system responds by capturing all the pipeline state that can be changed by the technique in a state block. An application signals the end of a technique by calling , which uses the state block to restore the original state. The effect system, therefore, takes care of saving state when a technique becomes active and restoring state when a technique ends. If you choose to disable this save and restore functionality, see .

Within the and pair, an application uses to set the active pass, if any state changes occurred after the pass was activated, and to end the active pass.

+
+ + bb205815 + HRESULT ID3DXEffect::Begin([Out] unsigned int* pPasses,[In] D3DXFX Flags) + ID3DXEffect::Begin +
+ + +

Begins a pass, within the active technique.

+
+

A zero-based integer index into the technique.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

An application sets one active pass (within one active technique) in the effect system by calling . An application signals the end of the active pass by calling . and must occur in a matching pair, within a matching pair of and calls.

If the application changes any effect state using any of the Effect::Setx methods inside of a / matching pair, the application must call to set the update the device with the state changes. If no state changes occur within a and matching pair, it is not necessary to call .

+
+ + bb205817 + HRESULT ID3DXEffect::BeginPass([In] unsigned int Pass) + ID3DXEffect::BeginPass +
+ + +

Propagate state changes that occur inside of an active pass to the device before rendering.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

If the application changes any effect state using any of the ID3DXEffect::Setx methods inside of an / matching pair, the application must call before any DrawxPrimitive call to propagate state changes to the device before rendering. If no state changes occur within a and matching pair, it is not necessary to call .

This is slightly different for any shared parameters in a cloned effect. When a technique is active on a cloned effect (that is, when has been called but and has not been called), updates parameters that are not shared as expected. To update a shared parameter (only for a cloned effect whose technique is active), call to deactivate the technique and to reactivate the technique before calling .

+
+ + bb205819 + HRESULT ID3DXEffect::CommitChanges() + ID3DXEffect::CommitChanges +
+ + +

End an active pass.

+
+

This method always returns the value .

+ +

An application signals the end of rendering an active pass by calling . Each must be part of a matching pair of and calls.

Each matching pair of and calls must be located within a matching pair of and calls.

If the application changes any effect state using any of the Effect::Setx methods inside of a / matching pair, the application must call before any DrawxPrimitive call to propagate state changes to the device before rendering.

+
+ + bb205823 + HRESULT ID3DXEffect::EndPass() + ID3DXEffect::EndPass +
+ + +

Ends an active technique.

+
+

This method always returns the value .

+ +

All rendering in an effect is done within a matching pair of and calls. After all passes are rendered, must be called to end the active technique. The effect system responds by using the state block created when was called, to automatically restore the pipeline state before .

By default, the effect system takes care of saving state prior to a technique, and restoring state after a technique. If you choose to disable this save and restore functionality, see .

+
+ + bb205821 + HRESULT ID3DXEffect::End() + ID3DXEffect::End +
+ + +

Retrieves the device associated with the effect.

+
+

Address of a reference to an interface, representing the device associated with the effect.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

Calling this method will increase the internal reference count for the interface. Be sure to call IUnknown::Release when you are done using the interface or you will have a memory leak.

+
+ + bb205826 + HRESULT ID3DXEffect::GetDevice([Out] IDirect3DDevice9** ppDevice) + ID3DXEffect::GetDevice +
+ + +

Use this method to release all references to video memory resources and delete all stateblocks. This method should be called whenever a device is lost, or before resetting a device.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

This method should be called whenever the device is lost or before the user calls . Even if the device was not actually lost, is responsible for freeing stateblocks and other resources that may need to be released before resetting the device. As a result, the font object cannot be used again before calling and then .

+
+ + bb205830 + HRESULT ID3DXEffect::OnLostDevice() + ID3DXEffect::OnLostDevice +
+ + +

Use this method to re-acquire resources and save initial state.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

should be called each time the device is reset (using ), before any other methods are called. This is a good place to re-acquire video-memory resources and capture state blocks.

+
+ + bb205831 + HRESULT ID3DXEffect::OnResetDevice() + ID3DXEffect::OnResetDevice +
+ + +

Set the effect state manager.

+
+

A reference to the state manager. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

The is a user-implemented interface that furnishes callbacks into an application for setting device state from an effect.

+
+ + bb205833 + HRESULT ID3DXEffect::SetStateManager([In] ID3DXEffectStateManager* pManager) + ID3DXEffect::SetStateManager +
+ + +

Get the effect state manager.

+
+

Returns a reference to the state manager. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

The is a user-implemented interface that furnishes callbacks into an application for setting device state from an effect.

+
+ + bb205828 + HRESULT ID3DXEffect::GetStateManager([Out] ID3DXEffectStateManager** ppManager) + ID3DXEffect::GetStateManager +
+ + +

Start capturing state changes in a parameter block.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

Capture effect parameter state changes until EndParameterBlock is called. Effect parameters include any state changes outside of a pass. Delete parameter blocks if they are no longer needed by calling DeleteParameterBlock.

+
+ + bb205816 + HRESULT ID3DXEffect::BeginParameterBlock() + ID3DXEffect::BeginParameterBlock +
+ + +

Stop capturing effect parameter state changes.

+
+

Returns a handle to the parameter state block.

+ +

All effect parameters that change state (after calling BeginParameterBlock and before calling EndParameterBlock) will be saved in an effect parameter state block. Use ApplyParameterBlock to apply this block of state changes to the effect system. Once you are finished with a state block use DeleteParameterBlock to free the memory.

+
+ + bb205822 + D3DXHANDLE ID3DXEffect::EndParameterBlock() + ID3DXEffect::EndParameterBlock +
+ + +

Apply the values in a state block to the current effect system state.

+
+

A handle to the parameter block. This is the handle returned by .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

Capture effect parameter state changes in a parameter block by calling BeginParameterBlock; stop capturing state changes by calling EndParameterBlock. These state changes include any effect parameter changes that occur inside of a technique (including those outside of a pass). Once you are done with the parameter block, call DeleteParameterBlock to recover memory.

+
+ + bb205814 + HRESULT ID3DXEffect::ApplyParameterBlock([In] D3DXHANDLE hParameterBlock) + ID3DXEffect::ApplyParameterBlock +
+ + +

Delete a parameter block.

+
+

A handle to the parameter block. This is the handle returned by .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

Parameter blocks are blocks of effect states. Use a parameter block to record state changes so that they can be applied later on with a single API call. When no longer needed, delete the parameter block to reduce memory usage.

+
+ + bb205820 + HRESULT ID3DXEffect::DeleteParameterBlock([In] D3DXHANDLE hParameterBlock) + ID3DXEffect::DeleteParameterBlock +
+ + +

Creates a copy of an effect.

+
+

Pointer to an interface, representing the device associated with the effect.

+

Pointer to an interface, containing the cloned effect.

+ +

Note??This function will not clone an effect if the user specifies during effect creation.

To update shared and non-shared parameters in an active technique of a cloned effect, see .

+
+ + bb205818 + HRESULT ID3DXEffect::CloneEffect([In] IDirect3DDevice9* pDevice,[Out] ID3DXEffect** ppEffect) + ID3DXEffect::CloneEffect +
+ + +

Set a contiguous range of shader constants with a memory copy.

+
+

Handle to the value to set, or the name of the value passed in as a string. Passing in a handle is more efficient. See Handles (Direct3D 9).

+

Pointer to a buffer containing the data to be set. SetRawValue checks for valid memory, but does not do any checking for valid data.

+

Number of bytes between the beginning of the effect data and the beginning of the effect constants you are going to set.

+

The size of the buffer to be set, in bytes.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following:E_INVALIDCALL.

+ +

SetRawValue is a very fast way to set effect constants since it performs a memory copy without performing validation or any data conversion (like converting a row-major matrix to a column-major matrix). Use SetRawValue to set a series of contiguous effect constants. For instance, you could set an array of twenty matrices with 20 calls to or by using a single SetRawValue.

All values are expected to be either matrix4x4s or float4s and all matrices are expected to be in column-major order. Int or float values are cast into a float4; therefore, it is highly recommended that you use SetRawValue with only float4 or matrix4x4 data.

+
+ + bb205832 + HRESULT ID3DXEffect::SetRawValue([In] D3DXHANDLE hParameter,[In] const void* pData,[In] unsigned int ByteOffset,[In] unsigned int Bytes) + ID3DXEffect::SetRawValue +
+ + +

The interface compiles an effect from a function or from a vertex shader.

+
+ +

The interface is obtained by calling , , or .

The LPD3DXEFFECTCOMPILER type is defined as a reference to this interface.

 typedef interface  ;	
+            typedef interface  *LPD3DXEFFECTCOMPILER;	
+            
+
+ + bb205789 + ID3DXEffectCompiler + ID3DXEffectCompiler +
+ + + Initializes a new instance of the class. + + The data. + The defines. + The include file. + The flags. + HRESULT D3DXCreateEffectCompiler([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) + + + + Compile an effect. + + The flags. + If a compilation errors occurs + Buffer containing the compiled effect. + HRESULT ID3DXEffectCompiler::CompileEffect([In] unsigned int Flags,[In] ID3DXBuffer** ppEffect,[In] ID3DXBuffer** ppErrorMsgs) + + + + Compiles a shader from an effect that contains one or more functions. + + The function handle. + The target. + The flags. + If a compilation errors occurs + The bytecode of the effect. + HRESULT ID3DXEffectCompiler::CompileShader([In] D3DXHANDLE hFunction,[In] const char* pTarget,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) + + + + Compiles a shader from an effect that contains one or more functions. + + The function handle. + The target. + The flags. + The constant table. + If a compilation errors occurs + The bytecode of the effect. + HRESULT ID3DXEffectCompiler::CompileShader([In] D3DXHANDLE hFunction,[In] const char* pTarget,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) + + + + Creates an effect compiler from a file on disk containing an ASCII effect description . + + Name of the file. + The flags. + + An instance of + + HRESULT D3DXCreateEffectCompiler([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[Out, Fast] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) + + + + Creates an effect compiler from a file on disk containing an ASCII effect description . + + Name of the file. + The defines. + The include file. + The flags. + + An instance of + + HRESULT D3DXCreateEffectCompiler([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[Out, Fast] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) + + + + Creates an effect compiler from a memory buffer containing an ASCII effect description . + + The data. + The flags. + + An instance of + + HRESULT D3DXCreateEffectCompiler([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[Out, Fast] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) + + + + Creates an effect compiler from a memory buffer containing an ASCII effect description . + + The data. + The defines. + The include file. + The flags. + + An instance of + + HRESULT D3DXCreateEffectCompiler([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[Out, Fast] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) + + + + Creates an effect compiler from a stream containing an ASCII effect description . + + The stream. + The flags. + + An instance of + + HRESULT D3DXCreateEffectCompiler([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[Out, Fast] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) + + + + Creates an effect compiler from a stream containing an ASCII effect description . + + The stream. + The defines. + The include file. + The flags. + An instance of + HRESULT D3DXCreateEffectCompiler([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[Out, Fast] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Toggles the literal status of a parameter. A literal parameter has a value that doesn't change during the lifetime of an effect.

+
+

Unique identifier to a parameter. See Handles (Direct3D 9).

+

Set to TRUE to make the parameter a literal, and if the parameter can change value during the shader lifetime.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

This methods only changes whether the parameter is a literal or not. To change the value of a parameter, use a method like or .

This function must be called before the effect is compiled. Here is an example of how one might use this function:

 LPD3DXEFFECTCOMPILER pEffectCompiler; char errors[1000];  hr; hr = ("shader.fx", null, null, 0, &pEffectCompiler,  &errors); //In the fx file, literalInt is declared as an int. //By calling this function, the compiler will treat //it as a literal (i.e. #define) hr = pEffectCompiler->SetLiteral("literalInt", TRUE); //create ten different variations of the same effect LPD3DXBUFFER pEffects[10]; LPD3DXBUFFER pErrors; for(int i = 0; i < 10; ++i) { hr = pEffectCompiler->SetInt("literalInt", i); hr = pEffectCompiler->CompileEffect(0, &pEffects[i], &pErrors); }	
+            
+
+ + bb205793 + HRESULT ID3DXEffectCompiler::SetLiteral([In] D3DXHANDLE hParameter,[In] BOOL Literal) + ID3DXEffectCompiler::SetLiteral +
+ + +

Gets a literal status of a parameter. A literal parameter has a value that doesn't change during the lifetime of an effect.

+
+

Unique identifier to a parameter. See Handles (Direct3D 9).

+

Returns True if the parameter is a literal, and False otherwise.

+ +

This methods only changes whether the parameter is a literal or not. To change the value of a parameter, use a method like or .

+
+ + bb205792 + HRESULT ID3DXEffectCompiler::GetLiteral([In] D3DXHANDLE hParameter,[Out] BOOL* pLiteral) + ID3DXEffectCompiler::GetLiteral +
+ + +

Compile an effect.

+
+

Compile options identified by various flags. The Direct3D 10 HLSL compiler is now the default. See Flags for details.

+

Buffer containing the compiled effect. For more information about accessing the buffer, see .

+

Buffer containing at least the first compile error message that occurred. This includes effect compiler errors and high-level language compile errors. For more information about accessing the buffer, see .

+

If the method succeeds, the return value is .

If the arguments are invalid, the method will return .

If the method fails, the return value will be E_FAIL.

+ + bb205790 + HRESULT ID3DXEffectCompiler::CompileEffect([In] unsigned int Flags,[In] ID3DXBuffer** ppEffect,[In] ID3DXBuffer** ppErrorMsgs) + ID3DXEffectCompiler::CompileEffect +
+ + +

Compiles a shader from an effect that contains one or more functions.

+
+

Unique identifier to the function to be compiled. This value must not be null. See Handles (Direct3D 9).

+

Pointer to a shader profile which determines the shader instruction set. See or for a list of the profiles available.

+

Compile options identified by various flags. The Direct3D 10 HLSL compiler is now the default. See Flags for details.

+

Buffer containing the compiled shader. The compiler shader is an array of DWORDs. For more information about accessing the buffer, see .

+

Buffer containing at least the first compile error message that occurred. This includes effect compiler errors and high-level language compile errors. For more information about accessing the buffer, see .

+

Returns an interface, which can be used to access shader constants. This value can be null. If you compile your application as large address aware (that is, you use the /LARGEADDRESSAWARE linker option to handle addresses larger than 2 GB), you cannot use this parameter and must set it to null. Instead, you must use the function to retrieve the shader-constant table that is embedded inside the shader. In this call, you must pass the D3DXCONSTTABLE_LARGEADDRESSAWARE flag to the Flags parameter to specify to access up to 4 GB of virtual address space.

+

If the method succeeds, the return value is .

If the arguments are invalid, the method will return .

If the method fails, the return value will be E_FAIL.

+ +

Targets can be specified for vertex shaders, pixel shaders, and texture fill functions.

Vertex shader targetsvs_1_1, vs_2_0, vs_2_sw, vs_3_0
Pixel shader targetsps_1_1, ps_1_2, ps_1_3, ps_1_4, ps_2_0, ps_2_sw, ps_3_0
Texture fill targetstx_0, tx_1

?

This method compiles a shader from a function that is written in a C-like language. For more information, see HLSL.

+
+ + bb205791 + HRESULT ID3DXEffectCompiler::CompileShader([In] D3DXHANDLE hFunction,[In] const char* pTarget,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) + ID3DXEffectCompiler::CompileShader +
+ + + No documentation. + + + bb280319 + D3DXEFFECTDEFAULT + D3DXEFFECTDEFAULT + + + + Gets the value. + + + + + No documentation. + + + bb280319 + char* pParamName + char pParamName + + + + No documentation. + + + bb280319 + D3DXEFFECTDEFAULTTYPE Type + D3DXEFFECTDEFAULTTYPE Type + + + + No documentation. + + + bb280319 + unsigned int NumBytes + unsigned int NumBytes + + + + No documentation. + + + bb280319 + void* pValue + void pValue + + + + EffectHandle used to identify a shader parameter. + + + + + Defines the behavior for caching strings. True by default. + + + + + Cache of allocated strings. + + + + + Pointer to the handle or the allocated string. + + + + + If the is a custom string not cached that needs to be released by this instance. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + The pointer. + + + + + Initializes a new instance of the class. + + + The pointer. + + + + + Initializes a new instance of the class. + + + The name. + + + + + Clears the cache. + + + By default, this class is caching all strings that are implicitly used as an effect handle. + Use this method in order to deallocate all strings that were previously cached. + + + + + marshal free. + + The __from. + The @ref. + + + + Method to marshal from native to managed struct + + The __from. + The @ref. + + + + Method to marshal from managed struct tot native + + The __from. + The @ref. + + + + + + + Allocates a string. + + + The name. + + + Pointer to the allocated string + + + + + Performs an implicit conversion from to . + + The value. + + The result of the conversion. + + + + + Performs an implicit conversion from to . + + The value. + + The result of the conversion. + + + + + Performs an implicit conversion from to raw pointer"/>. + + The value. + + The result of the conversion. + + + + + Performs an implicit conversion from raw pointer to . + + The value. + + The result of the conversion. + + + + + Performs an implicit conversion from to . + + The name. + + The result of the conversion. + + + + +

Data type for managing a set of default effect parameters.

+
+ + bb172823 + D3DXEFFECTINSTANCE + D3DXEFFECTINSTANCE +
+ + +

Name of the effect file.

+
+ + bb172823 + char* pEffectFilename + char pEffectFilename +
+ + +

Number of default parameters.

+
+ + bb172823 + unsigned int NumDefaults + unsigned int NumDefaults +
+ + +

Pointer to an array of elements, each of which contains an effect parameter.

+
+ + bb172823 + D3DXEFFECTDEFAULT* pDefaults + D3DXEFFECTDEFAULT pDefaults +
+ + +

Applications use the interface to identify parameters that are going to be shared across effects. See parameter sharing in Cloning and Sharing (Direct3D 9). This interface has no methods.

+
+ +

The interface is obtained by calling .

The LPD3DXEFFECTPOOL type is defined as a reference to this interface.

 typedef interface  ;	
+            typedef interface  *LPD3DXEFFECTPOOL;	
+            
+
+ + bb205794 + ID3DXEffectPool + ID3DXEffectPool +
+ + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + A callback function used to fill 2D texture. + + Texture coordinate being sampled. + Dimensions of the texel. + The desired color of the specified texel. + typedef VOID (WINAPI *LPD3DXFILL2D)(D3DXVECTOR4 *pOut, CONST D3DXVECTOR2 *pTexCoord, CONST D3DXVECTOR2 *pTexelSize, LPVOID pData); + + + + A callback function used to fill 3D texture. + + Texture coordinate being sampled. + Dimensions of the texel. + The desired color of the specified texel. + typedef VOID (WINAPI *LPD3DXFILL2D)(D3DXVECTOR4 *pOut, CONST D3DXVECTOR2 *pTexCoord, CONST D3DXVECTOR2 *pTexelSize, LPVOID pData); + + + + Fill callback helper class. + + + + + Pointer to the native callback for 2D function + + + + + Pointer to the native callback for 3D function + + + + +

The interface encapsulates the textures and resources needed to render a specific font on a specific device.

+
+ +

The interface is obtained by calling or .

The LPD3DXFONT type is defined as a reference to the interface.

 typedef interface  ;	
+            typedef interface  *LPD3DXFONT;	
+            
+
+ + bb173961 + ID3DXFont + ID3DXFont +
+ + + Initializes a new instance of the class. + + The device. + The font description. + + + + Initializes a new instance of the class. + + The device. + The height. + The width. + The weight. + The mip levels. + if set to true [is italic]. + The character set. + The precision. + The quality. + The pitch and family. + Name of the face. + + + + Load formatted text into video memory to improve the efficiency of rendering to the device. This method supports ANSI and Unicode strings. + + + The compiler setting also determines the function version. If Unicode is defined, the function call resolves to PreloadTextW. Otherwise, the function call resolves to PreloadTextA because ANSI strings are being used. This method generates textures that contain glyphs that represent the input text. The glyphs are drawn as a series of triangles. Text will not be rendered to the device; ID3DX10Font::DrawText must still be called to render the text. However, by preloading text into video memory, ID3DX10Font::DrawText will use substantially fewer CPU resources. This method internally converts characters to glyphs using the GDI function {{GetCharacterPlacement}}. + + Pointer to a string of characters to be loaded into video memory. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR; otherwise, the data type resolves to LPCSTR. See Remarks. + If the method succeeds, the return value is S_OK. If the method fails, the return value can be one of the following: D3DERR_INVALIDCALL, D3DXERR_INVALIDDATA. + HRESULT ID3DX10Font::PreloadTextW([None] const wchar_t* pString,[None] int Count) + + + + Draws formatted text. + + Pointer to an object that contains the string. Can be null, in which case Direct3D will render the string with its own sprite object. To improve efficiency, a sprite object should be specified if DrawText is to be called more than once in a row. + Pointer to a string to draw. If the Count parameter is -1, the string must be null-terminated. + Pointer to a structure that contains the rectangle, in logical coordinates, in which the text is to be formatted. The coordinate value of the rectangle's right side must be greater than that of its left side. Likewise, the coordinate value of the bottom must be greater than that of the top. + Specifies the method of formatting the text. It can be any combination of the following values: ValueMeaning DT_BOTTOM Justifies the text to the bottom of the rectangle. This value must be combined with DT_SINGLELINE. DT_CALCRECT Determines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the pRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text. DT_CENTER Centers text horizontally in the rectangle. DT_EXPANDTABS Expands tab characters. The default number of characters per tab is eight. DT_LEFT Aligns text to the left. DT_NOCLIP Draws without clipping. DrawText is somewhat faster when DT_NOCLIP is used. DT_RIGHT Aligns text to the right. DT_RTLREADING Displays text in right-to-left reading order for bidirectional text when a Hebrew or Arabic font is selected. The default reading order for all text is left-to-right. DT_SINGLELINE Displays text on a single line only. Carriage returns and line feeds do not break the line. DT_TOP Top-justifies text. DT_VCENTER Centers text vertically (single line only). DT_WORDBREAK Breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the pRect parameter. A carriage return/line feed sequence also breaks the line. ? + Color of the text. For more information, see . + If the function succeeds, the return value is the height of the text in logical units. If DT_VCENTER or DT_BOTTOM is specified, the return value is the offset from pRect (top to the bottom) of the drawn text. If the function fails, the return value is zero. + + The parameters of this method are very similar to those of the GDI DrawText function.This method supports both ANSI and Unicode strings.This method must be called inside a BeginScene ... EndScene block. The only exception is when an application calls DrawText with DT_CALCRECT to calculate the size of a given block of text.Unless the DT_NOCLIP format is used, this method clips the text so that it does not appear outside the specified rectangle. All formatting is assumed to have multiple lines unless the DT_SINGLELINE format is specified.If the selected font is too large for the rectangle, this method does not attempt to substitute a smaller font.This method supports only fonts whose escapement and orientation are both zero. + + int ID3DXFont::DrawTextW([In] ID3DXSprite* pSprite,[In] const wchar_t* pString,[In] int Count,[In] void* pRect,[In] unsigned int Format,[In] D3DCOLOR Color) + + + + Draws formatted text. + + Pointer to an object that contains the string. Can be null, in which case Direct3D will render the string with its own sprite object. To improve efficiency, a sprite object should be specified if DrawText is to be called more than once in a row. + Pointer to a string to draw. If the Count parameter is -1, the string must be null-terminated. + The x position to draw the text. + The y position to draw the text. + Color of the text. For more information, see . + + If the function succeeds, the return value is the height of the text in logical units. If DT_VCENTER or DT_BOTTOM is specified, the return value is the offset from pRect (top to the bottom) of the drawn text. If the function fails, the return value is zero. + + int ID3DXFont::DrawTextW([In] ID3DXSprite* pSprite,[In] const wchar_t* pString,[In] int Count,[In] void* pRect,[In] unsigned int Format,[In] D3DCOLOR Color) + + The parameters of this method are very similar to those of the GDI DrawText function.This method supports both ANSI and Unicode strings.This method must be called inside a BeginScene ... EndScene block. The only exception is when an application calls DrawText with DT_CALCRECT to calculate the size of a given block of text.Unless the DT_NOCLIP format is used, this method clips the text so that it does not appear outside the specified rectangle. All formatting is assumed to have multiple lines unless the DT_SINGLELINE format is specified.If the selected font is too large for the rectangle, this method does not attempt to substitute a smaller font.This method supports only fonts whose escapement and orientation are both zero. + + + + + Measures the specified sprite. + + Pointer to an object that contains the string. Can be null, in which case Direct3D will render the string with its own sprite object. To improve efficiency, a sprite object should be specified if DrawText is to be called more than once in a row. + Pointer to a string to draw. If the Count parameter is -1, the string must be null-terminated. + Specifies the method of formatting the text. It can be any combination of the following values: ValueMeaning DT_BOTTOM Justifies the text to the bottom of the rectangle. This value must be combined with DT_SINGLELINE. DT_CALCRECT Determines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the pRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text. DT_CENTER Centers text horizontally in the rectangle. DT_EXPANDTABS Expands tab characters. The default number of characters per tab is eight. DT_LEFT Aligns text to the left. DT_NOCLIP Draws without clipping. DrawText is somewhat faster when DT_NOCLIP is used. DT_RIGHT Aligns text to the right. DT_RTLREADING Displays text in right-to-left reading order for bidirectional text when a Hebrew or Arabic font is selected. The default reading order for all text is left-to-right. DT_SINGLELINE Displays text on a single line only. Carriage returns and line feeds do not break the line. DT_TOP Top-justifies text. DT_VCENTER Centers text vertically (single line only). DT_WORDBREAK Breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the pRect parameter. A carriage return/line feed sequence also breaks the line. ? + Determines the width and height of the rectangle. If there are multiple lines of text, this function uses the width of the rectangle pointed to by the rect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, this method modifies the right side of the rectangle so that it bounds the last character in the line. + + + + Measures the specified sprite. + + Pointer to an object that contains the string. Can be null, in which case Direct3D will render the string with its own sprite object. To improve efficiency, a sprite object should be specified if DrawText is to be called more than once in a row. + Pointer to a string to draw. If the Count parameter is -1, the string must be null-terminated. + Pointer to a structure that contains the rectangle, in logical coordinates, in which the text is to be formatted. The coordinate value of the rectangle's right side must be greater than that of its left side. Likewise, the coordinate value of the bottom must be greater than that of the top. + Specifies the method of formatting the text. It can be any combination of the following values: ValueMeaning DT_BOTTOM Justifies the text to the bottom of the rectangle. This value must be combined with DT_SINGLELINE. DT_CALCRECT Determines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the pRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text. DT_CENTER Centers text horizontally in the rectangle. DT_EXPANDTABS Expands tab characters. The default number of characters per tab is eight. DT_LEFT Aligns text to the left. DT_NOCLIP Draws without clipping. DrawText is somewhat faster when DT_NOCLIP is used. DT_RIGHT Aligns text to the right. DT_RTLREADING Displays text in right-to-left reading order for bidirectional text when a Hebrew or Arabic font is selected. The default reading order for all text is left-to-right. DT_SINGLELINE Displays text on a single line only. Carriage returns and line feeds do not break the line. DT_TOP Top-justifies text. DT_VCENTER Centers text vertically (single line only). DT_WORDBREAK Breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the pRect parameter. A carriage return/line feed sequence also breaks the line. ? + Determines the width and height of the rectangle. If there are multiple lines of text, this function uses the width of the rectangle pointed to by the rect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, this method modifies the right side of the rectangle so that it bounds the last character in the line. + + + + Measures the specified sprite. + + Pointer to an object that contains the string. Can be null, in which case Direct3D will render the string with its own sprite object. To improve efficiency, a sprite object should be specified if DrawText is to be called more than once in a row. + Pointer to a string to draw. If the Count parameter is -1, the string must be null-terminated. + Pointer to a structure that contains the rectangle, in logical coordinates, in which the text is to be formatted. The coordinate value of the rectangle's right side must be greater than that of its left side. Likewise, the coordinate value of the bottom must be greater than that of the top. + Specifies the method of formatting the text. It can be any combination of the following values: ValueMeaning DT_BOTTOM Justifies the text to the bottom of the rectangle. This value must be combined with DT_SINGLELINE. DT_CALCRECT Determines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the pRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text. DT_CENTER Centers text horizontally in the rectangle. DT_EXPANDTABS Expands tab characters. The default number of characters per tab is eight. DT_LEFT Aligns text to the left. DT_NOCLIP Draws without clipping. DrawText is somewhat faster when DT_NOCLIP is used. DT_RIGHT Aligns text to the right. DT_RTLREADING Displays text in right-to-left reading order for bidirectional text when a Hebrew or Arabic font is selected. The default reading order for all text is left-to-right. DT_SINGLELINE Displays text on a single line only. Carriage returns and line feeds do not break the line. DT_TOP Top-justifies text. DT_VCENTER Centers text vertically (single line only). DT_WORDBREAK Breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the pRect parameter. A carriage return/line feed sequence also breaks the line. ? + The height of the formatted text but does not draw the text. + Determines the width and height of the rectangle. If there are multiple lines of text, this function uses the width of the rectangle pointed to by the rect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, this method modifies the right side of the rectangle so that it bounds the last character in the line. + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Retrieves the Direct3D device associated with the font object.

+
+ +

Note??Calling this method will increase the internal reference count on the interface. Be sure to call when you are done using this interface or you will have a memory leak.

+
+ + bb173965 + GetDevice + GetDevice + HRESULT ID3DXFont::GetDevice([Out] IDirect3DDevice9** ppDevice) +
+ + +

Gets a description of the current font object. GetDescW and GetDescA are identical to this method, except that a reference is returned to a or D3DXFONT_DESCA structure, respectively.

+
+ +

This method describes Unicode font objects if UNICODE is defined. Otherwise GetDescA is called, which returns a reference to the D3DXFONT_DESCA structure.

+
+ + bb173964 + GetDescW + GetDescW + HRESULT ID3DXFont::GetDescW([Out] D3DXFONT_DESCW* pDesc) +
+ + +

Returns a handle to a display device context (DC) that has the font set.

+
+ + bb173963 + GetDC + GetDC + HDC ID3DXFont::GetDC() +
+ + +

Retrieves the Direct3D device associated with the font object.

+
+

Address of a reference to an interface, representing the Direct3D device object associated with the font object.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

Note??Calling this method will increase the internal reference count on the interface. Be sure to call when you are done using this interface or you will have a memory leak.

+
+ + bb173965 + HRESULT ID3DXFont::GetDevice([Out] IDirect3DDevice9** ppDevice) + ID3DXFont::GetDevice +
+ + +

Gets a description of the current font object. GetDescW and GetDescA are identical to this method, except that a reference is returned to a or D3DXFONT_DESCA structure, respectively.

+
+ No documentation. +

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ +

This method describes Unicode font objects if UNICODE is defined. Otherwise GetDescA is called, which returns a reference to the D3DXFONT_DESCA structure.

+
+ + bb173964 + HRESULT ID3DXFont::GetDescW([Out] D3DXFONT_DESCW* pDesc) + ID3DXFont::GetDescW +
+ + +

Retrieves font characteristics that are identified in a structure. This method supports ANSI and Unicode compiler settings.

+
+ No documentation. +

Nonzero if the function is successful; otherwise 0.

+ +

The compiler setting also determines the structure type. If Unicode is defined, the function returns a structure. Otherwise, the function call returns a structure.

+
+ + bb173967 + BOOL ID3DXFont::GetTextMetricsW([Out] TEXTMETRICW* pTextMetrics) + ID3DXFont::GetTextMetricsW +
+ + +

Returns a handle to a display device context (DC) that has the font set.

+
+

Handle to a display DC.

+ + bb173963 + HDC ID3DXFont::GetDC() + ID3DXFont::GetDC +
+ + +

Returns information about the placement and orientation of a glyph in a character cell.

+
+

Glyph identifier.

+

Address of a reference to a object that contains the glyph.

+

Pointer to the smallest rectangle object that completely encloses the glyph.

+

Pointer to the two-dimensional vector that connects the origin of the current character cell to the origin of the next character cell. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ + bb173966 + HRESULT ID3DXFont::GetGlyphData([In] unsigned int Glyph,[Out] IDirect3DTexture9** ppTexture,[Out] RECT* pBlackBox,[Out] POINT* pCellInc) + ID3DXFont::GetGlyphData +
+ + +

Loads a series of characters into video memory to improve the efficiency of rendering to the device.

+
+

ID of the first character to be loaded into video memory.

+

ID of the last character to be loaded into video memory.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

This method generates textures containing glyphs that represent the input characters. The glyphs are drawn as a series of triangles.

Characters will not be rendered to the device; DrawText must still be called to render the characters. However, by pre-loading characters into video memory, DrawText will use substantially fewer CPU resources.

This method internally converts characters to glyphs using the GDI function GetCharacterPlacement.

+
+ + bb173970 + HRESULT ID3DXFont::PreloadCharacters([In] unsigned int First,[In] unsigned int Last) + ID3DXFont::PreloadCharacters +
+ + +

Loads a series of glyphs into video memory to improve the efficiency of rendering to the device.

+
+

ID of the first glyph to be loaded into video memory.

+

ID of the last glyph to be loaded into video memory.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

This method generates textures that contain the input glyphs. The glyphs are drawn as a series of triangles.

Glyphs will not be rendered to the device; DrawText must still be called to render the glyphs. However, by pre-loading glyphs into video memory, DrawText will use substantially fewer CPU resources.

+
+ + bb173971 + HRESULT ID3DXFont::PreloadGlyphs([In] unsigned int First,[In] unsigned int Last) + ID3DXFont::PreloadGlyphs +
+ + +

Loads formatted text into video memory to improve the efficiency of rendering to the device. This method supports ANSI and Unicode strings.

+
+

Pointer to a string of characters to be loaded into video memory. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR; otherwise, the data type resolves to LPCSTR. See Remarks.

+

Number of characters in the text string.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to PreloadTextW. Otherwise, the function call resolves to PreloadTextA because ANSI strings are being used.

This method generates textures that contain glyphs that represent the input text. The glyphs are drawn as a series of triangles.

Text will not be rendered to the device; DrawText must still be called to render the text. However, by preloading text into video memory, DrawText will use substantially fewer CPU resources.

This method internally converts characters to glyphs using the GDI function GetCharacterPlacement.

+
+ + bb173972 + HRESULT ID3DXFont::PreloadTextW([In] const wchar_t* pString,[In] int Count) + ID3DXFont::PreloadTextW +
+ + +

Draws formatted text. This method supports ANSI and Unicode strings.

+
+

Pointer to an object that contains the string. Can be null, in which case Direct3D will render the string with its own sprite object. To improve efficiency, a sprite object should be specified if DrawText is to be called more than once in a row.

+

Pointer to a string to draw. If the Count parameter is -1, the string must be null-terminated.

+

Specifies the number of characters in the string. If Count is -1, then the pString parameter is assumed to be a reference to a null-terminated string and DrawText computes the character count automatically.

+

Pointer to a structure that contains the rectangle, in logical coordinates, in which the text is to be formatted. The coordinate value of the rectangle's right side must be greater than that of its left side. Likewise, the coordinate value of the bottom must be greater than that of the top.

+

Specifies the method of formatting the text. It can be any combination of the following values:

ValueMeaning
DT_BOTTOM

Justifies the text to the bottom of the rectangle. This value must be combined with DT_SINGLELINE.

DT_CALCRECT

Determines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the pRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text.

DT_CENTER

Centers text horizontally in the rectangle.

DT_EXPANDTABS

Expands tab characters. The default number of characters per tab is eight.

DT_LEFT

Aligns text to the left.

DT_NOCLIP

Draws without clipping. DrawText is somewhat faster when DT_NOCLIP is used.

DT_RIGHT

Aligns text to the right.

DT_RTLREADING

Displays text in right-to-left reading order for bidirectional text when a Hebrew or Arabic font is selected. The default reading order for all text is left-to-right.

DT_SINGLELINE

Displays text on a single line only. Carriage returns and line feeds do not break the line.

DT_TOP

Top-justifies text.

DT_VCENTER

Centers text vertically (single line only).

DT_WORDBREAK

Breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the pRect parameter. A carriage return/line feed sequence also breaks the line.

?

+

Color of the text. For more information, see .

+

If the function succeeds, the return value is the height of the text in logical units. If DT_VCENTER or DT_BOTTOM is specified, the return value is the offset from pRect (top to the bottom) of the drawn text. If the function fails, the return value is zero.

+ +

The parameters of this method are very similar to those of the GDI DrawText function.

This method supports both ANSI and Unicode strings.

This method must be called inside a BeginScene ... EndScene block. The only exception is when an application calls DrawText with DT_CALCRECT to calculate the size of a given block of text.

Unless the DT_NOCLIP format is used, this method clips the text so that it does not appear outside the specified rectangle. All formatting is assumed to have multiple lines unless the DT_SINGLELINE format is specified.

If the selected font is too large for the rectangle, this method does not attempt to substitute a smaller font.

This method supports only fonts whose escapement and orientation are both zero.

+
+ + bb173962 + int ID3DXFont::DrawTextW([In] ID3DXSprite* pSprite,[In] const wchar_t* pString,[In] int Count,[In] void* pRect,[In] unsigned int Format,[In] D3DCOLOR Color) + ID3DXFont::DrawTextW +
+ + +

Use this method to release all references to video memory resources and delete all stateblocks. This method should be called whenever a device is lost, or before resetting a device.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

This method should be called whenever the device is lost or before the user calls Reset. Even if the device was not actually lost, OnLostDevice is responsible for freeing stateblocks and other resources that may need to be released before resetting the device. As a result, the font object cannot be used again before calling Reset and then OnResetDevice.

+
+ + bb173968 + HRESULT ID3DXFont::OnLostDevice() + ID3DXFont::OnLostDevice +
+ + +

Use this method to re-acquire resources and save initial state.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

OnResetDevice should be called each time the device is reset (using Reset), before any other methods are called. This is a good place to re-acquire video-memory resources and capture state blocks.

+
+ + bb173969 + HRESULT ID3DXFont::OnResetDevice() + ID3DXFont::OnResetDevice +
+ + + Defines possible character sets for fonts. + + CHARSET + + + + The ANSI character set. + + + + + The Arabic character set. + + + + + The Baltic character set. + + + + + The Chinese character set. + + + + + The default system character set. + + + + + The East Europe character set. + + + + + The GB2312 character set. + + + + + The Greek character set. + + + + + The Hangul character set. + + + + + The Hebrew character set. + + + + + The Johab character set. + + + + + The Mac character set. + + + + + The OEM character set. + + + + + The Russian character set. + + + + + The ShiftJIS character set. + + + + + The symbol character set. + + + + + The Thai character set. + + + + + The Turkish character set. + + + + + The Vietnamese character set. + + + + + Specifies formatting options for text rendering. + + DT + + + + Align the text to the bottom. + + + + + Align the text to the center. + + + + + Expand tab characters. + + + + + Align the text to the left. + + + + + Don't clip the text. + + + + + Align the text to the right. + + + + + Rendering the text in right-to-left reading order. + + + + + Force all text to a single line. + + + + + Align the text to the top. + + + + + Vertically align the text to the center. + + + + + Allow word breaks. + + + + + Defines pitch and family settings for fonts. + + + + + Use the Decorative family. + + + + + Default pitch. + + + + + The font family doesn't matter. + + + + + Fixed pitch. + + + + + Use the Modern family. + + + + + Mono pitch. + + + + + Use the Roman family. + + + + + Use the Script family. + + + + + Use the Swiss family. + + + + + Variable pitch. + + + + + Defines precision levels for font rendering. + + OutPrecision + + + + Default + + + + + String + + + + + Character + + + + + Stroke + + + + + TrueType + + + + + Device + + + + + Raster + + + + + TrueTypeOnly + + + + + Outline + + + + + ScreenOutline + + + + + PostScriptOnly + + + + + Specifies quality options for font rendering. + + QUALITY + + + + Default + + + + + Draft + + + + + Proof + + + + + Non antialiased + + + + + Antialiased + + + + + ClearType + + + + + ClearTypeNatural + + + + + Specifies weights for font rendering. + + FW + + + + Use a black weight. + + + + + Use a bold weight. + + + + + Use a demi-bold weight. + + + + + The font weight doesn't matter. + + + + + Use an extra bold weight. + + + + + Make the font extra light. + + + + + Use a heavy weight. + + + + + Make the font light. + + + + + Use a medium weight. + + + + + Use a normal weight. + + + + + Use a regular weight. + + + + + Use a semi-bold weight. + + + + + Make the font thin. + + + + + Use an ultra bold weight. + + + + + Make the font ultra light. + + + + +

Defines constants that describe the type of back buffer.

+
+ +

Direct3D 9 does not support stereo view, so Direct3D does not use the and values of this enumerated type.

+
+ + bb172506 + D3DBACKBUFFER_TYPE + D3DBACKBUFFER_TYPE +
+ + +

Specifies a nonstereo swap chain.

+
+ + bb172506 + D3DBACKBUFFER_TYPE_MONO + D3DBACKBUFFER_TYPE_MONO +
+ + +

Specifies the left side of a stereo pair in a swap chain.

+
+ + bb172506 + D3DBACKBUFFER_TYPE_LEFT + D3DBACKBUFFER_TYPE_LEFT +
+ + +

Specifies the right side of a stereo pair in a swap chain.

+
+ + bb172506 + D3DBACKBUFFER_TYPE_RIGHT + D3DBACKBUFFER_TYPE_RIGHT +
+ + +

Defines the basis type of a high-order patch surface.

+
+ +

The members of specify the formulation to be used in evaluating the high-order patch surface primitive during tessellation.

+
+ + bb172507 + D3DBASISTYPE + D3DBASISTYPE +
+ + +

Input vertices are treated as a series of B?zier patches. The number of vertices specified must be divisible by 4. Portions of the mesh beyond this criterion will not be rendered. Full continuity is assumed between sub-patches in the interior of the surface rendered by each call. Only the vertices at the corners of each sub-patch are guaranteed to lie on the resulting surface.

+
+ + bb172507 + D3DBASIS_BEZIER + D3DBASIS_BEZIER +
+ + +

Input vertices are treated as control points of a B-spline surface. The number of apertures rendered is two fewer than the number of apertures in that direction. In general, the generated surface does not contain the control vertices specified.

+
+ + bb172507 + D3DBASIS_BSPLINE + D3DBASIS_BSPLINE +
+ + +

An interpolating basis defines the surface so that the surface goes through all the input vertices specified. In DirectX 8, this was D3DBASIS_INTERPOLATE.

+
+ + bb172507 + D3DBASIS_CATMULL_ROM + D3DBASIS_CATMULL_ROM +
+ + +

Defines the supported blend mode.

+
+ +

In the preceding member descriptions, the RGBA values of the source and destination are indicated by the s and d subscripts.

The values in this enumerated type are used by the following render states:

See

+
+ + bb172508 + D3DBLEND + D3DBLEND +
+ + +

Blend factor is (0, 0, 0, 0).

+
+ + bb172508 + D3DBLEND_ZERO + D3DBLEND_ZERO +
+ + +

Blend factor is (1, 1, 1, 1).

+
+ + bb172508 + D3DBLEND_ONE + D3DBLEND_ONE +
+ + +

Blend factor is (Rs, Gs, Bs, As).

+
+ + bb172508 + D3DBLEND_SRCCOLOR + D3DBLEND_SRCCOLOR +
+ + +

Blend factor is (1 - Rs, 1 - Gs, 1 - Bs, 1 - As).

+
+ + bb172508 + D3DBLEND_INVSRCCOLOR + D3DBLEND_INVSRCCOLOR +
+ + +

Blend factor is (As, As, As, As).

+
+ + bb172508 + D3DBLEND_SRCALPHA + D3DBLEND_SRCALPHA +
+ + +

Blend factor is ( 1 - As, 1 - As, 1 - As, 1 - As).

+
+ + bb172508 + D3DBLEND_INVSRCALPHA + D3DBLEND_INVSRCALPHA +
+ + +

Blend factor is (Ad Ad Ad Ad).

+
+ + bb172508 + D3DBLEND_DESTALPHA + D3DBLEND_DESTALPHA +
+ + +

Blend factor is (1 - Ad 1 - Ad 1 - Ad 1 - Ad).

+
+ + bb172508 + D3DBLEND_INVDESTALPHA + D3DBLEND_INVDESTALPHA +
+ + +

Blend factor is (Rd, Gd, Bd, Ad).

+
+ + bb172508 + D3DBLEND_DESTCOLOR + D3DBLEND_DESTCOLOR +
+ + +

Blend factor is (1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad).

+
+ + bb172508 + D3DBLEND_INVDESTCOLOR + D3DBLEND_INVDESTCOLOR +
+ + +

Blend factor is (f, f, f, 1); where f = min(As, 1 - Ad).

+
+ + bb172508 + D3DBLEND_SRCALPHASAT + D3DBLEND_SRCALPHASAT +
+ + +

Obsolete. Starting with DirectX 6, you can achieve the same effect by setting the source and destination blend factors to and in separate calls.

+
+ + bb172508 + D3DBLEND_BOTHSRCALPHA + D3DBLEND_BOTHSRCALPHA +
+ + +

Obsolete. Source blend factor is (1 - As, 1 - As, 1 - As, 1 - As), and destination blend factor is (As, As, As, As); the destination blend selection is overridden. This blend mode is supported only for the render state.

+
+ + bb172508 + D3DBLEND_BOTHINVSRCALPHA + D3DBLEND_BOTHINVSRCALPHA +
+ + +

Constant color blending factor used by the frame-buffer blender. This blend mode is supported only if is set in the SrcBlendCaps or DestBlendCaps members of .

+
+ + bb172508 + D3DBLEND_BLENDFACTOR + D3DBLEND_BLENDFACTOR +
+ + +

Inverted constant color-blending factor used by the frame-buffer blender. This blend mode is supported only if the bit is set in the SrcBlendCaps or DestBlendCaps members of .

+
+ + bb172508 + D3DBLEND_INVBLENDFACTOR + D3DBLEND_INVBLENDFACTOR +
+ + +

Blend factor is (PSOutColor[1]r, PSOutColor[1]g, PSOutColor[1]b, not used). See Render.

Differences between Direct3D 9 and Direct3D 9Ex:

This flag is available in Direct3D 9Ex only.

?

+
+ + bb172508 + D3DBLEND_SRCCOLOR2 + D3DBLEND_SRCCOLOR2 +
+ + +

Blend factor is (1 - PSOutColor[1]r, 1 - PSOutColor[1]g, 1 - PSOutColor[1]b, not used)). See Render.

Differences between Direct3D 9 and Direct3D 9Ex:

This flag is available in Direct3D 9Ex only.

?

+
+ + bb172508 + D3DBLEND_INVSRCCOLOR2 + D3DBLEND_INVSRCCOLOR2 +
+ + +

Represents the capabilities of the hardware exposed through the Direct3D object.

+
+ +

The MaxTextureBlendStages and MaxSimultaneousTextures members might seem similar, but they contain different information. The MaxTextureBlendStages member contains the total number of texture-blending stages supported by the current device, and the MaxSimultaneousTextures member describes how many of those stages can have textures bound to them by using the SetTexture method.

When the driver fills this structure, it can set values for execute-buffer capabilities, even when the interface being used to retrieve the capabilities (such as ) does not support execute buffers.

In general, performance problems may occur if you use a texture and then modify it during a scene. Ensure that no texture used in the current BeginScene and EndScene block is evicted unless absolutely necessary. In the case of extremely high texture usage within a scene, the results are undefined. This occurs when you modify a texture that you have used in the scene and there is no spare texture memory available. For such systems, the contents of the z-buffer become invalid at EndScene. Applications should not call UpdateSurface to or from the back buffer on this type of hardware inside a BeginScene/EndScene pair. In addition, applications should not try to access the z-buffer if the capability flag is set. Finally, applications should not lock the back buffer or the z-buffer inside a BeginScene/EndScene pair.

The following flags concerning mipmapped textures are not supported in Direct3D 9.

  • D3DPTFILTERCAPS_LINEAR
  • D3DPTFILTERCAPS_LINEARMIPLINEAR
  • D3DPTFILTERCAPS_LINEARMIPNEAREST
  • D3DPTFILTERCAPS_MIPNEAREST
  • D3DPTFILTERCAPS_NEAREST
+
+ + bb172513 + D3DPBLENDCAPS + D3DPBLENDCAPS +
+ + +

Member of the enumerated type, which identifies what type of resources are used for processing vertices.

+
+ + bb172513 + D3DPBLENDCAPS_ZERO + D3DPBLENDCAPS_ZERO +
+ + +

Adapter on which this Direct3D device was created. This ordinal is valid only to pass to methods of the interface that created this Direct3D device. The interface can always be retrieved by calling GetDirect3D.

+
+ + bb172513 + D3DPBLENDCAPS_ONE + D3DPBLENDCAPS_ONE +
+ + +

The following driver-specific capability.

ValueMeaning

Display hardware is capable of returning the current scan line.

The display driver supports an overlay DDI that allows for verification of overlay capabilities. For more information about the overlay DDI, see Overlay DDI.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

?

+
+ + bb172513 + D3DPBLENDCAPS_SRCCOLOR + D3DPBLENDCAPS_SRCCOLOR +
+ + +

Driver-specific capabilities identified in .

+
+ + bb172513 + D3DPBLENDCAPS_INVSRCCOLOR + D3DPBLENDCAPS_INVSRCCOLOR +
+ + +

Driver-specific capabilities identified in .

+
+ + bb172513 + D3DPBLENDCAPS_SRCALPHA + D3DPBLENDCAPS_SRCALPHA +
+ + +

Bit mask of values representing what presentation swap intervals are available.

ValueMeaning

The driver supports an immediate presentation swap interval.

The driver supports a presentation swap interval of every screen refresh.

The driver supports a presentation swap interval of every second screen refresh.

The driver supports a presentation swap interval of every third screen refresh.

The driver supports a presentation swap interval of every fourth screen refresh.

?

+
+ + bb172513 + D3DPBLENDCAPS_INVSRCALPHA + D3DPBLENDCAPS_INVSRCALPHA +
+ + +

Bit mask indicating what hardware support is available for cursors. Direct3D 9 does not define alpha-blending cursor capabilities.

ValueMeaning

A full-color cursor is supported in hardware. Specifically, this flag indicates that the driver supports at least a hardware color cursor in high-resolution modes (with scan lines greater than or equal to 400).

A full-color cursor is supported in hardware. Specifically, this flag indicates that the driver supports a hardware color cursor in both high-resolution and low-resolution modes (with scan lines less than 400).

?

+
+ + bb172513 + D3DPBLENDCAPS_DESTALPHA + D3DPBLENDCAPS_DESTALPHA +
+ + +

Flags identifying the capabilities of the device.

ValueMeaning

Device supports blits from system-memory textures to nonlocal video-memory textures.

Device can queue rendering commands after a page flip. Applications do not change their behavior if this flag is set; this capability means that the device is relatively fast.

Device can support at least a DirectX 5-compliant driver.

Device can support at least a DirectX 7-compliant driver.

Device exports an -aware hal.

Device can use execute buffers from system memory.

Device can use execute buffers from video memory.

Device has hardware acceleration for scene rasterization.

Device can support transformation and lighting in hardware.

Device supports N patches.

Device can support rasterization, transform, lighting, and shading in hardware.

Device supports quintic B?zier curves and B-splines.

Device supports rectangular and triangular patches.

When this device capability is set, the hardware architecture does not require caching of any information, and uncached patches (handle zero) will be drawn as efficiently as cached ones. Note that setting does not mean that a patch with handle zero can be drawn. A handle-zero patch can always be drawn whether this cap is set or not.

Device is texturing from separate memory pools.

Device can retrieve textures from non-local video memory.

Device can retrieve textures from system memory.

Device can retrieve textures from device memory.

Device can use buffers from system memory for transformed and lit vertices.

Device can use buffers from video memory for transformed and lit vertices.

?

+
+ + bb172513 + D3DPBLENDCAPS_INVDESTALPHA + D3DPBLENDCAPS_INVDESTALPHA +
+ + +

Miscellaneous driver primitive capabilities. See .

+
+ + bb172513 + D3DPBLENDCAPS_DESTCOLOR + D3DPBLENDCAPS_DESTCOLOR +
+ + +

Information on raster-drawing capabilities. This member can be one or more of the following flags.

ValueMeaning

Device supports anisotropic filtering.

Device iterates colors perspective correctly.

Device can dither to improve color resolution.

Device supports legacy depth bias. For true depth bias, see .

Device supports range-based fog. In range-based fog, the distance of an object from the viewer is used to compute fog effects, not the depth of the object (that is, the z-coordinate) in the scene.

Device calculates the fog value by referring to a lookup table containing fog values that are indexed to the depth of a given pixel.

Device calculates the fog value during the lighting operation and interpolates the fog value during rasterization.

Device supports level-of-detail bias adjustments. These bias adjustments enable an application to make a mipmap appear crisper or less sharp than it normally would. For more information about level-of-detail bias in mipmaps, see .

Device supports toggling multisampling on and off between and (using ).

Device supports scissor test. See Scissor Test (Direct3D 9).

Device performs true slope-scale based depth bias. This is in contrast to the legacy style depth bias.

Device supports depth buffering using w.

Device supports w-based fog. W-based fog is used when a perspective projection matrix is specified, but affine projections still use z-based fog. The system considers a projection matrix that contains a nonzero value in the [3][4] element to be a perspective projection matrix.

Device can perform hidden-surface removal (HSR) without requiring the application to sort polygons and without requiring the allocation of a depth-buffer. This leaves more video memory for textures. The method used to perform HSR is hardware-dependent and is transparent to the application.

Z-bufferless HSR is performed if no depth-buffer surface is associated with the rendering-target surface and the depth-buffer comparison test is enabled (that is, when the state value associated with the enumeration constant is set to TRUE).

Device supports z-based fog.

Device can perform z-test operations. This effectively renders a primitive and indicates whether any z pixels have been rendered.

?

+
+ + bb172513 + D3DPBLENDCAPS_INVDESTCOLOR + D3DPBLENDCAPS_INVDESTCOLOR +
+ + +

Z-buffer comparison capabilities. This member can be one or more of the following flags.

ValueMeaning

Always pass the z-test.

Pass the z-test if the new z equals the current z.

Pass the z-test if the new z is greater than the current z.

Pass the z-test if the new z is greater than or equal to the current z.

Pass the z-test if the new z is less than the current z.

Pass the z-test if the new z is less than or equal to the current z.

Always fail the z-test.

Pass the z-test if the new z does not equal the current z.

?

+
+ + bb172513 + D3DPBLENDCAPS_SRCALPHASAT + D3DPBLENDCAPS_SRCALPHASAT +
+ + +

Source-blending capabilities. This member can be one or more of the following flags. (The RGBA values of the source and destination are indicated by the subscripts s and d.)

ValueMeaning

The driver supports both and . See .

Source blend factor is (1 - As, 1 - As, 1 - As, 1 - As) and destination blend factor is (As, As, As, As); the destination blend selection is overridden.

The driver supports the blend mode. (This blend mode is obsolete. For more information, see .)

Blend factor is (Ad, Ad, Ad, Ad).

Blend factor is (Rd, Gd, Bd, Ad).

Blend factor is (1 - Ad, 1 - Ad, 1 - Ad, 1 - Ad).

Blend factor is (1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad).

Blend factor is (1 - As, 1 - As, 1 - As, 1 - As).

Blend factor is (1 - Rs, 1 - Gs, 1 - Bs, 1 - As).

Blend factor is (1 - PSOutColor[1]r, 1 - PSOutColor[1]g, 1 - PSOutColor[1]b, not used)). See Render Target Blending.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

Blend factor is (1, 1, 1, 1).

Blend factor is (As, As, As, As).

Blend factor is (f, f, f, 1); f = min(As, 1 - Ad).

Blend factor is (Rs, Gs, Bs, As).

Blend factor is (PSOutColor[1]r, PSOutColor[1]g, PSOutColor[1]b, not used). See Render Target Blending.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

Blend factor is (0, 0, 0, 0).

?

+
+ + bb172513 + D3DPBLENDCAPS_BOTHSRCALPHA + D3DPBLENDCAPS_BOTHSRCALPHA +
+ + +

Destination-blending capabilities. This member can be the same capabilities that are defined for the SrcBlendCaps member.

+
+ + bb172513 + D3DPBLENDCAPS_BOTHINVSRCALPHA + D3DPBLENDCAPS_BOTHINVSRCALPHA +
+ + +

Alpha-test comparison capabilities. This member can include the same capability flags defined for the ZCmpCaps member. If this member contains only the capability or only the capability, the driver does not support alpha tests. Otherwise, the flags identify the individual comparisons that are supported for alpha testing.

+
+ + bb172513 + D3DPBLENDCAPS_BLENDFACTOR + D3DPBLENDCAPS_BLENDFACTOR +
+ + +

Shading operations capabilities. It is assumed, in general, that if a device supports a given command at all, it supports the mode (as specified in the enumerated type). This flag specifies whether the driver can also support Gouraud shading and whether alpha color components are supported. When alpha components are not supported, the alpha value of colors generated is implicitly 255. This is the maximum possible alpha (that is, the alpha component is at full intensity).

The color, specular highlights, fog, and alpha interpolants of a triangle each have capability flags that an application can use to find out how they are implemented by the device driver.

This member can be one or more of the following flags.

ValueMeaning

Device can support an alpha component for Gouraud-blended transparency (the state for the enumerated type). In this mode, the alpha color component of a primitive is provided at vertices and interpolated across a face along with the other color components.

Device can support colored Gouraud shading. In this mode, the per-vertex color components (red, green, and blue) are interpolated across a triangle face.

Device can support fog in the Gouraud shading mode.

Device supports Gouraud shading of specular highlights.

?

+
+ + bb172513 + D3DPBLENDCAPS_SRCCOLOR2 + D3DPBLENDCAPS_SRCCOLOR2 +
+ + +

Miscellaneous texture-mapping capabilities. This member can be one or more of the following flags.

ValueMeaning

Alpha in texture pixels is supported.

Device can draw alpha from texture palettes.

Supports cube textures.

Device requires that cube texture maps have dimensions specified as powers of two.

Device supports mipmapped cube textures.

Device supports mipmapped textures.

Device supports mipmapped volume textures.

is also set, conditionally supports the use of 2D textures with dimensions that are not powers of two. A device that exposes this capability can use such a texture if all of the following requirements are met.

  • The texture addressing mode for the texture stage is set to .
  • Texture wrapping for the texture stage is disabled (D3DRS_WRAP n set to 0).
  • Mipmapping is not in use (use magnification filter only).
  • Texture formats must not be through .

If this flag is not set, and is also not set, then unconditional support is provided for 2D textures with dimensions that are not powers of two.

A texture that is not a power of two cannot be set at a stage that will be read based on a shader computation (such as the bem - ps and texm3x3 - ps instructions in pixel shaders versions 1_0 to 1_3). For example, these textures can be used to store bumps that will be fed into texture reads, but not the environment maps that are used in texbem - ps, texbeml - ps, and texm3x3spec - ps. This means that a texture with dimensions that are not powers of two cannot be addressed or sampled using texture coordinates computed within the shader. This type of operation is known as a dependent read and cannot be performed on these types of textures.

Device does not support a projected bump-environment loopkup operation in programmable and fixed function shaders.

Perspective correction texturing is supported.

If is not set, all textures must have widths and heights specified as powers of two. This requirement does not apply to either cube textures or volume textures.

If is also set, conditionally supports the use of 2D textures with dimensions that are not powers of two. See description.

If this flag is not set, and is also not set, then unconditional support is provided for 2D textures with dimensions that are not powers of two.

Supports the texture transformation flag. When applied, the device divides transformed texture coordinates by the last texture coordinate. If this capability is present, then the projective divide occurs per pixel. If this capability is not present, but the projective divide needs to occur anyway, then it is performed on a per-vertex basis by the Direct3D runtime.

All textures must be square.

Texture indices are not scaled by the texture size prior to interpolation.

Device supports volume textures.

Device requires that volume texture maps have dimensions specified as powers of two.

?

+
+ + bb172513 + D3DPBLENDCAPS_INVSRCCOLOR2 + D3DPBLENDCAPS_INVSRCCOLOR2 +
+ + +

Defines the supported blend operations. See Remarks for definitions of terms.

+
+ +

Source, Destination, and Result are defined as:

TermTypeDescription
SourceInputColor of the source pixel before the operation.
DestinationInputColor of the pixel in the destination buffer before the operation.
ResultOutputReturned value that is the blended color resulting from the operation.

?

This enumerated type defines values used by the following render states:

+
+ + bb172509 + D3DBLENDOP + D3DBLENDOP +
+ + +

The result is the destination added to the source. Result = Source + Destination

+
+ + bb172509 + D3DBLENDOP_ADD + D3DBLENDOP_ADD +
+ + +

The result is the destination subtracted from to the source. Result = Source - Destination

+
+ + bb172509 + D3DBLENDOP_SUBTRACT + D3DBLENDOP_SUBTRACT +
+ + +

The result is the source subtracted from the destination. Result = Destination - Source

+
+ + bb172509 + D3DBLENDOP_REVSUBTRACT + D3DBLENDOP_REVSUBTRACT +
+ + +

The result is the minimum of the source and destination. Result = MIN(Source, Destination)

+
+ + bb172509 + D3DBLENDOP_MIN + D3DBLENDOP_MIN +
+ + +

The result is the maximum of the source and destination. Result = MAX(Source, Destination)

+
+ + bb172509 + D3DBLENDOP_MAX + D3DBLENDOP_MAX +
+ + +

Flags used to obtain callback information.

+
+ + bb172714 + D3DXCALLBACK_SEARCH_FLAGS + D3DXCALLBACK_SEARCH_FLAGS +
+ + +

Exclude callbacks located at the initial position from the search.

+
+ + bb172714 + D3DXCALLBACK_SEARCH_EXCLUDING_INITIAL_POSITION + D3DXCALLBACK_SEARCH_EXCLUDING_INITIAL_POSITION +
+ + +

Reverse the callback search direction.

+
+ + bb172714 + D3DXCALLBACK_SEARCH_BEHIND_INITIAL_POSITION + D3DXCALLBACK_SEARCH_BEHIND_INITIAL_POSITION +
+ + +

Obsolete in DirectX 8.0 and later versions; see Remarks.

The D3DLIGHTINGCAPS structure describes the lighting capabilities of a device.

+
+ +

This structure has been replaced by D3DCAPS8 (see the DirectX 8.0 SDK documentation) for DirectX 8.0 and later runtimes, but is required for DirectX 7.0 and earlier runtime compatibility. See Reporting DirectX 8.0 Style Direct3D Capabilities for details.

This structure is a member of the D3DDEVICEDESC_V1 structure.

+
+ + ff548471 + D3DCAPS + D3DCAPS +
+ + +

Specifies the size, in bytes, of the D3DLIGHTINGCAPS structure.

+
+ + ff548471 + D3DCAPS_OVERLAY + D3DCAPS_OVERLAY +
+ + +

Specifies flags describing the capabilities of the lighting module. The following flags are defined:

ValueMeaning
D3DLIGHTCAPS_DIRECTIONALDirectional lights are supported. +
D3DLIGHTCAPS_GLSPOTOpenGL-style spotlights are supported.
D3DLIGHTCAPS_PARALLELPOINTParallel-point lights are supported.
D3DLIGHTCAPS_POINTPoint lights are supported.
D3DLIGHTCAPS_SPOTSpotlights are supported. +

?

+
+ + ff548471 + D3DCAPS_READ_SCANLINE + D3DCAPS_READ_SCANLINE +
+ + + None. + + + None + None + + + +

Driver capability flags.

+
+ + bb172511 + D3DCAPS2 + D3DCAPS2 +
+ + + No documentation. + + + bb172511 + D3DCAPS2_FULLSCREENGAMMA + D3DCAPS2_FULLSCREENGAMMA + + + + No documentation. + + + bb172511 + D3DCAPS2_CANCALIBRATEGAMMA + D3DCAPS2_CANCALIBRATEGAMMA + + + + No documentation. + + + bb172511 + D3DCAPS2_CANMANAGERESOURCE + D3DCAPS2_CANMANAGERESOURCE + + + + No documentation. + + + bb172511 + D3DCAPS2_DYNAMICTEXTURES + D3DCAPS2_DYNAMICTEXTURES + + + + No documentation. + + + bb172511 + D3DCAPS2_CANAUTOGENMIPMAP + D3DCAPS2_CANAUTOGENMIPMAP + + + + No documentation. + + + bb172511 + D3DCAPS2_CANSHARERESOURCE + D3DCAPS2_CANSHARERESOURCE + + + + None. + + + None + None + + + +

Driver capability flags.

+
+ + bb172512 + D3DCAPS3 + D3DCAPS3 +
+ + + No documentation. + + + bb172512 + D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD + D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD + + + + No documentation. + + + bb172512 + D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION + D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION + + + + No documentation. + + + bb172512 + D3DCAPS3_COPY_TO_VIDMEM + D3DCAPS3_COPY_TO_VIDMEM + + + + No documentation. + + + bb172512 + D3DCAPS3_COPY_TO_SYSTEMMEM + D3DCAPS3_COPY_TO_SYSTEMMEM + + + + No documentation. + + + bb172512 + D3DCAPS3_DXVAHD + D3DCAPS3_DXVAHD + + + + None. + + + None + None + + + +

The following flags are used to specify which channels in a texture to operate on.

+
+ + bb205563 + D3DX_CHANNEL + D3DX_CHANNEL +
+ + + No documentation. + + + bb205563 + D3DX_CHANNEL_RED + D3DX_CHANNEL_RED + + + + No documentation. + + + bb205563 + D3DX_CHANNEL_BLUE + D3DX_CHANNEL_BLUE + + + + No documentation. + + + bb205563 + D3DX_CHANNEL_GREEN + D3DX_CHANNEL_GREEN + + + + No documentation. + + + bb205563 + D3DX_CHANNEL_ALPHA + D3DX_CHANNEL_ALPHA + + + + No documentation. + + + bb205563 + D3DX_CHANNEL_LUMINANCE + D3DX_CHANNEL_LUMINANCE + + + +

Defines operations to perform on vertices in preparation for mesh cleaning.

+
+ + bb172720 + D3DXCLEANTYPE + D3DXCLEANTYPE +
+ + +

Merge triangles that share the same vertex indices but have face normals pointing in opposite directions (back-facing triangles). Unless the triangles are not split by adding a replicated vertex, mesh adjacency data from the two triangles may conflict.

+
+ + bb172720 + D3DXCLEAN_BACKFACING + D3DXCLEAN_BACKFACING +
+ + +

If a vertex is the apex of two triangle fans (a bowtie) and mesh operations will affect one of the fans, then split the shared vertex into two new vertices. Bowties can cause problems for operations such as mesh simplification that remove vertices, because removing one vertex affects two distinct sets of triangles.

+
+ + bb172720 + D3DXCLEAN_BOWTIES + D3DXCLEAN_BOWTIES +
+ + +

Use this flag to prevent infinite loops during skinning setup mesh operations.

+
+ + bb172720 + D3DXCLEAN_SKINNING + D3DXCLEAN_SKINNING +
+ + +

Use this flag to prevent infinite loops during mesh optimization operations.

+
+ + bb172720 + D3DXCLEAN_OPTIMIZATION + D3DXCLEAN_OPTIMIZATION +
+ + +

Use this flag to prevent infinite loops during mesh simplification operations.

+
+ + bb172720 + D3DXCLEAN_SIMPLIFICATION + D3DXCLEAN_SIMPLIFICATION +
+ + +

These flags identify a surface to reset when calling Clear.

+
+ + bb172514 + D3DCLEAR + D3DCLEAR +
+ + + No documentation. + + + bb172514 + D3DCLEAR_TARGET + D3DCLEAR_TARGET + + + + No documentation. + + + bb172514 + D3DCLEAR_ZBUFFER + D3DCLEAR_ZBUFFER + + + + No documentation. + + + bb172514 + D3DCLEAR_STENCIL + D3DCLEAR_STENCIL + + + + No documentation. + + + bb172514 + D3DCLEAR_ALL + D3DCLEAR_ALL + + + + None. + + + None + None + + + +

Describes the current clip status.

+
+ +

When clipping is enabled during vertex processing (by ProcessVertices, DrawPrimitive, or other drawing functions), Direct3D computes a clip code for every vertex. The clip code is a combination of D3DCS_* bits. When a vertex is outside a particular clipping plane, the corresponding bit is set in the clipping code. Direct3D maintains the clip status using , which has ClipUnion and ClipIntersection members. ClipUnion is a bitwise OR of all vertex clip codes and ClipIntersection is a bitwise AND of all vertex clip codes. Initial values are zero for ClipUnion and 0xFFFFFFFF for ClipIntersection. When is set to , ClipUnion and ClipIntersection are set to zero. Direct3D updates the clip status during drawing calls. To compute clip status for a particular object, set ClipUnion and ClipIntersection to their initial value and continue drawing.

Clip status is not updated by DrawRectPatch and DrawTriPatch because there is no software emulation for them.

+
+ + bb172516 + D3DCS + D3DCS +
+ + +

Clip union flags that describe the current clip status. This member can be one or more of the following flags:

ValueMeaning

Combination of all clip flags.

All vertices are clipped by the left plane of the viewing frustum.

All vertices are clipped by the right plane of the viewing frustum.

All vertices are clipped by the top plane of the viewing frustum.

All vertices are clipped by the bottom plane of the viewing frustum.

All vertices are clipped by the front plane of the viewing frustum.

All vertices are clipped by the back plane of the viewing frustum.

Application-defined clipping planes.

Application-defined clipping planes.

Application-defined clipping planes.

Application-defined clipping planes.

Application-defined clipping planes.

Application-defined clipping planes.

?

+
+ + bb172516 + D3DCS_LEFT + D3DCS_LEFT +
+ + +

Clip intersection flags that describe the current clip status. This member can take the same flags as ClipUnion.

+
+ + bb172516 + D3DCS_RIGHT + D3DCS_RIGHT +
+ + + No documentation. + + + bb172516 + D3DCS_TOP + D3DCS_TOP + + + + No documentation. + + + bb172516 + D3DCS_BOTTOM + D3DCS_BOTTOM + + + + No documentation. + + + bb172516 + D3DCS_FRONT + D3DCS_FRONT + + + + No documentation. + + + bb172516 + D3DCS_BACK + D3DCS_BACK + + + + No documentation. + + + bb172516 + D3DCS_PLANE0 + D3DCS_PLANE0 + + + + No documentation. + + + bb172516 + D3DCS_PLANE1 + D3DCS_PLANE1 + + + + No documentation. + + + bb172516 + D3DCS_PLANE2 + D3DCS_PLANE2 + + + + No documentation. + + + bb172516 + D3DCS_PLANE3 + D3DCS_PLANE3 + + + + No documentation. + + + bb172516 + D3DCS_PLANE4 + D3DCS_PLANE4 + + + + No documentation. + + + bb172516 + D3DCS_PLANE5 + D3DCS_PLANE5 + + + + No documentation. + + + bb172516 + D3DCS_ALL + D3DCS_ALL + + + + No documentation. + + + D3DMATERIALCOLORSOURCE + D3DMATERIALCOLORSOURCE + + + + No documentation. + + + D3DMCS_MATERIAL + D3DMCS_MATERIAL + + + + No documentation. + + + D3DMCS_COLOR1 + D3DMCS_COLOR1 + + + + No documentation. + + + D3DMCS_COLOR2 + D3DMCS_COLOR2 + + + +

Render states define set-up states for all kinds of vertex and pixel processing. Some render states set up vertex processing, and some set up pixel processing (see Render States (Direct3D 9)). Render states can be saved and restored using stateblocks (see State Blocks Save and Restore State (Direct3D 9)).

+
+ +
Render States
ps_1_1 to ps_1_34 texture samplers

?

Direct3D defines the D3DRENDERSTATE_WRAPBIAS constant as a convenience for applications to enable or disable texture wrapping, based on the zero-based integer of a texture coordinate set (rather than explicitly using one of the D3DRS_WRAP n state values). Add the D3DRENDERSTATE_WRAPBIAS value to the zero-based index of a texture coordinate set to calculate the D3DRS_WRAP n value that corresponds to that index, as shown in the following example.

 // Enable U/V wrapping for textures that use the texture 	
+            // coordinate set at the index within the dwIndex variable  hr = pd3dDevice->SetRenderState(	
+            dwIndex + D3DRENDERSTATE_WRAPBIAS,  	
+             | ); // If dwIndex is 3, the value that results from 	
+            // the addition equals  (131)	
+            
+
+ + bb172599 + D3DCOLORWRITEENABLE + D3DCOLORWRITEENABLE +
+ + + No documentation. + + + bb172599 + D3DCOLORWRITEENABLE_RED + D3DCOLORWRITEENABLE_RED + + + + No documentation. + + + bb172599 + D3DCOLORWRITEENABLE_GREEN + D3DCOLORWRITEENABLE_GREEN + + + + No documentation. + + + bb172599 + D3DCOLORWRITEENABLE_BLUE + D3DCOLORWRITEENABLE_BLUE + + + + No documentation. + + + bb172599 + D3DCOLORWRITEENABLE_ALPHA + D3DCOLORWRITEENABLE_ALPHA + + + +

Defines the supported compare functions.

+
+ +

The values in this enumerated type define the supported compare functions for the , , and render states.

+
+ + bb172517 + D3DCMPFUNC + D3DCMPFUNC +
+ + +

Always fail the test.

+
+ + bb172517 + D3DCMP_NEVER + D3DCMP_NEVER +
+ + +

Accept the new pixel if its value is less than the value of the current pixel.

+
+ + bb172517 + D3DCMP_LESS + D3DCMP_LESS +
+ + +

Accept the new pixel if its value equals the value of the current pixel.

+
+ + bb172517 + D3DCMP_EQUAL + D3DCMP_EQUAL +
+ + +

Accept the new pixel if its value is less than or equal to the value of the current pixel.

+
+ + bb172517 + D3DCMP_LESSEQUAL + D3DCMP_LESSEQUAL +
+ + +

Accept the new pixel if its value is greater than the value of the current pixel.

+
+ + bb172517 + D3DCMP_GREATER + D3DCMP_GREATER +
+ + +

Accept the new pixel if its value does not equal the value of the current pixel.

+
+ + bb172517 + D3DCMP_NOTEQUAL + D3DCMP_NOTEQUAL +
+ + +

Accept the new pixel if its value is greater than or equal to the value of the current pixel.

+
+ + bb172517 + D3DCMP_GREATEREQUAL + D3DCMP_GREATEREQUAL +
+ + +

Always pass the test.

+
+ + bb172517 + D3DCMP_ALWAYS + D3DCMP_ALWAYS +
+ + +

C++ applications can use alpha testing to control when pixels are written to the render-target surface. By using the render state, your application sets the current Direct3D device so that it tests each pixel according to an alpha test function. If the test succeeds, the pixel is written to the surface. If it does not, Direct3D ignores the pixel. Select the alpha test function with the render state. Your application can set a reference alpha value for all pixels to compare against by using the render state.

The most common use for alpha testing is to improve performance when rasterizing objects that are nearly transparent. If the color data being rasterized is more opaque than the color at a given pixel (), then the pixel is written. Otherwise, the rasterizer ignores the pixel altogether, saving the processing required to blend the two colors. The following code example checks if a given comparison function is supported and, if so, it sets the comparison function parameters required to improve performance during rendering.

 // This code example assumes that pCaps is a	
+            //  structure that was filled with a 	
+            // previous call to . if (pCaps.AlphaCmpCaps & )	
+            { dev->SetRenderState(, (DWORD)0x00000001); dev->SetRenderState(, TRUE);  dev->SetRenderState(, );	
+            } // If the comparison is not supported, render anyway. 	
+            // The only drawback is no performance gain.	
+            

Not all hardware supports all alpha-testing features. You can check the device capabilities by calling the method. After retrieving the device capabilities, check the associated structure's AlphaCmpCaps member for the desired comparison function. If the AlphaCmpCaps member contains only the capability or only the capability, the driver does not support alpha tests.

?

?

+
+ + bb172254 + D3DPCMPCAPS + D3DPCMPCAPS +
+ + + No documentation. + + + bb172254 + D3DPCMPCAPS_NEVER + D3DPCMPCAPS_NEVER + + + + No documentation. + + + bb172254 + D3DPCMPCAPS_LESS + D3DPCMPCAPS_LESS + + + + No documentation. + + + bb172254 + D3DPCMPCAPS_EQUAL + D3DPCMPCAPS_EQUAL + + + + No documentation. + + + bb172254 + D3DPCMPCAPS_LESSEQUAL + D3DPCMPCAPS_LESSEQUAL + + + + No documentation. + + + bb172254 + D3DPCMPCAPS_GREATER + D3DPCMPCAPS_GREATER + + + + No documentation. + + + bb172254 + D3DPCMPCAPS_NOTEQUAL + D3DPCMPCAPS_NOTEQUAL + + + + No documentation. + + + bb172254 + D3DPCMPCAPS_GREATEREQUAL + D3DPCMPCAPS_GREATEREQUAL + + + + No documentation. + + + bb172254 + D3DPCMPCAPS_ALWAYS + D3DPCMPCAPS_ALWAYS + + + +

Specifies how to combine the glyph data from the source and destination surfaces in a call to ComposeRects.

+
+ + bb509546 + D3DCOMPOSERECTSOP + D3DCOMPOSERECTSOP +
+ + + No documentation. + + + bb509546 + D3DCOMPOSERECTS_COPY + D3DCOMPOSERECTS_COPY + + + + No documentation. + + + bb509546 + D3DCOMPOSERECTS_OR + D3DCOMPOSERECTS_OR + + + + No documentation. + + + bb509546 + D3DCOMPOSERECTS_AND + D3DCOMPOSERECTS_AND + + + + No documentation. + + + bb509546 + D3DCOMPOSERECTS_NEG + D3DCOMPOSERECTS_NEG + + + +

Defines the compression mode used for storing compressed animation set data.

+
+ + bb172734 + D3DXCOMPRESSION_FLAGS + D3DXCOMPRESSION_FLAGS +
+ + +

Implements fast compression.

+
+ + bb172734 + D3DXCOMPRESS_DEFAULT + D3DXCOMPRESS_DEFAULT +
+ + +

A combination of one or more flags that control the device create behavior.

+
+ + bb172527 + D3DCREATE + D3DCREATE +
+ + + No documentation. + + + bb172527 + D3DCREATE_FPU_PRESERVE + D3DCREATE_FPU_PRESERVE + + + + No documentation. + + + bb172527 + D3DCREATE_MULTITHREADED + D3DCREATE_MULTITHREADED + + + + No documentation. + + + bb172527 + D3DCREATE_PUREDEVICE + D3DCREATE_PUREDEVICE + + + + No documentation. + + + bb172527 + D3DCREATE_SOFTWARE_VERTEXPROCESSING + D3DCREATE_SOFTWARE_VERTEXPROCESSING + + + + No documentation. + + + bb172527 + D3DCREATE_HARDWARE_VERTEXPROCESSING + D3DCREATE_HARDWARE_VERTEXPROCESSING + + + + No documentation. + + + bb172527 + D3DCREATE_MIXED_VERTEXPROCESSING + D3DCREATE_MIXED_VERTEXPROCESSING + + + + No documentation. + + + bb172527 + D3DCREATE_DISABLE_DRIVER_MANAGEMENT + D3DCREATE_DISABLE_DRIVER_MANAGEMENT + + + + No documentation. + + + bb172527 + D3DCREATE_ADAPTERGROUP_DEVICE + D3DCREATE_ADAPTERGROUP_DEVICE + + + + No documentation. + + + bb172527 + D3DCREATE_DISABLE_DRIVER_MANAGEMENT_EX + D3DCREATE_DISABLE_DRIVER_MANAGEMENT_EX + + + + No documentation. + + + bb172527 + D3DCREATE_NOWINDOWCHANGES + D3DCREATE_NOWINDOWCHANGES + + + + No documentation. + + + bb172527 + D3DCREATE_DISABLE_PSGP_THREADING + D3DCREATE_DISABLE_PSGP_THREADING + + + + No documentation. + + + bb172527 + D3DCREATE_ENABLE_PRESENTSTATS + D3DCREATE_ENABLE_PRESENTSTATS + + + + No documentation. + + + bb172527 + D3DCREATE_DISABLE_PRINTSCREEN + D3DCREATE_DISABLE_PRINTSCREEN + + + + No documentation. + + + bb172527 + D3DCREATE_SCREENSAVER + D3DCREATE_SCREENSAVER + + + + None. + + + None + None + + + +

Defines the faces of a cubemap.

+
+ + bb172528 + D3DCUBEMAP_FACES + D3DCUBEMAP_FACES +
+ + +

Positive x-face of the cubemap.

+
+ + bb172528 + D3DCUBEMAP_FACE_POSITIVE_X + D3DCUBEMAP_FACE_POSITIVE_X +
+ + +

Negative x-face of the cubemap.

+
+ + bb172528 + D3DCUBEMAP_FACE_NEGATIVE_X + D3DCUBEMAP_FACE_NEGATIVE_X +
+ + +

Positive y-face of the cubemap.

+
+ + bb172528 + D3DCUBEMAP_FACE_POSITIVE_Y + D3DCUBEMAP_FACE_POSITIVE_Y +
+ + +

Negative y-face of the cubemap.

+
+ + bb172528 + D3DCUBEMAP_FACE_NEGATIVE_Y + D3DCUBEMAP_FACE_NEGATIVE_Y +
+ + +

Positive z-face of the cubemap.

+
+ + bb172528 + D3DCUBEMAP_FACE_POSITIVE_Z + D3DCUBEMAP_FACE_POSITIVE_Z +
+ + +

Negative z-face of the cubemap.

+
+ + bb172528 + D3DCUBEMAP_FACE_NEGATIVE_Z + D3DCUBEMAP_FACE_NEGATIVE_Z +
+ + +

Defines the supported culling modes.

+
+ +

The values in this enumerated type are used by the render state. The culling modes define how back faces are culled when rendering a geometry.

+
+ + bb172529 + D3DCULL + D3DCULL +
+ + +

Do not cull back faces.

+
+ + bb172529 + D3DCULL_NONE + D3DCULL_NONE +
+ + +

Cull back faces with clockwise vertices.

+
+ + bb172529 + D3DCULL_CW + D3DCULL_CW +
+ + +

Cull back faces with counterclockwise vertices.

+
+ + bb172529 + D3DCULL_CCW + D3DCULL_CCW +
+ + +

Driver cursor capability flags.

+
+ + bb172530 + D3DCURSORCAPS + D3DCURSORCAPS +
+ + + No documentation. + + + bb172530 + D3DCURSORCAPS_COLOR + D3DCURSORCAPS_COLOR + + + + No documentation. + + + bb172530 + D3DCURSORCAPS_LOWRES + D3DCURSORCAPS_LOWRES + + + + No documentation. + + + D3DDEBUGMONITORTOKENS + D3DDEBUGMONITORTOKENS + + + + No documentation. + + + D3DDMT_ENABLE + D3DDMT_ENABLE + + + + No documentation. + + + D3DDMT_DISABLE + D3DDMT_DISABLE + + + +

Defines the vertex declaration method which is a predefined operation performed by the tessellator (or any procedural geometry routine on the vertex data during tessellation).

+
+ +

The tessellator looks at the method to determine what data to calculate from the vertex data during tessellation. Mesh data should use the default value. Patches can use any of the other implemented types.

Vertex data is declared with an array of structures. Each element in the array contains a vertex declaration method.

In addition to using , a normal mesh can use and methods when N-patches are enabled.

+
+ + bb172532 + D3DDECLMETHOD + D3DDECLMETHOD +
+ + +

Default value. The tessellator copies the vertex data (spline data for patches) as is, with no additional calculations. When the tessellator is used, this element is interpolated. Otherwise vertex data is copied into the input register. The input and output type can be any value, but are always the same type.

+
+ + bb172532 + D3DDECLMETHOD_DEFAULT + D3DDECLMETHOD_DEFAULT +
+ + +

Computes the tangent at a point on the rectangle or triangle patch in the U direction. The input type can be one of the following: +

The output type is always .

+
+ + bb172532 + D3DDECLMETHOD_PARTIALU + D3DDECLMETHOD_PARTIALU +
+ + +

Computes the tangent at a point on the rectangle or triangle patch in the V direction. The input type can be one of the following: +

The output type is always .

+
+ + bb172532 + D3DDECLMETHOD_PARTIALV + D3DDECLMETHOD_PARTIALV +
+ + +

Computes the normal at a point on the rectangle or triangle patch by taking the cross product of two tangents. The input type can be one of the following: +

The output type is always .

+
+ + bb172532 + D3DDECLMETHOD_CROSSUV + D3DDECLMETHOD_CROSSUV +
+ + +

Copy out the U, V values at a point on the rectangle or triangle patch. This results in a 2D float. The input type must be set to . The output data type is always . The input stream and offset are also unused (but must be set to 0).

+
+ + bb172532 + D3DDECLMETHOD_UV + D3DDECLMETHOD_UV +
+ + +

Look up a displacement map. The input type can be one of the following: +

Only the .x and .y components are used for the texture map lookup. The output type is always . The device must support displacement mapping. For more information about displacement mapping, see Displacement Mapping (Direct3D 9). This constant is supported only by the programmable pipeline on N-patch data, if N-patches are enabled.

+
+ + bb172532 + D3DDECLMETHOD_LOOKUP + D3DDECLMETHOD_LOOKUP +
+ + +

Look up a presampled displacement map. The input type must be set to ; the stream index and the stream offset must be set to 0. The output type for this operation is always . The device must support displacement mapping. For more information about displacement mapping, see Displacement Mapping (Direct3D 9). This constant is supported only by the programmable pipeline on N-patch data, if N-patches are enabled. This method can be used only with .

+
+ + bb172532 + D3DDECLMETHOD_LOOKUPPRESAMPLED + D3DDECLMETHOD_LOOKUPPRESAMPLED +
+ + +

Defines a vertex declaration data type.

+
+ +

Vertex data is declared with an array of structures. Each element in the array contains a vertex declaration data type.

Use the DirectX Caps Viewer Tool tool to see which types are supported on your device.

+
+ + bb172533 + D3DDECLTYPE + D3DDECLTYPE +
+ + +

One-component float expanded to (float, 0, 0, 1).

+
+ + bb172533 + D3DDECLTYPE_FLOAT1 + D3DDECLTYPE_FLOAT1 +
+ + +

Two-component float expanded to (float, float, 0, 1).

+
+ + bb172533 + D3DDECLTYPE_FLOAT2 + D3DDECLTYPE_FLOAT2 +
+ + +

Three-component float expanded to (float, float, float, 1).

+
+ + bb172533 + D3DDECLTYPE_FLOAT3 + D3DDECLTYPE_FLOAT3 +
+ + +

Four-component float expanded to (float, float, float, float).

+
+ + bb172533 + D3DDECLTYPE_FLOAT4 + D3DDECLTYPE_FLOAT4 +
+ + +

Four-component, packed, unsigned bytes mapped to 0 to 1 range. Input is a and is expanded to RGBA order.

+
+ + bb172533 + D3DDECLTYPE_D3DCOLOR + D3DDECLTYPE_D3DCOLOR +
+ + +

Four-component, unsigned byte.

+
+ + bb172533 + D3DDECLTYPE_UBYTE4 + D3DDECLTYPE_UBYTE4 +
+ + +

Two-component, signed short expanded to (value, value, 0, 1).

+
+ + bb172533 + D3DDECLTYPE_SHORT2 + D3DDECLTYPE_SHORT2 +
+ + +

Four-component, signed short expanded to (value, value, value, value).

+
+ + bb172533 + D3DDECLTYPE_SHORT4 + D3DDECLTYPE_SHORT4 +
+ + +

Four-component byte with each byte normalized by dividing with 255.0f.

+
+ + bb172533 + D3DDECLTYPE_UBYTE4N + D3DDECLTYPE_UBYTE4N +
+ + +

Normalized, two-component, signed short, expanded to (first short/32767.0, second short/32767.0, 0, 1).

+
+ + bb172533 + D3DDECLTYPE_SHORT2N + D3DDECLTYPE_SHORT2N +
+ + +

Normalized, four-component, signed short, expanded to (first short/32767.0, second short/32767.0, third short/32767.0, fourth short/32767.0).

+
+ + bb172533 + D3DDECLTYPE_SHORT4N + D3DDECLTYPE_SHORT4N +
+ + +

Normalized, two-component, unsigned short, expanded to (first short/65535.0, short short/65535.0, 0, 1).

+
+ + bb172533 + D3DDECLTYPE_USHORT2N + D3DDECLTYPE_USHORT2N +
+ + +

Normalized, four-component, unsigned short, expanded to (first short/65535.0, second short/65535.0, third short/65535.0, fourth short/65535.0).

+
+ + bb172533 + D3DDECLTYPE_USHORT4N + D3DDECLTYPE_USHORT4N +
+ + +

Three-component, unsigned, 10 10 10 format expanded to (value, value, value, 1).

+
+ + bb172533 + D3DDECLTYPE_UDEC3 + D3DDECLTYPE_UDEC3 +
+ + +

Three-component, signed, 10 10 10 format normalized and expanded to (v[0]/511.0, v[1]/511.0, v[2]/511.0, 1).

+
+ + bb172533 + D3DDECLTYPE_DEC3N + D3DDECLTYPE_DEC3N +
+ + +

Two-component, 16-bit, floating point expanded to (value, value, 0, 1).

+
+ + bb172533 + D3DDECLTYPE_FLOAT16_2 + D3DDECLTYPE_FLOAT16_2 +
+ + +

Four-component, 16-bit, floating point expanded to (value, value, value, value).

+
+ + bb172533 + D3DDECLTYPE_FLOAT16_4 + D3DDECLTYPE_FLOAT16_4 +
+ + +

Type field in the declaration is unused. This is designed for use with and .

+
+ + bb172533 + D3DDECLTYPE_UNUSED + D3DDECLTYPE_UNUSED +
+ + +

Constants describing the vertex data types supported by a device.

+
+ + bb172552 + D3DDTCAPS + D3DDTCAPS +
+ + + No documentation. + + + bb172552 + D3DDTCAPS_UBYTE4 + D3DDTCAPS_UBYTE4 + + + + No documentation. + + + bb172552 + D3DDTCAPS_UBYTE4N + D3DDTCAPS_UBYTE4N + + + + No documentation. + + + bb172552 + D3DDTCAPS_SHORT2N + D3DDTCAPS_SHORT2N + + + + No documentation. + + + bb172552 + D3DDTCAPS_SHORT4N + D3DDTCAPS_SHORT4N + + + + No documentation. + + + bb172552 + D3DDTCAPS_USHORT2N + D3DDTCAPS_USHORT2N + + + + No documentation. + + + bb172552 + D3DDTCAPS_USHORT4N + D3DDTCAPS_USHORT4N + + + + No documentation. + + + bb172552 + D3DDTCAPS_UDEC3 + D3DDTCAPS_UDEC3 + + + + No documentation. + + + bb172552 + D3DDTCAPS_DEC3N + D3DDTCAPS_DEC3N + + + + No documentation. + + + bb172552 + D3DDTCAPS_FLOAT16_2 + D3DDTCAPS_FLOAT16_2 + + + + No documentation. + + + bb172552 + D3DDTCAPS_FLOAT16_4 + D3DDTCAPS_FLOAT16_4 + + + +

Identifies the intended use of vertex data.

+
+ +

Vertex data is declared with an array of structures. Each element in the array contains a usage type.

For more information about vertex declarations, see Vertex Declaration (Direct3D 9).

+
+ + bb172534 + D3DDECLUSAGE + D3DDECLUSAGE +
+ + +

Position data ranging from (-1,-1) to (1,1). Use with a usage index of 0 to specify untransformed position for fixed function vertex processing and the n-patch tessellator. Use with a usage index of 1 to specify untransformed position in the fixed function vertex shader for vertex tweening.

+
+ + bb172534 + D3DDECLUSAGE_POSITION + D3DDECLUSAGE_POSITION +
+ + +

Blending weight data. Use with a usage index of 0 to specify the blend weights used in indexed and nonindexed vertex blending.

+
+ + bb172534 + D3DDECLUSAGE_BLENDWEIGHT + D3DDECLUSAGE_BLENDWEIGHT +
+ + +

Blending indices data. Use with a usage index of 0 to specify matrix indices for indexed paletted skinning.

+
+ + bb172534 + D3DDECLUSAGE_BLENDINDICES + D3DDECLUSAGE_BLENDINDICES +
+ + +

Vertex normal data. Use with a usage index of 0 to specify vertex normals for fixed function vertex processing and the n-patch tessellator. Use with a usage index of 1 to specify vertex normals for fixed function vertex processing for vertex tweening.

+
+ + bb172534 + D3DDECLUSAGE_NORMAL + D3DDECLUSAGE_NORMAL +
+ + +

Point size data. Use with a usage index of 0 to specify the point-size attribute used by the setup engine of the rasterizer to expand a point into a quad for the point-sprite functionality.

+
+ + bb172534 + D3DDECLUSAGE_PSIZE + D3DDECLUSAGE_PSIZE +
+ + +

Texture coordinate data. Use , n to specify texture coordinates in fixed function vertex processing and in pixel shaders prior to ps_3_0. These can be used to pass user defined data.

+
+ + bb172534 + D3DDECLUSAGE_TEXCOORD + D3DDECLUSAGE_TEXCOORD +
+ + +

Vertex tangent data.

+
+ + bb172534 + D3DDECLUSAGE_TANGENT + D3DDECLUSAGE_TANGENT +
+ + +

Vertex binormal data.

+
+ + bb172534 + D3DDECLUSAGE_BINORMAL + D3DDECLUSAGE_BINORMAL +
+ + +

Single positive floating point value. Use with a usage index of 0 to specify a tessellation factor used in the tessellation unit to control the rate of tessellation. For more information about the data type, see .

+
+ + bb172534 + D3DDECLUSAGE_TESSFACTOR + D3DDECLUSAGE_TESSFACTOR +
+ + +

Vertex data contains transformed position data ranging from (0,0) to (viewport width, viewport height). Use with a usage index of 0 to specify transformed position. When a declaration containing this is set, the pipeline does not perform vertex processing.

+
+ + bb172534 + D3DDECLUSAGE_POSITIONT + D3DDECLUSAGE_POSITIONT +
+ + +

Vertex data contains diffuse or specular color. Use with a usage index of 0 to specify the diffuse color in the fixed function vertex shader and pixel shaders prior to ps_3_0. Use with a usage index of 1 to specify the specular color in the fixed function vertex shader and pixel shaders prior to ps_3_0.

+
+ + bb172534 + D3DDECLUSAGE_COLOR + D3DDECLUSAGE_COLOR +
+ + +

Vertex data contains fog data. Use with a usage index of 0 to specify a fog blend value used after pixel shading finishes. This applies to pixel shaders prior to version ps_3_0.

+
+ + bb172534 + D3DDECLUSAGE_FOG + D3DDECLUSAGE_FOG +
+ + +

Vertex data contains depth data.

+
+ + bb172534 + D3DDECLUSAGE_DEPTH + D3DDECLUSAGE_DEPTH +
+ + +

Vertex data contains sampler data. Use with a usage index of 0 to specify the displacement value to look up. It can be used only with D3DDECLUSAGE_LOOKUPPRESAMPLED or D3DDECLUSAGE_LOOKUP.

+
+ + bb172534 + D3DDECLUSAGE_SAMPLE + D3DDECLUSAGE_SAMPLE +
+ + +

Defines the degree of the variables in the equation that describes a curve.

+
+ +

The values in this enumeration are used to describe the curves used by rectangle and triangle patches. For more information, see .

+
+ + bb172536 + D3DDEGREETYPE + D3DDEGREETYPE +
+ + +

Curve is described by variables of first order.

+
+ + bb172536 + D3DDEGREE_LINEAR + D3DDEGREE_LINEAR +
+ + +

Curve is described by variables of second order.

+
+ + bb172536 + D3DDEGREE_QUADRATIC + D3DDEGREE_QUADRATIC +
+ + +

Curve is described by variables of third order.

+
+ + bb172536 + D3DDEGREE_CUBIC + D3DDEGREE_CUBIC +
+ + +

Curve is described by variables of fourth order.

+
+ + bb172536 + D3DDEGREE_QUINTIC + D3DDEGREE_QUINTIC +
+ + +

Represents the capabilities of the hardware exposed through the Direct3D object.

+
+ +

The MaxTextureBlendStages and MaxSimultaneousTextures members might seem similar, but they contain different information. The MaxTextureBlendStages member contains the total number of texture-blending stages supported by the current device, and the MaxSimultaneousTextures member describes how many of those stages can have textures bound to them by using the SetTexture method.

When the driver fills this structure, it can set values for execute-buffer capabilities, even when the interface being used to retrieve the capabilities (such as ) does not support execute buffers.

In general, performance problems may occur if you use a texture and then modify it during a scene. Ensure that no texture used in the current BeginScene and EndScene block is evicted unless absolutely necessary. In the case of extremely high texture usage within a scene, the results are undefined. This occurs when you modify a texture that you have used in the scene and there is no spare texture memory available. For such systems, the contents of the z-buffer become invalid at EndScene. Applications should not call UpdateSurface to or from the back buffer on this type of hardware inside a BeginScene/EndScene pair. In addition, applications should not try to access the z-buffer if the capability flag is set. Finally, applications should not lock the back buffer or the z-buffer inside a BeginScene/EndScene pair.

The following flags concerning mipmapped textures are not supported in Direct3D 9.

  • D3DPTFILTERCAPS_LINEAR
  • D3DPTFILTERCAPS_LINEARMIPLINEAR
  • D3DPTFILTERCAPS_LINEARMIPNEAREST
  • D3DPTFILTERCAPS_MIPNEAREST
  • D3DPTFILTERCAPS_NEAREST
+
+ + bb172513 + D3DDEVCAPS + D3DDEVCAPS +
+ + +

Member of the enumerated type, which identifies what type of resources are used for processing vertices.

+
+ + bb172513 + D3DDEVCAPS_EXECUTESYSTEMMEMORY + D3DDEVCAPS_EXECUTESYSTEMMEMORY +
+ + +

Adapter on which this Direct3D device was created. This ordinal is valid only to pass to methods of the interface that created this Direct3D device. The interface can always be retrieved by calling GetDirect3D.

+
+ + bb172513 + D3DDEVCAPS_EXECUTEVIDEOMEMORY + D3DDEVCAPS_EXECUTEVIDEOMEMORY +
+ + +

The following driver-specific capability.

ValueMeaning

Display hardware is capable of returning the current scan line.

The display driver supports an overlay DDI that allows for verification of overlay capabilities. For more information about the overlay DDI, see Overlay DDI.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

?

+
+ + bb172513 + D3DDEVCAPS_TLVERTEXSYSTEMMEMORY + D3DDEVCAPS_TLVERTEXSYSTEMMEMORY +
+ + +

Driver-specific capabilities identified in .

+
+ + bb172513 + D3DDEVCAPS_TLVERTEXVIDEOMEMORY + D3DDEVCAPS_TLVERTEXVIDEOMEMORY +
+ + +

Driver-specific capabilities identified in .

+
+ + bb172513 + D3DDEVCAPS_TEXTURESYSTEMMEMORY + D3DDEVCAPS_TEXTURESYSTEMMEMORY +
+ + +

Bit mask of values representing what presentation swap intervals are available.

ValueMeaning

The driver supports an immediate presentation swap interval.

The driver supports a presentation swap interval of every screen refresh.

The driver supports a presentation swap interval of every second screen refresh.

The driver supports a presentation swap interval of every third screen refresh.

The driver supports a presentation swap interval of every fourth screen refresh.

?

+
+ + bb172513 + D3DDEVCAPS_TEXTUREVIDEOMEMORY + D3DDEVCAPS_TEXTUREVIDEOMEMORY +
+ + +

Bit mask indicating what hardware support is available for cursors. Direct3D 9 does not define alpha-blending cursor capabilities.

ValueMeaning

A full-color cursor is supported in hardware. Specifically, this flag indicates that the driver supports at least a hardware color cursor in high-resolution modes (with scan lines greater than or equal to 400).

A full-color cursor is supported in hardware. Specifically, this flag indicates that the driver supports a hardware color cursor in both high-resolution and low-resolution modes (with scan lines less than 400).

?

+
+ + bb172513 + D3DDEVCAPS_DRAWPRIMTLVERTEX + D3DDEVCAPS_DRAWPRIMTLVERTEX +
+ + +

Flags identifying the capabilities of the device.

ValueMeaning

Device supports blits from system-memory textures to nonlocal video-memory textures.

Device can queue rendering commands after a page flip. Applications do not change their behavior if this flag is set; this capability means that the device is relatively fast.

Device can support at least a DirectX 5-compliant driver.

Device can support at least a DirectX 7-compliant driver.

Device exports an -aware hal.

Device can use execute buffers from system memory.

Device can use execute buffers from video memory.

Device has hardware acceleration for scene rasterization.

Device can support transformation and lighting in hardware.

Device supports N patches.

Device can support rasterization, transform, lighting, and shading in hardware.

Device supports quintic B?zier curves and B-splines.

Device supports rectangular and triangular patches.

When this device capability is set, the hardware architecture does not require caching of any information, and uncached patches (handle zero) will be drawn as efficiently as cached ones. Note that setting does not mean that a patch with handle zero can be drawn. A handle-zero patch can always be drawn whether this cap is set or not.

Device is texturing from separate memory pools.

Device can retrieve textures from non-local video memory.

Device can retrieve textures from system memory.

Device can retrieve textures from device memory.

Device can use buffers from system memory for transformed and lit vertices.

Device can use buffers from video memory for transformed and lit vertices.

?

+
+ + bb172513 + D3DDEVCAPS_CANRENDERAFTERFLIP + D3DDEVCAPS_CANRENDERAFTERFLIP +
+ + +

Miscellaneous driver primitive capabilities. See .

+
+ + bb172513 + D3DDEVCAPS_TEXTURENONLOCALVIDMEM + D3DDEVCAPS_TEXTURENONLOCALVIDMEM +
+ + +

Information on raster-drawing capabilities. This member can be one or more of the following flags.

ValueMeaning

Device supports anisotropic filtering.

Device iterates colors perspective correctly.

Device can dither to improve color resolution.

Device supports legacy depth bias. For true depth bias, see .

Device supports range-based fog. In range-based fog, the distance of an object from the viewer is used to compute fog effects, not the depth of the object (that is, the z-coordinate) in the scene.

Device calculates the fog value by referring to a lookup table containing fog values that are indexed to the depth of a given pixel.

Device calculates the fog value during the lighting operation and interpolates the fog value during rasterization.

Device supports level-of-detail bias adjustments. These bias adjustments enable an application to make a mipmap appear crisper or less sharp than it normally would. For more information about level-of-detail bias in mipmaps, see .

Device supports toggling multisampling on and off between and (using ).

Device supports scissor test. See Scissor Test (Direct3D 9).

Device performs true slope-scale based depth bias. This is in contrast to the legacy style depth bias.

Device supports depth buffering using w.

Device supports w-based fog. W-based fog is used when a perspective projection matrix is specified, but affine projections still use z-based fog. The system considers a projection matrix that contains a nonzero value in the [3][4] element to be a perspective projection matrix.

Device can perform hidden-surface removal (HSR) without requiring the application to sort polygons and without requiring the allocation of a depth-buffer. This leaves more video memory for textures. The method used to perform HSR is hardware-dependent and is transparent to the application.

Z-bufferless HSR is performed if no depth-buffer surface is associated with the rendering-target surface and the depth-buffer comparison test is enabled (that is, when the state value associated with the enumeration constant is set to TRUE).

Device supports z-based fog.

Device can perform z-test operations. This effectively renders a primitive and indicates whether any z pixels have been rendered.

?

+
+ + bb172513 + D3DDEVCAPS_DRAWPRIMITIVES2 + D3DDEVCAPS_DRAWPRIMITIVES2 +
+ + +

Z-buffer comparison capabilities. This member can be one or more of the following flags.

ValueMeaning

Always pass the z-test.

Pass the z-test if the new z equals the current z.

Pass the z-test if the new z is greater than the current z.

Pass the z-test if the new z is greater than or equal to the current z.

Pass the z-test if the new z is less than the current z.

Pass the z-test if the new z is less than or equal to the current z.

Always fail the z-test.

Pass the z-test if the new z does not equal the current z.

?

+
+ + bb172513 + D3DDEVCAPS_SEPARATETEXTUREMEMORIES + D3DDEVCAPS_SEPARATETEXTUREMEMORIES +
+ + +

Source-blending capabilities. This member can be one or more of the following flags. (The RGBA values of the source and destination are indicated by the subscripts s and d.)

ValueMeaning

The driver supports both and . See .

Source blend factor is (1 - As, 1 - As, 1 - As, 1 - As) and destination blend factor is (As, As, As, As); the destination blend selection is overridden.

The driver supports the blend mode. (This blend mode is obsolete. For more information, see .)

Blend factor is (Ad, Ad, Ad, Ad).

Blend factor is (Rd, Gd, Bd, Ad).

Blend factor is (1 - Ad, 1 - Ad, 1 - Ad, 1 - Ad).

Blend factor is (1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad).

Blend factor is (1 - As, 1 - As, 1 - As, 1 - As).

Blend factor is (1 - Rs, 1 - Gs, 1 - Bs, 1 - As).

Blend factor is (1 - PSOutColor[1]r, 1 - PSOutColor[1]g, 1 - PSOutColor[1]b, not used)). See Render Target Blending.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

Blend factor is (1, 1, 1, 1).

Blend factor is (As, As, As, As).

Blend factor is (f, f, f, 1); f = min(As, 1 - Ad).

Blend factor is (Rs, Gs, Bs, As).

Blend factor is (PSOutColor[1]r, PSOutColor[1]g, PSOutColor[1]b, not used). See Render Target Blending.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

Blend factor is (0, 0, 0, 0).

?

+
+ + bb172513 + D3DDEVCAPS_DRAWPRIMITIVES2EX + D3DDEVCAPS_DRAWPRIMITIVES2EX +
+ + +

Destination-blending capabilities. This member can be the same capabilities that are defined for the SrcBlendCaps member.

+
+ + bb172513 + D3DDEVCAPS_HWTRANSFORMANDLIGHT + D3DDEVCAPS_HWTRANSFORMANDLIGHT +
+ + +

Alpha-test comparison capabilities. This member can include the same capability flags defined for the ZCmpCaps member. If this member contains only the capability or only the capability, the driver does not support alpha tests. Otherwise, the flags identify the individual comparisons that are supported for alpha testing.

+
+ + bb172513 + D3DDEVCAPS_CANBLTSYSTONONLOCAL + D3DDEVCAPS_CANBLTSYSTONONLOCAL +
+ + +

Shading operations capabilities. It is assumed, in general, that if a device supports a given command at all, it supports the mode (as specified in the enumerated type). This flag specifies whether the driver can also support Gouraud shading and whether alpha color components are supported. When alpha components are not supported, the alpha value of colors generated is implicitly 255. This is the maximum possible alpha (that is, the alpha component is at full intensity).

The color, specular highlights, fog, and alpha interpolants of a triangle each have capability flags that an application can use to find out how they are implemented by the device driver.

This member can be one or more of the following flags.

ValueMeaning

Device can support an alpha component for Gouraud-blended transparency (the state for the enumerated type). In this mode, the alpha color component of a primitive is provided at vertices and interpolated across a face along with the other color components.

Device can support colored Gouraud shading. In this mode, the per-vertex color components (red, green, and blue) are interpolated across a triangle face.

Device can support fog in the Gouraud shading mode.

Device supports Gouraud shading of specular highlights.

?

+
+ + bb172513 + D3DDEVCAPS_HWRASTERIZATION + D3DDEVCAPS_HWRASTERIZATION +
+ + +

Miscellaneous texture-mapping capabilities. This member can be one or more of the following flags.

ValueMeaning

Alpha in texture pixels is supported.

Device can draw alpha from texture palettes.

Supports cube textures.

Device requires that cube texture maps have dimensions specified as powers of two.

Device supports mipmapped cube textures.

Device supports mipmapped textures.

Device supports mipmapped volume textures.

is also set, conditionally supports the use of 2D textures with dimensions that are not powers of two. A device that exposes this capability can use such a texture if all of the following requirements are met.

  • The texture addressing mode for the texture stage is set to .
  • Texture wrapping for the texture stage is disabled (D3DRS_WRAP n set to 0).
  • Mipmapping is not in use (use magnification filter only).
  • Texture formats must not be through .

If this flag is not set, and is also not set, then unconditional support is provided for 2D textures with dimensions that are not powers of two.

A texture that is not a power of two cannot be set at a stage that will be read based on a shader computation (such as the bem - ps and texm3x3 - ps instructions in pixel shaders versions 1_0 to 1_3). For example, these textures can be used to store bumps that will be fed into texture reads, but not the environment maps that are used in texbem - ps, texbeml - ps, and texm3x3spec - ps. This means that a texture with dimensions that are not powers of two cannot be addressed or sampled using texture coordinates computed within the shader. This type of operation is known as a dependent read and cannot be performed on these types of textures.

Device does not support a projected bump-environment loopkup operation in programmable and fixed function shaders.

Perspective correction texturing is supported.

If is not set, all textures must have widths and heights specified as powers of two. This requirement does not apply to either cube textures or volume textures.

If is also set, conditionally supports the use of 2D textures with dimensions that are not powers of two. See description.

If this flag is not set, and is also not set, then unconditional support is provided for 2D textures with dimensions that are not powers of two.

Supports the texture transformation flag. When applied, the device divides transformed texture coordinates by the last texture coordinate. If this capability is present, then the projective divide occurs per pixel. If this capability is not present, but the projective divide needs to occur anyway, then it is performed on a per-vertex basis by the Direct3D runtime.

All textures must be square.

Texture indices are not scaled by the texture size prior to interpolation.

Device supports volume textures.

Device requires that volume texture maps have dimensions specified as powers of two.

?

+
+ + bb172513 + D3DDEVCAPS_PUREDEVICE + D3DDEVCAPS_PUREDEVICE +
+ + +

Texture-filtering capabilities for a texture. Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture blending. This member can be any combination of the per-stage texture-filtering flags defined in .

+
+ + bb172513 + D3DDEVCAPS_QUINTICRTPATCHES + D3DDEVCAPS_QUINTICRTPATCHES +
+ + +

Texture-filtering capabilities for a cube texture. Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture blending. This member can be any combination of the per-stage texture-filtering flags defined in .

+
+ + bb172513 + D3DDEVCAPS_RTPATCHES + D3DDEVCAPS_RTPATCHES +
+ + +

Texture-filtering capabilities for a volume texture. Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture blending. This member can be any combination of the per-stage texture-filtering flags defined in .

+
+ + bb172513 + D3DDEVCAPS_RTPATCHHANDLEZERO + D3DDEVCAPS_RTPATCHHANDLEZERO +
+ + +

Texture-addressing capabilities for texture objects. This member can be one or more of the following flags.

ValueMeaning

Device supports setting coordinates outside the range [0.0, 1.0] to the border color, as specified by the texture-stage state.

Device can clamp textures to addresses.

Device can separate the texture-addressing modes of the u and v coordinates of the texture. This ability corresponds to the and render-state values.

Device can mirror textures to addresses.

Device can take the absolute value of the texture coordinate (thus, mirroring around 0) and then clamp to the maximum value.

Device can wrap textures to addresses.

?

+
+ + bb172513 + D3DDEVCAPS_NPATCHES + D3DDEVCAPS_NPATCHES +
+ + +

driver capability flags.

+
+ + bb172537 + D3DDEVCAPS2 + D3DDEVCAPS2 +
+ + + No documentation. + + + bb172537 + D3DDEVCAPS2_STREAMOFFSET + D3DDEVCAPS2_STREAMOFFSET + + + + No documentation. + + + bb172537 + D3DDEVCAPS2_DMAPNPATCH + D3DDEVCAPS2_DMAPNPATCH + + + + No documentation. + + + bb172537 + D3DDEVCAPS2_ADAPTIVETESSRTPATCH + D3DDEVCAPS2_ADAPTIVETESSRTPATCH + + + + No documentation. + + + bb172537 + D3DDEVCAPS2_ADAPTIVETESSNPATCH + D3DDEVCAPS2_ADAPTIVETESSNPATCH + + + + No documentation. + + + bb172537 + D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES + D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES + + + + No documentation. + + + bb172537 + D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH + D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH + + + + No documentation. + + + bb172537 + D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET + D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET + + + +

Defines device types.

+
+ +

All methods of the interface that take a device type will fail if is specified. To use these methods, substitute in the method call.

A device should be created in memory, unless vertex and index buffers are required. To support vertex and index buffers, create the device in memory.

If D3dref9.dll is installed, Direct3D will use the reference rasterizer to create a device type, even if is specified. If D3dref9.dll is not available and is specified, Direct3D will neither render nor present the scene.

+
+ + bb172547 + D3DDEVTYPE + D3DDEVTYPE +
+ + +

Hardware rasterization. Shading is done with software, hardware, or mixed transform and lighting.

+
+ + bb172547 + D3DDEVTYPE_HAL + D3DDEVTYPE_HAL +
+ + +

Direct3D features are implemented in software; however, the reference rasterizer does make use of special CPU instructions whenever it can.

The reference device is installed by the Windows SDK 8.0 or later and is intended as an aid in debugging for development only.

+
+ + bb172547 + D3DDEVTYPE_REF + D3DDEVTYPE_REF +
+ + +

A pluggable software device that has been registered with .

+
+ + bb172547 + D3DDEVTYPE_SW + D3DDEVTYPE_SW +
+ + +

Initialize Direct3D on a computer that has neither hardware nor reference rasterization available, and enable resources for 3D content creation. See Remarks.

+
+ + bb172547 + D3DDEVTYPE_NULLREF + D3DDEVTYPE_NULLREF +
+ + +

Specifies how the monitor being used to display a full-screen application is rotated.

+
+ +

This enumeration is used in , , and .

Applications may choose to handle monitor rotation themselves by using the , in which case, the application will need to know how the monitor is rotated so that it may adjust its rendering accordingly.

+
+ + bb172551 + D3DDISPLAYROTATION + D3DDISPLAYROTATION +
+ + +

Display is not rotated.

+
+ + bb172551 + D3DDISPLAYROTATION_IDENTITY + D3DDISPLAYROTATION_IDENTITY +
+ + +

Display is rotated 90 degrees.

+
+ + bb172551 + D3DDISPLAYROTATION_90 + D3DDISPLAYROTATION_90 +
+ + +

Display is rotated 180 degrees.

+
+ + bb172551 + D3DDISPLAYROTATION_180 + D3DDISPLAYROTATION_180 +
+ + +

Display is rotated 270 degrees.

+
+ + bb172551 + D3DDISPLAYROTATION_270 + D3DDISPLAYROTATION_270 +
+ + +

Effect data types. The data is contained in the pValue member of .

+
+ + bb172822 + D3DXEFFECTDEFAULTTYPE + D3DXEFFECTDEFAULTTYPE +
+ + + No documentation. + + + bb172822 + D3DXEDT_STRING + D3DXEDT_STRING + + + + No documentation. + + + bb172822 + D3DXEDT_FLOATS + D3DXEDT_FLOATS + + + + No documentation. + + + bb172822 + D3DXEDT_DWORD + D3DXEDT_DWORD + + + + No documentation. + + + bb172822 + D3DXEDT_FORCEDWORD + D3DXEDT_FORCEDWORD + + + +

Describes the type of events that can be keyed by the animation controller.

+
+ + bb172827 + D3DXEVENT_TYPE + D3DXEVENT_TYPE +
+ + +

Track speed.

+
+ + bb172827 + D3DXEVENT_TRACKSPEED + D3DXEVENT_TRACKSPEED +
+ + +

Track weight.

+
+ + bb172827 + D3DXEVENT_TRACKWEIGHT + D3DXEVENT_TRACKWEIGHT +
+ + +

Track position.

+
+ + bb172827 + D3DXEVENT_TRACKPOSITION + D3DXEVENT_TRACKPOSITION +
+ + +

Enable flag.

+
+ + bb172827 + D3DXEVENT_TRACKENABLE + D3DXEVENT_TRACKENABLE +
+ + +

Priority blend value.

+
+ + bb172827 + D3DXEVENT_PRIORITYBLEND + D3DXEVENT_PRIORITYBLEND +
+ + +

Defines constants describing the fill mode.

+
+ +

The values in this enumerated type are used by the render state.

+
+ + bb172556 + D3DFILLMODE + D3DFILLMODE +
+ + +

Fill points.

+
+ + bb172556 + D3DFILL_POINT + D3DFILL_POINT +
+ + +

Fill wireframes.

+
+ + bb172556 + D3DFILL_WIREFRAME + D3DFILL_WIREFRAME +
+ + +

Fill solids.

+
+ + bb172556 + D3DFILL_SOLID + D3DFILL_SOLID +
+ + +

The following flags are used to specify which channels in a texture to operate on.

+
+ + bb205565 + D3DX_FILTER + D3DX_FILTER +
+ + + No documentation. + + + bb205565 + D3DX_FILTER_NONE + D3DX_FILTER_NONE + + + + No documentation. + + + bb205565 + D3DX_FILTER_POINT + D3DX_FILTER_POINT + + + + No documentation. + + + bb205565 + D3DX_FILTER_LINEAR + D3DX_FILTER_LINEAR + + + + No documentation. + + + bb205565 + D3DX_FILTER_TRIANGLE + D3DX_FILTER_TRIANGLE + + + + No documentation. + + + bb205565 + D3DX_FILTER_BOX + D3DX_FILTER_BOX + + + + No documentation. + + + bb205565 + D3DX_FILTER_MIRROR_U + D3DX_FILTER_MIRROR_U + + + + No documentation. + + + bb205565 + D3DX_FILTER_MIRROR_V + D3DX_FILTER_MIRROR_V + + + + No documentation. + + + bb205565 + D3DX_FILTER_MIRROR_W + D3DX_FILTER_MIRROR_W + + + + No documentation. + + + bb205565 + D3DX_FILTER_MIRROR + D3DX_FILTER_MIRROR + + + + No documentation. + + + bb205565 + D3DX_FILTER_DITHER + D3DX_FILTER_DITHER + + + + No documentation. + + + bb205565 + D3DX_FILTER_DITHER_DIFFUSION + D3DX_FILTER_DITHER_DIFFUSION + + + + No documentation. + + + bb205565 + D3DX_FILTER_SRGB_IN + D3DX_FILTER_SRGB_IN + + + + No documentation. + + + bb205565 + D3DX_FILTER_SRGB_OUT + D3DX_FILTER_SRGB_OUT + + + + No documentation. + + + bb205565 + D3DX_FILTER_SRGB + D3DX_FILTER_SRGB + + + + No documentation. + + + bb205565 + D3DX_FILTER_DEFAULT + D3DX_FILTER_DEFAULT + + + +

Texture filtering constants.

+
+ + bb172593 + D3DPTFILTERCAPS + D3DPTFILTERCAPS +
+ + + No documentation. + + + bb172593 + D3DPTFILTERCAPS_MINFPOINT + D3DPTFILTERCAPS_MINFPOINT + + + + No documentation. + + + bb172593 + D3DPTFILTERCAPS_MINFLINEAR + D3DPTFILTERCAPS_MINFLINEAR + + + + No documentation. + + + bb172593 + D3DPTFILTERCAPS_MINFANISOTROPIC + D3DPTFILTERCAPS_MINFANISOTROPIC + + + + No documentation. + + + bb172593 + D3DPTFILTERCAPS_MINFPYRAMIDALQUAD + D3DPTFILTERCAPS_MINFPYRAMIDALQUAD + + + + No documentation. + + + bb172593 + D3DPTFILTERCAPS_MINFGAUSSIANQUAD + D3DPTFILTERCAPS_MINFGAUSSIANQUAD + + + + No documentation. + + + bb172593 + D3DPTFILTERCAPS_MIPFPOINT + D3DPTFILTERCAPS_MIPFPOINT + + + + No documentation. + + + bb172593 + D3DPTFILTERCAPS_MIPFLINEAR + D3DPTFILTERCAPS_MIPFLINEAR + + + + No documentation. + + + bb172593 + D3DPTFILTERCAPS_CONVOLUTIONMONO + D3DPTFILTERCAPS_CONVOLUTIONMONO + + + + No documentation. + + + bb172593 + D3DPTFILTERCAPS_MAGFPOINT + D3DPTFILTERCAPS_MAGFPOINT + + + + No documentation. + + + bb172593 + D3DPTFILTERCAPS_MAGFLINEAR + D3DPTFILTERCAPS_MAGFLINEAR + + + + No documentation. + + + bb172593 + D3DPTFILTERCAPS_MAGFANISOTROPIC + D3DPTFILTERCAPS_MAGFANISOTROPIC + + + + No documentation. + + + bb172593 + D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD + D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD + + + + No documentation. + + + bb172593 + D3DPTFILTERCAPS_MAGFGAUSSIANQUAD + D3DPTFILTERCAPS_MAGFGAUSSIANQUAD + + + +

Defines constants that describe the fog mode.

+
+ +

The values in this enumerated type are used by the and render states.

Fog can be considered a measure of visibility: the lower the fog value produced by a fog equation, the less visible an object is.

+
+ + bb172557 + D3DFOGMODE + D3DFOGMODE +
+ + +

No fog effect.

+
+ + bb172557 + D3DFOG_NONE + D3DFOG_NONE +
+ + +

Fog effect intensifies exponentially, according to the following formula. +

+
+ + bb172557 + D3DFOG_EXP + D3DFOG_EXP +
+ + +

Fog effect intensifies exponentially with the square of the distance, according to the following formula. +

+
+ + bb172557 + D3DFOG_EXP2 + D3DFOG_EXP2 +
+ + +

Fog effect intensifies linearly between the start and end points, according to the following formula.

This is the only fog mode currently supported.

+
+ + bb172557 + D3DFOG_LINEAR + D3DFOG_LINEAR +
+ + +

Defines the various types of surface formats.

typedef enum _D3DFORMAT { = 0, = 20, = 21, = 22, = 23, = 24, = 25, = 26, = 27, = 28, = 29, = 30, = 31, = 32, = 33, = 34, = 35, = 36, = 40, = 41, = 50, = 51, = 52, = 60, = 61, = 62, = 63, = 64, = 67, = MAKEFOURCC('U', 'Y', 'V', 'Y'), = MAKEFOURCC('R', 'G', 'B', 'G'), = MAKEFOURCC('Y', 'U', 'Y', '2'), = MAKEFOURCC('G', 'R', 'G', 'B'), = MAKEFOURCC('D', 'X', 'T', '1'), = MAKEFOURCC('D', 'X', 'T', '2'), = MAKEFOURCC('D', 'X', 'T', '3'), = MAKEFOURCC('D', 'X', 'T', '4'), = MAKEFOURCC('D', 'X', 'T', '5'), = 70, = 71, = 73, = 75, = 77, = 79, = 80, = 82, = 83, #if !defined(D3D_DISABLE_9EX) = 84, = 85, + #endif // !D3D_DISABLE_9EX = 81, =100, =101, =102, =110, = MAKEFOURCC('M','E','T','1'), = 111, = 112, = 113, = 114, = 115, = 116, = 117, #if !defined(D3D_DISABLE_9EX) = 118, = 119, = 199, + #endif // !D3D_DISABLE_9EX D3DFMT_FORCE_DWORD =0x7fffffff + } ; +
+ +

There are several types of formats:

  • BackBuffer
  • Buffer
  • DXTn
  • Floating-Point
  • FOURCC
  • IEEE
  • Mixed
  • Signed
  • Unsigned
  • Other

All formats are listed from left to right, most-significant bit to least-significant bit. For example, D3DFORMAT_ARGB is ordered from the most-significant bit channel A (alpha), to the least-significant bit channel B (blue). When traversing surface data, the data is stored in memory from least-significant bit to most-significant bit, which means that the channel order in memory is from least-significant bit (blue) to most-significant bit (alpha).

The default value for formats that contain undefined channels (G16R16, A8, and so on) is 1. The only exception is the A8 format, which is initialized to 000 for the three color channels.

The order of the bits is from the most significant byte first, so indicates that the high byte of this 2-byte format is alpha. indicates a 16-bit integer value and an application-lockable surface.

Pixel formats have been chosen to enable the expression of hardware-vendor-defined extension formats, as well as to include the well-established FOURCC method. The set of formats understood by the Direct3D runtime is defined by .

Note that formats are supplied by independent hardware vendors (IHVs) and many FOURCC codes are not listed. The formats in this enumeration are unique in that they are sanctioned by the runtime, meaning that the reference rasterizer will operate on all these types. IHV-supplied formats will be supported by the individual IHVs on a card-by-card basis.

+
+ + bb172558 + D3DFORMAT + D3DFORMAT +
+ + + No documentation. + + + bb172558 + D3DFMT_UNKNOWN + D3DFMT_UNKNOWN + + + + No documentation. + + + bb172558 + D3DFMT_R8G8B8 + D3DFMT_R8G8B8 + + + + No documentation. + + + bb172558 + D3DFMT_A8R8G8B8 + D3DFMT_A8R8G8B8 + + + + No documentation. + + + bb172558 + D3DFMT_X8R8G8B8 + D3DFMT_X8R8G8B8 + + + + No documentation. + + + bb172558 + D3DFMT_R5G6B5 + D3DFMT_R5G6B5 + + + + No documentation. + + + bb172558 + D3DFMT_X1R5G5B5 + D3DFMT_X1R5G5B5 + + + + No documentation. + + + bb172558 + D3DFMT_A1R5G5B5 + D3DFMT_A1R5G5B5 + + + + No documentation. + + + bb172558 + D3DFMT_A4R4G4B4 + D3DFMT_A4R4G4B4 + + + + No documentation. + + + bb172558 + D3DFMT_R3G3B2 + D3DFMT_R3G3B2 + + + + No documentation. + + + bb172558 + D3DFMT_A8 + D3DFMT_A8 + + + + No documentation. + + + bb172558 + D3DFMT_A8R3G3B2 + D3DFMT_A8R3G3B2 + + + + No documentation. + + + bb172558 + D3DFMT_X4R4G4B4 + D3DFMT_X4R4G4B4 + + + + No documentation. + + + bb172558 + D3DFMT_A2B10G10R10 + D3DFMT_A2B10G10R10 + + + + No documentation. + + + bb172558 + D3DFMT_A8B8G8R8 + D3DFMT_A8B8G8R8 + + + + No documentation. + + + bb172558 + D3DFMT_X8B8G8R8 + D3DFMT_X8B8G8R8 + + + + No documentation. + + + bb172558 + D3DFMT_G16R16 + D3DFMT_G16R16 + + + + No documentation. + + + bb172558 + D3DFMT_A2R10G10B10 + D3DFMT_A2R10G10B10 + + + + No documentation. + + + bb172558 + D3DFMT_A16B16G16R16 + D3DFMT_A16B16G16R16 + + + + No documentation. + + + bb172558 + D3DFMT_A8P8 + D3DFMT_A8P8 + + + + No documentation. + + + bb172558 + D3DFMT_P8 + D3DFMT_P8 + + + + No documentation. + + + bb172558 + D3DFMT_L8 + D3DFMT_L8 + + + + No documentation. + + + bb172558 + D3DFMT_A8L8 + D3DFMT_A8L8 + + + + No documentation. + + + bb172558 + D3DFMT_A4L4 + D3DFMT_A4L4 + + + + No documentation. + + + bb172558 + D3DFMT_V8U8 + D3DFMT_V8U8 + + + + No documentation. + + + bb172558 + D3DFMT_L6V5U5 + D3DFMT_L6V5U5 + + + + No documentation. + + + bb172558 + D3DFMT_X8L8V8U8 + D3DFMT_X8L8V8U8 + + + + No documentation. + + + bb172558 + D3DFMT_Q8W8V8U8 + D3DFMT_Q8W8V8U8 + + + + No documentation. + + + bb172558 + D3DFMT_V16U16 + D3DFMT_V16U16 + + + + No documentation. + + + bb172558 + D3DFMT_A2W10V10U10 + D3DFMT_A2W10V10U10 + + + + No documentation. + + + bb172558 + D3DFMT_UYVY + D3DFMT_UYVY + + + + No documentation. + + + bb172558 + D3DFMT_R8G8_B8G8 + D3DFMT_R8G8_B8G8 + + + + No documentation. + + + bb172558 + D3DFMT_YUY2 + D3DFMT_YUY2 + + + + No documentation. + + + bb172558 + D3DFMT_G8R8_G8B8 + D3DFMT_G8R8_G8B8 + + + + No documentation. + + + bb172558 + D3DFMT_DXT1 + D3DFMT_DXT1 + + + + No documentation. + + + bb172558 + D3DFMT_DXT2 + D3DFMT_DXT2 + + + + No documentation. + + + bb172558 + D3DFMT_DXT3 + D3DFMT_DXT3 + + + + No documentation. + + + bb172558 + D3DFMT_DXT4 + D3DFMT_DXT4 + + + + No documentation. + + + bb172558 + D3DFMT_DXT5 + D3DFMT_DXT5 + + + + No documentation. + + + bb172558 + D3DFMT_D16_LOCKABLE + D3DFMT_D16_LOCKABLE + + + + No documentation. + + + bb172558 + D3DFMT_D32 + D3DFMT_D32 + + + + No documentation. + + + bb172558 + D3DFMT_D15S1 + D3DFMT_D15S1 + + + + No documentation. + + + bb172558 + D3DFMT_D24S8 + D3DFMT_D24S8 + + + + No documentation. + + + bb172558 + D3DFMT_D24X8 + D3DFMT_D24X8 + + + + No documentation. + + + bb172558 + D3DFMT_D24X4S4 + D3DFMT_D24X4S4 + + + + No documentation. + + + bb172558 + D3DFMT_D16 + D3DFMT_D16 + + + + No documentation. + + + bb172558 + D3DFMT_D32F_LOCKABLE + D3DFMT_D32F_LOCKABLE + + + + No documentation. + + + bb172558 + D3DFMT_D24FS8 + D3DFMT_D24FS8 + + + + No documentation. + + + bb172558 + D3DFMT_D32_LOCKABLE + D3DFMT_D32_LOCKABLE + + + + No documentation. + + + bb172558 + D3DFMT_S8_LOCKABLE + D3DFMT_S8_LOCKABLE + + + + No documentation. + + + bb172558 + D3DFMT_L16 + D3DFMT_L16 + + + + No documentation. + + + bb172558 + D3DFMT_VERTEXDATA + D3DFMT_VERTEXDATA + + + + No documentation. + + + bb172558 + D3DFMT_INDEX16 + D3DFMT_INDEX16 + + + + No documentation. + + + bb172558 + D3DFMT_INDEX32 + D3DFMT_INDEX32 + + + + No documentation. + + + bb172558 + D3DFMT_Q16W16V16U16 + D3DFMT_Q16W16V16U16 + + + + No documentation. + + + bb172558 + D3DFMT_MULTI2_ARGB8 + D3DFMT_MULTI2_ARGB8 + + + + No documentation. + + + bb172558 + D3DFMT_R16F + D3DFMT_R16F + + + + No documentation. + + + bb172558 + D3DFMT_G16R16F + D3DFMT_G16R16F + + + + No documentation. + + + bb172558 + D3DFMT_A16B16G16R16F + D3DFMT_A16B16G16R16F + + + + No documentation. + + + bb172558 + D3DFMT_R32F + D3DFMT_R32F + + + + No documentation. + + + bb172558 + D3DFMT_G32R32F + D3DFMT_G32R32F + + + + No documentation. + + + bb172558 + D3DFMT_A32B32G32R32F + D3DFMT_A32B32G32R32F + + + + No documentation. + + + bb172558 + D3DFMT_CxV8U8 + D3DFMT_CxV8U8 + + + + No documentation. + + + bb172558 + D3DFMT_A1 + D3DFMT_A1 + + + + No documentation. + + + bb172558 + D3DFMT_A2B10G10R10_XR_BIAS + D3DFMT_A2B10G10R10_XR_BIAS + + + + No documentation. + + + bb172558 + D3DFMT_BINARYBUFFER + D3DFMT_BINARYBUFFER + + + +

Options for saving and creating effects.

The constants in the following table are defined in d3dx9effect.h.

+
+ + bb172855 + D3DXFX + D3DXFX +
+ + + No documentation. + + + bb172855 + D3DXFX_DONOTSAVESTATE + D3DXFX_DONOTSAVESTATE + + + + No documentation. + + + bb172855 + D3DXFX_DONOTSAVESHADERSTATE + D3DXFX_DONOTSAVESHADERSTATE + + + + No documentation. + + + bb172855 + D3DXFX_DONOTSAVESAMPLERSTATE + D3DXFX_DONOTSAVESAMPLERSTATE + + + + No documentation. + + + bb172855 + D3DXFX_NOT_CLONEABLE + D3DXFX_NOT_CLONEABLE + + + + No documentation. + + + bb172855 + D3DXFX_LARGEADDRESSAWARE + D3DXFX_LARGEADDRESSAWARE + + + + None. + + + None + None + + + +

Describes the supported image file formats. See Remarks for descriptions of these formats.

+
+ +

Functions that begin with D3DXLoadxxx support all of the formats listed. Functions that begin with D3DXSavexxx support all of the formats listed except the Truevision (.tga) and portable pixmap (.ppm) formats.

The following table lists the available input and output formats.

File ExtensionDescription
.bmpWindows bitmap format. Contains a header that describes the resolution of the device on which the rectangle of pixels was created, the dimensions of the rectangle, the size of the array of bits, a logical palette, and an array of bits that defines the relationship between pixels in the bitmapped image and entries in the logical palette.
.ddsDirectDraw Surface file format. Stores textures, volume textures, and cubic environment maps, with or without mipmap levels, and with or without pixel compression. See DDS.
.dibWindows DIB. Contains an array of bits combined with structures that specify width and height of the bitmapped image, color format of the device where the image was created, and resolution of the device used to create that image.
.hdrHDR format. Encodes each pixel as an RGBE 32-bit color, with 8 bits of mantissa for red, green, and blue, and a shared 8-bit exponent. Each channel is separately compressed with run-length encoding (RLE).
.jpgJPEG standard. Specifies variable compression of 24-bit RGB color and 8-bit gray-scale Tagged Image File Format (TIFF) image document files.
.pfmPortable float map format. A raw floating point image format, without any compression. The file header specifies image width, height, monochrome or color, and machine word order. Pixel data is stored as 32-bit floating point values, with 3 values per pixel for color, and one value per pixel for monochrome.
.pngPNG format. A non-proprietary bitmap format using lossless compression.
.ppmPortable Pixmap format. A binary or ASCII file format for color images that includes image height and width and the maximum color component value.
.tgaTarga or Truevision Graphics Adapter format. Supports depths of 8, 15, 16, 24, and 32 bits, including 8-bit gray scale, and contains optional color palette data, image (x, y) origin and size data, and pixel data.

?

See Types of Bitmaps for more information on some of these formats.

+
+ + bb172878 + D3DXIMAGE_FILEFORMAT + D3DXIMAGE_FILEFORMAT +
+ + +

Windows bitmap (BMP) file format.

+
+ + bb172878 + D3DXIFF_BMP + D3DXIFF_BMP +
+ + +

Joint Photographics Experts Group (JPEG) compressed file format.

+
+ + bb172878 + D3DXIFF_JPG + D3DXIFF_JPG +
+ + +

Truevision (Targa, or TGA) image file format.

+
+ + bb172878 + D3DXIFF_TGA + D3DXIFF_TGA +
+ + +

Portable Network Graphics (PNG) file format.

+
+ + bb172878 + D3DXIFF_PNG + D3DXIFF_PNG +
+ + +

DirectDraw surface (DDS) file format.

+
+ + bb172878 + D3DXIFF_DDS + D3DXIFF_DDS +
+ + +

Portable pixmap (PPM) file format.

+
+ + bb172878 + D3DXIFF_PPM + D3DXIFF_PPM +
+ + +

Windows device-independent bitmap (DIB) file format.

+
+ + bb172878 + D3DXIFF_DIB + D3DXIFF_DIB +
+ + +

High dynamic range (HDR) file format.

+
+ + bb172878 + D3DXIFF_HDR + D3DXIFF_HDR +
+ + +

Portable float map file format.

+
+ + bb172878 + D3DXIFF_PFM + D3DXIFF_PFM +
+ + +

Describes the location for the include file.

+
+ + bb172881 + D3DXINCLUDE_TYPE + D3DXINCLUDE_TYPE +
+ + +

Look in the local project for the include file.

+
+ + bb172881 + D3DXINC_LOCAL + D3DXINC_LOCAL +
+ + +

Look in the system path for the include file.

+
+ + bb172881 + D3DXINC_SYSTEM + D3DXINC_SYSTEM +
+ + +

This macro creates a value used by Issue to issue a query end.

#define (1 << 0) +
+ +

This macro changes the query state to nonsignaled.

is valid for the following query types.

  • D3DQUERYTYPE_ResourceManager
+
+ + bb172565 + D3DISSUE + D3DISSUE +
+ + + No documentation. + + + bb172565 + D3DISSUE_END + D3DISSUE_END + + + + No documentation. + + + bb172565 + D3DISSUE_BEGIN + D3DISSUE_BEGIN + + + +

Defines the light type.

+
+ +

Directional lights are slightly faster than point light sources, but point lights look a little better. Spotlights offer interesting visual effects but are computationally time-consuming.

+
+ + bb172567 + D3DLIGHTTYPE + D3DLIGHTTYPE +
+ + +

Light is a point source. The light has a position in space and radiates light in all directions.

+
+ + bb172567 + D3DLIGHT_POINT + D3DLIGHT_POINT +
+ + +

Light is a spotlight source. This light is like a point light, except that the illumination is limited to a cone. This light type has a direction and several other parameters that determine the shape of the cone it produces. For information about these parameters, see the structure.

+
+ + bb172567 + D3DLIGHT_SPOT + D3DLIGHT_SPOT +
+ + +

Light is a directional light source. This is equivalent to using a point light source at an infinite distance.

+
+ + bb172567 + D3DLIGHT_DIRECTIONAL + D3DLIGHT_DIRECTIONAL +
+ + + No documentation. + + + bb206304 + D3DLINECAPS + D3DLINECAPS + + + + No documentation. + + + bb206304 + D3DLINECAPS_TEXTURE + D3DLINECAPS_TEXTURE + + + + No documentation. + + + bb206304 + D3DLINECAPS_ZTEST + D3DLINECAPS_ZTEST + + + + No documentation. + + + bb206304 + D3DLINECAPS_BLEND + D3DLINECAPS_BLEND + + + + No documentation. + + + bb206304 + D3DLINECAPS_ALPHACMP + D3DLINECAPS_ALPHACMP + + + + No documentation. + + + bb206304 + D3DLINECAPS_FOG + D3DLINECAPS_FOG + + + + No documentation. + + + bb206304 + D3DLINECAPS_ANTIALIAS + D3DLINECAPS_ANTIALIAS + + + +

A combination of zero or more locking options that describe the type of lock to perform.

+
+ + bb172568 + D3DLOCK + D3DLOCK +
+ + + No documentation. + + + bb172568 + D3DLOCK_READONLY + D3DLOCK_READONLY + + + + No documentation. + + + bb172568 + D3DLOCK_DISCARD + D3DLOCK_DISCARD + + + + No documentation. + + + bb172568 + D3DLOCK_NOOVERWRITE + D3DLOCK_NOOVERWRITE + + + + No documentation. + + + bb172568 + D3DLOCK_NOSYSLOCK + D3DLOCK_NOSYSLOCK + + + + No documentation. + + + bb172568 + D3DLOCK_DONOTWAIT + D3DLOCK_DONOTWAIT + + + + No documentation. + + + bb172568 + D3DLOCK_NO_DIRTY_UPDATE + D3DLOCK_NO_DIRTY_UPDATE + + + + No documentation. + + + bb172568 + D3DLOCK_DONOTCOPYDATA + D3DLOCK_DONOTCOPYDATA + + + + None. + + + None + None + + + +

Defines the type of mesh data present in .

+
+ + bb205373 + D3DXMESHDATATYPE + D3DXMESHDATATYPE +
+ + + No documentation. + + + bb205373 + D3DXMESHTYPE_MESH + D3DXMESHTYPE_MESH + + + + No documentation. + + + bb205373 + D3DXMESHTYPE_PMESH + D3DXMESHTYPE_PMESH + + + + No documentation. + + + bb205373 + D3DXMESHTYPE_PATCHMESH + D3DXMESHTYPE_PATCHMESH + + + +

Flags used to specify creation options for a mesh.

+
+ +

A 32-bit mesh () can theoretically support (2^32)-1 faces and vertices. However, allocating memory for a mesh that large on a 32-bit operating system is not practical.

+
+ + bb205370 + _D3DXMESH + _D3DXMESH +
+ + +

The mesh has 32-bit indices instead of 16-bit indices. See Remarks.

+
+ + bb205370 + D3DXMESH_32BIT + D3DXMESH_32BIT +
+ + +

Use the usage flag for vertex and index buffers.

+
+ + bb205370 + D3DXMESH_DONOTCLIP + D3DXMESH_DONOTCLIP +
+ + +

Use the usage flag for vertex and index buffers.

+
+ + bb205370 + D3DXMESH_POINTS + D3DXMESH_POINTS +
+ + +

Use the usage flag for vertex and index buffers.

+
+ + bb205370 + D3DXMESH_RTPATCHES + D3DXMESH_RTPATCHES +
+ + +

Specifying this flag causes the vertex and index buffer of the mesh to be created with flag. This is required if the mesh object is to be rendered using N-patch enhancement using Direct3D.

+
+ + bb205370 + D3DXMESH_NPATCHES + D3DXMESH_NPATCHES +
+ + +

Use the usage flag for vertex buffers.

+
+ + bb205370 + D3DXMESH_VB_SYSTEMMEM + D3DXMESH_VB_SYSTEMMEM +
+ + +

Use the usage flag for vertex buffers.

+
+ + bb205370 + D3DXMESH_VB_MANAGED + D3DXMESH_VB_MANAGED +
+ + +

Use the usage flag for vertex buffers.

+
+ + bb205370 + D3DXMESH_VB_WRITEONLY + D3DXMESH_VB_WRITEONLY +
+ + +

Use the usage flag for vertex buffers.

+
+ + bb205370 + D3DXMESH_VB_DYNAMIC + D3DXMESH_VB_DYNAMIC +
+ + +

Use the usage flag for vertex buffers.

+
+ + bb205370 + D3DXMESH_VB_SOFTWAREPROCESSING + D3DXMESH_VB_SOFTWAREPROCESSING +
+ + +

Use the usage flag for index buffers.

+
+ + bb205370 + D3DXMESH_IB_SYSTEMMEM + D3DXMESH_IB_SYSTEMMEM +
+ + +

Use the usage flag for index buffers.

+
+ + bb205370 + D3DXMESH_IB_MANAGED + D3DXMESH_IB_MANAGED +
+ + +

Use the usage flag for index buffers.

+
+ + bb205370 + D3DXMESH_IB_WRITEONLY + D3DXMESH_IB_WRITEONLY +
+ + +

Use the usage flag for index buffers.

+
+ + bb205370 + D3DXMESH_IB_DYNAMIC + D3DXMESH_IB_DYNAMIC +
+ + +

Use the usage flag for index buffers.

+
+ + bb205370 + D3DXMESH_IB_SOFTWAREPROCESSING + D3DXMESH_IB_SOFTWAREPROCESSING +
+ + +

Forces the cloned meshes to share vertex buffers.

+
+ + bb205370 + D3DXMESH_VB_SHARE + D3DXMESH_VB_SHARE +
+ + +

Use hardware processing only. For mixed-mode device, this flag will cause the system to use hardware (if supported in hardware) or will default to software processing.

+
+ + bb205370 + D3DXMESH_USEHWONLY + D3DXMESH_USEHWONLY +
+ + +

Equivalent to specifying both and .

+
+ + bb205370 + D3DXMESH_SYSTEMMEM + D3DXMESH_SYSTEMMEM +
+ + +

Equivalent to specifying both and .

+
+ + bb205370 + D3DXMESH_MANAGED + D3DXMESH_MANAGED +
+ + +

Equivalent to specifying both and .

+
+ + bb205370 + D3DXMESH_WRITEONLY + D3DXMESH_WRITEONLY +
+ + +

Equivalent to specifying both and .

+
+ + bb205370 + D3DXMESH_DYNAMIC + D3DXMESH_DYNAMIC +
+ + +

Equivalent to specifying both and .

+
+ + bb205370 + D3DXMESH_SOFTWAREPROCESSING + D3DXMESH_SOFTWAREPROCESSING +
+ + +

Specifies the type of mesh optimization to be performed.

+
+ +

The and optimization flags are mutually exclusive.

The D3DXMESHOPT_SHAREVB flag has been removed from this enumeration. Use instead, in D3DXMESH.

+
+ + bb205374 + _D3DXMESHOPT + _D3DXMESHOPT +
+ + +

Reorders faces to remove unused vertices and faces.

+
+ + bb205374 + D3DXMESHOPT_COMPACT + D3DXMESHOPT_COMPACT +
+ + +

Reorders faces to optimize for fewer attribute bundle state changes and enhanced performance.

+
+ + bb205374 + D3DXMESHOPT_ATTRSORT + D3DXMESHOPT_ATTRSORT +
+ + +

Reorders faces to increase the cache hit rate of vertex caches.

+
+ + bb205374 + D3DXMESHOPT_VERTEXCACHE + D3DXMESHOPT_VERTEXCACHE +
+ + +

Reorders faces to maximize length of adjacent triangles.

+
+ + bb205374 + D3DXMESHOPT_STRIPREORDER + D3DXMESHOPT_STRIPREORDER +
+ + +

Optimize the faces only; do not optimize the vertices.

+
+ + bb205374 + D3DXMESHOPT_IGNOREVERTS + D3DXMESHOPT_IGNOREVERTS +
+ + +

While attribute sorting, do not split vertices that are shared between attribute groups.

+
+ + bb205374 + D3DXMESHOPT_DONOTSPLIT + D3DXMESHOPT_DONOTSPLIT +
+ + +

Affects the vertex cache size. Using this flag specifies a default vertex cache size that works well on legacy hardware.

+
+ + bb205374 + D3DXMESHOPT_DEVICEINDEPENDENT + D3DXMESHOPT_DEVICEINDEPENDENT +
+ + +

Specifies simplification options for a mesh.

+
+ + bb205375 + _D3DXMESHSIMP + _D3DXMESHSIMP +
+ + +

The mesh will be simplified by the number of vertices specified in the MinValue parameter.

+
+ + bb205375 + D3DXMESHSIMP_VERTEX + D3DXMESHSIMP_VERTEX +
+ + +

The mesh will be simplified by the number of faces specified in the MinValue parameter.

+
+ + bb205375 + D3DXMESHSIMP_FACE + D3DXMESHSIMP_FACE +
+ + +

Defines the levels of full-scene multisampling that the device can apply.

+
+ +

In addition to enabling full-scene multisampling at time, there will be render states that turn various aspects on and off at fine-grained levels.

Multisampling is valid only on a swap chain that is being created or reset with the swap effect.

The multisample antialiasing value can be set with the parameters (or sub-parameters) in the following methods.

MethodParametersSub-parameters
MultiSampleType and pQualityLevels
pPresentationParametersMultiSampleType and pQualityLevels
pPresentationParametersMultiSampleType and pQualityLevels
MultiSampleType and pQualityLevels
MultiSampleType and pQualityLevels
pPresentationParametersMultiSampleType and pQualityLevels

?

It is not good practice to switch from one multisample type to another to raise the quality of the antialiasing.

enables swap effects other than discarding, locking, and so on.

Whether the display device supports maskable multisampling (more than one sample for a multiple-sample render-target format plus antialias support) or just non-maskable multisampling (only antialias support), the driver for the device provides the number of quality levels for the multiple-sample type. Applications that just use multisampling for antialiasing purposes only need to query for the number of non-maskable multiple-sample quality levels that the driver supports.

The quality levels supported by the device can be obtained with the pQualityLevels parameter of . Quality levels used by the application are set with the MultiSampleQuality parameter of and .

See for discussion of maskable multisampling.

+
+ + bb172574 + D3DMULTISAMPLE_TYPE + D3DMULTISAMPLE_TYPE +
+ + +

No level of full-scene multisampling is available.

+
+ + bb172574 + D3DMULTISAMPLE_NONE + D3DMULTISAMPLE_NONE +
+ + +

Enables the multisample quality value. See Remarks.

+
+ + bb172574 + D3DMULTISAMPLE_NONMASKABLE + D3DMULTISAMPLE_NONMASKABLE +
+ + +

Level of full-scene multisampling available.

+
+ + bb172574 + D3DMULTISAMPLE_2_SAMPLES + D3DMULTISAMPLE_2_SAMPLES +
+ + +

Level of full-scene multisampling available.

+
+ + bb172574 + D3DMULTISAMPLE_3_SAMPLES + D3DMULTISAMPLE_3_SAMPLES +
+ + +

Level of full-scene multisampling available.

+
+ + bb172574 + D3DMULTISAMPLE_4_SAMPLES + D3DMULTISAMPLE_4_SAMPLES +
+ + +

Level of full-scene multisampling available.

+
+ + bb172574 + D3DMULTISAMPLE_5_SAMPLES + D3DMULTISAMPLE_5_SAMPLES +
+ + +

Level of full-scene multisampling available.

+
+ + bb172574 + D3DMULTISAMPLE_6_SAMPLES + D3DMULTISAMPLE_6_SAMPLES +
+ + +

Level of full-scene multisampling available.

+
+ + bb172574 + D3DMULTISAMPLE_7_SAMPLES + D3DMULTISAMPLE_7_SAMPLES +
+ + +

Level of full-scene multisampling available.

+
+ + bb172574 + D3DMULTISAMPLE_8_SAMPLES + D3DMULTISAMPLE_8_SAMPLES +
+ + +

Level of full-scene multisampling available.

+
+ + bb172574 + D3DMULTISAMPLE_9_SAMPLES + D3DMULTISAMPLE_9_SAMPLES +
+ + +

Level of full-scene multisampling available.

+
+ + bb172574 + D3DMULTISAMPLE_10_SAMPLES + D3DMULTISAMPLE_10_SAMPLES +
+ + +

Level of full-scene multisampling available.

+
+ + bb172574 + D3DMULTISAMPLE_11_SAMPLES + D3DMULTISAMPLE_11_SAMPLES +
+ + +

Level of full-scene multisampling available.

+
+ + bb172574 + D3DMULTISAMPLE_12_SAMPLES + D3DMULTISAMPLE_12_SAMPLES +
+ + +

Level of full-scene multisampling available.

+
+ + bb172574 + D3DMULTISAMPLE_13_SAMPLES + D3DMULTISAMPLE_13_SAMPLES +
+ + +

Level of full-scene multisampling available.

+
+ + bb172574 + D3DMULTISAMPLE_14_SAMPLES + D3DMULTISAMPLE_14_SAMPLES +
+ + +

Level of full-scene multisampling available.

+
+ + bb172574 + D3DMULTISAMPLE_15_SAMPLES + D3DMULTISAMPLE_15_SAMPLES +
+ + +

Level of full-scene multisampling available.

+
+ + bb172574 + D3DMULTISAMPLE_16_SAMPLES + D3DMULTISAMPLE_16_SAMPLES +
+ + +

Normal maps generation constants.

+
+ + bb205566 + D3DX_NORMALMAP + D3DX_NORMALMAP +
+ + + No documentation. + + + bb205566 + D3DX_NORMALMAP_MIRROR_U + D3DX_NORMALMAP_MIRROR_U + + + + No documentation. + + + bb205566 + D3DX_NORMALMAP_MIRROR_V + D3DX_NORMALMAP_MIRROR_V + + + + No documentation. + + + bb205566 + D3DX_NORMALMAP_MIRROR + D3DX_NORMALMAP_MIRROR + + + + No documentation. + + + bb205566 + D3DX_NORMALMAP_INVERTSIGN + D3DX_NORMALMAP_INVERTSIGN + + + + No documentation. + + + bb205566 + D3DX_NORMALMAP_COMPUTE_OCCLUSION + D3DX_NORMALMAP_COMPUTE_OCCLUSION + + + +

The type of object.

+
+ + bb205378 + D3DXPARAMETER_CLASS + D3DXPARAMETER_CLASS +
+ + +

Constant is a scalar.

+
+ + bb205378 + D3DXPC_SCALAR + D3DXPC_SCALAR +
+ + +

Constant is a vector.

+
+ + bb205378 + D3DXPC_VECTOR + D3DXPC_VECTOR +
+ + +

Constant is a row major matrix.

+
+ + bb205378 + D3DXPC_MATRIX_ROWS + D3DXPC_MATRIX_ROWS +
+ + +

Constant is a column major matrix.

+
+ + bb205378 + D3DXPC_MATRIX_COLUMNS + D3DXPC_MATRIX_COLUMNS +
+ + +

Constant is either a texture, shader, or a string.

+
+ + bb205378 + D3DXPC_OBJECT + D3DXPC_OBJECT +
+ + +

Constant is a structure.

+
+ + bb205378 + D3DXPC_STRUCT + D3DXPC_STRUCT +
+ + +

These flags provide additional information about effect parameters.

Effect parameter constants are used by .

+

+ + bb205567 + D3DX_PARAMETER + D3DX_PARAMETER +
+ + + No documentation. + + + bb205567 + D3DX_PARAMETER_SHARED + D3DX_PARAMETER_SHARED + + + + No documentation. + + + bb205567 + D3DX_PARAMETER_LITERAL + D3DX_PARAMETER_LITERAL + + + + No documentation. + + + bb205567 + D3DX_PARAMETER_ANNOTATION + D3DX_PARAMETER_ANNOTATION + + + + None. + + + None + None + + + +

Describes the data contained by the enumeration.

+
+ + bb205380 + D3DXPARAMETER_TYPE + D3DXPARAMETER_TYPE +
+ + +

Parameter is a void reference.

+
+ + bb205380 + D3DXPT_VOID + D3DXPT_VOID +
+ + +

Parameter is a Boolean. Any non-zero value passed into , , , , or will be mapped to 1 (TRUE) before being written into the constant table; otherwise, the value will be set to 0 in the constant table.

+
+ + bb205380 + D3DXPT_BOOL + D3DXPT_BOOL +
+ + +

Parameter is an integer. Any floating-point values passed into , , or will be rounded off (to zero decimal places) before being written into the constant table.

+
+ + bb205380 + D3DXPT_INT + D3DXPT_INT +
+ + +

Parameter is a floating-point number.

+
+ + bb205380 + D3DXPT_FLOAT + D3DXPT_FLOAT +
+ + +

Parameter is a string.

+
+ + bb205380 + D3DXPT_STRING + D3DXPT_STRING +
+ + +

Parameter is a texture.

+
+ + bb205380 + D3DXPT_TEXTURE + D3DXPT_TEXTURE +
+ + +

Parameter is a 1D texture.

+
+ + bb205380 + D3DXPT_TEXTURE1D + D3DXPT_TEXTURE1D +
+ + +

Parameter is a 2D texture.

+
+ + bb205380 + D3DXPT_TEXTURE2D + D3DXPT_TEXTURE2D +
+ + +

Parameter is a 3D texture.

+
+ + bb205380 + D3DXPT_TEXTURE3D + D3DXPT_TEXTURE3D +
+ + +

Parameter is a cube texture.

+
+ + bb205380 + D3DXPT_TEXTURECUBE + D3DXPT_TEXTURECUBE +
+ + +

Parameter is a sampler.

+
+ + bb205380 + D3DXPT_SAMPLER + D3DXPT_SAMPLER +
+ + +

Parameter is a 1D sampler.

+
+ + bb205380 + D3DXPT_SAMPLER1D + D3DXPT_SAMPLER1D +
+ + +

Parameter is a 2D sampler.

+
+ + bb205380 + D3DXPT_SAMPLER2D + D3DXPT_SAMPLER2D +
+ + +

Parameter is a 3D sampler.

+
+ + bb205380 + D3DXPT_SAMPLER3D + D3DXPT_SAMPLER3D +
+ + +

Parameter is a cube sampler.

+
+ + bb205380 + D3DXPT_SAMPLERCUBE + D3DXPT_SAMPLERCUBE +
+ + +

Parameter is a pixel shader.

+
+ + bb205380 + D3DXPT_PIXELSHADER + D3DXPT_PIXELSHADER +
+ + +

Parameter is a vertex shader.

+
+ + bb205380 + D3DXPT_VERTEXSHADER + D3DXPT_VERTEXSHADER +
+ + +

Parameter is a pixel shader fragment.

+
+ + bb205380 + D3DXPT_PIXELFRAGMENT + D3DXPT_PIXELFRAGMENT +
+ + +

Parameter is a vertex shader fragment.

+
+ + bb205380 + D3DXPT_VERTEXFRAGMENT + D3DXPT_VERTEXFRAGMENT +
+ + +

Parameter is not supported.

+
+ + bb205380 + D3DXPT_UNSUPPORTED + D3DXPT_UNSUPPORTED +
+ + +

Defines whether the current tessellation mode is discrete or continuous.

+
+ +

Note that continuous tessellation produces a completely different tessellation pattern from the discrete one for the same tessellation values (this is more apparent in wireframe mode). Thus, 4.0 continuous is not the same as 4 discrete.

+
+ + bb172575 + D3DPATCHEDGESTYLE + D3DPATCHEDGESTYLE +
+ + +

Discrete edge style. In discrete mode, you can specify float tessellation but it will be truncated to integers.

+
+ + bb172575 + D3DPATCHEDGE_DISCRETE + D3DPATCHEDGE_DISCRETE +
+ + +

Continuous edge style. In continuous mode, tessellation is specified as float values that can be smoothly varied to reduce "popping" artifacts.

+
+ + bb172575 + D3DPATCHEDGE_CONTINUOUS + D3DPATCHEDGE_CONTINUOUS +
+ + +

Mesh patch types.

+
+ +

Triangle patches have three sides and are described in . Rectangle patches are four-sided and are described in .

+
+ + bb205384 + D3DXPATCHMESHTYPE + D3DXPATCHMESHTYPE +
+ + +

Rectangle patch mesh type.

+
+ + bb205384 + D3DXPATCHMESH_RECT + D3DXPATCHMESH_RECT +
+ + +

Triangle patch mesh type.

+
+ + bb205384 + D3DXPATCHMESH_TRI + D3DXPATCHMESH_TRI +
+ + +

N-patch mesh type.

+
+ + bb205384 + D3DXPATCHMESH_NPATCH + D3DXPATCHMESH_NPATCH +
+ + + No documentation. + + + D3DPS20CAPS + D3DPS20CAPS + + + + No documentation. + + + D3DPS20CAPS_ARBITRARYSWIZZLE + D3DPS20CAPS_ARBITRARYSWIZZLE + + + + No documentation. + + + D3DPS20CAPS_GRADIENTINSTRUCTIONS + D3DPS20CAPS_GRADIENTINSTRUCTIONS + + + + No documentation. + + + D3DPS20CAPS_PREDICATION + D3DPS20CAPS_PREDICATION + + + + No documentation. + + + D3DPS20CAPS_NODEPENDENTREADLIMIT + D3DPS20CAPS_NODEPENDENTREADLIMIT + + + + No documentation. + + + D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT + D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT + + + + None. + + + None + None + + + +

Defines the type of animation set looping modes used for playback.

+
+ + bb205397 + D3DXPLAYBACK_TYPE + D3DXPLAYBACK_TYPE +
+ + +

The animation repeats endlessly.

+
+ + bb205397 + D3DXPLAY_LOOP + D3DXPLAY_LOOP +
+ + +

The animation plays once, and then it stops on the last frame.

+
+ + bb205397 + D3DXPLAY_ONCE + D3DXPLAY_ONCE +
+ + +

The animation alternates endlessly between playing forward and playing backward.

+
+ + bb205397 + D3DXPLAY_PINGPONG + D3DXPLAY_PINGPONG +
+ + +

Defines the memory class that holds the buffers for a resource.

+
+ +

All pool types are valid with all resources including: vertex buffers, index buffers, textures, and surfaces.

The following tables indicate restrictions on pool types for render targets, depth stencils, and dynamic and mipmap usages. An x indicates a compatible combination; lack of an x indicates incompatibility.

Pool
xx

?

Pool
xx
x
x

?

For more information about usage types, see .

Pools cannot be mixed for different objects contained within one resource (mip levels in a mipmap) and, when a pool is chosen, it cannot be changed.

Applications should use for most static resources because this saves the application from having to deal with lost devices. (Managed resources are restored by the runtime.) This is especially beneficial for unified memory architecture (UMA) systems. Other dynamic resources are not a good match for . In fact, index buffers and vertex buffers cannot be created using together with .

For dynamic textures, it is sometimes desirable to use a pair of video memory and system memory textures, allocating the video memory using and the system memory using . You can lock and modify the bits of the system memory texture using a locking method. Then you can update the video memory texture using .

+
+ + bb172584 + D3DPOOL + D3DPOOL +
+ + +

Resources are placed in the memory pool most appropriate for the set of usages requested for the given resource. This is usually video memory, including both local video memory and AGP memory. The pool is separate from and , and it specifies that the resource is placed in the preferred memory for device access. Note that never indicates that either or should be chosen as the memory pool type for this resource. Textures placed in the pool cannot be locked unless they are dynamic textures or they are private, FOURCC, driver formats. To access unlockable textures, you must use functions such as , , , and . is probably a better choice than for most applications. Note that some textures created in driver-proprietary pixel formats, unknown to the Direct3D runtime, can be locked. Also note that - unlike textures - swap chain back buffers, render targets, vertex buffers, and index buffers can be locked. When a device is lost, resources created using must be released before calling . For more information, see Lost Devices (Direct3D 9).

When creating resources with , if video card memory is already committed, managed resources will be evicted to free enough memory to satisfy the request.

+
+ + bb172584 + D3DPOOL_DEFAULT + D3DPOOL_DEFAULT +
+ + +

Resources are copied automatically to device-accessible memory as needed. Managed resources are backed by system memory and do not need to be recreated when a device is lost. See Managing Resources (Direct3D 9) for more information. Managed resources can be locked. Only the system-memory copy is directly modified. Direct3D copies your changes to driver-accessible memory as needed.

Differences between Direct3D 9 and Direct3D 9Ex:

is valid with ; however, it is not valid with .

?

+
+ + bb172584 + D3DPOOL_MANAGED + D3DPOOL_MANAGED +
+ + +

Resources are placed in memory that is not typically accessible by the Direct3D device. This memory allocation consumes system RAM but does not reduce pageable RAM. These resources do not need to be recreated when a device is lost. Resources in this pool can be locked and can be used as the source for a or operation to a memory resource created with .

+
+ + bb172584 + D3DPOOL_SYSTEMMEM + D3DPOOL_SYSTEMMEM +
+ + +

Resources are placed in system RAM and do not need to be recreated when a device is lost. These resources are not bound by device size or format restrictions. Because of this, these resources cannot be accessed by the Direct3D device nor set as textures or render targets. However, these resources can always be created, locked, and copied.

+
+ + bb172584 + D3DPOOL_SCRATCH + D3DPOOL_SCRATCH +
+ + +

Describes the relationship between the adapter refresh rate and the rate at which Present or Present operations are completed. These values also serve as flag values for the PresentationIntervals field of .

+

+ +

Windowed mode supports , , and . and the are nearly equivalent (see the information regarding timer resolution below). They perform similarly to COPY_VSYNC in that there is only one present per frame, and they prevent tearing with beam-following. In contrast, will attempt to provide an unlimited presentation rate.

Full-screen mode supports similar usage as windowed mode by supporting regardless of the refresh rate or swap effect. uses the default system timer resolution whereas the calls timeBeginPeriod to enhance system timer resolution. This improves the quality of vertical sync, but consumes slightly more processing time. Both parameters attempt to synchronize vertically.

+
+ + bb172585 + D3DPRESENT + D3DPRESENT +
+ + + No documentation. + + + bb172585 + D3DPRESENT_BACK_BUFFERS_MAX + D3DPRESENT_BACK_BUFFERS_MAX + + + + No documentation. + + + bb172585 + D3DPRESENT_BACK_BUFFERS_MAX_EX + D3DPRESENT_BACK_BUFFERS_MAX_EX + + + + No documentation. + + + bb172585 + D3DPRESENT_DONOTWAIT + D3DPRESENT_DONOTWAIT + + + + No documentation. + + + bb172585 + D3DPRESENT_LINEAR_CONTENT + D3DPRESENT_LINEAR_CONTENT + + + + No documentation. + + + bb172585 + D3DPRESENT_DONOTFLIP + D3DPRESENT_DONOTFLIP + + + + No documentation. + + + bb172585 + D3DPRESENT_FLIPRESTART + D3DPRESENT_FLIPRESTART + + + + No documentation. + + + bb172585 + D3DPRESENT_VIDEO_RESTRICT_TO_MONITOR + D3DPRESENT_VIDEO_RESTRICT_TO_MONITOR + + + + No documentation. + + + bb172585 + D3DPRESENT_UPDATEOVERLAYONLY + D3DPRESENT_UPDATEOVERLAYONLY + + + + No documentation. + + + bb172585 + D3DPRESENT_HIDEOVERLAY + D3DPRESENT_HIDEOVERLAY + + + + No documentation. + + + bb172585 + D3DPRESENT_UPDATECOLORKEY + D3DPRESENT_UPDATECOLORKEY + + + + No documentation. + + + bb172585 + D3DPRESENT_FORCEIMMEDIATE + D3DPRESENT_FORCEIMMEDIATE + + + + No documentation. + + + bb172585 + D3DPRESENT_RATE_DEFAULT + D3DPRESENT_RATE_DEFAULT + + + + None. + + + None + None + + + +

Constants used by .

+
+ + bb172586 + D3DPRESENTFLAG + D3DPRESENTFLAG +
+ + + No documentation. + + + bb172586 + D3DPRESENTFLAG_LOCKABLE_BACKBUFFER + D3DPRESENTFLAG_LOCKABLE_BACKBUFFER + + + + No documentation. + + + bb172586 + D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL + D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL + + + + No documentation. + + + bb172586 + D3DPRESENTFLAG_DEVICECLIP + D3DPRESENTFLAG_DEVICECLIP + + + + No documentation. + + + bb172586 + D3DPRESENTFLAG_VIDEO + D3DPRESENTFLAG_VIDEO + + + + No documentation. + + + bb172586 + D3DPRESENTFLAG_NOAUTOROTATE + D3DPRESENTFLAG_NOAUTOROTATE + + + + No documentation. + + + bb172586 + D3DPRESENTFLAG_UNPRUNEDMODE + D3DPRESENTFLAG_UNPRUNEDMODE + + + + No documentation. + + + bb172586 + D3DPRESENTFLAG_OVERLAY_LIMITEDRGB + D3DPRESENTFLAG_OVERLAY_LIMITEDRGB + + + + No documentation. + + + bb172586 + D3DPRESENTFLAG_OVERLAY_YCbCr_BT709 + D3DPRESENTFLAG_OVERLAY_YCbCr_BT709 + + + + No documentation. + + + bb172586 + D3DPRESENTFLAG_OVERLAY_YCbCr_xvYCC + D3DPRESENTFLAG_OVERLAY_YCbCr_xvYCC + + + + No documentation. + + + bb172586 + D3DPRESENTFLAG_RESTRICTED_CONTENT + D3DPRESENTFLAG_RESTRICTED_CONTENT + + + + No documentation. + + + bb172586 + D3DPRESENTFLAG_RESTRICT_SHARED_RESOURCE_DRIVER + D3DPRESENTFLAG_RESTRICT_SHARED_RESOURCE_DRIVER + + + + None. + + + None + None + + + +

Describes the relationship between the adapter refresh rate and the rate at which Present or Present operations are completed. These values also serve as flag values for the PresentationIntervals field of .

+

+ +

Windowed mode supports , , and . and the are nearly equivalent (see the information regarding timer resolution below). They perform similarly to COPY_VSYNC in that there is only one present per frame, and they prevent tearing with beam-following. In contrast, will attempt to provide an unlimited presentation rate.

Full-screen mode supports similar usage as windowed mode by supporting regardless of the refresh rate or swap effect. uses the default system timer resolution whereas the calls timeBeginPeriod to enhance system timer resolution. This improves the quality of vertical sync, but consumes slightly more processing time. Both parameters attempt to synchronize vertically.

+
+ + bb172585 + D3DPRESENT_INTERVAL + D3DPRESENT_INTERVAL +
+ + + No documentation. + + + bb172585 + D3DPRESENT_INTERVAL_DEFAULT + D3DPRESENT_INTERVAL_DEFAULT + + + + No documentation. + + + bb172585 + D3DPRESENT_INTERVAL_ONE + D3DPRESENT_INTERVAL_ONE + + + + No documentation. + + + bb172585 + D3DPRESENT_INTERVAL_TWO + D3DPRESENT_INTERVAL_TWO + + + + No documentation. + + + bb172585 + D3DPRESENT_INTERVAL_THREE + D3DPRESENT_INTERVAL_THREE + + + + No documentation. + + + bb172585 + D3DPRESENT_INTERVAL_FOUR + D3DPRESENT_INTERVAL_FOUR + + + + No documentation. + + + bb172585 + D3DPRESENT_INTERVAL_IMMEDIATE + D3DPRESENT_INTERVAL_IMMEDIATE + + + +

Miscellaneous driver primitive capability flags.

+
+ + bb172583 + D3DPMISCCAPS + D3DPMISCCAPS +
+ + + No documentation. + + + bb172583 + D3DPMISCCAPS_MASKZ + D3DPMISCCAPS_MASKZ + + + + No documentation. + + + bb172583 + D3DPMISCCAPS_CULLNONE + D3DPMISCCAPS_CULLNONE + + + + No documentation. + + + bb172583 + D3DPMISCCAPS_CULLCW + D3DPMISCCAPS_CULLCW + + + + No documentation. + + + bb172583 + D3DPMISCCAPS_CULLCCW + D3DPMISCCAPS_CULLCCW + + + + No documentation. + + + bb172583 + D3DPMISCCAPS_COLORWRITEENABLE + D3DPMISCCAPS_COLORWRITEENABLE + + + + No documentation. + + + bb172583 + D3DPMISCCAPS_CLIPPLANESCALEDPOINTS + D3DPMISCCAPS_CLIPPLANESCALEDPOINTS + + + + No documentation. + + + bb172583 + D3DPMISCCAPS_CLIPTLVERTS + D3DPMISCCAPS_CLIPTLVERTS + + + + No documentation. + + + bb172583 + D3DPMISCCAPS_TSSARGTEMP + D3DPMISCCAPS_TSSARGTEMP + + + + No documentation. + + + bb172583 + D3DPMISCCAPS_BLENDOP + D3DPMISCCAPS_BLENDOP + + + + No documentation. + + + bb172583 + D3DPMISCCAPS_NULLREFERENCE + D3DPMISCCAPS_NULLREFERENCE + + + + No documentation. + + + bb172583 + D3DPMISCCAPS_INDEPENDENTWRITEMASKS + D3DPMISCCAPS_INDEPENDENTWRITEMASKS + + + + No documentation. + + + bb172583 + D3DPMISCCAPS_PERSTAGECONSTANT + D3DPMISCCAPS_PERSTAGECONSTANT + + + + No documentation. + + + bb172583 + D3DPMISCCAPS_FOGANDSPECULARALPHA + D3DPMISCCAPS_FOGANDSPECULARALPHA + + + + No documentation. + + + bb172583 + D3DPMISCCAPS_SEPARATEALPHABLEND + D3DPMISCCAPS_SEPARATEALPHABLEND + + + + No documentation. + + + bb172583 + D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS + D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS + + + + No documentation. + + + bb172583 + D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING + D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING + + + + No documentation. + + + bb172583 + D3DPMISCCAPS_FOGVERTEXCLAMPED + D3DPMISCCAPS_FOGVERTEXCLAMPED + + + + No documentation. + + + bb172583 + D3DPMISCCAPS_POSTBLENDSRGBCONVERT + D3DPMISCCAPS_POSTBLENDSRGBCONVERT + + + +

Defines the primitives supported by Direct3D.

+
+ +

Using Triangle Strips or Triangle Fans (Direct3D 9) is often more efficient than using triangle lists because fewer vertices are duplicated.

+
+ + bb172589 + D3DPRIMITIVETYPE + D3DPRIMITIVETYPE +
+ + +

Renders the vertices as a collection of isolated points. This value is unsupported for indexed primitives.

+
+ + bb172589 + D3DPT_POINTLIST + D3DPT_POINTLIST +
+ + +

Renders the vertices as a list of isolated straight line segments.

+
+ + bb172589 + D3DPT_LINELIST + D3DPT_LINELIST +
+ + +

Renders the vertices as a single polyline.

+
+ + bb172589 + D3DPT_LINESTRIP + D3DPT_LINESTRIP +
+ + +

Renders the specified vertices as a sequence of isolated triangles. Each group of three vertices defines a separate triangle.

Back-face culling is affected by the current winding-order render state.

+
+ + bb172589 + D3DPT_TRIANGLELIST + D3DPT_TRIANGLELIST +
+ + +

Renders the vertices as a triangle strip. The backface-culling flag is automatically flipped on even-numbered triangles.

+
+ + bb172589 + D3DPT_TRIANGLESTRIP + D3DPT_TRIANGLESTRIP +
+ + +

Renders the vertices as a triangle fan.

+
+ + bb172589 + D3DPT_TRIANGLEFAN + D3DPT_TRIANGLEFAN +
+ + +

Identifies the query type. For information about queries, see Queries (Direct3D 9)

+
+ + bb172594 + D3DQUERYTYPE + D3DQUERYTYPE +
+ + + No documentation. + + + bb172594 + D3DQUERYTYPE_VCACHE + D3DQUERYTYPE_VCACHE + + + + No documentation. + + + bb172594 + D3DQUERYTYPE_RESOURCEMANAGER + D3DQUERYTYPE_RESOURCEMANAGER + + + + No documentation. + + + bb172594 + D3DQUERYTYPE_VERTEXSTATS + D3DQUERYTYPE_VERTEXSTATS + + + + No documentation. + + + bb172594 + D3DQUERYTYPE_EVENT + D3DQUERYTYPE_EVENT + + + + No documentation. + + + bb172594 + D3DQUERYTYPE_OCCLUSION + D3DQUERYTYPE_OCCLUSION + + + + No documentation. + + + bb172594 + D3DQUERYTYPE_TIMESTAMP + D3DQUERYTYPE_TIMESTAMP + + + + No documentation. + + + bb172594 + D3DQUERYTYPE_TIMESTAMPDISJOINT + D3DQUERYTYPE_TIMESTAMPDISJOINT + + + + No documentation. + + + bb172594 + D3DQUERYTYPE_TIMESTAMPFREQ + D3DQUERYTYPE_TIMESTAMPFREQ + + + + No documentation. + + + bb172594 + D3DQUERYTYPE_PIPELINETIMINGS + D3DQUERYTYPE_PIPELINETIMINGS + + + + No documentation. + + + bb172594 + D3DQUERYTYPE_INTERFACETIMINGS + D3DQUERYTYPE_INTERFACETIMINGS + + + + No documentation. + + + bb172594 + D3DQUERYTYPE_VERTEXTIMINGS + D3DQUERYTYPE_VERTEXTIMINGS + + + + No documentation. + + + bb172594 + D3DQUERYTYPE_PIXELTIMINGS + D3DQUERYTYPE_PIXELTIMINGS + + + + No documentation. + + + bb172594 + D3DQUERYTYPE_BANDWIDTHTIMINGS + D3DQUERYTYPE_BANDWIDTHTIMINGS + + + + No documentation. + + + bb172594 + D3DQUERYTYPE_CACHEUTILIZATION + D3DQUERYTYPE_CACHEUTILIZATION + + + + No documentation. + + + bb172594 + D3DQUERYTYPE_MEMORYPRESSURE + D3DQUERYTYPE_MEMORYPRESSURE + + + +

A programmable pixel shader is made up of a set of instructions that operate on pixel data. Registers transfer data in and out of the ALU. Additional control can be applied to modify the instruction, the results, or what data gets written out.

  • ps_3_0 Instructions contains a list of the available instructions.
  • ps_3_0 Registers lists the different types of registers used by the pixel shader ALU.
  • Modifiers Are used to modify the way an instruction works.
  • Destination Register Write Mask determines what components of the destination register get written.
  • Pixel Shader Source Register Modifiers alter the source register data before the instruction runs.
  • Source Register Swizzling gives additional control over which register components are read, copied, or written.
+
+ + bb219845 + D3DPRASTERCAPS + D3DPRASTERCAPS +
+ + + No documentation. + + + bb219845 + D3DPRASTERCAPS_DITHER + D3DPRASTERCAPS_DITHER + + + + No documentation. + + + bb219845 + D3DPRASTERCAPS_ZTEST + D3DPRASTERCAPS_ZTEST + + + + No documentation. + + + bb219845 + D3DPRASTERCAPS_FOGVERTEX + D3DPRASTERCAPS_FOGVERTEX + + + + No documentation. + + + bb219845 + D3DPRASTERCAPS_FOGTABLE + D3DPRASTERCAPS_FOGTABLE + + + + No documentation. + + + bb219845 + D3DPRASTERCAPS_MIPMAPLODBIAS + D3DPRASTERCAPS_MIPMAPLODBIAS + + + + No documentation. + + + bb219845 + D3DPRASTERCAPS_ZBUFFERLESSHSR + D3DPRASTERCAPS_ZBUFFERLESSHSR + + + + No documentation. + + + bb219845 + D3DPRASTERCAPS_FOGRANGE + D3DPRASTERCAPS_FOGRANGE + + + + No documentation. + + + bb219845 + D3DPRASTERCAPS_ANISOTROPY + D3DPRASTERCAPS_ANISOTROPY + + + + No documentation. + + + bb219845 + D3DPRASTERCAPS_WBUFFER + D3DPRASTERCAPS_WBUFFER + + + + No documentation. + + + bb219845 + D3DPRASTERCAPS_WFOG + D3DPRASTERCAPS_WFOG + + + + No documentation. + + + bb219845 + D3DPRASTERCAPS_ZFOG + D3DPRASTERCAPS_ZFOG + + + + No documentation. + + + bb219845 + D3DPRASTERCAPS_COLORPERSPECTIVE + D3DPRASTERCAPS_COLORPERSPECTIVE + + + + No documentation. + + + bb219845 + D3DPRASTERCAPS_SCISSORTEST + D3DPRASTERCAPS_SCISSORTEST + + + + No documentation. + + + bb219845 + D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS + D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS + + + + No documentation. + + + bb219845 + D3DPRASTERCAPS_DEPTHBIAS + D3DPRASTERCAPS_DEPTHBIAS + + + + No documentation. + + + bb219845 + D3DPRASTERCAPS_MULTISAMPLE_TOGGLE + D3DPRASTERCAPS_MULTISAMPLE_TOGGLE + + + +

Data type of the register.

+
+ + bb205424 + D3DXREGISTER_SET + D3DXREGISTER_SET +
+ + +

Boolean value.

+
+ + bb205424 + D3DXRS_BOOL + D3DXRS_BOOL +
+ + +

4D integer number.

+
+ + bb205424 + D3DXRS_INT4 + D3DXRS_INT4 +
+ + +

4D floating-point number.

+
+ + bb205424 + D3DXRS_FLOAT4 + D3DXRS_FLOAT4 +
+ + +

The register contains 4D sampler data.

+
+ + bb205424 + D3DXRS_SAMPLER + D3DXRS_SAMPLER +
+ + +

The enumerated type lists a variety of attributes, or render states. The enumerators of that are used exclusively by drivers can specify either rendering information or a texture attribute. The following render states are used by display drivers:

#define D3DRENDERSTATE_EVICTMANAGEDTEXTURES  61	
+            #define D3DRENDERSTATE_SCENECAPTURE          62	
+            #define D3DRS_DELETERTPATCH                  169	
+            #define D3DRS_MAXVERTEXSHADERINST            196	
+            #define D3DRS_MAXPIXELSHADERINST             197

Enumerators

D3DRENDERSTATE_EVICTMANAGEDTEXTURES

Determines whether textures are evicted from memory. + The driver uses a data type without a default value to detect whether to evict.

This render state determines whether the driver evicts textures that it manages (as opposed to textures managed by the Direct3D runtime) from video memory. If the render state value is TRUE, the driver evicts the textures. Otherwise, the driver does not evict those textures.

D3DRENDERSTATE_SCENECAPTURE

Specifies either begin scene information or end scene information for geometric data captured within a frame. + The driver uses a data type with a default value of TRUE to detect scene-capture information.

The driver responds to D3DRENDERSTATE_SCENECAPTURE first with TRUE for begin scene information and next with for end scene information to capture geometric data within a frame. + See the permedia2 sample driver that ships with the Windows Driver Development Kit (DDK) for an example implementation. + Using the D3DRENDERSTATE_SCENECAPTURE render state in a D3dDrawPrimitives2 call replaces the legacy D3DHALCallbacks->D3dSceneCapture callback routine.

Care must be taken in updating a driver that implements the legacy D3DHALCallbacks->D3dSceneCapture callback routine to one using the D3DRENDERSTATE_SCENECAPTURE render state. The D3dSceneCapture callback routine uses the constants D3DHAL_SCENE_CAPTURE_START and D3DHAL_SCENE_CAPTURE_END to indicate, respectively, the beginning and end of a scene. The values of these constants are, respectively, 0 and 1. If you use these constants in place of TRUE and in this render state, the meaning will be the exact opposite of what you intend.

D3DRS_DELETERTPATCH

DirectX 8.0 and later versions only.

Deletes either a rectangular or triangular patch from memory. + The driver uses a DWORD data type without a default value to detect the patch to delete.

This render state notifies the driver that a patch is to be deleted. The value of this render state is the handle to the patch affected. All cached information should be freed and the handle should be removed from the driver's patch handle table. This render state is not visible to applications but is generated internally when an application calls the DeletePatch function. This render state is sent to the driver only when patches are deleted by DeletePatch explicitly. All other patches should be cleaned up when the device is destroyed.

D3DRS_MAXVERTEXSHADERINST

DirectX 9.0 and later versions only.

Determines the maximum number of instructions that the vertex shader assembler can execute.

The driver uses a DWORD data type with a default value of D3DINFINITEINSTRUCTIONS (0xffffffff) to report the maximum number of vertex-shader instructions. + This maximum number depends on the version of the vertex shader that the display device supports as shown in the following table.

VersionMaximum number
earlier than 2_00
2_0 and laterFrom 216 (0x0000ffff) to D3DINFINITEINSTRUCTIONS

?

D3DINFINITEINSTRUCTIONS represents a virtually unlimited amount.

Valid values for this render state are numbers that are powers of 2; if the driver sets any other integer, the runtime uses the next nearest power of 2 number.

The runtime sets the MaxVShaderInstructionsExecuted member of the structure to this maximum number.

D3DRS_MAXPIXELSHADERINST

DirectX 9.0 and later versions only.

Determines the maximum number of instructions that the pixel shader assembler can execute.

The driver uses a DWORD data type with a default value of D3DINFINITEINSTRUCTIONS (0xffffffff) to report the maximum number of pixel-shader instructions. + This maximum number depends on the version of the pixel shader that the display device supports as shown in the following table.

VersionMaximum number
earlier than 2_00
2_0From 96 to D3DINFINITEINSTRUCTIONS
3_0 and laterFrom 216 (0x0000ffff) to D3DINFINITEINSTRUCTIONS

?

D3DINFINITEINSTRUCTIONS represents a virtually unlimited amount.

Valid values for this render state are numbers that are powers of 2; if the driver sets any other integer, the runtime uses the next nearest power of 2 number.

The runtime sets the MaxVShaderInstructionsExecuted member of the structure to this maximum number.

+
+ +

The driver uses these render states when it performs graphics rendering. Only render states that are specific to drivers are included in the Windows Driver Kit (WDK) documentation. The render states accessible to DirectX applications are included in the DirectX SDK documentation. These application-level render states include such characteristics as whether alpha blending is enabled, whether dithering is enabled, whether Direct3D lighting is used, and the type of shading to be used.

To update a particular render state, Direct3D stores information about the render state, and then calls the driver's D3dDrawPrimitives2 callback routine. The information provided to the driver enables it to:

  • Determine that it should update one or more render states.

  • Identify which render states to update, and what the new render state values should be.

Note that for certain render states to be honored, the driver must have previously set capability flags in the relevant member of the D3DPRIMCAPS structure.

In order to indicate a specific render state update, Direct3D inserts a D3DHAL_DP2COMMAND structure into the command buffer, setting the bCommand member of this structure to D3DDP2OP_RENDERSTATE (see the description for D3DDP2OP_RENDERSTATE in D3DHAL_DP2OPERATION), and setting the wStateCount member of the same structure to the number of render states to be updated.

Immediately following the D3DHAL_DP2COMMAND structure, Direct3D inserts one D3DHAL_DP2RENDERSTATE structure into the command buffer for each render state to be updated. The RenderState member of this structure identifies the render state to be changed; the new value of this render state is specified in either the dwState member (for DWORD values) or the fState member (for D3DVALUE values).

The following figure shows a portion of the command buffer containing a D3DDP2OP_RENDERSTATE command and two D3DHAL_DP2RENDERSTATE structures. The first of the three structures indicates that two render states are to be updated. The second structure indicates that the D3DRENDERSTATE_FILLMODE render state is to be changed to . The third structure indicates that the D3DRENDERSTATE_SHADEMODE render state should be updated to .

Additional Notes

See the , , and D3DTEXTUREFILTER enumerated types in the DirectX SDK documentation for complete listings of all of the enabled render state types.

Some changes have been made to the enumerated type for DirectX 5.0 and beyond. D3DRENDERSTATE_BLENDENABLE has been removed completely although it is defined as D3DRENDERSTATE_ALPHABLENDENABLE in the d3dtypes.h header file. See D3DRENDERSTATE_COLORKEYENABLE for an explanation. The 128 integer values in the interval [128, 255] are reserved for texture coordinate wrap flags. These are constructed with the D3DWRAP_U and D3DWRAP_V macros. Using a flags word preserves forward compatibility with texture coordinates of higher dimension than 2D.

Multitexture macro ops and D3DRENDERSTATE_TEXTUREFACTOR override all of the per-texture stage blending controls (COLOR{OP,ARG1,ARG2} & ALPHA{OP,ARG1,ARG2}).

+
+ + ff549036 + D3DRENDERSTATETYPE + D3DRENDERSTATETYPE +
+ + +

Determines whether textures are evicted from memory. + The driver uses a data type without a default value to detect whether to evict.

This render state determines whether the driver evicts textures that it manages (as opposed to textures managed by the Direct3D runtime) from video memory. If the render state value is TRUE, the driver evicts the textures. Otherwise, the driver does not evict those textures.

+
+ + ff549036 + D3DRS_ZENABLE + D3DRS_ZENABLE +
+ + +

Specifies either begin scene information or end scene information for geometric data captured within a frame. + The driver uses a data type with a default value of TRUE to detect scene-capture information.

The driver responds to D3DRENDERSTATE_SCENECAPTURE first with TRUE for begin scene information and next with for end scene information to capture geometric data within a frame. + See the permedia2 sample driver that ships with the Windows Driver Development Kit (DDK) for an example implementation. + Using the D3DRENDERSTATE_SCENECAPTURE render state in a D3dDrawPrimitives2 call replaces the legacy D3DHALCallbacks->D3dSceneCapture callback routine.

Care must be taken in updating a driver that implements the legacy D3DHALCallbacks->D3dSceneCapture callback routine to one using the D3DRENDERSTATE_SCENECAPTURE render state. The D3dSceneCapture callback routine uses the constants D3DHAL_SCENE_CAPTURE_START and D3DHAL_SCENE_CAPTURE_END to indicate, respectively, the beginning and end of a scene. The values of these constants are, respectively, 0 and 1. If you use these constants in place of TRUE and in this render state, the meaning will be the exact opposite of what you intend.

+
+ + ff549036 + D3DRS_FILLMODE + D3DRS_FILLMODE +
+ + +

DirectX 8.0 and later versions only.

Deletes either a rectangular or triangular patch from memory. + The driver uses a DWORD data type without a default value to detect the patch to delete.

This render state notifies the driver that a patch is to be deleted. The value of this render state is the handle to the patch affected. All cached information should be freed and the handle should be removed from the driver's patch handle table. This render state is not visible to applications but is generated internally when an application calls the DeletePatch function. This render state is sent to the driver only when patches are deleted by DeletePatch explicitly. All other patches should be cleaned up when the device is destroyed.

+
+ + ff549036 + D3DRS_SHADEMODE + D3DRS_SHADEMODE +
+ + +

DirectX 9.0 and later versions only.

Determines the maximum number of instructions that the vertex shader assembler can execute.

The driver uses a DWORD data type with a default value of D3DINFINITEINSTRUCTIONS (0xffffffff) to report the maximum number of vertex-shader instructions. + This maximum number depends on the version of the vertex shader that the display device supports as shown in the following table.

VersionMaximum number
earlier than 2_00
2_0 and laterFrom 216 (0x0000ffff) to D3DINFINITEINSTRUCTIONS

?

D3DINFINITEINSTRUCTIONS represents a virtually unlimited amount.

Valid values for this render state are numbers that are powers of 2; if the driver sets any other integer, the runtime uses the next nearest power of 2 number.

The runtime sets the MaxVShaderInstructionsExecuted member of the structure to this maximum number.

+
+ + ff549036 + D3DRS_ZWRITEENABLE + D3DRS_ZWRITEENABLE +
+ + +

DirectX 9.0 and later versions only.

Determines the maximum number of instructions that the pixel shader assembler can execute.

The driver uses a DWORD data type with a default value of D3DINFINITEINSTRUCTIONS (0xffffffff) to report the maximum number of pixel-shader instructions. + This maximum number depends on the version of the pixel shader that the display device supports as shown in the following table.

VersionMaximum number
earlier than 2_00
2_0From 96 to D3DINFINITEINSTRUCTIONS
3_0 and laterFrom 216 (0x0000ffff) to D3DINFINITEINSTRUCTIONS

?

D3DINFINITEINSTRUCTIONS represents a virtually unlimited amount.

Valid values for this render state are numbers that are powers of 2; if the driver sets any other integer, the runtime uses the next nearest power of 2 number.

The runtime sets the MaxVShaderInstructionsExecuted member of the structure to this maximum number.

+
+ + ff549036 + D3DRS_ALPHATESTENABLE + D3DRS_ALPHATESTENABLE +
+ + + No documentation. + + + ff549036 + D3DRS_LASTPIXEL + D3DRS_LASTPIXEL + + + + No documentation. + + + ff549036 + D3DRS_SRCBLEND + D3DRS_SRCBLEND + + + + No documentation. + + + ff549036 + D3DRS_DESTBLEND + D3DRS_DESTBLEND + + + + No documentation. + + + ff549036 + D3DRS_CULLMODE + D3DRS_CULLMODE + + + + No documentation. + + + ff549036 + D3DRS_ZFUNC + D3DRS_ZFUNC + + + + No documentation. + + + ff549036 + D3DRS_ALPHAREF + D3DRS_ALPHAREF + + + + No documentation. + + + ff549036 + D3DRS_ALPHAFUNC + D3DRS_ALPHAFUNC + + + + No documentation. + + + ff549036 + D3DRS_DITHERENABLE + D3DRS_DITHERENABLE + + + + No documentation. + + + ff549036 + D3DRS_ALPHABLENDENABLE + D3DRS_ALPHABLENDENABLE + + + + No documentation. + + + ff549036 + D3DRS_FOGENABLE + D3DRS_FOGENABLE + + + + No documentation. + + + ff549036 + D3DRS_SPECULARENABLE + D3DRS_SPECULARENABLE + + + + No documentation. + + + ff549036 + D3DRS_FOGCOLOR + D3DRS_FOGCOLOR + + + + No documentation. + + + ff549036 + D3DRS_FOGTABLEMODE + D3DRS_FOGTABLEMODE + + + + No documentation. + + + ff549036 + D3DRS_FOGSTART + D3DRS_FOGSTART + + + + No documentation. + + + ff549036 + D3DRS_FOGEND + D3DRS_FOGEND + + + + No documentation. + + + ff549036 + D3DRS_FOGDENSITY + D3DRS_FOGDENSITY + + + + No documentation. + + + ff549036 + D3DRS_RANGEFOGENABLE + D3DRS_RANGEFOGENABLE + + + + No documentation. + + + ff549036 + D3DRS_STENCILENABLE + D3DRS_STENCILENABLE + + + + No documentation. + + + ff549036 + D3DRS_STENCILFAIL + D3DRS_STENCILFAIL + + + + No documentation. + + + ff549036 + D3DRS_STENCILZFAIL + D3DRS_STENCILZFAIL + + + + No documentation. + + + ff549036 + D3DRS_STENCILPASS + D3DRS_STENCILPASS + + + + No documentation. + + + ff549036 + D3DRS_STENCILFUNC + D3DRS_STENCILFUNC + + + + No documentation. + + + ff549036 + D3DRS_STENCILREF + D3DRS_STENCILREF + + + + No documentation. + + + ff549036 + D3DRS_STENCILMASK + D3DRS_STENCILMASK + + + + No documentation. + + + ff549036 + D3DRS_STENCILWRITEMASK + D3DRS_STENCILWRITEMASK + + + + No documentation. + + + ff549036 + D3DRS_TEXTUREFACTOR + D3DRS_TEXTUREFACTOR + + + + No documentation. + + + ff549036 + D3DRS_WRAP0 + D3DRS_WRAP0 + + + + No documentation. + + + ff549036 + D3DRS_WRAP1 + D3DRS_WRAP1 + + + + No documentation. + + + ff549036 + D3DRS_WRAP2 + D3DRS_WRAP2 + + + + No documentation. + + + ff549036 + D3DRS_WRAP3 + D3DRS_WRAP3 + + + + No documentation. + + + ff549036 + D3DRS_WRAP4 + D3DRS_WRAP4 + + + + No documentation. + + + ff549036 + D3DRS_WRAP5 + D3DRS_WRAP5 + + + + No documentation. + + + ff549036 + D3DRS_WRAP6 + D3DRS_WRAP6 + + + + No documentation. + + + ff549036 + D3DRS_WRAP7 + D3DRS_WRAP7 + + + + No documentation. + + + ff549036 + D3DRS_CLIPPING + D3DRS_CLIPPING + + + + No documentation. + + + ff549036 + D3DRS_LIGHTING + D3DRS_LIGHTING + + + + No documentation. + + + ff549036 + D3DRS_AMBIENT + D3DRS_AMBIENT + + + + No documentation. + + + ff549036 + D3DRS_FOGVERTEXMODE + D3DRS_FOGVERTEXMODE + + + + No documentation. + + + ff549036 + D3DRS_COLORVERTEX + D3DRS_COLORVERTEX + + + + No documentation. + + + ff549036 + D3DRS_LOCALVIEWER + D3DRS_LOCALVIEWER + + + + No documentation. + + + ff549036 + D3DRS_NORMALIZENORMALS + D3DRS_NORMALIZENORMALS + + + + No documentation. + + + ff549036 + D3DRS_DIFFUSEMATERIALSOURCE + D3DRS_DIFFUSEMATERIALSOURCE + + + + No documentation. + + + ff549036 + D3DRS_SPECULARMATERIALSOURCE + D3DRS_SPECULARMATERIALSOURCE + + + + No documentation. + + + ff549036 + D3DRS_AMBIENTMATERIALSOURCE + D3DRS_AMBIENTMATERIALSOURCE + + + + No documentation. + + + ff549036 + D3DRS_EMISSIVEMATERIALSOURCE + D3DRS_EMISSIVEMATERIALSOURCE + + + + No documentation. + + + ff549036 + D3DRS_VERTEXBLEND + D3DRS_VERTEXBLEND + + + + No documentation. + + + ff549036 + D3DRS_CLIPPLANEENABLE + D3DRS_CLIPPLANEENABLE + + + + No documentation. + + + ff549036 + D3DRS_POINTSIZE + D3DRS_POINTSIZE + + + + No documentation. + + + ff549036 + D3DRS_POINTSIZE_MIN + D3DRS_POINTSIZE_MIN + + + + No documentation. + + + ff549036 + D3DRS_POINTSPRITEENABLE + D3DRS_POINTSPRITEENABLE + + + + No documentation. + + + ff549036 + D3DRS_POINTSCALEENABLE + D3DRS_POINTSCALEENABLE + + + + No documentation. + + + ff549036 + D3DRS_POINTSCALE_A + D3DRS_POINTSCALE_A + + + + No documentation. + + + ff549036 + D3DRS_POINTSCALE_B + D3DRS_POINTSCALE_B + + + + No documentation. + + + ff549036 + D3DRS_POINTSCALE_C + D3DRS_POINTSCALE_C + + + + No documentation. + + + ff549036 + D3DRS_MULTISAMPLEANTIALIAS + D3DRS_MULTISAMPLEANTIALIAS + + + + No documentation. + + + ff549036 + D3DRS_MULTISAMPLEMASK + D3DRS_MULTISAMPLEMASK + + + + No documentation. + + + ff549036 + D3DRS_PATCHEDGESTYLE + D3DRS_PATCHEDGESTYLE + + + + No documentation. + + + ff549036 + D3DRS_DEBUGMONITORTOKEN + D3DRS_DEBUGMONITORTOKEN + + + + No documentation. + + + ff549036 + D3DRS_POINTSIZE_MAX + D3DRS_POINTSIZE_MAX + + + + No documentation. + + + ff549036 + D3DRS_INDEXEDVERTEXBLENDENABLE + D3DRS_INDEXEDVERTEXBLENDENABLE + + + + No documentation. + + + ff549036 + D3DRS_COLORWRITEENABLE + D3DRS_COLORWRITEENABLE + + + + No documentation. + + + ff549036 + D3DRS_TWEENFACTOR + D3DRS_TWEENFACTOR + + + + No documentation. + + + ff549036 + D3DRS_BLENDOP + D3DRS_BLENDOP + + + + No documentation. + + + ff549036 + D3DRS_POSITIONDEGREE + D3DRS_POSITIONDEGREE + + + + No documentation. + + + ff549036 + D3DRS_NORMALDEGREE + D3DRS_NORMALDEGREE + + + + No documentation. + + + ff549036 + D3DRS_SCISSORTESTENABLE + D3DRS_SCISSORTESTENABLE + + + + No documentation. + + + ff549036 + D3DRS_SLOPESCALEDEPTHBIAS + D3DRS_SLOPESCALEDEPTHBIAS + + + + No documentation. + + + ff549036 + D3DRS_ANTIALIASEDLINEENABLE + D3DRS_ANTIALIASEDLINEENABLE + + + + No documentation. + + + ff549036 + D3DRS_MINTESSELLATIONLEVEL + D3DRS_MINTESSELLATIONLEVEL + + + + No documentation. + + + ff549036 + D3DRS_MAXTESSELLATIONLEVEL + D3DRS_MAXTESSELLATIONLEVEL + + + + No documentation. + + + ff549036 + D3DRS_ADAPTIVETESS_X + D3DRS_ADAPTIVETESS_X + + + + No documentation. + + + ff549036 + D3DRS_ADAPTIVETESS_Y + D3DRS_ADAPTIVETESS_Y + + + + No documentation. + + + ff549036 + D3DRS_ADAPTIVETESS_Z + D3DRS_ADAPTIVETESS_Z + + + + No documentation. + + + ff549036 + D3DRS_ADAPTIVETESS_W + D3DRS_ADAPTIVETESS_W + + + + No documentation. + + + ff549036 + D3DRS_ENABLEADAPTIVETESSELLATION + D3DRS_ENABLEADAPTIVETESSELLATION + + + + No documentation. + + + ff549036 + D3DRS_TWOSIDEDSTENCILMODE + D3DRS_TWOSIDEDSTENCILMODE + + + + No documentation. + + + ff549036 + D3DRS_CCW_STENCILFAIL + D3DRS_CCW_STENCILFAIL + + + + No documentation. + + + ff549036 + D3DRS_CCW_STENCILZFAIL + D3DRS_CCW_STENCILZFAIL + + + + No documentation. + + + ff549036 + D3DRS_CCW_STENCILPASS + D3DRS_CCW_STENCILPASS + + + + No documentation. + + + ff549036 + D3DRS_CCW_STENCILFUNC + D3DRS_CCW_STENCILFUNC + + + + No documentation. + + + ff549036 + D3DRS_COLORWRITEENABLE1 + D3DRS_COLORWRITEENABLE1 + + + + No documentation. + + + ff549036 + D3DRS_COLORWRITEENABLE2 + D3DRS_COLORWRITEENABLE2 + + + + No documentation. + + + ff549036 + D3DRS_COLORWRITEENABLE3 + D3DRS_COLORWRITEENABLE3 + + + + No documentation. + + + ff549036 + D3DRS_BLENDFACTOR + D3DRS_BLENDFACTOR + + + + No documentation. + + + ff549036 + D3DRS_SRGBWRITEENABLE + D3DRS_SRGBWRITEENABLE + + + + No documentation. + + + ff549036 + D3DRS_DEPTHBIAS + D3DRS_DEPTHBIAS + + + + No documentation. + + + ff549036 + D3DRS_WRAP8 + D3DRS_WRAP8 + + + + No documentation. + + + ff549036 + D3DRS_WRAP9 + D3DRS_WRAP9 + + + + No documentation. + + + ff549036 + D3DRS_WRAP10 + D3DRS_WRAP10 + + + + No documentation. + + + ff549036 + D3DRS_WRAP11 + D3DRS_WRAP11 + + + + No documentation. + + + ff549036 + D3DRS_WRAP12 + D3DRS_WRAP12 + + + + No documentation. + + + ff549036 + D3DRS_WRAP13 + D3DRS_WRAP13 + + + + No documentation. + + + ff549036 + D3DRS_WRAP14 + D3DRS_WRAP14 + + + + No documentation. + + + ff549036 + D3DRS_WRAP15 + D3DRS_WRAP15 + + + + No documentation. + + + ff549036 + D3DRS_SEPARATEALPHABLENDENABLE + D3DRS_SEPARATEALPHABLENDENABLE + + + + No documentation. + + + ff549036 + D3DRS_SRCBLENDALPHA + D3DRS_SRCBLENDALPHA + + + + No documentation. + + + ff549036 + D3DRS_DESTBLENDALPHA + D3DRS_DESTBLENDALPHA + + + + No documentation. + + + ff549036 + D3DRS_BLENDOPALPHA + D3DRS_BLENDOPALPHA + + + + No documentation. + + + D3DX_RESOURCE_RESIDENCY + D3DX_RESOURCE_RESIDENCY + + + + No documentation. + + + D3DX_RESOURCE_RESIDENCY_RESIDENT + D3DX_RESOURCE_RESIDENCY_RESIDENT + + + + No documentation. + + + D3DX_RESOURCE_RESIDENCY_RESIDENT_IN_SHARED_MEMORY + D3DX_RESOURCE_RESIDENCY_RESIDENT_IN_SHARED_MEMORY + + + + No documentation. + + + D3DX_RESOURCE_RESIDENCY_NOT_RESIDENT + D3DX_RESOURCE_RESIDENCY_NOT_RESIDENT + + + + No documentation. + + + D3DRESOURCETYPE + D3DRESOURCETYPE + + + + No documentation. + + + D3DRTYPE_SURFACE + D3DRTYPE_SURFACE + + + + No documentation. + + + D3DRTYPE_VOLUME + D3DRTYPE_VOLUME + + + + No documentation. + + + D3DRTYPE_TEXTURE + D3DRTYPE_TEXTURE + + + + No documentation. + + + D3DRTYPE_VOLUMETEXTURE + D3DRTYPE_VOLUMETEXTURE + + + + No documentation. + + + D3DRTYPE_CUBETEXTURE + D3DRTYPE_CUBETEXTURE + + + + No documentation. + + + D3DRTYPE_VERTEXBUFFER + D3DRTYPE_VERTEXBUFFER + + + + No documentation. + + + D3DRTYPE_INDEXBUFFER + D3DRTYPE_INDEXBUFFER + + + +

Sampler states define texture sampling operations such as texture addressing and texture filtering. Some sampler states set-up vertex processing, and some set-up pixel processing. Sampler states can be saved and restored using stateblocks (see State Blocks Save and Restore State (Direct3D 9)).

+
+ + bb172602 + D3DSAMPLERSTATETYPE + D3DSAMPLERSTATETYPE +
+ + + No documentation. + + + bb172602 + D3DSAMP_ADDRESSU + D3DSAMP_ADDRESSU + + + + No documentation. + + + bb172602 + D3DSAMP_ADDRESSV + D3DSAMP_ADDRESSV + + + + No documentation. + + + bb172602 + D3DSAMP_ADDRESSW + D3DSAMP_ADDRESSW + + + + No documentation. + + + bb172602 + D3DSAMP_BORDERCOLOR + D3DSAMP_BORDERCOLOR + + + + No documentation. + + + bb172602 + D3DSAMP_MAGFILTER + D3DSAMP_MAGFILTER + + + + No documentation. + + + bb172602 + D3DSAMP_MINFILTER + D3DSAMP_MINFILTER + + + + No documentation. + + + bb172602 + D3DSAMP_MIPFILTER + D3DSAMP_MIPFILTER + + + + No documentation. + + + bb172602 + D3DSAMP_MIPMAPLODBIAS + D3DSAMP_MIPMAPLODBIAS + + + + No documentation. + + + bb172602 + D3DSAMP_MAXMIPLEVEL + D3DSAMP_MAXMIPLEVEL + + + + No documentation. + + + bb172602 + D3DSAMP_MAXANISOTROPY + D3DSAMP_MAXANISOTROPY + + + + No documentation. + + + bb172602 + D3DSAMP_SRGBTEXTURE + D3DSAMP_SRGBTEXTURE + + + + No documentation. + + + bb172602 + D3DSAMP_ELEMENTINDEX + D3DSAMP_ELEMENTINDEX + + + + No documentation. + + + bb172602 + D3DSAMP_DMAPOFFSET + D3DSAMP_DMAPOFFSET + + + +

Defines the sampler texture types for vertex shaders.

+
+ + bb172603 + D3DSAMPLER_TEXTURE_TYPE + D3DSAMPLER_TEXTURE_TYPE +
+ + +

Uninitialized value. The value of this element is D3DSP_TEXTURETYPE_SHIFT.

+
+ + bb172603 + D3DSTT_UNKNOWN + D3DSTT_UNKNOWN +
+ + +

Declaring a 2D texture. The value of this element is D3DSP_TEXTURETYPE_SHIFT * 4.

+
+ + bb172603 + D3DSTT_2D + D3DSTT_2D +
+ + +

Declaring a cube texture. The value of this element is D3DSP_TEXTURETYPE_SHIFT * 8.

+
+ + bb172603 + D3DSTT_CUBE + D3DSTT_CUBE +
+ + +

Declaring a volume texture. The value of this element is D3DSP_TEXTURETYPE_SHIFT * 16.

+
+ + bb172603 + D3DSTT_VOLUME + D3DSTT_VOLUME +
+ + +

Flags indicating the method the rasterizer uses to create an image on a surface.

+
+ +

This enumeration is used as a member in and .

+
+ + bb172604 + D3DSCANLINEORDERING + D3DSCANLINEORDERING +
+ + +

The image is created from the first scanline to the last without skipping any.

+
+ + bb172604 + D3DSCANLINEORDERING_UNKNOWN + D3DSCANLINEORDERING_UNKNOWN +
+ + +

The image is created using the interlaced method in which odd-numbered lines are drawn on odd-numbered passes and even lines are drawn on even-numbered passes.

+
+ + bb172604 + D3DSCANLINEORDERING_PROGRESSIVE + D3DSCANLINEORDERING_PROGRESSIVE +
+ + +

The image is created using the interlaced method in which odd-numbered lines are drawn on odd-numbered passes and even lines are drawn on even-numbered passes.

+
+ + bb172604 + D3DSCANLINEORDERING_INTERLACED + D3DSCANLINEORDERING_INTERLACED +
+ + +

The following page provides a basic outline of key differences between Direct3D 9 and Direct3D 10. The outline below provides some insight to assist developers with Direct3D 9 experience to explore and relate to Direct3D 10.

Although the info in this topic compares Direct3D 9 with Direct3D 10, because Direct3D 11 builds on the improvements made in Direct3D 10 and 10.1, you also need this info to migrate from Direct3D 9 to Direct3D 11. For info about moving beyond Direct3D 10 to Direct3D 11, see Migrating to Direct3D 11.

  • Overview
    • Removal
    • Device
  • Engine
    • Direct
  • Tricks
    • Overriding
    • Resolving
    • Simulating
  • Driving
    • Resource
    • Views
    • Static
    • Direct3D
    • HLSL
    • Shader
    • Creation
    • Shader
    • Input
    • Impact
    • Vertex
    • State
  • Porting
    • File
    • Mapping
  • Porting
    • Direct3D
    • Shader
    • HLSL
    • Constant
    • User
  • Additional
    • Integers
    • Mouse
    • Mapping
    • Reference
    • Test
    • StretchRect
  • Additional
  • Related
+
+ + bb205073 + D3DPSHADECAPS + D3DPSHADECAPS +
+ + + No documentation. + + + bb205073 + D3DPSHADECAPS_COLORGOURAUDRGB + D3DPSHADECAPS_COLORGOURAUDRGB + + + + No documentation. + + + bb205073 + D3DPSHADECAPS_SPECULARGOURAUDRGB + D3DPSHADECAPS_SPECULARGOURAUDRGB + + + + No documentation. + + + bb205073 + D3DPSHADECAPS_ALPHAGOURAUDBLEND + D3DPSHADECAPS_ALPHAGOURAUDBLEND + + + + No documentation. + + + bb205073 + D3DPSHADECAPS_FOGGOURAUD + D3DPSHADECAPS_FOGGOURAUD + + + +

Defines constants that describe the supported shading modes.

+
+ +

The first vertex of a triangle for flat shading mode is defined in the following manner.

  • For a triangle list, the first vertex of the triangle i is i * 3.
  • For a triangle strip, the first vertex of the triangle i is vertex i.
  • For a triangle fan, the first vertex of the triangle i is vertex i + 1.

The members of this enumerated type define the vales for the render state.

+
+ + bb172605 + D3DSHADEMODE + D3DSHADEMODE +
+ + +

Flat shading mode. The color and specular component of the first vertex in the triangle are used to determine the color and specular component of the face. These colors remain constant across the triangle; that is, they are not interpolated. The specular alpha is interpolated. See Remarks.

+
+ + bb172605 + D3DSHADE_FLAT + D3DSHADE_FLAT +
+ + +

Gouraud shading mode. The color and specular components of the face are determined by a linear interpolation between all three of the triangle's vertices.

+
+ + bb172605 + D3DSHADE_GOURAUD + D3DSHADE_GOURAUD +
+ + +

Not supported.

+
+ + bb172605 + D3DSHADE_PHONG + D3DSHADE_PHONG +
+ + +

The flags are used for parsing, compiling, or assembling shaders.

Parser flags

Parse time flags are only used by the effect system (before effect compilation) when you create an effect compiler. For example, you could create a compiler object with , and then use that compiler object repeatedly with different compiler flags to generate specialized code.

+
+ +

The effect system will use parser flags when called by the following functions:

  • CompileEffect

The effect system will use compiler flags when called by the following functions:

  • (or or )
  • CompileEffect (or CompileShader)

In addition, you can use compiler flags when creating an effect by calling (or or ).

  • If you pass in an uncompiled .fx file, the effect system will use the flag input parameter during compilation.
  • If you pass in a compiled effect, the effect system will ignore the compiler flags since they are not needed to load the effect.

The effect system will use assembler flags when called by the following functions:

Applying compiler flags or assembler flags to the incorrect API will fail shader validation. Check the Direct3D error code return value from the function (with the DirectX Error Lookup Tool) to help track down this error.

+
+ + bb205441 + D3DXSHADER + D3DXSHADER +
+ + + No documentation. + + + bb205441 + D3DXSHADER_DEBUG + D3DXSHADER_DEBUG + + + + No documentation. + + + bb205441 + D3DXSHADER_SKIPVALIDATION + D3DXSHADER_SKIPVALIDATION + + + + No documentation. + + + bb205441 + D3DXSHADER_SKIPOPTIMIZATION + D3DXSHADER_SKIPOPTIMIZATION + + + + No documentation. + + + bb205441 + D3DXSHADER_PACKMATRIX_ROWMAJOR + D3DXSHADER_PACKMATRIX_ROWMAJOR + + + + No documentation. + + + bb205441 + D3DXSHADER_PACKMATRIX_COLUMNMAJOR + D3DXSHADER_PACKMATRIX_COLUMNMAJOR + + + + No documentation. + + + bb205441 + D3DXSHADER_PARTIALPRECISION + D3DXSHADER_PARTIALPRECISION + + + + No documentation. + + + bb205441 + D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT + D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT + + + + No documentation. + + + bb205441 + D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT + D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT + + + + No documentation. + + + bb205441 + D3DXSHADER_NO_PRESHADER + D3DXSHADER_NO_PRESHADER + + + + No documentation. + + + bb205441 + D3DXSHADER_AVOID_FLOW_CONTROL + D3DXSHADER_AVOID_FLOW_CONTROL + + + + No documentation. + + + bb205441 + D3DXSHADER_PREFER_FLOW_CONTROL + D3DXSHADER_PREFER_FLOW_CONTROL + + + + No documentation. + + + bb205441 + D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY + D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY + + + + No documentation. + + + bb205441 + D3DXSHADER_IEEE_STRICTNESS + D3DXSHADER_IEEE_STRICTNESS + + + + No documentation. + + + bb205441 + D3DXSHADER_USE_LEGACY_D3DX9_31_DLL + D3DXSHADER_USE_LEGACY_D3DX9_31_DLL + + + + No documentation. + + + bb205441 + D3DXSHADER_OPTIMIZATION_LEVEL0 + D3DXSHADER_OPTIMIZATION_LEVEL0 + + + + No documentation. + + + bb205441 + D3DXSHADER_OPTIMIZATION_LEVEL1 + D3DXSHADER_OPTIMIZATION_LEVEL1 + + + + No documentation. + + + bb205441 + D3DXSHADER_OPTIMIZATION_LEVEL2 + D3DXSHADER_OPTIMIZATION_LEVEL2 + + + + No documentation. + + + bb205441 + D3DXSHADER_OPTIMIZATION_LEVEL3 + D3DXSHADER_OPTIMIZATION_LEVEL3 + + + + None. + + + None + None + + + +

The following flags are used to specify sprite rendering options to the flags parameter in the Begin method:

+
+ + bb205466 + D3DXSPRITE + D3DXSPRITE +
+ + + No documentation. + + + bb205466 + D3DXSPRITE_DONOTSAVESTATE + D3DXSPRITE_DONOTSAVESTATE + + + + No documentation. + + + bb205466 + D3DXSPRITE_DONOTMODIFY_RENDERSTATE + D3DXSPRITE_DONOTMODIFY_RENDERSTATE + + + + No documentation. + + + bb205466 + D3DXSPRITE_OBJECTSPACE + D3DXSPRITE_OBJECTSPACE + + + + No documentation. + + + bb205466 + D3DXSPRITE_BILLBOARD + D3DXSPRITE_BILLBOARD + + + + No documentation. + + + bb205466 + D3DXSPRITE_ALPHABLEND + D3DXSPRITE_ALPHABLEND + + + + No documentation. + + + bb205466 + D3DXSPRITE_SORT_TEXTURE + D3DXSPRITE_SORT_TEXTURE + + + + No documentation. + + + bb205466 + D3DXSPRITE_SORT_DEPTH_FRONTTOBACK + D3DXSPRITE_SORT_DEPTH_FRONTTOBACK + + + + No documentation. + + + bb205466 + D3DXSPRITE_SORT_DEPTH_BACKTOFRONT + D3DXSPRITE_SORT_DEPTH_BACKTOFRONT + + + + No documentation. + + + bb205466 + D3DXSPRITE_DO_NOT_ADDREF_TEXTURE + D3DXSPRITE_DO_NOT_ADDREF_TEXTURE + + + + None. + + + None + None + + + +

Predefined sets of pipeline state used by state blocks (see State Blocks Save and Restore State (Direct3D 9)).

+
+ +

As the following diagram shows, vertex and pixel state are both subsets of device state.

There are only a few states that are considered both vertex and pixel state. These states are:

  • Render state:
  • Render state:
  • Render state:
  • Texture state:
  • Texture state:
+
+ + bb172608 + D3DSTATEBLOCKTYPE + D3DSTATEBLOCKTYPE +
+ + + No documentation. + + + bb172608 + D3DSBT_ALL + D3DSBT_ALL + + + + No documentation. + + + bb172608 + D3DSBT_PIXELSTATE + D3DSBT_PIXELSTATE + + + + No documentation. + + + bb172608 + D3DSBT_VERTEXSTATE + D3DSBT_VERTEXSTATE + + + +

Driver stencil capability flags.

+
+ + bb172609 + D3DSTENCILCAPS + D3DSTENCILCAPS +
+ + + No documentation. + + + bb172609 + D3DSTENCILCAPS_KEEP + D3DSTENCILCAPS_KEEP + + + + No documentation. + + + bb172609 + D3DSTENCILCAPS_ZERO + D3DSTENCILCAPS_ZERO + + + + No documentation. + + + bb172609 + D3DSTENCILCAPS_REPLACE + D3DSTENCILCAPS_REPLACE + + + + No documentation. + + + bb172609 + D3DSTENCILCAPS_INCRSAT + D3DSTENCILCAPS_INCRSAT + + + + No documentation. + + + bb172609 + D3DSTENCILCAPS_DECRSAT + D3DSTENCILCAPS_DECRSAT + + + + No documentation. + + + bb172609 + D3DSTENCILCAPS_INVERT + D3DSTENCILCAPS_INVERT + + + + No documentation. + + + bb172609 + D3DSTENCILCAPS_INCR + D3DSTENCILCAPS_INCR + + + + No documentation. + + + bb172609 + D3DSTENCILCAPS_DECR + D3DSTENCILCAPS_DECR + + + + No documentation. + + + bb172609 + D3DSTENCILCAPS_TWOSIDED + D3DSTENCILCAPS_TWOSIDED + + + +

Defines stencil-buffer operations.

+
+ +

Stencil-buffer entries are integer values ranging from 0 through 2n - 1, where n is the bit depth of the stencil buffer.

+
+ + bb172610 + D3DSTENCILOP + D3DSTENCILOP +
+ + +

Do not update the entry in the stencil buffer. This is the default value.

+
+ + bb172610 + D3DSTENCILOP_KEEP + D3DSTENCILOP_KEEP +
+ + +

Set the stencil-buffer entry to 0.

+
+ + bb172610 + D3DSTENCILOP_ZERO + D3DSTENCILOP_ZERO +
+ + +

Replace the stencil-buffer entry with a reference value.

+
+ + bb172610 + D3DSTENCILOP_REPLACE + D3DSTENCILOP_REPLACE +
+ + +

Increment the stencil-buffer entry, clamping to the maximum value.

+
+ + bb172610 + D3DSTENCILOP_INCRSAT + D3DSTENCILOP_INCRSAT +
+ + +

Decrement the stencil-buffer entry, clamping to zero.

+
+ + bb172610 + D3DSTENCILOP_DECRSAT + D3DSTENCILOP_DECRSAT +
+ + +

Invert the bits in the stencil-buffer entry.

+
+ + bb172610 + D3DSTENCILOP_INVERT + D3DSTENCILOP_INVERT +
+ + +

Increment the stencil-buffer entry, wrapping to zero if the new value exceeds the maximum value.

+
+ + bb172610 + D3DSTENCILOP_INCR + D3DSTENCILOP_INCR +
+ + +

Decrement the stencil-buffer entry, wrapping to the maximum value if the new value is less than zero.

+
+ + bb172610 + D3DSTENCILOP_DECR + D3DSTENCILOP_DECR +
+ + +

Given a scene that contains many objects that use the same geometry, you can draw many instances of that geometry at different orientations, sizes, colors, and so on with dramatically better performance by reducing the amount of data you need to supply to the renderer.

This can be accomplished through the use of two techniques: the first for drawing indexed geometry and the second for non-indexed geometry. Both techniques use two vertex buffers: one to supply geometry data and one to supply per-object instance data. The instance data can be a wide variety of information such as a transform, color data, or lighting data - basically anything that you can describe in a vertex declaration. Drawing many instances of geometry with these techniques can dramatically reduce the amount of data sent to the renderer.

  • Drawing
    • Indexed
  • Drawing
    • Non-Indexed
  • Related
+
+ + bb173349 + D3DSTREAMSOURCE + D3DSTREAMSOURCE +
+ + + No documentation. + + + bb173349 + D3DSTREAMSOURCE_INDEXEDDATA + D3DSTREAMSOURCE_INDEXEDDATA + + + + No documentation. + + + bb173349 + D3DSTREAMSOURCE_INSTANCEDATA + D3DSTREAMSOURCE_INSTANCEDATA + + + +

Defines swap effects.

+
+ +

The state of the back buffer after a call to Present is well-defined by each of these swap effects, and whether the Direct3D device was created with a full-screen swap chain or a windowed swap chain has no effect on this state. In particular, the swap effect operates the same whether windowed or full-screen, and the Direct3D runtime guarantees this by creating extra buffers. As a result, it is recommended that applications use whenever possible to avoid any such penalties. This is because this swap effect will always be the most efficient in terms of memory consumption and performance.

Applications that use or should not expect full-screen destination alpha to work. This means that the render state will not work as expected because full-screen swap chains with these swap effects do not have an explicit pixel format from the driver's point of view. The driver infers that they should take on the display format, which does not have an alpha channel. To work around this, take the following steps:

  • Use .
  • Check the flag in the Caps3 member of the structure. This flag indicates whether the driver can do alpha blending when or is used.
  • Applications using flip mode swap effect () should call PresentEx after a window resize or region change to ensure that the display content is updated.

An invisible window cannot receive user-mode events; furthermore, an invisible-fullscreen window will interfere with the presentation of another applications' windowed-mode window. Therefore, each application needs to ensure that a device window is visible when a swapchain is presented in fullscreen mode.

+
+ + bb172612 + D3DSWAPEFFECT + D3DSWAPEFFECT +
+ + +

When a swap chain is created with a swap effect of or , the runtime will guarantee that an operation will not affect the content of any of the back buffers. Unfortunately, meeting this guarantee can involve substantial video memory or processing overheads, especially when implementing flip semantics for a windowed swap chain or copy semantics for a full-screen swap chain. An application may use the swap effect to avoid these overheads and to enable the display driver to select the most efficient presentation technique for the swap chain. This is also the only swap effect that may be used when specifying a value other than for the MultiSampleType member of .

Like a swap chain that uses , a swap chain that uses might include more than one back buffer, any of which may be accessed using or . The swap chain is best envisaged as a queue in which 0 always indexes the back buffer that will be displayed by the next Present operation and from which buffers are discarded when they have been displayed.

An application that uses this swap effect cannot make any assumptions about the contents of a discarded back buffer and should therefore update an entire back buffer before invoking a Present operation that would display it. Although this is not enforced, the debug version of the runtime will overwrite the contents of discarded back buffers with random data to enable developers to verify that their applications are updating the entire back buffer surfaces correctly.

+
+ + bb172612 + D3DSWAPEFFECT_DISCARD + D3DSWAPEFFECT_DISCARD +
+ + +

The swap chain might include multiple back buffers and is best envisaged as a circular queue that includes the front buffer. Within this queue, the back buffers are always numbered sequentially from 0 to (n - 1), where n is the number of back buffers, so that 0 denotes the least recently presented buffer. When Present is invoked, the queue is "rotated" so that the front buffer becomes back buffer (n - 1), while the back buffer 0 becomes the new front buffer.

+
+ + bb172612 + D3DSWAPEFFECT_FLIP + D3DSWAPEFFECT_FLIP +
+ + +

This swap effect may be specified only for a swap chain comprising a single back buffer. Whether the swap chain is windowed or full-screen, the runtime will guarantee the semantics implied by a copy-based Present operation, namely that the operation leaves the content of the back buffer unchanged, instead of replacing it with the content of the front buffer as a flip-based Present operation would.

For a full-screen swap chain, the runtime uses a combination of flip operations and copy operations, supported if necessary by hidden back buffers, to accomplish the Present operation. Accordingly, the presentation is synchronized with the display adapter's vertical retrace and its rate is constrained by the chosen presentation interval. A swap chain specified with the flag is the only exception. (Refer to the description of the PresentationIntervals member of the structure.) In this case, a Present operation copies the back buffer content directly to the front buffer without waiting for the vertical retrace.

+
+ + bb172612 + D3DSWAPEFFECT_COPY + D3DSWAPEFFECT_COPY +
+ + +

Use a dedicated area of video memory that can be overlayed on the primary surface. No copy is performed when the overlay is displayed. The overlay operation is performed in hardware, without modifying the data in the primary surface.

Differences between Direct3D 9 and Direct3D 9Ex:

is only available in Direct3D9Ex running on Windows 7 (or more current operating system).

?

+
+ + bb172612 + D3DSWAPEFFECT_OVERLAY + D3DSWAPEFFECT_OVERLAY +
+ + +

Designates when an application is adopting flip mode, during which time an application's frame is passed instead of copied to the Desktop Window Manager(DWM) for composition when the application is presenting in windowed mode. Flip mode allows an application to more efficiently use memory bandwidth as well as enabling an application to take advantage of full-screen-present statistics. Flip mode does not affect full-screen behavior. A sample application that uses and is the D3D9ExFlipEx sample on the MSDN Code Gallery.

Note??If you create a swap chain with , you can't override the hDeviceWindow member of the structure when you present a new frame for display. That is, you must pass null to the hDestWindowOverride parameter of to instruct the runtime to use the hDeviceWindow member of for the presentation.

Differences between Direct3D 9 and Direct3D 9Ex:

is only available in Direct3D9Ex running on Windows 7 (or more current operating system).

?

+
+ + bb172612 + D3DSWAPEFFECT_FLIPEX + D3DSWAPEFFECT_FLIPEX +
+ + +

Defines settings used for mesh tangent frame computations.

+
+ + bb205467 + D3DXTANGENT + D3DXTANGENT +
+ + +

Texture coordinate values in the u direction are between 0 and 1. In this case a texture coordinate set will be chosen that minimizes the perimeter of the triangle. See Texture Wrapping (Direct3D 9).

+
+ + bb205467 + D3DXTANGENT_WRAP_U + D3DXTANGENT_WRAP_U +
+ + +

Texture coordinate values in the v direction are between 0 and 1. In this case a texture coordinate set will be chosen that minimizes the perimeter of the triangle. See Texture Wrapping (Direct3D 9).

+
+ + bb205467 + D3DXTANGENT_WRAP_V + D3DXTANGENT_WRAP_V +
+ + +

Texture coordinate values in both u and v directions are between 0 and 1. In this case a texture coordinate set will be chosen that minimizes the perimeter of the triangle. See Texture Wrapping (Direct3D 9).

+
+ + bb205467 + D3DXTANGENT_WRAP_UV + D3DXTANGENT_WRAP_UV +
+ + +

Do not normalize partial derivatives with respect to texture coordinates. If not normalized, the scale of the partial derivatives is proportional to the scale of the 3D model divided by the scale of the triangle in (u, v) space. This scale value provides a measure of how much the texture is stretched in a given direction. The resulting vector length is a weighted sum of the lengths of the partial derivatives.

+
+ + bb205467 + D3DXTANGENT_DONT_NORMALIZE_PARTIALS + D3DXTANGENT_DONT_NORMALIZE_PARTIALS +
+ + +

Do not transform texture coordinates to orthogonal Cartesian coordinates. Mutually exclusive with and .

+
+ + bb205467 + D3DXTANGENT_DONT_ORTHOGONALIZE + D3DXTANGENT_DONT_ORTHOGONALIZE +
+ + +

Compute the partial derivative with respect to texture coordinate v independently for each vertex, and then compute the partial derivative with respect to u as the cross product of the partial derivative with respect to v and the normal vector. Mutually exclusive with and .

+
+ + bb205467 + D3DXTANGENT_ORTHOGONALIZE_FROM_V + D3DXTANGENT_ORTHOGONALIZE_FROM_V +
+ + +

Compute the partial derivative with respect to texture coordinate u independently for each vertex, and then compute the partial derivative with respect to v as the cross product of the normal vector and the partial derivative with respect to u. Mutually exclusive with and .

+
+ + bb205467 + D3DXTANGENT_ORTHOGONALIZE_FROM_U + D3DXTANGENT_ORTHOGONALIZE_FROM_U +
+ + +

Weight the direction of the computed per-vertex normal or partial derivative vector according to the areas of triangles attached to that vertex. Mutually exclusive with .

+
+ + bb205467 + D3DXTANGENT_WEIGHT_BY_AREA + D3DXTANGENT_WEIGHT_BY_AREA +
+ + +

Compute a unit-length normal vector for each triangle of the input mesh. Mutually exclusive with .

+
+ + bb205467 + D3DXTANGENT_WEIGHT_EQUAL + D3DXTANGENT_WEIGHT_EQUAL +
+ + +

Vertices are ordered in a clockwise direction around each triangle. The computed normal vector direction is therefore inverted 180 degrees from the direction computed using counterclockwise vertex ordering.

+
+ + bb205467 + D3DXTANGENT_WIND_CW + D3DXTANGENT_WIND_CW +
+ + +

Compute the per-vertex normal vector for each triangle of the input mesh, and ignore any normal vectors already in the input mesh.

+
+ + bb205467 + D3DXTANGENT_CALCULATE_NORMALS + D3DXTANGENT_CALCULATE_NORMALS +
+ + +

The results are stored in the original input mesh, and the output mesh is not used.

+
+ + bb205467 + D3DXTANGENT_GENERATE_IN_PLACE + D3DXTANGENT_GENERATE_IN_PLACE +
+ + + None. + + + None + None + + + +

Defines constants that describe the supported texture-addressing modes.

+
+ + bb172614 + D3DTEXTUREADDRESS + D3DTEXTUREADDRESS +
+ + +

Tile the texture at every integer junction. For example, for u values between 0 and 3, the texture is repeated three times; no mirroring is performed.

+
+ + bb172614 + D3DTADDRESS_WRAP + D3DTADDRESS_WRAP +
+ + +

Similar to , except that the texture is flipped at every integer junction. For u values between 0 and 1, for example, the texture is addressed normally; between 1 and 2, the texture is flipped (mirrored); between 2 and 3, the texture is normal again; and so on.

+
+ + bb172614 + D3DTADDRESS_MIRROR + D3DTADDRESS_MIRROR +
+ + +

Texture coordinates outside the range [0.0, 1.0] are set to the texture color at 0.0 or 1.0, respectively.

+
+ + bb172614 + D3DTADDRESS_CLAMP + D3DTADDRESS_CLAMP +
+ + +

Texture coordinates outside the range [0.0, 1.0] are set to the border color.

+
+ + bb172614 + D3DTADDRESS_BORDER + D3DTADDRESS_BORDER +
+ + +

Similar to and . Takes the absolute value of the texture coordinate (thus, mirroring around 0), and then clamps to the maximum value. The most common usage is for volume textures, where support for the full texture-addressing mode is not necessary, but the data is symmetric around the one axis.

+
+ + bb172614 + D3DTADDRESS_MIRRORONCE + D3DTADDRESS_MIRRORONCE +
+ + +

A programmable pixel shader is made up of a set of instructions that operate on pixel data. Registers transfer data in and out of the ALU. Additional control can be applied to modify the instruction, the results, or what data gets written out.

  • ps_3_0 Instructions contains a list of the available instructions.
  • ps_3_0 Registers lists the different types of registers used by the pixel shader ALU.
  • Modifiers Are used to modify the way an instruction works.
  • Destination Register Write Mask determines what components of the destination register get written.
  • Pixel Shader Source Register Modifiers alter the source register data before the instruction runs.
  • Source Register Swizzling gives additional control over which register components are read, copied, or written.
+
+ + bb219845 + D3DPTADDRESSCAPS + D3DPTADDRESSCAPS +
+ + + No documentation. + + + bb219845 + D3DPTADDRESSCAPS_WRAP + D3DPTADDRESSCAPS_WRAP + + + + No documentation. + + + bb219845 + D3DPTADDRESSCAPS_MIRROR + D3DPTADDRESSCAPS_MIRROR + + + + No documentation. + + + bb219845 + D3DPTADDRESSCAPS_CLAMP + D3DPTADDRESSCAPS_CLAMP + + + + No documentation. + + + bb219845 + D3DPTADDRESSCAPS_BORDER + D3DPTADDRESSCAPS_BORDER + + + + No documentation. + + + bb219845 + D3DPTADDRESSCAPS_INDEPENDENTUV + D3DPTADDRESSCAPS_INDEPENDENTUV + + + + No documentation. + + + bb219845 + D3DPTADDRESSCAPS_MIRRORONCE + D3DPTADDRESSCAPS_MIRRORONCE + + + +

Texture argument constants are used as values for the following members of the enumerated type:

Set and retrieve texture arguments by calling the SetTextureStageState and GetTextureStageState methods.

Argument flags

You can combine an argument flag with a modifier, but two argument flags cannot be combined.

+
+ + bb172613 + D3DTA + D3DTA +
+ + + No documentation. + + + bb172613 + D3DTA_SELECTMASK + D3DTA_SELECTMASK + + + + No documentation. + + + bb172613 + D3DTA_DIFFUSE + D3DTA_DIFFUSE + + + + No documentation. + + + bb172613 + D3DTA_CURRENT + D3DTA_CURRENT + + + + No documentation. + + + bb172613 + D3DTA_TEXTURE + D3DTA_TEXTURE + + + + No documentation. + + + bb172613 + D3DTA_TFACTOR + D3DTA_TFACTOR + + + + No documentation. + + + bb172613 + D3DTA_SPECULAR + D3DTA_SPECULAR + + + + No documentation. + + + bb172613 + D3DTA_TEMP + D3DTA_TEMP + + + + No documentation. + + + bb172613 + D3DTA_CONSTANT + D3DTA_CONSTANT + + + + No documentation. + + + bb172613 + D3DTA_COMPLEMENT + D3DTA_COMPLEMENT + + + + No documentation. + + + bb172613 + D3DTA_ALPHAREPLICATE + D3DTA_ALPHAREPLICATE + + + +

A programmable pixel shader is made up of a set of instructions that operate on pixel data. Registers transfer data in and out of the ALU. Additional control can be applied to modify the instruction, the results, or what data gets written out.

  • ps_3_0 Instructions contains a list of the available instructions.
  • ps_3_0 Registers lists the different types of registers used by the pixel shader ALU.
  • Modifiers Are used to modify the way an instruction works.
  • Destination Register Write Mask determines what components of the destination register get written.
  • Pixel Shader Source Register Modifiers alter the source register data before the instruction runs.
  • Source Register Swizzling gives additional control over which register components are read, copied, or written.
+
+ + bb219845 + D3DPTEXTURECAPS + D3DPTEXTURECAPS +
+ + + No documentation. + + + bb219845 + D3DPTEXTURECAPS_PERSPECTIVE + D3DPTEXTURECAPS_PERSPECTIVE + + + + No documentation. + + + bb219845 + D3DPTEXTURECAPS_POW2 + D3DPTEXTURECAPS_POW2 + + + + No documentation. + + + bb219845 + D3DPTEXTURECAPS_ALPHA + D3DPTEXTURECAPS_ALPHA + + + + No documentation. + + + bb219845 + D3DPTEXTURECAPS_SQUAREONLY + D3DPTEXTURECAPS_SQUAREONLY + + + + No documentation. + + + bb219845 + D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE + D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE + + + + No documentation. + + + bb219845 + D3DPTEXTURECAPS_ALPHAPALETTE + D3DPTEXTURECAPS_ALPHAPALETTE + + + + No documentation. + + + bb219845 + D3DPTEXTURECAPS_NONPOW2CONDITIONAL + D3DPTEXTURECAPS_NONPOW2CONDITIONAL + + + + No documentation. + + + bb219845 + D3DPTEXTURECAPS_PROJECTED + D3DPTEXTURECAPS_PROJECTED + + + + No documentation. + + + bb219845 + D3DPTEXTURECAPS_CUBEMAP + D3DPTEXTURECAPS_CUBEMAP + + + + No documentation. + + + bb219845 + D3DPTEXTURECAPS_VOLUMEMAP + D3DPTEXTURECAPS_VOLUMEMAP + + + + No documentation. + + + bb219845 + D3DPTEXTURECAPS_MIPMAP + D3DPTEXTURECAPS_MIPMAP + + + + No documentation. + + + bb219845 + D3DPTEXTURECAPS_MIPVOLUMEMAP + D3DPTEXTURECAPS_MIPVOLUMEMAP + + + + No documentation. + + + bb219845 + D3DPTEXTURECAPS_MIPCUBEMAP + D3DPTEXTURECAPS_MIPCUBEMAP + + + + No documentation. + + + bb219845 + D3DPTEXTURECAPS_CUBEMAP_POW2 + D3DPTEXTURECAPS_CUBEMAP_POW2 + + + + No documentation. + + + bb219845 + D3DPTEXTURECAPS_VOLUMEMAP_POW2 + D3DPTEXTURECAPS_VOLUMEMAP_POW2 + + + + No documentation. + + + bb219845 + D3DPTEXTURECAPS_NOPROJECTEDBUMPENV + D3DPTEXTURECAPS_NOPROJECTEDBUMPENV + + + +

Driver texture coordinate capability flags.

+
+ + bb172621 + D3DTSS_TCI + D3DTSS_TCI +
+ + + No documentation. + + + bb172621 + D3DTSS_TCI_PASSTHRU + D3DTSS_TCI_PASSTHRU + + + + No documentation. + + + bb172621 + D3DTSS_TCI_CAMERASPACENORMAL + D3DTSS_TCI_CAMERASPACENORMAL + + + + No documentation. + + + bb172621 + D3DTSS_TCI_CAMERASPACEPOSITION + D3DTSS_TCI_CAMERASPACEPOSITION + + + + No documentation. + + + bb172621 + D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR + D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR + + + + No documentation. + + + bb172621 + D3DTSS_TCI_SPHEREMAP + D3DTSS_TCI_SPHEREMAP + + + +

Defines texture filtering modes for a texture stage.

+
+ +

is used by along with to define texture filtering modes for a texture stage.

To check if a format supports texture filter types other than (which is always supported), call with .

Set a texture stage's magnification filter by calling with the value as the second parameter and one member of this enumeration as the third parameter.

Set a texture stage's minification filter by calling with the value as the second parameter and one member of this enumeration as the third parameter.

Set the texture filter to use between-mipmap levels by calling with the value as the second parameter and one member of this enumeration as the third parameter.

Not all valid filtering modes for a device will apply to volume maps. In general, and magnification filters will be supported for volume maps. If is set, then the mipmap filter and and minification filters will be supported for volume maps. The device may or may not support the mipmap filter for volume maps. Devices that support anisotropic filtering for 2D maps do not necessarily support anisotropic filtering for volume maps. However, applications that enable anisotropic filtering will receive the best available filtering (probably linear) if anisotropic filtering is not supported.

+
+ + bb172615 + D3DTEXTUREFILTERTYPE + D3DTEXTUREFILTERTYPE +
+ + +

When used with , disables mipmapping.

+
+ + bb172615 + D3DTEXF_NONE + D3DTEXF_NONE +
+ + +

When used with D3DSAMP_ MAGFILTER or , specifies that point filtering is to be used as the texture magnification or minification filter respectively. When used with , enables mipmapping and specifies that the rasterizer chooses the color from the texel of the nearest mip level.

+
+ + bb172615 + D3DTEXF_POINT + D3DTEXF_POINT +
+ + +

When used with D3DSAMP_ MAGFILTER or , specifies that linear filtering is to be used as the texture magnification or minification filter respectively. When used with , enables mipmapping and trilinear filtering; it specifies that the rasterizer interpolates between the two nearest mip levels.

+
+ + bb172615 + D3DTEXF_LINEAR + D3DTEXF_LINEAR +
+ + +

When used with D3DSAMP_ MAGFILTER or , specifies that anisotropic texture filtering used as a texture magnification or minification filter respectively. Compensates for distortion caused by the difference in angle between the texture polygon and the plane of the screen. Use with is undefined.

+
+ + bb172615 + D3DTEXF_ANISOTROPIC + D3DTEXF_ANISOTROPIC +
+ + +

A 4-sample tent filter used as a texture magnification or minification filter. Use with is undefined.

+
+ + bb172615 + D3DTEXF_PYRAMIDALQUAD + D3DTEXF_PYRAMIDALQUAD +
+ + +

A 4-sample Gaussian filter used as a texture magnification or minification filter. Use with is undefined.

+
+ + bb172615 + D3DTEXF_GAUSSIANQUAD + D3DTEXF_GAUSSIANQUAD +
+ + +

Convolution filter for monochrome textures. See .

Differences between Direct3D 9 and Direct3D 9Ex:

This flag is available in Direct3D 9Ex only.

?

Use with is undefined.

+
+ + bb172615 + D3DTEXF_CONVOLUTIONMONO + D3DTEXF_CONVOLUTIONMONO +
+ + +

Defines per-stage texture-blending operations.

+
+ +

The members of this type are used when setting color or alpha operations by using the or values with the method.

In the above formulas, SRGBA is the RGBA color produced by a texture operation, and Arg1, Arg2, and Arg3 represent the complete RGBA color of the texture arguments. Individual components of an argument are shown with subscripts. For example, the alpha component for argument 1 would be shown as Arg1A.

+
+ + bb172616 + D3DTEXTUREOP + D3DTEXTUREOP +
+ + +

Disables output from this texture stage and all stages with a higher index. To disable texture mapping, set this as the color operation for the first texture stage (stage 0). Alpha operations cannot be disabled when color operations are enabled. Setting the alpha operation to when color blending is enabled causes undefined behavior.

+
+ + bb172616 + D3DTOP_DISABLE + D3DTOP_DISABLE +
+ + +

Use this texture stage's first color or alpha argument, unmodified, as the output. This operation affects the color argument when used with the texture-stage state, and the alpha argument when used with .

+
+ + bb172616 + D3DTOP_SELECTARG1 + D3DTOP_SELECTARG1 +
+ + +

Use this texture stage's second color or alpha argument, unmodified, as the output. This operation affects the color argument when used with the texture stage state, and the alpha argument when used with .

+
+ + bb172616 + D3DTOP_SELECTARG2 + D3DTOP_SELECTARG2 +
+ + +

Multiply the components of the arguments.

+
+ + bb172616 + D3DTOP_MODULATE + D3DTOP_MODULATE +
+ + +

Multiply the components of the arguments, and shift the products to the left 1 bit (effectively multiplying them by 2) for brightening.

+
+ + bb172616 + D3DTOP_MODULATE2X + D3DTOP_MODULATE2X +
+ + +

Multiply the components of the arguments, and shift the products to the left 2 bits (effectively multiplying them by 4) for brightening.

+
+ + bb172616 + D3DTOP_MODULATE4X + D3DTOP_MODULATE4X +
+ + +

Add the components of the arguments.

+
+ + bb172616 + D3DTOP_ADD + D3DTOP_ADD +
+ + +

Add the components of the arguments with a - 0.5 bias, making the effective range of values from - 0.5 through 0.5.

+
+ + bb172616 + D3DTOP_ADDSIGNED + D3DTOP_ADDSIGNED +
+ + +

Add the components of the arguments with a - 0.5 bias, and shift the products to the left 1 bit.

+
+ + bb172616 + D3DTOP_ADDSIGNED2X + D3DTOP_ADDSIGNED2X +
+ + +

Subtract the components of the second argument from those of the first argument.

+
+ + bb172616 + D3DTOP_SUBTRACT + D3DTOP_SUBTRACT +
+ + +

Add the first and second arguments; then subtract their product from the sum.

+
+ + bb172616 + D3DTOP_ADDSMOOTH + D3DTOP_ADDSMOOTH +
+ + +

Linearly blend this texture stage, using the interpolated alpha from each vertex.

+
+ + bb172616 + D3DTOP_BLENDDIFFUSEALPHA + D3DTOP_BLENDDIFFUSEALPHA +
+ + +

Linearly blend this texture stage, using the alpha from this stage's texture.

+
+ + bb172616 + D3DTOP_BLENDTEXTUREALPHA + D3DTOP_BLENDTEXTUREALPHA +
+ + +

Linearly blend this texture stage, using a scalar alpha set with the render state.

+
+ + bb172616 + D3DTOP_BLENDFACTORALPHA + D3DTOP_BLENDFACTORALPHA +
+ + +

Linearly blend a texture stage that uses a premultiplied alpha.

+
+ + bb172616 + D3DTOP_BLENDTEXTUREALPHAPM + D3DTOP_BLENDTEXTUREALPHAPM +
+ + +

Linearly blend this texture stage, using the alpha taken from the previous texture stage.

+
+ + bb172616 + D3DTOP_BLENDCURRENTALPHA + D3DTOP_BLENDCURRENTALPHA +
+ + +

is set in stage n. The output of stage n is arg1. Additionally, if there is a texture in stage n + 1, any in stage n + 1 is premultiplied by texture in stage n + 1.

+
+ + bb172616 + D3DTOP_PREMODULATE + D3DTOP_PREMODULATE +
+ + +

Modulate the color of the second argument, using the alpha of the first argument; then add the result to argument one. This operation is supported only for color operations ().

+
+ + bb172616 + D3DTOP_MODULATEALPHA_ADDCOLOR + D3DTOP_MODULATEALPHA_ADDCOLOR +
+ + +

Modulate the arguments; then add the alpha of the first argument. This operation is supported only for color operations ().

+
+ + bb172616 + D3DTOP_MODULATECOLOR_ADDALPHA + D3DTOP_MODULATECOLOR_ADDALPHA +
+ + +

Similar to , but use the inverse of the alpha of the first argument. This operation is supported only for color operations ().

+
+ + bb172616 + D3DTOP_MODULATEINVALPHA_ADDCOLOR + D3DTOP_MODULATEINVALPHA_ADDCOLOR +
+ + +

Similar to , but use the inverse of the color of the first argument. This operation is supported only for color operations ().

+
+ + bb172616 + D3DTOP_MODULATEINVCOLOR_ADDALPHA + D3DTOP_MODULATEINVCOLOR_ADDALPHA +
+ + +

Perform per-pixel bump mapping, using the environment map in the next texture stage, without luminance. This operation is supported only for color operations ().

+
+ + bb172616 + D3DTOP_BUMPENVMAP + D3DTOP_BUMPENVMAP +
+ + +

Perform per-pixel bump mapping, using the environment map in the next texture stage, with luminance. This operation is supported only for color operations ().

+
+ + bb172616 + D3DTOP_BUMPENVMAPLUMINANCE + D3DTOP_BUMPENVMAPLUMINANCE +
+ + +

Modulate the components of each argument as signed components, add their products; then replicate the sum to all color channels, including alpha. This operation is supported for color and alpha operations.

In DirectX 6 and DirectX 7, multitexture operations the above inputs are all shifted down by half (y = x - 0.5) before use to simulate signed data, and the scalar result is automatically clamped to positive values and replicated to all three output channels. Also, note that as a color operation this does not updated the alpha it just updates the RGB components.

However, in DirectX 8.1 shaders you can specify that the output be routed to the .rgb or the .a components or both (the default). You can also specify a separate scalar operation on the alpha channel.

+
+ + bb172616 + D3DTOP_DOTPRODUCT3 + D3DTOP_DOTPRODUCT3 +
+ + +

Performs a multiply-accumulate operation. It takes the last two arguments, multiplies them together, and adds them to the remaining input/source argument, and places that into the result.

SRGBA = Arg1 + Arg2 * Arg3

+
+ + bb172616 + D3DTOP_MULTIPLYADD + D3DTOP_MULTIPLYADD +
+ + +

Linearly interpolates between the second and third source arguments by a proportion specified in the first source argument.

SRGBA = (Arg1) * Arg2 + (1- Arg1) * Arg3.

+
+ + bb172616 + D3DTOP_LERP + D3DTOP_LERP +
+ + +

Represents the capabilities of the hardware exposed through the Direct3D object.

+
+ +

The MaxTextureBlendStages and MaxSimultaneousTextures members might seem similar, but they contain different information. The MaxTextureBlendStages member contains the total number of texture-blending stages supported by the current device, and the MaxSimultaneousTextures member describes how many of those stages can have textures bound to them by using the SetTexture method.

When the driver fills this structure, it can set values for execute-buffer capabilities, even when the interface being used to retrieve the capabilities (such as ) does not support execute buffers.

In general, performance problems may occur if you use a texture and then modify it during a scene. Ensure that no texture used in the current BeginScene and EndScene block is evicted unless absolutely necessary. In the case of extremely high texture usage within a scene, the results are undefined. This occurs when you modify a texture that you have used in the scene and there is no spare texture memory available. For such systems, the contents of the z-buffer become invalid at EndScene. Applications should not call UpdateSurface to or from the back buffer on this type of hardware inside a BeginScene/EndScene pair. In addition, applications should not try to access the z-buffer if the capability flag is set. Finally, applications should not lock the back buffer or the z-buffer inside a BeginScene/EndScene pair.

The following flags concerning mipmapped textures are not supported in Direct3D 9.

  • D3DPTFILTERCAPS_LINEAR
  • D3DPTFILTERCAPS_LINEARMIPLINEAR
  • D3DPTFILTERCAPS_LINEARMIPNEAREST
  • D3DPTFILTERCAPS_MIPNEAREST
  • D3DPTFILTERCAPS_NEAREST
+
+ + bb172513 + D3DTEXOPCAPS + D3DTEXOPCAPS +
+ + +

Member of the enumerated type, which identifies what type of resources are used for processing vertices.

+
+ + bb172513 + D3DTEXOPCAPS_DISABLE + D3DTEXOPCAPS_DISABLE +
+ + +

Adapter on which this Direct3D device was created. This ordinal is valid only to pass to methods of the interface that created this Direct3D device. The interface can always be retrieved by calling GetDirect3D.

+
+ + bb172513 + D3DTEXOPCAPS_SELECTARG1 + D3DTEXOPCAPS_SELECTARG1 +
+ + +

The following driver-specific capability.

ValueMeaning

Display hardware is capable of returning the current scan line.

The display driver supports an overlay DDI that allows for verification of overlay capabilities. For more information about the overlay DDI, see Overlay DDI.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

?

+
+ + bb172513 + D3DTEXOPCAPS_SELECTARG2 + D3DTEXOPCAPS_SELECTARG2 +
+ + +

Driver-specific capabilities identified in .

+
+ + bb172513 + D3DTEXOPCAPS_MODULATE + D3DTEXOPCAPS_MODULATE +
+ + +

Driver-specific capabilities identified in .

+
+ + bb172513 + D3DTEXOPCAPS_MODULATE2X + D3DTEXOPCAPS_MODULATE2X +
+ + +

Bit mask of values representing what presentation swap intervals are available.

ValueMeaning

The driver supports an immediate presentation swap interval.

The driver supports a presentation swap interval of every screen refresh.

The driver supports a presentation swap interval of every second screen refresh.

The driver supports a presentation swap interval of every third screen refresh.

The driver supports a presentation swap interval of every fourth screen refresh.

?

+
+ + bb172513 + D3DTEXOPCAPS_MODULATE4X + D3DTEXOPCAPS_MODULATE4X +
+ + +

Bit mask indicating what hardware support is available for cursors. Direct3D 9 does not define alpha-blending cursor capabilities.

ValueMeaning

A full-color cursor is supported in hardware. Specifically, this flag indicates that the driver supports at least a hardware color cursor in high-resolution modes (with scan lines greater than or equal to 400).

A full-color cursor is supported in hardware. Specifically, this flag indicates that the driver supports a hardware color cursor in both high-resolution and low-resolution modes (with scan lines less than 400).

?

+
+ + bb172513 + D3DTEXOPCAPS_ADD + D3DTEXOPCAPS_ADD +
+ + +

Flags identifying the capabilities of the device.

ValueMeaning

Device supports blits from system-memory textures to nonlocal video-memory textures.

Device can queue rendering commands after a page flip. Applications do not change their behavior if this flag is set; this capability means that the device is relatively fast.

Device can support at least a DirectX 5-compliant driver.

Device can support at least a DirectX 7-compliant driver.

Device exports an -aware hal.

Device can use execute buffers from system memory.

Device can use execute buffers from video memory.

Device has hardware acceleration for scene rasterization.

Device can support transformation and lighting in hardware.

Device supports N patches.

Device can support rasterization, transform, lighting, and shading in hardware.

Device supports quintic B?zier curves and B-splines.

Device supports rectangular and triangular patches.

When this device capability is set, the hardware architecture does not require caching of any information, and uncached patches (handle zero) will be drawn as efficiently as cached ones. Note that setting does not mean that a patch with handle zero can be drawn. A handle-zero patch can always be drawn whether this cap is set or not.

Device is texturing from separate memory pools.

Device can retrieve textures from non-local video memory.

Device can retrieve textures from system memory.

Device can retrieve textures from device memory.

Device can use buffers from system memory for transformed and lit vertices.

Device can use buffers from video memory for transformed and lit vertices.

?

+
+ + bb172513 + D3DTEXOPCAPS_ADDSIGNED + D3DTEXOPCAPS_ADDSIGNED +
+ + +

Miscellaneous driver primitive capabilities. See .

+
+ + bb172513 + D3DTEXOPCAPS_ADDSIGNED2X + D3DTEXOPCAPS_ADDSIGNED2X +
+ + +

Information on raster-drawing capabilities. This member can be one or more of the following flags.

ValueMeaning

Device supports anisotropic filtering.

Device iterates colors perspective correctly.

Device can dither to improve color resolution.

Device supports legacy depth bias. For true depth bias, see .

Device supports range-based fog. In range-based fog, the distance of an object from the viewer is used to compute fog effects, not the depth of the object (that is, the z-coordinate) in the scene.

Device calculates the fog value by referring to a lookup table containing fog values that are indexed to the depth of a given pixel.

Device calculates the fog value during the lighting operation and interpolates the fog value during rasterization.

Device supports level-of-detail bias adjustments. These bias adjustments enable an application to make a mipmap appear crisper or less sharp than it normally would. For more information about level-of-detail bias in mipmaps, see .

Device supports toggling multisampling on and off between and (using ).

Device supports scissor test. See Scissor Test (Direct3D 9).

Device performs true slope-scale based depth bias. This is in contrast to the legacy style depth bias.

Device supports depth buffering using w.

Device supports w-based fog. W-based fog is used when a perspective projection matrix is specified, but affine projections still use z-based fog. The system considers a projection matrix that contains a nonzero value in the [3][4] element to be a perspective projection matrix.

Device can perform hidden-surface removal (HSR) without requiring the application to sort polygons and without requiring the allocation of a depth-buffer. This leaves more video memory for textures. The method used to perform HSR is hardware-dependent and is transparent to the application.

Z-bufferless HSR is performed if no depth-buffer surface is associated with the rendering-target surface and the depth-buffer comparison test is enabled (that is, when the state value associated with the enumeration constant is set to TRUE).

Device supports z-based fog.

Device can perform z-test operations. This effectively renders a primitive and indicates whether any z pixels have been rendered.

?

+
+ + bb172513 + D3DTEXOPCAPS_SUBTRACT + D3DTEXOPCAPS_SUBTRACT +
+ + +

Z-buffer comparison capabilities. This member can be one or more of the following flags.

ValueMeaning

Always pass the z-test.

Pass the z-test if the new z equals the current z.

Pass the z-test if the new z is greater than the current z.

Pass the z-test if the new z is greater than or equal to the current z.

Pass the z-test if the new z is less than the current z.

Pass the z-test if the new z is less than or equal to the current z.

Always fail the z-test.

Pass the z-test if the new z does not equal the current z.

?

+
+ + bb172513 + D3DTEXOPCAPS_ADDSMOOTH + D3DTEXOPCAPS_ADDSMOOTH +
+ + +

Source-blending capabilities. This member can be one or more of the following flags. (The RGBA values of the source and destination are indicated by the subscripts s and d.)

ValueMeaning

The driver supports both and . See .

Source blend factor is (1 - As, 1 - As, 1 - As, 1 - As) and destination blend factor is (As, As, As, As); the destination blend selection is overridden.

The driver supports the blend mode. (This blend mode is obsolete. For more information, see .)

Blend factor is (Ad, Ad, Ad, Ad).

Blend factor is (Rd, Gd, Bd, Ad).

Blend factor is (1 - Ad, 1 - Ad, 1 - Ad, 1 - Ad).

Blend factor is (1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad).

Blend factor is (1 - As, 1 - As, 1 - As, 1 - As).

Blend factor is (1 - Rs, 1 - Gs, 1 - Bs, 1 - As).

Blend factor is (1 - PSOutColor[1]r, 1 - PSOutColor[1]g, 1 - PSOutColor[1]b, not used)). See Render Target Blending.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

Blend factor is (1, 1, 1, 1).

Blend factor is (As, As, As, As).

Blend factor is (f, f, f, 1); f = min(As, 1 - Ad).

Blend factor is (Rs, Gs, Bs, As).

Blend factor is (PSOutColor[1]r, PSOutColor[1]g, PSOutColor[1]b, not used). See Render Target Blending.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

Blend factor is (0, 0, 0, 0).

?

+
+ + bb172513 + D3DTEXOPCAPS_BLENDDIFFUSEALPHA + D3DTEXOPCAPS_BLENDDIFFUSEALPHA +
+ + +

Destination-blending capabilities. This member can be the same capabilities that are defined for the SrcBlendCaps member.

+
+ + bb172513 + D3DTEXOPCAPS_BLENDTEXTUREALPHA + D3DTEXOPCAPS_BLENDTEXTUREALPHA +
+ + +

Alpha-test comparison capabilities. This member can include the same capability flags defined for the ZCmpCaps member. If this member contains only the capability or only the capability, the driver does not support alpha tests. Otherwise, the flags identify the individual comparisons that are supported for alpha testing.

+
+ + bb172513 + D3DTEXOPCAPS_BLENDFACTORALPHA + D3DTEXOPCAPS_BLENDFACTORALPHA +
+ + +

Shading operations capabilities. It is assumed, in general, that if a device supports a given command at all, it supports the mode (as specified in the enumerated type). This flag specifies whether the driver can also support Gouraud shading and whether alpha color components are supported. When alpha components are not supported, the alpha value of colors generated is implicitly 255. This is the maximum possible alpha (that is, the alpha component is at full intensity).

The color, specular highlights, fog, and alpha interpolants of a triangle each have capability flags that an application can use to find out how they are implemented by the device driver.

This member can be one or more of the following flags.

ValueMeaning

Device can support an alpha component for Gouraud-blended transparency (the state for the enumerated type). In this mode, the alpha color component of a primitive is provided at vertices and interpolated across a face along with the other color components.

Device can support colored Gouraud shading. In this mode, the per-vertex color components (red, green, and blue) are interpolated across a triangle face.

Device can support fog in the Gouraud shading mode.

Device supports Gouraud shading of specular highlights.

?

+
+ + bb172513 + D3DTEXOPCAPS_BLENDTEXTUREALPHAPM + D3DTEXOPCAPS_BLENDTEXTUREALPHAPM +
+ + +

Miscellaneous texture-mapping capabilities. This member can be one or more of the following flags.

ValueMeaning

Alpha in texture pixels is supported.

Device can draw alpha from texture palettes.

Supports cube textures.

Device requires that cube texture maps have dimensions specified as powers of two.

Device supports mipmapped cube textures.

Device supports mipmapped textures.

Device supports mipmapped volume textures.

is also set, conditionally supports the use of 2D textures with dimensions that are not powers of two. A device that exposes this capability can use such a texture if all of the following requirements are met.

  • The texture addressing mode for the texture stage is set to .
  • Texture wrapping for the texture stage is disabled (D3DRS_WRAP n set to 0).
  • Mipmapping is not in use (use magnification filter only).
  • Texture formats must not be through .

If this flag is not set, and is also not set, then unconditional support is provided for 2D textures with dimensions that are not powers of two.

A texture that is not a power of two cannot be set at a stage that will be read based on a shader computation (such as the bem - ps and texm3x3 - ps instructions in pixel shaders versions 1_0 to 1_3). For example, these textures can be used to store bumps that will be fed into texture reads, but not the environment maps that are used in texbem - ps, texbeml - ps, and texm3x3spec - ps. This means that a texture with dimensions that are not powers of two cannot be addressed or sampled using texture coordinates computed within the shader. This type of operation is known as a dependent read and cannot be performed on these types of textures.

Device does not support a projected bump-environment loopkup operation in programmable and fixed function shaders.

Perspective correction texturing is supported.

If is not set, all textures must have widths and heights specified as powers of two. This requirement does not apply to either cube textures or volume textures.

If is also set, conditionally supports the use of 2D textures with dimensions that are not powers of two. See description.

If this flag is not set, and is also not set, then unconditional support is provided for 2D textures with dimensions that are not powers of two.

Supports the texture transformation flag. When applied, the device divides transformed texture coordinates by the last texture coordinate. If this capability is present, then the projective divide occurs per pixel. If this capability is not present, but the projective divide needs to occur anyway, then it is performed on a per-vertex basis by the Direct3D runtime.

All textures must be square.

Texture indices are not scaled by the texture size prior to interpolation.

Device supports volume textures.

Device requires that volume texture maps have dimensions specified as powers of two.

?

+
+ + bb172513 + D3DTEXOPCAPS_BLENDCURRENTALPHA + D3DTEXOPCAPS_BLENDCURRENTALPHA +
+ + +

Texture-filtering capabilities for a texture. Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture blending. This member can be any combination of the per-stage texture-filtering flags defined in .

+
+ + bb172513 + D3DTEXOPCAPS_PREMODULATE + D3DTEXOPCAPS_PREMODULATE +
+ + +

Texture-filtering capabilities for a cube texture. Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture blending. This member can be any combination of the per-stage texture-filtering flags defined in .

+
+ + bb172513 + D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR + D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR +
+ + +

Texture-filtering capabilities for a volume texture. Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture blending. This member can be any combination of the per-stage texture-filtering flags defined in .

+
+ + bb172513 + D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA + D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA +
+ + +

Texture-addressing capabilities for texture objects. This member can be one or more of the following flags.

ValueMeaning

Device supports setting coordinates outside the range [0.0, 1.0] to the border color, as specified by the texture-stage state.

Device can clamp textures to addresses.

Device can separate the texture-addressing modes of the u and v coordinates of the texture. This ability corresponds to the and render-state values.

Device can mirror textures to addresses.

Device can take the absolute value of the texture coordinate (thus, mirroring around 0) and then clamp to the maximum value.

Device can wrap textures to addresses.

?

+
+ + bb172513 + D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR + D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR +
+ + +

Texture-addressing capabilities for a volume texture. This member can be one or more of the flags defined for the TextureAddressCaps member.

+
+ + bb172513 + D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA + D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA +
+ + +

Defines the capabilities for line-drawing primitives.

ValueMeaning

Supports alpha-test comparisons.

Antialiased lines are supported.

Supports source-blending.

Supports fog.

Supports texture-mapping.

Supports z-buffer comparisons.

?

+
+ + bb172513 + D3DTEXOPCAPS_BUMPENVMAP + D3DTEXOPCAPS_BUMPENVMAP +
+ + +

Maximum texture width for this device.

+
+ + bb172513 + D3DTEXOPCAPS_BUMPENVMAPLUMINANCE + D3DTEXOPCAPS_BUMPENVMAPLUMINANCE +
+ + +

Maximum texture height for this device.

+
+ + bb172513 + D3DTEXOPCAPS_DOTPRODUCT3 + D3DTEXOPCAPS_DOTPRODUCT3 +
+ + +

Maximum value for any of the three dimensions (width, height, and depth) of a volume texture.

+
+ + bb172513 + D3DTEXOPCAPS_MULTIPLYADD + D3DTEXOPCAPS_MULTIPLYADD +
+ + +

This number represents the maximum range of the integer bits of the post-normalized texture coordinates. A texture coordinate is stored as a 32-bit signed integer using 27 bits to store the integer part and 5 bits for the floating point fraction. The maximum integer index, 227, is used to determine the maximum texture coordinate, depending on how the hardware does texture-coordinate scaling.

Some hardware reports the cap . For this case, the device defers scaling texture coordinates by the texture size until after interpolation and application of the texture address mode, so the number of times a texture can be wrapped is given by the integer value in MaxTextureRepeat.

Less desirably, on some hardware is not set and the device scales the texture coordinates by the texture size (using the highest level of detail) prior to interpolation. This limits the number of times a texture can be wrapped to MaxTextureRepeat / texture size.

For example, assume that MaxTextureRepeat is equal to 32k and the size of the texture is 4k. If the hardware sets , then the number of times a texture can be wrapped is equal to MaxTextureRepeat, which is 32k in this example. Otherwise, the number of times a texture can be wrapped is equal to MaxTextureRepeat divided by texture size, which is 32k/4k in this example.

+
+ + bb172513 + D3DTEXOPCAPS_LERP + D3DTEXOPCAPS_LERP +
+ + +

Texture stage states define multi-blender texture operations. Some sampler states set up vertex processing, and some set up pixel processing. Texture stage states can be saved and restored using stateblocks (see State Blocks Save and Restore State (Direct3D 9)).

+
+ +

Members of this enumerated type are used with the and methods to retrieve and set texture state values.

The valid range of values for the , , , and bump-mapping matrix coefficients is greater than or equal to -8.0 and less than 8.0. This range, expressed in mathematical notation is (-8.0,8.0).

+
+ + bb172617 + D3DTEXTURESTAGESTATETYPE + D3DTEXTURESTAGESTATETYPE +
+ + + No documentation. + + + bb172617 + D3DTSS_COLOROP + D3DTSS_COLOROP + + + + No documentation. + + + bb172617 + D3DTSS_COLORARG1 + D3DTSS_COLORARG1 + + + + No documentation. + + + bb172617 + D3DTSS_COLORARG2 + D3DTSS_COLORARG2 + + + + No documentation. + + + bb172617 + D3DTSS_ALPHAOP + D3DTSS_ALPHAOP + + + + No documentation. + + + bb172617 + D3DTSS_ALPHAARG1 + D3DTSS_ALPHAARG1 + + + + No documentation. + + + bb172617 + D3DTSS_ALPHAARG2 + D3DTSS_ALPHAARG2 + + + + No documentation. + + + bb172617 + D3DTSS_BUMPENVMAT00 + D3DTSS_BUMPENVMAT00 + + + + No documentation. + + + bb172617 + D3DTSS_BUMPENVMAT01 + D3DTSS_BUMPENVMAT01 + + + + No documentation. + + + bb172617 + D3DTSS_BUMPENVMAT10 + D3DTSS_BUMPENVMAT10 + + + + No documentation. + + + bb172617 + D3DTSS_BUMPENVMAT11 + D3DTSS_BUMPENVMAT11 + + + + No documentation. + + + bb172617 + D3DTSS_TEXCOORDINDEX + D3DTSS_TEXCOORDINDEX + + + + No documentation. + + + bb172617 + D3DTSS_BUMPENVLSCALE + D3DTSS_BUMPENVLSCALE + + + + No documentation. + + + bb172617 + D3DTSS_BUMPENVLOFFSET + D3DTSS_BUMPENVLOFFSET + + + + No documentation. + + + bb172617 + D3DTSS_TEXTURETRANSFORMFLAGS + D3DTSS_TEXTURETRANSFORMFLAGS + + + + No documentation. + + + bb172617 + D3DTSS_COLORARG0 + D3DTSS_COLORARG0 + + + + No documentation. + + + bb172617 + D3DTSS_ALPHAARG0 + D3DTSS_ALPHAARG0 + + + + No documentation. + + + bb172617 + D3DTSS_RESULTARG + D3DTSS_RESULTARG + + + + No documentation. + + + bb172617 + D3DTSS_CONSTANT + D3DTSS_CONSTANT + + + +

Defines texture coordinate transformation values.

+
+ +

Texture coordinates can be transformed using a 4 x 4 matrix before the results are passed to the rasterizer. The texture coordinate transforms are set by calling , and by passing in the texture stage state and one of the values from . For more information about texture transforms, see Texture Coordinate Transformations (Direct3D 9).

+
+ + bb172618 + D3DTEXTURETRANSFORMFLAGS + D3DTEXTURETRANSFORMFLAGS +
+ + +

Texture coordinates are passed directly to the rasterizer.

+
+ + bb172618 + D3DTTFF_DISABLE + D3DTTFF_DISABLE +
+ + +

The rasterizer should expect 1D texture coordinates. This value is used by fixed function vertex processing; it should be set to 0 when using a programmable vertex shader.

+
+ + bb172618 + D3DTTFF_COUNT1 + D3DTTFF_COUNT1 +
+ + +

The rasterizer should expect 2D texture coordinates. This value is used by fixed function vertex processing; it should be set to 0 when using a programmable vertex shader.

+
+ + bb172618 + D3DTTFF_COUNT2 + D3DTTFF_COUNT2 +
+ + +

The rasterizer should expect 3D texture coordinates. This value is used by fixed function vertex processing; it should be set to 0 when using a programmable vertex shader.

+
+ + bb172618 + D3DTTFF_COUNT3 + D3DTTFF_COUNT3 +
+ + +

The rasterizer should expect 4D texture coordinates. This value is used by fixed function vertex processing; it should be set to 0 when using a programmable vertex shader.

+
+ + bb172618 + D3DTTFF_COUNT4 + D3DTTFF_COUNT4 +
+ + +

This flag is honored by the fixed function pixel pipeline, as well as the programmable pixel pipeline in versions ps_1_1 to ps_1_3. When texture projection is enabled for a texture stage, all four floating point values must be written to the corresponding texture register. Each texture coordinate is divided by the last element before being passed to the rasterizer. For example, if this flag is specified with the flag, the first and second texture coordinates are divided by the third coordinate before being passed to the rasterizer.

+
+ + bb172618 + D3DTTFF_PROJECTED + D3DTTFF_PROJECTED +
+ + +

In short, texture wrapping changes the basic way that Direct3D rasterizes textured polygons using the texture coordinates specified for each vertex. While rasterizing a polygon, the system interpolates between the texture coordinates at each of the polygon's vertices to determine the texels that should be used for every pixel of the polygon. Normally, the system treats the texture as a 2D plane, interpolating new texels by taking the shortest route from point A within a texture to point B. If point A represents the u, v position (0.8, 0.1), and point B is at (0.1,0.1), the line of interpolation looks like the following diagram.

Note that the shortest distance between A and B in this illustration runs roughly through the middle of the texture. Enabling u-texture or v-texture coordinate wrapping changes how Direct3D perceives the shortest route between texture coordinates in the u-direction and v-direction. By definition, texture wrapping causes the rasterizer to take the shortest route between texture coordinate sets, assuming that 0.0 and 1.0 are coincident. The last bit is the tricky part: You can imagine that enabling texture wrapping in one direction causes the system to treat a texture as though it were wrapped around a cylinder. For example, consider the following diagram.

The preceding illustration shows how wrapping in the u - direction affects how the system interpolates texture coordinates. Using the same points as in the example for normal, or nonwrapped, textures, you can see that the shortest route between points A and B is no longer across the middle of the texture; it's now across the border where 0.0 and 1.0 exist together. Wrapping in the v-direction is similar, except that it wraps the texture around a cylinder that is lying on its side. Wrapping in both the u-direction and v-direction is more complex. In this situation, you can envision the texture as a torus, or doughnut.

The most common practical application for texture wrapping is to perform environment mapping. Usually, an object textured with an environment map appears very reflective, showing a mirrored image of the object's surroundings in the scene. For the sake of this discussion, picture a room with four walls, each one painted with a letter R, G, B, Y and the corresponding colors: red, green, blue, and yellow. The environment map for such a simple room might look like the following illustration.

Imagine that the room's ceiling is held up by a perfectly reflective, four-sided, pillar. Mapping the environment map texture to the pillar is simple; making the pillar look as though it is reflecting the letters and colors is not as easy. The following diagram shows a wire frame of the pillar with the applicable texture coordinates listed near the top vertices. The seam where wrapping will cross the edges of the texture is shown with a dotted line.

With wrapping enabled in the u-direction, the textured pillar shows the colors and symbols from the environment map appropriately and, at the seam in the front of the texture, the rasterizer properly chooses the shortest route between the texture coordinates, assuming that u-coordinates 0.0 and 1.0 share the same location. The textured pillar looks like the following illustration.

If texture wrapping isn't enabled, the rasterizer does not interpolate in the direction needed to generate a believable, reflected image. Rather, the area at the front of the pillar contains a horizontally compressed version of the texels between u-coordinates 0.175 and 0.875, as they pass through the center of the texture. The wrap effect is ruined.

+
+ + bb206256 + D3DWRAPCOORD + D3DWRAPCOORD +
+ + + No documentation. + + + bb206256 + D3DWRAPCOORD_0 + D3DWRAPCOORD_0 + + + + No documentation. + + + bb206256 + D3DWRAPCOORD_1 + D3DWRAPCOORD_1 + + + + No documentation. + + + bb206256 + D3DWRAPCOORD_2 + D3DWRAPCOORD_2 + + + + No documentation. + + + bb206256 + D3DWRAPCOORD_3 + D3DWRAPCOORD_3 + + + + None. + + + None + None + + + +

Defines the priority type to which an animation track is assigned.

+
+ +

Tracks with the same priority are blended together, and the two resulting values are then blended using the priority blend factor.

+
+ + bb205401 + D3DXPRIORITY_TYPE + D3DXPRIORITY_TYPE +
+ + +

Track should be blended with all the low-priority tracks before the low-priority blend is mixed with the high-priority blend.

+
+ + bb205401 + D3DXPRIORITY_LOW + D3DXPRIORITY_LOW +
+ + +

Track should be blended with all the high-priority tracks before the high-priority blend is mixed with the low-priority blend.

+
+ + bb205401 + D3DXPRIORITY_HIGH + D3DXPRIORITY_HIGH +
+ + + No documentation. + + + D3DTRANSFORMSTATETYPE2 + D3DTRANSFORMSTATETYPE2 + + + + No documentation. + + + D3DTS2_VIEW + D3DTS2_VIEW + + + + No documentation. + + + D3DTS2_PROJECTION + D3DTS2_PROJECTION + + + + No documentation. + + + D3DTS2_WORLD + D3DTS2_WORLD + + + + No documentation. + + + D3DTS2_WORLD1 + D3DTS2_WORLD1 + + + + No documentation. + + + D3DTS2_WORLD2 + D3DTS2_WORLD2 + + + + No documentation. + + + D3DTS2_WORLD3 + D3DTS2_WORLD3 + + + + No documentation. + + + D3DTS2_TEXTURE0 + D3DTS2_TEXTURE0 + + + + No documentation. + + + D3DTS2_TEXTURE1 + D3DTS2_TEXTURE1 + + + + No documentation. + + + D3DTS2_TEXTURE2 + D3DTS2_TEXTURE2 + + + + No documentation. + + + D3DTS2_TEXTURE3 + D3DTS2_TEXTURE3 + + + + No documentation. + + + D3DTS2_TEXTURE4 + D3DTS2_TEXTURE4 + + + + No documentation. + + + D3DTS2_TEXTURE5 + D3DTS2_TEXTURE5 + + + + No documentation. + + + D3DTS2_TEXTURE6 + D3DTS2_TEXTURE6 + + + + No documentation. + + + D3DTS2_TEXTURE7 + D3DTS2_TEXTURE7 + + + +

Defines the transition style between values of a mesh animation.

+
+ +

The calculation for the ramp from ease in to ease out is calculated as follows:

Q(t) = 2(x - y)t3 + 3(y - x)t2 + x

where the ramp is a function Q(t) with the following properties:

  • Q(t) is a cubic spline.
  • Q(t) interpolates between x and y as t ranges from 0 to 1.
  • Q(t) is horizontal when t = 0 and t = 1.

Mathematically, this translates into:

Q(t) = At3 + Bt2 + Ct + D (and therefore, Q'(t) = 3At2 + 2Bt + C)
2a) Q(0) = x
2b) Q(1) = y
3a) Q'(0) = 0
3b) Q'(1) = 0

Solving for A, B, C, D:

D = x (from 2a)
C = 0 (from 3a)
3A + 2B = 0 (from 3b)
A + B = y - x (from 2b and D = x)

Therefore:

A = 2(x - y), B = 3(y - x), C = 0, D = x
+
+ + bb205475 + D3DXTRANSITION_TYPE + D3DXTRANSITION_TYPE +
+ + +

Linear transition between values.

+
+ + bb205475 + D3DXTRANSITION_LINEAR + D3DXTRANSITION_LINEAR +
+ + +

Ease-in, ease-out spline transition between values.

+
+ + bb205475 + D3DXTRANSITION_EASEINEASEOUT + D3DXTRANSITION_EASEINEASEOUT +
+ + +

Usage options that identify how resources are to be used.

The following table summarizes the available usage options.

+

+ + bb172625 + D3DUSAGE + D3DUSAGE +
+ + + No documentation. + + + bb172625 + D3DUSAGE_RENDERTARGET + D3DUSAGE_RENDERTARGET + + + + No documentation. + + + bb172625 + D3DUSAGE_DEPTHSTENCIL + D3DUSAGE_DEPTHSTENCIL + + + + No documentation. + + + bb172625 + D3DUSAGE_DYNAMIC + D3DUSAGE_DYNAMIC + + + + No documentation. + + + bb172625 + D3DUSAGE_NONSECURE + D3DUSAGE_NONSECURE + + + + No documentation. + + + bb172625 + D3DUSAGE_AUTOGENMIPMAP + D3DUSAGE_AUTOGENMIPMAP + + + + No documentation. + + + bb172625 + D3DUSAGE_DMAP + D3DUSAGE_DMAP + + + + No documentation. + + + bb172625 + D3DUSAGE_QUERY_LEGACYBUMPMAP + D3DUSAGE_QUERY_LEGACYBUMPMAP + + + + No documentation. + + + bb172625 + D3DUSAGE_QUERY_SRGBREAD + D3DUSAGE_QUERY_SRGBREAD + + + + No documentation. + + + bb172625 + D3DUSAGE_QUERY_FILTER + D3DUSAGE_QUERY_FILTER + + + + No documentation. + + + bb172625 + D3DUSAGE_QUERY_SRGBWRITE + D3DUSAGE_QUERY_SRGBWRITE + + + + No documentation. + + + bb172625 + D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING + D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING + + + + No documentation. + + + bb172625 + D3DUSAGE_QUERY_VERTEXTEXTURE + D3DUSAGE_QUERY_VERTEXTEXTURE + + + + No documentation. + + + bb172625 + D3DUSAGE_QUERY_WRAPANDMIP + D3DUSAGE_QUERY_WRAPANDMIP + + + + No documentation. + + + bb172625 + D3DUSAGE_WRITEONLY + D3DUSAGE_WRITEONLY + + + + No documentation. + + + bb172625 + D3DUSAGE_SOFTWAREPROCESSING + D3DUSAGE_SOFTWAREPROCESSING + + + + No documentation. + + + bb172625 + D3DUSAGE_DONOTCLIP + D3DUSAGE_DONOTCLIP + + + + No documentation. + + + bb172625 + D3DUSAGE_POINTS + D3DUSAGE_POINTS + + + + No documentation. + + + bb172625 + D3DUSAGE_RTPATCHES + D3DUSAGE_RTPATCHES + + + + No documentation. + + + bb172625 + D3DUSAGE_NPATCHES + D3DUSAGE_NPATCHES + + + + No documentation. + + + bb172625 + D3DUSAGE_TEXTAPI + D3DUSAGE_TEXTAPI + + + + No documentation. + + + bb172625 + D3DUSAGE_RESTRICTED_CONTENT + D3DUSAGE_RESTRICTED_CONTENT + + + + No documentation. + + + bb172625 + D3DUSAGE_RESTRICT_SHARED_RESOURCE + D3DUSAGE_RESTRICT_SHARED_RESOURCE + + + + No documentation. + + + bb172625 + D3DUSAGE_RESTRICT_SHARED_RESOURCE_DRIVER + D3DUSAGE_RESTRICT_SHARED_RESOURCE_DRIVER + + + + None. + + + None + None + + + +

Texture wrapping options for IMT computation APIs.

+
+ + bb172880 + D3DXIMT + D3DXIMT +
+ + +

The texture wraps in the U direction.

+
+ + bb172880 + D3DXIMT_WRAP_U + D3DXIMT_WRAP_U +
+ + +

The texture wraps in the V direction.

+
+ + bb172880 + D3DXIMT_WRAP_V + D3DXIMT_WRAP_V +
+ + +

The texture wraps in both the U and V direction.

+
+ + bb172880 + D3DXIMT_WRAP_UV + D3DXIMT_WRAP_UV +
+ + +

Defines flags used to control the number or matrices that the system applies when performing multimatrix vertex blending.

+
+ +

Members of this type are used with the render state.

Geometry blending (multimatrix vertex blending) requires that your application use a vertex format that has blending (beta) weights for each vertex.

+
+ + bb172628 + D3DVERTEXBLENDFLAGS + D3DVERTEXBLENDFLAGS +
+ + +

Disable vertex blending; apply only the world matrix set by the D3DTS_WORLDMATRIX macro, where the index value for the transformation state is 0.

+
+ + bb172628 + D3DVBF_DISABLE + D3DVBF_DISABLE +
+ + +

Enable vertex blending between the two matrices set by the D3DTS_WORLDMATRIX macro, where the index value for the transformation states are 0 and 1.

+
+ + bb172628 + D3DVBF_1WEIGHTS + D3DVBF_1WEIGHTS +
+ + +

Enable vertex blending between the three matrices set by the D3DTS_WORLDMATRIX macro, where the index value for the transformation states are 0, 1, and 2.

+
+ + bb172628 + D3DVBF_2WEIGHTS + D3DVBF_2WEIGHTS +
+ + +

Enable vertex blending between the four matrices set by the D3DTS_WORLDMATRIX macro, where the index value for the transformation states are 0, 1, 2, and 3.

+
+ + bb172628 + D3DVBF_3WEIGHTS + D3DVBF_3WEIGHTS +
+ + +

Vertex blending is done by using the value assigned to .

+
+ + bb172628 + D3DVBF_TWEENING + D3DVBF_TWEENING +
+ + +

Use a single matrix with a weight of 1.0.

+
+ + bb172628 + D3DVBF_0WEIGHTS + D3DVBF_0WEIGHTS +
+ + +

Flexible Vertex Format Constants, or FVF codes, are used to describe the contents of vertices interleaved in a single data stream that will be processed by the fixed-function pipeline.

+
+ + bb172559 + D3DFVF + D3DFVF +
+ + + No documentation. + + + bb172559 + D3DFVF_RESERVED0 + D3DFVF_RESERVED0 + + + + No documentation. + + + bb172559 + D3DFVF_POSITION_MASK + D3DFVF_POSITION_MASK + + + + No documentation. + + + bb172559 + D3DFVF_XYZ + D3DFVF_XYZ + + + + No documentation. + + + bb172559 + D3DFVF_XYZRHW + D3DFVF_XYZRHW + + + + No documentation. + + + bb172559 + D3DFVF_XYZB1 + D3DFVF_XYZB1 + + + + No documentation. + + + bb172559 + D3DFVF_XYZB2 + D3DFVF_XYZB2 + + + + No documentation. + + + bb172559 + D3DFVF_XYZB3 + D3DFVF_XYZB3 + + + + No documentation. + + + bb172559 + D3DFVF_XYZB4 + D3DFVF_XYZB4 + + + + No documentation. + + + bb172559 + D3DFVF_XYZB5 + D3DFVF_XYZB5 + + + + No documentation. + + + bb172559 + D3DFVF_XYZW + D3DFVF_XYZW + + + + No documentation. + + + bb172559 + D3DFVF_NORMAL + D3DFVF_NORMAL + + + + No documentation. + + + bb172559 + D3DFVF_PSIZE + D3DFVF_PSIZE + + + + No documentation. + + + bb172559 + D3DFVF_DIFFUSE + D3DFVF_DIFFUSE + + + + No documentation. + + + bb172559 + D3DFVF_SPECULAR + D3DFVF_SPECULAR + + + + No documentation. + + + bb172559 + D3DFVF_TEXCOUNT_MASK + D3DFVF_TEXCOUNT_MASK + + + + No documentation. + + + bb172559 + D3DFVF_TEXCOUNT_SHIFT + D3DFVF_TEXCOUNT_SHIFT + + + + No documentation. + + + bb172559 + D3DFVF_TEX0 + D3DFVF_TEX0 + + + + No documentation. + + + bb172559 + D3DFVF_TEX1 + D3DFVF_TEX1 + + + + No documentation. + + + bb172559 + D3DFVF_TEX2 + D3DFVF_TEX2 + + + + No documentation. + + + bb172559 + D3DFVF_TEX3 + D3DFVF_TEX3 + + + + No documentation. + + + bb172559 + D3DFVF_TEX4 + D3DFVF_TEX4 + + + + No documentation. + + + bb172559 + D3DFVF_TEX5 + D3DFVF_TEX5 + + + + No documentation. + + + bb172559 + D3DFVF_TEX6 + D3DFVF_TEX6 + + + + No documentation. + + + bb172559 + D3DFVF_TEX7 + D3DFVF_TEX7 + + + + No documentation. + + + bb172559 + D3DFVF_TEX8 + D3DFVF_TEX8 + + + + No documentation. + + + bb172559 + D3DFVF_LASTBETA_UBYTE4 + D3DFVF_LASTBETA_UBYTE4 + + + + No documentation. + + + bb172559 + D3DFVF_LASTBETA_D3DCOLOR + D3DFVF_LASTBETA_D3DCOLOR + + + + None. + + + None + None + + + + No documentation. + + + ff569467 + D3DFVFCAPS + D3DFVFCAPS + + + + No documentation. + + + ff569467 + D3DFVFCAPS_TEXCOORDCOUNTMASK + D3DFVFCAPS_TEXCOORDCOUNTMASK + + + + No documentation. + + + ff569467 + D3DFVFCAPS_DONOTSTRIPELEMENTS + D3DFVFCAPS_DONOTSTRIPELEMENTS + + + + No documentation. + + + ff569467 + D3DFVFCAPS_PSIZE + D3DFVFCAPS_PSIZE + + + +

This constant is the maximum number of vertex declarators for a mesh.

+
+ +

MAXD3DDECLLENGTH is defined as a maximum of 64 (see d3d9types.h). This does not include the "end" marker vertex element.

+
+ + bb147183 + _MAX_FVF_DECL_SIZE + _MAX_FVF_DECL_SIZE +
+ + +

The maximum number of elements in the vertex declaration. The additional (+1) is for D3DDECL_END.

+
+ + bb147183 + MAX_FVF_DECL_SIZE + MAX_FVF_DECL_SIZE +
+ + +

A combination of one or more flags that control the device create behavior.

+
+ + bb172637 + D3DVTXPCAPS + D3DVTXPCAPS +
+ + + No documentation. + + + bb172637 + D3DVTXPCAPS_TEXGEN + D3DVTXPCAPS_TEXGEN + + + + No documentation. + + + bb172637 + D3DVTXPCAPS_MATERIALSOURCE7 + D3DVTXPCAPS_MATERIALSOURCE7 + + + + No documentation. + + + bb172637 + D3DVTXPCAPS_DIRECTIONALLIGHTS + D3DVTXPCAPS_DIRECTIONALLIGHTS + + + + No documentation. + + + bb172637 + D3DVTXPCAPS_POSITIONALLIGHTS + D3DVTXPCAPS_POSITIONALLIGHTS + + + + No documentation. + + + bb172637 + D3DVTXPCAPS_LOCALVIEWER + D3DVTXPCAPS_LOCALVIEWER + + + + No documentation. + + + bb172637 + D3DVTXPCAPS_TWEENING + D3DVTXPCAPS_TWEENING + + + + No documentation. + + + bb172637 + D3DVTXPCAPS_TEXGEN_SPHEREMAP + D3DVTXPCAPS_TEXGEN_SPHEREMAP + + + + No documentation. + + + bb172637 + D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER + D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER + + + +

Vertex shader caps constants. These constants are used by the VS20Caps member of .

+
+ + bb172634 + D3DVS20CAPS + D3DVS20CAPS +
+ + + No documentation. + + + bb172634 + D3DVS20CAPS_PREDICATION + D3DVS20CAPS_PREDICATION + + + + None. + + + None + None + + + +

Vertex texture sampler constants.

These constants identify the texture samplers used by vertex shaders.

+
+ + bb172631 + D3DVERTEXTEXTURESAMPLER + D3DVERTEXTEXTURESAMPLER +
+ + + No documentation. + + + bb172631 + D3DVERTEXTEXTURESAMPLER0 + D3DVERTEXTEXTURESAMPLER0 + + + + No documentation. + + + bb172631 + D3DVERTEXTEXTURESAMPLER1 + D3DVERTEXTEXTURESAMPLER1 + + + + No documentation. + + + bb172631 + D3DVERTEXTEXTURESAMPLER2 + D3DVERTEXTEXTURESAMPLER2 + + + + No documentation. + + + bb172631 + D3DVERTEXTEXTURESAMPLER3 + D3DVERTEXTEXTURESAMPLER3 + + + + No documentation. + + + bb172631 + D3DVERTEXTEXTURESAMPLERMAPSAMPLER + D3DVERTEXTEXTURESAMPLERMAPSAMPLER + + + +

Specifies the type of I/O bus used by the graphics adapter.

+
+ +

As many as three flags can be set. Flags in the range 0x00 through 0x04 (D3DBUSTYPE_Xxx) provide the basic bus type. Flags in the range 0x10000 through 0x50000 (D3DBUSIMPL_MODIFIER_Xxx) modify the basic description. The driver sets one bus-type flag, and can set zero or one modifier flag. If the driver sets a modifier flag, it also sets the flag. Flags are combined with a bitwise OR.

+
+ + dd318379 + D3DBUSTYPE + D3DBUSTYPE +
+ + +

Indicates a type of bus other than the types listed here. +

+
+ + dd318379 + D3DBUSTYPE_OTHER + D3DBUSTYPE_OTHER +
+ + +

PCI bus. +

+
+ + dd318379 + D3DBUSTYPE_PCI + D3DBUSTYPE_PCI +
+ + +

PCI-X bus. +

+
+ + dd318379 + D3DBUSTYPE_PCIX + D3DBUSTYPE_PCIX +
+ + +

PCI Express bus. +

+
+ + dd318379 + D3DBUSTYPE_PCIEXPRESS + D3DBUSTYPE_PCIEXPRESS +
+ + +

Accelerated Graphics Port (AGP) bus. +

+
+ + dd318379 + D3DBUSTYPE_AGP + D3DBUSTYPE_AGP +
+ + +

The implementation for the graphics adapter is in a motherboard chipset's north bridge. This flag implies that data never goes over an expansion bus (such as PCI or AGP) when it is transferred from main memory to the graphics adapter.

+
+ + dd318379 + D3DBUSIMPL_MODIFIER_INSIDE_OF_CHIPSET + D3DBUSIMPL_MODIFIER_INSIDE_OF_CHIPSET +
+ + +

Indicates that the graphics adapter is connected to a motherboard chipset's north bridge by tracks on the motherboard and all of the graphics adapter's chips are soldered to the motherboard. This flag implies that data never goes over an expansion bus (such as PCI or AGP) when it is transferred from main memory to the graphics adapter.

+
+ + dd318379 + D3DBUSIMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_CHIP + D3DBUSIMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_CHIP +
+ + +

The graphics adapter is connected to a motherboard chipset's north bridge by tracks on the motherboard, and all of the graphics adapter's chips are connected through sockets to the motherboard. +

+
+ + dd318379 + D3DBUSIMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_SOCKET + D3DBUSIMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_SOCKET +
+ + +

The graphics adapter is connected to the motherboard through a daughterboard connector. +

+
+ + dd318379 + D3DBUSIMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR + D3DBUSIMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR +
+ + +

The graphics adapter is connected to the motherboard through a daughterboard connector, and the graphics adapter is inside an enclosure that is not user accessible. +

+
+ + dd318379 + D3DBUSIMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR_INSIDE_OF_NUAE + D3DBUSIMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR_INSIDE_OF_NUAE +
+ + +

One of the D3DBUSIMPL_MODIFIER_MODIFIER_Xxx flags is set. +

+
+ + dd318379 + D3DBUSIMPL_MODIFIER_NON_STANDARD + D3DBUSIMPL_MODIFIER_NON_STANDARD +
+ + +

Options for welding together vertices.

+
+ + bb205561 + _D3DXWELDEPSILONSFLAGS + _D3DXWELDEPSILONSFLAGS +
+ + +

Weld together all vertices that are at the same location. Using this flag avoids an epsilon comparison between vertex components.

+
+ + bb205561 + D3DXWELDEPSILONS_WELDALL + D3DXWELDEPSILONS_WELDALL +
+ + +

If a given vertex component is within epsilon, modify partially matched vertices so that both components are identical. If all components are equal, remove one of the vertices.

+
+ + bb205561 + D3DXWELDEPSILONS_WELDPARTIALMATCHES + D3DXWELDEPSILONS_WELDPARTIALMATCHES +
+ + +

Instructs the weld to allow only modifications to vertices and not removal. This flag is valid only if is set. It is useful to modify vertices to be equal, but not to allow vertices to be removed.

+
+ + bb205561 + D3DXWELDEPSILONS_DONOTREMOVEVERTICES + D3DXWELDEPSILONS_DONOTREMOVEVERTICES +
+ + +

Instructs the weld not to split vertices that are in separate attribute groups. When the method is called with the flag, then the flag will also be set. Setting this flag can slow down software vertex processing.

+
+ + bb205561 + D3DXWELDEPSILONS_DONOTSPLIT + D3DXWELDEPSILONS_DONOTSPLIT +
+ + + No documentation. + + + D3DXF_FILEFORMAT2 + D3DXF_FILEFORMAT2 + + + + No documentation. + + + D3DXF_FILEFORMAT_BINARY + D3DXF_FILEFORMAT_BINARY + + + + No documentation. + + + D3DXF_FILEFORMAT_TEXT + D3DXF_FILEFORMAT_TEXT + + + + No documentation. + + + D3DXF_FILEFORMAT_COMPRESSED + D3DXF_FILEFORMAT_COMPRESSED + + + + No documentation. + + + D3DZBUFFERTYPE + D3DZBUFFERTYPE + + + + No documentation. + + + D3DZB_FALSE + D3DZB_FALSE + + + + No documentation. + + + D3DZB_TRUE + D3DZB_TRUE + + + + No documentation. + + + D3DZB_USEW + D3DZB_USEW + + + + Functions + + + + + Constant SdkVersion. + D3D_SDK_VERSION + + + +

Creates an object and returns an interface to it.

+
+ No documentation. + No documentation. +
  • if Direct3DEx features are not supported (no WDDM driver is installed) or if the SDKVersion does not match the version of the DLL.
  • D3DERR_OUTOFMEMORY if out-of-memory conditions are detected when creating the enumerator object.
  • if the creation of the enumerator object is successful.
+ +

The object is the first object that the application creates and the last object thta the application releases. Functions for enumerating and retrieving capabilities of a device are accessible through the object. This enables applications to select devices without creating them.

The interface supports enumeration of active display adapters and allows the creation of objects. If the user dynamically adds adapters (either by adding devices to the desktop, or by hot-docking a laptop), these devices are not included in the enumeration. Creating a new interface will expose the new devices.

Pass the flag to this function to ensure that header files used in the compiled application match the version of the installed runtime DLLs. is changed in the runtime only when a header or another code change would require rebuilding the application. If this function fails, it indicates that the versions of the header file and the runtime DLL do not match.

Note??Direct3DCreate9Ex is supported only in Windows Vista, Windows Server 2008, and Windows 7. Earlier versions of the D3D9.dll library do not include Direct3D9Ex and Direct3DCreate9Ex.

+
+ + bb219676 + HRESULT Direct3DCreate9Ex([In] unsigned int SDKVersion,[Out, Fast] IDirect3D9Ex** arg1) + Direct3DCreate9Ex +
+ + +

Create an object and return an interface to it.

+
+

The value of this parameter should be . See Remarks.

+

If successful, this function returns a reference to an interface; otherwise, a null reference is returned.

+ +

The Direct3D object is the first Direct3D COM object that your graphical application needs to create and the last object that your application needs to release. Functions for enumerating and retrieving capabilities of a device are accessible through the Direct3D object. This enables applications to select devices without creating them.

Create an object as shown here:

 LPDIRECT3D9 g_pD3D = null; if( null == (g_pD3D = Direct3DCreate9())) return E_FAIL;	
+            

The interface supports enumeration of active display adapters and allows the creation of objects. If the user dynamically adds adapters (either by adding devices to the desktop, or by hot-docking a laptop), those devices will not be included in the enumeration. Creating a new interface will expose the new devices.

is passed to this function to ensure that the header files against which an application is compiled match the version of the runtime DLL's that are installed on the machine. is only changed in the runtime when a header change (or other code change) would require an application to be rebuilt. If this function fails, it indicates that the header file version does not match the runtime DLL version.

For an example, see Creating a Device (Direct3D 9).

+
+ + bb219685 + IDirect3D9* Direct3DCreate9([In] unsigned int SDKVersion) + Direct3DCreate9 +
+ + + Functions + + + + + Constant Version. + D3DX_VERSION + + + Constant SdkVersion. + D3DX_SDK_VERSION + + + + No documentation. + + No documentation. + No documentation. + + void D3DPERF_SetMarker([In] D3DCOLOR col,[In] const wchar_t* wszName) + D3DPERF_SetMarker + + + + No documentation. + + No documentation. + + void D3DPERF_SetOptions([In] unsigned int dwOptions) + D3DPERF_SetOptions + + + + No documentation. + + No documentation. + + unsigned int D3DPERF_GetStatus() + D3DPERF_GetStatus + + + + No documentation. + + No documentation. + No documentation. + + void D3DPERF_SetRegion([In] D3DCOLOR col,[In] const wchar_t* wszName) + D3DPERF_SetRegion + + + + No documentation. + + No documentation. + + int D3DPERF_EndEvent() + D3DPERF_EndEvent + + + +

Marks the beginning of a section of event code.

+
+

A null-terminated UNICODE string that contains the name of the event. The name is not relevant to the operating system. You can choose a name that is meaningful when the calling application is running under the Direct3D profiling tool.A null reference produces undefined results.

+ No documentation. +

Returns the number of previous calls to BeginEvent that have not yet been finalized by calls to the ID3DUserDefinedAnnotation::EndEvent method.

The return value is ?1 if the calling application is not running under a Direct3D profiling tool.

+ +

You call the EndEvent method to mark the end of the section of event code.

A user can visualize the event when the calling application is running under an enabled Direct3D profiling tool such as Microsoft Visual Studio Ultimate?2012.

BeginEvent has no effect if the calling application is not running under an enabled Direct3D profiling tool.

+
+ + hh446884 + int D3DPERF_BeginEvent([In] D3DCOLOR col,[In] const wchar_t* wszName) + D3DPERF_BeginEvent +
+ + + No documentation. + + No documentation. + + BOOL D3DPERF_QueryRepeatFrame() + D3DPERF_QueryRepeatFrame + + + +

Adds a child frame to a frame.

+
+

Pointer to the parent node.

+

Pointer to the child node.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ + bb172846 + HRESULT D3DXFrameAppendChild([In] D3DXFRAME* pFrameParent,[In] const D3DXFRAME* pFrameChild) + D3DXFrameAppendChild +
+ + +

Loads the first frame hierarchy from a .x file.

+
+

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

Combination of one or more flags from the D3DXMESH enumeration that specify creation options for the mesh.

+

Pointer to an interface, the device object associated with the mesh.

+

Pointer to an interface.

+

Application provided interface that allows loading of user data. See .

+

Returns a reference to the loaded frame hierarchy. See .

+

Returns a reference to the animation controller corresponding to animation in the .x file. This is created with default tracks and events. See .

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXLoadMeshHierarchyFromXA.

All the meshes in the file will be collapsed into one output mesh. If the file contains a frame hierarchy, all the transformations will be applied to the mesh.

loads the animation data and frame hierarchy from a .x file. It scans the .x file and builds a frame hierarchy and animation controller according to the -derived object passed to it through pAlloc. Loading the data requires several steps as follows:

  1. Derive , implementing each method. This controls how frames and meshes are allocated and freed.
  2. Derive , implementing each method. If your .x file has no embedded user-defined data, or if you do not need it, you can skip this part.
  3. Create an object of your class, and optionally of your LoadUserData class. You do not need to call any methods of these objects yourself.
  4. Call , passing in your object and your object (or null) to create the frame hierarchy and animation controller. All the animation sets and frames are automatically registered to the animation controller.

During the load, CreateFrame and LoadFrameChildData are called back on each frame to control loading and allocation of the frame. The application defines these methods to control how frames are stored. CreateMeshContainer and LoadMeshChildData are called back on each mesh object to control loading and allocation of mesh objects. LoadTopLevelData is called back for each top level object that doesn't get loaded by the other methods.

To free this data, call ID3DXAnimationController::Release to free the animation sets, and D3DXFRAMEDestroy, passing in the root node of the frame hierarchy and an object of your derived class. DestroyFrame and DestroyMeshContainer will each be called for every frame and mesh object in the frame hierarchy. Your implementation of DestroyFrame should release everything allocated by CreateFrame, and likewise for the mesh container methods.

+
+ + bb172894 + HRESULT D3DXLoadMeshHierarchyFromXW([In] const wchar_t* Filename,[In] unsigned int MeshOptions,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXAllocateHierarchy* pAlloc,[In] ID3DXLoadUserData* pUserDataLoader,[In] D3DXFRAME** ppFrameHierarchy,[In] ID3DXAnimationController** ppAnimController) + D3DXLoadMeshHierarchyFromXW +
+ + +

Given a frame hierarchy, registers all the named matrices in the animation mixer.

+
+

The top level node in the frame hierarchy.

+

Pointer to the animation controller object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ + bb172851 + HRESULT D3DXFrameRegisterNamedMatrices([In] D3DXFRAME* pFrameRoot,[In] ID3DXAnimationController* pAnimController) + D3DXFrameRegisterNamedMatrices +
+ + +

Loads the first frame hierarchy from a .x file.

+
+

Pointer to a buffer that contains the mesh hierarchy.

+

Size of the pMemory buffer, in bytes.

+

Combination of one or more flags from the D3DXMESH enumeration that specify creation options for the mesh.

+

Pointer to an interface, the device object associated with the mesh.

+

Pointer to an interface.

+

Application provided interface that allows loading of user data. See .

+

Returns a reference to the loaded frame hierarchy. See .

+

Returns a reference to the animation controller corresponding to animation in the .x file. This is created with default tracks and events. See .

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ +

All the meshes in the file will be collapsed into one output mesh. If the file contains a frame hierarchy, all the transformations will be applied to the mesh.

+
+ + bb172895 + HRESULT D3DXLoadMeshHierarchyFromXInMemory([In] const void* Memory,[In] unsigned int SizeOfMemory,[In] unsigned int MeshOptions,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXAllocateHierarchy* pAlloc,[In] ID3DXLoadUserData* pUserDataLoader,[In] D3DXFRAME** ppFrameHierarchy,[In] ID3DXAnimationController** ppAnimController) + D3DXLoadMeshHierarchyFromXInMemory +
+ + +

Creates a key framed animation set interface that stores key frame data in a compressed format.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ + bb172754 + HRESULT D3DXCreateCompressedAnimationSet([In] const char* pName,[In] double TicksPerSecond,[In] D3DXPLAYBACK_TYPE Playback,[In] ID3DXBuffer* pCompressedData,[In] unsigned int NumCallbackKeys,[In] const D3DXKEY_CALLBACK* pCallbackKeys,[In] ID3DXCompressedAnimationSet** ppAnimationSet) + D3DXCreateCompressedAnimationSet +
+ + +

Creates a .x file and saves the mesh hierarchy and corresponding animations in it.

+
+

Pointer to a string that specifies the name of the .x file identifying the saved mesh. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

Format of the .x file (text or binary, compressed or not). See . can be combined (using a logical OR) with either the or flags to reduce the output file size.

+

Root node of the hierarchy to be saved. See .

+

Animation controller that has animation sets to be stored. See .

+

Application-provided interface that allows saving of user data. See .

+

If the function succeeds, the return value is . If the function fails, the return value can be: .

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXSaveMeshHierarchyToFileA.

This function does not save compressed animation sets.

+
+ + bb205427 + HRESULT D3DXSaveMeshHierarchyToFileW([In] const wchar_t* Filename,[In] unsigned int XFormat,[In] const D3DXFRAME* pFrameRoot,[In] ID3DXAnimationController* pAnimController,[In] ID3DXSaveUserData* pUserDataSaver) + D3DXSaveMeshHierarchyToFileW +
+ + +

Computes the bounding sphere of all the meshes in the frame hierarchy.

+
+

Pointer to the root node.

+

Returns the center of the bounding sphere.

+

Returns the radius of the bounding sphere.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ + bb172847 + HRESULT D3DXFrameCalculateBoundingSphere([In] const D3DXFRAME* pFrameRoot,[In] D3DXVECTOR3* pObjectCenter,[In] float* pObjectRadius) + D3DXFrameCalculateBoundingSphere +
+ + +

Creates an animation controller object.

+
+

Maximum number of animation outputs the controller can support.

+

Maximum number of animation sets that can be mixed.

+

Maximum number of animation sets that can be mixed simultaneously.

+

Maximum number of outstanding events that the controller will support.

+

Pointer to the animation controller object created. See .

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ +

An animation controller controls an animation mixer. The controller adds methods to modify blending parameters over time to enable smooth transitions.

+
+ + bb172751 + HRESULT D3DXCreateAnimationController([In] unsigned int MaxNumMatrices,[In] unsigned int MaxNumAnimationSets,[In] unsigned int MaxNumTracks,[In] unsigned int MaxNumEvents,[In] ID3DXAnimationController** ppAnimController) + D3DXCreateAnimationController +
+ + +

Finds the child frame of a root frame.

+
+

Pointer to the root frame. See .

+

Name of the child frame to find.

+

Returns the child frame if it is found, or null otherwise. See .

+ + bb172849 + D3DXFRAME* D3DXFrameFind([In] const D3DXFRAME* pFrameRoot,[In] const char* Name) + D3DXFrameFind +
+ + +

Creates a key framed animation set interface.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ + bb172776 + HRESULT D3DXCreateKeyframedAnimationSet([In] const char* pName,[In] double TicksPerSecond,[In] D3DXPLAYBACK_TYPE Playback,[In] unsigned int NumAnimations,[In] unsigned int NumCallbackKeys,[In] const D3DXKEY_CALLBACK* pCallbackKeys,[In] ID3DXKeyframedAnimationSet** ppAnimationSet) + D3DXCreateKeyframedAnimationSet +
+ + +

Destroys the subtree of frames under the root, including the root.

+
+

Pointer to the root node.

+

Allocation interface used to deallocate nodes of the frame hierarchy.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ + bb172848 + HRESULT D3DXFrameDestroy([In] D3DXFRAME* pFrameRoot,[In] ID3DXAllocateHierarchy* pAlloc) + D3DXFrameDestroy +
+ + +

Counts number of frames in a subtree that have non-null names.

+
+

Pointer to the root node of the subtree.

+

Returns the frame count.

+ + bb172850 + unsigned int D3DXFrameNumNamedMatrices([In] const D3DXFRAME* pFrameRoot) + D3DXFrameNumNamedMatrices +
+ + +

Creates a render environment map.

+
+

Pointer to an interface, which is the device to associate with the render surface.

+

Size of the render surface.

+

The number of mipmap levels.

+

Member of the enumerated type that describes the pixel format of the environment map.

+

If TRUE, the render surface supports a depth-stencil surface. Otherwise, this member is set to .

+

If DepthStencil is set to TRUE, this parameter is a member of the enumerated type that describes the depth-stencil format of the environment map.

+

Address of a reference to an interface that represents the created render environment map.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ + bb172790 + HRESULT D3DXCreateRenderToEnvMap([In] IDirect3DDevice9* pDevice,[In] unsigned int Size,[In] unsigned int MipLevels,[In] D3DFORMAT Format,[In] BOOL DepthStencil,[In] D3DFORMAT DepthStencilFormat,[In] ID3DXRenderToEnvMap** ppRenderToEnvMap) + D3DXCreateRenderToEnvMap +
+ + +

Returns the driver level.

+
+

Pointer to an interface representing the device.

+

The driver level. See remarks.

+ +

This method returns the driver version, which is one of the following:

  • 700 - Direct3D 7 level driver
  • 800 - Direct3D 8 level driver
  • 900 - Direct3D 9 level driver
+
+ + bb172865 + unsigned int D3DXGetDriverLevel([In] IDirect3DDevice9* pDevice) + D3DXGetDriverLevel +
+ + +

Creates a font object for a device and font.

+
+

Pointer to an interface, the device to be associated with the font object.

+

The height of the characters in logical units.

+

The width of the characters in logical units.

+

Typeface weight. One example is bold.

+

The number of mipmap levels.

+

True for italic font, false otherwise.

+

The character set of the font.

+

Specifies how Windows should attempt to match the desired font sizes and characteristics with actual fonts. Use OUT_TT_ONLY_PRECIS for instance, to ensure that you always get a TrueType font.

+

Specifies how Windows should match the desired font with a real font. It applies to raster fonts only and should not affect TrueType fonts.

+

Pitch and family index.

+

String containing the typeface name. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

Returns a reference to an interface, representing the created font object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The creation of an object requires that the device supports 32-bit color.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateFontA because ANSI strings are being used.

If you want more information about font parameters, see The Logical Font.

+
+ + bb172773 + HRESULT D3DXCreateFontW([In] IDirect3DDevice9* pDevice,[In] int Height,[In] unsigned int Width,[In] unsigned int Weight,[In] unsigned int MipLevels,[In] BOOL Italic,[In] unsigned int CharSet,[In] unsigned int OutputPrecision,[In] unsigned int Quality,[In] unsigned int PitchAndFamily,[In] const wchar_t* pFaceName,[Out, Fast] ID3DXFont** ppFont) + D3DXCreateFontW +
+ + +

Creates a render surface.

+
+

Pointer to an interface, the device to be associated with the render surface.

+

Width of the render surface, in pixels.

+

Height of the render surface, in pixels.

+

Member of the enumerated type, describing the pixel format of the render surface.

+

If TRUE, the render surface supports a depth-stencil surface. Otherwise, this member is set to . This function will create a new depth buffer.

+

If DepthStencil is set to TRUE, this parameter is a member of the enumerated type, describing the depth-stencil format of the render surface.

+

Address of a reference to an interface, representing the created render surface.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ + bb172791 + HRESULT D3DXCreateRenderToSurface([In] IDirect3DDevice9* pDevice,[In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] BOOL DepthStencil,[In] D3DFORMAT DepthStencilFormat,[Out, Fast] ID3DXRenderToSurface** ppRenderToSurface) + D3DXCreateRenderToSurface +
+ + +

Creates a sprite object which is associated with a particular device. Sprite objects are used to draw 2D images to the screen.

+
+

Pointer to an interface, the device to be associated with the sprite.

+

Address of a reference to an interface. This interface allows the user to access sprite functions.

+

If the function succeeds, the return value is .If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

This interface can be used to draw two dimensional images in screen space of the associated device.

+
+ + bb172797 + HRESULT D3DXCreateSprite([In] IDirect3DDevice9* pDevice,[Out, Fast] ID3DXSprite** ppSprite) + D3DXCreateSprite +
+ + +

Creates a font object indirectly for both a device and a font.

+
+

Pointer to an interface, the device to be associated with the font object.

+

Pointer to a structure, describing the attributes of the font object to create. If the compiler settings require Unicode, the data type resolves to ; otherwise, the data type resolves to D3DXFONT_DESCA. See Remarks.

+

Returns a reference to an interface, representing the created font object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateFontIndirectA because ANSI strings are being used.

+
+ + bb172774 + HRESULT D3DXCreateFontIndirectW([In] IDirect3DDevice9* pDevice,[In] const D3DXFONT_DESCW* pDesc,[Out, Fast] ID3DXFont** ppFont) + D3DXCreateFontIndirectW +
+ + +

Uses a left-handed coordinate system to create a line.

+
+

Pointer to an interface, representing the device associated with the created box mesh.

+

Pointer to an interface.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

This function creates a mesh with the creation option and | Flexible Vertex Format (FVF).

+
+ + bb172778 + HRESULT D3DXCreateLine([In] IDirect3DDevice9* pDevice,[Out, Fast] ID3DXLine** ppLine) + D3DXCreateLine +
+ + +

Turns on or off all D3DX debug output.

+
+

If TRUE, debugger output is halted; if , debug output is enabled.

+

Returns the previous value of Mute.

+ + bb172817 + BOOL D3DXDebugMute([In] BOOL Mute) + D3DXDebugMute +
+ + +

Verify that the version of D3DX you compiled with is the version that you are running.

+
+

Use . See remarks.

+

Use . See remarks.

+

Returns TRUE if the version of D3DX you compiled against is the version you are running with; otherwise, is returned.

+ +

Use this function during the initialization of your application like this:

  CD3DXMyApplication::Initialize( hInstance,  LPCSTR szWindowName, LPCSTR szClassName, UINT uWidth, UINT uHeight)	
+            {  hr; if (!(, )) return E_FAIL; ...	
+            }	
+            

Use Direct3DCreate9 to verify that the correct runtime is installed.

+
+ + bb172717 + BOOL D3DXCheckVersion([In] unsigned int D3DSdkVersion,[In] unsigned int D3DXSdkVersion) + D3DXCheckVersion +
+ + +

Create an effect from an ASCII or binary effect description.

+
+

Pointer to the device that will create the effect. See .

+

Pointer to a buffer containing an effect description.

+

Length of the effect data, in bytes.

+

An optional null-terminated array of structures that describe preprocessor definitions. This value can be null.

+

Optional interface reference, , to use for handling #include directives. If this value is null, #includes will either be honored when compiling from a file or will cause an error when compiled from a resource or memory.

+

If pSrcData contains a text effect, flags can be a combination of Flags and flags; otherwise, pSrcData contains a binary effect and the only flags honored are flags. The Direct3D 10 HLSL compiler is now the default. See Effect-Compiler Tool for details.

+

Pointer to a object to use for shared parameters. If this value is null, no parameters will be shared.

+

Returns a reference to an interface.

+

Returns a buffer containing a listing of compile errors.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ + bb172763 + HRESULT D3DXCreateEffect([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) + D3DXCreateEffect +
+ + +

Disassemble an effect.

+
+

Pointer to an interface that contains the effect.

+

Enable color coding to make the disassembly easier to read.

+

Returns a buffer containing the disassembled shader. See .

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ + bb172819 + HRESULT D3DXDisassembleEffect([In] ID3DXEffect* pEffect,[In] BOOL EnableColorCode,[In] ID3DXBuffer** ppDisassembly) + D3DXDisassembleEffect +
+ + +

Create an effect from an ASCII or binary effect description. This is an extended version of that allows an application to control which parameters are ignored by the effects system.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

This function is an extended version of that allows an application to specify which effect constants will be managed by the application. A constant that is managed by the application is ignored by the effects system. That is, the application is responsible for initializing the constant as well as saving and restoring its state whenever appropriate.

This function checks each constant in pSkipConstants to see that:

  • It is bound to a constant register.
  • It is only used in HLSL shader code.

If a constant is named in the string that is not present in the effect, it is ignored.

If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the LPCTSTR data type resolves to LPCSTR.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateEffectFromResourceA because ANSI strings are being used.

loads data from a resource of type RT_RCDATA. See MSDN for more information about Windows resources.

+
+ + bb172771 + HRESULT D3DXCreateEffectFromResourceExW([In] IDirect3DDevice9* pDevice,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) + D3DXCreateEffectFromResourceExW +
+ + +

Create an effect from an ASCII or binary effect description.

+
+

Pointer to the device.

+

Handle to a module containing the effect description. If this parameter is null, the current module will be used.

+

Pointer to the resource. This parameter supports both Unicode and ANSI strings. See Remarks.

+

An optional null-terminated array of structures that describe preprocessor definitions. This value can be null.

+

Optional interface reference, , to use for handling #include directives. If this value is null, #includes will either be honored when compiling from a file or will cause an error when compiled from a resource or memory.

+

If hSrcModule contains a text effect, flags can be a combination of Flags and flags; otherwise, hSrcModule contains a binary effect and the only flags honored are flags. The Direct3D 10 HLSL compiler is now the default. See Effect-Compiler Tool for details.

+

Pointer to a object to use for shared parameters. If this value is null, no parameters will be shared.

+

Returns a buffer containing the compiled effect.

+

Returns a buffer containing a listing of compile errors.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the LPCTSTR data type resolves to LPCSTR.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateEffectFromResourceA because ANSI strings are being used.

loads data from a resource of type RT_RCDATA. See MSDN for more information about Windows resources.

+
+ + bb172770 + HRESULT D3DXCreateEffectFromResourceW([In] IDirect3DDevice9* pDevice,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) + D3DXCreateEffectFromResourceW +
+ + +

Creates an effect compiler from an ASCII effect description.

+
+

Pointer to a buffer containing an effect description.

+

Length, in bytes, of the effect data.

+

An optional null-terminated array of structures that describe preprocessor definitions. This value can be null.

+

Optional interface reference, , to use for handling #include directives. If this value is null, #includes will either be honored when compiling from a file or will cause an error when compiled from a resource or memory.

+

Compile options identified by various flags (see Flags). The Direct3D 10 HLSL compiler is now the default. See Effect-Compiler Tool for details.

+

Address of a reference to an interface containing the effect compiler.

+

Address of a reference to an interface containing any error messages that occurred during compilation. This parameter can be set to null to ignore error messages.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ + bb172764 + HRESULT D3DXCreateEffectCompiler([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[Out, Fast] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) + D3DXCreateEffectCompiler +
+ + +

Create an effect from an ASCII or binary effect description. This function is an extended version of that allows an application to control which parameters are ignored by the effects system.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

This function is an extended version of that allows an application to specify which effect constants will be managed by the application. A constant that is managed by the application is ignored by the effects system. That is, the application is responsible for initializing the constant as well as saving and restoring its state whenever appropriate.

This function checks each constant in pSkipConstants to see that:

  • It is bound to a constant register.
  • It is only used in HLSL shader code.

If a constant is named in the string that is not present in the effect, it is ignored.

If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the LPCTSTR data type resolves to LPCSTR.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateEffectFromFileA because ANSI strings are being used.

+
+ + bb172769 + HRESULT D3DXCreateEffectFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) + D3DXCreateEffectFromFileExW +
+ + +

Creates an effect compiler from an ASCII effect description.

+
+

Pointer to the filename. This parameter supports both Unicode and ANSI strings. See Remarks.

+

An optional null-terminated array of structures that describe preprocessor definitions. This value can be null.

+

Optional interface reference, , to use for handling #include directives. If this value is null, #includes will either be honored when compiling from a file or will cause an error when compiled from a resource or memory.

+

Compile options identified by various flags (see Flags). The Direct3D 10 HLSL compiler is now the default. See Effect-Compiler Tool for details.

+

Address of a reference to an interface, containing the effect compiler.

+

Address of a reference to an interface, containing any error messages that occurred during compilation. This parameter can be set to null to ignore error messages.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the LPCTSTR data type resolves to LPCSTR.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateEffectCompilerFromFileA because ANSI strings are being used.

+
+ + bb172765 + HRESULT D3DXCreateEffectCompilerFromFileW([In] const wchar_t* pSrcFile,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) + D3DXCreateEffectCompilerFromFileW +
+ + +

Creates an from an ASCII effect description.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the LPCTSTR data type resolves to LPCSTR.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateEffectCompilerFromResourceA because ANSI strings are being used.

+
+ + bb172766 + HRESULT D3DXCreateEffectCompilerFromResourceW([In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) + D3DXCreateEffectCompilerFromResourceW +
+ + +

Create an effect from an ASCII or binary effect description.

+
+

Pointer to the device that will create the effect. See .

+

Pointer to the filename. This parameter supports both Unicode and ANSI strings. See Remarks.

+

Optional null-terminated array of preprocessor macro definitions. See .

+

Optional interface reference, , to use for handling #include directives. If this value is null, #includes will either be honored when compiling from a file or will cause an error when compiled from a resource or memory.

+

If pSrcFile contains a text effect, flags can be a combination of Flags and flags; otherwise, pSrcFile contains a binary effect and the only flags honored are flags. The Direct3D 10 HLSL compiler is now the default. See Effect-Compiler Tool for details.

+

Pointer to a object to use for shared parameters. If this value is null, no parameters will be shared.

+

Returns a reference to a buffer containing the compiled effect. See .

+

Returns a reference to a buffer containing a listing of compile errors. See .

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the LPCTSTR data type resolves to LPCSTR.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateEffectFromFileA because ANSI strings are being used.

+
+ + bb172768 + HRESULT D3DXCreateEffectFromFileW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) + D3DXCreateEffectFromFileW +
+ + +

Create an effect pool. A pool is used to share parameters between effects.

+
+

Returns a reference to the created pool.

+

If the method succeeds, the return value is .

If the arguments are invalid, the method will return .

If the method fails, the return value will be E_FAIL.

+ +

For effects within a pool, shared parameters with the same name share values.

+
+ + bb172772 + HRESULT D3DXCreateEffectPool([Out, Fast] ID3DXEffectPool** ppPool) + D3DXCreateEffectPool +
+ + +

Creates an effect from an ASCII or binary effect description. This function is an extended version of that allows an application to control which parameters are ignored by the effects system.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

This function is an extended version of that allows an application to specify which effect constants will be managed by the application. A constant that is managed by the application is ignored by the effects system. That is, the application is responsible for initializing the constant as well as saving and restoring its state whenever appropriate.

This function checks each constant in pSkipConstants to see that:

  • It is bound to a constant register.
  • It is only used in HLSL shader code.

If a constant is named in the string that is not present in the effect, it is ignored.

+
+ + bb172767 + HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) + D3DXCreateEffectEx +
+ + +

Saves a mesh to a .x file.

+
+

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

Pointer to an interface, representing the mesh to save to a .x file.

+

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh. This parameter may be null.

+

Pointer to an array of structures, containing material information to be saved in the .x file.

+

Pointer to an array of effect instances, one per attribute group in the mesh. This parameter may be null. An effect instance is a particular instance of state information used to initialize an effect. For more information, see .

+

Number of structures in the pMaterials array.

+

A combination of file format and save options when saving an .x file. See D3DX X File Constants.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: .

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXSaveMeshToXA because ANSI strings are being used.

The default file format is binary; however, if a file is specified as both a binary and a text file, it will be saved as a text file. Regardless of the file format, you may also use the compressed format to reduce the file size.

The following is a typical code example of how to use this function.

 *    m_pMesh;           // Mesh object to be saved to a .x file	
+            * m_pMaterials;      // Array of material structs in the mesh	
+            DWORD         m_dwNumMaterials;  // Number of material structs in the mesh DWORD dwFormat = ;  // Binary-format .x file (default)	
+            // DWORD dwFormat = ; // Text-format .x file // Load mesh into m_pMesh and determine values of m_pMaterials and 	
+            // m_dwNumMaterials with calls to D3DXLoadMeshxxx or other D3DX functions // ... ( L"outputxfilename.x", m_pMesh, null, m_pMaterials, null, m_dwNumMaterials, dwFormat );	
+            
+
+ + bb205428 + HRESULT D3DXSaveMeshToXW([In] const wchar_t* pFilename,[In] ID3DXMesh* pMesh,[In] const unsigned int* pAdjacency,[In] const D3DXMATERIAL* pMaterials,[In] const D3DXEFFECTINSTANCE* pEffectInstances,[In] unsigned int NumMaterials,[In] unsigned int Format) + D3DXSaveMeshToXW +
+ + +

Creates an N-patch mesh from a triangle mesh.

+
+

Address of a reference to an interface that represents the triangle mesh object.

+

Address of a reference to an interface that represents the created patch mesh object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ + bb172782 + HRESULT D3DXCreateNPatchMesh([In] ID3DXMesh* pMeshSysMem,[In] ID3DXPatchMesh** pPatchMesh) + D3DXCreateNPatchMesh +
+ + +

Returns a declarator from a flexible vertex format (FVF) code.

+
+

Combination of that describes the FVF from which to generate the returned declarator array.

+

An array of elements describing the vertex format of the mesh vertices. The upper limit of this declarator array is .

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: D3DXERR_INVALIDMESH.

+ + bb172818 + HRESULT D3DXDeclaratorFromFVF([In] D3DFVF FVF,[In, Buffer] D3DVERTEXELEMENT9* pDeclarator) + D3DXDeclaratorFromFVF +
+ + +

Compute tangent, binormal, and normal vectors for a mesh.

+
+

Pointer to an input mesh object.

+

Combination of one or more flags.

Use null to specify the following options:

  • Weight the normal vector length by the angle, in radians, subtended by the two edges leaving the vertex.
  • Compute orthogonal Cartesian coordinates from the UV texture coordinates.
  • Textures are not wrapped in either U or V directions
  • Partial derivatives with respect to texture coordinates are normalized.
  • Vertices are ordered in a counterclockwise direction around each triangle.
  • Use per-vertex normal vectors already present in the input mesh.
  • The results will be stored in the original input mesh. The function will fail if new vertices need to be created.
+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

This function simply calls with the following input parameters:

 (pMesh, , 0,    , 0, , 0,  , 0,  dwOptions | , null, 0.01f, 0.25f, 0.01f, null, null);	
+            

Singularities are handled as required by grouping edges and splitting vertices. If any vertices need to be split, the function will fail. The computed normal vector at each vertex is always normalized to have unit length.

The most robust solution for computing orthogonal Cartesian coordinates is to not set flags and , so that orthogonal coordinates are computed from both UV texture coordinates. However, in this case, if either U or V is zero, then the function will compute orthogonal coordinates using or respectively.

+
+ + bb172744 + HRESULT D3DXComputeTangentFrame([In] ID3DXMesh* pMesh,[In] unsigned int dwOptions) + D3DXComputeTangentFrame +
+ + +

Generates an optimized face remapping for a triangle list.

+
+

Pointer to triangle list indices to use for ordering vertices.

+

Number of faces in the triangle list. For 16-bit meshes, this is limited to 2^16 - 1 (65535) or fewer faces.

+

Number of vertices referenced by the triangle list.

+

Flag indicating index type: TRUE if indices are 32-bit (more than 65535 indices), if indices are 16-bit (65535 or fewer indices).

+

Pointer to the original mesh face that was split to generate the current face.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

This function's optimization procedure is functionally equivalent to calling with the flag, but this function makes more efficient use of vertex caches.

+
+ + bb205376 + HRESULT D3DXOptimizeFaces([In] const void* pbIndices,[In] unsigned int cFaces,[In] unsigned int cVertices,[In] BOOL b32BitIndices,[In, Buffer] int* pFaceRemap) + D3DXOptimizeFaces +
+ + +

Welds together replicated vertices that have equal attributes. This method uses specified epsilon values for equality comparisons.

+
+

Pointer to an object, the mesh from which to weld vertices.

+

Combination of one or more flags from D3DXWELDEPSILONSFLAGS.

+

Pointer to a D3DXWeldEpsilons structure, specifying the epsilon values to be used for this method. Use null to initialize all structure members to a default value of 1.0e-6f.

+

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the source mesh. If the edge has no adjacent faces, the value is 0xffffffff. If this parameter is set to null, will be called to create logical adjacency information.

+

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the optimized mesh. If the edge has no adjacent faces, the value is 0xffffffff.

+

An array of DWORDs, one per face, that identifies the original mesh face that corresponds to each face in the welded mesh.

+

Address of a reference to an interface, which contains a DWORD for each vertex that specifies how the new vertices map to the old vertices. This remap is useful if you need to alter external data based on the new vertex mapping.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

This function uses supplied adjacency information to determine the points that are replicated. Vertices are merged based on an epsilon comparison. Vertices with equal position must already have been calculated and represented by point-representative data.

This function combines logically-welded vertices that have similar components, such as normals or texture coordinates within pEpsilons.

The following example code calls this function with welding enabled. Vertices are compared using epsilon values for normal vector and vertex position. A reference is returned to a face remapping array (pFaceRemap).

 TCHAR            strMediaPath[512];       // X-file path 	
+            LPD3DXBUFFER     pAdjacencyBuffer = null; // adjacency data buffer	
+            LPD3DXBUFFER     pD3DXMtrlBuffer  = null; // material buffer	
+            LPD3DXMESH       pMesh            = null; // mesh object	
+            DWORD            m_dwNumMaterials;        // number of materials	
+             Epsilons;                // structure with epsilon values	
+            DWORD            *pFaceRemap[65536];      // face remapping array	
+            DWORD            i;                       // internal variable // Load the mesh from the specified file hr =  ( strMediaPath, , m_pd3dDevice, &pAdjacencyBuffer, &pD3DXMtrlBuffer, null, &m_dwNumMaterials, &pMesh ) ) if( FAILED( hr ) )  goto End;              // Go to error handling // Set epsilon values Epsilons.Normal = 0.001; Epsilons.Position = 0.1; // Weld the vertices for( i=0; i < 65536; i++ ) {  pFaceRemap[i] = 0;  } hr =  ( pMesh, , &Epsilons, (DWORD*)pAdjacencyBuffer->GetBufferPointer(), (DWORD*)pAdjacencyBuffer->GetBufferPointer(), (DWORD*)pFaceRemap, null ) if( FAILED( hr ) )  goto End;              // Go to error handling	
+            
+
+ + bb205562 + HRESULT D3DXWeldVertices([In] ID3DXMesh* pMesh,[In] unsigned int Flags,[In] const D3DXWELDEPSILONS* pEpsilons,[In] const unsigned int* pAdjacencyIn,[In] unsigned int* pAdjacencyOut,[In] unsigned int* pFaceRemap,[In] ID3DXBuffer** ppVertexRemap) + D3DXWeldVertices +
+ + +

Generates an output vertex declaration from the input declaration. The output declaration is intended for use by the mesh tessellation functions.

+
+

Pointer to the output vertex declaration. See .

+

Pointer to the input vertex declaration. See .

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: .

+ + bb172861 + HRESULT D3DXGenerateOutputDecl([In, Buffer] D3DVERTEXELEMENT9* pOutput,[In, Buffer] const D3DVERTEXELEMENT9* pInput) + D3DXGenerateOutputDecl +
+ + +

Creates a buffer object.

+
+

Size of the buffer to create, in bytes.

+

Address of a reference to an interface, representing the created buffer object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: E_OUTOFMEMORY.

+ + bb172753 + HRESULT D3DXCreateBuffer([In] unsigned int NumBytes,[In] ID3DXBuffer** ppBuffer) + D3DXCreateBuffer +
+ + +

Loads a patch mesh from an object.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

For mesh files that do not contain effect instance information, default effect instances will be generated from the material information in the .x file. A default effect instance will have default values that correspond to the members of the structure.

The default texture name is also filled in, but is handled differently. The name will be Texture0@Name, which corresponds to an effect variable by the name of "Texture0" with an annotation called "Name." This will contain the string file name for the texture.

+
+ + bb172896 + HRESULT D3DXLoadPatchMeshFromXof([In] ID3DXFileData* pXofObjMesh,[In] unsigned int Options,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXBuffer** ppMaterials,[In] ID3DXBuffer** ppEffectInstances,[In] unsigned int* pNumMaterials,[In] ID3DXPatchMesh** ppMesh) + D3DXLoadPatchMeshFromXof +
+ + +

Tessellates the given mesh using the N-patch tessellation scheme.

+
+

Pointer to an interface, representing the mesh to tessellate.

+

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the source mesh. This parameter may be null.

+

Number of segments per edge to tessellate.

+

Set to TRUE to use quadratic interpolation for normals; set to for linear interpolation.

+

Address of a reference to an interface, representing the returned tessellated mesh.

+

Address of a reference to an interface. If the value of this parameter is not set to null, this buffer will contain an array of three DWORDs per face that specify the three neighbors for each face in the output mesh. This parameter may be null.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

This function tessellates by using the N-patch algorithm.

+
+ + bb205469 + HRESULT D3DXTessellateNPatches([In] ID3DXMesh* pMeshIn,[In] const unsigned int* pAdjacencyIn,[In] float NumSegs,[In] BOOL QuadraticInterpNormals,[In] ID3DXMesh** ppMeshOut,[In] ID3DXBuffer** ppAdjacencyOut) + D3DXTessellateNPatches +
+ + +

Calculates per-triangle IMT's from a custom application-specified signal that varies over the surface of the mesh (generally at a higher frequency than vertex data). The signal is evaluated via a user-specified callback function.

+
+

A reference to an input mesh (see ) which contains the object geometry for calculating the IMT.

+

Zero-based texture coordinate index that identifies which set of texture coordinates to use.

+

The number of components in each data point in the signal.

+

The maximum distance between vertices; the algorithm continues subdividing until the distance between all vertices is less than or equal to fMaxUVDistance.

+

Texture wrap options. This is a combination of one or more FLAGS.

+

A reference to a user-provided evaluator function, which will be used to compute the signal value at arbitrary U,V coordinates. The function follows the prototype of LPD3DXIMTSIGNALCALLBACK.

+

A reference to a user-defined value which is passed to the signal callback function. Typically used by an application to pass a reference to a data structure that provides context information for the callback function.

+

A reference to a callback function to monitor IMT computation progress.

+

A reference to a user-defined variable which is passed to the status callback function. Typically used by an application to pass a reference to a data structure that provides context information for the callback function.

+

A reference to the buffer (see ) containing the returned IMT array. This array can be provided as input to the D3DX UVAtlas Functions to prioritize texture-space allocation in the texture parameterization.

+

If the function succeeds, the return value is ; otherwise, the value is .

+ +

This function requires that the input mesh contain a signal-to-mesh texture mapping (ie. texture coordinates). It allows the user to define a signal arbitrarily over the surface of the mesh.

+
+ + bb172739 + HRESULT D3DXComputeIMTFromSignal([In] ID3DXMesh* pMesh,[In] unsigned int dwTextureIndex,[In] unsigned int uSignalDimension,[In] float fMaxUVDistance,[In] unsigned int dwOptions,[In] __function__stdcall* pSignalCallback,[In] void* pUserData,[In] __function__stdcall* pStatusCallback,[In] void* pUserContext,[In] ID3DXBuffer** ppIMTData) + D3DXComputeIMTFromSignal +
+ + +

Validates a patch mesh, returning the number of degenerate vertices and patches.

+
+

Pointer to an interface, representing the patch mesh to be tested.

+

Returns the number of degenerate vertices in the patch mesh.

+

Returns the number of degenerate patches in the patch mesh.

+

Returns a reference to a buffer containing a string of errors and warnings that explain the problems found in the patch mesh.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

This method validates the mesh by checking for invalid indices. Error information is available from the debugger output.

+
+ + bb205483 + HRESULT D3DXValidPatchMesh([In] ID3DXPatchMesh* pMesh,[In] unsigned int* dwcDegenerateVertices,[In] unsigned int* dwcDegeneratePatches,[In] ID3DXBuffer** ppErrorsAndWarnings) + D3DXValidPatchMesh +
+ + +

Validates a mesh.

+
+

Pointer to an interface, representing the mesh to be tested.

+

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh to be tested.

+

Returns a buffer containing a string of errors and warnings, which explain the problems found in the mesh.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: D3DXERR_INVALIDMESH, , E_OUTOFMEMORY.

+ +

This method validates the mesh by checking for invalid indices. Error information is available from the debugger output.

+
+ + bb205482 + HRESULT D3DXValidMesh([In] ID3DXMesh* pMeshIn,[In] const unsigned int* pAdjacency,[In] ID3DXBuffer** ppErrorsAndWarnings) + D3DXValidMesh +
+ + +

Splits a mesh into meshes smaller than the specified size.

+
+

Pointer to an interface, representing the source mesh.

+

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh to be simplified.

+

Maximum number of vertices in the resulting mesh.

+

Option flags for the new meshes.

+

Number of meshes returned.

+

Buffer containing an array of interfaces for the new meshes. For a source mesh split into n meshes, ppMeshArrayOut is an array of n references.

+

Buffer containing an array of adjacency arrays (DWORDs) for the new meshes. See . This parameter is optional.

+

Buffer containing an array of face remap arrays (DWORDs) for the new meshes. See . This parameter is optional.

+

Buffer containing an array of vertex remap arrays for the new meshes. See . This parameter is optional.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

A common use of this function is to split a mesh with 32-bit indices (more than 65535 vertices) into more than one mesh, each of which has 16-bit indices.

The adjacency, vertex remap and face remap arrays are arrays are DWORDs where each array contains n DWORD references, followed by the DWORD data referenced by the references. For example, to obtain the face remap information for face 3 in mesh 2, the following code could be used, assuming the face remap data was returned in a variable named ppFaceRemapArrayOut.

 const DWORD **face_remaps =  static_cast<DWORD **>(ppFaceRemapArrayOut->GetBufferPointer());	
+            const DWORD remap = face_remaps[2][3];	
+            
+
+ + bb205465 + HRESULT D3DXSplitMesh([In] ID3DXMesh* pMeshIn,[In] const unsigned int* pAdjacencyIn,[In] const unsigned int MaxSize,[In] const unsigned int Options,[In] unsigned int* pMeshesOut,[In] ID3DXBuffer** ppMeshArrayOut,[In] ID3DXBuffer** ppAdjacencyArrayOut,[In] ID3DXBuffer** ppFaceRemapArrayOut,[In] ID3DXBuffer** ppVertRemapArrayOut) + D3DXSplitMesh +
+ + +

Computes the tangent vectors for the texture coordinates given in the texture stage. Provided to support legacy applications. Use for better results.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

If the mesh vertex declaration specifies tangent or binormal fields, will update any user-supplied tangent or binormal data. Alternatively, set TangentIndex to D3DX_DEFAULT to not update the user-supplied tangent data, or set BinormIndex to D3DX_DEFAULT to not update the user-supplied binormal data. TexStageIndex cannot be set to D3DX_DEFAULT.

depends on the mesh vertex declaration containing either the binormal field (BinormIndex), the tangent field (TangentIndex), or both. If both are missing, this function will fail.

This function simply calls with the following input parameters:

 ( Mesh, , TexStageIndex, ( BinormIndex == D3DX_DEFAULT ) ? D3DX_DEFAULT : , // provides backward function compatibility BinormIndex, ( TangentIndex == D3DX_DEFAULT ) ? D3DX_DEFAULT : , TangentIndex, D3DX_DEFAULT, // do not store normals 0, ( Wrap ?  : 0 ) |  | , pAdjacency, -1.01f, -0.01f, -1.01f, null, null);	
+            
+
+ + bb172743 + HRESULT D3DXComputeTangent([In] ID3DXMesh* Mesh,[In] unsigned int TexStage,[In] unsigned int TangentIndex,[In] unsigned int BinormIndex,[In] unsigned int Wrap,[In] const unsigned int* pAdjacency) + D3DXComputeTangent +
+ + +

Determines if a ray intersects with a mesh.

+
+

Pointer to an interface, representing the mesh to be tested.

+

Pointer to a structure, specifying the point where the ray begins.

+

Pointer to a structure, specifying the direction of the ray.

+

Pointer to a . If the ray intersects a triangular face on the mesh, this value will be set to TRUE. Otherwise, this value is set to .

+

Pointer to an index value of the face closest to the ray origin, if pHit is TRUE.

+

Pointer to a barycentric hit coordinate, U.

+

Pointer to a barycentric hit coordinate, V.

+

Pointer to a ray intersection parameter distance.

+

Pointer to an object, containing an array of D3DXINTERSECTINFO structures.

+

Pointer to a DWORD that contains the number of entries in the ppAllHits array.

+

If the function succeeds, the return value is . If the function fails, the return value can be: E_OUTOFMEMORY.

+ +

The function provides a way to understand points in and around a triangle, independent of where the triangle is actually located. This function returns the resulting point by using the following equation: V1 + U(V2 - V1) + V(V3 - V1).

Any point in the plane V1V2V3 can be represented by the barycentric coordinate (U,V). The parameter U controls how much V2 gets weighted into the result, and the parameter V controls how much V3 gets weighted into the result. Lastly, the value of [1 - (U + V)] controls how much V1 gets weighted into the result.

Barycentric coordinates are a form of general coordinates. In this context, using barycentric coordinates represents a change in coordinate systems. What holds true for Cartesian coordinates holds true for barycentric coordinates.

Barycentric coordinates define a point inside a triangle in terms of the triangle's vertices. For a more in-depth description of barycentric coordinates, see Mathworld's Barycentric Coordinates Description.

+
+ + bb172882 + HRESULT D3DXIntersect([In] ID3DXBaseMesh* pMesh,[In] const D3DXVECTOR3* pRayPos,[In] const D3DXVECTOR3* pRayDir,[In] BOOL* pHit,[In] unsigned int* pFaceIndex,[In] float* pU,[In] float* pV,[In] float* pDist,[In] ID3DXBuffer** ppAllHits,[In] unsigned int* pCountOfHits) + D3DXIntersect +
+ + +

Pack mesh partitioning data into an atlas.

+
+

Pointer to an input mesh (see ) which contains the object geometry for calculating the atlas. At a minimum, the mesh must contain position data and 2D texture coordinates.

+

Texture width.

+

Texture height.

+

The minimum distance, in texels, between two charts on the atlas. The gutter is always scaled by the width; so, if a gutter of 2.5 is used on a 512x512 texture, then the minimum distance between two charts is 2.5 / 512.0 texels.

+

Zero-based texture coordinate index that identifies which set of texture coordinates to use.

+

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh. It should be derived from the ppPartitionResultAdjacency returned from . This value cannot be null, because Pack needs to know where charts were cut in the partition step in order to find the edges of each chart.

+

A reference to a callback function (see LPD3DXUVATLASCB) that is useful for monitoring progress.

+

Specify how often D3DX will call the callback; a reasonable default value is 0.0001f.

+

A void reference to be passed back to the callback function.

+

This options parameter is currently reserved.

+

A reference to an containing the array of the final face-partitioning. Each element contains one DWORD per face.

+

If the function succeeds, the return value is ; otherwise, the value is .

+ + bb205480 + HRESULT D3DXUVAtlasPack([In] ID3DXMesh* pMesh,[In] unsigned int uWidth,[In] unsigned int uHeight,[In] float fGutter,[In] unsigned int dwTextureIndex,[In] const unsigned int* pdwPartitionResultAdjacency,[In] __function__stdcall* pStatusCallback,[In] float fCallbackFrequency,[In] void* pUserContext,[In] unsigned int dwOptions,[In] ID3DXBuffer* pFacePartitioning) + D3DXUVAtlasPack +
+ + +

Loads a skin mesh from a DirectX .x file data object.

+
+

Pointer to an interface, representing the file data object to load.

+

Combination of one or more flags, from the D3DXMESH enumeration, specifying creation options for the mesh.

+

Pointer to an interface, the device object associated with the mesh.

+

Address of a reference to an interface. When this method returns, this parameter is filled with an array of three DWORDs per face that specify the three neighbors for each face in the mesh.

+

Address of a reference to an interface. When the method returns, this parameter is filled with an array of structures.

+

Pointer to a buffer containing an array of effect instances, one per attribute group in the returned mesh. An effect instance is a particular instance of state information used to initialize an effect. See . For more information about accessing the buffer, see .

+

Pointer to the number of structures in the ppMaterials array, when the method returns.

+

Address of a reference to an interface, which represents the skinning information.

+

Address of a reference to an interface, which represents the loaded mesh.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY

+ +

This method takes a reference to an internal object in the .x file, enabling you to load the frame hierarchy.

For mesh files that do not contain effect instance information, default effect instances will be generated from the material information in the .x file. A default effect instance will have default values that correspond to the members of the structure.

The default texture name is also filled in, but is handled differently. The name will be Texture0@Name, which corresponds to an effect variable by the name of "Texture0" with an annotation called "Name." This will contain the string file name for the texture.

+
+ + bb172899 + HRESULT D3DXLoadSkinMeshFromXof([In] ID3DXFileData* pxofMesh,[In] unsigned int Options,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXBuffer** ppAdjacency,[In] ID3DXBuffer** ppMaterials,[In] ID3DXBuffer** ppEffectInstances,[In] unsigned int* pMatOut,[In] ID3DXSkinInfo** ppSkinInfo,[In] ID3DXMesh** ppMesh) + D3DXLoadSkinMeshFromXof +
+ + +

Creates a mesh object using a declarator.

+
+

Number of faces for the mesh. The valid range for this number is greater than 0, and one less than the maximum DWORD (typically 65534), because the last index is reserved.

+

Number of vertices for the mesh. This parameter must be greater than 0.

+

Combination of one or more flags from the D3DXMESH enumeration, specifying options for the mesh.

+

Array of elements, describing the vertex format for the returned mesh. This parameter must map directly to a flexible vertex format (FVF).

+

Pointer to an interface, the device object to be associated with the mesh.

+

Address of a reference to an interface, representing the created mesh object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ + bb172780 + HRESULT D3DXCreateMesh([In] unsigned int NumFaces,[In] unsigned int NumVertices,[In] unsigned int Options,[In] const D3DVERTEXELEMENT9* pDeclaration,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXMesh** ppMesh) + D3DXCreateMesh +
+ + +

Creates an empty skin mesh object using a flexible vertex format (FVF) code.

+
+

Number of vertices for the skin mesh.

+

Combination of that describes the vertex format for the returned skin mesh.

+

Number of bones for the skin mesh.

+

Address of a reference to an interface, representing the created skin information object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

Use SetBoneInfluence to populate the empty skin mesh object returned by this method.

+
+ + bb172794 + HRESULT D3DXCreateSkinInfoFVF([In] unsigned int NumVertices,[In] D3DFVF FVF,[In] unsigned int NumBones,[In] ID3DXSkinInfo** ppSkinInfo) + D3DXCreateSkinInfoFVF +
+ + +

Intersects the specified ray with the given mesh subset. This provides similar functionality to .

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be the following value: E_OUTOFMEMORY.

+ +

The function provides a way to understand points in and around a triangle, independent of where the triangle is actually located. This function returns the resulting point by using the following equation: V1 + U(V2 - V1) + V(V3 - V1).

Any point in the plane V1V2V3 can be represented by the barycentric coordinate (U,V). The parameter U controls how much V2 gets weighted into the result and the parameter V controls how much V3 gets weighted into the result. Lastly, the value of [1 - (U + V)] controls how much V1 gets weighted into the result.

Barycentric coordinates are a form of general coordinates. In this context, using barycentric coordinates represents a change in coordinate systems. What holds true for Cartesian coordinates holds true for barycentric coordinates.

Barycentric coordinates define a point inside a triangle in terms of the triangle's vertices. For a more in-depth description of barycentric coordinates, see Mathworld's Barycentric Coordinates Description.

+
+ + bb172884 + HRESULT D3DXIntersectSubset([In] ID3DXBaseMesh* pMesh,[In] unsigned int AttribId,[In] const D3DXVECTOR3* pRayPos,[In] const D3DXVECTOR3* pRayDir,[In] BOOL* pHit,[In] unsigned int* pFaceIndex,[In] float* pU,[In] float* pV,[In] float* pDist,[In] ID3DXBuffer** ppAllHits,[In] unsigned int* pCountOfHits) + D3DXIntersectSubset +
+ + +

Returns the size of a vertex for a flexible vertex format (FVF).

+
+

FVF to be queried. A combination of .

+

The FVF vertex size, in bytes.

+ + bb172866 + unsigned int D3DXGetFVFVertexSize([In] D3DFVF FVF) + D3DXGetFVFVertexSize +
+ + +

Returns the number of elements in the vertex declaration.

+
+

A reference to the vertex declaration. See .

+

The number of elements in the vertex declaration.

+ + bb172863 + unsigned int D3DXGetDeclLength([In, Buffer] const D3DVERTEXELEMENT9* pDecl) + D3DXGetDeclLength +
+ + +

Cleans a mesh, preparing it for simplification.

+
+

Vertex operations to perform in preparation for mesh cleaning. See .

+

Pointer to an interface, representing the mesh to be cleaned.

+

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh to be cleaned.

+

Address of a reference to an interface, representing the returned cleaned mesh. The same mesh is returned that was passed in if no cleaning was necessary.

+

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the output mesh.

+

Returns a buffer containing a string of errors and warnings, which explain the problems found in the mesh.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

This function cleans a mesh using the cleaning method and options specified in the CleanType parameter. See the enumeration for a description of the available options.

+
+ + bb172719 + HRESULT D3DXCleanMesh([In] D3DXCLEANTYPE CleanType,[In] ID3DXMesh* pMeshIn,[In] const unsigned int* pAdjacencyIn,[In] ID3DXMesh** ppMeshOut,[In] unsigned int* pAdjacencyOut,[In] ID3DXBuffer** ppErrorsAndWarnings) + D3DXCleanMesh +
+ + +

Computes the intersection of a ray and a triangle.

+
+

Pointer to a structure, describing the first triangle vertex position.

+

Pointer to a structure, describing the second triangle vertex position.

+

Pointer to a structure, describing the third triangle vertex position.

+

Pointer to a structure, specifying the point where the ray begins.

+

Pointer to a structure, specifying the direction of the ray.

+

Barycentric hit coordinates, U.

+

Barycentric hit coordinates, V.

+

Ray-intersection parameter distance.

+

Returns TRUE if the ray intersects the area of the triangle. Otherwise, returns .

+ +

Any point in the plane V1V2V3 can be represented by the barycentric coordinate (U,V). The parameter U controls how much V2 gets weighted into the result, and the parameter V controls how much V3 gets weighted into the result. Lastly, the value of [1 - (U + V)] controls how much V1 gets weighted into the result.

Barycentric coordinates are a form of general coordinates. In this context, using barycentric coordinates represents a change in coordinate systems. What holds true for Cartesian coordinates holds true for barycentric coordinates.

Barycentric coordinates define a point inside a triangle in terms of the triangle's vertices. For a more in-depth description of barycentric coordinates, see Mathworld's Barycentric Coordinates Description.

+
+ + bb204928 + BOOL D3DXIntersectTri([In] const D3DXVECTOR3* p0,[In] const D3DXVECTOR3* p1,[In] const D3DXVECTOR3* p2,[In] const D3DXVECTOR3* pRayPos,[In] const D3DXVECTOR3* pRayDir,[In] float* pU,[In] float* pV,[In] float* pDist) + D3DXIntersectTri +
+ + +

Converts the specified mesh subset into a single triangle strip.

+
+

Pointer to an interface, representing the mesh to convert to a strip.

+

Attribute ID of the mesh subset to convert to strips.

+

Combination of one or more flags from the D3DXMESH enumeration, specifying options for creating the index buffer. Cannot be . The index buffer will be created with 32-bit or 16-bit indices, depending on the format of the index buffer of the mesh specified by the MeshIn parameter.

+

Pointer to an interface, representing the index buffer containing the strip.

+

Number of indices in the buffer returned in the ppIndexBuffer parameter.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ +

Before running this function, call Optimize or , with the flag set.

+
+ + bb172749 + HRESULT D3DXConvertMeshSubsetToSingleStrip([In] ID3DXBaseMesh* MeshIn,[In] unsigned int AttribId,[In] unsigned int IBOptions,[In] IDirect3DIndexBuffer9** ppIndexBuffer,[In] unsigned int* pNumIndices) + D3DXConvertMeshSubsetToSingleStrip +
+ + +

Creates an empty skin mesh object using a declarator.

+
+

Number of vertices for the skin mesh.

+

Array of elements, describing the vertex format for the returned mesh.

+

Number of bones for the skin mesh.

+

Address of a reference to an interface, representing the created skin mesh object.

+

If the function succeeds, the return value is . If the function fails, the return value can be: E_OUTOFMEMORY.

+ +

Use SetBoneInfluence to populate the empty skin mesh object returned by this method.

+
+ + bb172792 + HRESULT D3DXCreateSkinInfo([In] unsigned int NumVertices,[In] const D3DVERTEXELEMENT9* pDeclaration,[In] unsigned int NumBones,[In] ID3DXSkinInfo** ppSkinInfo) + D3DXCreateSkinInfo +
+ + +

Returns the size of a vertex from the vertex declaration.

+
+

A reference to the vertex declaration. See .

+

The zero-based stream index.

+

The vertex declaration size, in bytes.

+ + bb172864 + unsigned int D3DXGetDeclVertexSize([In, Buffer] const D3DVERTEXELEMENT9* pDecl,[In] unsigned int Stream) + D3DXGetDeclVertexSize +
+ + + No documentation. + + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + + HRESULT D3DXGeneratePMesh([In] ID3DXMesh* pMesh,[In] const unsigned int* pAdjacency,[In] const D3DXATTRIBUTEWEIGHTS* pVertexAttributeWeights,[In] const float* pVertexWeights,[In] unsigned int MinValue,[In] unsigned int Options,[In] ID3DXPMesh** ppPMesh) + D3DXGeneratePMesh + + + +

Tessellates a rectangular higher-order surface patch into a triangle mesh.

+
+

Vertex buffer containing the patch data.

+

Pointer to an array of four floating-point values that identify the number of segments into which each edge of the rectangle patch should be divided when tessellated. See .

+

Vertex declaration structure that defines the vertex data. See .

+

Describes a rectangular patch. See .

+

Pointer to the created mesh. See .

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

Use to get the number of output vertices and indices that the tessellation function needs.

+
+ + bb205470 + HRESULT D3DXTessellateRectPatch([In] IDirect3DVertexBuffer9* pVB,[In] const float* pNumSegs,[In] const D3DVERTEXELEMENT9* pdwInDecl,[In] const D3DRECTPATCH_INFO* pRectPatchInfo,[In] ID3DXMesh* pMesh) + D3DXTessellateRectPatch +
+ + +

Returns a flexible vertex format (FVF) code from a declarator.

+
+

Array of elements, describing the FVF code.

+

Pointer to a DWORD value, representing the returned combination of that describes the vertex format returned from the declarator.

+ +

This function will fail for any declarator that does not map directly to an FVF.

+
+ + bb172854 + HRESULT D3DXFVFFromDeclarator([In, Buffer] const D3DVERTEXELEMENT9* pDeclarator,[Out] D3DFVF* pFVF) + D3DXFVFFromDeclarator +
+ + +

Computes a coordinate-axis oriented bounding box.

+
+

Pointer to the first position.

+

Number of vertices.

+

Count or number of bytes between vertices.

+

Pointer to a structure, describing the returned lower-left corner of the bounding box.

+

Pointer to a structure, describing the returned upper-right corner of the bounding box.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: .

+ + bb204920 + HRESULT D3DXComputeBoundingBox([In] const D3DXVECTOR3* pFirstPosition,[In] unsigned int NumVertices,[In] unsigned int dwStride,[In] D3DXVECTOR3* pMin,[In] D3DXVECTOR3* pMax) + D3DXComputeBoundingBox +
+ + +

Creates a skin mesh from another mesh.

+
+

Pointer to an object, the mesh from which to create the skin mesh.

+

The length of the array attached to the BoneId. See .

+

Pointer to an array of bone combinations. See .

+

Address of a reference to an interface representing the created skin mesh object.

+

If the function succeeds, the return value is . If the function fails, the return value can be the following: E_OUTOFMEMORY.

+ + bb172793 + HRESULT D3DXCreateSkinInfoFromBlendedMesh([In] ID3DXBaseMesh* pMesh,[In] unsigned int NumBones,[In] const D3DXBONECOMBINATION* pBoneCombinationTable,[In] ID3DXSkinInfo** ppSkinInfo) + D3DXCreateSkinInfoFromBlendedMesh +
+ + +

Performs tangent frame computations on a mesh. Tangent, binormal, and optionally normal vectors are generated. Singularities are handled as required by grouping edges and splitting vertices.

+
+

Pointer to an input mesh object.

+

Specifies the texture coordinate input semantic. If D3DX_DEFAULT, the function assumes that there are no texture coordinates, and the function will fail unless normal vector calculation is specified.

+

If a mesh has multiple texture coordinates, specifies the texture coordinate to use for the tangent frame computations. If zero, the mesh has only a single texture coordinate.

+

Specifies the output semantic for the type, typically , that describes where the partial derivative with respect to the U texture coordinate will be stored. If D3DX_DEFAULT, then this partial derivative will not be stored.

+

Specifies the semantic index at which to store the partial derivative with respect to the U texture coordinate.

+

Specifies the type, typically , that describes where the partial derivative with respect to the V texture coordinate will be stored. If D3DX_DEFAULT, then this partial derivative will not be stored.

+

Specifies the semantic index at which to store the partial derivative with respect to the V texture coordinate.

+

Specifies the output normal semantic, typically , that describes where the normal vector at each vertex will be stored. If D3DX_DEFAULT, then this normal vector will not be stored.

+

Specifies the semantic index at which to store the normal vector at each vertex.

+

Combination of one or more flags that specify tangent frame computation options. If null, the following options will be specified:

Description Flag Value
Weight the normal vector length by the angle, in radians, subtended by the two edges leaving the vertex.& !( | )
Compute orthogonal Cartesian coordinates from texture coordinates (u, v). See Remarks.& !( | )
Textures are not wrapped in either u or v directions& !( )
Partial derivatives with respect to texture coordinates are normalized.& !( )
Vertices are ordered in a counterclockwise direction around each triangle.& !( )
Use per-vertex normal vectors already present in the input mesh.& !( )

?

If is not set, the input mesh is cloned. The original mesh must therefore have sufficient space to store the computed normal vector and partial derivative data.

+

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh. The number of bytes in this array must be at least 3 * GetNumFaces * sizeof(DWORD).

+

Specifies the maximum cosine of the angle at which two partial derivatives are deemed to be incompatible with each other. If the dot product of the direction of the two partial derivatives in adjacent triangles is less than or equal to this threshold, then the vertices shared between these triangles will be split.

+

Specifies the maximum magnitude of a partial derivative at which a vertex will be deemed singular. As multiple triangles are incident on a point that have nearby tangent frames, but altogether cancel each other out (such as at the top of a sphere), the magnitude of the partial derivative will decrease. If the magnitude is less than or equal to this threshold, then the vertex will be split for every triangle that contains it.

+

Similar to fPartialEdgeThreshold, specifies the maximum cosine of the angle between two normals that is a threshold beyond which vertices shared between triangles will be split. If the dot product of the two normals is less than the threshold, the shared vertices will be split, forming a hard edge between neighboring triangles. If the dot product is more than the threshold, neighboring triangles will have their normals interpolated.

+

Address of a reference to an output mesh object that receives the computed tangent, binormal, and normal vector data.

+

Address of a reference to an output buffer object that receives a mapping of new vertices computed by this method to the original vertices. The buffer is an array of DWORDs, with the array size defined as the number of vertices in ppMeshOut.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

A simplified version of this function is available as .

The computed normal vector at each vertex is always normalized to have unit length.

The most robust solution for computing orthogonal Cartesian coordinates is to not set flags and , so that orthogonal coordinates are computed from both texture coordinates u and v. However, in this case, if either u or v is zero, then the function will compute orthogonal coordinates using or , respectively.

+
+ + bb172745 + HRESULT D3DXComputeTangentFrameEx([In] ID3DXMesh* pMesh,[In] unsigned int dwTextureInSemantic,[In] unsigned int dwTextureInIndex,[In] unsigned int dwUPartialOutSemantic,[In] unsigned int dwUPartialOutIndex,[In] unsigned int dwVPartialOutSemantic,[In] unsigned int dwVPartialOutIndex,[In] unsigned int dwNormalOutSemantic,[In] unsigned int dwNormalOutIndex,[In] unsigned int dwOptions,[In] const unsigned int* pdwAdjacency,[In] float fPartialEdgeThreshold,[In] float fSingularPointThreshold,[In] float fNormalEdgeThreshold,[In] ID3DXMesh** ppMeshOut,[In] ID3DXBuffer** ppVertexMapping) + D3DXComputeTangentFrameEx +
+ + +

Determines if a ray intersects the volume of a sphere's bounding box.

+
+

Pointer to a structure, specifying the center coordinate of the sphere.

+

Radius of the sphere.

+

Pointer to a structure, specifying the origin coordinate of the ray.

+

Pointer to a structure, specifying the direction of the ray. This vector should not be (0,0,0) but does not need to be normalized.

+

Returns TRUE if the ray intersects the volume of the sphere's bounding box. Otherwise, returns .

+ +

determines if the ray intersects the volume of the sphere's bounding box, not just the surface of the sphere.

+
+ + bb204995 + BOOL D3DXSphereBoundProbe([In] const D3DXVECTOR3* pCenter,[In] float Radius,[In] const D3DXVECTOR3* pRayPosition,[In] const D3DXVECTOR3* pRayDirection) + D3DXSphereBoundProbe +
+ + +

Create a UV atlas for a mesh.

+
+

Pointer to an input mesh (see ) which contains the object geometry for calculating the atlas. At a minimum, the mesh must contain position data and 2D texture coordinates.

+

The maximum number of charts to partition the mesh into. See remarks about the partitioning modes. Use 0 to tell D3DX that the atlas should be parameterized based on stretch.

+

The amount of stretching allowed. 0 means no stretching is allowed, 1 means any amount of stretching can be used.

+

Texture width.

+

Texture height.

+

The minimum distance, in texels, between two charts on the atlas. The gutter is always scaled by the width; so, if a gutter of 2.5 is used on a 512x512 texture, then the minimum distance between two charts is 2.5 / 512.0 texels.

+

Zero-based texture coordinate index that identifies which set of texture coordinates to use.

+

A reference to an array of adjacency data. with 3 DWORDs per face, indicating which triangles are adjacent to each other (see ).

+

An array with 3 DWORDS per face. Each face indicates if an edge is false or not. A non-false edge is indicated by -1, a false edge is indicated by any other value. This enables the parameterization of a mesh of quads where the edges down the middle of each quad will not be cut.

+

A reference to an array of integrated metric tensors that describes how to stretch a triangle (see IntegratedMetricTensor).

+

A reference to a callback function (see LPD3DXUVATLASCB) that is useful for monitoring progress.

+

Specify how often D3DX will call the callback; a reasonable default value is 0.0001f.

+

Pointer to a user-defined value which is passed to the callback function; typically used by an application to pass a reference to a data structure that provides context information for the callback function.

+

Specify the quality of the charts generated. See D3DXUVATLAS.

+

Pointer to the created mesh with the atlas (see ).

+

A reference to an array of the final face-partitioning data. Each element contains one DWORD per face (see ).

+

A reference to an array of remapped vertices. Each array element identifies the original vertex that each final vertex came from (if the vertex was split during remapping). Each array element contains one DWORD per vertex.

+

A reference to the maximum stretch value generated by the atlas algorithm. The range is between 0.0 and 1.0.

+

A reference to the number of charts created by the atlas algorithm. If dwMaxChartNumber is too low, this parameter will return the minimum number of charts required to create an atlas.

+

If the function succeeds, the return value is ; otherwise, the value is .

+ +

can partition mesh geometry two ways:

  • Based on the number of charts
  • Based on the maximum allowed stretch. If the maximum allowed stretch is 0, each triangle will likely be in its own chart.
+
+ + bb205479 + HRESULT D3DXUVAtlasCreate([In] ID3DXMesh* pMesh,[In] unsigned int uMaxChartNumber,[In] float fMaxStretch,[In] unsigned int uWidth,[In] unsigned int uHeight,[In] float fGutter,[In] unsigned int dwTextureIndex,[In] const unsigned int* pdwAdjacency,[In] const unsigned int* pdwFalseEdgeAdjacency,[In] const float* pfIMTArray,[In] __function__stdcall* pStatusCallback,[In] float fCallbackFrequency,[In] void* pUserContext,[In] unsigned int dwOptions,[In] ID3DXMesh** ppMeshOut,[In] ID3DXBuffer** ppFacePartitioning,[In] ID3DXBuffer** ppVertexRemapArray,[In] float* pfMaxStretchOut,[In] unsigned int* puNumChartsOut) + D3DXUVAtlasCreate +
+ + +

Create a UV atlas for a mesh.

+
+

Pointer to an input mesh (see ) that contains the object geometry for calculating the atlas. At a minimum, the mesh must contain position data and 2D texture coordinates.

+

The maximum number of charts to partition the mesh into. See remarks about the partitioning modes. Use 0 to tell D3DX that the atlas should be parameterized based on stretch.

+

The amount of stretching allowed. 0 means no stretching is allowed, 1 means any amount of stretching can be used.

+

Zero-based texture coordinate index that identifies which set of texture coordinates to use.

+

A reference to an array of adjacency data with 3 DWORDs per face, indicating which triangles are adjacent to each other (see ).

+

An array with 3 DWORDS per face. Each face indicates if an edge is false or not. A non-false edge is indicated by -1, a false edge is indicated by any other value. This enables the parameterization of a mesh of quads where the edges down the middle of each quad will not be cut.

+

A reference to an array of integrated metric tensors that describes how to stretch a triangle (see IntegratedMetricTensor).

+

A reference to a callback function (see LPD3DXUVATLASCB) that is useful for monitoring progress.

+

Specify how often D3DX will call the callback; a reasonable default value is 0.0001f.

+

Pointer to a user-defined value that is passed to the callback function; typically used by an application to pass a reference to a data structure that provides context information for the callback function.

+

Specify the quality of the charts generated by combining one or more D3DXUVATLAS flags.

+

Pointer to the created mesh with the atlas (see ).

+

A reference to an array of the final face-partitioning data. Each element contains one DWORD per face (see ).

+

A reference to an array of remapped vertices. Each array element identifies the original vertex each final vertex came from (if the vertex was split during remapping). Each array element contains one DWORD per vertex.

+

Address of a reference to an interface. This buffer will contain an array of three DWORDs per face that specify the three neighbors for each face in the output mesh. This parameter must not be null, because the subsequent call to () requires it.

+

A reference to the maximum stretch value generated by the atlas algorithm. The range is between 0.0 and 1.0.

+

A reference to the number of charts created by the atlas algorithm. If dwMaxChartNumber is too low, this parameter will return the minimum number of charts required to create an atlas.

+

If the function succeeds, the return value is ; otherwise, the value is .

+ +

is similar to , except that does not performing the final packing step.

+
+ + bb205481 + HRESULT D3DXUVAtlasPartition([In] ID3DXMesh* pMesh,[In] unsigned int uMaxChartNumber,[In] float fMaxStretch,[In] unsigned int dwTextureIndex,[In] const unsigned int* pdwAdjacency,[In] const unsigned int* pdwFalseEdgeAdjacency,[In] const float* pfIMTArray,[In] __function__stdcall* pStatusCallback,[In] float fCallbackFrequency,[In] void* pUserContext,[In] unsigned int dwOptions,[In] ID3DXMesh** ppMeshOut,[In] ID3DXBuffer** ppFacePartitioning,[In] ID3DXBuffer** ppVertexRemapArray,[In] ID3DXBuffer** ppPartitionResultAdjacency,[In] float* pfMaxStretchOut,[In] unsigned int* puNumChartsOut) + D3DXUVAtlasPartition +
+ + + No documentation. + + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + + HRESULT D3DXCreatePMeshFromStream([In] IStream* pStream,[In] unsigned int Options,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXBuffer** ppMaterials,[In] ID3DXBuffer** ppEffectInstances,[In] unsigned int* pNumMaterials,[In] ID3DXPMesh** ppPMesh) + D3DXCreatePMeshFromStream + + + +

Calculates per-triangle IMT's from a texture mapped onto a mesh, to be used optionally as input to the D3DX UVAtlas Functions.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is ; otherwise, the value is .

+ +

Given a texture that maps over the surface of the mesh, the algorithm computes the IMT for each face. This will cause triangles containing lower-frequency signal data to take up less space in the final texture atlas when parameterized with the UVAtlas functions. The texture is assumed to be interpolated over the mesh bilinearly.

+
+ + bb172740 + HRESULT D3DXComputeIMTFromTexture([In] ID3DXMesh* pMesh,[In] IDirect3DTexture9* pTexture,[In] unsigned int dwTextureIndex,[In] unsigned int dwOptions,[In] __function__stdcall* pStatusCallback,[In] void* pUserContext,[In] ID3DXBuffer** ppIMTData) + D3DXComputeIMTFromTexture +
+ + + No documentation. + + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + + HRESULT D3DXCreateSPMesh([In] ID3DXMesh* pMesh,[In] const unsigned int* pAdjacency,[In] const D3DXATTRIBUTEWEIGHTS* pVertexAttributeWeights,[In] const float* pVertexWeights,[In] ID3DXSPMesh** ppSMesh) + D3DXCreateSPMesh + + + +

Concatenates a group of meshes into one common mesh. This method can optionally apply a matrix transformation to each input mesh and its texture coordinates.

+
+

Array of input mesh references (see ). The number of elements in the array is NumMeshes.

+

Number of input meshes to concatenate.

+

Mesh creation options; this is a combination of one or more D3DXMESH flags. The mesh creation options are equivalent to the options parameter required by .

+

Optional array of geometry transforms. The number of elements in the array is NumMeshes; each element is a transformation matrix (see ). May be null.

+

Optional array of texture transforms. The number of elements in the array is NumMeshes; each element is a transformation matrix (see ). This parameter may be null.

+

Optional reference to a vertex declaration (see ). This parameter may be null.

+

Pointer to a device that is used to create the new mesh.

+

Address of a reference to the mesh created (see ).

+

If the function succeeds, the return value is . If the function fails, the return value can be one of these: , E_OUTOFMEMORY.

+ +

If no vertex declaration is given as part of the Options mesh creation parameter, the method will generate a union of all of the vertex declarations of the submeshes, promoting channels and types if necessary. The method will create an attribute table from attribute tables of the input meshes. To ensure creation of an attribute table, call Optimize with Flags set to and (see D3DXMESHOPT).

+
+ + bb172746 + HRESULT D3DXConcatenateMeshes([In] ID3DXMesh** ppMeshes,[In] unsigned int NumMeshes,[In] unsigned int Options,[In] const D3DXMATRIX* pGeomXForms,[In] const D3DXMATRIX* pTextureXForms,[In, Buffer] const D3DVERTEXELEMENT9* pDecl,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXMesh** ppMeshOut) + D3DXConcatenateMeshes +
+ + +

Determines whether a ray intersects the volume of a box's bounding box.

+
+

Pointer to a , describing the lower-left corner of the bounding box. See Remarks.

+

Pointer to a structure, describing the upper-right corner of the bounding box. See Remarks.

+

Pointer to a structure, specifying the origin coordinate of the ray.

+

Pointer to a structure, specifying the direction of the ray. This vector should not be (0,0,0) but does not need to be normalized.

+

Returns TRUE if the ray intersects the volume of the box's bounding box. Otherwise, returns .

+ +

determines if the ray intersects the volume of the box's bounding box, not just the surface of the box.

The values passed to are xmin, xmax, ymin, ymax, zmin, and zmax. Thus, the following defines the corners of the bounding box.

 xmax, ymax, zmax	
+            xmax, ymax, zmin	
+            xmax, ymin, zmax	
+            xmax, ymin, zmin	
+            xmin, ymax, zmax	
+            xmin, ymax, zmin	
+            xmin, ymin, zmax	
+            xmin, ymin, zmin	
+            

The depth of the bounding box in the z direction is zmax - zmin, in the y direction is ymax - ymin, and in the x direction is xmax - xmin. For example, with the following minimum and maximum vectors, min (-1, -1, -1) and max (1, 1, 1), the bounding box is defined in the following manner.

 1,  1,  1 1,  1, -1 1, -1,  1 1, -1, -1	
+            -1,  1,  1	
+            -1,  1, -1	
+            -1, -1,  1	
+            -1, -1, -l	
+            
+
+ + bb204916 + BOOL D3DXBoxBoundProbe([In] const D3DXVECTOR3* pMin,[In] const D3DXVECTOR3* pMax,[In] const D3DXVECTOR3* pRayPosition,[In] const D3DXVECTOR3* pRayDirection) + D3DXBoxBoundProbe +
+ + +

Loads a mesh from a resource.

+
+

Handle to the module where the resource is located, or null for the module associated with the image the operating system used to create the current process. See remarks.

+

Pointer to a string that specifies the resource to create the mesh from. See remarks.

+

Pointer to a string that specifies the resource type. See remarks.

+

Combination of one or more flags from the D3DXMESH enumeration that specify creation options for the mesh.

+

Pointer to an interface, the device object associated with the mesh.

+

Address of a reference to an interface. When the method returns, this parameter is filled with an array of three DWORDs per face that specify the three neighbors for each face in the mesh.

+

Address of a reference to an interface. When this method returns, this parameter is filled with an array of structures, containing information saved in the DirectX file.

+

Pointer to a buffer containing an array of effect instances, one per attribute group in the returned mesh. An effect instance is a particular instance of state information used to initialize an effect. See . For more information about accessing the buffer, see .

+

Pointer to the number of structures in the ppMaterials array, when the method returns.

+

Address of a reference to an interface, representing the loaded mesh.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ +

See FindResource to find out more about the Module, Name and Type parameters.

All the meshes in the file will be collapsed into one output mesh. If the file contains a frame hierarchy, all the transformations will be applied to the mesh.

For mesh files that do not contain effect instance information, default effect instances will be generated from the material information in the .x file. A default effect instance will have default values that correspond to the members of the structure.

The default texture name is also filled in, but is handled differently. The name will be Texture0@Name, which corresponds to an effect variable by the name of "Texture0" with an annotation called "Name." This will contain the string file name for the texture.

+
+ + bb172893 + HRESULT D3DXLoadMeshFromXResource([In] HINSTANCE Module,[In] const char* Name,[In] const char* Type,[In] unsigned int Options,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXBuffer** ppAdjacency,[In] ID3DXBuffer** ppMaterials,[In] ID3DXBuffer** ppEffectInstances,[In] unsigned int* pNumMaterials,[In] ID3DXMesh** ppMesh) + D3DXLoadMeshFromXResource +
+ + +

Generates a simplified mesh using the provided weights that come as close as possible to the given MinValue.

+
+

Pointer to an interface, representing the source mesh.

+

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh to be simplified.

+

Pointer to a structure, containing the weight for each vertex component. If this parameter is set to null, a default structure is used. See Remarks.

+

Pointer to an array of vertex weights. If this parameter is set to null, all vertex weights are set to 1.0.

+

Number of vertices or faces, depending on the flag set in the Options parameter, by which to simplify the source mesh.

+

Specifies simplification options for the mesh. One of the flags in D3DXMESHSIMP can be set.

+

Address of a reference to an interface, representing the returned simplification mesh.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

This function generates a mesh that has MinValue vertices or faces.

If the simplification process cannot reduce the mesh to MinValue, the call still succeeds because MinValue is a desired minimum, not an absolute minimum.

If pVertexAttributeWeights is set to null, the following values are assigned to the default structure.

  AttributeWeights; AttributeWeights.Position  = 1.0;	
+            AttributeWeights.Boundary =  1.0;	
+            AttributeWeights.Normal   =  1.0;	
+            AttributeWeights.Diffuse  =  0.0;	
+            AttributeWeights.Specular =  0.0;	
+            AttributeWeights.Tex[8]   =  {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};	
+            

This default structure is what most applications should use because it considers only geometric and normal adjustment. Only in special cases will the other member fields need to be modified.

+
+ + bb205463 + HRESULT D3DXSimplifyMesh([In] ID3DXMesh* pMesh,[In] const unsigned int* pAdjacency,[In] const D3DXATTRIBUTEWEIGHTS* pVertexAttributeWeights,[In] const float* pVertexWeights,[In] unsigned int MinValue,[In] unsigned int Options,[In] ID3DXMesh** ppMesh) + D3DXSimplifyMesh +
+ + +

Creates a mesh object using a flexible vertex format (FVF) code.

+
+

Number of faces for the mesh. The valid range for this number is greater than 0, and one less than the max DWORD value, typically 232 - 1, because the last index is reserved.

+

Number of vertices for the mesh. This parameter must be greater than 0.

+

Combination of one or more flags from the D3DXMESH enumeration, specifying creation options for the mesh.

+

Combination of that describes the vertex format for the returned mesh. This function does not support .

+

Pointer to an interface, the device object to be associated with the mesh.

+

Address of a reference to an interface, representing the created mesh object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ + bb172781 + HRESULT D3DXCreateMeshFVF([In] unsigned int NumFaces,[In] unsigned int NumVertices,[In] unsigned int Options,[In] D3DFVF FVF,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXMesh** ppMesh) + D3DXCreateMeshFVF +
+ + +

Calculate per-triangle IMT's from from per-vertex data. This function allows you to calculate the IMT based off of any value in a mesh (color, normal, etc).

+
+

A reference to an input mesh (see ) which contains the object geometry for calculating the IMT.

+

A reference to an array of per-vertex data from which IMT will be computed. The array size is uSignalStride * v, where v is the number of vertices in the mesh.

+

The number of floats per vertex.

+

The number of bytes per vertex in the array. This must be a multiple of sizeof(float)

+

Texture wrap options. This is a combination of one or more FLAGS.

+

A reference to a callback function to monitor IMT computation progress.

+

A reference to a user-defined variable which is passed to the status callback function. Typically used by an application to pass a reference to a data structure that provides context information for the callback function.

+

A reference to the buffer (see ) containing the returned IMT array. This array can be provided as input to the D3DX UVAtlas Functions to prioritize texture-space allocation in the texture parameterization.

+

If the function succeeds, the return value is ; otherwise, the value is .

+ + bb172738 + HRESULT D3DXComputeIMTFromPerVertexSignal([In] ID3DXMesh* pMesh,[In] const float* pfVertexSignal,[In] unsigned int uSignalDimension,[In] unsigned int uSignalStride,[In] unsigned int dwOptions,[In] __function__stdcall* pStatusCallback,[In] void* pUserContext,[In] ID3DXBuffer** ppIMTData) + D3DXComputeIMTFromPerVertexSignal +
+ + +

Generates an optimized vertex remapping for a triangle list. This function is commonly used after applying the face remapping generated by .

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

By default, a mesh uses 16 bit indices when it is created unless the application specifies otherwise. To check whether an existing mesh uses 16-bit or 32-bit indices, call and check for the flag.

+
+ + bb205377 + HRESULT D3DXOptimizeVertices([In] const void* pbIndices,[In] unsigned int cFaces,[In] unsigned int cVertices,[In] BOOL b32BitIndices,[In, Buffer] int* pVertexRemap) + D3DXOptimizeVertices +
+ + +

Loads a mesh from a DirectX .x file.

+
+

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

Combination of one or more flags from the D3DXMESH enumeration, which specifies creation options for the mesh.

+

Pointer to an interface, the device object associated with the mesh.

+

Pointer to a buffer that contains adjacency data. The adjacency data contains an array of three DWORDs per face that specify the three neighbors for each face in the mesh. For more information about accessing the buffer, see .

+

Pointer to a buffer containing materials data. The buffer contains an array of structures, containing information from the DirectX file. For more information about accessing the buffer, see .

+

Pointer to a buffer containing an array of effect instances, one per attribute group in the returned mesh. An effect instance is a particular instance of state information used to initialize an effect. See . For more information about accessing the buffer, see .

+

Pointer to the number of structures in the ppMaterials array, when the method returns.

+

Address of a reference to an interface, representing the loaded mesh.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXLoadMeshFromXA because ANSI strings are being used.

All the meshes in the file will be collapsed into one output mesh. If the file contains a frame hierarchy, all the transformations will be applied to the mesh.

For mesh files that do not contain effect instance information, default effect instances will be generated from the material information in the .x file. A default effect instance will have default values that correspond to the members of the structure.

The default texture name is also filled in, but is handled differently. The name will be Texture0@Name, which corresponds to an effect variable by the name of "Texture0" with an annotation called "Name." This will contain the string file name for the texture.

+
+ + bb172890 + HRESULT D3DXLoadMeshFromXof([In] ID3DXFileData* pxofMesh,[In] unsigned int Options,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXBuffer** ppAdjacency,[In] ID3DXBuffer** ppMaterials,[In] ID3DXBuffer** ppEffectInstances,[In] unsigned int* pNumMaterials,[In] ID3DXMesh** ppMesh) + D3DXLoadMeshFromXof +
+ + +

Creates a mesh from a control-patch mesh.

+
+

Patch information structure. For more information, see .

+

Number of patches.

+

Number of control vertices in the patch.

+

Unused. Reserved for later use.

+

Array of elements, describing the vertex format for the returned mesh.

+

Pointer the device that creates the patch mesh. See .

+

Pointer to the object that is created.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

This method takes an input patch mesh and converts it to a tessellated mesh. Patch meshes use 16-bit index buffers. Therefore, indices to LockIndexBuffer are 16 bits.

+
+ + bb172783 + HRESULT D3DXCreatePatchMesh([In] const D3DXPATCHINFO* pInfo,[In] unsigned int dwNumPatches,[In] unsigned int dwNumVertices,[In] unsigned int dwOptions,[In, Buffer] const D3DVERTEXELEMENT9* pDecl,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXPatchMesh** pPatchMesh) + D3DXCreatePatchMesh +
+ + +

Gets the size of the rectangle patch.

+
+

Number of segments per edge to tessellate.

+

Pointer to a DWORD that contains the number of triangles in the patch.

+

Pointer to a DWORD that contains the number of vertices in the patch.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ + bb205423 + HRESULT D3DXRectPatchSize([In] const float* pfNumSegs,[Out] unsigned int* pdwTriangles,[Out] unsigned int* pdwVertices) + D3DXRectPatchSize +
+ + +

Tessellates a triangular higher-order surface patch into a triangle mesh.

+
+

Vertex buffer containing the patch data.

+

Pointer to an array of three floating-point values that identify the number of segments into which each edge of the triangle patch should be divided when tessellated. See .

+

Vertex declaration structure that defines the vertex data. See .

+

Describes a triangle patch. See .

+

Pointer to the created mesh. See .

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

Use to get the number of output vertices and indices that the tessellation function needs.

+
+ + bb205471 + HRESULT D3DXTessellateTriPatch([In] IDirect3DVertexBuffer9* pVB,[In] const float* pNumSegs,[In] const D3DVERTEXELEMENT9* pInDecl,[In] const D3DTRIPATCH_INFO* pTriPatchInfo,[In] ID3DXMesh* pMesh) + D3DXTessellateTriPatch +
+ + +

Computes a bounding sphere for the mesh.

+
+

Pointer to first position.

+

Number of vertices.

+

Number of bytes between position vectors. Use GetNumBytesPerVertex, , or to get the vertex stride.

+

structure, defining the coordinate center of the returned bounding sphere.

+

Radius of the returned bounding sphere.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: .

+ + bb172736 + HRESULT D3DXComputeBoundingSphere([In] const D3DXVECTOR3* pFirstPosition,[In] unsigned int NumVertices,[In] unsigned int dwStride,[In] D3DXVECTOR3* pCenter,[In] float* pRadius) + D3DXComputeBoundingSphere +
+ + +

Loads a mesh from a DirectX .x file.

+
+

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

Combination of one or more flags from the D3DXMESH enumeration, which specifies creation options for the mesh.

+

Pointer to an interface, the device object associated with the mesh.

+

Pointer to a buffer that contains adjacency data. The adjacency data contains an array of three DWORDs per face that specify the three neighbors for each face in the mesh. For more information about accessing the buffer, see .

+

Pointer to a buffer containing materials data. The buffer contains an array of structures, containing information from the DirectX file. For more information about accessing the buffer, see .

+

Pointer to a buffer containing an array of effect instances, one per attribute group in the returned mesh. An effect instance is a particular instance of state information used to initialize an effect. See . For more information about accessing the buffer, see .

+

Pointer to the number of structures in the ppMaterials array, when the method returns.

+

Address of a reference to an interface, representing the loaded mesh.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXLoadMeshFromXA because ANSI strings are being used.

All the meshes in the file will be collapsed into one output mesh. If the file contains a frame hierarchy, all the transformations will be applied to the mesh.

For mesh files that do not contain effect instance information, default effect instances will be generated from the material information in the .x file. A default effect instance will have default values that correspond to the members of the structure.

The default texture name is also filled in, but is handled differently. The name will be Texture0@Name, which corresponds to an effect variable by the name of "Texture0" with an annotation called "Name." This will contain the string file name for the texture.

+
+ + bb172890 + HRESULT D3DXLoadMeshFromXW([In] const wchar_t* pFilename,[In] unsigned int Options,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXBuffer** ppAdjacency,[In] ID3DXBuffer** ppMaterials,[In] ID3DXBuffer** ppEffectInstances,[In] unsigned int* pNumMaterials,[In] ID3DXMesh** ppMesh) + D3DXLoadMeshFromXW +
+ + +

Loads a mesh from memory.

+
+

Pointer to the memory buffer which contains the mesh data.

+

Size of the file in memory, in bytes.

+

Combination of one or more flags from the D3DXMESH enumeration, specifying creation options for the mesh.

+

Pointer to an interface, the device object associated with the mesh.

+

Address of a reference to an interface. When the method returns, this parameter is filled with an array of three DWORDs per face that specify the three neighbors for each face in the mesh.

+

Address of a reference to an interface. When this method returns, this parameter is filled with an array of structures, containing information saved in the DirectX file.

+

Pointer to a buffer containing an array of effect instances, one per attribute group in the returned mesh. An effect instance is a particular instance of state information used to initialize an effect. See . For more information about accessing the buffer, see .

+

Pointer to the number of structures in the ppMaterials array, when the method returns.

+

Address of a reference to an interface, representing the loaded mesh.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ +

All the meshes in the file will be collapsed into one output mesh. If the file contains a frame hierarchy, all the transformations will be applied to the mesh.

For mesh files that do not contain effect instance information, default effect instances will be generated from the material information in the .x file. A default effect instance will have default values that correspond to the members of the structure.

The default texture name is also filled in, but is handled differently. The name will be Texture0@Name, which corresponds to an effect variable by the name of "Texture0" with an annotation called "Name." This will contain the string file name for the texture.

+
+ + bb172891 + HRESULT D3DXLoadMeshFromXInMemory([In] const void* Memory,[In] unsigned int SizeOfMemory,[In] unsigned int Options,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXBuffer** ppAdjacency,[In] ID3DXBuffer** ppMaterials,[In] ID3DXBuffer** ppEffectInstances,[In] unsigned int* pNumMaterials,[In] ID3DXMesh** ppMesh) + D3DXLoadMeshFromXInMemory +
+ + +

Convert the specified mesh subset into a series of strips.

+
+

Pointer to an interface, representing the mesh to convert to a strip.

+

Attribute ID of the mesh subset to convert to strips.

+

Combination of one or more flags from the D3DXMESH enumeration, specifying options for creating the index buffer. Cannot be . The index buffer will be created with 32-bit or 16-bit indices depending on the format of the index buffer of the mesh specified by the MeshIn parameter.

+

Pointer to an interface, representing index buffer containing the strip.

+

Number of indices in the buffer returned in the ppIndexBuffer parameter.

+

Buffer containing an array of one DWORD per strip, which specifies the number of triangles in the that strip.

+

Number of individual strips in the index buffer and corresponding strip length array.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ +

Before running this function, call Optimize or , with the flag set.

+
+ + bb172750 + HRESULT D3DXConvertMeshSubsetToStrips([In] ID3DXBaseMesh* MeshIn,[In] unsigned int AttribId,[In] unsigned int IBOptions,[In] IDirect3DIndexBuffer9** ppIndexBuffer,[In] unsigned int* pNumIndices,[In] ID3DXBuffer** ppStripLengths,[In] unsigned int* pNumStrips) + D3DXConvertMeshSubsetToStrips +
+ + +

Calculate per-triangle IMT's from per-texel data. This function is similar to , but it uses a float array to pass in the data, and it can calculate higher dimensional values than 4.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is ; otherwise, the value is .

+ + bb172737 + HRESULT D3DXComputeIMTFromPerTexelSignal([In] ID3DXMesh* pMesh,[In] unsigned int dwTextureIndex,[In] float* pfTexelSignal,[In] unsigned int uWidth,[In] unsigned int uHeight,[In] unsigned int uSignalDimension,[In] unsigned int uComponents,[In] unsigned int dwOptions,[In] __function__stdcall* pStatusCallback,[In] void* pUserContext,[In] ID3DXBuffer** ppIMTData) + D3DXComputeIMTFromPerTexelSignal +
+ + +

Gets the size of the triangle patch.

+
+

Number of segments per edge to tessellate.

+

Pointer to a DWORD that contains the number of triangles in the patch.

+

Pointer to a DWORD that contains the number of vertices in the triangle patch.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ + bb205476 + HRESULT D3DXTriPatchSize([In] const float* pfNumSegs,[Out] unsigned int* pdwTriangles,[Out] unsigned int* pdwVertices) + D3DXTriPatchSize +
+ + +

Computes unit normals for each vertex in a mesh. Provided to support legacy applications. Use for better results.

+
+ No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The input mesh must have the flag specified in its flexible vertex format (FVF).

A normal for a vertex is generated by averaging the normals of all faces that share that vertex.

If adjacency is provided, replicated vertices are ignored and "smoothed" over. If adjacency is not provided, replicated vertices will have normals averaged in from only the faces explicitly referencing them.

This function simply calls with the following input parameters:

 ( pMesh, D3DX_DEFAULT, 0, D3DX_DEFAULT, 0, D3DX_DEFAULT, 0, , 0,  | , pAdjacency, -1.01f, -0.01f, -1.01f, null, null);	
+            
+
+ + bb172742 + HRESULT D3DXComputeNormals([In] ID3DXBaseMesh* pMesh,[In] const unsigned int* pAdjacency) + D3DXComputeNormals +
+ + +

Disassemble a shader.

Note??Instead of using this legacy function, we recommend that you use the API.

+
+ No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ + bb172820 + HRESULT D3DXDisassembleShader([In] const void* pShader,[In] BOOL EnableColorCode,[In] const char* pComments,[In] ID3DXBuffer** ppDisassembly) + D3DXDisassembleShader +
+ + +

Preprocesses a shader without performing compilation. This resolves all #defines and #includes, providing a self-contained shader for subsequent compilation.

Note??Instead of using this legacy function, we recommend that you use the API.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ + bb205398 + HRESULT D3DXPreprocessShader([In] const void* pSrcData,[In] unsigned int SrcDataSize,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) + D3DXPreprocessShader +
+ + +

Compile a shader file.

Note??Instead of using this legacy function, we recommend that you compile offline by using the Fxc.exe command-line compiler or use the API.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_NOTIMPL, E_OUTOFMEMORY.

E_NOTIMPL is returned if you're using 1.1 shaders (vs_1_1and ps_1_1).

+ + bb172732 + HRESULT D3DXCompileShaderFromFileW([In] const wchar_t* pSrcFile,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) + D3DXCompileShaderFromFileW +
+ + +

Creates a texture shader object from the compiled shader.

+
+

Pointer to the function DWORD stream.

+

Returns an object which can be used to procedurally fill the contents of a texture using the functions.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ + bb172808 + HRESULT D3DXCreateTextureShader([In] const unsigned int* pFunction,[In] ID3DXTextureShader** ppTextureShader) + D3DXCreateTextureShader +
+ + +

Get the semantics for all shader output elements.

+
+

Pointer to the shader function DWORD stream.

+

Pointer to an array of structures. The function will fill this array with the semantics for each output element referenced by the shader. This array is assumed to contain at least MAXD3DDECLLENGTH elements. However, calling with pSemantics = null will return the number of elements needed for pCount.

+

Returns the number of elements in pSemantics.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ + bb172873 + HRESULT D3DXGetShaderOutputSemantics([In] const void* pFunction,[In, Out, Buffer] D3DXSEMANTIC* pSemantics,[InOut] unsigned int* pCount) + D3DXGetShaderOutputSemantics +
+ + +

Gets the semantics for the shader inputs. Use this method to determine the input vertex format.

+
+

Pointer to the shader function DWORD stream.

+

Pointer to an array of structures. The function will fill this array with the semantics for each input element referenced by the shader. This array is assumed to contain at least MAXD3DDECLLENGTH elements. However, calling with pSemantics = null will return the number of elements needed for pCount.

+

Returns the number of elements in pSemantics.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

Use to return a list of input semantics required by the shader. This is the way to find out what the input vertex format is for a high-level shader language (HLSL) shader. If the shader has additional inputs that your vertex declaration is missing, you could create an extra vertex stream that has a stride of 0 that has the missing components with default values. For instance, this technique could be used to provide default vertex color for models that do not specify it.

+
+ + bb172872 + HRESULT D3DXGetShaderInputSemantics([In] const void* pFunction,[In, Out, Buffer] D3DXSEMANTIC* pSemantics,[InOut] unsigned int* pCount) + D3DXGetShaderInputSemantics +
+ + +

Returns the name of the highest high-level shader language (HLSL) profile supported by a given device.

+
+

Pointer to the device. See .

+

The HLSL profile name.

If the device does not support pixel shaders then the function returns null.

+ +

A shader profile specifies the assembly shader version to use and the capabilities available to the HLSL compiler when compiling a shader. The following table lists the pixel shader profiles that are supported.

Shader ProfileDescription
ps_1_1Compile to ps_1_1 version.
ps_1_2Compile to ps_1_2 version.
ps_1_3Compile to ps_1_3 version.
ps_1_4Compile to ps_1_4 version.
ps_2_0Compile to ps_2_0 version.
ps_2_aSame as the ps_2_0 profile, with the following additional capabilities available for the compiler to target:
  • Number of Temporary Registers (r#) is greater than or equal to 22.
  • Arbitrary source swizzle.
  • Gradient instructions: dsx, dsy.
  • Predication.
  • No dependent texture read limit.
  • No limit for the number of texture instructions.
ps_2_bSame as the ps_2_0 profile, with the following additional capabilities available for the compiler to target:
  • Number of Temporary Registers (r#) is greater than or equal to 32.
  • No limit for the number of texture instructions.
ps_3_0Compile to ps_3_0 version.

?

For more information about the differences between shader versions, see Pixel Shader Differences.

+
+ + bb172870 + const char* D3DXGetPixelShaderProfile([In] IDirect3DDevice9* pDevice) + D3DXGetPixelShaderProfile +
+ + +

Searches through a shader for a particular comment. The comment is identified by a four-character code (FOURCC) in the first DWORD of the comment.

+
+

Pointer to the shader function DWORD stream.

+

FOURCC code that identifies the comment block. See FourCC Formats.

+

Returns a reference to the comment data (not including the comment token and FOURCC code). This value can be null.

+

Returns the size of the comment data in bytes. This value can be null.

+

If the function succeeds, the return value is . If the comment is not found, and no other error has occurred, S_FALSE is returned.

+ + bb172838 + HRESULT D3DXFindShaderComment([In] const void* pFunction,[In] unsigned int FourCC,[Out] const void** ppData,[Out] unsigned int* pSizeInBytes) + D3DXFindShaderComment +
+ + +

Assemble a shader.

+
+

Handle to a module containing the effect description. If this parameter is null, the current module will be used.

+

Pointer to a string that specifies the resource name. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

An optional null terminated array of structures. This value may be null.

+

Optional interface reference, , to use for handling #include directives. If this value is null, #includes will either be honored when compiling from a file or will cause an error when compiled from a resource or memory.

+

Compile options identified by various flags. The Direct3D 10 HLSL compiler is now the default. See Flags for details.

+

Returns a buffer containing the created shader. This buffer contains the compiled shader code, as well as any embedded debug and symbol table information.

+

Returns a buffer containing a listing of errors and warnings that were encountered during the compile. These are the same messages the debugger displays when running in debug mode. This value may be null.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXAssembleShaderFromResourceA because ANSI strings are being used.

+
+ + bb172709 + HRESULT D3DXAssembleShaderFromResourceW([In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs) + D3DXAssembleShaderFromResourceW +
+ + +

Assemble a shader.

+
+

Pointer to a memory buffer that contains the shader data.

+

Length of the effect data, in bytes.

+

An optional null terminated array of structures. This value may be null.

+

Optional interface reference, , to use for handling #include directives. If this value is null, #includes will either be honored when compiling from a file or will cause an error when compiled from a resource or memory.

+

Compile options identified by various flags. The Direct3D 10 HLSL compiler is now the default. See Flags for details.

+

Returns a buffer containing the created shader. This buffer contains the compiled shader code, as well as any embedded debug and symbol table information.

+

Returns a buffer containing a listing of errors and warnings that were encountered during the compile. These are the same messages the debugger displays when running in debug mode. This value may be null.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ + bb172707 + HRESULT D3DXAssembleShader([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs) + D3DXAssembleShader +
+ + +

Compile a shader file.

Note??Instead of using this legacy function, we recommend that you compile offline by using the Fxc.exe command-line compiler or use the API.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ + bb172731 + HRESULT D3DXCompileShader([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) + D3DXCompileShader +
+ + +

Get the sampler names referenced in a shader.

+
+

Pointer to the shader function DWORD stream.

+

Pointer to an array of LPCSTRs. The function will fill this array with references to the sampler names contained within pFunction. The maximum array size is the maximum number of sampler registers (16 for vs_3_0 and ps_3_0).

To find the number of samplers used, check pCount after calling with pSamplers = null.

+

Returns the number of samplers referenced by the shader.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ + bb172874 + HRESULT D3DXGetShaderSamplers([In] const void* pFunction,[In, Out, Buffer] const void** pSamplers,[InOut] unsigned int* pCount) + D3DXGetShaderSamplers +
+ + +

Gets the shader-constant table embedded inside a shader.

+
+

Pointer to the function DWORD stream.

+

Returns the constant table interface (see ) that manages the constant table.

+ +

A constant table is generated by and embedded in the shader body. If you need additional virtual address space, see .

+
+ + bb172871 + HRESULT D3DXGetShaderConstantTable([In] const void* pFunction,[Out] ID3DXConstantTable** ppConstantTable) + D3DXGetShaderConstantTable +
+ + +

Assemble a shader.

+
+

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

An optional null terminated array of structures. This value may be null.

+

Optional interface reference, , to use for handling #include directives. If this value is null, #includes will either be honored when compiling from a file or will cause an error when compiled from a resource or memory.

+

Compile options identified by various flags. The Direct3D 10 HLSL compiler is now the default. See Flags for details.

+

Returns a buffer containing the created shader. This buffer contains the compiled shader code, as well as any embedded debug and symbol table information.

+

Returns a buffer containing a listing of errors and warnings that were encountered during the compile. These are the same messages the debugger displays when running in debug mode. This value may be null.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXAssembleShaderFromFileA because ANSI strings are being used.

+
+ + bb172708 + HRESULT D3DXAssembleShaderFromFileW([In] const wchar_t* pSrcFile,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs) + D3DXAssembleShaderFromFileW +
+ + +

Gets the shader-constant table embedded inside a shader.

+
+

Pointer to the function DWORD stream.

+

Use the D3DXCONSTTABLE_LARGEADDRESSAWARE flag to access up to 4 GB of virtual address space (instead of the default of 2 GB). If you do not need the additional virtual address space, use .

+

Returns the constant table interface (see ) that manages the constant table.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

A constant table is generated by and embedded in the shader body.

+
+ + bb943959 + HRESULT D3DXGetShaderConstantTableEx([In] const void* pFunction,[In] unsigned int Flags,[In] ID3DXConstantTable** ppConstantTable) + D3DXGetShaderConstantTableEx +
+ + +

Returns the name of the highest high-level shader language (HLSL) profile supported by a given device.

+
+

Pointer to the device. See .

+

The HLSL profile name.

If the device does not support vertex shaders then the function returns null.

+ +

A shader profile specifies the assembly shader version to use and the capabilities available to the HLSL compiler when compiling a shader. The following table lists the vertex shader profiles that are supported.

Shader ProfileDescription
vs_1_1Compile to vs_1_1 version.
vs_2_0Compile to vs_2_0 version.
vs_2_aSame as the vs_2_0 profile, with the following additional capabilities available for the compiler to target:
  • Number of Temporary Registers (r#) is greater than or equal to 13.
  • Dynamic flow control instruction.
  • Predication.
vs_3_0Compile to vs_3_0 version.

?

For more information about the differences between shader versions, see Vertex Shader Differences.

+
+ + bb172877 + const char* D3DXGetVertexShaderProfile([In] IDirect3DDevice9* pDevice) + D3DXGetVertexShaderProfile +
+ + +

Preprocesses a shader resource without performing compilation. This resolves all #defines and #includes, providing a self-contained shader for subsequent compilation.

Note??Instead of using this legacy function, we recommend that you use the API.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ + bb205400 + HRESULT D3DXPreprocessShaderFromResourceW([In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) + D3DXPreprocessShaderFromResourceW +
+ + +

Compile a shader file.

Note??Instead of using this legacy function, we recommend that you compile offline by using the Fxc.exe command-line compiler or use the API.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ + bb172733 + HRESULT D3DXCompileShaderFromResourceW([In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) + D3DXCompileShaderFromResourceW +
+ + +

Preprocesses a shader file without performing compilation. This resolves all #defines and #includes, providing a self-contained shader for subsequent compilation.

Note??Instead of using this legacy function, we recommend that you use the API.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ + bb205399 + HRESULT D3DXPreprocessShaderFromFileW([In] const wchar_t* pSrcFile,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) + D3DXPreprocessShaderFromFileW +
+ + +

Returns the size of the shader byte code, in bytes.

+
+

Pointer to the function DWORD stream.

+

Returns the size of the shader byte code, in bytes.

+ + bb172875 + unsigned int D3DXGetShaderSize([In] const void* pFunction) + D3DXGetShaderSize +
+ + +

Returns the shader version of the compiled shader.

+
+

Pointer to the function DWORD stream.

+

Returns the shader version of the given shader, or zero if the shader function is null.

+ + bb172876 + unsigned int D3DXGetShaderVersion([In] const void* pFunction) + D3DXGetShaderVersion +
+ + +

Uses a left-handed coordinate system to create a mesh containing a cylinder.

+
+

Pointer to an interface, representing the device associated with the created cylinder mesh.

+

Radius at the negative Z end. Value should be greater than or equal to 0.0f.

+

Radius at the positive Z end. Value should be greater than or equal to 0.0f.

+

Length of the cylinder along the z-axis.

+

Number of slices about the main axis.

+

Number of stacks along the main axis.

+

Address of a reference to the output shape, an interface.

+

Address of a reference to an interface. When the method returns, this parameter is filled with an array of three DWORDs per face that specify the three neighbors for each face in the mesh. null can be specified.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The created cylinder is centered at the origin, and its axis is aligned with the z-axis.

This function creates a mesh with the creation option and | flexible vertex format (FVF).

+
+ + bb172762 + HRESULT D3DXCreateCylinder([In] IDirect3DDevice9* pDevice,[In] float Radius1,[In] float Radius2,[In] float Length,[In] unsigned int Slices,[In] unsigned int Stacks,[In] ID3DXMesh** ppMesh,[In] ID3DXBuffer** ppAdjacency) + D3DXCreateCylinder +
+ + +

Uses a left-handed coordinate system to create a mesh containing a torus.

+
+

Pointer to an interface, representing the device associated with the created torus mesh.

+

Inner-radius of the torus. Value should be greater than or equal to 0.0f.

+

Outer-radius of the torus. Value should be greater than or equal to 0.0f.

+

Number of sides in a cross-section. Value must be greater than or equal to 3.

+

Number of rings making up the torus. Value must be greater than or equal to 3.

+

Address of a reference to the output shape, an interface.

+

Address of a reference to an interface. When the method returns, this parameter is filled with an array of three DWORDs per face that specify the three neighbors for each face in the mesh. null can be specified.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The created torus is centered at the origin, and its axis is aligned with the z-axis. The inner radius of the torus is the radius of the cross-section (the minor radius), and the outer radius of the torus is the radius of the central hole.

This function returns a mesh that can be used later for drawing or manipulation by the application.

This function creates a mesh with the creation option and | flexible vertex format (FVF).

+
+ + bb172809 + HRESULT D3DXCreateTorus([In] IDirect3DDevice9* pDevice,[In] float InnerRadius,[In] float OuterRadius,[In] unsigned int Sides,[In] unsigned int Rings,[In] ID3DXMesh** ppMesh,[In] ID3DXBuffer** ppAdjacency) + D3DXCreateTorus +
+ + +

Uses a left-handed coordinate system to create a mesh containing a sphere.

+
+

Pointer to an interface, representing the device associated with the created sphere mesh.

+

Radius of the sphere. This value should be greater than or equal to 0.0f.

+

Number of slices about the main axis.

+

Number of stacks along the main axis.

+

Address of a reference to the output shape, an interface.

+

Address of a reference to an interface. When the method returns, this parameter is filled with an array of three DWORDs per face that specify the three neighbors for each face in the mesh. null can be specified.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The created sphere is centered at the origin, and its axis is aligned with the z-axis.

This function creates a mesh with the creation option and | flexible vertex format (FVF).

+
+ + bb172795 + HRESULT D3DXCreateSphere([In] IDirect3DDevice9* pDevice,[In] float Radius,[In] unsigned int Slices,[In] unsigned int Stacks,[In] ID3DXMesh** ppMesh,[In] ID3DXBuffer** ppAdjacency) + D3DXCreateSphere +
+ + +

Uses a left-handed coordinate system to create a mesh containing a teapot.

+
+

Pointer to an interface, representing the device associated with the created teapot mesh.

+

Address of a reference to the output shape, an interface.

+

Address of a reference to an interface. When the method returns, this parameter is filled with an array of three DWORDs per face that specify the three neighbors for each face in the mesh. null can be specified.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

This function creates a mesh with the creation option and | flexible vertex format (FVF).

+
+ + bb172798 + HRESULT D3DXCreateTeapot([In] IDirect3DDevice9* pDevice,[In] ID3DXMesh** ppMesh,[In] ID3DXBuffer** ppAdjacency) + D3DXCreateTeapot +
+ + +

Uses a left-handed coordinate system to create a mesh containing an axis-aligned box.

+
+

Pointer to an interface, representing the device associated with the created box mesh.

+

Width of the box, along the x-axis.

+

Height of the box, along the y-axis.

+

Depth of the box, along the z-axis.

+

Address of a reference to the output shape, an interface.

+

Address of a reference to an interface. When the method returns, this parameter is filled with an array of three DWORDs per face that specify the three neighbors for each face in the mesh. null can be specified.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The created box is centered at the origin.

This function creates a mesh with the creation option and | flexible vertex format (FVF).

+
+ + bb172752 + HRESULT D3DXCreateBox([In] IDirect3DDevice9* pDevice,[In] float Width,[In] float Height,[In] float Depth,[In] ID3DXMesh** ppMesh,[In] ID3DXBuffer** ppAdjacency) + D3DXCreateBox +
+ + +

Uses a left-handed coordinate system to create a mesh containing an + n-sided polygon.

+
+

Pointer to an interface, representing the device associated with the created polygon mesh.

+

Length of each side.

+

Number of sides for the polygon. Value must be greater than or equal to 3.

+

Address of a reference to the output shape, an interface.

+

Address of a reference to an interface. When the method returns, this parameter is filled with an array of three DWORDs per face that specify the three neighbors for each face in the mesh. null can be specified.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The created polygon is centered at the origin.

This function creates a mesh with the creation option and | flexible vertex format (FVF).

+
+ + bb172785 + HRESULT D3DXCreatePolygon([In] IDirect3DDevice9* pDevice,[In] float Length,[In] unsigned int Sides,[In] ID3DXMesh** ppMesh,[In] ID3DXBuffer** ppAdjacency) + D3DXCreatePolygon +
+ + +

Creates a mesh containing the specified text, using the font associated with the device context.

+
+

Pointer to the device that created the mesh.

+

Device context, containing the font for output. The font selected by the device context must be a TrueType font.

+

Pointer to a string that specifies the text to generate. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

Maximum chordal deviation from TrueType font outlines.

+

Amount to extrude text in the negative z-direction.

+

Pointer to the returned mesh.

+

Pointer to a buffer containing adjacency information. May be null.

+

Pointer to an array of GLYPHMETRICSFLOAT structures that contain the glyph metric data. Each element contains information about the position and orientation of the corresponding glyph in the string. The number of elements in the array should be equal to the number of characters in the string. Note that the origin in each structure is not relative to the entire string, but rather is relative to that character cell. To compute the entire bounding box, add the increment for each glyph while traversing the string. If you are not concerned with the glyph sizes, set this parameter to null.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateTextA because ANSI strings are being used.

This function creates a mesh with the creation option and | flexible vertex format (FVF).

+
+ + bb172799 + HRESULT D3DXCreateTextW([In] IDirect3DDevice9* pDevice,[In] HDC hDC,[In] const wchar_t* pText,[In] float Deviation,[In] float Extrusion,[In] ID3DXMesh** ppMesh,[In] ID3DXBuffer** ppAdjacency,[In] LPGLYPHMETRICSFLOAT pGlyphMetrics) + D3DXCreateTextW +
+ + +

Retrieves information about a given image file in memory.

+
+

VOID reference to the source file in memory.

+

Size of file in memory, in bytes. .

+

Pointer to a structure to be filled with the description of the data in the source file.

+ + bb172868 + HRESULT D3DXGetImageInfoFromFileInMemory([In] const void* pSrcData,[In] unsigned int SrcDataSize,[Out] D3DXIMAGE_INFO* pSrcInfo) + D3DXGetImageInfoFromFileInMemory +
+ + +

Uses a compiled high-level shader language (HLSL) function to fill each texel of each mipmap level of a texture.

+
+

Pointer to an object, representing the texture to be filled.

+

Pointer to a texture shader object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following:D3DERR_NOTAVAILABLE, .

+ +

The texture target must be an HLSL function that takes contains the following semantics:

  • One input parameter must use a POSITION semantic.
  • One input parameter must use a PSIZE semantic.
  • The function must return a parameter that uses the COLOR semantic.

The input parameters can be in any order. For an example, see

+
+ + bb172836 + HRESULT D3DXFillVolumeTextureTX([In] IDirect3DVolumeTexture9* pVolumeTexture,[In] ID3DXTextureShader* pTextureShader) + D3DXFillVolumeTextureTX +
+ + +

Creates an empty cube texture, adjusting the calling parameters as needed.

+
+

Pointer to an interface, representing the device to be associated with the texture.

+

Width and height of the cube texture, in pixels. For example, if the cube texture is an 8-pixel by 8-pixel cube, the value for this parameter should be 8.

+

Number of mip levels requested. If this value is zero or D3DX_DEFAULT, a complete mipmap chain is created.

+

0, , or . Setting this flag to indicates that the surface is to be used as a render target. The resource can then be passed to the pNewRenderTarget parameter of the SetRenderTarget method. If is specified, the application should check that the device supports this operation by calling CheckDeviceFormat. For more information about using dynamic textures, see Using Dynamic Textures.

+

Member of the enumerated type, describing the requested pixel format for the cube texture. The returned cube texture might have a different format from that specified by Format. Applications should check the format of the returned cube texture.

+

Member of the enumerated type, describing the memory class into which the cube texture should be placed.

+

Address of a reference to an interface, representing the created cube texture object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , E_OUTOFMEMORY.

+ +

Cube textures differ from other surfaces in that they are collections of surfaces.

Internally, uses to adjust the calling parameters. Therefore, calls to will often succeed where calls to CreateCubeTexture would fail.

+
+ + bb172755 + HRESULT D3DXCreateCubeTexture([In] IDirect3DDevice9* pDevice,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] IDirect3DCubeTexture9** ppCubeTexture) + D3DXCreateCubeTexture +
+ + +

Creates a volume texture from a file. This is a more advanced function than .

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

When skipping mipmap levels while loading a .dds file, use the D3DX_SKIP_DDS_MIP_LEVELS macro to generate the MipFilter value. This macro takes the number of levels to skip and the filter type and returns the filter value, which would then be passed into the MipFilter parameter.

+
+ + bb172814 + HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Depth,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + D3DXCreateVolumeTextureFromFileInMemoryEx +
+ + +

Uses a compiled high-level shader language (HLSL) function to fill each texel of each mipmap level of a texture.

+
+

Pointer to an object, representing the texture to be filled.

+

Pointer to a texture shader object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , .

+ +

The texture target must be an HLSL function that takes contains the following semantics:

  • One input parameter must use a POSITION semantic.
  • One input parameter must use a PSIZE semantic.
  • The function must return a parameter that uses the COLOR semantic.

The following is an example of such an HLSL function:

 float4 TextureGradientFill( float2 vTexCoord : POSITION,  float2 vTexelSize : PSIZE) : COLOR  { float r,g, b, xSq,ySq, a; xSq = 2.f*vTexCoord.x-1.f; xSq *= xSq; ySq = 2.f*vTexCoord.y-1.f; ySq *= ySq; a = sqrt(xSq+ySq); if (a > 1.0f) { a = 1.0f-(a-1.0f); } else if (a < 0.2f) { a = 0.2f; } r = 1-vTexCoord.x; g = 1-vTexCoord.y; b = vTexCoord.x; return float4(r, g, b, a); };	
+            

Note that the input parameters can be in any order, but both input semantics must be represented.

+
+ + bb172834 + HRESULT D3DXFillTextureTX([In] IDirect3DTexture9* pTexture,[In] ID3DXTextureShader* pTextureShader) + D3DXFillTextureTX +
+ + +

Checks cube-texture-creation parameters.

+
+

Pointer to an interface, representing the device to be associated with the cube texture.

+

Pointer to the requested width and height in pixels, or null. Returns the corrected size.

+

Pointer to the number of requested mipmap levels, or null. Returns the corrected number of mipmap levels.

+

0 or . Setting this flag to indicates that the surface is to be used as a render target. The resource can then be passed to the pNewRenderTarget parameter of the SetRenderTarget method. If is specified, the application should check that the device supports this operation by calling CheckDeviceFormat.

+

Pointer to a member of the enumerated type. Specifies the desired pixel format, or null. Returns the corrected format.

+

Member of the enumerated type, describing the memory class into which the texture should be placed.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , .

+ +

If parameters to this function are invalid, this function returns corrected parameters.

Cube textures differ from other surfaces in that they are collections of surfaces. To call SetRenderTarget with a cube texture, you must select an individual face using GetCubeMapSurface and pass the resulting surface to SetRenderTarget.

+
+ + bb172715 + HRESULT D3DXCheckCubeTextureRequirements([In] IDirect3DDevice9* pDevice,[InOut] unsigned int* pSize,[InOut] unsigned int* pNumMipLevels,[In] unsigned int Usage,[InOut] D3DFORMAT* pFormat,[In] D3DPOOL Pool) + D3DXCheckCubeTextureRequirements +
+ + +

Creates a texture from a file.

+
+

Pointer to an interface, representing the device to be associated with the texture.

+

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

Address of a reference to an interface, representing the created texture object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateTextureFromFileA because ANSI strings are being used.

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

The function is equivalent to (pDevice, pSrcFile, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, , , D3DX_DEFAULT, D3DX_DEFAULT, 0, null, null, ppTexture).

Mipmapped textures automatically have each level filled with the loaded texture.

When loading images into mipmapped textures, some devices are unable to go to a 1x1 image and this function will fail. If this happens, the images need to be loaded manually.

Note that a resource created with this function will be placed in the memory class denoted by .

Filtering is automatically applied to a texture created using this method. The filtering is equivalent to | in .

For the best performance when using :

  1. Doing image scaling and format conversion at load time can be slow. Store images in the format and resolution they will be used. If the target hardware requires power of two dimensions, create and store images using power of two dimensions.
  2. Consider using DirectDraw surface (DDS) files. Because DDS files can be used to represent any Direct3D 9 texture format, they are very easy for D3DX to read. Also, they can store mipmaps, so any mipmap-generation algorithms can be used to author the images.
+
+ + bb172801 + HRESULT D3DXCreateTextureFromFileW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] IDirect3DTexture9** ppTexture) + D3DXCreateTextureFromFileW +
+ + +

Loads a surface from a file.

+
+

Pointer to an interface. Specifies the destination surface, which receives the image.

+

Pointer to a structure, the destination palette of 256 colors or null.

+

Pointer to a structure. Specifies the destination rectangle. Set this parameter to null to specify the entire surface.

+

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

Pointer to a structure. Specifies the source rectangle. Set this parameter to null to specify the entire image.

+

Combination of one or more controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | .

+

value to replace with transparent black, or 0 to disable the colorkey. This is always a 32-bit ARGB color, independent of the source image format. Alpha is significant and should usually be set to FF for opaque color keys Thus, for opaque black, the value would be equal to 0xFF000000.

+

Pointer to a structure to be filled with a description of the data in the source image file, or null.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , D3DXERR_INVALIDDATA.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXLoadSurfaceFromFileA because ANSI strings are being used.

This function handles conversion to and from compressed texture formats and supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Writing to a non-level-zero surface will not cause the dirty rectangle to be updated. If is called and the surface was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call AddDirtyRect on the surface.

+
+ + bb172900 + HRESULT D3DXLoadSurfaceFromFileW([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const wchar_t* pSrcFile,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + D3DXLoadSurfaceFromFileW +
+ + +

Uses a user-provided function to fill each texel of each mip level of a given cube texture.

+
+

Pointer to an interface, representing the filled texture.

+

Pointer to a user-provided evaluator function, which will be used to compute the value of each texel. The function follows the prototype of LPD3DXFILL3D.

+

Pointer to an arbitrary block of user-defined data. This reference will be passed to the function provided in pFunction.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: .

+ +

Here is an example that creates a function called ColorCubeFill, which relies on .

 // Define a function that matches the prototype of LPD3DXFILL3D	
+            VOID WINAPI ColorCubeFill (* pOut, const * pTexCoord, 	
+            const * pTexelSize, LPVOID pData)	
+            { *pOut = (pTexCoord->x, pTexCoord->y, pTexCoord->z, 0.0f);	
+            } // Fill the texture using 	
+            if (FAILED (hr =  (m_pTexture, ColorCubeFill, null)))	
+            { return hr;	
+            }	
+            
+
+ + bb172831 + HRESULT D3DXFillCubeTexture([In] IDirect3DCubeTexture9* pCubeTexture,[In] __function__stdcall* pFunction,[In] void* pData) + D3DXFillCubeTexture +
+ + +

Creates an empty volume texture, adjusting the calling parameters as needed.

+
+

Pointer to an interface, representing the device to be associated with the volume texture.

+

Width in pixels. This value must be nonzero. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in .

+

Height in pixels. This value must be nonzero. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in .

+

Depth in pixels. This value must be nonzero. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in .

+

Number of mip levels requested. If this value is zero or D3DX_DEFAULT, a complete mipmap chain is created.

+

0 or . For more information about using dynamic textures, see Using Dynamic Textures.

+

Member of the enumerated type, describing the requested pixel format for the volume texture. The returned volume texture might have a different format from that specified by Format. Applications should check the format of the returned volume texture.

+

Member of the enumerated type, describing the memory class into which the volume texture should be placed.

+

Address of a reference to an interface, representing the created volume texture object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , E_OUTOFMEMORY .

+ +

Internally, uses to adjust the calling parameters. Therefore, calls to will often succeed where calls to CreateVolumeTexture would fail.

+
+ + bb172810 + HRESULT D3DXCreateVolumeTexture([In] IDirect3DDevice9* pDevice,[In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Depth,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + D3DXCreateVolumeTexture +
+ + +

Loads a volume from a file.

+
+

Pointer to an interface. Specifies the destination volume.

+

Pointer to a structure, the destination palette of 256 colors or null.

+

Pointer to a structure. Specifies the destination box. Set this parameter to null to specify the entire volume.

+

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

Pointer to a structure. Specifies the source box. Set this parameter to null to specify the entire volume.

+

Combination of one or more , controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | .

+

value to replace with transparent black, or 0 to disable the colorkey. This is always a 32-bit ARGB color, independent of the source image format. Alpha is significant and should usually be set to FF for opaque color keys. Thus, for opaque black, the value would be equal to 0xFF000000.

+

Pointer to a structure to be filled with a description of the data in the source image file, or null.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , D3DXERR_INVALIDDATA.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXLoadVolumeFromFileA because ANSI strings are being used.

This function handles conversion to and from compressed texture formats and supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Writing to a non-level-zero surface of the volume texture will not cause the dirty rectangle to be updated. If is called and the texture was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call on the volume texture.

+
+ + bb172905 + HRESULT D3DXLoadVolumeFromFileW([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const wchar_t* pSrcFile,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + D3DXLoadVolumeFromFileW +
+ + + No documentation. + + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + + HRESULT D3DXLoadSurfaceFromResourceW([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + D3DXLoadSurfaceFromResourceW + + + +

Creates a texture from a file. This is a more advanced function than .

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateTextureFromFileExA because ANSI strings are being used.

Use to determine if your device can support the texture given the current state.

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Mipmapped textures automatically have each level filled with the loaded texture. When loading images into mipmapped textures, some devices are unable to go to a 1x1 image and this function will fail. If this happens, then the images need to be loaded manually.

For the best performance when using :

  1. Doing image scaling and format conversion at load time can be slow. Store images in the format and resolution they will be used. If the target hardware requires power of 2 dimensions, then create and store images using power of 2 dimensions.
  2. For mipmap image creation at load time, filter using . A box filter is much faster than other filter types such as .
  3. Consider using DDS files. Since DDS files can be used to represent any Direct3D 9 texture format, they are very easy for D3DX to read. Also, they can store mipmaps, so any mipmap-generation algorithms can be used to author the images.

When skipping mipmap levels while loading a .dds file, use the D3DX_SKIP_DDS_MIP_LEVELS macro to generate the MipFilter value. This macro takes the number of levels to skip and the filter type and returns the filter value, which would then be passed into the MipFilter parameter.

+
+ + bb172802 + HRESULT D3DXCreateTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Width,[In] unsigned int Height,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + D3DXCreateTextureFromFileExW +
+ + +

Converts a height map into a normal map. The (x,y,z) components of each normal are mapped to the (r,g,b) channels of the output texture.

+
+

Pointer to an interface, representing the destination texture.

+

Pointer to an interface, representing the source height-map texture.

+

Pointer to a type that contains the source palette of 256 colors or null.

+

One or more flags that control generation of normal maps.

+

One flag specifying the source of height information.

+

Constant value multiplier that increases (or decreases) the values in the normal map. Higher values usually make bumps more visible, lower values usually make bumps less visible.

+

If the function succeeds, the return value is . If the function fails, the return value can be the following value: .

+ +

This method computes the normal by using the central difference with a kernel size of 3x3. The central differencing denominator used is 2.0. RGB channels in the destination contain biased (x,y,z) components of the normal.

+
+ + bb172741 + HRESULT D3DXComputeNormalMap([In] IDirect3DTexture9* pTexture,[In] IDirect3DTexture9* pSrcTexture,[Out, Buffer] const PALETTEENTRY* pSrcPalette,[In] unsigned int Flags,[In] unsigned int Channel,[In] float Amplitude) + D3DXComputeNormalMap +
+ + +

Checks volume-texture-creation parameters.

+
+

Pointer to an interface, representing the device to be associated with the volume texture.

+

Pointer to the requested width in pixels, or null. Returns the corrected size.

+

Pointer to the requested height in pixels, or null. Returns the corrected size.

+

Pointer to the requested depth in pixels, or null. Returns the corrected size.

+

Pointer to the number of requested mipmap levels, or null. Returns the corrected number of mipmap levels.

+

Currently not used, set to 0.

+

Pointer to a member of the enumerated type. Specifies the desired pixel format, or null. Returns the corrected format.

+

Member of the enumerated type, describing the memory class into which the volume texture should be placed.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , .

+ +

If parameters to this function are invalid, this function returns corrected parameters.

+
+ + bb172718 + HRESULT D3DXCheckVolumeTextureRequirements([In] IDirect3DDevice9* pDevice,[InOut] unsigned int* pWidth,[InOut] unsigned int* pHeight,[InOut] unsigned int* pDepth,[InOut] unsigned int* pNumMipLevels,[In] unsigned int Usage,[InOut] D3DFORMAT* pFormat,[In] D3DPOOL Pool) + D3DXCheckVolumeTextureRequirements +
+ + + No documentation. + + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + + HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + D3DXLoadSurfaceFromFileInMemory + + + +

Creates a texture from a file in memory.

+
+

Pointer to an interface representing the device to be associated with the texture.

+

Pointer to the file in memory from which to create the texture.

+

Size in bytes of the file in memory.

+

Address of a reference to an interface representing the created texture object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The function is equivalent to (pDevice, pSrcData, SrcDataSize, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, , , D3DX_DEFAULT, D3DX_DEFAULT, 0, null, null, ppTexture).

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Note that a resource created with this function when called from a object will be placed in the memory class denoted by . When this method is called from a object the resource will be placed in the memory class denoted by .

Filtering is automatically applied to a texture created using this method. The filtering is equivalent to | in .

+
+ + bb172803 + HRESULT D3DXCreateTextureFromFileInMemory([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] IDirect3DTexture9** ppTexture) + D3DXCreateTextureFromFileInMemory +
+ + +

Creates a cube texture from a resource specified by a string. This is a more advanced function than .

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The compiler setting determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateCubeTextureFromResourceExA because ANSI strings are being used.

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Cube textures differ from other surfaces in that they are collections of surfaces. To call SetRenderTarget with a cube texture, you must select an individual face using GetCubeMapSurface and pass the resulting surface to SetRenderTarget.

uses the DirectDraw surface (DDS) file format. The DirectX Texture Editor (Dxtex.exe) enables you to generate a cube map from other file formats and save it in the DDS file format.

+
+ + bb172761 + HRESULT D3DXCreateCubeTextureFromResourceExW([In] IDirect3DDevice9* pDevice,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] D3DXIMAGE_INFO* pSrcInfo,[In] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + D3DXCreateCubeTextureFromResourceExW +
+ + +

Creates a volume texture from a file in memory.

+
+

Pointer to an interface, representing the device to be associated with the volume texture.

+

Pointer to the file in memory from which to create the volume texture.

+

Size of the file in memory, in bytes.

+

Address of a reference to an interface, representing the created texture object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

The function is equivalent to (pDevice, pSrcFile, SrcData, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, , , D3DX_DEFAULT, D3DX_DEFAULT, 0, null, null, ppVolumeTexture).

Note that a resource created with this function when called from a object will be placed in the memory class denoted by . When this method is called from a object the resource will be placed in the memory class denoted by .

Filtering is automatically applied to a texture created using this method. The filtering is equivalent to | in .

+
+ + bb172813 + HRESULT D3DXCreateVolumeTextureFromFileInMemory([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + D3DXCreateVolumeTextureFromFileInMemory +
+ + +

Loads a volume from another volume.

+
+

Pointer to an interface. Specifies the destination volume, which receives the image.

+

Pointer to a structure, the destination palette of 256 colors or null.

+

Pointer to a structure. Specifies the destination box. Set this parameter to null to specify the entire volume.

+

A Pointer to an interface. Specifies the source volume.

+

Pointer to a structure, the source palette of 256 colors or null.

+

Pointer to a structure. Specifies the source box. Set this parameter to null to specify the entire volume.

+

A combination of one or more , controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | .

+

value to replace with transparent black, or 0 to disable the colorkey. This is always a 32-bit ARGB color, independent of the source image format. Alpha is significant and should usually be set to FF for opaque color keys. Thus, for opaque black, the value would be equal to 0xFF000000.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

Writing to a non-level-zero surface of the volume texture will not cause the dirty rectangle to be updated. If is called and the surface was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call on the surface.

+
+ + bb172909 + HRESULT D3DXLoadVolumeFromVolume([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] IDirect3DVolume9* pSrcVolume,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey) + D3DXLoadVolumeFromVolume +
+ + +

Saves a texture to a file.

+
+

Pointer to a string that specifies the file name of the destination image. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

specifying the file format to use when saving. This function supports saving to all formats except Portable Pixmap (.ppm) and Targa/Truevision Graphics Adapter (.tga).

+

Pointer to interface, containing the texture to be saved.

+

Pointer to a structure containing a palette of 256 colors. This parameter can be null.

+

If the function succeeds, the return value is . If the function fails, the return value can be the following:

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXSaveTextureToFileA because ANSI strings are being used.

This function handles conversion to and from compressed texture formats.

If the volume is nondynamic (because of a usage parameter set to 0 at the creation) and located in video memory (the memory pool set to ), will fail because D3DX cannot lock nondynamic volumes located in video memory.

+
+ + bb205433 + HRESULT D3DXSaveTextureToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DBaseTexture9* pSrcTexture,[In, Buffer] const PALETTEENTRY* pSrcPalette) + D3DXSaveTextureToFileW +
+ + +

Creates a texture from a file.

+
+

Pointer to an interface, representing the device to be associated with the texture.

+

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

Address of a reference to an interface, representing the created texture object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateTextureFromFileA because ANSI strings are being used.

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

The function is equivalent to (pDevice, pSrcFile, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, , , D3DX_DEFAULT, D3DX_DEFAULT, 0, null, null, ppTexture).

Mipmapped textures automatically have each level filled with the loaded texture.

When loading images into mipmapped textures, some devices are unable to go to a 1x1 image and this function will fail. If this happens, the images need to be loaded manually.

Note that a resource created with this function will be placed in the memory class denoted by .

Filtering is automatically applied to a texture created using this method. The filtering is equivalent to | in .

For the best performance when using :

  1. Doing image scaling and format conversion at load time can be slow. Store images in the format and resolution they will be used. If the target hardware requires power of two dimensions, create and store images using power of two dimensions.
  2. Consider using DirectDraw surface (DDS) files. Because DDS files can be used to represent any Direct3D 9 texture format, they are very easy for D3DX to read. Also, they can store mipmaps, so any mipmap-generation algorithms can be used to author the images.
+
+ + bb172801 + HRESULT D3DXCreateCubeTextureFromFileW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] IDirect3DCubeTexture9** ppCubeTexture) + D3DXCreateCubeTextureFromFileW +
+ + +

Creates a cube texture from a file in memory. This is a more advanced function than .

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Cube textures differ from other surfaces in that they are collections of surfaces. To call SetRenderTarget with a cube texture, you must select an individual face using GetCubeMapSurface and pass the resulting surface to SetRenderTarget .

This method is designed to be used for loading image files stored as RT_RCDATA, which is an application-defined resource (raw data). Otherwise this method will fail.

For details on , see the Platform SDK. Note that as of DirectX 8.0, the peFlags member of the structure does not function as documented in the Platform SDK. The peFlags member is now the alpha channel for 8-bit palettized formats.

uses the DirectDraw surface (DDS) file format. The DirectX Texture Editor (Dxtex.exe) enables you to generate a cube map from other file formats and save it in the DDS file format

When skipping mipmap levels while loading a .dds file, use the D3DX_SKIP_DDS_MIP_LEVELS macro to generate the MipFilter value. This macro takes the number of levels to skip and the filter type and returns the filter value, which would then be passed into the MipFilter parameter.

+
+ + bb172759 + HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + D3DXCreateCubeTextureFromFileInMemoryEx +
+ + +

Creates a texture from a resource. This is a more advanced function than .

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateTextureFromResourceExA because ANSI strings are being used.

The resource being loaded must be of type RT_BITMAP or RT_RCDATA. Resource type RT_RCDATA is used to load formats other than bitmaps (such as .tga, .jpg, and .dds).

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

+
+ + bb172806 + HRESULT D3DXCreateTextureFromResourceExW([In] IDirect3DDevice9* pDevice,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In] unsigned int Width,[In] unsigned int Height,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] D3DXIMAGE_INFO* pSrcInfo,[In] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + D3DXCreateTextureFromResourceExW +
+ + +

Retrieves information about a given image file.

+
+

File name of image to retrieve information about. If UNICODE or _UNICODE are defined, this parameter type is LPCWSTR, otherwise, the type is LPCSTR.

+

Pointer to a structure to be filled with the description of the data in the source file.

+ +

This function supports both Unicode and ANSI strings.

+
+ + bb172867 + HRESULT D3DXGetImageInfoFromFileW([In] const wchar_t* pSrcFile,[Out] D3DXIMAGE_INFO* pSrcInfo) + D3DXGetImageInfoFromFileW +
+ + + No documentation. + + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + + HRESULT D3DXFilterTexture([In] IDirect3DBaseTexture9* pBaseTexture,[In, Buffer] const PALETTEENTRY* pPalette,[In] unsigned int SrcLevel,[In] D3DX_FILTER Filter) + D3DXFilterTexture + + + +

Loads a surface from memory.

+
+

Pointer to an interface. Specifies the destination surface, which receives the image.

+

Pointer to a structure, the destination palette of 256 colors or null.

+

Pointer to a structure. Specifies the destination rectangle. Set this parameter to null to specify the entire surface.

+

Pointer to the upper left corner of the source image in memory.

+

Member of the enumerated type, the pixel format of the source image.

+

Pitch of source image, in bytes. For DXT formats, this number should represent the width of one row of cells, in bytes.

+

Pointer to a structure, the source palette of 256 colors or null.

+

Pointer to a structure. Specifies the dimensions of the source image in memory. This value cannot be null.

+

Combination of one or more controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | .

+

value to replace with transparent black, or 0 to disable the colorkey. This is always a 32-bit ARGB color, independent of the source image format. Alpha is significant and should usually be set to FF for opaque color keys. Thus, for opaque black, the value would be equal to 0xFF000000.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , D3DXERR_INVALIDDATA.

+ +

This function handles conversion to and from compressed texture formats.

Writing to a non-level-zero surface will not cause the dirty rectangle to be updated. If is called and the surface was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call AddDirtyRect on the surface.

+
+ + bb172902 + HRESULT D3DXLoadSurfaceFromMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcPitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) + D3DXLoadSurfaceFromMemory +
+ + +

Saves a texture to an image file.

+
+

specifying the file format to use when saving. This function supports saving to all formats except Portable Pixmap (.ppm) and Targa/Truevision Graphics Adapter (.tga).

+

Pointer to interface containing the image to be saved.

+

Pointer to a structure containing a palette of 256 colors. This parameter can be null.

+

Address of a reference to an that will store the image.

+ +

This function handles conversion to and from compressed texture formats.

+
+ + bb205434 + HRESULT D3DXSaveTextureToFileInMemory([Out] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DBaseTexture9* pSrcTexture,[In, Buffer] const PALETTEENTRY* pSrcPalette) + D3DXSaveTextureToFileInMemory +
+ + +

Checks texture-creation parameters.

+
+

Pointer to an interface, representing the device to be associated with the texture.

+

Pointer to the requested width in pixels, or null. Returns the corrected size.

+

Pointer to the requested height in pixels, or null. Returns the corrected size.

+

Pointer to number of requested mipmap levels, or null. Returns the corrected number of mipmap levels.

+

0 or . Setting this flag to indicates that the surface is to be used as a render target. The resource can then be passed to the pNewRenderTarget parameter of the SetRenderTarget method. If is specified, the application should check that the device supports this operation by calling CheckDeviceFormat.

+

Pointer to a member of the enumerated type. Specifies the desired pixel format, or null. Returns the corrected format.

+

Member of the enumerated type, describing the memory class into which the texture should be placed.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , .

+ +

If parameters to this function are invalid, this function returns corrected parameters.

This function uses the following heuristics when comparing the requested requirements against available formats:

  • Do not choose a format that has fewer channels.
  • Avoid FOURCC And 24-bit formats unless explicitly requested.
  • Try not to add new channels.
  • Try not to change the number of bits per channel.
  • Try to avoid converting between types of formats. For instance, avoid converting an ARGB format to a depth format.
+
+ + bb172716 + HRESULT D3DXCheckTextureRequirements([In] IDirect3DDevice9* pDevice,[InOut] unsigned int* pWidth,[InOut] unsigned int* pHeight,[InOut] unsigned int* pNumMipLevels,[In] unsigned int Usage,[InOut] D3DFORMAT* pFormat,[In] D3DPOOL Pool) + D3DXCheckTextureRequirements +
+ + +

Saves a volume to a file on disk.

+
+

Pointer to a string that specifies the file name of the destination image. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

specifying the file format to use when saving. This function supports saving to all formats except Portable Pixmap (.ppm) and Targa/Truevision Graphics Adapter (.tga).

+

Pointer to interface containing the image to be saved.

+

Pointer to a structure containing a palette of 256 colors. This parameter can be null.

+

Pointer to a structure. Specifies the source box. Set this parameter to null to specify the entire volume.

+

If the function succeeds, the return value is . If the function fails, the return value can be the following:

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to >D3DXSaveVolumeToFileA because ANSI strings are being used.

This function handles conversion to and from compressed texture formats.

If the volume is nondynamic (because of a usage parameter set to 0 at the creation) and located in video memory (the memory pool set to ), will fail because D3DX cannot lock nondynamic volumes located in video memory.

+
+ + bb205435 + HRESULT D3DXSaveVolumeToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcBox) + D3DXSaveVolumeToFileW +
+ + +

Loads a volume from a resource.

+
+

Pointer to an interface. Specifies the destination volume.

+

Pointer to a structure, the destination palette of 256 colors or null.

+

Pointer to a structure. Specifies the destination box. Set this parameter to null to specify the entire volume.

+

Handle to the module where the resource is located, or null for module associated with the image the operating system used to create the current process.

+

Pointer to a string that specifies the file name of the source image. If UNICODE or _UNICODE are defined, this parameter type is LPCWSTR, otherwise, the type is LPCSTR.

+

Pointer to a structure. Specifies the source box. Set this parameter to null to specify the entire volume.

+

Combination of one or more , controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | .

+

value to replace with transparent black, or 0 to disable the colorkey. This is always a 32-bit ARGB color, independent of the source image format. Alpha is significant and should usually be set to FF for opaque color keys. Thus, for opaque black, the value would be equal to 0xFF000000.

+

Pointer to a structure to be filled with a description of the data in the source image file, or null.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , D3DXERR_INVALIDDATA.

+ +

The resource being loaded must be a bitmap resource(RT_BITMAP).

This function handles conversion to and from compressed texture formats.

Writing to a non-level-zero surface of the volume texture will not cause the dirty rectangle to be updated. If is called and the texture was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call on the volume texture.

This function supports both Unicode and ANSI strings.

+
+ + bb172908 + HRESULT D3DXLoadVolumeFromResourceW([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + D3DXLoadVolumeFromResourceW +
+ + +

Creates a volume texture from a resource specified by a string. This is a more advanced function than .

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateVolumeTextureFromResourceExA because ANSI strings are being used.

The resource being loaded must be an application-defined resource (RT_RCDATA).

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

+
+ + bb172816 + HRESULT D3DXCreateVolumeTextureFromResourceExW([In] IDirect3DDevice9* pDevice,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Depth,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] D3DXIMAGE_INFO* pSrcInfo,[In] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + D3DXCreateVolumeTextureFromResourceExW +
+ + +

Creates a cube texture from a resource.

+
+

Pointer to an interface, representing the device to be associated with the cube texture.

+

Handle to the module where the resource is located, or null for the module associated with the image the operating system used to create the current process.

+

Pointer to a string that specifies the resource name. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

Address of a reference to an interface, representing the created cube texture object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The compiler setting determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateCubeTextureFromResourceA because ANSI strings are being used.

The function is equivalent to (pDevice, hSrcModule, pSrcResource, D3DX_DEFAULT, D3DX_DEFAULT, 0, , , D3DX_DEFAULT, D3DX_DEFAULT, 0, null, null, ppCubeTexture).

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Note that a resource created with this function when called from a object will be placed in the memory class denoted by . When this method is called from a object the resource will be placed in the memory class denoted by .

Filtering is automatically applied to a texture created using this method. The filtering is equivalent to | in .

uses the DirectDraw surface (DDS) file format. The DirectX Texture Editor (Dxtex.exe) enables you to generate a cube map from other file formats and save it in the DDS file format.

+
+ + bb172760 + HRESULT D3DXCreateCubeTextureFromResourceW([In] IDirect3DDevice9* pDevice,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In] IDirect3DCubeTexture9** ppCubeTexture) + D3DXCreateCubeTextureFromResourceW +
+ + +

Saves a surface to a file.

+
+

Pointer to a string that specifies the file name of the destination image. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

specifying the file format to use when saving. This function supports saving to all formats except Portable Pixmap (.ppm) and Targa/Truevision Graphics Adapter (.tga).

+

Pointer to interface, containing the image to be saved.

+

Pointer to a structure containing a palette of 256 colors. This parameter can be null.

+

Pointer to a structure. Specifies the source rectangle. Set this parameter to null to specify the entire image.

+

If the function succeeds, the return value is . If the function fails, the return value can be the following:

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXSaveSurfaceToFileA because ANSI strings are being used.

This function handles conversion to and from compressed texture formats.

+
+ + bb205431 + HRESULT D3DXSaveSurfaceToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect) + D3DXSaveSurfaceToFileW +
+ + +

Creates a cube texture from a file in memory.

+
+

Pointer to an interface, representing the device to be associated with the cube texture.

+

Pointer to the file in memory from which to create the cubemap. See Remarks.

+

Size of the file in memory, in bytes.

+

Address of a reference to an interface, representing the created cube texture object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

The function is equivalent to (pDevice, pSrcData, SrcDataSize, D3DX_DEFAULT, D3DX_DEFAULT, 0, , , D3DX_DEFAULT, D3DX_DEFAULT, 0, null, null, ppCubeTexture).

Note that a resource created with this function when called from a object will be placed in the memory class denoted by . When this method is called from a object the resource will be placed in the memory class denoted by .

This method is designed to be used for loading image files stored as RT_RCDATA, which is an application-defined resource (raw data). Otherwise this method will fail.

Filtering is automatically applied to a texture created using this method. The filtering is equivalent to | in .

uses the DirectDraw surface (DDS) file format. The DirectX Texture Editor (Dxtex.exe) enables you to generate a cube map from other file formats and save it in the DDS file format.

+
+ + bb172758 + HRESULT D3DXCreateCubeTextureFromFileInMemory([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] IDirect3DCubeTexture9** ppCubeTexture) + D3DXCreateCubeTextureFromFileInMemory +
+ + +

Creates a cube texture from a file. This is a more advanced function than .

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateCubeTextureFromFileExA because ANSI strings are being used.

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Cube textures differ from other surfaces in that they are collections of surfaces. To call SetRenderTarget with a cube texture, you must select an individual face using GetCubeMapSurface and pass the resulting surface to SetRenderTarget.

uses the DirectDraw surface (DDS) file format. The DirectX Texture Editor (Dxtex.exe) enables you to generate a cube map from other file formats and save it in the DDS file format.

When skipping mipmap levels while loading a .dds file, use the D3DX_SKIP_DDS_MIP_LEVELS macro to generate the MipFilter value. This macro takes the number of levels to skip and the filter type and returns the filter value, which would then be passed into the MipFilter parameter.

+
+ + bb172757 + HRESULT D3DXCreateCubeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) + D3DXCreateCubeTextureFromFileExW +
+ + +

Retrieves information about a given image in a resource.

+
+

Module where the resource is loaded. Set this parameter to null to specify the module associated with the image that the operating system used to create the current process.

+

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

Pointer to a structure to be filled with the description of the data in the source file.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXGetImageInfoFromResourceA because ANSI strings are being used.

+
+ + bb172869 + HRESULT D3DXGetImageInfoFromResourceW([In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[Out] D3DXIMAGE_INFO* pSrcInfo) + D3DXGetImageInfoFromResourceW +
+ + +

Uses a compiled high-level shader language (HLSL) function to fill each texel of each mipmap level of a texture.

+
+

Pointer to an object, representing the texture to be filled.

+

Pointer to a texture shader object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , .

+ +

The texture target must be an HLSL function that takes contains the following semantics:

  • One input parameter must use a POSITION semantic.
  • One input parameter must use a PSIZE semantic.
  • The function must return a parameter that uses the COLOR semantic.

The input parameters can be in any order. For an example, see

+
+ + bb172832 + HRESULT D3DXFillCubeTextureTX([In] IDirect3DCubeTexture9* pCubeTexture,[In] ID3DXTextureShader* pTextureShader) + D3DXFillCubeTextureTX +
+ + +

Uses a user-provided function to fill each texel of each mip level of a given texture.

+
+

Pointer to an interface, representing the filled texture.

+

Pointer to a user-provided evaluator function, which will be used to compute the value of each texel. The function follows the prototype of LPD3DXFILL2D.

+

Pointer to an arbitrary block of user-defined data. This reference will be passed to the function provided in pFunction.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: .

+ +

Here is an example that creates a function called ColorFill, which relies on .

 // Define a function that matches the prototype of LPD3DXFILL3D	
+            VOID WINAPI ColorFill (* pOut, const * pTexCoord, 	
+            const * pTexelSize, LPVOID pData)	
+            { *pOut = (pTexCoord->x, pTexCoord->y, 0.0f, 0.0f);	
+            } // Fill the texture using 	
+            if (FAILED (hr =  (m_pTexture, ColorFill, null)))	
+            { return hr;	
+            }	
+            
+
+ + bb172833 + HRESULT D3DXFillTexture([In] IDirect3DTexture9* pTexture,[In] __function__stdcall* pFunction,[In] void* pData) + D3DXFillTexture +
+ + +

Saves a surface to an image file.

+
+

Address of a reference to an that will store the image.

+

specifying the file format to use when saving. This function supports saving to all formats except Portable Pixmap (.ppm) and Targa/Truevision Graphics Adapter (.tga).

+

Pointer to interface containing the image to be saved.

+

Pointer to a structure containing a palette of 256 colors. This parameter can be null.

+

Pointer to a structure. Specifies the source rectangle. Set this parameter to null to specify the entire image.

+

If the function succeeds, the return value is . If the function fails, the return value can be the following: .

+ +

This function handles conversion to and from compressed texture formats.

+
+ + bb205432 + HRESULT D3DXSaveSurfaceToFileInMemory([In] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect) + D3DXSaveSurfaceToFileInMemory +
+ + +

Creates a volume texture from a file.

+
+

Pointer to an interface, representing the device to be associated with the volume texture.

+

Pointer to a string that specifies the file name. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

Address of a reference to an interface representing the created texture object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateVolumeTextureFromFileA because ANSI strings are being used.

The function is equivalent to (pDevice, pSrcFile, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, , , D3DX_DEFAULT, D3DX_DEFAULT, 0, null, null, ppVolumeTexture).

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Mipmapped textures automatically have each level filled with the loaded texture.

When loading images into mipmapped textures, some devices are unable to go to a 1x1 image and this function will fail. If this happens, then the images need to be loaded manually.

Note that a resource created with this function when called from a object will be placed in the memory class denoted by . When this method is called from a object the resource will be placed in the memory class denoted by .

Filtering is automatically applied to a texture created using this method. The filtering is equivalent to | in .

+
+ + bb172811 + HRESULT D3DXCreateVolumeTextureFromFileW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + D3DXCreateVolumeTextureFromFileW +
+ + +

Creates a texture from a resource.

+
+

Pointer to an interface, representing the device to be associated with the texture.

+

Handle to the module where the resource is located, or null for module associated with the image the operating system used to create the current process.

+

Pointer to a string that specifies the resource name. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

Address of a reference to an interface, representing the created texture object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateTextureFromResourceA because ANSI strings are being used.

The function is equivalent to (pDevice, hSrcModule, pSrcResource, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, , , D3DX_DEFAULT, D3DX_DEFAULT, 0, null, null, ppTexture).

The resource being loaded must be of type RT_BITMAP or RT_RCDATA. Resource type RT_RCDATA is used to load formats other than bitmaps (such as .tga, .jpg, and .dds).

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Note that a resource created with this function when called from a object will be placed in the memory class denoted by . When this method is called from a object the resource will be placed in the memory class denoted by .

Filtering is automatically applied to a texture created using this method. The filtering is equivalent to | in .

+
+ + bb172805 + HRESULT D3DXCreateTextureFromResourceW([In] IDirect3DDevice9* pDevice,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In] IDirect3DTexture9** ppTexture) + D3DXCreateTextureFromResourceW +
+ + +

Loads a volume from memory.

+
+

Pointer to an interface. Specifies the destination volume, which receives the image.

+

Pointer to a structure, the destination palette of 256 colors or null.

+

Pointer to a structure. Specifies the destination box. Set this parameter to null to specify the entire volume.

+

Pointer to the top-left corner of the source volume in memory.

+

Member of the enumerated type, the pixel format of the source volume.

+

Pitch of source image, in bytes. For DXT formats (compressed texture formats), this number should represent the size of one row of cells, in bytes.

+

Pitch of source image, in bytes. For DXT formats (compressed texture formats), this number should represent the size of one slice of cells, in bytes.

+

Pointer to a structure, the source palette of 256 colors or null.

+

Pointer to a structure. Specifies the source box. null is not a valid value for this parameter.

+

A combination of one or more controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | .

+

value to replace with transparent black, or 0 to disable the colorkey. This is always a 32-bit ARGB color, independent of the source image format. Alpha is significant and should usually be set to FF for opaque color keys. Thus, for opaque black, the value would be equal to 0xFF000000.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , D3DXERR_INVALIDDATA.

+ +

Writing to a non-level-zero surface of the volume texture will not cause the dirty rectangle to be updated. If is called and the texture was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call on the volume texture.

+
+ + bb172907 + HRESULT D3DXLoadVolumeFromMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcRowPitch,[In] unsigned int SrcSlicePitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey) + D3DXLoadVolumeFromMemory +
+ + +

Creates a volume texture from a file.

+
+

Pointer to an interface, representing the device to be associated with the texture.

+

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

Width in pixels. If this value is zero or D3DX_DEFAULT, the dimensions are taken from the file. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in .

+

Height, in pixels. If this value is zero or D3DX_DEFAULT, the dimensions are taken from the file. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in .

+

Depth, in pixels. If this value is zero or D3DX_DEFAULT, the dimensions are taken from the file. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in .

+

Number of mip levels requested. If this value is zero or D3DX_DEFAULT, a complete mipmap chain is created.

+

0, , or . Setting this flag to indicates that the surface is to be used as a render target. The resource can then be passed to the pNewRenderTarget parameter of the SetRenderTarget method. If either or is specified, Pool must be set to , and the application should check that the device supports this operation by calling CheckDeviceFormat. indicates that the surface should be handled dynamically. For more information about using dynamic textures, see Using Dynamic Textures.

+

Member of the enumerated type, describing the requested pixel format for the texture. The returned texture might have a different format from that specified by Format. Applications should check the format of the returned texture. If , the format is taken from the file. If D3DFMT_FROM_FILE, the format is taken exactly as it is in the file, and the call will fail if this violates device capabilities.

+

Member of the enumerated type, describing the memory class into which the texture should be placed.

+

A combination of one or more controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | .

+

A combination of one or more controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying . In addition, use bits 27-31 to specify the number of mip levels to be skipped (from the top of the mipmap chain) when a .dds texture is loaded into memory; this allows you to skip up to 32 levels.

+

value to replace with transparent black, or 0 to disable the colorkey. This is always a 32-bit ARGB color, independent of the source image format. Alpha is significant and should usually be set to FF for opaque color keys. Thus, for opaque black, the value would be equal to 0xFF000000.

+

Pointer to a structure to be filled in with a description of the data in the source image file, or null.

+

Pointer to a structure, representing a 256-color palette to fill in, or null.

+

Address of a reference to an interface, representing the created texture object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateVolumeTextureFromFileExA because ANSI strings are being used.

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Mipmapped textures automatically have each level filled with the loaded volume texture. When loading images into mipmapped textures, some devices are unable to go to a 1x1 image and this function will fail. If this happens, then the images need to be loaded manually.

When skipping mipmap levels while loading a .dds file, use the D3DX_SKIP_DDS_MIP_LEVELS macro to generate the MipFilter value. This macro takes the number of levels to skip and the filter type and returns the filter value, which would then be passed into the MipFilter parameter.

+
+ + bb172812 + HRESULT D3DXCreateVolumeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Depth,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + D3DXCreateVolumeTextureFromFileExW +
+ + +

Creates a texture from a file in memory. This is a more advanced function than .

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

For details about , see the Platform SDK. Note that as of DirectX 8.0, the peFlags member of the structure does not function as documented in the Platform SDK. The peFlags member is now the alpha channel for 8-bit palettized formats.

When skipping mipmap levels while loading a .dds file, use the D3DX_SKIP_DDS_MIP_LEVELS macro to generate the MipFilter value. This macro takes the number of levels to skip and the filter type and returns the filter value, which would then be passed into the MipFilter parameter.

+
+ + bb172804 + HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Width,[In] unsigned int Height,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + D3DXCreateTextureFromFileInMemoryEx +
+ + +

Saves a volume to a buffer. The method creates an buffer to store the data, and returns that object.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be the following:

+ + bb205436 + HRESULT D3DXSaveVolumeToFileInMemory([In] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcBox) + D3DXSaveVolumeToFileInMemory +
+ + +

Creates a volume texture from a resource.

+
+

Pointer to an interface, representing the device to be associated with the volume texture.

+

Handle to the module where the resource is located, or null for the module associated with the image the operating system used to create the current process.

+

Pointer to a string that specifies the resource name. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

+

Address of a reference to an interface representing the created texture object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateVolumeTextureFromResourceA because ANSI strings are being used.

The function is equivalent to (pDevice, hSrcModule, pSrcResource, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, , , D3DX_DEFAULT, D3DX_DEFAULT, 0, null, null, ppVolumeTexture).

The resource being loaded must be an application-defined resource (RT_RCDATA).

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Note that a resource created with this function when called from a object will be placed in the memory class denoted by . When this method is called from a object the resource will be placed in the memory class denoted by .

Filtering is automatically applied to a texture created using this method. The filtering is equivalent to | in .

+
+ + bb172815 + HRESULT D3DXCreateVolumeTextureFromResourceW([In] IDirect3DDevice9* pDevice,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + D3DXCreateVolumeTextureFromResourceW +
+ + +

Creates an empty texture, adjusting the calling parameters as needed.

+
+

Pointer to an interface, representing the device to be associated with the texture.

+

Width in pixels. If this value is 0, a value of 1 is used. See Remarks.

+

Height in pixels. If this value is 0, a value of 1 is used. See Remarks.

+

Number of mip levels requested. If this value is zero or D3DX_DEFAULT, a complete mipmap chain is created.

+

0, , or . Setting this flag to indicates that the surface is to be used as a render target by calling the SetRenderTarget method. If either or is specified, the application should check that the device supports this operation by calling CheckDeviceFormat. For more information about using dynamic textures, see Using Dynamic Textures.

+

Member of the enumerated type, describing the requested pixel format for the texture. The returned texture may be of a different format from that specified, if the device does not support the requested format. Applications should check the format of the returned texture to see if it matches the format requested.

+

Member of the enumerated type, describing the memory class into which the texture should be placed.

+

Address of a reference to an interface, representing the created texture object.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , E_OUTOFMEMORY.

+ +

Internally, uses to adjust the calling parameters. Therefore, calls to will often succeed where calls to CreateTexture would fail.

If both Height and Width are set to D3DX_DEFAULT, a value of 256 is used for both parameters. If either Height or Width is set to D3DX_DEFAULT And the other parameter is set to a numeric value, the texture will be square with both the height and width equal to the numeric value.

+
+ + bb172800 + HRESULT D3DXCreateTexture([In] IDirect3DDevice9* pDevice,[In] unsigned int Width,[In] unsigned int Height,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] IDirect3DTexture9** ppTexture) + D3DXCreateTexture +
+ + +

Uses a user-provided function to fill each texel of each mip level of a given volume texture.

+
+

Pointer to an interface, representing the filled texture.

+

Pointer to a user-provided evaluator function, which will be used to compute the value of each texel. The function follows the prototype of LPD3DXFILL3D.

+

Pointer to an arbitrary block of user-defined data. This reference will be passed to the function provided in pFunction.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: .

+ +

If the volume is non-dynamic (because usage is set to 0 when it is created), and located in video memory (the memory pool set to ), will fail because the volume cannot be locked.

This example creates a function called ColorVolumeFill, which relies on .

 // Define a function that matches the prototype of LPD3DXFILL3D	
+            VOID WINAPI ColorVolumeFill (* pOut, const * pTexCoord, 	
+            const * pTexelSize, LPVOID pData)	
+            { *pOut = (pTexCoord->x, pTexCoord->y, pTexCoord->z, 0.0f);	
+            } // Fill volume texture	
+            if (FAILED (hr =  (m_pTexture, ColorVolumeFill, null)))	
+            { return hr;	
+            }	
+            
+
+ + bb172835 + HRESULT D3DXFillVolumeTexture([In] IDirect3DVolumeTexture9* pVolumeTexture,[In] __function__stdcall* pFunction,[In] void* pData) + D3DXFillVolumeTexture +
+ + +

Loads a surface from another surface with color conversion.

+
+

Pointer to an interface. Specifies the destination surface, which receives the image.

+

Pointer to a structure, the destination palette of 256 colors or null.

+

Pointer to a structure. Specifies the destination rectangle. Set this parameter to null to specify the entire surface.

+

Pointer to an interface, representing the source surface.

+

Pointer to a structure, the source palette of 256 colors or null.

+

Pointer to a structure. Specifies the source rectangle. Set this parameter to null to specify the entire surface.

+

A combination of one or more , controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | .

+

value to replace with transparent black, or 0 to disable the colorkey. This is always a 32-bit ARGB color, independent of the source image format. Alpha is significant and should usually be set to FF for opaque color keys. Thus, for opaque black, the value would be equal to 0xFF000000.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

This function handles conversion to and from compressed texture formats.

Writing to a non-level-zero surface will not cause the dirty rectangle to be updated. If is called and the surface was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call AddDirtyRect on the surface.

+
+ + bb172904 + HRESULT D3DXLoadSurfaceFromSurface([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) + D3DXLoadSurfaceFromSurface +
+ + +

Loads a volume from a file in memory.

+
+

Pointer to an interface. Specifies the destination volume.

+

Pointer to a structure, the destination palette of 256 colors or null.

+

Pointer to a structure. Specifies the destination box. Set this parameter to null to specify the entire volume.

+

Pointer to the file in memory from which to load the volume.

+

Size in bytes of the file in memory.

+

Pointer to a structure. Specifies the source box. Set this parameter to null to specify the entire volume.

+

Combination of one or more , controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | .

+

value to replace with transparent black, or 0 to disable the colorkey. This is always a 32-bit ARGB color, independent of the source image format. Alpha is significant and should usually be set to FF for opaque color keys. Thus, for opaque black, the value would be equal to 0xFF000000.

+

Pointer to a structure to be filled with a description of the data in the source image file, or null.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

This function handles conversion to and from compressed texture formats and supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Writing to a non-level-zero surface of the volume texture will not cause the dirty rectangle to be updated. If is called and the texture was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call on the volume texture.

+
+ + bb172906 + HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + D3DXLoadVolumeFromFileInMemory +
+ + +

Creates an instance of an object.

+
+ No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: E_POINTER, E_OUTOFMEMORY.

+ +

After using this function, use RegisterTemplates or RegisterEnumTemplates to register templates, CreateEnumObject to create an enumerator object, or CreateSaveObject to create a save object.

+
+ + bb172830 + HRESULT D3DXFileCreate([In] ID3DXFile** lplpDirectXFile) + D3DXFileCreate +
+ + + Functions + + + + + Constant ConflictingRenderState. + D3DERR_CONFLICTINGRENDERSTATE + + + Constant ConflictingTextureFilter. + D3DERR_CONFLICTINGTEXTUREFILTER + + + Constant ConflictingTexturePalette. + D3DERR_CONFLICTINGTEXTUREPALETTE + + + Constant DeviceHung. + D3DERR_DEVICEHUNG + + + Constant DeviceLost. + D3DERR_DEVICELOST + + + Constant DeviceNotReset. + D3DERR_DEVICENOTRESET + + + Constant DeviceRemoved. + D3DERR_DEVICEREMOVED + + + Constant DriverInternalError. + D3DERR_DRIVERINTERNALERROR + + + Constant InvalidCall. + D3DERR_INVALIDCALL + + + Constant InvalidDevice. + D3DERR_INVALIDDEVICE + + + Constant MoreData. + D3DERR_MOREDATA + + + Constant NoAutomaticGeneration. + D3DOK_NOAUTOGEN + + + Constant NotAvailable. + D3DERR_NOTAVAILABLE + + + Constant NotFound. + D3DERR_NOTFOUND + + + Constant OutOfVideoMemory. + D3DERR_OUTOFVIDEOMEMORY + + + Constant PresentModeChanged. + S_PRESENT_MODE_CHANGED + + + Constant PresentOccluded. + S_PRESENT_OCCLUDED + + + Constant ResidentInSharedMemory. + S_RESIDENT_IN_SHARED_MEMORY + + + Constant Success. + D3D_OK + + + Constant TooManyOperations. + D3DERR_TOOMANYOPERATIONS + + + Constant UnsupportedAlphaArgument. + D3DERR_UNSUPPORTEDALPHAARG + + + Constant UnsupportedAlphaOperation. + D3DERR_UNSUPPORTEDALPHAOPERATION + + + Constant UnsupportedColorArgument. + D3DERR_UNSUPPORTEDCOLORARG + + + Constant UnsupportedColorOperation. + D3DERR_UNSUPPORTEDCOLOROPERATION + + + Constant UnsupportedFactorValue. + D3DERR_UNSUPPORTEDFACTORVALUE + + + Constant UnsupportedTextureFilter. + D3DERR_UNSUPPORTEDTEXTUREFILTER + + + Constant WasStillDrawing. + D3DERR_WASSTILLDRAWING + + + Constant WrongTextureFormat. + D3DERR_WRONGTEXTUREFORMAT + + + +

An application implements this interface to handle callbacks in animation sets generated by calls to .

+
+ +

The LPD3DXANIMATIONCALLBACKHANDLER type is defined as a reference to this interface.

 typedef interface  ;	
+            typedef interface  *LPD3DXANIMATIONCALLBACKHANDLER;	
+            
+
+ + bb205624 + ID3DXAnimationCallbackHandler + ID3DXAnimationCallbackHandler +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

The application implements this method. This method is called when a callback occurs for an animation set in one of the tracks during a call to .

+
+ No documentation. + No documentation. +

The return values of this method are implemented by an application programmer. In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR.

+ + bb205625 + HRESULT ID3DXAnimationCallbackHandler::HandleCallback([In] unsigned int Track,[In] void* pCallbackData) + ID3DXAnimationCallbackHandler::HandleCallback +
+ + +

This interface is used to control animation functionality, connecting animation sets with the transformation frames that are being animated. The interface has methods to mix multiple animations and to modify blending parameters over time to enable smooth transitions and other effects.

+
+ +

Create an animation controller object with .

The LPD3DXANIMATIONCONTROLLER type is defined as a reference to the interface.

 typedef interface  ;	
+            typedef interface  *LPD3DXANIMATIONCONTROLLER;	
+            

The D3DXEVENTHANDLE type is defined as an event handle to animation controller events.

 typedef DWORD D3DXEVENTHANDLE;	
+            

The LPD3DXEVENTHANDLE type is defined as a reference to an event handle to animation controller events.

 typedef D3DXEVENTHANDLE *LPD3DXEVENTHANDLE;	
+            
+
+ + bb205626 + ID3DXAnimationController + ID3DXAnimationController +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Get the maximum number of animation outputs the animation controller can support.

+
+ + bb205634 + GetMaxNumAnimationOutputs + GetMaxNumAnimationOutputs + unsigned int ID3DXAnimationController::GetMaxNumAnimationOutputs() +
+ + +

Gets the maximum number of animation sets the animation controller can support.

+
+ + bb205635 + GetMaxNumAnimationSets + GetMaxNumAnimationSets + unsigned int ID3DXAnimationController::GetMaxNumAnimationSets() +
+ + +

Gets the maximum number of tracks in the animation controller.

+
+ +

The maximum number of tracks the controller can manage.

+
+ + bb205637 + GetMaxNumTracks + GetMaxNumTracks + unsigned int ID3DXAnimationController::GetMaxNumTracks() +
+ + +

Gets the maximum number of events the animation controller can support.

+
+ + bb205636 + GetMaxNumEvents + GetMaxNumEvents + unsigned int ID3DXAnimationController::GetMaxNumEvents() +
+ + +

Returns the number of animation sets currently registered in the animation controller.

+
+ +

The controller contains any number of animations sets and tracks. Animation sets can be registered with RegisterAnimationOutput. An animation controller created by a call to will automatically register loaded animation sets.

+
+ + bb205638 + GetNumAnimationSets + GetNumAnimationSets + unsigned int ID3DXAnimationController::GetNumAnimationSets() +
+ + +

Gets the global animation time.

+
+ +

Animations are designed using a local animation time and mixed into global time with AdvanceTime.

+
+ + bb205640 + GetTime + GetTime + double ID3DXAnimationController::GetTime() +
+ + +

Gets or sets the current priority blending weight used by the animation controller.

+
+ +

The priority blending weight is used to blend high and low priority tracks together.

+
+ + bb205639 + GetPriorityBlend / SetPriorityBlend + GetPriorityBlend + float ID3DXAnimationController::GetPriorityBlend() +
+ + +

Returns an event handle to a priority blend event that is currently running.

+
+ + bb205631 + GetCurrentPriorityBlend + GetCurrentPriorityBlend + unsigned int ID3DXAnimationController::GetCurrentPriorityBlend() +
+ + +

Get the maximum number of animation outputs the animation controller can support.

+
+

The maximum number of animation outputs the controller can manage.

+ + bb205634 + unsigned int ID3DXAnimationController::GetMaxNumAnimationOutputs() + ID3DXAnimationController::GetMaxNumAnimationOutputs +
+ + +

Gets the maximum number of animation sets the animation controller can support.

+
+

The maximum number of animation sets the controller can manage.

+ + bb205635 + unsigned int ID3DXAnimationController::GetMaxNumAnimationSets() + ID3DXAnimationController::GetMaxNumAnimationSets +
+ + +

Gets the maximum number of tracks in the animation controller.

+
+

Number of tracks.

+ +

The maximum number of tracks the controller can manage.

+
+ + bb205637 + unsigned int ID3DXAnimationController::GetMaxNumTracks() + ID3DXAnimationController::GetMaxNumTracks +
+ + +

Gets the maximum number of events the animation controller can support.

+
+

The maximum number of events the controller can manage.

+ + bb205636 + unsigned int ID3DXAnimationController::GetMaxNumEvents() + ID3DXAnimationController::GetMaxNumEvents +
+ + +

Adds an animation output to the animation controller and registers references for scale, rotate, and translate (SRT) transformations.

+
+

Name of the animation output.

+

Pointer to a structure containing SRT transformation data. Can be null.

+

Pointer to a vector that describes the scale of the animation set. Can be null.

+

Pointer to a quaternion that describes the rotation of the animation set. Can be null.

+

Pointer to a vector that describes the translation of the animation set. Can be null.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ +

If the animation output is already registered, pMatrix will be filled with the input transformation data.

Animation sets created with automatically register all loaded animation sets.

+
+ + bb205650 + HRESULT ID3DXAnimationController::RegisterAnimationOutput([In] const char* pName,[In] D3DXMATRIX* pMatrix,[In] D3DXVECTOR3* pScale,[In] D3DXQUATERNION* pRotation,[In] D3DXVECTOR3* pTranslation) + ID3DXAnimationController::RegisterAnimationOutput +
+ + +

Adds an animation set to the animation controller.

+
+

Pointer to the animation set to add.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb205651 + HRESULT ID3DXAnimationController::RegisterAnimationSet([In] ID3DXAnimationSet* pAnimSet) + ID3DXAnimationController::RegisterAnimationSet +
+ + +

Removes an animation set from the animation controller.

+
+

Pointer to the animation set to remove.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , .

+ + bb205664 + HRESULT ID3DXAnimationController::UnregisterAnimationSet([In] ID3DXAnimationSet* pAnimSet) + ID3DXAnimationController::UnregisterAnimationSet +
+ + +

Returns the number of animation sets currently registered in the animation controller.

+
+

Number of animation sets.

+ +

The controller contains any number of animations sets and tracks. Animation sets can be registered with RegisterAnimationOutput. An animation controller created by a call to will automatically register loaded animation sets.

+
+ + bb205638 + unsigned int ID3DXAnimationController::GetNumAnimationSets() + ID3DXAnimationController::GetNumAnimationSets +
+ + +

Gets an animation set.

+
+

Index of the animation set.

+

Pointer to the animation set.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ +

The animation controller contains an array of animation sets. This method returns one of them at the given index.

+
+ + bb205629 + HRESULT ID3DXAnimationController::GetAnimationSet([In] unsigned int Index,[Out] ID3DXAnimationSet** ppAnimationSet) + ID3DXAnimationController::GetAnimationSet +
+ + +

Gets an animation set, given its name.

+
+

String containing the name of the animation set.

+

Pointer to the animation set.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ +

The animation controller contains an array of animation sets. This method returns an animation set that has the given name.

+
+ + bb205630 + HRESULT ID3DXAnimationController::GetAnimationSetByName([In] const char* szName,[In] ID3DXAnimationSet** ppAnimationSet) + ID3DXAnimationController::GetAnimationSetByName +
+ + +

Animates the mesh and advances the global animation time by a specified amount.

+
+

Amount, in seconds, by which to advance the global animation time. TimeDelta value must be non-negative or zero.

+

Pointer to a user-defined animation callback handler interface, .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ + bb205627 + HRESULT ID3DXAnimationController::AdvanceTime([In] double TimeDelta,[In] ID3DXAnimationCallbackHandler* pCallbackHandler) + ID3DXAnimationController::AdvanceTime +
+ + +

Resets the global animation time to zero. Any pending events will retain their original schedules, but in the new timeframe.

+
+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ +

This method is typically used when the global animation time value is nearing the maximum precision of DOUBLE storage, or 264 - 1.

+
+ + bb205652 + HRESULT ID3DXAnimationController::ResetTime() + ID3DXAnimationController::ResetTime +
+ + +

Gets the global animation time.

+
+

Returns the global animation time.

+ +

Animations are designed using a local animation time and mixed into global time with AdvanceTime.

+
+ + bb205640 + double ID3DXAnimationController::GetTime() + ID3DXAnimationController::GetTime +
+ + +

Applies the animation set to the specified track.

+
+

Identifier of the track to which the animation set is applied.

+

Pointer to the animation set to be added to the track.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ +

This method sets the animation set to the specified track for mixing. The animation set for each track is blended according to the track weight and speed when AdvanceTime is called.

+
+ + bb205654 + HRESULT ID3DXAnimationController::SetTrackAnimationSet([In] unsigned int Track,[In] ID3DXAnimationSet* pAnimSet) + ID3DXAnimationController::SetTrackAnimationSet +
+ + +

Gets the animation set for the given track.

+
+

Track identifier.

+

Pointer to the animation set for the given track.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ + bb205641 + HRESULT ID3DXAnimationController::GetTrackAnimationSet([In] unsigned int Track,[Out] ID3DXAnimationSet** ppAnimSet) + ID3DXAnimationController::GetTrackAnimationSet +
+ + +

Sets the priority blending weight for the specified animation track.

+
+

Track identifier.

+

Track priority. This parameter should be set to one of the constants from .

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb205658 + HRESULT ID3DXAnimationController::SetTrackPriority([In] unsigned int Track,[In] D3DXPRIORITY_TYPE Priority) + ID3DXAnimationController::SetTrackPriority +
+ + +

Sets the track speed. The track speed is similar to a multiplier that is used to speed up or slow down the playback of the track.

+
+

Identifier of the track to set the speed on.

+

New speed.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ + bb205659 + HRESULT ID3DXAnimationController::SetTrackSpeed([In] unsigned int Track,[In] float Speed) + ID3DXAnimationController::SetTrackSpeed +
+ + +

Sets the track weight. The weight is used to determine how to blend multiple tracks together.

+
+

Identifier of the track to set the weight on.

+

Weight value.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ + bb205660 + HRESULT ID3DXAnimationController::SetTrackWeight([In] unsigned int Track,[In] float Weight) + ID3DXAnimationController::SetTrackWeight +
+ + +

Sets the track to the specified local animation time.

+
+

Track identifier.

+

Local animation time value to assign to the track.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ + bb205657 + HRESULT ID3DXAnimationController::SetTrackPosition([In] unsigned int Track,[In] double Position) + ID3DXAnimationController::SetTrackPosition +
+ + +

Enables or disables a track in the animation controller.

+
+

Identifier of the track to be mixed.

+

Enable value. Set to TRUE to enable this track in the controller, or to to prevent it from being mixed.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ +

To mix a track with other tracks, the Enable flag must be set to TRUE. Conversely, setting the flag to will prevent the track from being mixed with other tracks.

+
+ + bb205656 + HRESULT ID3DXAnimationController::SetTrackEnable([In] unsigned int Track,[In] BOOL Enable) + ID3DXAnimationController::SetTrackEnable +
+ + +

Sets the track description.

+
+

Identifier of the track to modify.

+

Description of the track.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ + bb205655 + HRESULT ID3DXAnimationController::SetTrackDesc([In] unsigned int Track,[In] D3DXTRACK_DESC* pDesc) + ID3DXAnimationController::SetTrackDesc +
+ + +

Gets the track description.

+
+

Track identifier.

+

Pointer to the track description. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ + bb205642 + HRESULT ID3DXAnimationController::GetTrackDesc([In] unsigned int Track,[In] D3DXTRACK_DESC* pDesc) + ID3DXAnimationController::GetTrackDesc +
+ + +

Sets the priority blending weight used by the animation controller.

+
+

Priority blending weight used by the animation controller.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: .

+ +

The blend weight is used to blend high and low priority tracks together.

+
+ + bb205653 + HRESULT ID3DXAnimationController::SetPriorityBlend([In] float BlendWeight) + ID3DXAnimationController::SetPriorityBlend +
+ + +

Gets the current priority blending weight used by the animation controller.

+
+

Returns the current priority blending weight.

+ +

The priority blending weight is used to blend high and low priority tracks together.

+
+ + bb205639 + float ID3DXAnimationController::GetPriorityBlend() + ID3DXAnimationController::GetPriorityBlend +
+ + +

Sets an event key that changes the rate of play of an animation track.

+
+

Identifier of the track to modify.

+

New speed of the animation track.

+

Global time key. Specifies the global time when the change will take place.

+

Transition time, which specifies how long the smooth transition will take to complete.

+

Specifies the transition type used for transitioning between speeds. See .

+

Event handle to the priority blend event. null is returned if one or more of the input parameters is invalid, or no free event is available.

+ + bb205648 + unsigned int ID3DXAnimationController::KeyTrackSpeed([In] unsigned int Track,[In] float NewSpeed,[In] double StartTime,[In] double Duration,[In] D3DXTRANSITION_TYPE Transition) + ID3DXAnimationController::KeyTrackSpeed +
+ + +

Sets an event key that changes the weight of an animation track. The weight is used as a multiplier when combining multiple tracks together.

+
+

Identifier of the track to modify.

+

New weight of the track.

+

Global time key. Specifies the global time when the change will take place.

+

Transition time, which specifies how long the smooth transition will take to complete.

+

Specifies the transition type used for transitioning between weights. See .

+

Event handle to the priority blend event. null is returned if one or more of the input parameters is invalid, or no free event is available.

+ +

The weight is used like a multiplier to determine how much of this track to blend together with other tracks.

+
+ + bb205649 + unsigned int ID3DXAnimationController::KeyTrackWeight([In] unsigned int Track,[In] float NewWeight,[In] double StartTime,[In] double Duration,[In] D3DXTRANSITION_TYPE Transition) + ID3DXAnimationController::KeyTrackWeight +
+ + +

Sets an event key that changes the local time of an animation track.

+
+

Identifier of the track to modify.

+

New local time of the animation track.

+

Global time key. Specifies the global time when the change will take place.

+

Event handle to the priority blend event. null is returned if Track is invalid, or if no free event is available.

+ + bb205647 + unsigned int ID3DXAnimationController::KeyTrackPosition([In] unsigned int Track,[In] double NewPosition,[In] double StartTime) + ID3DXAnimationController::KeyTrackPosition +
+ + +

Sets an event key that enables or disables an animation track.

+
+

Identifier of the animation track to modify.

+

Enable flag. Set this to TRUE to enable the animation track, or to to disable the track.

+

Global time key. Specifies the global time when the change will take place.

+

Event handle to the priority blend event. null is returned if Track is invalid.

+ + bb205646 + unsigned int ID3DXAnimationController::KeyTrackEnable([In] unsigned int Track,[In] BOOL NewEnable,[In] double StartTime) + ID3DXAnimationController::KeyTrackEnable +
+ + +

Sets blending event keys for the specified animation track.

+
+

Number between 0 and 1 that is used to blend tracks together.

+

Global time to start the blend.

+

Global time duration of the blend.

+

Specifies the transition type used for the duration of the blend. See .

+

Event handle to the priority blend event. null is returned if one or more of the input parameters is invalid, or no free event is available.

+ +

The animation controller blends in three phases: low priority tracks are blended first, high priority tracks are blended second, and then the results of both are blended.

+
+ + bb205645 + unsigned int ID3DXAnimationController::KeyPriorityBlend([In] float NewBlendWeight,[In] double StartTime,[In] double Duration,[In] D3DXTRANSITION_TYPE Transition) + ID3DXAnimationController::KeyPriorityBlend +
+ + +

Removes a specified event from an animation track, preventing the execution of the event.

+
+

Event handle to the event to be removed from the animation track.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb205663 + HRESULT ID3DXAnimationController::UnkeyEvent([In] unsigned int hEvent) + ID3DXAnimationController::UnkeyEvent +
+ + +

Removes all events from a specified animation track.

+
+

Identifier of the track on which all events should be removed.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ +

This method prevents the execution of all events previously scheduled on the track, and discards all data associated with those events.

+
+ + bb205662 + HRESULT ID3DXAnimationController::UnkeyAllTrackEvents([In] unsigned int Track) + ID3DXAnimationController::UnkeyAllTrackEvents +
+ + +

Removes all scheduled priority blend events from the animation controller.

+
+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb205661 + HRESULT ID3DXAnimationController::UnkeyAllPriorityBlends() + ID3DXAnimationController::UnkeyAllPriorityBlends +
+ + +

Returns an event handle to the event currently running on the specified animation track.

+
+

Track identifier.

+

Type of event to query.

+

Event handle to the event currently running on the specified track. null is returned if no event is running on the specified track.

+ + bb205632 + unsigned int ID3DXAnimationController::GetCurrentTrackEvent([In] unsigned int Track,[In] D3DXEVENT_TYPE EventType) + ID3DXAnimationController::GetCurrentTrackEvent +
+ + +

Returns an event handle to a priority blend event that is currently running.

+
+

Event handle to the currently running priority blend event. null is returned if no priority blend event is currently running.

+ + bb205631 + unsigned int ID3DXAnimationController::GetCurrentPriorityBlend() + ID3DXAnimationController::GetCurrentPriorityBlend +
+ + +

Returns an event handle to the next event scheduled to occur after a specified event on an animation track.

+
+

Track identifier.

+

Event handle to a specified event after which to search for a following event. If set to null, then the method will return the next scheduled event.

+

Event handle to the next event scheduled to run on the specified track. null is returned if no new event is scheduled.

+ +

This method can be used iteratively to locate a desired event by repeatedly passing in null for hEvent.

Note??Do not iterate further after the method has returned null.

+
+ + bb205644 + unsigned int ID3DXAnimationController::GetUpcomingTrackEvent([In] unsigned int Track,[In] unsigned int hEvent) + ID3DXAnimationController::GetUpcomingTrackEvent +
+ + +

Returns an event handle to the next priority blend event scheduled to occur after a specified event.

+
+

Event handle to a specified event after which to search for a following priority blend event. If set to null, then the method will return the next scheduled priority blend event.

+

Event handle to the next scheduled priority blend event. null is returned if no new priority blend event is scheduled.

+ +

This method can be used iteratively to locate a desired priority blend event by repeatedly passing in null for hEvent.

Note??Do not iterate further after the method has returned null.

+
+ + bb205643 + unsigned int ID3DXAnimationController::GetUpcomingPriorityBlend([In] unsigned int hEvent) + ID3DXAnimationController::GetUpcomingPriorityBlend +
+ + +

Checks whether a specified event handle is valid and the animation event has not yet completed.

+
+

Event handle to an animation event.

+

Returns if the event handle is valid and the event has not yet completed.

Returns E_FAIL if the event handle is invalid and/or the event has completed.

+ +

The method will indicate that an event handle is valid even if the event is running but has not yet completed.

+
+ + bb205665 + HRESULT ID3DXAnimationController::ValidateEvent([In] unsigned int hEvent) + ID3DXAnimationController::ValidateEvent +
+ + +

Gets a description of a specified animation event.

+
+

Event handle to an animation event to describe.

+

Pointer to a structure that contains a description of the animation event.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb205633 + HRESULT ID3DXAnimationController::GetEventDesc([In] unsigned int hEvent,[In] D3DXEVENT_DESC* pDesc) + ID3DXAnimationController::GetEventDesc +
+ + +

Clones, or copies, an animation controller.

+
+

Maximum number of animation outputs the controller can support.

+

Maximum number of animation sets the controller can support.

+

Maximum number of tracks the controller can support.

+

Maximum number of events the controller can support.

+

Address of a reference to the cloned animation controller.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ + bb205628 + HRESULT ID3DXAnimationController::CloneAnimationController([In] unsigned int MaxNumAnimationOutputs,[In] unsigned int MaxNumAnimationSets,[In] unsigned int MaxNumTracks,[In] unsigned int MaxNumEvents,[In] ID3DXAnimationController** ppAnimController) + ID3DXAnimationController::CloneAnimationController +
+ + +

This interface encapsulates the minimum functionality required of an animation set by an animation controller. Advanced users might want to implement this interface themselves to suit their specialized needs; for most users, however, the derived and interfaces should suffice.

+
+ +

An animation set consists of animations for many nodes for the same animation.

The LPD3DXANIMATIONSET type is defined as a reference to this interface.

 typedef interface  ;	
+            typedef interface  *LPD3DXANIMATIONSET;	
+            
+
+ + bb205667 + ID3DXAnimationSet + ID3DXAnimationSet +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Gets the animation set name.

+
+ + bb205671 + GetName + GetName + const char* ID3DXAnimationSet::GetName() +
+ + +

Gets the period of the animation set.

+
+ +

The period is the range of time that the animation key frames are valid. For looping animations, this is the period of the loop. The time units that the key frames are specified in (for example, seconds) is determined by the application.

+
+ + bb205673 + GetPeriod + GetPeriod + double ID3DXAnimationSet::GetPeriod() +
+ + +

Gets the number of animations in the animation set.

+
+ + bb205672 + GetNumAnimations + GetNumAnimations + unsigned int ID3DXAnimationSet::GetNumAnimations() +
+ + +

Gets the animation set name.

+
+

Name of the animation set.

+ + bb205671 + const char* ID3DXAnimationSet::GetName() + ID3DXAnimationSet::GetName +
+ + +

Gets the period of the animation set.

+
+

Period of the animation set.

+ +

The period is the range of time that the animation key frames are valid. For looping animations, this is the period of the loop. The time units that the key frames are specified in (for example, seconds) is determined by the application.

+
+ + bb205673 + double ID3DXAnimationSet::GetPeriod() + ID3DXAnimationSet::GetPeriod +
+ + +

Returns time position in the local timeframe of an animation set.

+
+

Local time of the animation set.

+

Time position as measured in the timeframe of the animation set. This value will be bounded by the period of the animation set.

+ +

The time position returned by this method can be used as the PeriodicPosition parameter of .

+
+ + bb205674 + double ID3DXAnimationSet::GetPeriodicPosition([In] double Position) + ID3DXAnimationSet::GetPeriodicPosition +
+ + +

Gets the number of animations in the animation set.

+
+

Number of animations in the animation set.

+ + bb205672 + unsigned int ID3DXAnimationSet::GetNumAnimations() + ID3DXAnimationSet::GetNumAnimations +
+ + +

Gets the name of an animation, given its index.

+
+

Index of the animation.

+

Address of a reference to a string that receives the animation name.

+

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR.

+ + bb205669 + HRESULT ID3DXAnimationSet::GetAnimationNameByIndex([In] unsigned int Index,[In] const char** ppName) + ID3DXAnimationSet::GetAnimationNameByIndex +
+ + +

Gets the index of an animation, given its name.

+
+

Name of the animation.

+

Pointer to the animation index.

+

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR.

+ + bb205668 + HRESULT ID3DXAnimationSet::GetAnimationIndexByName([In] const char* pName,[In] unsigned int* pIndex) + ID3DXAnimationSet::GetAnimationIndexByName +
+ + +

Gets the scale, rotation, and translation values of the animation set.

+
+

Position of the animation set. The position can be obtained by calling .

+

Animation index.

+

Pointer to the vector that describes the scale of the animation set.

+

Pointer to the quaternion that describes the rotation of the animation set.

+

Pointer to the vector that describes the translation of the animation set.

+

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR.

+ + bb205675 + HRESULT ID3DXAnimationSet::GetSRT([In] double PeriodicPosition,[In] unsigned int Animation,[Out] D3DXVECTOR3* pScale,[Out] D3DXQUATERNION* pRotation,[Out] D3DXVECTOR3* pTranslation) + ID3DXAnimationSet::GetSRT +
+ + +

Gets information about a specific callback in the animation set.

+
+

Position from which to find callbacks.

+

Callback search flags. This parameter can be set to a combination of one or more flags from .

+

Pointer to the position of the callback.

+

Address of the callback data reference.

+

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR.

+ + bb205670 + HRESULT ID3DXAnimationSet::GetCallback([In] double Position,[In] unsigned int Flags,[Out] double* pCallbackPosition,[In] void** ppCallbackData) + ID3DXAnimationSet::GetCallback +
+ + +

Locks a vertex buffer and obtains a reference to the vertex buffer memory.

+
+ +

When working with vertex buffers, you are allowed to make multiple lock calls; however, you must ensure that the number of lock calls match the number of unlock calls. DrawPrimitive calls will not succeed with any outstanding lock count on any currently set vertex buffer.

+
+ + bb205749 + ID3DXBaseMesh + ID3DXBaseMesh +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Gets the fixed function vertex value.

+
+ +

This method can return 0 if the vertex format cannot be mapped directly to an FVF code. This will occur for a mesh created from a vertex declaration that doesn't have the same order and elements supported by the FVF codes.

+
+ + bb205741 + GetFVF + GetFVF + unsigned int ID3DXBaseMesh::GetFVF() +
+ + +

Gets the number of bytes per vertex.

+
+ + bb205743 + GetNumBytesPerVertex + GetNumBytesPerVertex + unsigned int ID3DXBaseMesh::GetNumBytesPerVertex() +
+ + +

Retrieves the mesh options enabled for this mesh at creation time.

+
+ + bb205746 + GetOptions + GetOptions + unsigned int ID3DXBaseMesh::GetOptions() +
+ + +

Retrieves the device associated with the mesh.

+
+ +

Calling this method will increase the internal reference count on the interface. Be sure to call when you are done using this interface or you will have a memory leak.

+
+ + bb205740 + GetDevice + GetDevice + HRESULT ID3DXBaseMesh::GetDevice([Out] IDirect3DDevice9** ppDevice) +
+ + +

Retrieves the vertex buffer associated with the mesh.

+
+ + bb205747 + GetVertexBuffer + GetVertexBuffer + HRESULT ID3DXBaseMesh::GetVertexBuffer([Out] IDirect3DVertexBuffer9** ppVB) +
+ + +

Retrieves the data in an index buffer.

+
+ + bb205742 + GetIndexBuffer + GetIndexBuffer + HRESULT ID3DXBaseMesh::GetIndexBuffer([Out] IDirect3DIndexBuffer9** ppIB) +
+ + +

Draws a subset of a mesh.

+
+

DWORD that specifies which subset of the mesh to draw. This value is used to differentiate faces in a mesh as belonging to one or more attribute groups.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

The subset that is specified by AttribId will be rendered by the method, using the primitive type, so an index buffer must be properly initialized.

An attribute table is used to identify areas of the mesh that need to be drawn with different textures, render states, materials, and so on. In addition, the application can use the attribute table to hide portions of a mesh by not drawing a given attribute identifier (AttribId) when drawing the frame.

+
+ + bb205736 + HRESULT ID3DXBaseMesh::DrawSubset([In] unsigned int AttribId) + ID3DXBaseMesh::DrawSubset +
+ + +

Retrieves the number of faces in the mesh.

+
+

Returns the number of faces in the mesh.

+ + bb205744 + unsigned int ID3DXBaseMesh::GetNumFaces() + ID3DXBaseMesh::GetNumFaces +
+ + +

Retrieves the number of vertices in the mesh.

+
+

Returns the number of vertices in the mesh.

+ + bb205745 + unsigned int ID3DXBaseMesh::GetNumVertices() + ID3DXBaseMesh::GetNumVertices +
+ + +

Gets the fixed function vertex value.

+
+

Returns the flexible vertex format (FVF) codes.

+ +

This method can return 0 if the vertex format cannot be mapped directly to an FVF code. This will occur for a mesh created from a vertex declaration that doesn't have the same order and elements supported by the FVF codes.

+
+ + bb205741 + unsigned int ID3DXBaseMesh::GetFVF() + ID3DXBaseMesh::GetFVF +
+ + +

Retrieves a declaration describing the vertices in the mesh.

+
+

Array of elements describing the vertex format of the mesh vertices. The upper limit of this declarator array is . The vertex element array ends with the D3DDECL_END macro.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

The array of elements includes the D3DDECL_END macro, which ends the declaration.

+
+ + bb205739 + HRESULT ID3DXBaseMesh::GetDeclaration([In] D3DVERTEXELEMENT9* Declaration) + ID3DXBaseMesh::GetDeclaration +
+ + +

Gets the number of bytes per vertex.

+
+

Returns the number of bytes per vertex.

+ + bb205743 + unsigned int ID3DXBaseMesh::GetNumBytesPerVertex() + ID3DXBaseMesh::GetNumBytesPerVertex +
+ + +

Retrieves the mesh options enabled for this mesh at creation time.

+
+

Returns a combination of one or more of the following flags, indicating the options enabled for this mesh at creation time.

ValueDescription
Use 32-bit indices.
Use the usage flag for vertex and index buffers.
Equivalent to specifying both and .
Use the usage flag for vertex and index buffers.
Specifying this flag causes the vertex and index buffer of the mesh to be created with flag. This is required if the mesh object is to be rendered using N-Patch enhancement.
Equivalent to specifying both and .
Use the usage flag for vertex and index buffers.
Use the usage flag for index buffers.
Use the memory class for index buffers.
Use the memory class for index buffers.
Use the usage flag for index buffers.
Equivalent to specifying both and .
Use the usage flag for vertex buffers.
Use the memory class for vertex buffers.
Use the memory class for vertex buffers.
Use the usage flag for vertex buffers.
Equivalent to specifying both and .

?

+ + bb205746 + unsigned int ID3DXBaseMesh::GetOptions() + ID3DXBaseMesh::GetOptions +
+ + +

Retrieves the device associated with the mesh.

+
+

Address of a reference to an interface, representing the Direct3D device object associated with the mesh.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

Calling this method will increase the internal reference count on the interface. Be sure to call when you are done using this interface or you will have a memory leak.

+
+ + bb205740 + HRESULT ID3DXBaseMesh::GetDevice([Out] IDirect3DDevice9** ppDevice) + ID3DXBaseMesh::GetDevice +
+ + +

Clones a mesh using a flexible vertex format (FVF) code.

+
+

A combination of one or more D3DXMESH flags specifying creation options for the mesh.

+

Combination of FVF codes, which specifies the vertex format for the vertices in the output mesh. For the values of the codes, see .

+

Pointer to an interface representing the device object associated with the mesh.

+

Address of a reference to an interface, representing the cloned mesh.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

is used to reformat and change the vertex data layout. This is done by creating a new mesh object. For example, use it to to add space for normals, texture coordinates, colors, weights, etc. that were not present before.

updates the vertex declaration with different semantic information without changing the layout of the vertex buffer. This method does not modify the contents of the vertex buffer. For example, use it to relabel a 3D texture coordinate as a binormal or tangent or vice versa.

+
+ + bb205733 + HRESULT ID3DXBaseMesh::CloneMeshFVF([In] unsigned int Options,[In] unsigned int FVF,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXMesh** ppCloneMesh) + ID3DXBaseMesh::CloneMeshFVF +
+ + +

Clones a mesh using a declarator.

+
+

A combination of one or more D3DXMESH flags specifying creation options for the mesh.

+

An array of elements, which specify the vertex format for the vertices in the output mesh.

+

Pointer to an interface, representing the device object associated with the mesh.

+

Address of a reference to an interface, representing the cloned mesh.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

is used to reformat and change the vertex data layout. This is done by creating a new mesh object. For example, use it to add space for normals, texture coordinates, colors, weights, etc. that were not present before.

updates the vertex declaration with different semantic information without changing the layout of the vertex buffer. This method does not modify the contents of the vertex buffer. For example, use it to relabel a 3D texture coordinate as a binormal or tangent or vice versa.

+
+ + bb205732 + HRESULT ID3DXBaseMesh::CloneMesh([In] unsigned int Options,[In] const D3DVERTEXELEMENT9* pDeclaration,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXMesh** ppCloneMesh) + ID3DXBaseMesh::CloneMesh +
+ + +

Retrieves the vertex buffer associated with the mesh.

+
+

Address of a reference to an interface, representing the vertex buffer object associated with the mesh.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205747 + HRESULT ID3DXBaseMesh::GetVertexBuffer([Out] IDirect3DVertexBuffer9** ppVB) + ID3DXBaseMesh::GetVertexBuffer +
+ + +

Retrieves the data in an index buffer.

+
+

Address of a reference to an interface, representing the index buffer object associated with the mesh.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205742 + HRESULT ID3DXBaseMesh::GetIndexBuffer([Out] IDirect3DIndexBuffer9** ppIB) + ID3DXBaseMesh::GetIndexBuffer +
+ + +

Locks a vertex buffer and obtains a reference to the vertex buffer memory.

+
+

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

+

VOID* reference to a buffer containing the vertex data.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

When working with vertex buffers, you are allowed to make multiple lock calls; however, you must ensure that the number of lock calls match the number of unlock calls. DrawPrimitive calls will not succeed with any outstanding lock count on any currently set vertex buffer.

+
+ + bb205749 + HRESULT ID3DXBaseMesh::LockVertexBuffer([In] unsigned int Flags,[In] void** ppData) + ID3DXBaseMesh::LockVertexBuffer +
+ + +

Unlocks a vertex buffer.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205751 + HRESULT ID3DXBaseMesh::UnlockVertexBuffer() + ID3DXBaseMesh::UnlockVertexBuffer +
+ + +

Locks an index buffer and obtains a reference to the index buffer memory.

+
+

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

+

VOID* reference to a buffer containing the index data. The count of indices in this buffer will be equal to * 3.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

When working with index buffers, you are allowed to make multiple lock calls. However, you must ensure that the number of lock calls match the number of unlock calls. DrawPrimitive calls will not succeed with any outstanding lock count on any currently set index buffer.

+
+ + bb205748 + HRESULT ID3DXBaseMesh::LockIndexBuffer([In] unsigned int Flags,[In] void** ppData) + ID3DXBaseMesh::LockIndexBuffer +
+ + +

Unlocks an index buffer.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205750 + HRESULT ID3DXBaseMesh::UnlockIndexBuffer() + ID3DXBaseMesh::UnlockIndexBuffer +
+ + +

Retrieves either an attribute table for a mesh, or the number of entries stored in an attribute table for a mesh.

+
+

Pointer to an array of structures, representing the entries in the mesh's attribute table. Specify null to retrieve the value for pAttribTableSize.

+

Pointer to either the number of entries stored in pAttribTable or a value to be filled in with the number of entries stored in the attribute table for the mesh.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

An attribute table is created by and passing for the Flags parameter.

An attribute table is used to identify areas of the mesh that need to be drawn with different textures, render states, materials, and so on. In addition, the application can use the attribute table to hide portions of a mesh by not drawing a given attribute identifier when drawing the frame.

+
+ + bb205738 + HRESULT ID3DXBaseMesh::GetAttributeTable([Out] D3DXATTRIBUTERANGE* pAttribTable,[Out] unsigned int* pAttribTableSize) + ID3DXBaseMesh::GetAttributeTable +
+ + +

Converts point representative data to mesh adjacency information.

+
+

Pointer to an array of one DWORD per vertex of the mesh that contains point representative data. This parameter is optional. Supplying a null value will cause this parameter to be interpreted as an "identity" array.

+

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh. The number of bytes in this array must be at least 3 * * sizeof(DWORD).

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ + bb205735 + HRESULT ID3DXBaseMesh::ConvertPointRepsToAdjacency([In] const unsigned int* pPRep,[In] unsigned int* pAdjacency) + ID3DXBaseMesh::ConvertPointRepsToAdjacency +
+ + +

Converts mesh adjacency information to an array of point representatives.

+
+

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh. The number of bytes in this array must be at least 3 * * sizeof(DWORD).

+

Pointer to an array of one DWORD per vertex of the mesh that will be filled with point representative data.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ + bb205734 + HRESULT ID3DXBaseMesh::ConvertAdjacencyToPointReps([In] const unsigned int* pAdjacency,[In] unsigned int* pPRep) + ID3DXBaseMesh::ConvertAdjacencyToPointReps +
+ + +

Generate a list of mesh edges, as well as a list of faces that share each edge.

+
+

Specifies that vertices that differ in position by less than epsilon should be treated as coincident.

+

Pointer to an array of three DWORDs per face to be filled with the indices of adjacent faces. The number of bytes in this array must be at least 3 * * sizeof(DWORD).

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

After an application generates adjacency information for a mesh, the mesh data can be optimized for better drawing performance.

The order of the entries in the adjacency buffer is determined by the order of the vertex indices in the index buffer. The adjacent triangle 0 always corresponds to the edge between the indices of the corners 0 and 1. The adjacent triangle 1 always corresponds to the edge between the indices of the corners 1 and 2 while the adjacent triangle 2 corresponds to the edge between the indices of the corners 2 and 0.

+
+ + bb205737 + HRESULT ID3DXBaseMesh::GenerateAdjacency([In] float Epsilon,[In] unsigned int* pAdjacency) + ID3DXBaseMesh::GenerateAdjacency +
+ + +

This method allows the user to change the mesh declaration without changing the data layout of the vertex buffer. The call is valid only if the old and new declaration formats have the same vertex size.

+
+

An array of elements, describing the vertex format of the mesh vertices. The upper limit of this declarator array is .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

is used to reformat and change the vertex data layout. For example, use it to to add space for normals, texture coordinates, colors, weights, etc. that were not present before.

is a method for updating the vertex declaration with different semantic information, without changing the layout of the vertex buffer. For example, use it to relabel a 3D texture coordinate as a binormal or tangent, or vice versa.

+
+ + bb205752 + HRESULT ID3DXBaseMesh::UpdateSemantics([In] D3DVERTEXELEMENT9* Declaration) + ID3DXBaseMesh::UpdateSemantics +
+ + +

An application uses the methods of this interface to implement a key frame animation set stored in a compressed data format.

+
+ +

Create a compressed-format key frame animation set with .

The LPD3DXCOMPRESSEDANIMATIONSET type is defined as a reference to this interface.

 typedef interface  ;	
+            typedef interface  *LPD3DXCOMPRESSEDANIMATIONSET;	
+            
+
+ + bb205756 + ID3DXCompressedAnimationSet + ID3DXCompressedAnimationSet +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Gets the type of the animation set playback loop.

+
+ + bb205760 + GetPlaybackType + GetPlaybackType + D3DXPLAYBACK_TYPE ID3DXCompressedAnimationSet::GetPlaybackType() +
+ + +

Gets the number of animation key frame ticks that occur per second.

+
+ + bb205761 + GetSourceTicksPerSecond + GetSourceTicksPerSecond + double ID3DXCompressedAnimationSet::GetSourceTicksPerSecond() +
+ + +

Gets the data buffer that stores compressed key frame animation data.

+
+ + bb205758 + GetCompressedData + GetCompressedData + HRESULT ID3DXCompressedAnimationSet::GetCompressedData([Out] ID3DXBuffer** ppCompressedData) +
+ + +

Gets the number of callback keys in the animation set.

+
+ + bb205759 + GetNumCallbackKeys + GetNumCallbackKeys + unsigned int ID3DXCompressedAnimationSet::GetNumCallbackKeys() +
+ + +

Gets the type of the animation set playback loop.

+
+

Type of the animation set playback loop. See .

+ + bb205760 + D3DXPLAYBACK_TYPE ID3DXCompressedAnimationSet::GetPlaybackType() + ID3DXCompressedAnimationSet::GetPlaybackType +
+ + +

Gets the number of animation key frame ticks that occur per second.

+
+

Number of animation key frame ticks that occur per second.

+ + bb205761 + double ID3DXCompressedAnimationSet::GetSourceTicksPerSecond() + ID3DXCompressedAnimationSet::GetSourceTicksPerSecond +
+ + +

Gets the data buffer that stores compressed key frame animation data.

+
+

Address of a reference to the data buffer that receives compressed key frame animation data.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb205758 + HRESULT ID3DXCompressedAnimationSet::GetCompressedData([Out] ID3DXBuffer** ppCompressedData) + ID3DXCompressedAnimationSet::GetCompressedData +
+ + +

Gets the number of callback keys in the animation set.

+
+

Number of callback keys in the animation set.

+ + bb205759 + unsigned int ID3DXCompressedAnimationSet::GetNumCallbackKeys() + ID3DXCompressedAnimationSet::GetNumCallbackKeys +
+ + +

Fills an array with callback key data used for key frame animation.

+
+

Pointer to a user-allocated array of structures that the method is to fill with callback data.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb205757 + HRESULT ID3DXCompressedAnimationSet::GetCallbackKeys([In] D3DXKEY_CALLBACK* pCallbackKeys) + ID3DXCompressedAnimationSet::GetCallbackKeys +
+ + +

This is a user-implemented interface that allows a user to set the device state from an effect. Each of the methods in this interface must be implemented by the user and will then be used as callbacks to the application when either of the following occur:

  • An effect calls .
  • Effect state is dynamically updated by calling the appropriate state change API. See individual method pages for details.

When an application uses the state manager to implement custom callbacks, an effect no longer automatically saves and restores state when calling and . Because the application has implemented a custom save and restore behavior in the callbacks, this automatic behavior is bypassed.

+
+ +

A user creates an interface by implementing a class that derives from this interface, and implementing all the interface methods. Once the interface is created, you can get or set the state manager within an effect using and .

The LPD3DXEFFECTSTATEMANAGER type is defined as a reference to this interface.

 typedef interface  ;	
+            typedef interface  *LPD3DXEFFECTSTATEMANAGER;	
+            
+
+ + bb205795 + ID3DXEffectStateManager + ID3DXEffectStateManager +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

A callback function that must be implemented by a user to set material state.

+
+ + bb205799 + SetMaterial + SetMaterial + HRESULT ID3DXEffectStateManager::SetMaterial([In] const D3DMATERIAL9* pMaterial) +
+ + +

A callback function that must be implemented by a user to set the number of subdivision segments for N-patches.

+
+ + bb205800 + SetNPatchMode + SetNPatchMode + HRESULT ID3DXEffectStateManager::SetNPatchMode([In] float NumSegments) +
+ + +

A callback function that must be implemented by a user to set a FVF code.

+
+ + bb205797 + SetFVF + SetFVF + HRESULT ID3DXEffectStateManager::SetFVF([In] D3DFVF FVF) +
+ + +

A callback function that must be implemented by a user to set a vertex shader.

+
+ + bb205810 + SetVertexShader + SetVertexShader + HRESULT ID3DXEffectStateManager::SetVertexShader([In] IDirect3DVertexShader9* pShader) +
+ + +

A callback function that must be implemented by a user to set a pixel shader.

+
+ + bb205801 + SetPixelShader + SetPixelShader + HRESULT ID3DXEffectStateManager::SetPixelShader([In] IDirect3DPixelShader9* pShader) +
+ + +

A callback function that must be implemented by a user to set a transform.

+
+

The type of transform to apply the matrix to. See .

+

A transformation matrix. See .

+

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
+ + bb205809 + HRESULT ID3DXEffectStateManager::SetTransform([In] D3DTRANSFORMSTATETYPE State,[In] const D3DMATRIX* pMatrix) + ID3DXEffectStateManager::SetTransform +
+ + +

A callback function that must be implemented by a user to set material state.

+
+

A reference to the material state. See .

+

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
+ + bb205799 + HRESULT ID3DXEffectStateManager::SetMaterial([In] const D3DMATERIAL9* pMaterial) + ID3DXEffectStateManager::SetMaterial +
+ + +

A callback function that must be implemented by a user to set a light.

+
+

The zero-based index of the light. This is the same index in .

+

The light object. See .

+

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
+ + bb205798 + HRESULT ID3DXEffectStateManager::SetLight([In] unsigned int Index,[In] const D3DLIGHT9* pLight) + ID3DXEffectStateManager::SetLight +
+ + +

A callback function that must be implemented by a user to enable/disable a light.

+
+

The zero-based index of the light. This is the same index in .

+

True to enable the light, false otherwise.

+

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
+ + bb205796 + HRESULT ID3DXEffectStateManager::LightEnable([In] unsigned int Index,[In] BOOL Enable) + ID3DXEffectStateManager::LightEnable +
+ + +

A callback function that must be implemented by a user to set render state.

+
+

The render state to set.

+

The render state value. See Effect States (Direct3D 9).

+

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
+ + bb205805 + HRESULT ID3DXEffectStateManager::SetRenderState([In] D3DRENDERSTATETYPE State,[In] unsigned int Value) + ID3DXEffectStateManager::SetRenderState +
+ + +

A callback function that must be implemented by a user to set a texture.

+
+

The stage to which the texture is assigned. This is the index value in or .

+

A reference to the texture object. This can be any of the Direct3D texture types (cube, volume, etc.). See .

+

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
+ + bb205807 + HRESULT ID3DXEffectStateManager::SetTexture([In] unsigned int Stage,[In] IDirect3DBaseTexture9* pTexture) + ID3DXEffectStateManager::SetTexture +
+ + +

A callback function that must be implemented by a user to set the texture stage state.

+
+

The stage that the texture is assigned to. This is the index value in or .

+

Defines the type of operation that a texture stage will perform. See .

+

Can be either an operation () or an argument value (), depending on what is chosen for Type.

+

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
+ + bb205808 + HRESULT ID3DXEffectStateManager::SetTextureStageState([In] unsigned int Stage,[In] D3DTEXTURESTAGESTATETYPE Type,[In] unsigned int Value) + ID3DXEffectStateManager::SetTextureStageState +
+ + +

A callback function that must be implemented by a user to set a sampler.

+
+

The zero-based sampler number.

+

Identifies sampler state, which can specify the filtering, addressing, or the border color. See .

+

A value from one of the sampler state types in Type.

+

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
+ + bb205806 + HRESULT ID3DXEffectStateManager::SetSamplerState([In] unsigned int Sampler,[In] D3DSAMPLERSTATETYPE Type,[In] unsigned int Value) + ID3DXEffectStateManager::SetSamplerState +
+ + +

A callback function that must be implemented by a user to set the number of subdivision segments for N-patches.

+
+

Break the surface into this number of subdivisions. This is the same as the number used by .

+

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
+ + bb205800 + HRESULT ID3DXEffectStateManager::SetNPatchMode([In] float NumSegments) + ID3DXEffectStateManager::SetNPatchMode +
+ + +

A callback function that must be implemented by a user to set a FVF code.

+
+

The FVF constant, that determines how to interpret vertex data. See .

+

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
+ + bb205797 + HRESULT ID3DXEffectStateManager::SetFVF([In] D3DFVF FVF) + ID3DXEffectStateManager::SetFVF +
+ + +

A callback function that must be implemented by a user to set a vertex shader.

+
+

A reference to a vertex shader object. See .

+

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
+ + bb205810 + HRESULT ID3DXEffectStateManager::SetVertexShader([In] IDirect3DVertexShader9* pShader) + ID3DXEffectStateManager::SetVertexShader +
+ + +

A callback function that must be implemented by a user to set an array of vertex shader floating-point constants.

+
+

The zero-based index of the first constant register.

+

An array of floating-point constants.

+

The number of registers in pConstantData.

+

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
+ + bb205812 + HRESULT ID3DXEffectStateManager::SetVertexShaderConstantF([In] unsigned int RegisterIndex,[In] const float* pConstantData,[In] unsigned int RegisterCount) + ID3DXEffectStateManager::SetVertexShaderConstantF +
+ + +

A callback function that must be implemented by a user to set an array of vertex shader integer constants.

+
+

The zero-based index of the first constant register.

+

An array of integer constants.

+

The number of registers in pConstantData.

+

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
+ + bb205813 + HRESULT ID3DXEffectStateManager::SetVertexShaderConstantI([In] unsigned int RegisterIndex,[In] const int* pConstantData,[In] unsigned int RegisterCount) + ID3DXEffectStateManager::SetVertexShaderConstantI +
+ + +

A callback function that must be implemented by a user to set an array of vertex shader Boolean constants.

+
+

The zero-based index of the first constant register.

+

An array of Boolean constants.

+

The number of registers in pConstantData.

+

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
+ + bb205811 + HRESULT ID3DXEffectStateManager::SetVertexShaderConstantB([In] unsigned int RegisterIndex,[In] const BOOL* pConstantData,[In] unsigned int RegisterCount) + ID3DXEffectStateManager::SetVertexShaderConstantB +
+ + +

A callback function that must be implemented by a user to set a pixel shader.

+
+

A reference to a pixel shader object. See .

+

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
+ + bb205801 + HRESULT ID3DXEffectStateManager::SetPixelShader([In] IDirect3DPixelShader9* pShader) + ID3DXEffectStateManager::SetPixelShader +
+ + +

A callback function that must be implemented by a user to set an array of vertex shader floating-point constants.

+
+

The zero-based index of the first constant register.

+

An array of floating-point constants.

+

The number of registers in pConstantData.

+

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
+ + bb205803 + HRESULT ID3DXEffectStateManager::SetPixelShaderConstantF([In] unsigned int RegisterIndex,[In] const float* pConstantData,[In] unsigned int RegisterCount) + ID3DXEffectStateManager::SetPixelShaderConstantF +
+ + +

A callback function that must be implemented by a user to set an array of vertex shader integer constants.

+
+

The zero-based index of the first constant register.

+

An array of integer constants.

+

The number of registers in pConstantData.

+

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
+ + bb205804 + HRESULT ID3DXEffectStateManager::SetPixelShaderConstantI([In] unsigned int RegisterIndex,[In] const int* pConstantData,[In] unsigned int RegisterCount) + ID3DXEffectStateManager::SetPixelShaderConstantI +
+ + +

A callback function that must be implemented by a user to set an array of vertex shader Boolean constants.

+
+

The zero-based index of the first constant register.

+

An array of Boolean constants.

+

The number of registers in pConstantData.

+

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
+ + bb205802 + HRESULT ID3DXEffectStateManager::SetPixelShaderConstantB([In] unsigned int RegisterIndex,[In] const BOOL* pConstantData,[In] unsigned int RegisterCount) + ID3DXEffectStateManager::SetPixelShaderConstantB +
+ + +

This interface is implemented by the application to allocate or free frame and mesh container objects. Methods on this are called during loading and destroying frame hierarchies.

+
+ +

The LPD3DXALLOCATEHIERARCHY type is defined as a reference to this interface.

 typedef interface  ;	
+            typedef interface  *LPD3DXALLOCATEHIERARCHY;	
+            
+
+ + bb205619 + ID3DXAllocateHierarchy + ID3DXAllocateHierarchy +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Requests allocation of a frame object.

+
+

Name of the frame to be created.

+

Returns the created frame object.

+

The return values of this method are implemented by an application programmer. In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

+ + bb205620 + HRESULT ID3DXAllocateHierarchy::CreateFrame([In] const char* Name,[In] D3DXFRAME** ppNewFrame) + ID3DXAllocateHierarchy::CreateFrame +
+ + +

Requests allocation of a mesh container object.

+
+

Name of the mesh.

+

Pointer to the mesh data structure. See .

+

Array of materials used in the mesh.

+

Array of effect instances used in the mesh. See .

+

Number of materials in the materials array.

+

Adjacency array for the mesh.

+

Pointer to the skin mesh object if skin data is found. See .

+

Returns the created mesh container. See .

+

The return values of this method are implemented by an application programmer. In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

+ + bb205621 + HRESULT ID3DXAllocateHierarchy::CreateMeshContainer([In] const char* Name,[In] const D3DXMESHDATA* pMeshData,[In] const D3DXMATERIAL* pMaterials,[In] const D3DXEFFECTINSTANCE* pEffectInstances,[In] unsigned int NumMaterials,[In] const unsigned int* pAdjacency,[In] ID3DXSkinInfo* pSkinInfo,[In] D3DXMESHCONTAINER** ppNewMeshContainer) + ID3DXAllocateHierarchy::CreateMeshContainer +
+ + +

Requests deallocation of a frame object.

+
+

Pointer to the frame to be deallocated.

+

The return values of this method are implemented by an application programmer. In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

+ + bb205622 + HRESULT ID3DXAllocateHierarchy::DestroyFrame([In] D3DXFRAME* pFrameToFree) + ID3DXAllocateHierarchy::DestroyFrame +
+ + +

Requests deallocation of a mesh container object.

+
+

Pointer to the mesh container object to be deallocated.

+

The return values of this method are implemented by an application programmer. In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

+ + bb205623 + HRESULT ID3DXAllocateHierarchy::DestroyMeshContainer([In] D3DXMESHCONTAINER* pMeshContainerToFree) + ID3DXAllocateHierarchy::DestroyMeshContainer +
+ + +

This interface is implemented by the application to save any additional user data embedded in .x files. An instance of this interface is passed to , and D3DX calls the appropriate method on this interface every time the appropriate data is encountered. For example, for each frame object in the .x file, is called and passed the child data.

+
+ +

The LPD3DXLOADUSERDATA type is defined as a reference to this interface.

 typedef interface  ;	
+            typedef interface  *LPD3DXLOADUSERDATA;	
+            
+
+ + bb174034 + ID3DXLoadUserData + ID3DXLoadUserData +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Load top level data from a .x file.

+
+

Pointer to a .x file data structure. This is defined in Dxfile.h.

+

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

+ + bb174037 + HRESULT ID3DXLoadUserData::LoadTopLevelData([In] ID3DXFileData* pXofChildData) + ID3DXLoadUserData::LoadTopLevelData +
+ + +

Load frame child data from a .x file.

+
+

Pointer to a mesh container. See .

+

Pointer to a .x file data structure. This is defined in Dxfile.h.

+

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

+ + bb174035 + HRESULT ID3DXLoadUserData::LoadFrameChildData([In] D3DXFRAME* pFrame,[In] ID3DXFileData* pXofChildData) + ID3DXLoadUserData::LoadFrameChildData +
+ + +

Load mesh child data from a .x file.

+
+

Pointer to a mesh container. See .

+

Pointer to a .x file data structure. This is defined in Dxfile.h.

+

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

+ + bb174036 + HRESULT ID3DXLoadUserData::LoadMeshChildData([In] D3DXMESHCONTAINER* pMeshContainer,[In] ID3DXFileData* pXofChildData) + ID3DXLoadUserData::LoadMeshChildData +
+ + +

is a user-implemented interface to provide callbacks for #include directives during shader compilation. Each of the methods in this interface must be implemented by the user which will then be used as callbacks to the application when one of the following occurs:

  • An HLSL shader that contains a #include is compiled by calling one of the *** functions.
  • An assembly shader #include is assembled by calling any of the *** functions.
  • An effect that contains a #include is compiled by by calling any of the *** or *** functions.
+
+ +

A user creates an interface by implementing a class that derives from this interface, and implementing all the interface methods.

The LPD3DXINCLUDE type is defined as a reference to this interface.

 typedef interface  ;	
+            typedef interface  *LPD3DXINCLUDE;	
+            
+
+ + bb173986 + ID3DXInclude + ID3DXInclude +
+ + + A user-implemented method for opening and reading the contents of a shader #include file. + + A -typed value that indicates the location of the #include file. + Name of the #include file. + Pointer to the container that includes the #include file. + Stream that is associated with fileName to be read. This reference remains valid until is called. + HRESULT Open([None] D3D_INCLUDE_TYPE IncludeType,[None] const char* pFileName,[None] LPCVOID pParentData,[None] LPCVOID* ppData,[None] UINT* pBytes) + + + + A user-implemented method for closing a shader #include file. + + + If was successful, Close is guaranteed to be called before the API using the interface returns. + + This is a reference that was returned by the corresponding call. + HRESULT Close([None] LPCVOID pData) + + + +

Applications use the methods of the interface to manipulate an index buffer resource.

+
+ +

The interface is obtained by calling the method.

This interface inherits additional functionality from the interface.

This interface, like all COM interfaces, inherits from the interface.

The LPDIRECT3DINDEXBUFFER9 and PDIRECT3DINDEXBUFFER9 types are defined as references to the interface.

 typedef struct  *LPDIRECT3DINDEXBUFFER9, *PDIRECT3DINDEXBUFFER9;	
+            
+
+ + bb205865 + IDirect3DIndexBuffer9 + IDirect3DIndexBuffer9 +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Retrieves a description of the index buffer resource.

+
+ + bb205866 + GetDesc + GetDesc + HRESULT IDirect3DIndexBuffer9::GetDesc([Out] D3DINDEXBUFFER_DESC* pDesc) +
+ + +

Locks a range of index data and obtains a reference to the index buffer memory.

+
+

Offset into the index data to lock, in bytes. Lock the entire index buffer by specifying 0 for both parameters, SizeToLock and OffsetToLock.

+

Size of the index data to lock, in bytes. Lock the entire index buffer by specifying 0 for both parameters, SizeToLock and OffsetToLock.

+

VOID* reference to a memory buffer containing the returned index data.

+

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

As a general rule, do not hold a lock across more than one frame. When working with index buffers, you are allowed to make multiple lock calls. However, you must ensure that the number of lock calls match the number of unlock calls. calls will not succeed with any outstanding lock count on any currently set index buffer.

The and flags are valid only on buffers created with .

See Programming Tips (Direct3D 9) for information about using or .

+
+ + bb205867 + HRESULT IDirect3DIndexBuffer9::Lock([In] unsigned int OffsetToLock,[In] unsigned int SizeToLock,[Out] void** ppbData,[In] D3DLOCK Flags) + IDirect3DIndexBuffer9::Lock +
+ + +

Unlocks index data.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205868 + HRESULT IDirect3DIndexBuffer9::Unlock() + IDirect3DIndexBuffer9::Unlock +
+ + +

Retrieves a description of the index buffer resource.

+
+

Pointer to a structure, describing the returned index buffer.

+

If the method succeeds, the return value is . is returned if the argument is invalid.

+ + bb205866 + HRESULT IDirect3DIndexBuffer9::GetDesc([Out] D3DINDEXBUFFER_DESC* pDesc) + IDirect3DIndexBuffer9::GetDesc +
+ + + Initializes a new instance of the class. + + The device. + The size in bytes. + The usage. + The pool. + if set to true use 16bit index buffer, otherwise, use 32bit index buffer. + bb174357 + HRESULT IDirect3DDevice9::CreateIndexBuffer([In] unsigned int Length,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DIndexBuffer9** ppIndexBuffer,[In] void** pSharedHandle) + IDirect3DDevice9::CreateIndexBuffer + + + + Initializes a new instance of the class. + + The device. + The size in bytes. + The usage. + The pool. + if set to true use 16bit index buffer, otherwise, use 32bit index buffer. + The shared handle. + bb174357 + HRESULT IDirect3DDevice9::CreateIndexBuffer([In] unsigned int Length,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DIndexBuffer9** ppIndexBuffer,[In] void** pSharedHandle) + IDirect3DDevice9::CreateIndexBuffer + + + + Locks the specified index buffer. + + The offset in the buffer. + The size of the buffer to lock. + The lock flags. + A containing the locked index buffer. + bb205867 + HRESULT IDirect3DIndexBuffer9::Lock([In] unsigned int OffsetToLock,[In] unsigned int SizeToLock,[Out] void** ppbData,[In] D3DLOCK Flags) + IDirect3DIndexBuffer9::Lock + + + + Locks the specified index buffer. + + The offset in the buffer. + The size of the buffer to lock. + The lock flags. + A containing the locked index buffer. + bb205867 + HRESULT IDirect3DIndexBuffer9::Lock([In] unsigned int OffsetToLock,[In] unsigned int SizeToLock,[Out] void** ppbData,[In] D3DLOCK Flags) + IDirect3DIndexBuffer9::Lock + + + +

This interface is implemented by the application to save any additional user data embedded in .x files. An instance of this interface is passed to , and D3DX calls the appropriate method on this interface every time the appropriate data is encountered. For example, for each frame object in the .x file, is called and passed the child data.

+
+ +

The LPD3DXSAVEUSERDATA type is defined as a reference to this interface.

 typedef interface  ;	
+            typedef interface  *LPD3DXSAVEUSERDATA;	
+            
+
+ + bb174199 + ID3DXSaveUserData + ID3DXSaveUserData +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Add child data to the frame.

+
+

Pointer to a mesh container. See .

+

Pointer to a .x file save object. Use the reference to call to add a child data object. Do not save the data with .

+

Pointer to a .x file data node. Use the reference to call to add a child data object.

+

The return values of this method are implemented by an application programmer. In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

+ +

and provide a mechanism for adding a template to a .x file for saving user data.

+
+ + bb174200 + HRESULT ID3DXSaveUserData::AddFrameChildData([In] const D3DXFRAME* pFrame,[In] ID3DXFileSaveObject* pXofSave,[In] ID3DXFileSaveData* pXofFrameData) + ID3DXSaveUserData::AddFrameChildData +
+ + +

Add child data to the mesh.

+
+

Pointer to a mesh container. See .

+

Pointer to a .x file save object. Use the reference to call to add a child data object. Do not save the data with .

+

Pointer to a .x file data node. Use the reference to call to add a child data object.

+

The return values of this method are implemented by an application programmer. In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

+ + bb174201 + HRESULT ID3DXSaveUserData::AddMeshChildData([In] const D3DXMESHCONTAINER* pMeshContainer,[In] ID3DXFileSaveObject* pXofSave,[In] ID3DXFileSaveData* pXofMeshData) + ID3DXSaveUserData::AddMeshChildData +
+ + +

Add a top level object before the frame hierarchy.

+
+

Pointer to a .x file save object. Use this reference to call IDirectXFileSaveObject::CreateDataObject to create the data object to be saved. Then call IDirectXFileSaveObject::SaveData to save the data.

+

The return values of this method are implemented by an application programmer. In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

+ + bb174203 + HRESULT ID3DXSaveUserData::AddTopLevelDataObjectsPre([In] ID3DXFileSaveObject* pXofSave) + ID3DXSaveUserData::AddTopLevelDataObjectsPre +
+ + +

Add a top level object after the frame hierarchy.

+
+

Pointer to a .x file save object. Use this reference to call IDirectXFileSaveObject::CreateDataObject to create the data object to be saved. Then call IDirectXFileSaveObject::SaveData to save the data.

+

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

+ + bb174202 + HRESULT ID3DXSaveUserData::AddTopLevelDataObjectsPost([In] ID3DXFileSaveObject* pXofSave) + ID3DXSaveUserData::AddTopLevelDataObjectsPost +
+ + +

A callback for the user to register a .x file template.

+
+

Use this reference to register user-defined .x file templates. See . Do not use this parameter to add data objects.

+

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

+ +

and provide a mechanism for adding a template to a .x file for saving user data.

+
+ + bb174204 + HRESULT ID3DXSaveUserData::RegisterTemplates([In] ID3DXFile* pXFileApi) + ID3DXSaveUserData::RegisterTemplates +
+ + +

A callback for the user to save a .x file template.

+
+

Pointer to a .x file save object. Do not use this parameter to add data objects. See .

+

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

+ +

and provide a mechanism for adding a template to a .x file for saving user data.

+
+ + bb174205 + HRESULT ID3DXSaveUserData::SaveTemplates([In] ID3DXFileSaveObject* pXofSave) + ID3DXSaveUserData::SaveTemplates +
+ + +

An application uses the methods of this interface to implement a key frame animation set.

+
+ +

Create a keyframed animation set with .

The LPD3DXKEYFRAMEDANIMATIONSET type is defined as a reference to this interface.

 typedef interface  ;	
+            typedef interface  *LPD3DXKEYFRAMEDANIMATIONSET;	
+            
+
+ + bb173989 + ID3DXKeyframedAnimationSet + ID3DXKeyframedAnimationSet +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Gets the type of the animation set playback loop.

+
+ + bb173997 + GetPlaybackType + GetPlaybackType + D3DXPLAYBACK_TYPE ID3DXKeyframedAnimationSet::GetPlaybackType() +
+ + +

Gets the number of animation key frame ticks that occur per second.

+
+ + bb174004 + GetSourceTicksPerSecond + GetSourceTicksPerSecond + double ID3DXKeyframedAnimationSet::GetSourceTicksPerSecond() +
+ + +

Gets the number of callback keys in the animation set.

+
+ + bb173993 + GetNumCallbackKeys + GetNumCallbackKeys + unsigned int ID3DXKeyframedAnimationSet::GetNumCallbackKeys() +
+ + +

Gets the type of the animation set playback loop.

+
+

Type of the animation set playback loop. See .

+ + bb173997 + D3DXPLAYBACK_TYPE ID3DXKeyframedAnimationSet::GetPlaybackType() + ID3DXKeyframedAnimationSet::GetPlaybackType +
+ + +

Gets the number of animation key frame ticks that occur per second.

+
+

Number of animation key frame ticks that occur per second.

+ + bb174004 + double ID3DXKeyframedAnimationSet::GetSourceTicksPerSecond() + ID3DXKeyframedAnimationSet::GetSourceTicksPerSecond +
+ + +

Gets the number of scale keys in the specified key frame animation.

+
+

Animation index.

+

Number of scale keys in the specified key frame animation.

+ + bb173995 + unsigned int ID3DXKeyframedAnimationSet::GetNumScaleKeys([In] unsigned int Animation) + ID3DXKeyframedAnimationSet::GetNumScaleKeys +
+ + +

Fills an array with scale key data used for key frame animation.

+
+

Animation index.

+

Pointer to a user-allocated array of vectors that the method is to fill with animation scale data.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb174003 + HRESULT ID3DXKeyframedAnimationSet::GetScaleKeys([In] unsigned int Animation,[In] D3DXKEY_VECTOR3* pScaleKeys) + ID3DXKeyframedAnimationSet::GetScaleKeys +
+ + +

Get scale information for a specific key frame in the animation set.

+
+

Animation index.

+

Key frame.

+

Pointer to the scale data. See .

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb174002 + HRESULT ID3DXKeyframedAnimationSet::GetScaleKey([In] unsigned int Animation,[In] unsigned int Key,[In] D3DXKEY_VECTOR3* pScaleKey) + ID3DXKeyframedAnimationSet::GetScaleKey +
+ + +

Set scale information for a specific key frame in the animation set.

+
+

Animation index.

+

Key frame.

+

Pointer to the scale data. See .

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb174010 + HRESULT ID3DXKeyframedAnimationSet::SetScaleKey([In] unsigned int Animation,[In] unsigned int Key,[In] D3DXKEY_VECTOR3* pScaleKey) + ID3DXKeyframedAnimationSet::SetScaleKey +
+ + +

Gets the number of rotation keys in the specified key frame animation.

+
+

Animation index.

+

Number of rotation keys in the specified key frame animation.

+ + bb173994 + unsigned int ID3DXKeyframedAnimationSet::GetNumRotationKeys([In] unsigned int Animation) + ID3DXKeyframedAnimationSet::GetNumRotationKeys +
+ + +

Fills an array with rotational key data used for key frame animation.

+
+

Animation index.

+

Pointer to a user-allocated array of quaternions that the method is to fill with animation rotation data.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb174001 + HRESULT ID3DXKeyframedAnimationSet::GetRotationKeys([In] unsigned int Animation,[In] D3DXKEY_QUATERNION* pRotationKeys) + ID3DXKeyframedAnimationSet::GetRotationKeys +
+ + +

Get rotation information for a specific key frame in the animation set.

+
+

Animation index.

+

Key frame.

+

Pointer to the rotation data. See .

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb173998 + HRESULT ID3DXKeyframedAnimationSet::GetRotationKey([In] unsigned int Animation,[In] unsigned int Key,[In] D3DXKEY_QUATERNION* pRotationKey) + ID3DXKeyframedAnimationSet::GetRotationKey +
+ + +

Set rotation information for a specific key frame in the animation set.

+
+

Animation index.

+

Key frame.

+

Pointer to the rotation data. See .

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb174009 + HRESULT ID3DXKeyframedAnimationSet::SetRotationKey([In] unsigned int Animation,[In] unsigned int Key,[In] D3DXKEY_QUATERNION* pRotationKey) + ID3DXKeyframedAnimationSet::SetRotationKey +
+ + +

Gets the number of translation keys in the specified key frame animation.

+
+

Animation index.

+

Number of translation keys in the specified key frame animation.

+ + bb173996 + unsigned int ID3DXKeyframedAnimationSet::GetNumTranslationKeys([In] unsigned int Animation) + ID3DXKeyframedAnimationSet::GetNumTranslationKeys +
+ + +

Fills an array with translational key data used for key frame animation.

+
+

Animation index.

+

Pointer to a user-allocated array of vectors that the method is to fill with animation translation data.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb174006 + HRESULT ID3DXKeyframedAnimationSet::GetTranslationKeys([In] unsigned int Animation,[In] D3DXKEY_VECTOR3* pTranslationKeys) + ID3DXKeyframedAnimationSet::GetTranslationKeys +
+ + +

Get translation information for a specific key frame in the animation set.

+
+

Animation index.

+

Key Frame.

+

Pointer to the rotation information. See .

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb174005 + HRESULT ID3DXKeyframedAnimationSet::GetTranslationKey([In] unsigned int Animation,[In] unsigned int Key,[In] D3DXKEY_VECTOR3* pTranslationKey) + ID3DXKeyframedAnimationSet::GetTranslationKey +
+ + +

Set translation information for a specific key frame in the animation set.

+
+

Animation index.

+

Key Frame.

+

Pointer to the translation data. See .

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb174011 + HRESULT ID3DXKeyframedAnimationSet::SetTranslationKey([In] unsigned int Animation,[In] unsigned int Key,[In] D3DXKEY_VECTOR3* pTranslationKey) + ID3DXKeyframedAnimationSet::SetTranslationKey +
+ + +

Gets the number of callback keys in the animation set.

+
+

Number of callback keys in the animation set.

+ + bb173993 + unsigned int ID3DXKeyframedAnimationSet::GetNumCallbackKeys() + ID3DXKeyframedAnimationSet::GetNumCallbackKeys +
+ + +

Fills an array with callback key data used for key frame animation.

+
+

Pointer to a user-allocated array of structures that the method is to fill with callback data.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb173992 + HRESULT ID3DXKeyframedAnimationSet::GetCallbackKeys([In] D3DXKEY_CALLBACK* pCallbackKeys) + ID3DXKeyframedAnimationSet::GetCallbackKeys +
+ + +

Gets information about a specific callback in the animation set.

+
+

Animation index.

+

Pointer to the callback function.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb173991 + HRESULT ID3DXKeyframedAnimationSet::GetCallbackKey([In] unsigned int Key,[In] D3DXKEY_CALLBACK* pCallbackKey) + ID3DXKeyframedAnimationSet::GetCallbackKey +
+ + +

Sets information about a specific callback in the animation set.

+
+

Animation index.

+

Pointer to the callback function.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb174008 + HRESULT ID3DXKeyframedAnimationSet::SetCallbackKey([In] unsigned int Key,[In] D3DXKEY_CALLBACK* pCallbackKey) + ID3DXKeyframedAnimationSet::SetCallbackKey +
+ + +

Removes the scale data at the specified key frame.

+
+

Animation identifier.

+

Key frame.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ +

This method is slow and should not be used after an animation has begun to play.

+
+ + bb174014 + HRESULT ID3DXKeyframedAnimationSet::UnregisterScaleKey([In] unsigned int Animation,[In] unsigned int Key) + ID3DXKeyframedAnimationSet::UnregisterScaleKey +
+ + +

Removes the rotation data at the specified key frame.

+
+

Animation identifier.

+

Key frame.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ +

This method is slow and should not be used after an animation has begun to play.

+
+ + bb174013 + HRESULT ID3DXKeyframedAnimationSet::UnregisterRotationKey([In] unsigned int Animation,[In] unsigned int Key) + ID3DXKeyframedAnimationSet::UnregisterRotationKey +
+ + +

Removes the translation data at the specified key frame.

+
+

Animation identifier.

+

Key frame.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ +

This method is slow and should not be used after an animation has begun to play.

+
+ + bb174015 + HRESULT ID3DXKeyframedAnimationSet::UnregisterTranslationKey([In] unsigned int Animation,[In] unsigned int Key) + ID3DXKeyframedAnimationSet::UnregisterTranslationKey +
+ + +

Register the scale, rotate, and translate (SRT) key frame data for an animation.

+
+

Pointer to the animation name.

+

Number of scale keys.

+

Number of rotation keys.

+

Number of translation keys.

+

Address of a reference to a user-allocated array of vectors that the method fills with scale data.

+

Address of a reference to a user-allocated array of quaternions that the method fills with rotation data.

+

Address of a reference to a user-allocated array of vectors that the method fills with translation data.

+

Returns the animation index.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned:

+ + bb174007 + HRESULT ID3DXKeyframedAnimationSet::RegisterAnimationSRTKeys([In] const char* pName,[In] unsigned int NumScaleKeys,[In] unsigned int NumRotationKeys,[In] unsigned int NumTranslationKeys,[In] const D3DXKEY_VECTOR3* pScaleKeys,[In] const D3DXKEY_QUATERNION* pRotationKeys,[In] const D3DXKEY_VECTOR3* pTranslationKeys,[In] unsigned int* pAnimationIndex) + ID3DXKeyframedAnimationSet::RegisterAnimationSRTKeys +
+ + +

Transforms animations in an animation set into a compressed format and returns a reference to the buffer that stores the compressed data.

+
+

One of the values that define the compression mode used for storing compressed animation set data. is the only value currently supported.

+

Desired compression loss ratio, in the range from 0 to 1.

+

Pointer to a transformation frame hierarchy. Can be null.

+

Address of a reference to the compressed animation set.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

+ + bb173990 + HRESULT ID3DXKeyframedAnimationSet::Compress([In] unsigned int Flags,[In] float Lossiness,[In] D3DXFRAME* pHierarchy,[In] ID3DXBuffer** ppCompressedData) + ID3DXKeyframedAnimationSet::Compress +
+ + +

Remove the animation data from the animation set.

+
+

The animation index.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

+ + bb174012 + HRESULT ID3DXKeyframedAnimationSet::UnregisterAnimation([In] unsigned int Index) + ID3DXKeyframedAnimationSet::UnregisterAnimation +
+ + +

The interface implements line drawing using textured triangles.

+
+ +

Create a line drawing object with .

The LPD3DXLINE type is defined as a reference to the interface.

 typedef interface  ;	
+            typedef interface  *LPD3DXLINE;	
+            
+
+ + bb174016 + ID3DXLine + ID3DXLine +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Retrieves the Direct3D device associated with the line object.

+
+ + bb174022 + GetDevice + GetDevice + HRESULT ID3DXLine::GetDevice([Out] IDirect3DDevice9** ppDevice) +
+ + +

Gets or sets the line stipple pattern.

+
+ + bb174024 + GetPattern / SetPattern + GetPattern + unsigned int ID3DXLine::GetPattern() +
+ + +

Gets or sets the stipple-pattern scale value.

+
+ + bb174025 + GetPatternScale / SetPatternScale + GetPatternScale + float ID3DXLine::GetPatternScale() +
+ + +

Gets or sets the thickness of the line.

+
+ + bb174026 + GetWidth / SetWidth + GetWidth + float ID3DXLine::GetWidth() +
+ + +

Gets or sets the line antialiasing state.

+
+ + bb174021 + GetAntialias / SetAntialias + GetAntialias + BOOL ID3DXLine::GetAntialias() +
+ + +

Gets or sets the OpenGL-style line-drawing mode.

+
+ + bb174023 + GetGLLines / SetGLLines + GetGLLines + BOOL ID3DXLine::GetGLLines() +
+ + +

Retrieves the Direct3D device associated with the line object.

+
+

Address of a reference to an interface, representing the Direct3D device object associated with the line object.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ + bb174022 + HRESULT ID3DXLine::GetDevice([Out] IDirect3DDevice9** ppDevice) + ID3DXLine::GetDevice +
+ + +

Prepares a device for drawing lines.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

Calling is optional. If called outside of a / sequence, the draw functions will internally call and . To avoid extra overhead, this method should be used if more than one draw function will be called successively.

This method must be called from inside an and sequence.

cannot be used as a substitute for either or .

+
+ + bb174017 + HRESULT ID3DXLine::Begin() + ID3DXLine::Begin +
+ + +

Draws a line strip in screen space. Input is in the form of an array that defines points (of ) on the line strip.

+
+ No documentation. + No documentation. + No documentation. +

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ + bb174018 + HRESULT ID3DXLine::Draw([In] const void* pVertexList,[In] unsigned int dwVertexListCount,[In] D3DCOLOR Color) + ID3DXLine::Draw +
+ + +

Draws a line strip in screen space with a specified input transformation matrix.

+
+

Array of vertices that make up the line. See .

+

Number of vertices in the vertex list.

+

A scale, rotate, and translate (SRT) matrix for transforming the points. See . If this matrix is a projection matrix, any stippled lines will be drawn with a perspective-correct stippling pattern. Or, you can transform the vertices and use to draw the line with a nonperspective-correct stipple pattern.

+

Color of the line. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ + bb174019 + HRESULT ID3DXLine::DrawTransform([In] const void* pVertexList,[In] unsigned int dwVertexListCount,[In] const D3DXMATRIX* pTransform,[In] D3DCOLOR Color) + ID3DXLine::DrawTransform +
+ + +

Applies a stipple pattern to the line.

+
+

Describes the stipple pattern: 1 is opaque, 0 is transparent.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ + bb174031 + HRESULT ID3DXLine::SetPattern([In] unsigned int dwPattern) + ID3DXLine::SetPattern +
+ + +

Gets the line stipple pattern.

+
+

Returns the line stipple pattern: 1 is opaque, 0 is transparent.

+ + bb174024 + unsigned int ID3DXLine::GetPattern() + ID3DXLine::GetPattern +
+ + +

Stretches the stipple pattern along the line direction.

+
+

Stipple pattern scaling value. 1.0f is the default value and represents no scaling. A value less than 1.0f shrinks the pattern, and a value greater than 1.0 stretches the pattern.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ + bb174032 + HRESULT ID3DXLine::SetPatternScale([In] float fPatternScale) + ID3DXLine::SetPatternScale +
+ + +

Gets the stipple-pattern scale value.

+
+

Returns the value used to scale the stipple-pattern. 1.0f is the default value and represents no scaling. A value less than 1.0f shrinks the pattern, and a value greater than 1.0 stretches the pattern.

+ + bb174025 + float ID3DXLine::GetPatternScale() + ID3DXLine::GetPatternScale +
+ + +

Specifies the thickness of the line.

+
+

Describes the line width.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ + bb174033 + HRESULT ID3DXLine::SetWidth([In] float fWidth) + ID3DXLine::SetWidth +
+ + +

Gets the thickness of the line.

+
+

The line thickness.

+ + bb174026 + float ID3DXLine::GetWidth() + ID3DXLine::GetWidth +
+ + +

Toggles line antialiasing.

+
+

Toggles antialiasing on and off. TRUE turns antialiasing on, and turns antialiasing off.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ + bb174029 + HRESULT ID3DXLine::SetAntialias([In] BOOL bAntialias) + ID3DXLine::SetAntialias +
+ + +

Gets the line antialiasing state.

+
+

Returns the antialiasing switch value. TRUE means antialiasing is on, and means antialiasing is off.

+ + bb174021 + BOOL ID3DXLine::GetAntialias() + ID3DXLine::GetAntialias +
+ + +

Toggles the mode to draw OpenGL-style lines.

+
+

Toggles OpenGL-style line drawing. TRUE enables OpenGL-style lines, and enables Direct3D-style lines.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ + bb174030 + HRESULT ID3DXLine::SetGLLines([In] BOOL bGLLines) + ID3DXLine::SetGLLines +
+ + +

Gets the OpenGL-style line-drawing mode.

+
+

Returns TRUE if OpenGL-style lines are enabled, and if Direct3D-style lines are enabled.

+ + bb174023 + BOOL ID3DXLine::GetGLLines() + ID3DXLine::GetGLLines +
+ + +

Restores the device state to how it was when was called.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

cannot be used as a substitute for either or .

+
+ + bb174020 + HRESULT ID3DXLine::End() + ID3DXLine::End +
+ + +

Use this method to release all references to video memory resources and delete all stateblocks. This method should be called whenever a device is lost, or before resetting a device.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

This method should be called whenever the device is lost or before the user calls . Even if the device was not actually lost, is responsible for freeing stateblocks and other resources that may need to be released before resetting the device. As a result, the font object cannot be used again before calling and then .

+
+ + bb174027 + HRESULT ID3DXLine::OnLostDevice() + ID3DXLine::OnLostDevice +
+ + +

Use this method to re-acquire resources and save initial state.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

should be called each time the device is reset (using ), before any other methods are called. This is a good place to re-acquire video-memory resources and capture state blocks.

+
+ + bb174028 + HRESULT ID3DXLine::OnResetDevice() + ID3DXLine::OnResetDevice +
+ + + Instantiates a left-handed coordinate system to create a . + + Pointer to an interface, representing the device associated with the created box mesh. + + This function creates a mesh with the creation option and | Flexible Vertex Format (FVF). + + HRESULT D3DXCreateLine([In] IDirect3DDevice9* pDevice,[Out, Fast] ID3DXLine** ppLine) + + + + Draws a line strip in screen space. Input is in the form of an array that defines points (of ) on the line strip. + + No documentation. + No documentation. + HRESULT ID3DXLine::Draw([In] const void* pVertexList,[In] unsigned int dwVertexListCount,[In] D3DCOLOR Color) + + + + Draws a line strip in screen space. Input is in the form of an array that defines points (of ) on the line strip. + + No documentation. + No documentation. + HRESULT ID3DXLine::Draw([In] const void* pVertexList,[In] unsigned int dwVertexListCount,[In] D3DCOLOR Color) + + + + Draws a line strip in screen space with a specified input transformation matrix. + + Array of vertices that make up the line. See . + A scale, rotate, and translate (SRT) matrix for transforming the points. See . If this matrix is a projection matrix, any stippled lines will be drawn with a perspective-correct stippling pattern. Or, you can transform the vertices and use to draw the line with a nonperspective-correct stipple pattern. + Color of the line. See . + If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA. + HRESULT ID3DXLine::DrawTransform([In] const void* pVertexList,[In] unsigned int dwVertexListCount,[In] const D3DXMATRIX* pTransform,[In] D3DCOLOR Color) + + + + Draws a line strip in screen space with a specified input transformation matrix. + + Array of vertices that make up the line. See . + A scale, rotate, and translate (SRT) matrix for transforming the points. See . If this matrix is a projection matrix, any stippled lines will be drawn with a perspective-correct stippling pattern. Or, you can transform the vertices and use to draw the line with a nonperspective-correct stipple pattern. + Color of the line. See . + If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA. + HRESULT ID3DXLine::DrawTransform([In] const void* pVertexList,[In] unsigned int dwVertexListCount,[In] const D3DXMATRIX* pTransform,[In] D3DCOLOR Color) + + + +

Applications use the methods of the interface to manipulate mesh objects.

+
+ +

To obtain the interface, call either the or function.

This interface inherits additional functionality from the interface.

The LPD3DXMESH type is defined as a reference to the interface.

 typedef struct  *LPD3DXMESH;	
+            
+
+ + bb174069 + ID3DXMesh + ID3DXMesh +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Locks the mesh buffer that contains the mesh attribute data, and returns a reference to it.

+
+

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

+

Address of a reference to a buffer containing a DWORD for each face in the mesh.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

If has been called, the mesh will also have an attribute table that can be accessed using the method.

+
+ + bb174070 + HRESULT ID3DXMesh::LockAttributeBuffer([In] unsigned int Flags,[In] unsigned int** ppData) + ID3DXMesh::LockAttributeBuffer +
+ + +

Unlocks an attribute buffer.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174074 + HRESULT ID3DXMesh::UnlockAttributeBuffer() + ID3DXMesh::UnlockAttributeBuffer +
+ + +

Generates a new mesh with reordered faces and vertices to optimize drawing performance.

+
+

Specifies the type of optimization to perform. This parameter can be set to a combination of one or more flags from D3DXMESHOPT and D3DXMESH (except , , and ).

+

Pointer to an array of three DWORDs per face that specifies the three neighbors for each face in the source mesh. If the edge has no adjacent faces, the value is 0xffffffff. See Remarks.

+

Pointer to an array of three DWORDs per face that specifies the three neighbors for each face in the optimized mesh. If the edge has no adjacent faces, the value is 0xffffffff.

+

An array of DWORDs, one per face, that identifies the original mesh face that corresponds to each face in the optimized mesh. If the value supplied for this argument is null, face remap data is not returned.

+

Address of a reference to an interface, which contains a DWORD for each vertex that specifies how the new vertices map to the old vertices. This remap is useful if you need to alter external data based on the new vertex mapping.

+

Address of a reference to an interface, representing the optimized mesh.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

This method generates a new mesh. Before running Optimize, an application must generate an adjacency buffer by calling . The adjacency buffer contains adjacency data, such as a list of edges and the faces that are adjacent to each other.

This method is very similar to the method, except that it can perform optimization while generating the new clone of the mesh. The output mesh inherits all of the creation parameters of the input mesh.

+
+ + bb174071 + HRESULT ID3DXMesh::Optimize([In] unsigned int Flags,[In] const unsigned int* pAdjacencyIn,[In] unsigned int* pAdjacencyOut,[In] unsigned int* pFaceRemap,[In] ID3DXBuffer** ppVertexRemap,[In] ID3DXMesh** ppOptMesh) + ID3DXMesh::Optimize +
+ + +

Generates a mesh with reordered faces and vertices to optimize drawing performance. This method reorders the existing mesh.

+
+

Combination of one or more D3DXMESHOPT flags, specifying the type of optimization to perform.

+

Pointer to an array of three DWORDs per face that specifies the three neighbors for each face in the source mesh. If the edge has no adjacent faces, the value is 0xffffffff.

+

Pointer to an array of three DWORDs per face that specifies the three neighbors for each face in the optimized mesh. If the edge has no adjacent faces, the value is 0xffffffff. If the value supplied for this argument is null, adjacency data is not returned.

+

An array of DWORDs, one per face, that identifies the original mesh face that corresponds to each face in the optimized mesh. If the value supplied for this argument is null, face remap data is not returned.

+

Address of a reference to an interface, which contains a DWORD for each vertex that specifies how the new vertices map to the old vertices. This remap is useful if you need to alter external data based on the new vertex mapping. If the value supplied for this argument is null, vertex remap data is not returned.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_CANNOTATTRSORT, E_OUTOFMEMORY.

+ +

Before running , an application must generate an adjacency buffer by calling . The adjacency buffer contains adjacency data, such as a list of edges and the faces that are adjacent to each other.

Note??This method will fail if the mesh is sharing its vertex buffer with another mesh, unless the is set in Flags.

+
+ + bb174072 + HRESULT ID3DXMesh::OptimizeInplace([In] unsigned int Flags,[In] const unsigned int* pAdjacencyIn,[In] unsigned int* pAdjacencyOut,[In] unsigned int* pFaceRemap,[In] ID3DXBuffer** ppVertexRemap) + ID3DXMesh::OptimizeInplace +
+ + +

Sets the attribute table for a mesh and the number of entries stored in the table.

+
+

Pointer to an array of structures, representing the entries in the mesh attribute table.

+

Number of attributes in the mesh attribute table.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

If an application keeps track of the information in an attribute table, and rearranges the table as a result of changes to attributes or faces, this method allows the application to update the attribute tables instead of calling again.

+
+ + bb174073 + HRESULT ID3DXMesh::SetAttributeTable([In] const D3DXATTRIBUTERANGE* pAttribTable,[In] unsigned int cAttribTableSize) + ID3DXMesh::SetAttributeTable +
+ + +

This interface encapsulates patch mesh functionality.

+
+ +

A patch mesh is a mesh that consists of a series of patches.

To obtain the interface, call the function.

The LPD3DXPATCHMESH type is defined as a reference to the interface, as follows:

 typedef struct  *LPD3DXPATCHMESH;	
+            
+
+ + bb174075 + ID3DXPatchMesh + ID3DXPatchMesh +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Gets the number of patches in the mesh.

+
+ + bb174083 + GetNumPatches + GetNumPatches + unsigned int ID3DXPatchMesh::GetNumPatches() +
+ + +

Gets the number of vertices in the mesh.

+
+ + bb174084 + GetNumVertices + GetNumVertices + unsigned int ID3DXPatchMesh::GetNumVertices() +
+ + +

Gets the number of control vertices per patch.

+
+ + bb174078 + GetControlVerticesPerPatch + GetControlVerticesPerPatch + unsigned int ID3DXPatchMesh::GetControlVerticesPerPatch() +
+ + +

Gets the type of patch.

+
+ +

For more information about patch types, see .

+
+ + bb174085 + GetOptions + GetOptions + unsigned int ID3DXPatchMesh::GetOptions() +
+ + +

Gets the device that created the mesh.

+
+ + bb174080 + GetDevice + GetDevice + HRESULT ID3DXPatchMesh::GetDevice([Out] IDirect3DDevice9** ppDevice) +
+ + +

Gets the mesh vertex buffer.

+
+ +

This method assumes uniform tessellation.

+
+ + bb174088 + GetVertexBuffer + GetVertexBuffer + HRESULT ID3DXPatchMesh::GetVertexBuffer([Out] IDirect3DVertexBuffer9** ppVB) +
+ + +

Gets the mesh index buffer.

+
+ +

The index buffer contains the vertex ordering in the vertex buffer. The index buffer is used to access the vertex buffer when the mesh is rendered.

+
+ + bb174082 + GetIndexBuffer + GetIndexBuffer + HRESULT ID3DXPatchMesh::GetIndexBuffer([Out] IDirect3DIndexBuffer9** ppIB) +
+ + +

Gets the number of patches in the mesh.

+
+

The number of patches.

+ + bb174083 + unsigned int ID3DXPatchMesh::GetNumPatches() + ID3DXPatchMesh::GetNumPatches +
+ + +

Gets the number of vertices in the mesh.

+
+

The number of vertices.

+ + bb174084 + unsigned int ID3DXPatchMesh::GetNumVertices() + ID3DXPatchMesh::GetNumVertices +
+ + +

Gets the vertex declaration.

+
+

Array of elements describing the vertex format of the mesh vertices. The dimension of this declarator array is . The vertex element array ends with the D3DDECL_END macro.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

The array of elements includes the D3DDECL_END macro, which ends the declaration.

+
+ + bb174079 + HRESULT ID3DXPatchMesh::GetDeclaration([In] D3DVERTEXELEMENT9* Declaration) + ID3DXPatchMesh::GetDeclaration +
+ + +

Gets the number of control vertices per patch.

+
+

The number of control vertices per patch.

+ + bb174078 + unsigned int ID3DXPatchMesh::GetControlVerticesPerPatch() + ID3DXPatchMesh::GetControlVerticesPerPatch +
+ + +

Gets the type of patch.

+
+

The patch type.

+ +

For more information about patch types, see .

+
+ + bb174085 + unsigned int ID3DXPatchMesh::GetOptions() + ID3DXPatchMesh::GetOptions +
+ + +

Gets the device that created the mesh.

+
+

Pointer to the device.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ + bb174080 + HRESULT ID3DXPatchMesh::GetDevice([Out] IDirect3DDevice9** ppDevice) + ID3DXPatchMesh::GetDevice +
+ + +

Gets the attributes of the patch.

+
+

Pointer to the structures containing the patch attributes. For more information about patch attributes, see .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ + bb174086 + HRESULT ID3DXPatchMesh::GetPatchInfo([In] D3DXPATCHINFO* PatchInfo) + ID3DXPatchMesh::GetPatchInfo +
+ + +

Gets the mesh vertex buffer.

+
+

Pointer to the vertex buffer.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

This method assumes uniform tessellation.

+
+ + bb174088 + HRESULT ID3DXPatchMesh::GetVertexBuffer([Out] IDirect3DVertexBuffer9** ppVB) + ID3DXPatchMesh::GetVertexBuffer +
+ + +

Gets the mesh index buffer.

+
+

Pointer to the index buffer.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

The index buffer contains the vertex ordering in the vertex buffer. The index buffer is used to access the vertex buffer when the mesh is rendered.

+
+ + bb174082 + HRESULT ID3DXPatchMesh::GetIndexBuffer([Out] IDirect3DIndexBuffer9** ppIB) + ID3DXPatchMesh::GetIndexBuffer +
+ + +

Lock the vertex buffer.

+
+

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

+

VOID* reference to a memory buffer containing the returned vertex data.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

The vertex buffer is usually locked, written to, and then unlocked for reading.

Patch meshes use 16-bit index buffers.

+
+ + bb174091 + HRESULT ID3DXPatchMesh::LockVertexBuffer([In] unsigned int flags,[In] void** ppData) + ID3DXPatchMesh::LockVertexBuffer +
+ + +

Unlock the vertex buffer.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

The vertex buffer is usually locked, written to, and then unlocked for reading.

+
+ + bb174098 + HRESULT ID3DXPatchMesh::UnlockVertexBuffer() + ID3DXPatchMesh::UnlockVertexBuffer +
+ + +

Lock the index buffer.

+
+

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

+

VOID* reference to a memory buffer containing the returned index data.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

The index buffer is usually locked, written to, and then unlocked for reading. Patch mesh index buffers are 16-bit buffers.

+
+ + bb174090 + HRESULT ID3DXPatchMesh::LockIndexBuffer([In] unsigned int flags,[In] void** ppData) + ID3DXPatchMesh::LockIndexBuffer +
+ + +

Unlock the index buffer.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

The index buffer is usually locked, written to, and then unlocked for reading.

+
+ + bb174097 + HRESULT ID3DXPatchMesh::UnlockIndexBuffer() + ID3DXPatchMesh::UnlockIndexBuffer +
+ + +

Locks the attribute buffer.

+
+

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

+

Address of a reference to a buffer containing a DWORD for each face in the mesh.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

The attribute buffer is usually locked, written to, and then unlocked for reading.

+
+ + bb174089 + HRESULT ID3DXPatchMesh::LockAttributeBuffer([In] unsigned int flags,[In] unsigned int** ppData) + ID3DXPatchMesh::LockAttributeBuffer +
+ + +

Unlock the attribute buffer.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

The attribute buffer is usually locked, written to, and then unlocked for reading.

+
+ + bb174096 + HRESULT ID3DXPatchMesh::UnlockAttributeBuffer() + ID3DXPatchMesh::UnlockAttributeBuffer +
+ + +

Gets the size of the tessellated mesh, given a tessellation level.

+
+

Tessellation level.

+

Adaptive tessellation. For adaptive tessellation, set this value to TRUE and set fTessLevel to the maximum tessellation value. This will result in the maximum mesh size necessary for adaptive tessellation.

+

Pointer to the number of triangles generated by the tessellated mesh.

+

Pointer to the number of vertices generated by the tessellated mesh.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

This method assumes uniform tessellation.

+
+ + bb174087 + HRESULT ID3DXPatchMesh::GetTessSize([In] float fTessLevel,[In] unsigned int Adaptive,[Out] unsigned int* NumTriangles,[Out] unsigned int* NumVertices) + ID3DXPatchMesh::GetTessSize +
+ + +

Generate a list of mesh edges and the patches that share each edge.

+
+

Specifies that vertices that differ in position by less than the tolerance should be treated as coincident.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

After an application generates adjacency information for a mesh, the mesh data can be optimized for better drawing performance. This method determines which patches are adjacent (within the provided tolerance). This information is used internally to optimize tessellation.

+
+ + bb174077 + HRESULT ID3DXPatchMesh::GenerateAdjacency([In] float Tolerance) + ID3DXPatchMesh::GenerateAdjacency +
+ + +

Creates a new patch mesh with the specified vertex declaration.

+
+

Combination of one or more D3DXMESH flags that specify creation options for the mesh.

+

Array of elements that specify the vertex format for the vertices in the output mesh.

+

Address of a reference to an interface that represents the cloned mesh.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

CloneMesh converts the vertex buffer to the new vertex declaration. Entries in the vertex declaration that are new to the original mesh are set to 0. If the current mesh has adjacency, the new mesh will also have adjacency.

+
+ + bb174076 + HRESULT ID3DXPatchMesh::CloneMesh([In] unsigned int Options,[In] const D3DVERTEXELEMENT9* pDecl,[In] ID3DXPatchMesh** pMesh) + ID3DXPatchMesh::CloneMesh +
+ + +

Optimizes the patch mesh for efficient tessellation.

+
+

Currently unused.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_CANNOTATTRSORT.

+ +

After an application generates adjacency information for a mesh, the mesh data can be optimized (reordered) for better drawing performance. This method determines which patches are adjacent (within the provided tolerance).

Adjacency information is also used to optimize tessellation. Generate adjacency information once and tessellate repeatedly by calling . The optimization performed is independent of the actual tessellation level used. However, if the mesh vertices are changed, you must regenerate the adjacency information.

+
+ + bb174092 + HRESULT ID3DXPatchMesh::Optimize([In] unsigned int flags) + ID3DXPatchMesh::Optimize +
+ + +

Sets mesh geometry displacement parameters.

+
+

Texture containing the displacement data.

+

Minification level. For more information, see .

+

Magnification level. For more information, see .

+

Mip filter level. For more information, see .

+

Texture address wrap mode. For more information, see

+

Level of detail bias value.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

Displacement maps can only be 2D textures. Mipmapping is ignored for nonadaptive tessellation.

+
+ + bb174093 + HRESULT ID3DXPatchMesh::SetDisplaceParam([In] IDirect3DBaseTexture9* Texture,[In] D3DTEXTUREFILTERTYPE MinFilter,[In] D3DTEXTUREFILTERTYPE MagFilter,[In] D3DTEXTUREFILTERTYPE MipFilter,[In] D3DTEXTUREADDRESS Wrap,[In] unsigned int dwLODBias) + ID3DXPatchMesh::SetDisplaceParam +
+ + +

Gets mesh geometry displacement parameters.

+
+

Texture containing the displacement data.

+

Minification level. For more information, see .

+

Magnification level. For more information, see .

+

Mip filter level. For more information, see .

+

Texture address wrap mode. For more information, see .

+

Level of detail bias value.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

Displacement maps can only be 2D textures. Mipmapping is ignored for nonadaptive tessellation.

+
+ + bb174081 + HRESULT ID3DXPatchMesh::GetDisplaceParam([Out] IDirect3DBaseTexture9** Texture,[Out] D3DTEXTUREFILTERTYPE* MinFilter,[Out] D3DTEXTUREFILTERTYPE* MagFilter,[Out] D3DTEXTUREFILTERTYPE* MipFilter,[Out] D3DTEXTUREADDRESS* Wrap,[Out] unsigned int* dwLODBias) + ID3DXPatchMesh::GetDisplaceParam +
+ + +

Performs uniform tessellation based on the tessellation level.

+
+

Tessellation level. This is the number of vertices introduced between existing vertices. The range of this float parameter is 0 < fTessLevel <= 32.

+

Resulting tessellated mesh. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

This function will perform more efficiently if the patch mesh has been optimized using .

+
+ + bb174094 + HRESULT ID3DXPatchMesh::Tessellate([In] float fTessLevel,[In] ID3DXMesh* pMesh) + ID3DXPatchMesh::Tessellate +
+ + +

Performs adaptive tessellation based on the z-based adaptive tessellation criterion.

+
+

Specifies a 4D vector that is dotted with the vertices to get the per-vertex adaptive tessellation amount. Each edge is tessellated to the average value of the tessellation levels for the two vertices it connects.

+

Maximum limit for adaptive tessellation. This is the number of vertices introduced between existing vertices. This integer value can range from 1 to 32, inclusive.

+

Minimum limit for adaptive tessellation. This is the number of vertices introduced between existing vertices. This integer value can range from 1 to 32, inclusive.

+

Resulting tessellated mesh. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

This function will perform more efficiently if the patch mesh has been optimized using .

+
+ + bb174095 + HRESULT ID3DXPatchMesh::TessellateAdaptive([In] const D3DXVECTOR4* pTrans,[In] unsigned int dwMaxTessLevel,[In] unsigned int dwMinTessLevel,[In] ID3DXMesh* pMesh) + ID3DXPatchMesh::TessellateAdaptive +
+ + +

Applications use the methods of the interface to encapsulate the functionality of a pixel shader.

+
+ +

The LPDIRECT3DPIXELSHADER9 and PDIRECT3DPIXELSHADER9 types are defined as references to the interface.

typedef struct  *LPDIRECT3DPIXELSHADER9, *PDIRECT3DPIXELSHADER9;
+
+ + bb205869 + IDirect3DPixelShader9 + IDirect3DPixelShader9 +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + Constant MaxDynamicFlowControlDepth. + D3DPS20_MAX_DYNAMICFLOWCONTROLDEPTH + + + Constant MinDynamicFlowControlDepth. + D3DPS20_MIN_DYNAMICFLOWCONTROLDEPTH + + + Constant MaxTemps. + D3DPS20_MAX_NUMTEMPS + + + Constant MinTemps. + D3DPS20_MIN_NUMTEMPS + + + Constant MaxStaticFlowControlDepth. + D3DPS20_MAX_STATICFLOWCONTROLDEPTH + + + Constant MinStaticFlowControlDepth. + D3DPS20_MIN_STATICFLOWCONTROLDEPTH + + + Constant MaxInstructionSlots. + D3DPS20_MAX_NUMINSTRUCTIONSLOTS + + + Constant MinInstructionSlots. + D3DPS20_MIN_NUMINSTRUCTIONSLOTS + + + +

Gets the device.

+
+ + bb205870 + GetDevice + GetDevice + HRESULT IDirect3DPixelShader9::GetDevice([Out] IDirect3DDevice9** ppDevice) +
+ + +

Gets the device.

+
+

Pointer to the interface that is returned.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205870 + HRESULT IDirect3DPixelShader9::GetDevice([Out] IDirect3DDevice9** ppDevice) + IDirect3DPixelShader9::GetDevice +
+ + +

Gets a reference to the shader data.

+
+

Pointer to a buffer that contains the shader data. The application needs to allocate enough room for this.

+

Size of the data, in bytes. To get the buffer size that is needed to retrieve the data, set pData = null when calling GetFunction. Then call GetFunction with the returned size, to get the buffer data.

+

If the method succeeds, the return value is . If the method fails, the return value can be: .

+ + bb205871 + HRESULT IDirect3DPixelShader9::GetFunction([In] void* arg0,[InOut] unsigned int* pSizeOfData) + IDirect3DPixelShader9::GetFunction +
+ + + Initializes a new instance of the class. + + The device. + The function. + HRESULT IDirect3DDevice9::CreatePixelShader([In] const void* pFunction,[Out, Fast] IDirect3DPixelShader9** ppShader) + + + + Gets the bytecode associated to this shader.. + + + + + No documentation. + + + bb280447 + ID3DXPMesh + ID3DXPMesh + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + No documentation. + + + GetMaxFaces + GetMaxFaces + unsigned int ID3DXPMesh::GetMaxFaces() + + + + No documentation. + + + GetMinFaces + GetMinFaces + unsigned int ID3DXPMesh::GetMinFaces() + + + + No documentation. + + + GetMaxVertices + GetMaxVertices + unsigned int ID3DXPMesh::GetMaxVertices() + + + + No documentation. + + + GetMinVertices + GetMinVertices + unsigned int ID3DXPMesh::GetMinVertices() + + + + No documentation. + + + GetAdjacency + GetAdjacency + HRESULT ID3DXPMesh::GetAdjacency([Out] unsigned int* pAdjacency) + + + + No documentation. + + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + + HRESULT ID3DXPMesh::ClonePMeshFVF([In] unsigned int Options,[In] unsigned int FVF,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXPMesh** ppCloneMesh) + ID3DXPMesh::ClonePMeshFVF + + + + No documentation. + + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + + HRESULT ID3DXPMesh::ClonePMesh([In] unsigned int Options,[In] const D3DVERTEXELEMENT9* pDeclaration,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXPMesh** ppCloneMesh) + ID3DXPMesh::ClonePMesh + + + + No documentation. + + No documentation. + No documentation. + + HRESULT ID3DXPMesh::SetNumFaces([In] unsigned int Faces) + ID3DXPMesh::SetNumFaces + + + + No documentation. + + No documentation. + No documentation. + + HRESULT ID3DXPMesh::SetNumVertices([In] unsigned int Vertices) + ID3DXPMesh::SetNumVertices + + + + No documentation. + + No documentation. + + unsigned int ID3DXPMesh::GetMaxFaces() + ID3DXPMesh::GetMaxFaces + + + + No documentation. + + No documentation. + + unsigned int ID3DXPMesh::GetMinFaces() + ID3DXPMesh::GetMinFaces + + + + No documentation. + + No documentation. + + unsigned int ID3DXPMesh::GetMaxVertices() + ID3DXPMesh::GetMaxVertices + + + + No documentation. + + No documentation. + + unsigned int ID3DXPMesh::GetMinVertices() + ID3DXPMesh::GetMinVertices + + + + No documentation. + + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + + HRESULT ID3DXPMesh::Save([In] IStream* pStream,[In] const D3DXMATERIAL* pMaterials,[In] const D3DXEFFECTINSTANCE* pEffectInstances,[In] unsigned int NumMaterials) + ID3DXPMesh::Save + + + +

Generates a new mesh with reordered faces and vertices to optimize drawing performance.

+
+

Specifies the type of optimization to perform. This parameter can be set to a combination of one or more flags from D3DXMESHOPT and D3DXMESH (except , , and ).

+

Pointer to an array of three DWORDs per face that specifies the three neighbors for each face in the optimized mesh. If the edge has no adjacent faces, the value is 0xffffffff.

+

An array of DWORDs, one per face, that identifies the original mesh face that corresponds to each face in the optimized mesh. If the value supplied for this argument is null, face remap data is not returned.

+

Address of a reference to an interface, which contains a DWORD for each vertex that specifies how the new vertices map to the old vertices. This remap is useful if you need to alter external data based on the new vertex mapping.

+

Address of a reference to an interface, representing the optimized mesh.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

This method generates a new mesh. Before running Optimize, an application must generate an adjacency buffer by calling . The adjacency buffer contains adjacency data, such as a list of edges and the faces that are adjacent to each other.

This method is very similar to the method, except that it can perform optimization while generating the new clone of the mesh. The output mesh inherits all of the creation parameters of the input mesh.

+
+ + bb174071 + HRESULT ID3DXPMesh::Optimize([In] unsigned int Flags,[In] unsigned int* pAdjacencyOut,[In] unsigned int* pFaceRemap,[In] ID3DXBuffer** ppVertexRemap,[In] ID3DXMesh** ppOptMesh) + ID3DXPMesh::Optimize +
+ + + No documentation. + + No documentation. + No documentation. + No documentation. + + HRESULT ID3DXPMesh::OptimizeBaseLOD([In] unsigned int Flags,[In] unsigned int* pFaceRemap) + ID3DXPMesh::OptimizeBaseLOD + + + + No documentation. + + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + + HRESULT ID3DXPMesh::TrimByFaces([In] unsigned int NewFacesMin,[In] unsigned int NewFacesMax,[In] unsigned int* rgiFaceRemap,[In] unsigned int* rgiVertRemap) + ID3DXPMesh::TrimByFaces + + + + No documentation. + + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + + HRESULT ID3DXPMesh::TrimByVertices([In] unsigned int NewVerticesMin,[In] unsigned int NewVerticesMax,[In] unsigned int* rgiFaceRemap,[In] unsigned int* rgiVertRemap) + ID3DXPMesh::TrimByVertices + + + + No documentation. + + No documentation. + No documentation. + + HRESULT ID3DXPMesh::GetAdjacency([Out] unsigned int* pAdjacency) + ID3DXPMesh::GetAdjacency + + + + No documentation. + + No documentation. + No documentation. + + HRESULT ID3DXPMesh::GenerateVertexHistory([In] unsigned int* pVertexHistory) + ID3DXPMesh::GenerateVertexHistory + + + +

Applications use the methods of the interface to perform asynchronous queries on a driver.

+
+ +

The LPDIRECT3DQUERY9 and PDIRECT3DQUERY9 types are defined as references to the interface.

typedef struct  *LPDIRECT3DQUERY9, *PDIRECT3DQUERY9;
+
+ + bb205872 + IDirect3DQuery9 + IDirect3DQuery9 +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Gets the device that is being queried.

+
+ + bb205875 + GetDevice + GetDevice + HRESULT IDirect3DQuery9::GetDevice([Out] IDirect3DDevice9** ppDevice) +
+ + +

Gets the number of bytes in the query data.

+
+ + bb205874 + GetDataSize + GetDataSize + unsigned int IDirect3DQuery9::GetDataSize() +
+ + +

Gets the device that is being queried.

+
+

Pointer to the device being queried. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205875 + HRESULT IDirect3DQuery9::GetDevice([Out] IDirect3DDevice9** ppDevice) + IDirect3DQuery9::GetDevice +
+ + +

Gets the query type.

+
+

Returns the query type. See .

+ + bb205876 + D3DQUERYTYPE IDirect3DQuery9::GetType() + IDirect3DQuery9::GetType +
+ + +

Gets the number of bytes in the query data.

+
+

Returns the number of bytes of query data.

+ + bb205874 + unsigned int IDirect3DQuery9::GetDataSize() + IDirect3DQuery9::GetDataSize +
+ + +

Issue a query.

+
+

Query flags specify the type of state change for the query. See and .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A signaled query means the query has completed, the data is available, and will return .

+
+ + bb205877 + HRESULT IDirect3DQuery9::Issue([In] D3DISSUE dwIssueFlags) + IDirect3DQuery9::Issue +
+ + +

Polls a queried resource to get the query state or a query result. For more information about queries, see Queries (Direct3D 9).

+
+ No documentation. + No documentation. + No documentation. +

The return type identifies the query state (see Queries (Direct3D 9)). The method returns if the query data is available and S_FALSE if it is not. These are considered successful return values. If the method fails when D3DGETDATA_FLUSH is used, the return value can be .

+ +

It is possible to lose the device while polling for query status. When D3DGETDATA_FLUSH is specified, this method will return in response to a lost device. This allows an application to prevent threads from endlessly polling due to a lost device (which cannot respond to the query).

An application must never write code that only invokes GetData ( ... , 0 ), expecting that GetData will eventually return by itself over time. This is true, even if the application has used the FLUSH flag with GetData in the past. For example:

// Enables an infinite loop:	
+            while( pQuery->GetData( ... , 0 ) == S_FALSE ) ; // Still enables an infinite loop:	
+            pQuery->GetData( ... , D3DGETDATA_FLUSH );	
+            while( pQuery->GetData( ... , 0 ) == S_FALSE ) ; // Does not enable an infinite loop because eventually the command	
+            // buffer will fill up and that will cause a flush to occur.	
+            while( pQuery->GetData( ..., 0 ) == S_FALSE ) { pDevice->SetTexture(...); pDevice->Draw(...);	
+            }	
+            
+
+ + bb205873 + HRESULT IDirect3DQuery9::GetData([In] void* pData,[In] unsigned int dwSize,[In] unsigned int dwGetDataFlags) + IDirect3DQuery9::GetData +
+ + + Initializes a new instance of the class. + + The device. + The type. + + + + Gets the type. + + D3DQUERYTYPE IDirect3DQuery9::GetType() + + + + +

The interface is used to generalize the process of rendering to environment maps.

+
+ +

An environment map is used to texture-map scene geometry to provide a more sophisticated scene without using complex geometry. This interface supports creating surfaces for the following kinds of geometry: cube, half sphere or hemispheric, parabolic, or sphere.

The interface is obtained by calling the function.

The LPD3DXRenderToEnvMap type is defined as a reference to the interface.

 typedef interface  ;	
+            typedef interface  *LPD3DXRenderToEnvMap;	
+            
+
+ + bb174181 + ID3DXRenderToEnvMap + ID3DXRenderToEnvMap +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Retrieves the Direct3D device associated with the environment map.

+
+ + bb174189 + GetDevice + GetDevice + HRESULT ID3DXRenderToEnvMap::GetDevice([Out] IDirect3DDevice9** ppDevice) +
+ + +

Retrieves the description of the render surface.

+
+ + bb174188 + GetDesc + GetDesc + HRESULT ID3DXRenderToEnvMap::GetDesc([Out] D3DXRTE_DESC* pDesc) +
+ + +

Retrieves the Direct3D device associated with the environment map.

+
+

Address of a reference to an interface that represents the Direct3D device object associated with the environment map.

+

If the method succeeds, the return value is . If the method fails, the return value can be . Calling this method increases the internal reference count on the interface. Be sure to call when you are done using this interface or you will have a memory leak.

+ + bb174189 + HRESULT ID3DXRenderToEnvMap::GetDevice([Out] IDirect3DDevice9** ppDevice) + ID3DXRenderToEnvMap::GetDevice +
+ + +

Retrieves the description of the render surface.

+
+

Pointer to a structure that describes the rendering surface.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174188 + HRESULT ID3DXRenderToEnvMap::GetDesc([Out] D3DXRTE_DESC* pDesc) + ID3DXRenderToEnvMap::GetDesc +
+ + +

Initiate the rendering of a cubic environment map.

+
+

Pointer to an interface that represents the cube texture to which to render.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

See to draw each of the 6 faces.

+
+ + bb174182 + HRESULT ID3DXRenderToEnvMap::BeginCube([In] IDirect3DCubeTexture9* pCubeTex) + ID3DXRenderToEnvMap::BeginCube +
+ + +

Initiate the rendering of a spherical environment map.

+
+

Pointer to an interface that represents the texture to which to render.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: .E_FAIL

+ +

See to draw the face.

+
+ + bb174185 + HRESULT ID3DXRenderToEnvMap::BeginSphere([In] IDirect3DTexture9* pTex) + ID3DXRenderToEnvMap::BeginSphere +
+ + +

Initiate the rendering of a hemispheric environment map.

+
+

Pointer to an interface that represents the positive texture render surface.

+

Pointer to an interface that represents the negative texture render surface.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: .E_FAIL

+ +

See to draw the face.

+
+ + bb174183 + HRESULT ID3DXRenderToEnvMap::BeginHemisphere([In] IDirect3DTexture9* pTexZPos,[In] IDirect3DTexture9* pTexZNeg) + ID3DXRenderToEnvMap::BeginHemisphere +
+ + +

Initiate the rendering of a parabolic environment map.

+
+

Pointer to an interface that represents the positive render texture.

+

Pointer to an interface that represents the negative render texture.

+

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: .E_FAIL

+ +

See to draw the faces.

+
+ + bb174184 + HRESULT ID3DXRenderToEnvMap::BeginParabolic([In] IDirect3DTexture9* pTexZPos,[In] IDirect3DTexture9* pTexZNeg) + ID3DXRenderToEnvMap::BeginParabolic +
+ + +

Initiate the drawing of each face of an environment map.

+
+

The first face of the environmental cube map. See .

+

A valid combination of one or more flags.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

This method must be called once for each type of environment map. The only exception is a cubic environment map which requires this method to be called six times, once for each face in . For more information, see Environment Mapping (Direct3D 9).

+
+ + bb174187 + HRESULT ID3DXRenderToEnvMap::Face([In] D3DCUBEMAP_FACES Face,[In] unsigned int MipFilter) + ID3DXRenderToEnvMap::Face +
+ + +

Restore all render targets and, if needed, compose all the rendered faces into the environment map surface.

+
+

A valid combination of one or more flags.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174186 + HRESULT ID3DXRenderToEnvMap::End([In] unsigned int MipFilter) + ID3DXRenderToEnvMap::End +
+ + +

Use this method to release all references to video memory resources and delete all stateblocks. This method should be called whenever a device is lost, or before resetting a device.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

This method should be called whenever the device is lost or before the user calls . Even if the device was not actually lost, is responsible for freeing stateblocks and other resources that may need to be released before resetting the device. As a result, the font object cannot be used again before calling and then .

+
+ + bb174190 + HRESULT ID3DXRenderToEnvMap::OnLostDevice() + ID3DXRenderToEnvMap::OnLostDevice +
+ + +

Use this method to re-acquire resources and save initial state.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

should be called each time the device is reset (using ), before any other methods are called. This is a good place to re-acquire video-memory resources and capture state blocks.

+
+ + bb174191 + HRESULT ID3DXRenderToEnvMap::OnResetDevice() + ID3DXRenderToEnvMap::OnResetDevice +
+ + +

The interface is used to generalize the process of rendering to surfaces.

+
+ +

Surfaces can be used in a variety of ways including render targets, off-screen rendering, or rendering to textures.

A surface can be configured using a separate viewport using the method, to provide a custom render view. If the surface is not a render target, a compatible render target is used, and the result is copied to the surface at the end of the scene.

The interface is obtained by calling the function.

The LPD3DXRENDERTOSURFACE type is defined as a reference to the interface.

 typedef interface  ;	
+            typedef interface  *LPD3DXRENDERTOSURFACE;	
+            
+
+ + bb174192 + ID3DXRenderToSurface + ID3DXRenderToSurface +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Retrieves the Direct3D device associated with the render surface.

+
+ + bb174196 + GetDevice + GetDevice + HRESULT ID3DXRenderToSurface::GetDevice([Out] IDirect3DDevice9** ppDevice) +
+ + +

Retrieves the parameters of the render surface.

+
+ + bb174195 + GetDesc + GetDesc + HRESULT ID3DXRenderToSurface::GetDesc([Out] D3DXRTS_DESC* pDesc) +
+ + +

Retrieves the Direct3D device associated with the render surface.

+
+

Address of a reference to an interface, representing the Direct3D device object associated with the render surface.

+

If the method succeeds, the return value is . If the method fails, the return value can be . Calling this method will increase the internal reference count on the interface. Be sure to call when you are done using this interface or you will have a memory leak.

+ + bb174196 + HRESULT ID3DXRenderToSurface::GetDevice([Out] IDirect3DDevice9** ppDevice) + ID3DXRenderToSurface::GetDevice +
+ + +

Retrieves the parameters of the render surface.

+
+

Pointer to a structure, describing the parameters of the render surface.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174195 + HRESULT ID3DXRenderToSurface::GetDesc([Out] D3DXRTS_DESC* pDesc) + ID3DXRenderToSurface::GetDesc +
+ + +

Begins a scene.

+
+

Pointer to an interface, representing the render surface.

+

Pointer to a structure, describing the viewport for the scene.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: . D3DXERR_INVALIDDATA E_OUTOFMEMORY

+ + bb174193 + HRESULT ID3DXRenderToSurface::BeginScene([In] IDirect3DSurface9* pSurface,[In] const D3DVIEWPORT9* pViewport) + ID3DXRenderToSurface::BeginScene +
+ + +

Ends a scene.

+
+

Filter options, enumerated in .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ + bb174194 + HRESULT ID3DXRenderToSurface::EndScene([In] D3DX_FILTER MipFilter) + ID3DXRenderToSurface::EndScene +
+ + +

Use this method to release all references to video memory resources and delete all stateblocks. This method should be called whenever a device is lost or before resetting a device.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

This method should be called whenever the device is lost or before the user calls . Even if the device was not actually lost, is responsible for freeing stateblocks and other resources that may need to be released before resetting the device. As a result, the font object cannot be used again before calling and then .

+
+ + bb174197 + HRESULT ID3DXRenderToSurface::OnLostDevice() + ID3DXRenderToSurface::OnLostDevice +
+ + +

Use this method to re-acquire resources and save initial state.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

should be called each time the device is reset (using ), before any other methods are called. This is a good place to re-acquire video-memory resources and capture state blocks.

+
+ + bb174198 + HRESULT ID3DXRenderToSurface::OnResetDevice() + ID3DXRenderToSurface::OnResetDevice +
+ + + Creates a render surface. + +

Pointer to an interface, the device to be associated with the render surface.

+

Width of the render surface, in pixels.

+

Height of the render surface, in pixels.

+

Member of the enumerated type, describing the pixel format of the render surface.

+

If TRUE, the render surface supports a depth-stencil surface. Otherwise, this member is set to . This function will create a new depth buffer.

+

If DepthStencil is set to TRUE, this parameter is a member of the enumerated type, describing the depth-stencil format of the render surface.

+ bb172791 + HRESULT D3DXCreateRenderToSurface([In] IDirect3DDevice9* pDevice,[In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] BOOL DepthStencil,[In] D3DFORMAT DepthStencilFormat,[In] ID3DXRenderToSurface** ppRenderToSurface) + D3DXCreateRenderToSurface +
+ + +

Applications use the methods of the interface to query and prepare resources.

+
+ +

To create a texture resource, you can call one of the following methods.

To create a geometry-oriented resource, you can call one of the following methods.

This interface, like all COM interfaces, inherits from the interface.

The LPDIRECT3DRESOURCE9 and PDIRECT3DRESOURCE9 types are defined as references to the interface.

 typedef struct  *LPDIRECT3DRESOURCE9, *PDIRECT3DRESOURCE9;	
+            
+
+ + bb205878 + IDirect3DResource9 + IDirect3DResource9 +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Retrieves the device associated with a resource.

+
+ +

This method allows navigation to the owning device object.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

+
+ + bb205880 + GetDevice + GetDevice + HRESULT IDirect3DResource9::GetDevice([Out] IDirect3DDevice9** ppDevice) +
+ + +

Retrieves the priority for this resource.

+
+ +

is used for priority control of managed resources. This method returns 0 on nonmanaged resources.

Priorities are used to determine when managed resources are to be removed from memory. A resource assigned a low priority is removed before a resource with a high priority. If two resources have the same priority, the resource that was used more recently is kept in memory; the other resource is removed. Managed resources have a default priority of 0.

+
+ + bb205881 + GetPriority + GetPriority + unsigned int IDirect3DResource9::GetPriority() +
+ + +

Returns the type of the resource.

+
+ + bb205883 + GetType + GetType + D3DRESOURCETYPE IDirect3DResource9::GetType() +
+ + +

Retrieves the device associated with a resource.

+
+

Address of a reference to an interface to fill with the device reference, if the query succeeds.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

This method allows navigation to the owning device object.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

+
+ + bb205880 + HRESULT IDirect3DResource9::GetDevice([Out] IDirect3DDevice9** ppDevice) + IDirect3DResource9::GetDevice +
+ + +

Associates data with the resource that is intended for use by the application, not by Direct3D. Data is passed by value, and multiple sets of data can be associated with a single resource.

+
+

Reference to the globally unique identifier that identifies the private data to set.

+

Pointer to a buffer that contains the data to be associated with the resource.

+

Size of the buffer at pData, in bytes.

+

Value that describes the type of data being passed, or indicates to the application that the data should be invalidated when the resource changes.

ItemDescription

(none)

If no flags are specified, Direct3D allocates memory to hold the data within the buffer and copies the data into the new buffer. The buffer allocated by Direct3D is automatically freed, as appropriate.

D3DSPD_IUNKNOWN

The data at pData is a reference to an interface. SizeOfData must be set to the size of a reference to , that is, sizeof(*). Direct3D automatically callsIUnknown through pData when the private data is destroyed. Private data will be destroyed by a subsequent call to with the same , a subsequent call to , or when the object is released. For more information, see Remarks.

?

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

Direct3D does not manage the memory at pData. If this buffer was dynamically allocated, it is the calling application's responsibility to free the memory.

+
+ + bb205886 + HRESULT IDirect3DResource9::SetPrivateData([In] const GUID& refguid,[In] const void* pData,[In] unsigned int SizeOfData,[In] unsigned int Flags) + IDirect3DResource9::SetPrivateData +
+ + +

Copies the private data associated with the resource to a provided buffer.

+
+

The globally unique identifier that identifies the private data to retrieve.

+

Pointer to a previously allocated buffer to fill with the requested private data if the call succeeds. The application calling this method is responsible for allocating and releasing this buffer. If this parameter is null, this method will return the buffer size in pSizeOfData.

+

Pointer to the size of the buffer at pData, in bytes. If this value is less than the actual size of the private data (such as 0), the method sets this parameter to the required buffer size and the method returns .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , .

+ +

This method is inherited by the following interfaces: , , , , , , .

+
+ + bb205882 + HRESULT IDirect3DResource9::GetPrivateData([In] const GUID& refguid,[In] void* pData,[InOut] unsigned int* pSizeOfData) + IDirect3DResource9::GetPrivateData +
+ + +

Frees the specified private data associated with this resource.

+
+

Reference to the globally unique identifier that identifies the private data to free.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , .

+ +

Direct3D calls this method automatically when a resource is released.

+
+ + bb205879 + HRESULT IDirect3DResource9::FreePrivateData([In] const GUID& refguid) + IDirect3DResource9::FreePrivateData +
+ + +

Assigns the priority of a resource for scheduling purposes.

+
+

Priority to assign to a resource.

Differences between Direct3D 9 and Direct3D 9 for Windows Vista

The priority can be any DWORD value; Direct3D 9 for Windows Vista also supports any of these pre-defined values D3D9_RESOURCE_PRIORITY.

?

+

Returns the previous priority value for the resource.

+ +

This method is used to change the priority of managed resources (resources created with the flag). This method returns 0 on non-managed resources.

Priorities are used to determine when managed resources are to be removed from memory. A resource assigned a low priority is removed before a resource with a high priority. If two resources have the same priority, the resource that was used more recently is kept in memory; the other resource is removed. Managed resources have a default priority of 0.

Windows Vista only - When this method is called using an interface, only resources created with the flag will be affected.

+
+ + bb205885 + unsigned int IDirect3DResource9::SetPriority([In] unsigned int PriorityNew) + IDirect3DResource9::SetPriority +
+ + +

Retrieves the priority for this resource.

+
+

Returns a DWORD value, indicating the priority of the resource.

+ +

is used for priority control of managed resources. This method returns 0 on nonmanaged resources.

Priorities are used to determine when managed resources are to be removed from memory. A resource assigned a low priority is removed before a resource with a high priority. If two resources have the same priority, the resource that was used more recently is kept in memory; the other resource is removed. Managed resources have a default priority of 0.

+
+ + bb205881 + unsigned int IDirect3DResource9::GetPriority() + IDirect3DResource9::GetPriority +
+ + +

Preloads a managed resource.

+
+ +

Calling this method indicates that the application will need this managed resource shortly. This method has no effect on nonmanaged resources.

detects "thrashing" conditions where more resources are being used in each frame than can fit in video memory simultaneously. Under such circumstances silently does nothing.

+
+ + bb205884 + void IDirect3DResource9::PreLoad() + IDirect3DResource9::PreLoad +
+ + +

Returns the type of the resource.

+
+

Returns a member of the enumerated type, identifying the type of the resource.

+ + bb205883 + D3DRESOURCETYPE IDirect3DResource9::GetType() + IDirect3DResource9::GetType +
+ + + Gets or sets the debug-name for this object. + + + The debug name. + + + + + No documentation. + + + bb280438 + ID3DXSPMesh + ID3DXSPMesh + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + No documentation. + + + GetNumFaces + GetNumFaces + unsigned int ID3DXSPMesh::GetNumFaces() + + + + No documentation. + + + GetNumVertices + GetNumVertices + unsigned int ID3DXSPMesh::GetNumVertices() + + + + No documentation. + + + GetFVF + GetFVF + unsigned int ID3DXSPMesh::GetFVF() + + + + No documentation. + + + GetOptions + GetOptions + unsigned int ID3DXSPMesh::GetOptions() + + + + No documentation. + + + GetDevice + GetDevice + HRESULT ID3DXSPMesh::GetDevice([Out] IDirect3DDevice9** ppDevice) + + + + No documentation. + + + GetMaxFaces + GetMaxFaces + unsigned int ID3DXSPMesh::GetMaxFaces() + + + + No documentation. + + + GetMaxVertices + GetMaxVertices + unsigned int ID3DXSPMesh::GetMaxVertices() + + + + No documentation. + + + GetVertexWeights + GetVertexWeights + HRESULT ID3DXSPMesh::GetVertexWeights([Out] float* pVertexWeights) + + + + No documentation. + + No documentation. + + unsigned int ID3DXSPMesh::GetNumFaces() + ID3DXSPMesh::GetNumFaces + + + + No documentation. + + No documentation. + + unsigned int ID3DXSPMesh::GetNumVertices() + ID3DXSPMesh::GetNumVertices + + + + No documentation. + + No documentation. + + unsigned int ID3DXSPMesh::GetFVF() + ID3DXSPMesh::GetFVF + + + + No documentation. + + No documentation. + No documentation. + + HRESULT ID3DXSPMesh::GetDeclaration([In] D3DVERTEXELEMENT9* Declaration) + ID3DXSPMesh::GetDeclaration + + + + No documentation. + + No documentation. + + unsigned int ID3DXSPMesh::GetOptions() + ID3DXSPMesh::GetOptions + + + + No documentation. + + No documentation. + No documentation. + + HRESULT ID3DXSPMesh::GetDevice([Out] IDirect3DDevice9** ppDevice) + ID3DXSPMesh::GetDevice + + + + No documentation. + + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + + HRESULT ID3DXSPMesh::CloneMeshFVF([In] unsigned int Options,[In] unsigned int FVF,[In] IDirect3DDevice9* pD3DDevice,[In] unsigned int* pAdjacencyOut,[In] unsigned int* pVertexRemapOut,[In] ID3DXMesh** ppCloneMesh) + ID3DXSPMesh::CloneMeshFVF + + + + No documentation. + + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + + HRESULT ID3DXSPMesh::CloneMesh([In] unsigned int Options,[In] const D3DVERTEXELEMENT9* pDeclaration,[In] IDirect3DDevice9* pD3DDevice,[In] unsigned int* pAdjacencyOut,[In] unsigned int* pVertexRemapOut,[In] ID3DXMesh** ppCloneMesh) + ID3DXSPMesh::CloneMesh + + + + No documentation. + + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + + HRESULT ID3DXSPMesh::ClonePMeshFVF([In] unsigned int Options,[In] unsigned int FVF,[In] IDirect3DDevice9* pD3DDevice,[In] unsigned int* pVertexRemapOut,[In] float* pErrorsByFace,[In] ID3DXPMesh** ppCloneMesh) + ID3DXSPMesh::ClonePMeshFVF + + + + No documentation. + + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + + HRESULT ID3DXSPMesh::ClonePMesh([In] unsigned int Options,[In] const D3DVERTEXELEMENT9* pDeclaration,[In] IDirect3DDevice9* pD3DDevice,[In] unsigned int* pVertexRemapOut,[In] float* pErrorsbyFace,[In] ID3DXPMesh** ppCloneMesh) + ID3DXSPMesh::ClonePMesh + + + + No documentation. + + No documentation. + No documentation. + + HRESULT ID3DXSPMesh::ReduceFaces([In] unsigned int Faces) + ID3DXSPMesh::ReduceFaces + + + + No documentation. + + No documentation. + No documentation. + + HRESULT ID3DXSPMesh::ReduceVertices([In] unsigned int Vertices) + ID3DXSPMesh::ReduceVertices + + + + No documentation. + + No documentation. + + unsigned int ID3DXSPMesh::GetMaxFaces() + ID3DXSPMesh::GetMaxFaces + + + + No documentation. + + No documentation. + + unsigned int ID3DXSPMesh::GetMaxVertices() + ID3DXSPMesh::GetMaxVertices + + + + No documentation. + + No documentation. + No documentation. + + HRESULT ID3DXSPMesh::GetVertexAttributeWeights([In] D3DXATTRIBUTEWEIGHTS* pVertexAttributeWeights) + ID3DXSPMesh::GetVertexAttributeWeights + + + + No documentation. + + No documentation. + No documentation. + + HRESULT ID3DXSPMesh::GetVertexWeights([Out] float* pVertexWeights) + ID3DXSPMesh::GetVertexWeights + + + + No documentation. + + + bb280439 + ID3DXSkinInfo + ID3DXSkinInfo + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Gets the maximum number of influences for any vertex in the mesh.

+
+ + bb174218 + GetMaxVertexInfluences + GetMaxVertexInfluences + HRESULT ID3DXSkinInfo::GetMaxVertexInfluences([Out] unsigned int* maxVertexInfluences) +
+ + +

Gets the number of bones.

+
+ + bb174221 + GetNumBones + GetNumBones + unsigned int ID3DXSkinInfo::GetNumBones() +
+ + +

Gets or sets the minimum bone influence. Influence values smaller than this are ignored.

+
+ + bb174219 + GetMinBoneInfluence / SetMinBoneInfluence + GetMinBoneInfluence + float ID3DXSkinInfo::GetMinBoneInfluence() +
+ + +

Gets or sets the fixed function vertex value.

+
+ +

This method can return 0 if the vertex format cannot be mapped directly to an FVF code. This will occur for a mesh created from a vertex declaration that doesn't have the same order and elements supported by the FVF codes.

+
+ + bb174216 + GetFVF / SetFVF + GetFVF + unsigned int ID3DXSkinInfo::GetFVF() +
+ + +

Sets the influence value for a bone.

+
+

Bone number.

+

Number of influences.

+

The array of vertices influenced by a bone.

+

The array of weights influenced by a bone.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174224 + HRESULT ID3DXSkinInfo::SetBoneInfluence([In] unsigned int bone,[In] unsigned int numInfluences,[In] const unsigned int* vertices,[In] const float* weights) + ID3DXSkinInfo::SetBoneInfluence +
+ + +

Sets an influence value of a bone on a single vertex.

+
+

Index of the bone. Must be between 0 and the number of bones.

+

Index of the influence array of the specified bone.

+

Blend factor of the specified bone influence.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174227 + HRESULT ID3DXSkinInfo::SetBoneVertexInfluence([In] unsigned int boneNum,[In] unsigned int influenceNum,[In] float weight) + ID3DXSkinInfo::SetBoneVertexInfluence +
+ + +

Gets the number of influences for a bone.

+
+

Bone number.

+

Returns the number of influences for a bone.

+ + bb174220 + unsigned int ID3DXSkinInfo::GetNumBoneInfluences([In] unsigned int bone) + ID3DXSkinInfo::GetNumBoneInfluences +
+ + +

Gets the vertices and weights that a bone influences.

+
+

Bone number.

+

Get the array of vertices influenced by a bone.

+

Get the array of weights influenced by a bone.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

Use to find out how many vertices the bone influences.

+
+ + bb174211 + HRESULT ID3DXSkinInfo::GetBoneInfluence([In] unsigned int bone,[Out] unsigned int* vertices,[Out] float* weights) + ID3DXSkinInfo::GetBoneInfluence +
+ + +

Retrieves the blend factor and vertex affected by a specified bone influence.

+
+

Index of the bone. Must be between 0 and the number of bones.

+

Index of the influence array of the specified bone.

+

Pointer to the blend factor influenced by influenceNum.

+

Pointer to the vertex influenced by influenceNum.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174214 + HRESULT ID3DXSkinInfo::GetBoneVertexInfluence([In] unsigned int boneNum,[In] unsigned int influenceNum,[Out] float* pWeight,[Out] unsigned int* pVertexNum) + ID3DXSkinInfo::GetBoneVertexInfluence +
+ + +

Gets the maximum number of influences for any vertex in the mesh.

+
+

Pointer to the maximum vertex influence.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174218 + HRESULT ID3DXSkinInfo::GetMaxVertexInfluences([Out] unsigned int* maxVertexInfluences) + ID3DXSkinInfo::GetMaxVertexInfluences +
+ + +

Gets the number of bones.

+
+

Returns the number of bones.

+ + bb174221 + unsigned int ID3DXSkinInfo::GetNumBones() + ID3DXSkinInfo::GetNumBones +
+ + +

Retrieves the index of the bone influence affecting a single vertex.

+
+

Index of the bone. Must be between 0 and the number of bones.

+

Index of the vertex for which the bone influence is to be found. Must be between 0 and the number of vertices in the mesh.

+

Pointer to the index of the bone influence that affects vertexNum.

+

If the method succeeds, the return value is . If the specified bone does not influence the given vertex, S_FALSE is returned. If the method fails, the return value can be .

+ + bb174210 + HRESULT ID3DXSkinInfo::FindBoneVertexInfluenceIndex([In] unsigned int boneNum,[In] unsigned int vertexNum,[In] unsigned int* pInfluenceIndex) + ID3DXSkinInfo::FindBoneVertexInfluenceIndex +
+ + +

Gets the maximum face influences in a triangle mesh with the specified index buffer.

+
+

Pointer to the index buffer that contains the mesh index data.

+

Number of faces in the mesh.

+

Pointer to the maximum face influences.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174217 + HRESULT ID3DXSkinInfo::GetMaxFaceInfluences([In] IDirect3DIndexBuffer9* pIB,[In] unsigned int NumFaces,[Out] unsigned int* maxFaceInfluences) + ID3DXSkinInfo::GetMaxFaceInfluences +
+ + +

Sets the minimum bone influence. Influence values smaller than this are ignored.

+
+

Minimum influence value. Influence values smaller than this are ignored.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174230 + HRESULT ID3DXSkinInfo::SetMinBoneInfluence([In] float MinInfl) + ID3DXSkinInfo::SetMinBoneInfluence +
+ + +

Gets the minimum bone influence. Influence values smaller than this are ignored.

+
+

Returns the minimum bone influence value.

+ + bb174219 + float ID3DXSkinInfo::GetMinBoneInfluence() + ID3DXSkinInfo::GetMinBoneInfluence +
+ + +

Sets the bone name.

+
+

Bone number

+

Bone name

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

Bone names are returned by .

+
+ + bb174225 + HRESULT ID3DXSkinInfo::SetBoneName([In] unsigned int Bone,[In] const char* pName) + ID3DXSkinInfo::SetBoneName +
+ + +

Gets the bone name, from the bone index.

+
+

Bone number.

+

Returns the bone name. Do not free this string.

+ + bb174212 + const char* ID3DXSkinInfo::GetBoneName([In] unsigned int Bone) + ID3DXSkinInfo::GetBoneName +
+ + +

Sets the bone offset matrix.

+
+

Bone number.

+

Pointer to the bone offset matrix.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

Bone names are returned by .

+
+ + bb174226 + HRESULT ID3DXSkinInfo::SetBoneOffsetMatrix([In] unsigned int Bone,[In] const D3DXMATRIX* pBoneTransform) + ID3DXSkinInfo::SetBoneOffsetMatrix +
+ + +

Gets the bone offset matrix.

+
+

Bone number.

+

Returns a reference to the bone offset matrix. Do not free this reference.

+ + bb174213 + D3DXMATRIX* ID3DXSkinInfo::GetBoneOffsetMatrix([In] unsigned int Bone) + ID3DXSkinInfo::GetBoneOffsetMatrix +
+ + +

Clones a skin info object.

+
+

Address of a reference to an object, which will contain the cloned object if the method is successful.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174207 + HRESULT ID3DXSkinInfo::Clone([In] ID3DXSkinInfo** ppSkinInfo) + ID3DXSkinInfo::Clone +
+ + +

Updates bone influence information to match vertices after they are reordered. This method should be called if the target vertex buffer has been reordered externally.

+
+

Number of vertices to remap.

+

Array of DWORDS whose length is specified by NumVertices.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

Each element in pVertexRemap specifies the previous vertex index for that position. For example, if a vertex was in position 3 but has been remapped to position 5, then the fifth element of pVertexRemap should contain 3. The vertex remap array returned by can be used.

+
+ + bb174223 + HRESULT ID3DXSkinInfo::Remap([In] unsigned int NumVertices,[In] unsigned int* pVertexRemap) + ID3DXSkinInfo::Remap +
+ + +

Sets the flexible vertex format (FVF) type.

+
+

Flexible vertex format. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174229 + HRESULT ID3DXSkinInfo::SetFVF([In] unsigned int FVF) + ID3DXSkinInfo::SetFVF +
+ + +

Sets the vertex declaration.

+
+

Pointer to an array of elements.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174228 + HRESULT ID3DXSkinInfo::SetDeclaration([In] const D3DVERTEXELEMENT9* pDeclaration) + ID3DXSkinInfo::SetDeclaration +
+ + +

Gets the fixed function vertex value.

+
+

Returns the flexible vertex format (FVF) codes.

+ +

This method can return 0 if the vertex format cannot be mapped directly to an FVF code. This will occur for a mesh created from a vertex declaration that doesn't have the same order and elements supported by the FVF codes.

+
+ + bb174216 + unsigned int ID3DXSkinInfo::GetFVF() + ID3DXSkinInfo::GetFVF +
+ + +

Gets the vertex declaration.

+
+

Array of elements describing the vertex format of the mesh vertices. The upper limit of this declarator array is . The vertex element array ends with the D3DDECL_END macro.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

The array of elements includes the D3DDECL_END macro, which ends the declaration.

+
+ + bb174215 + HRESULT ID3DXSkinInfo::GetDeclaration([In] D3DVERTEXELEMENT9* Declaration) + ID3DXSkinInfo::GetDeclaration +
+ + +

Applies software skinning to the target vertices based on the current matrices.

+
+

Bone transform matrix.

+

Inverse transpose of the bone transform matrix.

+

Pointer to the buffer containing the source vertices.

+

Pointer to the buffer containing the destination vertices.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

When used to skin vertices with two position elements, this method skins the second position element with the inverse of the bone instead of the bone itself.

+
+ + bb174231 + HRESULT ID3DXSkinInfo::UpdateSkinnedMesh([In] const D3DXMATRIX* pBoneTransforms,[In] const D3DXMATRIX* pBoneInvTransposeTransforms,[In] const void* pVerticesSrc,[In] void* pVerticesDst) + ID3DXSkinInfo::UpdateSkinnedMesh +
+ + +

Takes a mesh and returns a new mesh with per-vertex blend weights and a bone combination table. The table describes which bones affect which subsets of the mesh.

+
+

Input mesh. See .

+

Currently unused.

+

Input mesh adjacency information.

+

Output mesh adjacency information.

+

An array of DWORDs, one per face, that identifies the original mesh face that corresponds to each face in the blended mesh. If the value supplied for this argument is null, face remap data is not returned.

+

Address of a reference to an interface, which contains a DWORD for each vertex that specifies how the new vertices map to the old vertices. This remap is useful if you need to alter external data based on the new vertex mapping. This parameter is optional; null may be used.

+

Pointer to a DWORD that will contain the maximum number of bone influences required per vertex for this skinning method.

+

Pointer to the number of bones in the bone combination table.

+

Pointer to the bone combination table. The data is organized in a structure.

+

Pointer to the new mesh.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

Each element in the remap array specifies the previous index for that position. For example, if a vertex was in position 3 but has been remapped to position 5, then the fifth element of pVertexRemap will contain 3.

This method does not run on hardware that does not support fixed-function vertex blending.

+
+ + bb174208 + HRESULT ID3DXSkinInfo::ConvertToBlendedMesh([In] ID3DXMesh* pMesh,[In] unsigned int Options,[In] const unsigned int* pAdjacencyIn,[In] unsigned int* pAdjacencyOut,[In] unsigned int* pFaceRemap,[In] ID3DXBuffer** ppVertexRemap,[In] unsigned int* pMaxFaceInfl,[In] unsigned int* pNumBoneCombinations,[In] ID3DXBuffer** ppBoneCombinationTable,[In] ID3DXMesh** ppMesh) + ID3DXSkinInfo::ConvertToBlendedMesh +
+ + +

Takes a mesh and returns a new mesh with per-vertex blend weights, indices, and a bone combination table. The table describes which bone palettes affect which subsets of the mesh.

+
+

The input mesh. See .

+

Currently unused.

+

Number of bone matrices available for matrix palette skinning.

+

Input mesh adjacency information.

+

Output mesh adjacency information.

+

An array of DWORDs, one per face, that identifies the original mesh face that corresponds to each face in the blended mesh. If the value supplied for this argument is null, face remap data is not returned.

+

Address of a reference to an interface, which contains a DWORD for each vertex that specifies how the new vertices map to the old vertices. This remap is useful if you need to alter external data based on the new vertex mapping. This parameter is optional; null may be used.

+

Pointer to a DWORD that will contain the maximum number of bone influences required per vertex for this skinning method.

+

Pointer to the number of bones in the bone combination table.

+

Pointer to the bone combination table. The data is organized in a structure.

+

Pointer to the new mesh.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

Each element in the remap arrays specifies the previous index for that position. For example, if a vertex was in position 3 but has been remapped to position 5, then the fifth element of pVertexRemap will contain 3.

This method does not run on hardware that does not support fixed-function vertex blending.

+
+ + bb174209 + HRESULT ID3DXSkinInfo::ConvertToIndexedBlendedMesh([In] ID3DXMesh* pMesh,[In] unsigned int Options,[In] unsigned int paletteSize,[In] const unsigned int* pAdjacencyIn,[In] unsigned int* pAdjacencyOut,[In] unsigned int* pFaceRemap,[In] ID3DXBuffer** ppVertexRemap,[In] unsigned int* pMaxVertexInfl,[In] unsigned int* pNumBoneCombinations,[In] ID3DXBuffer** ppBoneCombinationTable,[In] ID3DXMesh** ppMesh) + ID3DXSkinInfo::ConvertToIndexedBlendedMesh +
+ + +

The interface provides a set of methods that simplify the process of drawing sprites using Microsoft Direct3D.

+
+ +

The interface is obtained by calling the function.

The application typically first calls , which allows control over the device render state, alpha blending, and sprite transformation and sorting. Then for each sprite to be displayed, call . can be called repeatedly to store any number of sprites. To display the batched sprites to the device, call or .

The LPD3DXSPRITE type is defined as a reference to the interface.

 typedef interface  ;	
+            typedef interface  *LPD3DXSPRITE;	
+            
+
+ + bb174249 + ID3DXSprite + ID3DXSprite +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Retrieves the device associated with the sprite object.

+
+ +

Calling this method will increase the internal reference count on the interface.

+
+ + bb174254 + GetDevice + GetDevice + HRESULT ID3DXSprite::GetDevice([Out] IDirect3DDevice9** ppDevice) +
+ + +

Gets or sets the sprite transform.

+
+ + bb174255 + GetTransform / SetTransform + GetTransform + HRESULT ID3DXSprite::GetTransform([Out] D3DXMATRIX* pTransform) +
+ + +

Retrieves the device associated with the sprite object.

+
+

Address of a reference to an interface, representing the Direct3D device object associated with the sprite object.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned.

+ +

Calling this method will increase the internal reference count on the interface.

+
+ + bb174254 + HRESULT ID3DXSprite::GetDevice([Out] IDirect3DDevice9** ppDevice) + ID3DXSprite::GetDevice +
+ + +

Gets the sprite transform.

+
+

Pointer to a that contains a transform of the sprite from the original world space.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned.

+ + bb174255 + HRESULT ID3DXSprite::GetTransform([Out] D3DXMATRIX* pTransform) + ID3DXSprite::GetTransform +
+ + +

Sets the sprite transform.

+
+

Pointer to a that contains a transform of the sprite from the original world space. Use this transform to scale, rotate, or transform the sprite.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned.

+ + bb174258 + HRESULT ID3DXSprite::SetTransform([In] const D3DXMATRIX* pTransform) + ID3DXSprite::SetTransform +
+ + +

Sets the right-handed world-view transform for a sprite. A call to this method is required before billboarding or sorting sprites.

+
+

Pointer to a that contains a world transform. If null, the identity matrix is used for the world transform.

+

Pointer to a that contains a view transform. If null, the identity matrix is used for the view transform.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned.

+ +

A call to this method (or to ) is required if the sprite will be rendered with the D3DXSprite__BILLBOARD, D3DXSprite__SORT_DEPTH_FRONTTOBACK, or D3DXSprite__SORT_DEPTH_BACKTOFRONT flag value in .

+
+ + bb174260 + HRESULT ID3DXSprite::SetWorldViewRH([In] const D3DXMATRIX* pWorld,[In] const D3DXMATRIX* pView) + ID3DXSprite::SetWorldViewRH +
+ + +

Sets the left-handed world-view transform for a sprite. A call to this method is required before billboarding or sorting sprites.

+
+

Pointer to a that contains a world transform. If null, the identity matrix is used for the world transform.

+

Pointer to a that contains a view transform. If null, the identity matrix is used for the view transform.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned.

+ +

A call to this method (or to ) is required if the sprite will be rendered with the D3DXSprite__BILLBOARD, D3DXSprite__SORT_DEPTH_FRONTTOBACK, or D3DXSprite__SORT_DEPTH_BACKTOFRONT flag value in .

+
+ + bb174259 + HRESULT ID3DXSprite::SetWorldViewLH([In] const D3DXMATRIX* pWorld,[In] const D3DXMATRIX* pView) + ID3DXSprite::SetWorldViewLH +
+ + +

Prepares a device for drawing sprites.

+
+

Combination of zero or more flags that describe sprite rendering options. For this method, the valid flags are:

  • D3DXSPRITE__BILLBOARD
  • D3DXSPRITE__SORT_DEPTH_BACKTOFRONT
  • D3DXSPRITE__SORT_DEPTH_FRONTTOBACK
  • D3DXSPRITE__SORT_TEXTURE

For a description of the flags and for information on how to control device state capture and device view transforms, see .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

+ +

This method must be called from inside a . . . sequence. cannot be used as a substitute for either or .

This method will set the following states on the device.

Render States:

Type ()Value
TRUE
0x00
AlphaCmpCaps
TRUE
| | |
0

?

Texture Stage States:

Stage IdentifierType ()Value
0
0
0
0
0
0
00
0
1
1

?

Sampler States:

Sampler Stage IndexType ()Value
0
0
0 if TextureFilterCaps includes ; otherwise
00
0MaxAnisotropy
0 if TextureFilterCaps includes ; otherwise
0 if TextureFilterCaps includes ; otherwise
00
00

?

Note??This method disables N-patches.

+
+ + bb174250 + HRESULT ID3DXSprite::Begin([In] D3DXSPRITE Flags) + ID3DXSprite::Begin +
+ + +

Adds a sprite to the list of batched sprites.

+
+

Pointer to an interface that represents the sprite texture.

+

Pointer to a structure that indicates the portion of the source texture to use for the sprite. If this parameter is null, then the entire source image is used for the sprite.

+

Pointer to a vector that identifies the center of the sprite. If this argument is null, the point (0,0,0) is used, which is the upper-left corner.

+

Pointer to a vector that identifies the position of the sprite. If this argument is null, the point (0,0,0) is used, which is the upper-left corner.

+

type. The color and alpha channels are modulated by this value. A value of 0xFFFFFFFF maintains the original source color and alpha data. Use the D3DCOLOR_RGBA macro to help generate this color.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

To scale, rotate, or translate a sprite, call with a matrix that contains the scale, rotate, and translate (SRT) values, before calling . For information about setting SRT values in a matrix, see Matrix Transforms.

+
+ + bb174251 + HRESULT ID3DXSprite::Draw([In] IDirect3DTexture9* pTexture,[In] const void* pSrcRect,[In] const void* pCenter,[In] const void* pPosition,[In] D3DCOLOR Color) + ID3DXSprite::Draw +
+ + +

Forces all batched sprites to be submitted to the device. Device states remain as they were after the last call to . The list of batched sprites is then cleared.

+
+

If the method succeeds, the return value is . If the method fails, the following value will be returned.

+ + bb174253 + HRESULT ID3DXSprite::Flush() + ID3DXSprite::Flush +
+ + +

Calls and restores the device state to how it was before was called.

+
+

If the method succeeds, the return value is . If the method fails, the following value will be returned.

+ +

cannot be used as a substitute for either or .

+
+ + bb174252 + HRESULT ID3DXSprite::End() + ID3DXSprite::End +
+ + +

Use this method to release all references to video memory resources and delete all stateblocks. This method should be called whenever a device is lost or before resetting a device.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

This method should be called whenever the device is lost or before the user calls . Even if the device was not actually lost, is responsible for freeing stateblocks and other resources that may need to be released before resetting the device. As a result, the font object cannot be used again before calling and then .

+
+ + bb174256 + HRESULT ID3DXSprite::OnLostDevice() + ID3DXSprite::OnLostDevice +
+ + +

Use this method to re-acquire resources and save initial state.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

should be called each time the device is reset (using ), before any other methods are called. This is a good place to re-acquire video-memory resources and capture state blocks.

+
+ + bb174257 + HRESULT ID3DXSprite::OnResetDevice() + ID3DXSprite::OnResetDevice +
+ + + Creates a sprite object which is associated with a particular device. Sprite objects are used to draw 2D images to the screen. + + A reference to the device (see ) that will draw the sprite. + + This interface can be used to draw two dimensional images in screen space of the associated device. + + HRESULT D3DXCreateSprite([In] IDirect3DDevice9* pDevice,[Out, Fast] ID3DXSprite** ppSprite) + + + +

Adds a sprite to the list of batched sprites.

+
+

Pointer to an interface that represents the sprite texture.

+

type. The color and alpha channels are modulated by this value. A value of 0xFFFFFFFF maintains the original source color and alpha data. Use the D3DCOLOR_RGBA macro to help generate this color.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

To scale, rotate, or translate a sprite, call with a matrix that contains the scale, rotate, and translate (SRT) values, before calling . For information about setting SRT values in a matrix, see Matrix Transforms.

+
+ bb174251 + HRESULT ID3DXSprite::Draw([In] IDirect3DTexture9* pTexture,[In] const RECT* pSrcRect,[In] const D3DXVECTOR3* pCenter,[In] const D3DXVECTOR3* pPosition,[In] D3DCOLOR Color) + ID3DXSprite::Draw +
+ + +

Adds a sprite to the list of batched sprites.

+
+

Pointer to an interface that represents the sprite texture.

+

Pointer to a structure that indicates the portion of the source texture to use for the sprite. If this parameter is null, then the entire source image is used for the sprite.

+

Pointer to a vector that identifies the center of the sprite. If this argument is null, the point (0,0,0) is used, which is the upper-left corner.

+

Pointer to a vector that identifies the position of the sprite. If this argument is null, the point (0,0,0) is used, which is the upper-left corner.

+

type. The color and alpha channels are modulated by this value. A value of 0xFFFFFFFF maintains the original source color and alpha data. Use the D3DCOLOR_RGBA macro to help generate this color.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

To scale, rotate, or translate a sprite, call with a matrix that contains the scale, rotate, and translate (SRT) values, before calling . For information about setting SRT values in a matrix, see Matrix Transforms.

+
+ bb174251 + HRESULT ID3DXSprite::Draw([In] IDirect3DTexture9* pTexture,[In] const RECT* pSrcRect,[In] const D3DXVECTOR3* pCenter,[In] const D3DXVECTOR3* pPosition,[In] D3DCOLOR Color) + ID3DXSprite::Draw +
+ + +

Applications use the methods of the interface to encapsulate render states.

+
+ +

This interface can be used to save and restore pipeline state. It can also be used to capture the current state.

The LPDIRECT3DSTATEBLOCK9 and PDIRECT3DSTATEBLOCK9 types are defined as references to the interface.

typedef struct  *LPDIRECT3DSTATEBLOCK9, *PDIRECT3DSTATEBLOCK9;
+
+ + bb205887 + IDirect3DStateBlock9 + IDirect3DStateBlock9 +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Gets the device.

+
+ + bb205891 + GetDevice + GetDevice + HRESULT IDirect3DStateBlock9::GetDevice([Out] IDirect3DDevice9** ppDevice) +
+ + +

Gets the device.

+
+

Pointer to the interface that is returned.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205891 + HRESULT IDirect3DStateBlock9::GetDevice([Out] IDirect3DDevice9** ppDevice) + IDirect3DStateBlock9::GetDevice +
+ + +

Capture the current value of states that are included in a stateblock.

+
+

If the method succeeds, the return value is . If the method fails because capture cannot be done while in record mode, the return value is .

+ +

The Capture method captures current values for states within an existing state block. It does not capture the entire state of the device. For example:

 * pStateBlock = null; pd3dDevice->BeginStateBlock();	
+            // Add the ZENABLE state to the stateblock 	
+            pd3dDevice->SetRenderState ( ,  );	
+            pd3dDevice->EndStateBlock ( &pStateBlock ); // Change the current value that is stored in the state block	
+            pd3dDevice->SetRenderState ( ,  );	
+            pStateBlock->Capture();			 pStateBlock->Release();	
+            

Creating an empty stateblock and calling the Capture method does nothing if no states have been set.

The Capture method will not capture information for lights that are explicitly or implicitly created after the stateblock is created.

+
+ + bb205890 + HRESULT IDirect3DStateBlock9::Capture() + IDirect3DStateBlock9::Capture +
+ + +

Apply the state block to the current device state.

+
+

If the method succeeds, the return value is . If the method fails while in record mode, the return value is .

+ + bb205889 + HRESULT IDirect3DStateBlock9::Apply() + IDirect3DStateBlock9::Apply +
+ + + Initializes a new instance of the class. + + The device. + The type. + + + +

Applications use the methods of the interface to query and prepare surfaces.

+
+ +

The LPDIRECT3DSURFACE9 and PDIRECT3DSURFACE9 types are defined as references to the interface.

 typedef struct  *LPDIRECT3DSURFACE9, *PDIRECT3DSURFACE9;	
+            
+
+ + bb205892 + IDirect3DSurface9 + IDirect3DSurface9 +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Retrieves a description of the surface.

+
+ + bb205895 + GetDesc + GetDesc + HRESULT IDirect3DSurface9::GetDesc([Out] D3DSURFACE_DESC* pDesc) +
+ + +

Provides access to the parent cube texture or texture (mipmap) object, if this surface is a child level of a cube texture or a mipmap. This method can also provide access to the parent swap chain if the surface is a back-buffer child.

+
+

Reference identifier of the container being requested.

+

Address of a reference to fill with the container reference if the query succeeds. See Remarks.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

If the surface is created using CreateRenderTarget or CreateOffscreenPlainSurface or CreateDepthStencilSurface, the surface is considered stand alone. In this case, GetContainer will return the Direct3D device used to create the surface.

If the call succeeds, the reference count of the container is increased by one.

Here's an example getting the parent texture of a mip surface.

 // Assumes pSurface is a valid  reference	
+            void *pContainer = null;	
+             *pTexture = null;	
+             hr = pSurface->GetContainer(IID_IDirect3DTexture9, &pContainer);	
+            if (SUCCEEDED(hr) && pContainer)	
+            { pTexture = ( *)pContainer;	
+            }	
+            
+
+ + bb205893 + HRESULT IDirect3DSurface9::GetContainer([In] const GUID& riid,[Out] void** ppContainer) + IDirect3DSurface9::GetContainer +
+ + +

Retrieves a description of the surface.

+
+

Pointer to a structure, describing the surface.

+

If the method succeeds, the return value is .

is returned if the argument is invalid.

+ + bb205895 + HRESULT IDirect3DSurface9::GetDesc([Out] D3DSURFACE_DESC* pDesc) + IDirect3DSurface9::GetDesc +
+ + +

Locks a rectangle on a surface.

+
+

Pointer to a structure that describes the locked region.

+

Pointer to a rectangle to lock. Specified by a reference to a structure. Specifying null for this parameter expands the dirty region to cover the entire surface.

+

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

You may not specify a subrect when using . For a description of the flags, see .

+

If the method succeeds, the return value is .

If the method fails, the return value can be or .

+ +

If the flag is specified and the driver cannot lock the surface immediately, will return so that an application can use the CPU cycles while waiting for the driver to lock the surface.

The only lockable format for a depth-stencil surface is . See .

For performance reasons, dirty regions are recorded only for level zero of a texture. Dirty regions are automatically recorded when is called without or . See for more information.

A multisample back buffer cannot be locked.

This method cannot retrieve data from a surface that is is contained by a texture resource created with because such a texture must be assigned to memory and is therefore not lockable. In this case, use instead to copy texture data from device memory to system memory.

+
+ + bb205896 + HRESULT IDirect3DSurface9::LockRect([Out] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) + IDirect3DSurface9::LockRect +
+ + +

Unlocks a rectangle on a surface.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205898 + HRESULT IDirect3DSurface9::UnlockRect() + IDirect3DSurface9::UnlockRect +
+ + +

Retrieves a device context.

+
+

Pointer to the device context for the surface.

+ +

The following restrictions apply.

  • is valid on the following formats only: , , , and . Formats that contain Alpha are not supported because the GDI implementations don't have a well-defined behavior on the alpha channel. For more information about formats, see .
  • Only one device context per surface can be returned at a time.
  • will fail if the surface is already locked. If the surface is a member of a mipmap or cubemap, fails if any other mipmap or cubemap member is locked.
  • fails on render targets unless they were created lockable (or, in the case of back buffers, with the flag).
  • For surfaces not created with , will fail on default pool () surfaces unless they are dynamic () or are lockable render targets.
  • will fail on surfaces.

When a device context is outstanding on a surface, the application may not call these methods:

*

?

* (on a swap chain that contains the surface)

causes an implicit lock; do not retain the device context for later use. Call to release it.

It is valid to call / on levels of a mipmap or cubemap, however, these calls will be slow to all miplevels except the topmost level, and GDI operations to these miplevels will not be accelerated.

The hdc provides access to Win32 and GDI functionality.

+
+ + bb205894 + HRESULT IDirect3DSurface9::GetDC([Out] HDC* phdc) + IDirect3DSurface9::GetDC +
+ + +

Release a device context handle.

+
+

Handle to a device context.

+

If the method succeeds, the return value is . is returned if the argument is invalid.

+ +

An hdc is a Windows resource. It must be released after use so Windows can return it to the pool of available resources.

This method will release only the device context returned by . Otherwise, this method will fail.

+
+ + bb205897 + HRESULT IDirect3DSurface9::ReleaseDC([In] HDC hdc) + IDirect3DSurface9::ReleaseDC +
+ + + Creates a depth-stencil surface. + + The device. + The width. + The height. + The format. + Type of the multisample. + The multisample quality. + if set to true [discard]. + A reference to a , representing the created depth-stencil surface resource. + HRESULT IDirect3DDevice9::CreateDepthStencilSurface([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Discard,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle) + + + + Creates a depth-stencil surface. + + The device. + The width. + The height. + The format. + Type of the multisample. + The multisample quality. + if set to true [discard]. + The shared handle. + A reference to a , representing the created depth-stencil surface resource. + HRESULT IDirect3DDevice9::CreateDepthStencilSurface([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Discard,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle) + + + + Creates a depth-stencil surface. + + The device. + The width. + The height. + The format. + Type of the multisample. + The multisample quality. + if set to true [discard]. + The usage. + A reference to a , representing the created depth-stencil surface resource. + HRESULT IDirect3DDevice9Ex::CreateDepthStencilSurfaceEx([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Discard,[Out, Fast] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle,[In] unsigned int Usage) + + + + Creates a depth-stencil surface. + + The device. + The width. + The height. + The format. + Type of the multisample. + The multisample quality. + if set to true [discard]. + The usage. + The shared handle. + A reference to a , representing the created depth-stencil surface resource. + HRESULT IDirect3DDevice9Ex::CreateDepthStencilSurfaceEx([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Discard,[Out, Fast] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle,[In] unsigned int Usage) + + + + Create an off-screen surface. + + The device. + The width. + The height. + The format. + The pool. + A created. + HRESULT IDirect3DDevice9::CreateOffscreenPlainSurface([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle) + + + + Create an off-screen surface. + + The device. + The width. + The height. + The format. + The pool. + The shared handle. + A created. + HRESULT IDirect3DDevice9::CreateOffscreenPlainSurface([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle) + + + + Create an off-screen surface. + + The device. + The width. + The height. + The format. + The pool. + The usage. + + A created. + + HRESULT IDirect3DDevice9Ex::CreateOffscreenPlainSurfaceEx([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle,[In] unsigned int Usage) + + + + Create an off-screen surface. + + The device. + The width. + The height. + The format. + The pool. + The usage. + The shared handle. + + A created. + + HRESULT IDirect3DDevice9Ex::CreateOffscreenPlainSurfaceEx([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle,[In] unsigned int Usage) + + + + Creates a render-target surface. + + The device. + The width. + The height. + The format. + Type of the multisample. + The multisample quality. + if set to true [lockable]. + + A render-target . + + HRESULT IDirect3DDevice9::CreateRenderTarget([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Lockable,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle) + + + + Creates a render-target surface. + + The device. + The width. + The height. + The format. + Type of the multisample. + The multisample quality. + if set to true [lockable]. + The shared handle. + + A render-target . + + HRESULT IDirect3DDevice9::CreateRenderTarget([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Lockable,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle) + + + + Creates a render-target surface. + + The device. + The width. + The height. + The format. + Type of the multisample. + The multisample quality. + if set to true [lockable]. + The usage. + A render-target . + HRESULT IDirect3DDevice9Ex::CreateRenderTargetEx([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Lockable,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle,[In] unsigned int Usage) + + + + Creates a render-target surface. + + The device. + The width. + The height. + The format. + Type of the multisample. + The multisample quality. + if set to true [lockable]. + The usage. + The shared handle. + A render-target . + HRESULT IDirect3DDevice9Ex::CreateRenderTargetEx([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Lockable,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle,[In] unsigned int Usage) + + + + Loads a surface from a file. + + The surface. + Name of the file. + The filter. + The color key. + A object describing the result of the operation. + HRESULT D3DXLoadSurfaceFromFileW([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const wchar_t* pSrcFile,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a surface from a file. + + The surface. + Name of the file. + The filter. + The color key. + The source rectangle. + The destination rectangle. + A object describing the result of the operation. + HRESULT D3DXLoadSurfaceFromFileW([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const wchar_t* pSrcFile,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a surface from a file. + + The surface. + Name of the file. + The filter. + The color key. + The source rectangle. + The destination rectangle. + The image information. + A object describing the result of the operation. + HRESULT D3DXLoadSurfaceFromFileW([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const wchar_t* pSrcFile,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a surface from a file. + + The surface. + Name of the file. + The filter. + The color key. + The source rectangle. + The destination rectangle. + The palette. + The image information. + A object describing the result of the operation. + HRESULT D3DXLoadSurfaceFromFileW([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const wchar_t* pSrcFile,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a surface from a file in memory. + + The surface. + The memory. + The filter. + The color key. + A object describing the result of the operation. + HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a surface from a file in memory. + + The surface. + The memory. + The filter. + The color key. + The source rectangle. + The destination rectangle. + A object describing the result of the operation. + HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a surface from a file in memory. + + The surface. + The memory. + The filter. + The color key. + The source rectangle. + The destination rectangle. + The image information. + A object describing the result of the operation. + HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a surface from a file in memory. + + The surface. + The memory. + The filter. + The color key. + The source rectangle. + The destination rectangle. + The palette. + The image information. + A object describing the result of the operation. + HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a surface from a file in memory. + + The surface. + The stream. + The filter. + The color key. + + A object describing the result of the operation. + + HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a surface from a file in memory. + + The surface. + The stream. + The filter. + The color key. + The source rectangle. + The destination rectangle. + + A object describing the result of the operation. + + HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a surface from a file in memory. + + The surface. + The stream. + The filter. + The color key. + The source rectangle. + The destination rectangle. + The image information. + + A object describing the result of the operation. + + HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a surface from a file in memory. + + The surface. + The stream. + The filter. + The color key. + The source rectangle. + The destination rectangle. + The palette. + The image information. + + A object describing the result of the operation. + + HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a surface from a file in memory. + + The surface. + The stream. + The filter. + The color key. + The source rectangle. + The destination rectangle. + The palette. + The image information. + A object describing the result of the operation. + HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a surface from memory. + + The surface. + The data. + The filter. + The color key. + The source format. + The source pitch. + The source rectangle. + + A object describing the result of the operation. + + HRESULT D3DXLoadSurfaceFromMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcPitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) + + + + Loads a surface from memory. + + The surface. + The data. + The filter. + The color key. + The source format. + The source pitch. + The source rectangle. + The destination rectangle. + + A object describing the result of the operation. + + HRESULT D3DXLoadSurfaceFromMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcPitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) + + + + Loads a surface from memory. + + The surface. + The data. + The filter. + The color key. + The source format. + The source pitch. + The source rectangle. + The source palette. + The destination palette. + + A object describing the result of the operation. + + HRESULT D3DXLoadSurfaceFromMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcPitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) + + + + Loads a surface from memory. + + The surface. + The data. + The filter. + The color key. + The source format. + The source pitch. + The source rectangle. + The destination rectangle. + The source palette. + The destination palette. + A object describing the result of the operation. + HRESULT D3DXLoadSurfaceFromMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcPitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) + + + + Loads a surface from memory. + + The surface. + The stream. + The filter. + The color key. + The source format. + The source pitch. + The source rectangle. + + A object describing the result of the operation. + + HRESULT D3DXLoadSurfaceFromMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcPitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) + + + + Loads a surface from memory. + + The surface. + The stream. + The filter. + The color key. + The source format. + The source pitch. + The source rectangle. + The destination rectangle. + + A object describing the result of the operation. + + HRESULT D3DXLoadSurfaceFromMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcPitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) + + + + Loads a surface from memory. + + The surface. + The stream. + The filter. + The color key. + The source format. + The source pitch. + The source rectangle. + The source palette. + The destination palette. + + A object describing the result of the operation. + + HRESULT D3DXLoadSurfaceFromMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcPitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) + + + + Loads a surface from memory. + + The surface. + The stream. + The filter. + The color key. + The source format. + The source pitch. + The source rectangle. + The destination rectangle. + The source palette. + The destination palette. + + A object describing the result of the operation. + + HRESULT D3DXLoadSurfaceFromMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcPitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) + + + + Loads a surface from a source surface. + + The destination surface. + The source surface. + The filter. + The color key. + + A object describing the result of the operation. + + HRESULT D3DXLoadSurfaceFromSurface([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) + + + + Loads a surface from a source surface. + + The destination surface. + The source surface. + The filter. + The color key. + The source rectangle. + The destination rectangle. + + A object describing the result of the operation. + + HRESULT D3DXLoadSurfaceFromSurface([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) + + + + Loads a surface from a source surface. + + The destination surface. + The source surface. + The filter. + The color key. + The source rectangle. + The destination rectangle. + The destination palette. + The source palette. + + A object describing the result of the operation. + + HRESULT D3DXLoadSurfaceFromSurface([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) + + + + Gets the parent cube texture or texture (mipmap) object, if this surface is a child level of a cube texture or a mipmap. + This method can also provide access to the parent swap chain if the surface is a back-buffer child. + + + The GUID. + The parent container texture. + + + + Locks a rectangle on a surface. + + The type of lock to perform. + A pointer to the locked region + HRESULT IDirect3DSurface9::LockRect([Out] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) + + + + Locks a rectangle on a surface. + + The rectangle to lock. + The type of lock to perform. + A pointer to the locked region + HRESULT IDirect3DSurface9::LockRect([Out] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) + + + + Locks a rectangle on a surface. + + The type of lock to perform. + The stream pointing to the locked region. + A pointer to the locked region + HRESULT IDirect3DSurface9::LockRect([Out] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) + + + + Locks a rectangle on a surface. + + The rectangle to lock. + The type of lock to perform. + The stream pointing to the locked region. + A pointer to the locked region + HRESULT IDirect3DSurface9::LockRect([Out] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) + + + + Saves a surface to a file. + + The surface. + Name of the file. + The format. + + A object describing the result of the operation. + + HRESULT D3DXSaveSurfaceToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect) + + + + Saves a surface to a file. + + The surface. + Name of the file. + The format. + The rectangle. + + A object describing the result of the operation. + + HRESULT D3DXSaveSurfaceToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect) + + + + Saves a surface to a file. + + The surface. + Name of the file. + The format. + The rectangle. + The palette. + + A object describing the result of the operation. + + HRESULT D3DXSaveSurfaceToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect) + + + + Saves a surface to a stream. + + The surface. + The format. + + A object describing the result of the operation. + + HRESULT D3DXSaveSurfaceToFileInMemory([In] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect) + + + + Saves a surface to a stream. + + The surface. + The format. + The rectangle. + + A object describing the result of the operation. + + HRESULT D3DXSaveSurfaceToFileInMemory([In] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect) + + + + Saves a surface to a stream. + + The surface. + The format. + The rectangle. + The palette. + + A object describing the result of the operation. + + HRESULT D3DXSaveSurfaceToFileInMemory([In] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect) + + + +

Presents the contents of the next buffer in the sequence of back buffers owned by the swap chain.

+
+ +

The Present method is a shortcut to Present. Present has been updated to take a flag allowing the application to request that the method return immediately when the driver reports that it cannot schedule a presentation.

If necessary, a stretch operation is applied to transfer the pixels within the source rectangle to the destination rectangle in the client area of the target window.

Present will fail if called between BeginScene and EndScene pairs unless the render target is not the current render target (such as the back buffer you get from creating an additional swap chain). This is a new behavior for Direct3D 9.

+
+ + bb205908 + IDirect3DSwapChain9 + IDirect3DSwapChain9 +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Returns information describing the raster of the monitor on which the swap chain is presented.

+
+ + bb205907 + GetRasterStatus + GetRasterStatus + HRESULT IDirect3DSwapChain9::GetRasterStatus([Out] D3DRASTER_STATUS* pRasterStatus) +
+ + +

Retrieves the display mode's spatial resolution, color resolution, and refresh frequency.

+
+ + bb205904 + GetDisplayMode + GetDisplayMode + HRESULT IDirect3DSwapChain9::GetDisplayMode([Out] D3DDISPLAYMODE* pMode) +
+ + +

Retrieves the device associated with the swap chain.

+
+ +

This method allows navigation to the owning device object.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

+
+ + bb205903 + GetDevice + GetDevice + HRESULT IDirect3DSwapChain9::GetDevice([Out] IDirect3DDevice9** ppDevice) +
+ + +

Retrieves the presentation parameters associated with a swap chain.

+
+ +

This method can be used to see the presentation parameters of the parent swap chain of a surface (a back buffer, for instance). The parent swap chain can be retrieved with .

+
+ + bb205906 + GetPresentParameters + GetPresentParameters + HRESULT IDirect3DSwapChain9::GetPresentParameters([Out] D3DPRESENT_PARAMETERS* pPresentationParameters) +
+ + +

Presents the contents of the next buffer in the sequence of back buffers owned by the swap chain.

+
+

Pointer to the source rectangle (see ). Use null to present the entire surface. This value must be null unless the swap chain was created with . If the rectangle exceeds the source surface, the rectangle is clipped to the source surface.

+

Pointer to the destination rectangle in client coordinates (see ). This value must be null unless the swap chain was created with . Use null to fill the entire client area. If the rectangle exceeds the destination client area, the rectangle is clipped to the destination client area.

+

Destination window whose client area is taken as the target for this presentation. If this value is null, the runtime uses the hDeviceWindow member of for the presentation.

+

This value must be null unless the swap chain was created with . See Flipping Surfaces (Direct3D 9). If this value is non-null, the contained region is expressed in back buffer coordinates. The rectangles within the region are the minimal set of pixels that need to be updated. This method takes these rectangles into account when optimizing the presentation by copying only the pixels within the region, or some suitably expanded set of rectangles. This is an aid to optimization only, and the application should not rely on the region being copied exactly. The implementation may choose to copy the whole source rectangle.

+

Allows the application to request that the method return immediately when the driver reports that it cannot schedule a presentation. Valid values are 0, or any combination of or .

  • If dwFlags = 0, this method behaves as it did prior to Direct3D 9. Present will spin until the hardware is free, without returning an error.
  • If dwFlags = , and the hardware is busy processing or waiting for a vertical sync interval, the method will return .
  • If dwFlags = , gamma correction is performed from linear space to sRGB for windowed swap chains. This flag will take effect only when the driver exposes (see Gamma (Direct3D 9)). Appliations should specify this flag if the backbuffer format is 16-bit floating point in order to match windowed mode present to fullscreen gamma behavior.
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , , , E_OUTOFMEMORY.

+ +

The Present method is a shortcut to Present. Present has been updated to take a flag allowing the application to request that the method return immediately when the driver reports that it cannot schedule a presentation.

If necessary, a stretch operation is applied to transfer the pixels within the source rectangle to the destination rectangle in the client area of the target window.

Present will fail if called between BeginScene and EndScene pairs unless the render target is not the current render target (such as the back buffer you get from creating an additional swap chain). This is a new behavior for Direct3D 9.

+
+ + bb205908 + HRESULT IDirect3DSwapChain9::Present([In, Optional] const void* pSourceRect,[InOut, Optional] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags) + IDirect3DSwapChain9::Present +
+ + +

Generates a copy of the swapchain's front buffer and places that copy in a system memory buffer provided by the application.

+
+

Pointer to an interface that will receive a copy of the swapchain's front buffer. The data is returned in successive rows with no intervening space, starting from the vertically highest row to the lowest. For windowed mode, the size of the destination surface should be the size of the desktop. For full screen mode, the size of the destination surface should be the screen size.

+

If the method succeeds, the return value is . If BackBuffer exceeds or equals the total number of back buffers, the function fails and returns .

+ +

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

+
+ + bb205905 + HRESULT IDirect3DSwapChain9::GetFrontBufferData([In] IDirect3DSurface9* pDestSurface) + IDirect3DSwapChain9::GetFrontBufferData +
+ + +

Retrieves a back buffer from the swap chain of the device.

+
+

Index of the back buffer object to return. Back buffers are numbered from 0 to the total number of back buffers - 1. A value of 0 returns the first back buffer, not the front buffer. The front buffer is not accessible through this method. Use to retrieve a copy of the front buffer.

+

Stereo view is not supported in Direct3D 9, so the only valid value for this parameter is .

+

Address of a reference to an interface, representing the returned back buffer surface.

+ +

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak. You must release any surfaces obtained through this method before releasing the swap chain it belongs to.

+
+ + bb205902 + HRESULT IDirect3DSwapChain9::GetBackBuffer([In] unsigned int iBackBuffer,[In] D3DBACKBUFFER_TYPE Type,[Out] IDirect3DSurface9** ppBackBuffer) + IDirect3DSwapChain9::GetBackBuffer +
+ + +

Returns information describing the raster of the monitor on which the swap chain is presented.

+
+

Pointer to a structure filled with information about the position or other status of the raster on the monitor driven by this adapter.

+

If the method succeeds, the return value is . is returned if pRasterStatus is invalid or if the device does not support reading the current scan line. To determine if the device supports reading the scan line, check for the flag in the Caps member of .

+ + bb205907 + HRESULT IDirect3DSwapChain9::GetRasterStatus([Out] D3DRASTER_STATUS* pRasterStatus) + IDirect3DSwapChain9::GetRasterStatus +
+ + +

Retrieves the display mode's spatial resolution, color resolution, and refresh frequency.

+
+

Pointer to a structure containing data about the display mode of the adapter. As opposed to the display mode of the device, which may not be active if the device does not own full-screen mode.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205904 + HRESULT IDirect3DSwapChain9::GetDisplayMode([Out] D3DDISPLAYMODE* pMode) + IDirect3DSwapChain9::GetDisplayMode +
+ + +

Retrieves the device associated with the swap chain.

+
+

Address of a reference to an interface to fill with the device reference, if the query succeeds.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

This method allows navigation to the owning device object.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

+
+ + bb205903 + HRESULT IDirect3DSwapChain9::GetDevice([Out] IDirect3DDevice9** ppDevice) + IDirect3DSwapChain9::GetDevice +
+ + +

Retrieves the presentation parameters associated with a swap chain.

+
+

Pointer to the presentation parameters. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

This method can be used to see the presentation parameters of the parent swap chain of a surface (a back buffer, for instance). The parent swap chain can be retrieved with .

+
+ + bb205906 + HRESULT IDirect3DSwapChain9::GetPresentParameters([Out] D3DPRESENT_PARAMETERS* pPresentationParameters) + IDirect3DSwapChain9::GetPresentParameters +
+ + + Initializes a new instance of the class. + + The device. + The present parameters. + HRESULT IDirect3DDevice9::CreateAdditionalSwapChain([In] D3DPRESENT_PARAMETERS* pPresentationParameters,[In] IDirect3DSwapChain9** pSwapChain) + + + + Retrieves a back buffer from the swap chain of the device. + + The i back buffer. + The back buffer from the swap chain of the device. + HRESULT IDirect3DSwapChain9::GetBackBuffer([In] unsigned int iBackBuffer,[In] D3DBACKBUFFER_TYPE Type,[Out] IDirect3DSurface9** ppBackBuffer) + + + + Presents the contents of the next buffer in the sequence of back buffers to the screen. + + The present flags. + HRESULT IDirect3DSwapChain9::Present([In, Optional] const void* pSourceRect,[InOut, Optional] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags) + + + + Presents the contents of the next buffer in the sequence of back buffers to the screen. + + The present flags. + The area of the back buffer that should be presented. + The area of the front buffer that should receive the result of the presentation. + HRESULT IDirect3DSwapChain9::Present([In, Optional] const void* pSourceRect,[InOut, Optional] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags) + + + + Presents the contents of the next buffer in the sequence of back buffers to the screen. + + The present flags. + The area of the back buffer that should be presented. + The area of the front buffer that should receive the result of the presentation. + The destination window whose client area is taken as the target for this presentation. + HRESULT IDirect3DSwapChain9::Present([In, Optional] const void* pSourceRect,[InOut, Optional] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags) + + + + Presents the contents of the next buffer in the sequence of back buffers to the screen. + + The flags. + The area of the back buffer that should be presented. + The area of the front buffer that should receive the result of the presentation. + The destination window whose client area is taken as the target for this presentation. + Specifies a region on the back buffer that contains the minimal amount of pixels that need to be updated. + HRESULT IDirect3DSwapChain9::Present([In, Optional] const void* pSourceRect,[InOut, Optional] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags) + + + +

Applications use the methods of the interface to manipulate a swap chain.

+
+ +

There is always at least one swap chain for each device, known as the implicit swap chain. However, an additional swap chain for rendering multiple views from the same device can be created by calling the CreateAdditionalSwapChain method.

This interface, like all COM interfaces, inherits from the interface.

The LPDIRECT3DSWAPCHAIN9 and PDIRECT3DSWAPCHAIN9 types are defined as references to the interface.

objects are returned as a reference to an object when GetSwapChain is called on an instance of . + The interface is obtained by calling QueryInterface on the instance of that was returned by GetSwapChain.

+
+ + bb172503 + IDirect3DSwapChain9Ex + IDirect3DSwapChain9Ex +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Returns the number of times the swapchain has been processed.

+
+ + bb205900 + GetLastPresentCount + GetLastPresentCount + HRESULT IDirect3DSwapChain9Ex::GetLastPresentCount([Out] unsigned int* pLastPresentCount) +
+ + + No documentation. + + + GetPresentStats + GetPresentStats + HRESULT IDirect3DSwapChain9Ex::GetPresentStats([Out] D3DPRESENTSTATS* pPresentationStatistics) + + + +

Returns the number of times the swapchain has been processed.

+
+

Pointer to a UINT to be filled with the number of times the method has been called. The count will also be incremented by calling some other APIs such as .

+

the method was successful.

+ + bb205900 + HRESULT IDirect3DSwapChain9Ex::GetLastPresentCount([Out] unsigned int* pLastPresentCount) + IDirect3DSwapChain9Ex::GetLastPresentCount +
+ + + No documentation. + + No documentation. + No documentation. + + HRESULT IDirect3DSwapChain9Ex::GetPresentStats([Out] D3DPRESENTSTATS* pPresentationStatistics) + IDirect3DSwapChain9Ex::GetPresentStats + + + +

Retrieves the display mode's spatial resolution, color resolution, refresh frequency, and rotation settings.

+
+

Pointer to a structure containing data about the display mode of the adapter. As opposed to the display mode of the device, which may not be active if the device does not own full-screen mode.

+

Pointer to a indicating the type of screen rotation the application will do. The value returned through this reference is important when the flag is used; otherwise, it can be set to null.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb509715 + HRESULT IDirect3DSwapChain9Ex::GetDisplayModeEx([Out] D3DDISPLAYMODEEX* pMode,[Out] D3DDISPLAYROTATION* pRotation) + IDirect3DSwapChain9Ex::GetDisplayModeEx +
+ + +

Applications use the methods of the interface to manipulate a texture resource.

+
+ +

The interface can be obtained by calling the method or one of the xxx functions.

This interface inherits additional functionality from the interface.

This interface, like all COM interfaces, inherits from the interface.

The LPDIRECT3DTEXTURE9 and PDIRECT3DTEXTURE9 types are defined as references to the interface.

 typedef struct  *LPDIRECT3DTEXTURE9, *PDIRECT3DTEXTURE9;	
+            
+
+ + bb205909 + IDirect3DTexture9 + IDirect3DTexture9 +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Retrieves a level description of a texture resource.

+
+

Identifies a level of the texture resource. This method returns a surface description for the level specified by this parameter.

+

Pointer to a structure, describing the returned level.

+ + bb205911 + HRESULT IDirect3DTexture9::GetLevelDesc([In] unsigned int Level,[Out] D3DSURFACE_DESC* pDesc) + IDirect3DTexture9::GetLevelDesc +
+ + +

Retrieves the specified texture surface level.

+
+

Identifies a level of the texture resource. This method returns a surface for the level specified by this parameter. The top-level surface is denoted by 0.

+

Address of a reference to an interface, representing the returned surface.

+ +

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

+
+ + bb205912 + HRESULT IDirect3DTexture9::GetSurfaceLevel([In] unsigned int Level,[Out] IDirect3DSurface9** ppSurfaceLevel) + IDirect3DTexture9::GetSurfaceLevel +
+ + +

Locks a rectangle on a texture resource.

+
+

Specifies the level of the texture resource to lock.

+

Pointer to a structure, describing the locked region.

+

Pointer to a rectangle to lock. Specified by a reference to a structure. Specifying null for this parameter expands the dirty region to cover the entire texture.

+

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

You may not specify a subrect when using . For a description of the flags, see .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

Textures created with are not lockable. Textures created in video memory are lockable when created with USAGE_DYNAMIC.

For performance reasons, dirty regions are recorded only for level zero of a texture. Dirty regions are automatically recorded when is called without or . See for more information.

The only lockable format for a depth-stencil texture is D3DLOCK_D16_LOCKABLE.

Video memory textures cannot be locked, but must be modified by calling or . There are exceptions for some proprietary driver pixel formats that Direct3D 9 does not recognize. These can be locked.

This method cannot retrieve data from a texture resource created with because such a texture must be assigned to memory and is therefore not lockable. In this case, use instead to copy texture data from device memory to system memory.

+
+ + bb205913 + HRESULT IDirect3DTexture9::LockRect([In] unsigned int Level,[Out] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) + IDirect3DTexture9::LockRect +
+ + +

Unlocks a rectangle on a texture resource.

+
+

Specifies the level of the texture resource to unlock.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205914 + HRESULT IDirect3DTexture9::UnlockRect([In] unsigned int Level) + IDirect3DTexture9::UnlockRect +
+ + +

Adds a dirty region to a texture resource.

+
+

Pointer to a structure, specifying the dirty region to add. Specifying null expands the dirty region to cover the entire texture.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

For performance reasons, dirty regions are only recorded for level zero of a texture. For sublevels, it is assumed that the corresponding (scaled) rectangle or box is also dirty. Dirty regions are automatically recorded when is called without or . The destination surface of is also marked dirty automatically.

Using and explicitly specifying dirty regions can be used to increase the efficiency of . Using this method, applications can optimize what subset of a resource is copied by specifying dirty regions on the resource. However, the dirty regions may be expanded to optimize alignment.

+
+ + bb205910 + HRESULT IDirect3DTexture9::AddDirtyRect([In] const void* pDirtyRect) + IDirect3DTexture9::AddDirtyRect +
+ + + Initializes a new instance of the class. + + The device. + The width. + The height. + The level count. + The usage. + The format. + The pool. + HRESULT IDirect3DDevice9::CreateTexture([In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Levels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DTexture9** ppTexture,[In] void** pSharedHandle) + + + + Initializes a new instance of the class. + + The device. + The width. + The height. + The level count. + The usage. + The format. + The pool. + The shared handle. + HRESULT IDirect3DDevice9::CreateTexture([In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Levels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DTexture9** ppTexture,[In] void** pSharedHandle) + + + + Checks texture-creation parameters. + + Device associated with the texture. + The width. + The height. + Requested number of mipmap levels for the texture. + The requested usage for the texture. + Requested format for the texture. + Memory class where the resource will be placed. + + A value type containing the proposed values to pass to the texture creation functions. + + HRESULT D3DXCheckTextureRequirements([In] IDirect3DDevice9* pDevice,[InOut] unsigned int* pWidth,[InOut] unsigned int* pHeight,[InOut] unsigned int* pNumMipLevels,[In] unsigned int Usage,[InOut] D3DFORMAT* pFormat,[In] D3DPOOL Pool) + + + + Computes the normal map. + + The texture. + The source texture. + The flags. + The channel. + The amplitude. + A object describing the result of the operation. + HRESULT D3DXComputeNormalMap([In] IDirect3DTexture9* pTexture,[In] IDirect3DTexture9* pSrcTexture,[Out, Buffer] const PALETTEENTRY* pSrcPalette,[In] unsigned int Flags,[In] unsigned int Channel,[In] float Amplitude) + + + + Computes the normal map. + + The texture. + The source texture. + The palette. + The flags. + The channel. + The amplitude. + A object describing the result of the operation. + HRESULT D3DXComputeNormalMap([In] IDirect3DTexture9* pTexture,[In] IDirect3DTexture9* pSrcTexture,[Out, Buffer] const PALETTEENTRY* pSrcPalette,[In] unsigned int Flags,[In] unsigned int Channel,[In] float Amplitude) + + + + Uses a user-provided function to fill each texel of each mip level of a given texture. + + A function that is used to fill the texture. + A object describing the result of the operation. + HRESULT D3DXFillTexture([In] IDirect3DTexture9* pTexture,[In] __function__stdcall* pFunction,[In] void* pData) + + + + Uses a compiled high-level shader language (HLSL) function to fill each texel of each mipmap level of a texture. + + A texture shader object that is used to fill the texture. + A object describing the result of the operation. + HRESULT D3DXFillTextureTX([In] IDirect3DTexture9* pTexture,[In] ID3DXTextureShader* pTextureShader) + + + + Locks a rectangle on a texture resource. + + The level. + The flags. + + A describing the region locked. + + HRESULT IDirect3DTexture9::LockRect([In] unsigned int Level,[Out] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) + + + + Locks a rectangle on a texture resource. + + The level. + The flags. + The stream pointing to the locked region. + + A describing the region locked. + + HRESULT IDirect3DTexture9::LockRect([In] unsigned int Level,[Out] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) + + + + Locks a rectangle on a texture resource. + + The level. + The rectangle. + The flags. + + A describing the region locked. + + HRESULT IDirect3DTexture9::LockRect([In] D3DCUBEMAP_FACES FaceType,[In] unsigned int Level,[In] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) + + + + Locks a rectangle on a texture resource. + + The level. + The rectangle. + The flags. + The stream pointing to the locked region. + + A describing the region locked. + + HRESULT IDirect3DTexture9::LockRect([In] D3DCUBEMAP_FACES FaceType,[In] unsigned int Level,[In] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) + + + + Adds a dirty region to a texture resource. + + + A object describing the result of the operation. + + HRESULT IDirect3DTexture9::AddDirtyRect([In] const void* pDirtyRect) + + + + Adds a dirty region to a texture resource. + + The dirty rect ref. + + A object describing the result of the operation. + + HRESULT IDirect3DTexture9::AddDirtyRect([In] const void* pDirtyRect) + + + + Creates a from a file + + The device. + The filename. + + A + + HRESULT D3DXCreateTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + + + + Creates a from a file + + The device. + The filename. + The usage. + The pool. + + A + + HRESULT D3DXCreateTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + + + + Creates a from a file + + The device. + The filename. + The width. + The height. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + + A + + HRESULT D3DXCreateTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + + + + Creates a from a file + + The device. + The filename. + The width. + The height. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + + A + + HRESULT D3DXCreateTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + + + + Creates a from a file + + The device. + The filename. + The width. + The height. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + + A + + HRESULT D3DXCreateTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + + + + Creates a from a memory buffer. + + The device. + The buffer. + + A + + HRESULT D3DXCreateTextureFromFileInMemory([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] IDirect3DTexture9** ppTexture) + + + + Creates a from a memory buffer. + + The device. + The buffer. + The usage. + The pool. + + A + + HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + + + + Creates a from a memory buffer. + + The device. + The buffer. + The width. + The height. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + + A + + HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + + + + Creates a from a memory buffer. + + The device. + The buffer. + The width. + The height. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + + A + + HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + + + + Creates a from a memory buffer. + + The device. + The buffer. + The width. + The height. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + + A + + HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + + + + Creates a from a stream. + + The device. + The stream. + A + HRESULT D3DXCreateTextureFromFileInMemory([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] IDirect3DTexture9** ppTexture) + + + + Creates a from a stream. + + The device. + The stream. + The usage. + The pool. + + A + + HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + + + + Creates a from a stream. + + The device. + The stream. + The width. + The height. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + + A + + HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + + + + Creates a from a stream. + + The device. + The stream. + The size bytes. + The width. + The height. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + + A + + HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + + + + Creates a from a stream. + + The device. + The stream. + The size bytes. + The width. + The height + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + + A + + HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + + + + Creates a from a stream. + + The device. + The stream. + The size bytes. + The width. + The height. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + + A + + HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + + + + Creates a from a stream. + + The device. + The buffer. + The width. + The height. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + + A + + HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + + + + Creates a from a stream. + + The device. + The stream. + The size bytes. + The width. + The height + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + A + HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + + + + Creates a from a stream. + + The device. + The pointer. + The size in bytes. + The width. + The height. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + + A + + HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + + + + Creates a from a stream. + + The device. + Name of the file. + The width. + The height. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + + A + + HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) + + + +

The interface.

+
+ +

The interface is obtained by calling the function.

The interface, like all COM interfaces, inherits the interface.

The LPD3DXTEXTURESHADER type is defined as a reference to the interface.

 typedef interface  *LPD3DXTEXTURESHADER;	
+            
+
+ + bb174276 + ID3DXTextureShader + ID3DXTextureShader +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Gets a reference to the function DWORD stream.

+
+ + bb174283 + GetFunction + GetFunction + HRESULT ID3DXTextureShader::GetFunction([Out] ID3DXBuffer** ppFunction) +
+ + +

Get a reference to the constant table.

+
+ + bb174278 + GetConstantBuffer + GetConstantBuffer + HRESULT ID3DXTextureShader::GetConstantBuffer([Out] ID3DXBuffer** ppConstantBuffer) +
+ + +

Gets a description of the constant table.

+
+ + bb174282 + GetDesc + GetDesc + HRESULT ID3DXTextureShader::GetDesc([Out] D3DXCONSTANTTABLE_DESC* pDesc) +
+ + +

Gets a reference to the function DWORD stream.

+
+

A reference to the function DWORD stream. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ + bb174283 + HRESULT ID3DXTextureShader::GetFunction([Out] ID3DXBuffer** ppFunction) + ID3DXTextureShader::GetFunction +
+ + +

Get a reference to the constant table.

+
+

Pointer to an interface, which contains the constants.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ + bb174278 + HRESULT ID3DXTextureShader::GetConstantBuffer([Out] ID3DXBuffer** ppConstantBuffer) + ID3DXTextureShader::GetConstantBuffer +
+ + +

Gets a description of the constant table.

+
+

The attributes of the constant table. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ + bb174282 + HRESULT ID3DXTextureShader::GetDesc([Out] D3DXCONSTANTTABLE_DESC* pDesc) + ID3DXTextureShader::GetDesc +
+ + +

Gets a reference to the array of constants in the constant table.

+
+

Unique identifier to a constant. See .

+

Returns a reference to an array of descriptions. See .

+

The input supplied must be the maximum size of the array. The output is the number of elements that are filled in the array when the function returns.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

+ +

Samplers can appear more than once in a constant table, therefore, this method can return an array of descriptions each with a different register index.

+
+ + bb174280 + HRESULT ID3DXTextureShader::GetConstantDesc([In] D3DXHANDLE hConstant,[Out, Buffer] D3DXCONSTANT_DESC* pConstantDesc,[InOut] unsigned int* pCount) + ID3DXTextureShader::GetConstantDesc +
+ + +

Gets a constant by looking up its index.

+
+

A handle to the parent data structure. If the constant is a top-level parameter (there is no parent data structure), use null.

+

Zero-based index of the constant.

+

Returns a unique identifier to the constant.

+ +

To get a constant from an array of constants, use .

+
+ + bb174277 + D3DXHANDLE ID3DXTextureShader::GetConstant([In] D3DXHANDLE hConstant,[In] unsigned int Index) + ID3DXTextureShader::GetConstant +
+ + +

Gets a constant by looking up its name.

+
+

A handle to the parent data structure. If the constant is a top-level parameter (there is no parent data structure), use null.

+

A string containing the name of the constant.

+

Returns a unique identifier to the constant.

+ + bb174279 + D3DXHANDLE ID3DXTextureShader::GetConstantByName([In] D3DXHANDLE hConstant,[In] const char* pName) + ID3DXTextureShader::GetConstantByName +
+ + +

Get a constant from the constant table.

+
+

A handle to the array of constants. This value may not be null.

+

Zero-based index of the element in the constant table.

+

Returns a unique identifier to the constant.

+ +

To get a constant that is not part of an array, use or .

+
+ + bb174281 + D3DXHANDLE ID3DXTextureShader::GetConstantElement([In] D3DXHANDLE hConstant,[In] unsigned int Index) + ID3DXTextureShader::GetConstantElement +
+ + +

Sets the constants to the default values declared in the shader.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174286 + HRESULT ID3DXTextureShader::SetDefaults() + ID3DXTextureShader::SetDefaults +
+ + +

Sets the constant table with the data in the buffer.

+
+

Unique identifier to a constant. See .

+

A reference to a buffer containing the constant data.

+

Size of the buffer, in bytes.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174297 + HRESULT ID3DXTextureShader::SetValue([In] D3DXHANDLE hConstant,[In] const void* pData,[In] unsigned int Bytes) + ID3DXTextureShader::SetValue +
+ + +

Sets a value.

+
+

Unique identifier to the constant. See .

+

value.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174284 + HRESULT ID3DXTextureShader::SetBool([In] D3DXHANDLE hConstant,[In] BOOL b) + ID3DXTextureShader::SetBool +
+ + +

Sets an array of values.

+
+

Unique identifier to the array of constants. See .

+

Array of values.

+

Number of values in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174285 + HRESULT ID3DXTextureShader::SetBoolArray([In] D3DXHANDLE hConstant,[In] const BOOL* pb,[In] unsigned int Count) + ID3DXTextureShader::SetBoolArray +
+ + +

Sets an integer value.

+
+

Unique identifier to the constant. See .

+

Integer value.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174289 + HRESULT ID3DXTextureShader::SetInt([In] D3DXHANDLE hConstant,[In] int n) + ID3DXTextureShader::SetInt +
+ + +

Sets an array of integers.

+
+

Unique identifier to the array of constants. See .

+

Array of integers.

+

Number of integers in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174290 + HRESULT ID3DXTextureShader::SetIntArray([In] D3DXHANDLE hConstant,[In] const int* pn,[In] unsigned int Count) + ID3DXTextureShader::SetIntArray +
+ + +

Sets a floating-point number.

+
+

Unique identifier to the constant. See .

+

Floating-point number.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174287 + HRESULT ID3DXTextureShader::SetFloat([In] D3DXHANDLE hConstant,[In] float f) + ID3DXTextureShader::SetFloat +
+ + +

Sets an array of floating-point numbers.

+
+

Unique identifier to the array of constants. See .

+

Array of floating-point numbers.

+

Number of floating-point values in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174288 + HRESULT ID3DXTextureShader::SetFloatArray([In] D3DXHANDLE hConstant,[In] const float* pf,[In] unsigned int Count) + ID3DXTextureShader::SetFloatArray +
+ + +

Sets a 4D vector.

+
+

Unique identifier to the vector constant. See .

+

Pointer to a 4D vector. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174298 + HRESULT ID3DXTextureShader::SetVector([In] D3DXHANDLE hConstant,[In] const D3DXVECTOR4* pVector) + ID3DXTextureShader::SetVector +
+ + +

Sets an array of 4D vectors.

+
+

Unique identifier to the array of vector constants. See .

+

Array of 4D vectors. See .

+

Number of vectors in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb174299 + HRESULT ID3DXTextureShader::SetVectorArray([In] D3DXHANDLE hConstant,[In] const D3DXVECTOR4* pVector,[In] unsigned int Count) + ID3DXTextureShader::SetVectorArray +
+ + +

Sets a non-transposed matrix.

+
+

Unique identifier to the matrix of constants. See .

+

Pointer to a non-transposed matrix. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A non-transposed matrix contains row-major data; that is, each vector is contained in a row.

+
+ + bb174291 + HRESULT ID3DXTextureShader::SetMatrix([In] D3DXHANDLE hConstant,[In] const D3DXMATRIX* pMatrix) + ID3DXTextureShader::SetMatrix +
+ + +

Sets an array of non-transposed matrices.

+
+

Unique identifier to the array of constant matrices. See .

+

Array of non-transposed matrices. See .

+

Number of matrices in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A non-transposed matrix contains row-major data; that is, each vector is contained in a row.

+
+ + bb174292 + HRESULT ID3DXTextureShader::SetMatrixArray([In] D3DXHANDLE hConstant,[In] const D3DXMATRIX* pMatrix,[In] unsigned int Count) + ID3DXTextureShader::SetMatrixArray +
+ + +

Sets an array of references to non-transposed matrices.

+
+

Unique identifier to an array of constant matrices. See .

+

Array of references to non-transposed matrices. See .

+

Number of matrices in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A non-transposed matrix contains row-major data; that is, each vector is contained in a row.

+
+ + bb174293 + HRESULT ID3DXTextureShader::SetMatrixPointerArray([In] D3DXHANDLE hConstant,[In] const D3DXMATRIX** ppMatrix,[In] unsigned int Count) + ID3DXTextureShader::SetMatrixPointerArray +
+ + +

Sets a transposed matrix.

+
+

Unique identifier to the matrix of constants. See .

+

Pointer to a transposed matrix. See .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A transposed matrix contains column-major data; that is, each vector is contained in a column.

+
+ + bb174294 + HRESULT ID3DXTextureShader::SetMatrixTranspose([In] D3DXHANDLE hConstant,[In] const D3DXMATRIX* pMatrix) + ID3DXTextureShader::SetMatrixTranspose +
+ + +

Sets an array of transposed matrices.

+
+

Unique identifier to the array of matrix constants. See .

+

Array of transposed matrices. See .

+

Number of matrices in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A transposed matrix contains column-major data; that is, each vector is contained in a column.

+
+ + bb174295 + HRESULT ID3DXTextureShader::SetMatrixTransposeArray([In] D3DXHANDLE hConstant,[In] const D3DXMATRIX* pMatrix,[In] unsigned int Count) + ID3DXTextureShader::SetMatrixTransposeArray +
+ + +

Sets an array of references to transposed matrices.

+
+

Unique identifier to the array of matrix constants. See .

+

Array of references to transposed matrices. See .

+

Number of matrices in the array.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

A transposed matrix contains column-major data; that is, each vector is contained in a column.

+
+ + bb174296 + HRESULT ID3DXTextureShader::SetMatrixTransposePointerArray([In] D3DXHANDLE hConstant,[In] const D3DXMATRIX** ppMatrix,[In] unsigned int Count) + ID3DXTextureShader::SetMatrixTransposePointerArray +
+ + +

Applications use the methods of the interface to manipulate vertex buffer resources.

+
+ +

The interface is obtained by calling the method.

This interface inherits additional functionality from the interface.

This interface, like all COM interfaces, inherits from the interface.

The LPDIRECT3DVERTEXBUFFER9 and PDIRECT3DVERTEXBUFFER9 types are defined as references to the interface.

 typedef struct  *LPDIRECT3DVERTEXBUFFER9, *PDIRECT3DVERTEXBUFFER9;	
+            
+
+ + bb205915 + IDirect3DVertexBuffer9 + IDirect3DVertexBuffer9 +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Retrieves a description of the vertex buffer resource.

+
+ + bb205916 + GetDesc + GetDesc + HRESULT IDirect3DVertexBuffer9::GetDesc([Out] D3DVERTEXBUFFER_DESC* pDesc) +
+ + +

Locks a range of vertex data and obtains a reference to the vertex buffer memory.

+
+

Offset into the vertex data to lock, in bytes. To lock the entire vertex buffer, specify 0 for both parameters, SizeToLock and OffsetToLock.

+

Size of the vertex data to lock, in bytes. To lock the entire vertex buffer, specify 0 for both parameters, SizeToLock and OffsetToLock.

+

VOID* reference to a memory buffer containing the returned vertex data.

+

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

As a general rule, do not hold a lock across more than one frame. When working with vertex buffers, you are allowed to make multiple lock calls; however, you must ensure that the number of lock calls match the number of unlock calls. DrawPrimitive calls will not succeed with any outstanding lock count on any currently set vertex buffer.

The and flags are valid only on buffers created with .

For information about using or with , see Using Dynamic Vertex and Index Buffers.

+
+ + bb205917 + HRESULT IDirect3DVertexBuffer9::Lock([In] unsigned int OffsetToLock,[In] unsigned int SizeToLock,[Out] void** ppbData,[In] D3DLOCK Flags) + IDirect3DVertexBuffer9::Lock +
+ + +

Unlocks vertex data.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205918 + HRESULT IDirect3DVertexBuffer9::Unlock() + IDirect3DVertexBuffer9::Unlock +
+ + +

Retrieves a description of the vertex buffer resource.

+
+

Pointer to a structure, describing the returned vertex buffer.

+

If the method succeeds, the return value is . is returned if the argument is invalid.

+ + bb205916 + HRESULT IDirect3DVertexBuffer9::GetDesc([Out] D3DVERTEXBUFFER_DESC* pDesc) + IDirect3DVertexBuffer9::GetDesc +
+ + + Initializes a new instance of the class. + + The device that will be used to create the buffer. + Size of the buffer, in bytes. + The requested usage of the buffer. + The vertex format of the vertices in the buffer. If set to .None, the buffer will be a non-FVF buffer. + The memory class into which the resource will be placed. + bb174364 + HRESULT IDirect3DDevice9::CreateVertexBuffer([In] unsigned int Length,[In] D3DUSAGE Usage,[In] D3DFVF FVF,[In] D3DPOOL Pool,[Out, Fast] IDirect3DVertexBuffer9** ppVertexBuffer,[In] void** pSharedHandle) + IDirect3DDevice9::CreateVertexBuffer + + + + Initializes a new instance of the class. + + The device that will be used to create the buffer. + Size of the buffer, in bytes. + The requested usage of the buffer. + The vertex format of the vertices in the buffer. If set to .None, the buffer will be a non-FVF buffer. + The memory class into which the resource will be placed. + The variable that will receive the shared handle for this resource. + This method is only available in Direct3D9 Ex. + bb174364 + HRESULT IDirect3DDevice9::CreateVertexBuffer([In] unsigned int Length,[In] D3DUSAGE Usage,[In] D3DFVF FVF,[In] D3DPOOL Pool,[Out, Fast] IDirect3DVertexBuffer9** ppVertexBuffer,[In] void** pSharedHandle) + IDirect3DDevice9::CreateVertexBuffer + + + + Locks a range of vertex data and obtains a pointer to the vertex buffer memory. + + + As a general rule, do not hold a lock across more than one frame. When working with vertex buffers, you are allowed to make multiple lock calls; however, you must ensure that the number of lock calls match the number of unlock calls. DrawPrimitive calls will not succeed with any outstanding lock count on any currently set vertex buffer. The D3DLOCK_DISCARD and D3DLOCK_NOOVERWRITE flags are valid only on buffers created with D3DUSAGE_DYNAMIC. For information about using D3DLOCK_DISCARD or D3DLOCK_NOOVERWRITE with IDirect3DVertexBuffer9::Lock, see {{Using Dynamic Vertex and Index Buffers}}. + + Offset into the vertex data to lock, in bytes. To lock the entire vertex buffer, specify 0 for both parameters, SizeToLock and OffsetToLock. + Size of the vertex data to lock, in bytes. To lock the entire vertex buffer, specify 0 for both parameters, SizeToLock and OffsetToLock. + Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are: D3DLOCK_DISCARD D3DLOCK_NO_DIRTY_UPDATE D3DLOCK_NOSYSLOCK D3DLOCK_READONLY D3DLOCK_NOOVERWRITE For a description of the flags, see . + A if the method succeeds. + bb205917 + HRESULT IDirect3DVertexBuffer9::Lock([In] unsigned int OffsetToLock,[In] unsigned int SizeToLock,[Out] void** ppbData,[In] D3DLOCK Flags) + IDirect3DVertexBuffer9::Lock + + + + Locks a range of vertex data and obtains a pointer to the vertex buffer memory. + + + As a general rule, do not hold a lock across more than one frame. When working with vertex buffers, you are allowed to make multiple lock calls; however, you must ensure that the number of lock calls match the number of unlock calls. DrawPrimitive calls will not succeed with any outstanding lock count on any currently set vertex buffer. The D3DLOCK_DISCARD and D3DLOCK_NOOVERWRITE flags are valid only on buffers created with D3DUSAGE_DYNAMIC. For information about using D3DLOCK_DISCARD or D3DLOCK_NOOVERWRITE with IDirect3DVertexBuffer9::Lock, see {{Using Dynamic Vertex and Index Buffers}}. + + Offset into the vertex data to lock, in bytes. To lock the entire vertex buffer, specify 0 for both parameters, SizeToLock and OffsetToLock. + Size of the vertex data to lock, in bytes. To lock the entire vertex buffer, specify 0 for both parameters, SizeToLock and OffsetToLock. + Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are: D3DLOCK_DISCARD D3DLOCK_NO_DIRTY_UPDATE D3DLOCK_NOSYSLOCK D3DLOCK_READONLY D3DLOCK_NOOVERWRITE For a description of the flags, see . + A if the method succeeds. + bb205917 + HRESULT IDirect3DVertexBuffer9::Lock([In] unsigned int OffsetToLock,[In] unsigned int SizeToLock,[Out] void** ppbData,[In] D3DLOCK Flags) + IDirect3DVertexBuffer9::Lock + + + +

Applications use the methods of the interface to encapsulate the vertex shader declaration.

+
+ +

A vertex shader declaration is made up of an array of vertex elements.

The LPDIRECT3DVERTEXDECLARATION9 and PDIRECT3DVERTEXDECLARATION9 types are defined as references to the interface.

typedef struct  *LPDIRECT3DVERTEXDECLARATION9, *PDIRECT3DVERTEXDECLARATION9;
+
+ + bb205919 + IDirect3DVertexDeclaration9 + IDirect3DVertexDeclaration9 +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Gets the current device.

+
+ + bb205921 + GetDevice + GetDevice + HRESULT IDirect3DVertexDeclaration9::GetDevice([Out] IDirect3DDevice9** ppDevice) +
+ + +

Gets the current device.

+
+

Pointer to the interface that is returned.

+

If the method succeeds, the return value is . If the method fails, the return value can be: .

+ + bb205921 + HRESULT IDirect3DVertexDeclaration9::GetDevice([Out] IDirect3DDevice9** ppDevice) + IDirect3DVertexDeclaration9::GetDevice +
+ + +

Gets the vertex shader declaration.

+
+

Array of vertex elements (see ) that make up a vertex shader declaration. The application needs to allocate enough room for this. The vertex element array ends with the D3DDECL_END macro.

+

Number of elements in the array. The application needs to allocate enough room for this.

+

If the method succeeds, the return value is . If the method fails, the return value can be: .

+ +

The number of elements, pNumElements, includes the D3DDECL_END macro, which ends the declaration. So the element count is actually one higher than the number of valid vertex elements.

Here's an example that will return the vertex declaration array of up to 256 elements:

  decl[MAXD3DDECLLENGTH];	
+            UINT numElements;	
+             hr = m_pVertexDeclaration->GetDeclaration( decl, &numElements);	
+            

Specify null for pDeclto get the number of elements in the declaration.

+
+ + bb205920 + HRESULT IDirect3DVertexDeclaration9::GetDeclaration([Out, Buffer] D3DVERTEXELEMENT9* pElement,[InOut] unsigned int* pNumElements) + IDirect3DVertexDeclaration9::GetDeclaration +
+ + + Create a vertex shader declaration from the device and the vertex elements. + + + See the {{Vertex Declaration (Direct3D 9)}} page for a detailed description of how to map vertex declarations between different versions of DirectX. + + The device. + An array of vertex elements. + If the method succeeds + HRESULT IDirect3DDevice9::CreateVertexDeclaration([In, Buffer] const D3DVERTEXELEMENT9* pVertexElements,[None] IDirect3DVertexDeclaration9** ppDecl) + + + + Gets the elements. + + HRESULT IDirect3DVertexDeclaration9::GetDeclaration([Out, Buffer] D3DVERTEXELEMENT9* pElement,[InOut] unsigned int* pNumElements) + + + +

Applications use the methods of the interface to encapsulate the functionality of a vertex shader.

+
+ +

The LPDIRECT3DVERTEXSHADER9 and PDIRECT3DVERTEXSHADER9 types are defined as references to the interface.

typedef struct  *LPDIRECT3DVERTEXSHADER9, *PDIRECT3DVERTEXSHADER9;
+
+ + bb205922 + IDirect3DVertexShader9 + IDirect3DVertexShader9 +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + Constant MaxDynamicFlowControlDepth. + D3DVS20_MAX_DYNAMICFLOWCONTROLDEPTH + + + Constant MinDynamicFlowControlDepth. + D3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH + + + Constant MaxTemps. + D3DVS20_MAX_NUMTEMPS + + + Constant MinTemps. + D3DVS20_MIN_NUMTEMPS + + + Constant MaxStaticFlowControlDepth. + D3DVS20_MAX_STATICFLOWCONTROLDEPTH + + + Constant MinStaticFlowControlDepth. + D3DVS20_MIN_STATICFLOWCONTROLDEPTH + + + +

Gets the device.

+
+ + bb205923 + GetDevice + GetDevice + HRESULT IDirect3DVertexShader9::GetDevice([Out] IDirect3DDevice9** ppDevice) +
+ + +

Gets the device.

+
+

Pointer to the interface that is returned.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205923 + HRESULT IDirect3DVertexShader9::GetDevice([Out] IDirect3DDevice9** ppDevice) + IDirect3DVertexShader9::GetDevice +
+ + +

Gets a reference to the shader data.

+
+

Pointer to a buffer that contains the shader data. The application needs to allocate enough room for this.

+

Size of the data, in bytes. To get the buffer size that is needed to retrieve the data, set pData = null when calling GetFunction. Then call GetFunction with the returned size, to get the buffer data.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205924 + HRESULT IDirect3DVertexShader9::GetFunction([In] void* arg0,[InOut] unsigned int* pSizeOfData) + IDirect3DVertexShader9::GetFunction +
+ + + Initializes a new instance of the class. + + The device. + The function. + HRESULT IDirect3DDevice9::CreateVertexShader([In] const void* pFunction,[Out, Fast] IDirect3DVertexShader9** ppShader) + + + + Gets the bytecode associated to this shader.. + + + + +

Applications use the methods of the interface to manipulate volume resources.

+
+ +

The interface is obtained by calling the method.

This interface, like all COM interfaces, inherits from the interface.

The LPDIRECT3DVOLUME9 and PDIRECT3DVOLUME9 types are defined as references to the interface.

 typedef struct  *LPDIRECT3DVOLUME9, *PDIRECT3DVOLUME9;	
+            
+
+ + bb205932 + IDirect3DVolume9 + IDirect3DVolume9 +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Retrieves the device associated with a volume.

+
+ +

This method allows navigation to the owning device object.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

+
+ + bb205936 + GetDevice + GetDevice + HRESULT IDirect3DVolume9::GetDevice([Out] IDirect3DDevice9** ppDevice) +
+ + +

Retrieves a description of the volume.

+
+ + bb205935 + GetDesc + GetDesc + HRESULT IDirect3DVolume9::GetDesc([Out] D3DVOLUME_DESC* pDesc) +
+ + +

Retrieves the device associated with a volume.

+
+

Address of a reference to an interface to fill with the device reference, if the query succeeds.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

This method allows navigation to the owning device object.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

+
+ + bb205936 + HRESULT IDirect3DVolume9::GetDevice([Out] IDirect3DDevice9** ppDevice) + IDirect3DVolume9::GetDevice +
+ + +

Associates data with the volume that is intended for use by the application, not by Direct3D.

+
+

Reference to the globally unique identifier that identifies the private data to set.

+

Pointer to a buffer that contains the data to associate with the volume.

+

Size of the buffer at pData in bytes.

+

Value that describes the type of data being passed, or indicates to the application that the data should be invalidated when the resource changes.

ItemDescription

(none)

If no flags are specified, Direct3D allocates memory to hold the data within the buffer and copies the data into the new buffer. The buffer allocated by Direct3D is automatically freed, as appropriate.

D3DSPD_IUNKNOWN

The data at pData is a reference to an interface. SizeOfData must be set to the size of a reference to an interface, sizeof(*). Direct3D automatically calls through pData and when the private data is destroyed. Private data will be destroyed by a subsequent call to with the same , a subsequent call to , or when the object is released. For more information, see Remarks.

?

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

+ +

Direct3D does not manage the memory at pData. If this buffer was dynamically allocated, it is the calling application's responsibility to free the memory.

Data is passed by value, and multiple sets of data can be associated with a single volume.

+
+ + bb205939 + HRESULT IDirect3DVolume9::SetPrivateData([In] const GUID& refguid,[In] const void* pData,[In] unsigned int SizeOfData,[In] unsigned int Flags) + IDirect3DVolume9::SetPrivateData +
+ + +

Copies the private data associated with the volume to a provided buffer.

+
+

Reference to (C++) or address of (C) the globally unique identifier that identifies the private data to retrieve.

+

Pointer to a previously allocated buffer to fill with the requested private data if the call succeeds. The application calling this method is responsible for allocating and releasing this buffer. If this parameter is null, this method will return the buffer size in pSizeOfData.

+

Pointer to the size of the buffer at pData, in bytes. If this value is less than the actual size of the private data, such as 0, the method sets this parameter to the required buffer size, and the method returns .

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , .

+ + bb205937 + HRESULT IDirect3DVolume9::GetPrivateData([In] const GUID& refguid,[In] void* pData,[Out] unsigned int* pSizeOfData) + IDirect3DVolume9::GetPrivateData +
+ + +

Frees the specified private data associated with this volume.

+
+

Reference to the globally unique identifier that identifies the private data to free.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , .

+ +

Direct3D calls this method automatically when a volume is released.

+
+ + bb205933 + HRESULT IDirect3DVolume9::FreePrivateData([In] const GUID& refguid) + IDirect3DVolume9::FreePrivateData +
+ + +

Provides access to the parent volume texture object, if this surface is a child level of a volume texture.

+
+

Reference identifier of the volume being requested.

+

Address of a reference to fill with the container reference, if the query succeeds.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

If the call succeeds, the reference count of the container is increased by one.

Here's an example getting the parent volume texture of a volume texture.

 // Assumes pSurface is a valid  reference	
+            void *pContainer = null;	
+             *pVolumeTexture = null;	
+             hr = pVolume->GetContainer(IID_IDirect3DVolumeTexture9, &pContainer);	
+            if (SUCCEEDED(hr) && pContainer)	
+            { pVolumeTexture = ( *)pContainer;	
+            
+
+ + bb205934 + HRESULT IDirect3DVolume9::GetContainer([In] const GUID& riid,[In] void** ppContainer) + IDirect3DVolume9::GetContainer +
+ + +

Retrieves a description of the volume.

+
+

Pointer to a structure, describing the volume.

+

If the method succeeds, the return value is . is returned if the argument is invalid.

+ + bb205935 + HRESULT IDirect3DVolume9::GetDesc([Out] D3DVOLUME_DESC* pDesc) + IDirect3DVolume9::GetDesc +
+ + +

Locks a box on a volume resource.

+
+

Pointer to a structure, describing the locked region.

+

Pointer to a box to lock. Specified by a reference to a structure. Specifying null for this parameter locks the entire volume.

+

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

For performance reasons, dirty regions are only recorded for level zero of a texture. Dirty regions are automatically recorded when is called without or . See for more information.

+
+ + bb205938 + HRESULT IDirect3DVolume9::LockBox([Out] D3DLOCKED_BOX* pLockedVolume,[In] const void* pBox,[In] D3DLOCK Flags) + IDirect3DVolume9::LockBox +
+ + +

Unlocks a box on a volume resource.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205940 + HRESULT IDirect3DVolume9::UnlockBox() + IDirect3DVolume9::UnlockBox +
+ + + Loads a volume from memory. + + Pointer to a structure, the destination palette of 256 colors or null. + Pointer to a structure. Specifies the destination box. Set this parameter to null to specify the entire volume. + Pointer to the top-left corner of the source volume in memory. + Member of the enumerated type, the pixel format of the source volume. + Pitch of source image, in bytes. For DXT formats (compressed texture formats), this number should represent the size of one row of cells, in bytes. + Pitch of source image, in bytes. For DXT formats (compressed texture formats), this number should represent the size of one slice of cells, in bytes. + Pointer to a structure, the source palette of 256 colors or null. + Pointer to a structure. Specifies the source box. null is not a valid value for this parameter. + A combination of one or more controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | . + value to replace with transparent black, or 0 to disable the color key. This is always a 32-bit ARGB color, independent of the source image format. Alpha is significant and should usually be set to FF for opaque color keys. Thus, for opaque black, the value would be equal to 0xFF000000. + If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , D3DXERR_INVALIDDATA. + + Writing to a non-level-zero surface of the volume texture will not cause the dirty rectangle to be updated. If is called and the texture was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call on the volume texture. + + HRESULT D3DXLoadVolumeFromMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcRowPitch,[In] unsigned int SrcSlicePitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey) + + + + Loads a volume from a file on the disk. + + The volume. + Name of the file. + The filter. + The color key. + + A object describing the result of the operation. + + HRESULT D3DXLoadVolumeFromFileW([In] IDirect3DVolume9* pDestVolume,[In] const PALETTEENTRY* pDestPalette,[In] const D3DBOX* pDestBox,[In] const wchar_t* pSrcFile,[In] const D3DBOX* pSrcBox,[In] unsigned int Filter,[In] D3DCOLOR ColorKey,[In] D3DXIMAGE_INFO* pSrcInfo) + + + + Loads a volume from a file on the disk. + + The volume. + Name of the file. + The filter. + The color key. + The source box. + The destination box. + + A object describing the result of the operation. + + HRESULT D3DXLoadVolumeFromFileW([In] IDirect3DVolume9* pDestVolume,[In] const PALETTEENTRY* pDestPalette,[In] const D3DBOX* pDestBox,[In] const wchar_t* pSrcFile,[In] const D3DBOX* pSrcBox,[In] unsigned int Filter,[In] D3DCOLOR ColorKey,[In] D3DXIMAGE_INFO* pSrcInfo) + + + + Loads a volume from a file on the disk. + + The volume. + Name of the file. + The filter. + The color key. + The source box. + The destination box. + The image information. + + A object describing the result of the operation. + + HRESULT D3DXLoadVolumeFromFileW([In] IDirect3DVolume9* pDestVolume,[In] const PALETTEENTRY* pDestPalette,[In] const D3DBOX* pDestBox,[In] const wchar_t* pSrcFile,[In] const D3DBOX* pSrcBox,[In] unsigned int Filter,[In] D3DCOLOR ColorKey,[In] D3DXIMAGE_INFO* pSrcInfo) + + + + Loads a volume from a file on the disk. + + The volume. + Name of the file. + The filter. + The color key. + The source box. + The destination box. + The palette. + The image information. + + A object describing the result of the operation. + + HRESULT D3DXLoadVolumeFromFileW([In] IDirect3DVolume9* pDestVolume,[In] const PALETTEENTRY* pDestPalette,[In] const D3DBOX* pDestBox,[In] const wchar_t* pSrcFile,[In] const D3DBOX* pSrcBox,[In] unsigned int Filter,[In] D3DCOLOR ColorKey,[In] D3DXIMAGE_INFO* pSrcInfo) + + + + Loads a volume from a file in memory. + + The volume. + The memory. + The filter. + The color key. + + A object describing the result of the operation. + + HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a volume from a file in memory. + + The volume. + The memory. + The filter. + The color key. + The source box. + The destination box. + + A object describing the result of the operation. + + HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a volume from a file in memory. + + The volume. + The memory. + The filter. + The color key. + The source box. + The destination box. + The image information. + + A object describing the result of the operation. + + HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a volume from a file in memory. + + The volume. + The memory. + The filter. + The color key. + The source box. + The destination box. + The palette. + The image information. + + A object describing the result of the operation. + + HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a volume from a file in a stream. + + The volume. + The stream. + The filter. + The color key. + + A object describing the result of the operation. + + HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a volume from a file in a stream. + + The volume. + The stream. + The filter. + The color key. + The source box. + The destination box. + + A object describing the result of the operation. + + HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a volume from a file in a stream. + + The volume. + The stream. + The filter. + The color key. + The source box. + The destination box. + The image information. + + A object describing the result of the operation. + + HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a volume from a file in a stream. + + The volume. + The stream. + The filter. + The color key. + The source box. + The destination box. + The palette. + The image information. + A object describing the result of the operation. + HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) + + + + Loads a volume from a source volume. + + The destination volume. + The source volume. + The filter. + The color key. + + A object describing the result of the operation. + + HRESULT D3DXLoadVolumeFromVolume([In] IDirect3DVolume9* pDestVolume,[In] const PALETTEENTRY* pDestPalette,[In] const D3DBOX* pDestBox,[In] IDirect3DVolume9* pSrcVolume,[In] const PALETTEENTRY* pSrcPalette,[In] const D3DBOX* pSrcBox,[In] unsigned int Filter,[In] D3DCOLOR ColorKey) + + + + Loads a volume from a source volume. + + The destination volume. + The source volume. + The filter. + The color key. + The source box. + The destination box. + + A object describing the result of the operation. + + HRESULT D3DXLoadVolumeFromVolume([In] IDirect3DVolume9* pDestVolume,[In] const PALETTEENTRY* pDestPalette,[In] const D3DBOX* pDestBox,[In] IDirect3DVolume9* pSrcVolume,[In] const PALETTEENTRY* pSrcPalette,[In] const D3DBOX* pSrcBox,[In] unsigned int Filter,[In] D3DCOLOR ColorKey) + + + + Loads a volume from a source volume. + + The destination volume. + The source volume. + The filter. + The color key. + The source box. + The destination box. + The destination palette. + The source palette. + A object describing the result of the operation. + HRESULT D3DXLoadVolumeFromVolume([In] IDirect3DVolume9* pDestVolume,[In] const PALETTEENTRY* pDestPalette,[In] const D3DBOX* pDestBox,[In] IDirect3DVolume9* pSrcVolume,[In] const PALETTEENTRY* pSrcPalette,[In] const D3DBOX* pSrcBox,[In] unsigned int Filter,[In] D3DCOLOR ColorKey) + + + + Locks a box on a volume resource. + + The flags. + + The locked region of this resource + + HRESULT IDirect3DVolume9::LockBox([Out] D3DLOCKED_BOX* pLockedVolume,[In] const void* pBox,[In] D3DLOCK Flags) + + + + Locks a box on a volume resource. + + The box. + The flags. + The locked region of this resource + HRESULT IDirect3DVolume9::LockBox([Out] D3DLOCKED_BOX* pLockedVolume,[In] const void* pBox,[In] D3DLOCK Flags) + + + + Saves a volume to a file on disk. + + The volume. + Name of the file. + The format. + + A object describing the result of the operation. + + HRESULT D3DXSaveVolumeToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In] const PALETTEENTRY* pSrcPalette,[In] const D3DBOX* pSrcBox) + + + + Saves a volume to a file on disk. + + The volume. + Name of the file. + The format. + The box. + + A object describing the result of the operation. + + HRESULT D3DXSaveVolumeToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In] const PALETTEENTRY* pSrcPalette,[In] const D3DBOX* pSrcBox) + + + + Saves a volume to a file on disk. + + The volume. + Name of the file. + The format. + The box. + The palette. + A object describing the result of the operation. + HRESULT D3DXSaveVolumeToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In] const PALETTEENTRY* pSrcPalette,[In] const D3DBOX* pSrcBox) + + + + Saves a volume to a . + + The volume. + The format. + + A object describing the result of the operation. + + HRESULT D3DXSaveVolumeToFileInMemory([In] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcBox) + + + + Saves a volume to a . + + The volume. + The format. + The box. + + A object describing the result of the operation. + + HRESULT D3DXSaveVolumeToFileInMemory([In] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcBox) + + + + Saves a volume to a . + + The volume. + The format. + The box. + The palette. + A object describing the result of the operation. + HRESULT D3DXSaveVolumeToFileInMemory([In] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcBox) + + + +

Applications use the methods of the interface to manipulate a volume texture resource.

+
+ +

The interface can be obtained by calling the CreateVolumeTexture method or one of the xxx functions.

This interface inherits additional functionality from the interface.

This interface, like all COM interfaces, inherits from the interface.

The LPDIRECT3DVOLUMETEXTURE9 and PDIRECT3DVOLUMETEXTURE9 types are defined as references to the interface.

 typedef struct  *LPDIRECT3DVOLUMETEXTURE9, *PDIRECT3DVOLUMETEXTURE9;	
+            
+
+ + bb205941 + IDirect3DVolumeTexture9 + IDirect3DVolumeTexture9 +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Retrieves a level description of a volume texture resource.

+
+

Identifies a level of the volume texture resource. This method returns a volume description for the level specified by this parameter.

+

Pointer to a structure, describing the returned volume texture level.

+ + bb205943 + HRESULT IDirect3DVolumeTexture9::GetLevelDesc([In] unsigned int Level,[Out] D3DVOLUME_DESC* pDesc) + IDirect3DVolumeTexture9::GetLevelDesc +
+ + +

Retrieves the specified volume texture level.

+
+

Identifies a level of the volume texture resource. This method returns a volume for the level specified by this parameter.

+

Address of a reference to an interface, representing the returned volume level.

+ +

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

+
+ + bb205944 + HRESULT IDirect3DVolumeTexture9::GetVolumeLevel([In] unsigned int Level,[Out] IDirect3DVolume9** ppVolumeLevel) + IDirect3DVolumeTexture9::GetVolumeLevel +
+ + +

Locks a box on a volume texture resource.

+
+

Specifies the level of the volume texture resource to lock.

+

Pointer to a structure, describing the locked region.

+

Pointer to the volume to lock. This parameter is specified by a reference to a structure. Specifying null for this parameter locks the entire volume level.

+

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

For performance reasons, dirty regions are only recorded for level zero of a texture. Dirty regions are automatically recorded when LockBox is called without or . For more information, see UpdateTexture.

+
+ + bb205945 + HRESULT IDirect3DVolumeTexture9::LockBox([In] unsigned int Level,[Out] D3DLOCKED_BOX* pLockedVolume,[In] const void* pBox,[In] D3DLOCK Flags) + IDirect3DVolumeTexture9::LockBox +
+ + +

Unlocks a box on a volume texture resource.

+
+

Specifies the level of the volume texture resource to unlock.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ + bb205946 + HRESULT IDirect3DVolumeTexture9::UnlockBox([In] unsigned int Level) + IDirect3DVolumeTexture9::UnlockBox +
+ + +

Adds a dirty region to a volume texture resource.

+
+

Pointer to a structure, specifying the dirty region to add. Specifying null expands the dirty region to cover the entire volume texture.

+

If the method succeeds, the return value is . If the method fails, the return value can be .

+ +

For performance reasons, dirty regions are only recorded for level zero of a texture. For sublevels, it is assumed that the corresponding (scaled) box is also dirty. Dirty regions are automatically recorded when LockBox is called without or .

Using and explicitly specifying dirty regions can be used to increase the efficiency of UpdateTexture. Using this method, applications can optimize what subset of a resource is copied by specifying dirty boxes on the resource. However, the dirty regions may be expanded to optimize alignment.

+
+ + bb205942 + HRESULT IDirect3DVolumeTexture9::AddDirtyBox([In] const void* pDirtyBox) + IDirect3DVolumeTexture9::AddDirtyBox +
+ + + Initializes a new instance of the class. + + The device. + The width. + The height. + The depth. + The level count. + The usage. + The format. + The pool. + HRESULT IDirect3DDevice9::CreateVolumeTexture([In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Levels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DVolumeTexture9** ppVolumeTexture,[In] void** pSharedHandle) + + + + Initializes a new instance of the class. + + The device. + The width. + The height. + The depth. + The level count. + The usage. + The format. + The pool. + The shared handle. + HRESULT IDirect3DDevice9::CreateVolumeTexture([In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Levels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DVolumeTexture9** ppVolumeTexture,[In] void** pSharedHandle) + + + + Checks texture-creation parameters. + + Device associated with the texture. + The width. + The height. + The depth. + Requested number of mipmap levels for the texture. + The requested usage for the texture. + Requested format for the texture. + Memory class where the resource will be placed. + + A value type containing the proposed values to pass to the texture creation functions. + + HRESULT D3DXCheckVolumeTextureRequirements([In] IDirect3DDevice9* pDevice,[InOut] unsigned int* pWidth,[InOut] unsigned int* pHeight,[InOut] unsigned int* pDepth,[InOut] unsigned int* pNumMipLevels,[In] unsigned int Usage,[InOut] D3DFORMAT* pFormat,[In] D3DPOOL Pool) + + + + Uses a user-provided function to fill each texel of each mip level of a given texture. + + A function that is used to fill the texture. + A object describing the result of the operation. + HRESULT D3DXFillVolumeTexture([In] IDirect3DVolumeTexture9* pVolumeTexture,[In] __function__stdcall* pFunction,[In] void* pData) + + + + Uses a compiled high-level shader language (HLSL) function to fill each texel of each mipmap level of a texture. + + A texture shader object that is used to fill the texture. + A object describing the result of the operation. + HRESULT D3DXFillVolumeTextureTX([In] IDirect3DVolumeTexture9* pVolumeTexture,[In] ID3DXVolumeTextureShader* pVolumeTextureShader) + + + + Locks a box on a volume texture resource. + + The level. + The flags. + + A describing the region locked. + + HRESULT IDirect3DVolumeTexture9::LockBox([In] unsigned int Level,[Out] D3DLOCKED_BOX* pLockedVolume,[In] const void* pBox,[In] D3DLOCK Flags) + + + + Locks a box on a volume texture resource. + + The level. + The box. + The flags. + + A describing the region locked. + + HRESULT IDirect3DVolumeTexture9::LockBox([In] unsigned int Level,[Out] D3DLOCKED_BOX* pLockedVolume,[In] const void* pBox,[In] D3DLOCK Flags) + + + + Adds a dirty region to a texture resource. + + + A object describing the result of the operation. + + HRESULT IDirect3DVolumeTexture9::AddDirtyBox([In] const void* pDirtyBox) + + + + Adds a dirty region to a texture resource. + + The direct box ref. + + A object describing the result of the operation. + + HRESULT IDirect3DVolumeTexture9::AddDirtyBox([In] const void* pDirtyBox) + + + + Creates a from a file + + The device. + The filename. + + A + + HRESULT D3DXCreateVolumeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + + Creates a from a file + + The device. + The filename. + The usage. + The pool. + + A + + HRESULT D3DXCreateVolumeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + + Creates a from a file + + The device. + The filename. + The width. + The height. + The depth. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + + A + + HRESULT D3DXCreateVolumeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + + Creates a from a file + + The device. + The filename. + The width. + The height. + The depth. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + + A + + HRESULT D3DXCreateVolumeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + + Creates a from a file + + The device. + The filename. + The width. + The height. + The depth. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + + A + + HRESULT D3DXCreateVolumeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + + Creates a from a memory buffer. + + The device. + The buffer. + + A + + HRESULT D3DXCreateVolumeTextureFromFileInMemory([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + + Creates a from a memory buffer. + + The device. + The buffer. + The usage. + The pool. + + A + + HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + + Creates a from a memory buffer. + + The device. + The buffer. + The width. + The height. + The depth. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + + A + + HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + + Creates a from a memory buffer. + + The device. + The buffer. + The width. + The height. + The depth. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + + A + + HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + + Creates a from a memory buffer. + + The device. + The buffer. + The width. + The height. + The depth. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + + A + + HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + + Creates a from a stream. + + The device. + The stream. + A + HRESULT D3DXCreateVolumeTextureFromFileInMemory([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + + Creates a from a stream. + + The device. + The stream. + The usage. + The pool. + + A + + HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + + Creates a from a stream. + + The device. + The stream. + The width. + The height. + The depth. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + + A + + HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + + Creates a from a stream. + + The device. + The stream. + The size bytes. + The width. + The height. + The depth. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + + A + + HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + + Creates a from a stream. + + The device. + The stream. + The size bytes. + The width. + The height. + The depth. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + + A + + HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + + Creates a from a stream. + + The device. + The stream. + The size bytes. + The width. + The height. + The depth. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + + A + + HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + + Creates a from a stream. + + The device. + The buffer. + The width. + The height. + The depth. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + + A + + HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + + Creates a from a stream. + + The device. + The stream. + The size bytes. + The width. + The height. + The depth. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + A + HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + + Creates a from a stream. + + The device. + The pointer. + The size in bytes. + The width. + The height. + The depth. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + + A + + HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + + Creates a from a stream. + + The device. + Name of the file. + The width. + The height. + The depth. + The level count. + The usage. + The format. + The pool. + The filter. + The mip filter. + The color key. + The image information. + The palette. + + A + + HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) + + + +

Applications use the methods of the interface to create instances of the and interfaces, and to register templates.

+
+ +

An object also contains a local template store. This local storage may be added to only with the and methods.

and objects created with and also utilize the template store of the parent object.

The interface is obtained by calling the function.

The globally unique identifier () for the interface is IID_ID3DXFile.

The LPD3DXFILE type is defined as a reference to the interface.

 typedef interface  *LPD3DXFILE;	
+            
+
+ + bb205836 + ID3DXFile + ID3DXFile +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Creates an enumerator object that will read a .x file.

+
+

The data source. Either:

  • A file name
  • A D3DXF_FILELOADMEMORY structure
  • A D3DXF_FILELOADRESOURCE structure

Depending on the value of loadflags.

+

Value that specifies the source of the data. This value can be one of the D3DXF_FILELOADOPTIONS flags.

+

Address of a reference to an interface, representing the created enumerator object.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: D3DXFERR_BADVALUE, D3DXFERR_PARSEERROR.

+ +

After using this method, use one of the methods to retrieve a data object.

+
+ + bb173957 + HRESULT ID3DXFile::CreateEnumObject([In] const void* arg0,[In] unsigned int arg1,[In] ID3DXFileEnumObject** arg2) + ID3DXFile::CreateEnumObject +
+ + +

Creates a save object that will be used to save data to a .x file.

+
+

Pointer to the name of the file to use for saving data.

+

Value that specifies the name of the file to which data is to be saved. This value can be one of the File Save Options flags.

+

Indicates the format to use when saving the .x file. This value can be one of the File Formats flags. For more information, see Remarks.

+

Address of a reference to an interface, representing the created save object.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: D3DXFERR_BADVALUE, D3DXFERR_PARSEERROR.

+ +

After using this method, use methods of the interface to create data objects and to save templates or data.

For the saved file format dwFileFormat, one of the binary, legacy binary, or text flags in File Formats must be specified. The file can be compressed by using the optional flag.

The file format values can be combined in a logical OR to create compressed text or compressed binary files. If you indicate that the file format should be text and compressed, the file will be written out first as text and then compressed. However, compressed text files are not as efficient as binary text files; in most cases, therefore, you will want to indicate binary and compressed.

+
+ + bb173958 + HRESULT ID3DXFile::CreateSaveObject([In] const void* arg0,[In] unsigned int arg1,[In] unsigned int arg2,[In] ID3DXFileSaveObject** arg3) + ID3DXFile::CreateSaveObject +
+ + +

Registers custom templates.

+
+

Pointer to a buffer consisting of a .x file in text or binary format that contains templates.

+

Size of the buffer pointed to by pvData, in bytes.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: D3DXFERR_BADVALUE, D3DXFERR_PARSEERROR.

+ +

The following code fragment provides an example call to RegisterTemplates And example contents for the buffer to which pvData points.

 #define XSKINEXP_TEMPLATES \ "xof 0303txt 0032\ template XSkinMeshHeader \ { \ <3CF169CE-FF7C-44ab-93C0-F78F62D172E2> \ WORD nMaxSkinWeightsPerVertex; \ WORD nMaxSkinWeightsPerFace; \ WORD nBones; \ } \ template VertexDuplicationIndices \ { \ <B8D65549-D7C9-4995-89CF-53A9A8B031E3> \ DWORD nIndices; \ DWORD nOriginalVertices; \ array DWORD indices[nIndices]; \ } \ template SkinWeights \ { \ <6F0D123B-BAD2-4167-A0D0-80224F25FABB> \ STRING transformNodeName;\ DWORD nWeights; \ array DWORD vertexIndices[nWeights]; \ array float weights[nWeights]; \ Matrix4x4 matrixOffset; \ }"	
+            .	
+            .	
+            . LPD3DXFILE pD3DXFile = null; if ( FAILED  (hr = pD3DXFile->RegisterTemplates(  (LPVOID)XSKINEXP_TEMPLATES, sizeof( XSKINEXP_TEMPLATES ) - 1 ) ) )	
+            goto End;	
+            

All templates must specify a name and a UUID.

This method calls the RegisterEnumTemplates method, obtaining an interface reference by calling CreateEnumObject with pvData as the first parameter.

+
+ + bb173960 + HRESULT ID3DXFile::RegisterTemplates([In] const void* arg0,[In] SIZE_T arg1) + ID3DXFile::RegisterTemplates +
+ + +

Registers custom templates, given an enumeration object.

+
+ No documentation. +

If the method succeeds, the return value is .

If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

+ +

When this method is called, it copies templates stored with the , representing the file, to the local template store of the object.

If an reference is not available, call the RegisterTemplates method instead.

+
+ + bb173959 + HRESULT ID3DXFile::RegisterEnumTemplates([In] ID3DXFileEnumObject* arg0) + ID3DXFile::RegisterEnumTemplates +
+ + +

Applications use the methods of the interface to build or to access the immediate hierarchy of the data object. Template restrictions determine the hierarchy.

+
+ +

Data types allowed by the template are called optional members. The optional members are not required, but an object might miss important information without them. These optional members are saved as children of the data object. A child can be another data object or a reference to an earlier data object.

The for the interface is IID_ID3DXFileData.

The LPD3DXFILEDATA type is defined as a reference to this interface.

 typedef interface  *LPD3DXFILEDATA;	
+            
+
+ + bb205837 + ID3DXFileData + ID3DXFileData +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Retrieves the enumeration object in this file data object.

+
+ + bb205840 + GetEnum + GetEnum + HRESULT ID3DXFileData::GetEnum([Out] ID3DXFileEnumObject** arg0) +
+ + +

Retrieves the template ID in this file data object.

+
+ + bb205843 + GetType + GetType + HRESULT ID3DXFileData::GetType([Out] GUID* arg0) +
+ + +

Indicates whether this file data object is a reference object that points to another child data object.

+
+ + bb205844 + IsReference + IsReference + BOOL ID3DXFileData::IsReference() +
+ + +

Retrieves the number of children in this file data object.

+
+ + bb205839 + GetChildren + GetChildren + HRESULT ID3DXFileData::GetChildren([Out] SIZE_T* arg0) +
+ + +

Retrieves the enumeration object in this file data object.

+
+

Address of a reference to receive the enumeration object in this file data object.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

+ + bb205840 + HRESULT ID3DXFileData::GetEnum([Out] ID3DXFileEnumObject** arg0) + ID3DXFileData::GetEnum +
+ + +

Retrieves the name of this file data object.

+
+

Address of a reference to receive the name of this file data object. If this parameter is null, then puiSize will return the size of the string. If szName points to valid memory, the name of this file data object will be copied into szName up to the number of characters given by puiSize.

+

Pointer to the size of the string that represents the name of this file data object. This parameter can be null if szName provides a reference to the name. This parameter will return the size of the string if szName is null.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

+ +

For this method to succeed, either szName or puiSize must be non-null.

+
+ + bb205842 + HRESULT ID3DXFileData::GetName([In] char* arg0,[Out] SIZE_T* arg1) + ID3DXFileData::GetName +
+ + +

Retrieves the of this file data object.

+
+

Pointer to a to receive the ID of this file data object. If the file data object has no ID, the returned parameter value will be GUID_NULL.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

+ + bb205841 + HRESULT ID3DXFileData::GetId([In] GUID* arg0) + ID3DXFileData::GetId +
+ + +

Accesses the .x file data.

+
+

Pointer to the size of the .x file data.

+

Address of a reference to receive the file data object's interface reference. See Remarks.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

+ +

The ppData reference is only valid during a ... sequence. You can make multiple lock calls. However, you must ensure that the number of lock calls matches the number of unlock calls.

Because file data is not guaranteed to be aligned properly with byte boundaries, you should access ppData with UNALIGNED references.

Returned parameter values are not guaranteed to be valid due to possible file corruption; therefore, your code should verify the returned parameter values.

+
+ + bb205845 + HRESULT ID3DXFileData::Lock([In] SIZE_T* arg0,[In] const void** arg1) + ID3DXFileData::Lock +
+ + +

Ends the lifespan of the ppData reference returned by .

+
+

The return value is .

+ +

You must ensure that the number of calls matches the number of calls. After calling Unlock, the ppData reference returned by should no longer be used.

+
+ + bb205846 + HRESULT ID3DXFileData::Unlock() + ID3DXFileData::Unlock +
+ + +

Retrieves the template ID in this file data object.

+
+

Pointer to the representing the template in this file data object.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

+ + bb205843 + HRESULT ID3DXFileData::GetType([Out] GUID* arg0) + ID3DXFileData::GetType +
+ + +

Indicates whether this file data object is a reference object that points to another child data object.

+
+

Returns TRUE if the file data object is a reference object; returns otherwise.

+ + bb205844 + BOOL ID3DXFileData::IsReference() + ID3DXFileData::IsReference +
+ + +

Retrieves the number of children in this file data object.

+
+

Address of a reference to receive the number of children in this file data object.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

+ + bb205839 + HRESULT ID3DXFileData::GetChildren([Out] SIZE_T* arg0) + ID3DXFileData::GetChildren +
+ + +

Retrieves a child object in this file data object.

+
+

ID of the child object to retrieve.

+

Address of a reference to receive the child object's interface reference.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: D3DXFERR_BADVALUE, D3DXFERR_NOMOREOBJECTS.

+ + bb205838 + HRESULT ID3DXFileData::GetChild([In] SIZE_T arg0,[Out] ID3DXFileData** arg1) + ID3DXFileData::GetChild +
+ + +

Applications use the methods of the interface to cycle through the child file data objects in the file and to retrieve a child object by its globally unique identifier () or by its name.

+
+ +

The for the interface is IID_ID3DXFileEnumObject.

The LPD3DXFILEENUMOBJECT type is defined as a reference to this interface.

 typedef interface  *LPD3DXFILEENUMOBJECT;	
+            
+
+ + bb205847 + ID3DXFileEnumObject + ID3DXFileEnumObject +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Retrieves the object.

+
+ + bb205852 + GetFile + GetFile + HRESULT ID3DXFileEnumObject::GetFile([Out] ID3DXFile** arg0) +
+ + +

Retrieves the number of child objects in this file data object.

+
+ + bb205849 + GetChildren + GetChildren + HRESULT ID3DXFileEnumObject::GetChildren([Out] SIZE_T* arg0) +
+ + +

Retrieves the object.

+
+ No documentation. +

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

+ + bb205852 + HRESULT ID3DXFileEnumObject::GetFile([Out] ID3DXFile** arg0) + ID3DXFileEnumObject::GetFile +
+ + +

Retrieves the number of child objects in this file data object.

+
+

Address of a reference to receive the number of child objects in this file data object.

+

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

+ + bb205849 + HRESULT ID3DXFileEnumObject::GetChildren([Out] SIZE_T* arg0) + ID3DXFileEnumObject::GetChildren +
+ + +

Retrieves a child object in this file data object.

+
+

ID of the child object to retrieve.

+

Address of a reference to receive the child object's interface reference.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: D3DXFERR_BADVALUE, D3DXFERR_NOMOREOBJECTS.

+ + bb205848 + HRESULT ID3DXFileEnumObject::GetChild([In] SIZE_T arg0,[Out] ID3DXFileData** arg1) + ID3DXFileEnumObject::GetChild +
+ + +

Retrieves the data object that has the specified .

+
+

Reference to the requested .

+

Address of a reference to an interface, representing the returned file data object.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following:DXFILEERR_BADVALUE, DXFILEERR_NOTFOUND.

+ +

Obtain the rguid of the current file data object with the method.

+
+ + bb205850 + HRESULT ID3DXFileEnumObject::GetDataObjectById([In] const GUID& arg0,[In] ID3DXFileData** arg1) + ID3DXFileEnumObject::GetDataObjectById +
+ + +

Retrieves the data object that has the specified name.

+
+

Pointer to the requested name.

+

Address of a reference to an interface, representing the returned file data object.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following:DXFILEERR_BADVALUE, DXFILEERR_NOTFOUND.

+ +

Obtain the name szName of the current file data object with the method.

+
+ + bb205851 + HRESULT ID3DXFileEnumObject::GetDataObjectByName([In] const char* arg0,[In] ID3DXFileData** arg1) + ID3DXFileEnumObject::GetDataObjectByName +
+ + +

Applications use the methods of the interface to add data objects as children of a .x file data node.

+
+ +

The for the interface is IID_ID3DXFileSaveObject.

The LPD3DXFileSaveData type is defined as a reference to this interface.

 typedef interface  *LPD3DXFILESAVEDATA;	
+            
+
+ + bb205853 + ID3DXFileSaveData + ID3DXFileSaveData +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Retrieves a reference to this file data node.

+
+ + bb173951 + GetSave + GetSave + HRESULT ID3DXFileSaveData::GetSave([Out] ID3DXFileSaveObject** arg0) +
+ + +

Retrieves the template ID of this file data node.

+
+ + bb173952 + GetType + GetType + HRESULT ID3DXFileSaveData::GetType([Out] GUID* arg0) +
+ + +

Retrieves a reference to this file data node.

+
+ No documentation. +

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

+ + bb173951 + HRESULT ID3DXFileSaveData::GetSave([Out] ID3DXFileSaveObject** arg0) + ID3DXFileSaveData::GetSave +
+ + +

Retrieves the name of this file data node.

+
+ No documentation. + No documentation. +

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

+ +

For this method to succeed, either szName or puiSize must be non-null.

+
+ + bb173950 + HRESULT ID3DXFileSaveData::GetName([In] char* arg0,[Out] SIZE_T* arg1) + ID3DXFileSaveData::GetName +
+ + +

Retrieves the of this file data node.

+
+ No documentation. +

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

+ + bb205856 + HRESULT ID3DXFileSaveData::GetId([In] GUID* arg0) + ID3DXFileSaveData::GetId +
+ + +

Retrieves the template ID of this file data node.

+
+

Pointer to the representing the template in this file data node.

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: D3DXFERR_BADOBJECT, D3DXFERR_BADVALUE.

+ + bb173952 + HRESULT ID3DXFileSaveData::GetType([Out] GUID* arg0) + ID3DXFileSaveData::GetType +
+ + +

Adds a data object as a child of the file data node.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: D3DXFERR_BADOBJECT, D3DXFERR_BADVALUE, E_OUTOFMEMORY.

+ + bb205854 + HRESULT ID3DXFileSaveData::AddDataObject([In] const GUID& arg0,[In] const char* arg1,[In] const GUID* arg2,[In] SIZE_T arg3,[In] const void* arg4,[In] ID3DXFileSaveData** arg5) + ID3DXFileSaveData::AddDataObject +
+ + +

Adds a data reference as a child of this file data node. The data reference points to a file data object.

+
+ No documentation. + No documentation. +

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: D3DXFERR_BADOBJECT, D3DXFERR_BADVALUE, E_OUTOFMEMORY.

+ +

The file data object being referenced must have either a name or a . The file data object must also derive from a different parent object.

+
+ + bb205855 + HRESULT ID3DXFileSaveData::AddDataReference([In] const char* arg0,[In] const GUID* arg1) + ID3DXFileSaveData::AddDataReference +
+ + +

Applications use the methods of the interface to write a .x file to disk, and to add and save data objects and templates.

+
+ +

Templates are not required in every file. For example, you could put all templates into a single .x file rather than duplicating them in every .x file.

The interface is obtained by calling the method.

The globally unique identifier () for the interface is IID_ID3DXFileSaveObject.

The LPD3DXFILESAVEOBJECT type is defined as a reference to this interface.

 typedef interface  *LPD3DXFILESAVEOBJECT;	
+            
+
+ + bb173953 + ID3DXFileSaveObject + ID3DXFileSaveObject +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

Gets the interface of the object that created this object.

+
+ + bb173955 + GetFile + GetFile + HRESULT ID3DXFileSaveObject::GetFile([Out] ID3DXFile** arg0) +
+ + +

Gets the interface of the object that created this object.

+
+ No documentation. +

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: D3DXFERR_BADVALUE, E_NOINTERFACE, E_POINTER.

+ + bb173955 + HRESULT ID3DXFileSaveObject::GetFile([Out] ID3DXFile** arg0) + ID3DXFileSaveObject::GetFile +
+ + +

Adds a data object as a child of the object.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: D3DXFERR_BADOBJECT, DXFILEERR_BADVALUE, E_OUTOFMEMORY.

+ +

If a data reference object will reference the data object, either the szName or pId parameter must be non-null.

Save the created data to disk by using the method.

+
+ + bb173954 + HRESULT ID3DXFileSaveObject::AddDataObject([In] const GUID& arg0,[In] const char* arg1,[In] const GUID* arg2,[In] SIZE_T arg3,[In] const void* arg4,[In] ID3DXFileSaveData** arg5) + ID3DXFileSaveObject::AddDataObject +
+ + +

Saves a data object and its children to a .x file on disk.

+
+

If the method succeeds, the return value is . If the method fails, the return value can be the following: D3DXFERR_BADOBJECT.

+ +

After this method succeeds, , and can no longer be called until a new object is created.

+
+ + bb173956 + HRESULT ID3DXFileSaveObject::Save() + ID3DXFileSaveObject::Save +
+ + +

Stores an attribute table entry.

+
+ +

An attribute table is used to identify areas of the mesh that need to be drawn with different textures, render states, materials, and so on. In addition, the application can use the attribute table to hide portions of a mesh by not drawing a given attribute identifier (AttribId) when drawing the frame.

The LPD3DXATTRIBUTERANGE type is defined as a reference to the structure.

 typedef * LPD3DXATTRIBUTERANGE;	
+            
+
+ + bb172710 + D3DXATTRIBUTERANGE + D3DXATTRIBUTERANGE +
+ + +

Attribute table identifier.

+
+ + bb172710 + unsigned int AttribId + unsigned int AttribId +
+ + +

Starting face.

+
+ + bb172710 + unsigned int FaceStart + unsigned int FaceStart +
+ + +

Face count.

+
+ + bb172710 + unsigned int FaceCount + unsigned int FaceCount +
+ + +

Starting vertex.

+
+ + bb172710 + unsigned int VertexStart + unsigned int VertexStart +
+ + +

Vertex count.

+
+ + bb172710 + unsigned int VertexCount + unsigned int VertexCount +
+ + +

Specifies mesh weight attributes.

+
+ +

This structure describes how a simplification operation will consider vertex data when calculating relative costs between collapsing edges. For example, if the Normal field is 0.0, the simplification operation will ignore the vertex normal component when calculating the error for the collapse. However, if the Normal field is 1.0, the simplification operation will use the vertex normal component. If the Normal field is 2.0, double the amount of errors; if the Normal field is 4.0, then quadruple the number of errors, and so on.

The LPD3DXATTRIBUTEWEIGHTS type is defined as a reference to the structure.

 typedef * LPD3DXATTRIBUTEWEIGHTS;	
+            
+
+ + bb172711 + D3DXATTRIBUTEWEIGHTS + D3DXATTRIBUTEWEIGHTS +
+ + +

Position.

+
+ + bb172711 + float Position + float Position +
+ + +

Blend weight.

+
+ + bb172711 + float Boundary + float Boundary +
+ + +

Normal.

+
+ + bb172711 + float Normal + float Normal +
+ + +

Diffuse lighting value.

+
+ + bb172711 + float Diffuse + float Diffuse +
+ + +

Specular lighting value.

+
+ + bb172711 + float Specular + float Specular +
+ + +

Eight texture coordinates.

+
+ + bb172711 + float Texcoord[8] + float Texcoord +
+ + +

Tangent.

+
+ + bb172711 + float Tangent + float Tangent +
+ + +

Binormal.

+
+ + bb172711 + float Binormal + float Binormal +
+ + +

Throughput metrics for help in understanding the performance of an application.

+
+ + bb172539 + D3DDEVINFO_D3D9BANDWIDTHTIMINGS + D3DDEVINFO_D3D9BANDWIDTHTIMINGS +
+ + +

The bandwidth or maximum data transfer rate from the host CPU to the GPU. This is typically the bandwidth of the PCI or AGP bus which connects the CPU and the GPU.

+
+ + bb172539 + float MaxBandwidthUtilized + float MaxBandwidthUtilized +
+ + +

Memory utilized percentage when uploading data from the host CPU to the GPU.

+
+ + bb172539 + float FrontEndUploadMemoryUtilizedPercent + float FrontEndUploadMemoryUtilizedPercent +
+ + +

Vertex throughput percentage. This is the number of vertices processed compared to the theoretical maximum vertex processing rate.

+
+ + bb172539 + float VertexRateUtilizedPercent + float VertexRateUtilizedPercent +
+ + +

Triangle set-up throughput percentage. This is the number of triangles that are set up for rasterization compared to the theoretical maximum triangle set-up rate.

+
+ + bb172539 + float TriangleSetupRateUtilizedPercent + float TriangleSetupRateUtilizedPercent +
+ + +

Pixel fill throughput percentage. This is the number of pixels that are filled compared to the theoretical pixel fill.

+
+ + bb172539 + float FillRateUtilizedPercent + float FillRateUtilizedPercent +
+ + +

Defines a volume.

+
+ +

includes the left, top, and front edges; however, the right, bottom, and back edges are not included. For example, a box that is 100 units wide and begins at 0 (thus, including the points up to and including 99) would be expressed with a value of 0 for the Left member and a value of 100 for the Right member. Note that a value of 99 is not used for the Right member.

The restrictions on side ordering observed for are left to right, top to bottom, and front to back.

+
+ + bb172510 + D3DBOX + D3DBOX +
+ + +

Position of the left side of the box on the x-axis.

+
+ + bb172510 + unsigned int Left + unsigned int Left +
+ + +

Position of the top of the box on the y-axis.

+
+ + bb172510 + unsigned int Top + unsigned int Top +
+ + +

Position of the right side of the box on the x-axis.

+
+ + bb172510 + unsigned int Right + unsigned int Right +
+ + +

Position of the bottom of the box on the y-axis.

+
+ + bb172510 + unsigned int Bottom + unsigned int Bottom +
+ + +

Position of the front of the box on the z-axis.

+
+ + bb172510 + unsigned int Front + unsigned int Front +
+ + +

Position of the back of the box on the z-axis.

+
+ + bb172510 + unsigned int Back + unsigned int Back +
+ + +

Measure the cache hit rate performance for textures and indexed vertices.

+
+ +

An efficient cache is typically closer to a 90 percent hit rate, and an inefficient cache is typically closer to a 10 percent hit rate (although a low percentage is not necessarily a problem).

+
+ + bb172540 + D3DDEVINFO_D3D9CACHEUTILIZATION + D3DDEVINFO_D3D9CACHEUTILIZATION +
+ + +

The hit rate for finding a texture in the texture cache. This assumes there is a texture cache. Increasing the level-of-detail bias to use the most detailed texture, using many large textures, or producing a near random texture access pattern on large textures with custom shader code can dramatically affect the texture cache hit rate.

+
+ + bb172540 + float TextureCacheHitRate + float TextureCacheHitRate +
+ + +

The hit rate for finding transformed vertices in the vertex cache. The GPU is designed to transform indexed vertices and may store them in a vertex cache. If you are using meshes, or may result in better vertex cache utilization.

+
+ + bb172540 + float PostTransformVertexCacheHitRate + float PostTransformVertexCacheHitRate +
+ + +

Describes a callback key for use in key frame animation.

+
+ + bb172886 + D3DXKEY_CALLBACK + D3DXKEY_CALLBACK +
+ + +

Key frame time stamp.

+
+ + bb172886 + float Time + float Time +
+ + +

Pointer to user callback data.

+
+ + bb172886 + void* pCallbackData + void pCallbackData +
+ + +

Describes the current clip status.

+
+ +

When clipping is enabled during vertex processing (by ProcessVertices, DrawPrimitive, or other drawing functions), Direct3D computes a clip code for every vertex. The clip code is a combination of D3DCS_* bits. When a vertex is outside a particular clipping plane, the corresponding bit is set in the clipping code. Direct3D maintains the clip status using , which has ClipUnion and ClipIntersection members. ClipUnion is a bitwise OR of all vertex clip codes and ClipIntersection is a bitwise AND of all vertex clip codes. Initial values are zero for ClipUnion and 0xFFFFFFFF for ClipIntersection. When is set to , ClipUnion and ClipIntersection are set to zero. Direct3D updates the clip status during drawing calls. To compute clip status for a particular object, set ClipUnion and ClipIntersection to their initial value and continue drawing.

Clip status is not updated by DrawRectPatch and DrawTriPatch because there is no software emulation for them.

+
+ + bb172516 + D3DCLIPSTATUS9 + D3DCLIPSTATUS9 +
+ + +

Clip union flags that describe the current clip status. This member can be one or more of the following flags:

ValueMeaning

Combination of all clip flags.

All vertices are clipped by the left plane of the viewing frustum.

All vertices are clipped by the right plane of the viewing frustum.

All vertices are clipped by the top plane of the viewing frustum.

All vertices are clipped by the bottom plane of the viewing frustum.

All vertices are clipped by the front plane of the viewing frustum.

All vertices are clipped by the back plane of the viewing frustum.

Application-defined clipping planes.

Application-defined clipping planes.

Application-defined clipping planes.

Application-defined clipping planes.

Application-defined clipping planes.

Application-defined clipping planes.

?

+
+ + bb172516 + unsigned int ClipUnion + unsigned int ClipUnion +
+ + +

Clip intersection flags that describe the current clip status. This member can take the same flags as ClipUnion.

+
+ + bb172516 + unsigned int ClipIntersection + unsigned int ClipIntersection +
+ + +

A description of a constant in a constant table.

+
+ + bb172748 + D3DXCONSTANT_DESC + D3DXCONSTANT_DESC +
+ + +

Name of the constant.

+
+ + bb172748 + const char* Name + char Name +
+ + +

Constant data type. See .

+
+ + bb172748 + D3DXREGISTER_SET RegisterSet + D3DXREGISTER_SET RegisterSet +
+ + +

Zero-based index of the constant in the table.

+
+ + bb172748 + unsigned int RegisterIndex + unsigned int RegisterIndex +
+ + +

Number of registers that contain data.

+
+ + bb172748 + unsigned int RegisterCount + unsigned int RegisterCount +
+ + +

Parameter class. See .

+
+ + bb172748 + D3DXPARAMETER_CLASS Class + D3DXPARAMETER_CLASS Class +
+ + +

Parameter type. See .

+
+ + bb172748 + D3DXPARAMETER_TYPE Type + D3DXPARAMETER_TYPE Type +
+ + +

Number of rows.

+
+ + bb172748 + unsigned int Rows + unsigned int Rows +
+ + +

Number of columns.

+
+ + bb172748 + unsigned int Columns + unsigned int Columns +
+ + +

Number of elements in the array.

+
+ + bb172748 + unsigned int Elements + unsigned int Elements +
+ + +

Number of structure member sub-parameters.

+
+ + bb172748 + unsigned int StructMembers + unsigned int StructMembers +
+ + +

Data size in number of bytes.

+
+ + bb172748 + unsigned int Bytes + unsigned int Bytes +
+ + +

Pointer to the default value.

+
+ + bb172748 + const void* DefaultValue + void DefaultValue +
+ + +

A description of the constant table.

+
+ + bb172747 + D3DXCONSTANTTABLE_DESC + D3DXCONSTANTTABLE_DESC +
+ + +

Name of the constant table creator.

+
+ + bb172747 + const char* Creator + char Creator +
+ + +

Shader version.

+
+ + bb172747 + unsigned int Version + unsigned int Version +
+ + +

Number of constants in the constant table.

+
+ + bb172747 + unsigned int Constants + unsigned int Constants +
+ + +

Describes the creation parameters for a device.

+
+ + bb172538 + D3DDEVICE_CREATION_PARAMETERS + D3DDEVICE_CREATION_PARAMETERS +
+ + +

Ordinal number that denotes the display adapter. D3DADAPTER_DEFAULT is always the primary display adapter. Use this ordinal as the Adapter parameter for any of the methods. Note that different instances of Direct3D 9.0 objects can use different ordinals. Adapters can enter or leave a system when users, for example, add or remove monitors from a multiple-monitor system or when they hot-swap a laptop. Consequently, use this ordinal only in a Direct3D 9.0 instance known to be valid, that is, either the Direct3D 9.0 that created this interface or the Direct3D 9.0 returned from GetDirect3D, as called through this interface.

+
+ + bb172538 + unsigned int AdapterOrdinal + unsigned int AdapterOrdinal +
+ + +

Member of the enumerated type. Denotes the amount of emulated functionality for this device. The value of this parameter mirrors the value passed to the CreateDevice call that created this device.

+
+ + bb172538 + D3DDEVTYPE DeviceType + D3DDEVTYPE DeviceType +
+ + +

Window handle to which focus belongs for this Direct3D device. The value of this parameter mirrors the value passed to the CreateDevice call that created this device.

+
+ + bb172538 + HWND hFocusWindow + HWND hFocusWindow +
+ + +

A combination of one or more constants that control global behavior of the device. These constants mirror the constants passed to CreateDevice when the device was created.

+
+ + bb172538 + unsigned int BehaviorFlags + unsigned int BehaviorFlags +
+ + +

Specifies types of display modes to filter out.

+
+ + bb172550 + D3DDISPLAYMODEFILTER + D3DDISPLAYMODEFILTER +
+ + +

The size of this structure. This should always be set to sizeof().

+
+ + bb172550 + unsigned int Size + unsigned int Size +
+ + +

The display mode format to filter out. See .

+
+ + bb172550 + D3DFORMAT Format + D3DFORMAT Format +
+ + +

Whether the scanline ordering is interlaced or progressive. See .

+
+ + bb172550 + D3DSCANLINEORDERING ScanLineOrdering + D3DSCANLINEORDERING ScanLineOrdering +
+ + +

Describes an effect object.

+
+ +

An effect object can contain multiple rendering techniques and parameters for the same effect.

+
+ + bb172824 + D3DXEFFECT_DESC + D3DXEFFECT_DESC +
+ + +

String that contains the name of the effect creator.

+
+ + bb172824 + const char* Creator + char Creator +
+ + +

Number of parameters used for effect.

+
+ + bb172824 + unsigned int Parameters + unsigned int Parameters +
+ + +

Number of techniques that can render the effect.

+
+ + bb172824 + unsigned int Techniques + unsigned int Techniques +
+ + +

Number of functions that can render the effect.

+
+ + bb172824 + unsigned int Functions + unsigned int Functions +
+ + +

Describes an animation event.

+
+ + bb172826 + D3DXEVENT_DESC + D3DXEVENT_DESC +
+ + +

Event type, as defined in .

+
+ + bb172826 + D3DXEVENT_TYPE Type + D3DXEVENT_TYPE Type +
+ + +

Event track identifier.

+
+ + bb172826 + unsigned int Track + unsigned int Track +
+ + +

Start time of the event in global time.

+
+ + bb172826 + double StartTime + double StartTime +
+ + +

Duration of the event in global time.

+
+ + bb172826 + double Duration + double Duration +
+ + +

Transition style of the event, as defined in .

+
+ + bb172826 + D3DXTRANSITION_TYPE Transition + D3DXTRANSITION_TYPE Transition +
+ + +

Track weight for the event.

+
+ + bb172826 + float Weight + float Weight +
+ + +

Track speed for the event.

+
+ + bb172826 + float Speed + float Speed +
+ + +

Track position for the event.

+
+ + bb172826 + double Position + double Position +
+ + +

Enable flag.

+
+ + bb172826 + BOOL Enable + BOOL Enable +
+ + +

Returns material information saved in Direct3D (.x) files.

+
+ +

The and functions return an array of structures that specify the material color and name of the texture for each material in the mesh. The application is then required to load the texture.

The LPD3DXMATERIAL type is defined as a reference to the structure.

 typedef struct * LPD3DXMATERIAL;	
+            
+
+ + bb172911 + D3DXMATERIAL + D3DXMATERIAL +
+ + +

structure that describes the material properties.

+
+ + bb172911 + D3DMATERIAL9 MatD3D + D3DMATERIAL9 MatD3D +
+ + +

Pointer to a string that specifies the file name of the texture.

+
+ + bb172911 + char* pTextureFilename + char pTextureFilename +
+ + +

Defines the attributes of a font.

+
+ +

The compiler setting also determines the structure type. If Unicode is defined, the structure type resolves to a ; otherwise the structure type resolves to a D3DXFONT_DESCA.

Possible values of the above members are given in the GDI structure.

+
+ + bb172843 + D3DXFONT_DESCW + D3DXFONT_DESCW +
+ + +

Height, in logical units, of the font's character cell or character.

+
+ + bb172843 + int Height + int Height +
+ + +

Width, in logical units, of characters in the font.

+
+ + bb172843 + unsigned int Width + unsigned int Width +
+ + +

Weight of the font in the range from 0 through 1000.

+
+ + bb172843 + D3DX9_FONT_WEIGHT Weight + D3DX9_FONT_WEIGHT Weight +
+ + +

Number of mip levels requested. If this value is zero or D3DX_DEFAULT, a complete mipmap chain is created. If the value is 1, the texture space is mapped identically to the screen space.

+
+ + bb172843 + unsigned int MipLevels + unsigned int MipLevels +
+ + +

Set to TRUE for an Italic font.

+
+ + bb172843 + BOOL Italic + BOOL Italic +
+ + +

Character set.

+
+ + bb172843 + D3DX9_FONT_CHARSET CharSet + D3DX9_FONT_CHARSET CharSet +
+ + +

Output precision. The output precision defines how closely the output must match the requested font height, width, character orientation, escapement, pitch, and font type.

+
+ + bb172843 + D3DX9_FONT_PRECISION OutputPrecision + D3DX9_FONT_PRECISION OutputPrecision +
+ + +

Output quality.

+
+ + bb172843 + D3DX9_FONT_QUALITY Quality + D3DX9_FONT_QUALITY Quality +
+ + +

Pitch and family of the font.

+
+ + bb172843 + D3DX9_FONT_PITCHFAMILY PitchAndFamily + D3DX9_FONT_PITCHFAMILY PitchAndFamily +
+ + +

A null-terminated string or characters that specifies the typeface name of the font. The length of the string must not exceed 32 characters, including the terminating null character. If FaceName is an empty string, the first font that matches the other specified attributes will be used. If the compiler settings require Unicode, the data type TCHAR resolves to WCHAR; otherwise, the data type resolves to CHAR. See Remarks.

+
+ + bb172843 + wchar_t FaceName[32] + wchar_t FaceName +
+ + +

Encapsulates a transform frame in a transformation frame hierarchy.

+
+ +

An application can derive from this structure to add other data.

+
+ + bb172845 + D3DXFRAME + D3DXFRAME +
+ + +

Name of the frame.

+
+ + bb172845 + char* Name + char Name +
+ + +

Transformation matrix.

+
+ + bb172845 + D3DXMATRIX TransformationMatrix + D3DXMATRIX TransformationMatrix +
+ + +

Pointer to the mesh container.

+
+ + bb172845 + D3DXMESHCONTAINER* pMeshContainer + D3DXMESHCONTAINER pMeshContainer +
+ + +

Pointer to a sibling frame.

+
+ + bb172845 + D3DXFRAME* pFrameSibling + D3DXFRAME pFrameSibling +
+ + +

Pointer to a child frame.

+
+ + bb172845 + D3DXFRAME* pFrameFirstChild + D3DXFRAME pFrameFirstChild +
+ + + No documentation. + + + bb280311 + D3DXFUNCTION_DESC + D3DXFUNCTION_DESC + + + + No documentation. + + + bb280311 + const char* Name + char Name + + + + No documentation. + + + bb280311 + unsigned int Annotations + unsigned int Annotations + + + +

Contains red, green, and blue ramp data.

+
+ + bb172561 + D3DGAMMARAMP + D3DGAMMARAMP +
+ + +

Array of 256 WORD element that describes the red gamma ramp.

+
+ + bb172561 + unsigned short red[256] + unsigned short red +
+ + +

Array of 256 WORD element that describes the green gamma ramp.

+
+ + bb172561 + unsigned short green[256] + unsigned short green +
+ + +

Array of 256 WORD element that describes the blue gamma ramp.

+
+ + bb172561 + unsigned short blue[256] + unsigned short blue +
+ + +

Returns a description of the original contents of an image file.

+
+ + bb172879 + D3DXIMAGE_INFO + D3DXIMAGE_INFO +
+ + +

Width of original image in pixels.

+
+ + bb172879 + unsigned int Width + unsigned int Width +
+ + +

Height of original image in pixels.

+
+ + bb172879 + unsigned int Height + unsigned int Height +
+ + +

Depth of original image in pixels.

+
+ + bb172879 + unsigned int Depth + unsigned int Depth +
+ + +

Number of mip levels in original image.

+
+ + bb172879 + unsigned int MipLevels + unsigned int MipLevels +
+ + +

A value from the enumerated type that most closely describes the data in the original image.

+
+ + bb172879 + D3DFORMAT Format + D3DFORMAT Format +
+ + +

Represents the type of the texture stored in the file. It is either , , or D3DRTYPE_CubeTexture.

+
+ + bb172879 + D3DRESOURCETYPE ResourceType + D3DRESOURCETYPE ResourceType +
+ + +

Represents the format of the image file.

+
+ + bb172879 + D3DXIMAGE_FILEFORMAT ImageFileFormat + D3DXIMAGE_FILEFORMAT ImageFileFormat +
+ + + Retrieves information about a given image file on the disk. + + The filename. + A structure + HRESULT D3DXGetImageInfoFromFileInMemory([In] const void* pSrcData,[In] unsigned int SrcDataSize,[Out] D3DXIMAGE_INFO* pSrcInfo) + + + + Retrieves information about a given image file in memory. + + The memory. + A structure + HRESULT D3DXGetImageInfoFromFileInMemory([In] const void* pSrcData,[In] unsigned int SrcDataSize,[Out] D3DXIMAGE_INFO* pSrcInfo) + + + + Retrieves information about a given image file from a stream. + + The stream. + A structure + This method keeps the position of the stream + HRESULT D3DXGetImageInfoFromFileInMemory([In] const void* pSrcData,[In] unsigned int SrcDataSize,[Out] D3DXIMAGE_INFO* pSrcInfo) + + + + Retrieves information about a given image file from a stream. + + The stream. + if set to true preserve the stream position; false will move the stream pointer. + A structure + HRESULT D3DXGetImageInfoFromFileInMemory([In] const void* pSrcData,[In] unsigned int SrcDataSize,[Out] D3DXIMAGE_INFO* pSrcInfo) + + + +

Describes an index buffer.

+
+ + bb172563 + D3DINDEXBUFFER_DESC + D3DINDEXBUFFER_DESC +
+ + +

Member of the enumerated type, describing the surface format of the index buffer data.

+
+ + bb172563 + D3DFORMAT Format + D3DFORMAT Format +
+ + +

Member of the enumerated type, identifying this resource as an index buffer.

+
+ + bb172563 + D3DRESOURCETYPE Type + D3DRESOURCETYPE Type +
+ + +

Combination of one or more of the following flags, specifying the usage for this resource.

ValueMeaning

Set to indicate that the index buffer content will never require clipping.

Set to indicate that the index buffer requires dynamic memory use. This is useful for drivers because it enables them to decide where to place the buffer. In general, static index buffers are placed in video memory and dynamic index buffers are placed in AGP memory. Note that there is no separate static usage; if you do not specify the index buffer is made static. is strictly enforced through the and locking flags. As a result, and are only valid on index buffers created with ; they are not valid flags on static vertex buffers.

For more information about using dynamic index buffers, see Using Dynamic Vertex and Index Buffers.

Note that cannot be specified on managed index buffers. For more information, see Managing Resources (Direct3D 9).

Set to indicate when the index buffer is to be used for drawing high-order primitives.

Set to indicate when the index buffer is to be used for drawing N patches.

Set to indicate when the index buffer is to be used for drawing point sprites or indexed point lists.

Set to indicate that the buffer is to be used with software processing.

Informs the system that the application writes only to the index buffer. Using this flag enables the driver to choose the best memory location for efficient write operations and rendering. Attempts to read from an index buffer that is created with this capability can result in degraded performance.

?

+
+ + bb172563 + D3DUSAGE Usage + D3DUSAGE Usage +
+ + +

Member of the enumerated type, specifying the class of memory allocated for this index buffer.

+
+ + bb172563 + D3DPOOL Pool + D3DPOOL Pool +
+ + +

Size of the index buffer, in bytes.

+
+ + bb172563 + unsigned int Size + unsigned int Size +
+ + +

Percent of time processing data in the driver. These statistics may help identify cases when the driver is waiting for other resources.

+
+ +

These metrics help identify when a driver is waiting and what it is waiting for. High percentages are not necessarily a problem.

These system-global metrics may or may not be implemented. Depending on the specific hardware, these metrics may not support multiple queries simultaneously.

+
+ + bb172541 + D3DDEVINFO_D3D9INTERFACETIMINGS + D3DDEVINFO_D3D9INTERFACETIMINGS +
+ + +

Percentage of time the driver spent waiting for the GPU to finish using a locked resource (and wasn't specified).

+
+ + bb172541 + float WaitingForGPUToUseApplicationResourceTimePercent + float WaitingForGPUToUseApplicationResourceTimePercent +
+ + +

Percentage of time the driver spent waiting for the GPU to finish processing some commands before the driver could send more. This indicates the driver has run out of room to send commands to the GPU.

+
+ + bb172541 + float WaitingForGPUToAcceptMoreCommandsTimePercent + float WaitingForGPUToAcceptMoreCommandsTimePercent +
+ + +

Percentage of time the driver spent waiting for the GPU latency to reduce to less than three rendering frames.

If an application is GPU-limited, the driver must stall the CPU until the GPU gets within three frames. This prevents an application from queuing up many seconds' worth of rendering calls which may dramatically increase the latency between when the user inputs new data and when the user sees the results of that input. In general, the driver can track the number of times Present is called to prevent queuing up more than three frames of rendering work.

+
+ + bb172541 + float WaitingForGPUToStayWithinLatencyTimePercent + float WaitingForGPUToStayWithinLatencyTimePercent +
+ + +

Percentage of time the driver spent waiting for a resource that cannot be pipelined (that is operated in parallel). An application may want to avoid using a non-pipelined resource for performance reasons.

+
+ + bb172541 + float WaitingForGPUExclusiveResourceTimePercent + float WaitingForGPUExclusiveResourceTimePercent +
+ + +

Percentage of time the driver spent waiting for other GPU processing.

+
+ + bb172541 + float WaitingForGPUOtherTimePercent + float WaitingForGPUOtherTimePercent +
+ + +

Defines a set of lighting properties.

+
+ + bb172566 + D3DLIGHT9 + D3DLIGHT9 +
+ + +

Type of the light source. This value is one of the members of the enumerated type.

+
+ + bb172566 + D3DLIGHTTYPE Type + D3DLIGHTTYPE Type +
+ + +

Diffuse color emitted by the light. This member is a structure.

+
+ + bb172566 + D3DCOLORVALUE Diffuse + D3DCOLORVALUE Diffuse +
+ + +

Specular color emitted by the light. This member is a structure.

+
+ + bb172566 + D3DCOLORVALUE Specular + D3DCOLORVALUE Specular +
+ + +

Ambient color emitted by the light. This member is a structure.

+
+ + bb172566 + D3DCOLORVALUE Ambient + D3DCOLORVALUE Ambient +
+ + +

Position of the light in world space, specified by a structure. This member has no meaning for directional lights and is ignored in that case.

+
+ + bb172566 + D3DVECTOR Position + D3DVECTOR Position +
+ + +

Direction that the light is pointing in world space, specified by a structure. This member has meaning only for directional and spotlights. This vector need not be normalized, but it should have a nonzero length.

+
+ + bb172566 + D3DVECTOR Direction + D3DVECTOR Direction +
+ + +

Distance beyond which the light has no effect. The maximum allowable value for this member is the square root of FLT_MAX. This member does not affect directional lights.

+
+ + bb172566 + float Range + float Range +
+ + +

Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi).

The effect of falloff on the lighting is subtle. Furthermore, a small performance penalty is incurred by shaping the falloff curve. For these reasons, most developers set this value to 1.0.

+
+ + bb172566 + float Falloff + float Falloff +
+ + +

Value specifying how the light intensity changes over distance. Attenuation values are ignored for directional lights. This member represents an attenuation constant. For information about attenuation, see Light Properties (Direct3D 9). Valid values for this member range from 0.0 to infinity. For non-directional lights, all three attenuation values should not be set to 0.0 at the same time.

+
+ + bb172566 + float Attenuation0 + float Attenuation0 +
+ + +

Value specifying how the light intensity changes over distance. Attenuation values are ignored for directional lights. This member represents an attenuation constant. For information about attenuation, see Light Properties (Direct3D 9). Valid values for this member range from 0.0 to infinity. For non-directional lights, all three attenuation values should not be set to 0.0 at the same time.

+
+ + bb172566 + float Attenuation1 + float Attenuation1 +
+ + +

Value specifying how the light intensity changes over distance. Attenuation values are ignored for directional lights. This member represents an attenuation constant. For information about attenuation, see Light Properties (Direct3D 9). Valid values for this member range from 0.0 to infinity. For non-directional lights, all three attenuation values should not be set to 0.0 at the same time.

+
+ + bb172566 + float Attenuation2 + float Attenuation2 +
+ + +

Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.

+
+ + bb172566 + float Theta + float Theta +
+ + +

Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.

+
+ + bb172566 + float Phi + float Phi +
+ + + No documentation. + + + bb280342 + D3DLOCKED_BOX + D3DLOCKED_BOX + + + + No documentation. + + + bb280342 + int RowPitch + int RowPitch + + + + No documentation. + + + bb280342 + int SlicePitch + int SlicePitch + + + + No documentation. + + + bb280342 + void* pBits + void pBits + + + +

Describes a locked rectangular region.

+
+ +

The pitch for DXTn formats is different from what was returned in DirectX 7. It now refers to the number of bytes in a row of blocks. For example, if you have a width of 16, then you will have a pitch of 4 blocks (4*8 for DXT1, 4*16 for DXT2-5.)

+
+ + bb172570 + D3DLOCKED_RECT + D3DLOCKED_RECT +
+ + +

Number of bytes in one row of the surface.

+
+ + bb172570 + int Pitch + int Pitch +
+ + +

Pointer to the locked bits. If a was provided to the LockRect call, pBits will be appropriately offset from the start of the surface.

+
+ + bb172570 + void* pBits + void pBits +
+ + +

Describes preprocessor definitions used by an effect object.

+
+ +

To use s in more than one line, prefix each new line character with a backslash (like a #define in the C language). For example:

 sample=	
+            macro.Name = "DO_CODE_BLOCK";	
+            macro.Definition = "/* here is a block of code */\\\n" "{ do something ... }\\\n";	
+            

Notice the 3 backslash characters at the end of the line. The first two are required to output a single '\', followed by the newline character "\n". Optionally, you may also want to terminate your lines using "\\\r\n".

+
+ + bb172910 + D3DXMACRO + D3DXMACRO +
+ + +

Preprocessor name.

+
+ + bb172910 + const char* Name + char Name +
+ + +

Definition name.

+
+ + bb172910 + const char* Definition + char Definition +
+ + + Initializes a new instance of the struct. + + The name. + The definition. + + + +

Specifies material properties.

+
+ +

To turn off specular highlights, set to , using . This is the fastest option because no specular highlights will be calculated.

For more information about using the lighting engine to calculate specular lighting, see Specular Lighting (Direct3D 9).

+
+ + bb172571 + D3DMATERIAL9 + D3DMATERIAL9 +
+ + +

Value specifying the diffuse color of the material. See .

+
+ + bb172571 + D3DCOLORVALUE Diffuse + D3DCOLORVALUE Diffuse +
+ + +

Value specifying the ambient color of the material. See .

+
+ + bb172571 + D3DCOLORVALUE Ambient + D3DCOLORVALUE Ambient +
+ + +

Value specifying the specular color of the material. See .

+
+ + bb172571 + D3DCOLORVALUE Specular + D3DCOLORVALUE Specular +
+ + +

Value specifying the emissive color of the material. See .

+
+ + bb172571 + D3DCOLORVALUE Emissive + D3DCOLORVALUE Emissive +
+ + +

Floating-point value specifying the sharpness of specular highlights. The higher the value, the sharper the highlight.

+
+ + bb172571 + float Power + float Power +
+ + + No documentation. + + + bb280302 + D3DXMESHCONTAINER + D3DXMESHCONTAINER + + + + No documentation. + + + bb280302 + char* Name + char Name + + + + No documentation. + + + bb280302 + D3DXMESHDATA MeshData + D3DXMESHDATA MeshData + + + + No documentation. + + + bb280302 + D3DXMATERIAL* pMaterials + D3DXMATERIAL pMaterials + + + + No documentation. + + + bb280302 + D3DXEFFECTINSTANCE* pEffects + D3DXEFFECTINSTANCE pEffects + + + + No documentation. + + + bb280302 + unsigned int NumMaterials + unsigned int NumMaterials + + + + No documentation. + + + bb280302 + unsigned int* pAdjacency + unsigned int pAdjacency + + + + No documentation. + + + bb280302 + ID3DXSkinInfo* pSkinInfo + ID3DXSkinInfo pSkinInfo + + + + No documentation. + + + bb280302 + D3DXMESHCONTAINER* pNextMeshContainer + D3DXMESHCONTAINER pNextMeshContainer + + + + Gets or sets the materials. + + + The materials. + + + + +

Mesh data structure.

+
+ + bb205372 + D3DXMESHDATA + D3DXMESHDATA +
+ + +

Defines the mesh data type. See .

+
+ + bb205372 + D3DXMESHDATATYPE Type + D3DXMESHDATATYPE Type +
+ + +

Pointer to a mesh. See .

+
+ + bb205372 + ID3DXMesh* pMesh + ID3DXMesh pMesh +
+ + +

Pointer to a patch mesh. See .

+
+ + bb205372 + ID3DXPMesh* pPMesh + ID3DXPMesh pPMesh +
+ + +

Pointer to a patch mesh. See .

+
+ + bb205372 + ID3DXPatchMesh* pPatchMesh + ID3DXPatchMesh pPatchMesh +
+ + +

Describes a parameter used for an effect object.

+
+ + bb205379 + D3DXPARAMETER_DESC + D3DXPARAMETER_DESC +
+ + +

Name of the parameter.

+
+ + bb205379 + const char* Name + char Name +
+ + +

Semantic meaning, also called the usage.

+
+ + bb205379 + const char* Semantic + char Semantic +
+ + +

Parameter class. Set this to one of the values in .

+
+ + bb205379 + D3DXPARAMETER_CLASS Class + D3DXPARAMETER_CLASS Class +
+ + +

Parameter type. Set this to one of the values in .

+
+ + bb205379 + D3DXPARAMETER_TYPE Type + D3DXPARAMETER_TYPE Type +
+ + +

Number of rows in the array.

+
+ + bb205379 + unsigned int Rows + unsigned int Rows +
+ + +

Number of columns in the array.

+
+ + bb205379 + unsigned int Columns + unsigned int Columns +
+ + +

Number of elements in the array.

+
+ + bb205379 + unsigned int Elements + unsigned int Elements +
+ + +

Number of annotations.

+
+ + bb205379 + unsigned int Annotations + unsigned int Annotations +
+ + +

Number of structure members.

+
+ + bb205379 + unsigned int StructMembers + unsigned int StructMembers +
+ + +

Parameter attributes. See Effect Constants.

+
+ + bb205379 + unsigned int Flags + unsigned int Flags +
+ + +

The size of the parameter, in bytes.

+
+ + bb205379 + unsigned int Bytes + unsigned int Bytes +
+ + +

Describes a pass for an effect object.

+
+ + bb205381 + D3DXPASS_DESC + D3DXPASS_DESC +
+ + +

String value used for the pass.

+
+ + bb205381 + const char* Name + char Name +
+ + +

Annotations are user-specific data that can be attached to any technique, pass, or parameter. See Add Information to Effect Parameters with_Annotations.

+
+ + bb205381 + unsigned int Annotations + unsigned int Annotations +
+ + +

Pointer to the vertex shader function. If an effect is created with , this structure will return a null reference when called by GetPassDesc.

+
+ + bb205381 + const unsigned int* pVertexShaderFunction + unsigned int pVertexShaderFunction +
+ + +

Pointer to the pixel shader function. If an effect is created with , this structure will return a null reference when called by GetPassDesc.

+
+ + bb205381 + const unsigned int* pPixelShaderFunction + unsigned int pPixelShaderFunction +
+ + +

Structure that contains the attributes of a patch mesh.

+
+ +

A mesh is a set of faces, each of which is described by a simple polygon. Objects can be created by connecting several meshes together. A patch mesh is constructed from patches. A patch is a four-sided piece of geometry constructed from curves. The type of curve used and the order of the curve can be varied so that the patch surface will fit almost any surface shape.

The following types of patch combinations are supported:

Patch TypeBasisDegree
RectangleBezier2,3,5
RectangleB-Spline2,3,5
RectangleCatmull-Rom3
TriangleBezier2,3,5
N-patchN/A3

?

+
+ + bb205382 + D3DXPATCHINFO + D3DXPATCHINFO +
+ + +

The patch type. For information about patch types, see .

+
+ + bb205382 + D3DXPATCHMESHTYPE PatchType + D3DXPATCHMESHTYPE PatchType +
+ + +

Degree of the curves used to construct the patch. For information about the degrees supported, see .

+
+ + bb205382 + D3DDEGREETYPE Degree + D3DDEGREETYPE Degree +
+ + +

Type of curve used to construct the patch. For information about the basis types supported, see .

+
+ + bb205382 + D3DBASISTYPE Basis + D3DBASISTYPE Basis +
+ + +

Percent of time processing data in the pipeline.

+
+ +

For best performance, a balanced load is recommended.

+
+ + bb172542 + D3DDEVINFO_D3D9PIPELINETIMINGS + D3DDEVINFO_D3D9PIPELINETIMINGS +
+ + +

Percent of time spent running vertex shaders.

+
+ + bb172542 + float VertexProcessingTimePercent + float VertexProcessingTimePercent +
+ + +

Percent of time spent running pixel shaders.

+
+ + bb172542 + float PixelProcessingTimePercent + float PixelProcessingTimePercent +
+ + +

Percent of time spent doing other processing.

+
+ + bb172542 + float OtherGPUProcessingTimePercent + float OtherGPUProcessingTimePercent +
+ + +

Percent of time not processing anything.

+
+ + bb172542 + float GPUIdleTimePercent + float GPUIdleTimePercent +
+ + +

Pixel shader driver caps.

+
+ + bb172591 + D3DPSHADERCAPS2_0 + D3DPSHADERCAPS2_0 +
+ + +

Instruction predication is supported if this value is nonzero. See setp_comp - vs.

+
+ + bb172591 + D3DPS20CAPS Caps + D3DPS20CAPS Caps +
+ + +

Either 0 or 24, which represents the depth of the dynamic flow control instruction nesting. See .

+
+ + bb172591 + int DynamicFlowControlDepth + int DynamicFlowControlDepth +
+ + +

The number of temporary registers supported. See .

+
+ + bb172591 + int NumTemps + int NumTemps +
+ + +

The depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - vs instructions. See .

+
+ + bb172591 + int StaticFlowControlDepth + int StaticFlowControlDepth +
+ + +

The number of instruction slots supported. See .

+
+ + bb172591 + int NumInstructionSlots + int NumInstructionSlots +
+ + +

Describes swapchain statistics relating to PresentEx calls.

+
+ +

When a 9Ex application adopts Flip Mode present (), applications can detect frame dropping by calling GetPresentStatistics at any point in time. In effect, they can do the following.

  1. Render to the back buffer
  2. Call Present
  3. Call GetPresentStats and store the resulting structure
  4. Render the next frame to the back buffer
  5. Call Present
  6. Repeat steps 4 and 5 one or more times
  7. Call GetPresentStats and store the resulting structure
  8. Compare the values of PresentRefreshCount from the two stored structures. The application can calculate the corresponding PresentRefreshCount of a particular PresentCount parameter based on the assumptions of PresentRefreshCount increment and PresentCount assignment of frame presents. If the PresentRefreshCount last sampled does not match the PresentCount (i.e. if the PresentRefreshCount has incremented but PresentCount has not, then there was frame dropping.)

Applications can determine whether a frame has been dropped by sampling any two instances of PresentCount and GetPresentStats (by calling GetPresentStats API at any two points in time). For example, a media application that is presenting at the same rate as the monitor refresh rate (for example, monitor refresh rate is 60Hz, the application presents a frame every 1/60 seconds) wants to present frames A, B, C, D, E, each corresponding to Present IDs (PresentCount) 1, 2, 3, 7, 8.

The application code looks like the following sequence.

  1. Render frame A to the back buffer
  2. Call Present, PresentCount = 1
  3. Call GetPresentStats and store the resulting structure
  4. Render the next 4 frames, B, C, D, E, respectively
  5. Call Present 4 times, PresentCounts = 2, 3, 7, 8, respectively
  6. Call GetPresentStats and store the resulting structure
  7. Compare the values of PresentRefreshCount from the two stored structures. If the difference is 2, i.e. 2 vblank intervals has elapsed between the two GetPresentStats API calls, then the last presented frame should be frame C. Because the application presents once very vblank interval (the refresh rate of the monitor), the time elapsed between when frame A is presented and when frame C is presented should be 2 vblanks.
  8. Compare the values of PresentCount from the two stored structures. If the first PresentCount is 1 (corresponding to frame A) and the second PresentCount is 3 (corresponding to frame C), then no frames have been dropped. If the second PresentCount is 3, which corresponds to frame D, then the application knows that one frame has been dropped.

Note that GetPresentStatistics will be processed after it is called, regardless of the state of FLIPEX mode PresentEx calls.

Windows?Vista:??The Present calls will be queued and then processed before GetPresentStats call will be processed.

When an application detects that the presentation of certain frames are behind, it can skip those frames and correct the presentation to re-synchronize with the vblank. To do this, an application can simply not render the late frames and start rendering with the next correct frame in the queue. However, if an application has already started the rendering of late frames, it can use a new Present parameter in D3D9Ex called . The flag will be passed in the parameters of Present API call and indicates to the runtime that the frame will be processed immediately within the next vblank interval, effectively not visible on screen at all. Here is the application usage example after the last step in the previous example.

  1. Render the next frame to the back buffer
  2. Discover from PresentRefreshCount that the next frame is already late
  3. Set Present interval to
  4. Call Present on the next frame

Applications can synchronize video and audio streams in the same manner because the behavior of GetPresentStatistics does not change in that scenario.

D3D9Ex Flip Mode provides frame statistics information to windowed applications and full screen 9Ex applications.

Windows?Vista:??Use the DWM APIs for retrieving present statistics.

When Desktop Window Manager is turned off, windowed mode 9Ex applications using flip mode will receive present statistics information of limited accuracy.

Windows?Vista:??

If an application is not fast enough to keep up with the monitor's refresh rate, possibly due to slow hardware or lack of system resources, then it can experience a graphics glitch. A glitch is a so-called visual hiccup. If a monitor is set to refresh at 60 Hz, and the application can only manage 30 fps, then half of the frames will have glitches.

Applications can detect a glitch by keeping track of SynchRefreshCount. For example, an application might perform the following sequence of actions.

  1. Render to the back buffer.
  2. Call Present.
  3. Call GetPresentStats and store the resulting structure.
  4. Render the next frame to the back buffer.
  5. Call Present.
  6. Call GetPresentStats and store the resulting structure.
  7. Compare the values of SyncRefreshCount from the two stored structures. If the difference is greater than one, then a frame was skipped.
+
+ + bb172587 + D3DPRESENTSTATS + D3DPRESENTSTATS +
+ + + No documentation. + + + bb172587 + unsigned int PresentCount + unsigned int PresentCount + + + + No documentation. + + + bb172587 + unsigned int PresentRefreshCount + unsigned int PresentRefreshCount + + + + No documentation. + + + bb172587 + unsigned int SyncRefreshCount + unsigned int SyncRefreshCount + + + + No documentation. + + + bb172587 + LARGE_INTEGER SyncQPCTime + LARGE_INTEGER SyncQPCTime + + + + No documentation. + + + bb172587 + LARGE_INTEGER SyncGPUTime + LARGE_INTEGER SyncGPUTime + + + +

Describes the presentation parameters.

+
+ + bb172588 + D3DPRESENT_PARAMETERS + D3DPRESENT_PARAMETERS +
+ + +

Width of the new swap chain's back buffers, in pixels. If Windowed is (the presentation is full-screen), this value must equal the width of one of the enumerated display modes found through EnumAdapterModes. If Windowed is TRUE and either BackBufferWidth or BackBufferHeight is zero, the corresponding dimension of the client area of the hDeviceWindow (or the focus window, if hDeviceWindow is null) is taken.

+
+ + bb172588 + unsigned int BackBufferWidth + unsigned int BackBufferWidth +
+ + +

Height of the new swap chain's back buffers, in pixels. If Windowed is (the presentation is full-screen), this value must equal the height of one of the enumerated display modes found through EnumAdapterModes. If Windowed is TRUE and either BackBufferWidth or BackBufferHeight is zero, the corresponding dimension of the client area of the hDeviceWindow (or the focus window, if hDeviceWindow is null) is taken.

+
+ + bb172588 + unsigned int BackBufferHeight + unsigned int BackBufferHeight +
+ + +

The back buffer format. For more information about formats, see . This value must be one of the render-target formats as validated by CheckDeviceType. You can use GetDisplayMode to obtain the current format.

In fact, can be specified for the BackBufferFormat while in windowed mode. This tells the runtime to use the current display-mode format and eliminates the need to call GetDisplayMode.

For windowed applications, the back buffer format no longer needs to match the display-mode format because color conversion can now be done by the hardware (if the hardware supports color conversion). The set of possible back buffer formats is constrained, but the runtime will allow any valid back buffer format to be presented to any desktop format. (There is the additional requirement that the device be operable in the desktop; devices typically do not operate in 8 bits per pixel modes.)

Full-screen applications cannot do color conversion.

+
+ + bb172588 + D3DFORMAT BackBufferFormat + D3DFORMAT BackBufferFormat +
+ + +

This value can be between 0 and (or when using Direct3D 9Ex). Values of 0 are treated as 1. If the number of back buffers cannot be created, the runtime will fail the method call and fill this value with the number of back buffers that could be created. As a result, an application can call the method twice with the same structure and expect it to work the second time.

The method fails if one back buffer cannot be created. The value of BackBufferCount influences what set of swap effects are allowed. Specifically, any swap effect requires that there be exactly one back buffer.

+
+ + bb172588 + unsigned int BackBufferCount + unsigned int BackBufferCount +
+ + +

Member of the enumerated type. The value must be unless SwapEffect has been set to . Multisampling is supported only if the swap effect is .

+
+ + bb172588 + D3DMULTISAMPLE_TYPE MultiSampleType + D3DMULTISAMPLE_TYPE MultiSampleType +
+ + +

Quality level. The valid range is between zero and one less than the level returned by pQualityLevels used by CheckDeviceMultiSampleType. Passing a larger value returns the error . Paired values of render targets or of depth stencil surfaces and must match.

+
+ + bb172588 + unsigned int MultiSampleQuality + unsigned int MultiSampleQuality +
+ + +

Member of the enumerated type. The runtime will guarantee the implied semantics concerning buffer swap behavior; therefore, if Windowed is TRUE and SwapEffect is set to , the runtime will create one extra back buffer and copy whichever becomes the front buffer at presentation time.

requires that BackBufferCount be set to 1.

will be enforced in the debug runtime by filling any buffer with noise after it is presented.

Differences between Direct3D9 and Direct3D9Ex

In Direct3D9Ex, is added to designate when an application is adopting flip mode. That is, whan an application's frame is passed in window's mode (instead of copied) to the Desktop Window Manager(DWM) for composition. Flip mode provides more efficient memory bandwidth and enables an application to take advantage of full-screen-present statistics. It does not change full screen behavior. Flip mode behavior is available beginning with Windows 7.

?

+
+ + bb172588 + D3DSWAPEFFECT SwapEffect + D3DSWAPEFFECT SwapEffect +
+ + +

The device window determines the location and size of the back buffer on screen. This is used by Direct3D when the back buffer contents are copied to the front buffer during Present.

  • For a full-screen application, this is a handle to the top window (which is the focus window).

    For applications that use multiple full-screen devices (such as a multimonitor system), exactly one device can use the focus window as the device window. All other devices must have unique device windows.

  • For a windowed-mode application, this handle will be the default target window for Present. If this handle is null, the focus window will be taken.

Note that no attempt is made by the runtime to reflect user changes in window size. The back buffer is not implicitly reset when this window is reset. However, the Present method does automatically track window position changes.

+
+ + bb172588 + HWND hDeviceWindow + HWND hDeviceWindow +
+ + +

TRUE if the application runs windowed; if the application runs full-screen.

+
+ + bb172588 + BOOL Windowed + BOOL Windowed +
+ + +

If this value is TRUE, Direct3D will manage depth buffers for the application. The device will create a depth-stencil buffer when it is created. The depth-stencil buffer will be automatically set as the render target of the device. When the device is reset, the depth-stencil buffer will be automatically destroyed and recreated in the new size.

If EnableAutoDepthStencil is TRUE, then AutoDepthStencilFormat must be a valid depth-stencil format.

+
+ + bb172588 + BOOL EnableAutoDepthStencil + BOOL EnableAutoDepthStencil +
+ + +

Member of the enumerated type. The format of the automatic depth-stencil surface that the device will create. This member is ignored unless EnableAutoDepthStencil is TRUE.

+
+ + bb172588 + D3DFORMAT AutoDepthStencilFormat + D3DFORMAT AutoDepthStencilFormat +
+ + +

One of the constants.

+
+ + bb172588 + D3DPRESENTFLAG Flags + D3DPRESENTFLAG Flags +
+ + +

The rate at which the display adapter refreshes the screen. The value depends on the mode in which the application is running:

  • For windowed mode, the refresh rate must be 0.
  • For full-screen mode, the refresh rate is one of the refresh rates returned by EnumAdapterModes.
+
+ + bb172588 + unsigned int FullScreen_RefreshRateInHz + unsigned int FullScreen_RefreshRateInHz +
+ + +

The maximum rate at which the swap chain's back buffers can be presented to the front buffer. For a detailed explanation of the modes and the intervals that are supported, see .

+
+ + bb172588 + D3DPRESENT_INTERVAL PresentationInterval + D3DPRESENT_INTERVAL PresentationInterval +
+ + + Initializes a new instance of the struct. + + Width of the back buffer. + Height of the back buffer. + + + + Initializes a new instance of the struct. + + Width of the back buffer. + Height of the back buffer. + The back buffer format. + The back buffer count. + Type of the multi sample. + The multi sample quality. + The swap effect. + The device window handle. + if set to true [windowed]. + if set to true [enable auto depth stencil]. + The auto depth stencil format. + The present flags. + The full screen refresh rate in Hz. + The presentation interval. + + + + Init this structure to defaults + + + + +

Describes the raster status.

+
+ + bb172596 + D3DRASTER_STATUS + D3DRASTER_STATUS +
+ + +

TRUE if the raster is in the vertical blank period. if the raster is not in the vertical blank period.

+
+ + bb172596 + BOOL InVBlank + BOOL InVBlank +
+ + +

If InVBlank is , then this value is an integer roughly corresponding to the current scan line painted by the raster. Scan lines are numbered in the same way as Direct3D surface coordinates: 0 is the top of the primary surface, extending to the value (height of the surface - 1) at the bottom of the display.

If InVBlank is TRUE, then this value is set to zero and can be ignored.

+
+ + bb172596 + unsigned int ScanLine + unsigned int ScanLine +
+ + +

Describes a rectangular high-order patch.

+
+ +

The following diagram identifies the parameters that specify a rectangle patch.

Each of the vertices in the vertex buffer is shown as a black dot. In this case, the vertex buffer has 20 vertices in it, 16 of which are in the rectangle patch. The stride is the number of vertices in the width of the vertex buffer, in this case five. The x offset to the first vertex is called the StartIndexVertexWidth and is in this case 1. The y offset to the first patch vertex is called the StartIndexVertexHeight and is in this case 0.

To render a stream of individual rectangular patches (non-mosaic), you should interpret your geometry as a long narrow (1 x N) rectangular patch. The structure for such a strip (cubic B?zier) would be set up in the following manner.

  RectInfo; RectInfo.Width = 4;	
+            RectInfo.Height = 4;	
+            RectInfo.Stride = 4;	
+            RectInfo.Basis = ;	
+            RectInfo.Order = D3DORDER_CUBIC;	
+            RectInfo.StartVertexOffsetWidth = 0;	
+            RectInfo.StartVertexOffsetHeight = 4*i;  // The variable i is the index of the 	
+            //   patch you want to render.	
+            
+
+ + bb172598 + D3DRECTPATCH_INFO + D3DRECTPATCH_INFO +
+ + +

Starting vertex offset width, in number of vertices.

+
+ + bb172598 + unsigned int StartVertexOffsetWidth + unsigned int StartVertexOffsetWidth +
+ + +

Starting vertex offset height, in number of vertices.

+
+ + bb172598 + unsigned int StartVertexOffsetHeight + unsigned int StartVertexOffsetHeight +
+ + +

Width of each vertex, in number of vertices.

+
+ + bb172598 + unsigned int Width + unsigned int Width +
+ + +

Height of each vertex, in number of vertices.

+
+ + bb172598 + unsigned int Height + unsigned int Height +
+ + +

Width of the imaginary two-dimensional vertex array, which occupies the same space as the vertex buffer. For an example, see the diagram below.

+
+ + bb172598 + unsigned int Stride + unsigned int Stride +
+ + +

Member of the enumerated type, defining the basis type for the rectangular high-order patch.

ValueOrder supportedWidth and height
Linear, cubic, and quinticWidth = height = (DWORD)order + 1
Linear, cubic, and quinticWidth = height > (DWORD)order
D3DBASIS_INTERPOLATECubicWidth = height > (DWORD)order

?

+
+ + bb172598 + D3DBASISTYPE Basis + D3DBASISTYPE Basis +
+ + +

Member of the enumerated type, defining the degree for the rectangular patch.

+
+ + bb172598 + D3DDEGREETYPE Degree + D3DDEGREETYPE Degree +
+ + +

Describes an off-screen render target used by an instance of .

+
+ +

This method is used to return the creation parameters used when creating an object.

+
+ + bb205425 + D3DXRTE_DESC + D3DXRTE_DESC +
+ + + No documentation. + + + bb205425 + unsigned int Size + unsigned int Size + + + + No documentation. + + + bb205425 + unsigned int MipLevels + unsigned int MipLevels + + + + No documentation. + + + bb205425 + D3DFORMAT Format + D3DFORMAT Format + + + + No documentation. + + + bb205425 + BOOL DepthStencil + BOOL DepthStencil + + + + No documentation. + + + bb205425 + D3DFORMAT DepthStencilFormat + D3DFORMAT DepthStencilFormat + + + +

Describes a render surface.

+
+ + bb205426 + D3DXRTS_DESC + D3DXRTS_DESC +
+ + +

Width of the render surface, in pixels.

+
+ + bb205426 + unsigned int Width + unsigned int Width +
+ + +

Height of the render surface, in pixels.

+
+ + bb205426 + unsigned int Height + unsigned int Height +
+ + +

Member of the enumerated type, describing the pixel format of the render surface.

+
+ + bb205426 + D3DFORMAT Format + D3DFORMAT Format +
+ + +

If TRUE, the render surface supports a depth-stencil surface; otherwise this member is set to .

+
+ + bb205426 + BOOL DepthStencil + BOOL DepthStencil +
+ + +

If DepthStencil is set to TRUE, this parameter is a member of the enumerated type, describing the depth-stencil format of the render surface.

+
+ + bb205426 + D3DFORMAT DepthStencilFormat + D3DFORMAT DepthStencilFormat +
+ + + No documentation. + + + bb280347 + D3DDEVINFO_RESOURCEMANAGER + D3DDEVINFO_RESOURCEMANAGER + + + + No documentation. + + + bb280347 + D3DRESOURCESTATS stats[8] + D3DRESOURCESTATS stats + + + +

Resource statistics gathered by the D3DDEVINFO_ResourceManager when using the asynchronous query mechanism.

+
+ + bb172600 + D3DRESOURCESTATS + D3DRESOURCESTATS +
+ + + No documentation. + + + bb172600 + BOOL bThrashing + BOOL bThrashing + + + + No documentation. + + + bb172600 + unsigned int ApproxBytesDownloaded + unsigned int ApproxBytesDownloaded + + + + No documentation. + + + bb172600 + unsigned int NumEvicts + unsigned int NumEvicts + + + + No documentation. + + + bb172600 + unsigned int NumVidCreates + unsigned int NumVidCreates + + + + No documentation. + + + bb172600 + unsigned int LastPri + unsigned int LastPri + + + + No documentation. + + + bb172600 + unsigned int NumUsed + unsigned int NumUsed + + + + No documentation. + + + bb172600 + unsigned int NumUsedInVidMem + unsigned int NumUsedInVidMem + + + + No documentation. + + + bb172600 + unsigned int WorkingSet + unsigned int WorkingSet + + + + No documentation. + + + bb172600 + unsigned int WorkingSetBytes + unsigned int WorkingSetBytes + + + + No documentation. + + + bb172600 + unsigned int TotalManaged + unsigned int TotalManaged + + + + No documentation. + + + bb172600 + unsigned int TotalBytes + unsigned int TotalBytes + + + + No documentation. + + + bb280307 + D3DXKEY_QUATERNION + D3DXKEY_QUATERNION + + + + No documentation. + + + bb280307 + float Time + float Time + + + + No documentation. + + + bb280307 + D3DXQUATERNION Value + D3DXQUATERNION Value + + + +

Describes a vector key for use in key frame animation. It specifies a vector at a given time. This is used for scale and translation keys.

+
+ + bb172889 + D3DXKEY_VECTOR3 + D3DXKEY_VECTOR3 +
+ + +

Key frame time stamp.

+
+ + bb172889 + float Time + float Time +
+ + +

3D vector that supplies scale and/or translation values.

+
+ + bb172889 + D3DXVECTOR3 Value + D3DXVECTOR3 Value +
+ + + No documentation. + + + bb205439 + D3DXSHADER_CONSTANTINFO + D3DXSHADER_CONSTANTINFO + + + +

Offset from the beginning of this structure, in bytes, to the string that contains the constant information.

+
+ + bb205439 + unsigned int Name + unsigned int Name +
+ + +

Register set. See .

+
+ + bb205439 + unsigned short RegisterSet + unsigned short RegisterSet +
+ + +

The register index.

+
+ + bb205439 + unsigned short RegisterIndex + unsigned short RegisterIndex +
+ + +

Number of registers.

+
+ + bb205439 + unsigned short RegisterCount + unsigned short RegisterCount +
+ + +

Reserved.

+
+ + bb205439 + unsigned short Reserved + unsigned short Reserved +
+ + +

Offset from the beginning of this structure, in bytes, to the string that contains the D3DXSHADER_TYPEINFO information.

+
+ + bb205439 + unsigned int TypeInfo + unsigned int TypeInfo +
+ + +

Offset from the beginning of this structure, in bytes, to the string that contains the default value.

+
+ + bb205439 + unsigned int DefaultValue + unsigned int DefaultValue +
+ + +

Helper structure for managing a shader constant table. This can also be done using .

+
+ +

Shader constant information is included in a tab-delimited table of comments. All offsets are measured in bytes from the beginning of the structure. Entries in the constant table are sorted by Creator in ascending order.

A shader constant table can be managed with the interfaces. Alternatively, you can manage the constant table with .

This size member is often initialized using the following:

  constantTable;	
+            constantTable.Size = sizeof()	
+            
+
+ + bb205440 + D3DXSHADER_CONSTANTTABLE + D3DXSHADER_CONSTANTTABLE +
+ + + No documentation. + + + bb205440 + unsigned int Size + unsigned int Size + + + + No documentation. + + + bb205440 + unsigned int Creator + unsigned int Creator + + + + No documentation. + + + bb205440 + unsigned int Version + unsigned int Version + + + + No documentation. + + + bb205440 + unsigned int Constants + unsigned int Constants + + + + No documentation. + + + bb205440 + unsigned int ConstantInfo + unsigned int ConstantInfo + + + + No documentation. + + + bb205440 + unsigned int Flags + unsigned int Flags + + + + No documentation. + + + bb205440 + unsigned int Target + unsigned int Target + + + +

Semantics map a parameter to vertex or pixel shader registers. They can also be optional descriptive strings attached to non-register parameters.

+
+ +

Semantics are required for vertex and pixel shader, input and output registers.

+
+ + bb205437 + D3DXSEMANTIC + D3DXSEMANTIC +
+ + +

Options that identify how resources are used. See .

+
+ + bb205437 + D3DDECLUSAGE Usage + D3DDECLUSAGE Usage +
+ + +

Options that modify how the usage is interpreted. The usage and usage index make up a vertex declaration. See Vertex Declaration (Direct3D 9).

+
+ + bb205437 + unsigned int UsageIndex + unsigned int UsageIndex +
+ + +

Percent of time processing shader data.

+
+ +

For best performance, a balanced load is recommended.

+
+ + bb172543 + D3DDEVINFO_D3D9STAGETIMINGS + D3DDEVINFO_D3D9STAGETIMINGS +
+ + +

Percent of time in shader spent on memory accesses.

+
+ + bb172543 + float MemoryProcessingPercent + float MemoryProcessingPercent +
+ + +

Percent of time processing (moving data around in registers or doing mathematical operations).

+
+ + bb172543 + float ComputationProcessingPercent + float ComputationProcessingPercent +
+ + +

Describes a surface.

+
+ + bb172611 + D3DSURFACE_DESC + D3DSURFACE_DESC +
+ + +

Member of the enumerated type, describing the surface format.

+
+ + bb172611 + D3DFORMAT Format + D3DFORMAT Format +
+ + +

Member of the enumerated type, identifying this resource as a surface.

+
+ + bb172611 + D3DRESOURCETYPE Type + D3DRESOURCETYPE Type +
+ + +

Either the or values. For more information, see .

+
+ + bb172611 + D3DUSAGE Usage + D3DUSAGE Usage +
+ + +

Member of the enumerated type, specifying the class of memory allocated for this surface.

+
+ + bb172611 + D3DPOOL Pool + D3DPOOL Pool +
+ + +

Member of the enumerated type, specifying the levels of full-scene multisampling supported by the surface.

+
+ + bb172611 + D3DMULTISAMPLE_TYPE MultiSampleType + D3DMULTISAMPLE_TYPE MultiSampleType +
+ + +

Quality level. The valid range is between zero and one less than the level returned by pQualityLevels used by CheckDeviceMultiSampleType. Passing a larger value returns the error, . The MultisampleQuality values of paired render targets, depth stencil surfaces and the MultiSample type must all match.

+
+ + bb172611 + unsigned int MultiSampleQuality + unsigned int MultiSampleQuality +
+ + +

Width of the surface, in pixels.

+
+ + bb172611 + unsigned int Width + unsigned int Width +
+ + +

Height of the surface, in pixels.

+
+ + bb172611 + unsigned int Height + unsigned int Height +
+ + +

Describes a technique used by an effect.

+
+ +

Some video cards can render two textures in a single pass. However, if a card does not have this capability, it is often possible to render the same effect in two passes, using one texture for each pass.

+
+ + bb205468 + D3DXTECHNIQUE_DESC + D3DXTECHNIQUE_DESC +
+ + +

String that contains the technique name.

+
+ + bb205468 + const char* Name + char Name +
+ + +

Number of rendering passes the technique requires. See Remarks.

+
+ + bb205468 + unsigned int Passes + unsigned int Passes +
+ + +

The number of annotations. See Add Information to Effect Parameters with_Annotations.

+
+ + bb205468 + unsigned int Annotations + unsigned int Annotations +
+ + +

Describes an animation track and specifies blending weight, speed, and position for the track at a given time.

+
+ +

Tracks with the same priority are blended together, and the two resulting values are then blended using the priority blend factor. A track must have an animation set (stored separately) associated with it.

+
+ + bb205474 + D3DXTRACK_DESC + D3DXTRACK_DESC +
+ + +

Priority type, as defined in .

+
+ + bb205474 + D3DXPRIORITY_TYPE Priority + D3DXPRIORITY_TYPE Priority +
+ + +

Weight value. The weight determines the proportion of this track to blend with other tracks.

+
+ + bb205474 + float Weight + float Weight +
+ + +

Speed value. This is used similarly to a multiplier to scale the period of the track.

+
+ + bb205474 + float Speed + float Speed +
+ + +

Time position of the track, in the local timeframe of its current animation set.

+
+ + bb205474 + double Position + double Position +
+ + +

Track enable/disable. To enable, set to TRUE. To disable, set to .

+
+ + bb205474 + BOOL Enable + BOOL Enable +
+ + +

Describes a triangular high-order patch.

+
+ +

For example, the following diagram identifies the vertex order and segment numbers for a cubic B?zier triangle patch. The vertex order determines the segment numbers used by DrawTriPatch. The offset is the number of bytes to the first triangle patch vertex in the vertex buffer.

+
+ + bb172620 + D3DTRIPATCH_INFO + D3DTRIPATCH_INFO +
+ + +

Starting vertex offset, in number of vertices.

+
+ + bb172620 + unsigned int StartVertexOffset + unsigned int StartVertexOffset +
+ + +

Number of vertices.

+
+ + bb172620 + unsigned int NumVertices + unsigned int NumVertices +
+ + +

Member of the enumerated type, which defines the basis type for the triangular high-order patch. The only valid value for this member is .

+
+ + bb172620 + D3DBASISTYPE Basis + D3DBASISTYPE Basis +
+ + +

Member of the enumerated type, defining the degree type for the triangular high-order patch.

ValueNumber of vertices
10
3
N/A
21

?

N/A - Not available. Not supported.

+
+ + bb172620 + D3DDEGREETYPE Degree + D3DDEGREETYPE Degree +
+ + +

DirectX 8.1 and later versions only.

The structure describes vertex-cache information of a device.

+
+ +

DirectX 8.1 versions only. The Direct3D runtime calls a driver's D3dGetDriverState function to obtain vertex-cache information from the driver. In this D3dGetDriverState call, the runtime specifies the D3DDEVINFOID_VCACHE flag in the dwFlags member of the DD_GETDRIVERSTATEDATA structure that the runtime passes. The driver specifies vertex-cache information in a structure and returns it at the lpdwStates member of DD_GETDRIVERSTATEDATA.

DirectX 9.0 and later versions only. The Direct3D runtime specifies D3DDP2OP_CREATEQUERY and D3DDP2OP_ISSUEQUERY commands in calls to the driver's D3dDrawPrimitives2 callback to create driver-side resources for the query and then to asynchronously query the driver for vertex-cache information. In the call with the D3DDP2OP_CREATEQUERY command, the runtime specifies the query type in the QueryType member of the D3DHAL_DP2CREATEQUERY structure.

When the driver completes a vertex-cache query, the driver sets the total size of the response buffer in the dwErrorOffset member of the D3DHAL_DRAWPRIMITIVES2DATA structure and sets the ddrval member of D3DHAL_DRAWPRIMITIVES2DATA to for successful completion. The driver also overwrites the incoming command buffer with the outgoing response buffer. This response buffer contains a D3DHAL_DP2RESPONSEQUERY structure that identifies a response for the vertex-cache query. This D3DHAL_DP2RESPONSEQUERY is followed by the vertex-cache data in the structure.

+
+ + ff544702 + D3DDEVINFO_VCACHE + D3DDEVINFO_VCACHE +
+ + +

Specifies the bit pattern. The driver must specify the bit pattern as the CACH four-character code (FOURCC) value. The driver can use the MAKEFOURCC macro as follows to specify the FOURCC value as CACH:

MAKEFOURCC('C', 'A', 'C', 'H');
+
+ + ff544702 + unsigned int Pattern + unsigned int Pattern +
+ + +

Specifies the method of mesh optimization. The driver can use one of the following values to specify the mesh optimization that it uses:

ValueMeaning

(0)

Longest strips optimization

D3DXMESHOPT_VCACHE (1)

Vertex-cache based optimization

?

+
+ + ff544702 + unsigned int OptMethod + unsigned int OptMethod +
+ + +

Specifies the effective size, in entries, for which the driver optimizes the vertex cache. The actual cache size is not required to be the size specified in CacheSize because in most cases the actual cache size turns out to be larger. The driver only specifies an optimized size in CacheSize if it also specifies D3DXMESHOPT_VCACHE in the OptMethod member.

+
+ + ff544702 + unsigned int CacheSize + unsigned int CacheSize +
+ + +

Specifies the number that should be used as part of a trial-and-error procedure when determining when to restart the strips list. This number can be set from 1 to the value in the CacheSize member. Typically, the best values are near CacheSize/2.

+
+ + ff544702 + unsigned int MagicNumber + unsigned int MagicNumber +
+ + +

Describes a vertex buffer.

+
+ + bb172629 + D3DVERTEXBUFFER_DESC + D3DVERTEXBUFFER_DESC +
+ + +

Member of the enumerated type, describing the surface format of the vertex buffer data.

+
+ + bb172629 + D3DFORMAT Format + D3DFORMAT Format +
+ + +

Member of the enumerated type, identifying this resource as a vertex buffer.

+
+ + bb172629 + D3DRESOURCETYPE Type + D3DRESOURCETYPE Type +
+ + +

Combination of one or more flags.

+
+ + bb172629 + D3DUSAGE Usage + D3DUSAGE Usage +
+ + +

Member of the enumerated type, specifying the class of memory allocated for this vertex buffer.

+
+ + bb172629 + D3DPOOL Pool + D3DPOOL Pool +
+ + +

Size of the vertex buffer, in bytes.

+
+ + bb172629 + unsigned int Size + unsigned int Size +
+ + +

Combination of that describes the vertex format of the vertices in this buffer.

+
+ + bb172629 + D3DFVF FVF + D3DFVF FVF +
+ + +

Defines the vertex data layout. Each vertex can contain one or more data types, and each data type is described by a vertex element.

+
+ +

Vertex data is defined using an array of structures. Use D3DDECL_END to declare the last element in the declaration.

+
+ + bb172630 + D3DVERTEXELEMENT9 + D3DVERTEXELEMENT9 +
+ + +

Stream number.

+
+ + bb172630 + unsigned short Stream + unsigned short Stream +
+ + +

Offset from the beginning of the vertex data to the data associated with the particular data type.

+
+ + bb172630 + unsigned short Offset + unsigned short Offset +
+ + +

The data type, specified as a . One of several predefined types that define the data size. Some methods have an implied type.

+
+ + bb172630 + D3DDECLTYPE Type + D3DDECLTYPE Type +
+ + +

The method specifies the tessellator processing, which determines how the tessellator interprets (or operates on) the vertex data. For more information, see .

+
+ + bb172630 + D3DDECLMETHOD Method + D3DDECLMETHOD Method +
+ + +

Defines what the data will be used for; that is, the interoperability between vertex data layouts and vertex shaders. Each usage acts to bind a vertex declaration to a vertex shader. In some cases, they have a special interpretation. For example, an element that specifies or is used by the N-patch tessellator to set up tessellation. See for a list of the available semantics. can be used for user-defined fields (which don't have an existing usage defined).

+
+ + bb172630 + D3DDECLUSAGE Usage + D3DDECLUSAGE Usage +
+ + +

Modifies the usage data to allow the user to specify multiple usage types.

+
+ + bb172630 + unsigned char UsageIndex + unsigned char UsageIndex +
+ + + Used for closing a VertexElement declaration. + + + + + Initializes the struct. + + + + + Initializes a new instance of the struct. + + The stream. + The offset. + The type. + The method. + The usage. + Index of the usage. + + + +

Vertex shader caps.

+
+ + bb172635 + D3DVSHADERCAPS2_0 + D3DVSHADERCAPS2_0 +
+ + +

Instruction predication is supported if this value is nonzero. See setp_comp - vs.

+
+ + bb172635 + D3DVS20CAPS Caps + D3DVS20CAPS Caps +
+ + +

Either 0 or 24, which represents the depth of the dynamic flow control instruction nesting. See .

+
+ + bb172635 + int DynamicFlowControlDepth + int DynamicFlowControlDepth +
+ + +

The number of temporary registers supported. See .

+
+ + bb172635 + int NumTemps + int NumTemps +
+ + +

The depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - vs instructions. See .

+
+ + bb172635 + int StaticFlowControlDepth + int StaticFlowControlDepth +
+ + +

Reports the number of triangles that have been processed and clipped by the runtime's software vertex processing.

+
+ +

Use the debug runtime and software vertex processing to get the number of non-clipped and clipped primitives for a particular scene. Primitives will typically be clipped based on a guard band (if one is present). The clipping guard band is set with parameters such as GuardBandLeft in .

+
+ + bb172544 + D3DDEVINFO_D3DVERTEXSTATS + D3DDEVINFO_D3DVERTEXSTATS +
+ + +

Total number of triangles that are not clipped in this frame.

+
+ + bb172544 + unsigned int NumRenderedTriangles + unsigned int NumRenderedTriangles +
+ + +

Number of new triangles generated by clipping.

+
+ + bb172544 + unsigned int NumExtraClippingTriangles + unsigned int NumExtraClippingTriangles +
+ + +

Describes a volume.

+
+ + bb172633 + D3DVOLUME_DESC + D3DVOLUME_DESC +
+ + +

Member of the enumerated type, describing the surface format of the volume.

+
+ + bb172633 + D3DFORMAT Format + D3DFORMAT Format +
+ + +

Member of the enumerated type, identifying this resource as a volume.

+
+ + bb172633 + D3DRESOURCETYPE Type + D3DRESOURCETYPE Type +
+ + +

Currently not used. Always returned as 0.

+
+ + bb172633 + D3DUSAGE Usage + D3DUSAGE Usage +
+ + +

Member of the enumerated type, specifying the class of memory allocated for this volume.

+
+ + bb172633 + D3DPOOL Pool + D3DPOOL Pool +
+ + +

Width of the volume, in pixels.

+
+ + bb172633 + unsigned int Width + unsigned int Width +
+ + +

Height of the volume, in pixels.

+
+ + bb172633 + unsigned int Height + unsigned int Height +
+ + +

Depth of the volume, in pixels.

+
+ + bb172633 + unsigned int Depth + unsigned int Depth +
+ + +

Specifies tolerance values for each vertex component when comparing vertices to determine if they are similar enough to be welded together.

+
+ +

The LPD3DXWELDEPSILONS type is defined as a reference to the structure.

 typedef  *LPD3DXWELDEPSILONS;	
+            
+
+ + bb205560 + D3DXWELDEPSILONS + D3DXWELDEPSILONS +
+ + +

Position

+
+ + bb205560 + float Position + float Position +
+ + +

Blend weight

+
+ + bb205560 + float BlendWeights + float BlendWeights +
+ + +

Normal

+
+ + bb205560 + float Normal + float Normal +
+ + +

Point size value

+
+ + bb205560 + float PSize + float PSize +
+ + +

Specular lighting value

+
+ + bb205560 + float Specular + float Specular +
+ + +

Diffuse lighting value

+
+ + bb205560 + float Diffuse + float Diffuse +
+ + +

Eight texture coordinates

+
+ + bb205560 + float Texcoord[8] + float Texcoord +
+ + +

Tangent

+
+ + bb205560 + float Tangent + float Tangent +
+ + +

Binormal

+
+ + bb205560 + float Binormal + float Binormal +
+ + +

Tessellation factor

+
+ + bb205560 + float TessFactor + float TessFactor +
+ + +

Identifies compressed key frame animation data.

+
+ + bb174824 + XFILECOMPRESSEDANIMATIONSET + XFILECOMPRESSEDANIMATIONSET +
+ + +

Total size, in bytes, of the compressed data in the compressed key frame animation data buffer.

+
+ + bb174824 + unsigned int CompressedBlockSize + unsigned int CompressedBlockSize +
+ + +

Number of animation key frame ticks that occur per second.

+
+ + bb174824 + float TicksPerSec + float TicksPerSec +
+ + +

Type of the animation set playback loop. See .

+
+ + bb174824 + unsigned int PlaybackType + unsigned int PlaybackType +
+ + +

Minimum buffer size, in bytes, required to hold compressed key frame animation data. Value is equal to ( ( CompressedBlockSize + 3 ) / 4 ).

+
+ + bb174824 + unsigned int BufferLength + unsigned int BufferLength +
+ + + Shadow callback for . + + + + + Return a pointer to the unmanaged version of this callback. + + The callback. + A pointer to a shadow c++ callback + + + + Internal Include Callback + + + + + A user-implemented method for opening and reading the contents of a shader #include file. + + This pointer + A -typed value that indicates the location of the #include file. + Name of the #include file. + Pointer to the container that includes the #include file. + Pointer to the buffer that Open returns that contains the include directives. This pointer remains valid until is called. + Pointer to the number of bytes that Open returns in ppData. + The user-implemented method should return S_OK. If Open fails when reading the #include file, the application programming interface (API) that caused Open to be called fails. This failure can occur in one of the following situations:The high-level shader language (HLSL) shader fails one of the D3D10CompileShader*** functions.The effect fails one of the D3D10CreateEffect*** functions. + HRESULT Open([None] D3D_INCLUDE_TYPE IncludeType,[None] const char* pFileName,[None] LPCVOID pParentData,[None] LPCVOID* ppData,[None] UINT* pBytes) + + + + A user-implemented method for closing a shader #include file. + + + If was successful, Close is guaranteed to be called before the API using the interface returns. + + This pointer + Pointer to the buffer that contains the include directives. This is the pointer that was returned by the corresponding call. + The user-implemented Close method should return S_OK. If Close fails when it closes the #include file, the application programming interface (API) that caused Close to be called fails. This failure can occur in one of the following situations:The high-level shader language (HLSL) shader fails one of the D3D10CompileShader*** functions.The effect fails one of the D3D10CreateEffect*** functions. + HRESULT Close([None] LPCVOID pData) + + + + Internal class used to initialize this assembly. + + + + + Initializes this assembly. + + + This method is called when the assembly is loaded. + + + + + The namespace provides a managed Direct3D9 API. + + bb219837 + Direct3D9 + Direct3D9 + + + The PaletteEntry struct contains the color and usage of an entry in a logical palette. + PALETTEENTRY + + + + The red intensity value for the palette entry. + + + + + The green intensity value for the palette entry. + + + + + The blue intensity value for the palette entry. + + + + + Indicates how the palette entry is to be used. + TODO define an enum for flags + + + + + Represents the compiled bytecode of a shader or effect. + + Blob + + + + Initializes a new instance of the class. + + A containing the compiled bytecode. + + + + Initializes a new instance of the class. + + A containing the compiled bytecode. + + + + Initializes a new instance of the class. + + The buffer. + + + + Initializes a new instance of the class. + + a pointer to a compiler bytecode + size of the bytecode + + + + Initializes a new instance of the class. + + The BLOB. + + + + Gets the buffer pointer. + + + + + Gets or sets the size of the buffer. + + + The size of the buffer. + + + + + Gets the shader constant table. + + HRESULT D3DXGetShaderConstantTable([In] const void* pFunction,[In] ID3DXConstantTable** ppConstantTable) + + + + Gets the version of the shader. + + unsigned int D3DXGetShaderVersion([In] const void* pFunction) + + + + Gets the size of the shader from a function pointer. + + The shader function pointer. + Size of the shader + + + + Assembles a shader from the given source data. + + The source shader data. + Compilation options. + A object representing the raw shader stream. + HRESULT D3DXAssembleShader([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs) + + + + Assembles a shader from the given source data. + + The source shader data. + Compilation options. + A object representing the raw shader stream. + HRESULT D3DXAssembleShader([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs) + + + + Assembles a shader from the given source data. + + The source shader data. + Macro definitions. + An interface to use for handling #include directives. + Compilation options. + A object representing the raw shader stream. + HRESULT D3DXAssembleShader([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs) + + + + Assembles a shader from the given source data. + + The source shader data. + Macro definitions. + An interface to use for handling #include directives. + Compilation options. + A object representing the raw shader stream. + HRESULT D3DXAssembleShader([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs) + + + + Assembles a shader from file. + + Name of the shader file. + Compilation options. + A object representing the raw shader stream. + + + + Assembles a shader from file. + + Name of the shader file. + Macro definitions. + An interface to use for handling #include directives. + Compilation options. + + A object representing the raw shader stream. + + + + + Compiles the provided shader or effect source. + + A string containing the source of the shader or effect to compile. + The shader target or set of shader features to compile against. + Shader compilation options. + + The compiled shader bytecode, or null if the method fails. + + HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) + + + + Compiles the provided shader or effect source. + + An array of bytes containing the raw source of the shader or effect to compile. + The shader target or set of shader features to compile against. + Shader compilation options. + + The compiled shader bytecode, or null if the method fails. + + HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) + + + + Compiles the provided shader or effect source. + + A string containing the source of the shader or effect to compile. + The name of the shader entry-point function, or null for an effect file. + The shader target or set of shader features to compile against. + Shader compilation options. + + The compiled shader bytecode, or null if the method fails. + + HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) + + + + Compiles the provided shader or effect source. + + An array of bytes containing the raw source of the shader or effect to compile. + The name of the shader entry-point function, or null for an effect file. + The shader target or set of shader features to compile against. + Shader compilation options. + + The compiled shader bytecode, or null if the method fails. + + HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) + + + + Compiles the provided shader or effect source. + + A string containing the source of the shader or effect to compile. + The shader target or set of shader features to compile against. + Shader compilation options. + A set of macros to define during compilation. + An interface for handling include files. + + The compiled shader bytecode, or null if the method fails. + + HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) + + + + Compiles the provided shader or effect source. + + An array of bytes containing the raw source of the shader or effect to compile. + The shader target or set of shader features to compile against. + Shader compilation options. + A set of macros to define during compilation. + An interface for handling include files. + + The compiled shader bytecode, or null if the method fails. + + HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) + + + + Compiles the provided shader or effect source. + + A string containing the source of the shader or effect to compile. + The name of the shader entry-point function, or null for an effect file. + The shader target or set of shader features to compile against. + Shader compilation options. + A set of macros to define during compilation. + An interface for handling include files. + + The compiled shader bytecode, or null if the method fails. + + HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) + + + + Compiles a shader or effect from a file on disk. + + The name of the source file to compile. + The shader target or set of shader features to compile against. + Shader compilation options. + A set of macros to define during compilation. + An interface for handling include files. + + The compiled shader bytecode, or null if the method fails. + + HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) + + + + Compiles a shader or effect from a file on disk. + + The name of the source file to compile. + The name of the shader entry-point function, or null for an effect file. + The shader target or set of shader features to compile against. + Shader compilation options. + A set of macros to define during compilation. + An interface for handling include files. + + The compiled shader bytecode, or null if the method fails. + + HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) + + + + Compiles the provided shader or effect source. + + An array of bytes containing the raw source of the shader or effect to compile. + The name of the shader entry-point function, or null for an effect file. + The shader target or set of shader features to compile against. + Shader compilation options. + A set of macros to define during compilation. + An interface for handling include files. + + The compiled shader bytecode, or null if the method fails. + + HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) + + + + Disassembles compiled HLSL code back into textual source. + + The textual source of the shader or effect. + HRESULT D3DXDisassembleShader([In] const void* pShader,[In] BOOL EnableColorCode,[In] const char* pComments,[In] ID3DXBuffer** ppDisassembly) + + + + Disassembles compiled HLSL code back into textual source. + + if set to true [enable color code]. + + The textual source of the shader or effect. + + HRESULT D3DXDisassembleShader([In] const void* pShader,[In] BOOL EnableColorCode,[In] const char* pComments,[In] ID3DXBuffer** ppDisassembly) + + + + Disassembles compiled HLSL code back into textual source. + + if set to true [enable color code]. + Commenting information to embed in the disassembly. + + The textual source of the shader or effect. + + HRESULT D3DXDisassembleShader([In] const void* pShader,[In] BOOL EnableColorCode,[In] const char* pComments,[In] ID3DXBuffer** ppDisassembly) + + + + Searches through the shader for the specified comment. + + A FOURCC code used to identify the comment. + The comment data. + HRESULT D3DXFindShaderComment([In] const void* pFunction,[In] unsigned int FourCC,[Out] const void** ppData,[Out] unsigned int* pSizeInBytes) + + + + Gets the set of semantics for shader inputs. + + The set of semantics for shader inputs. + HRESULT D3DXGetShaderInputSemantics([In] const void* pFunction,[In, Out, Buffer] D3DXSEMANTIC* pSemantics,[InOut] unsigned int* pCount) + + + + Gets the set of semantics for shader outputs. + + The set of semantics for shader outputs. + HRESULT D3DXGetShaderOutputSemantics([In] const void* pFunction,[In, Out, Buffer] D3DXSEMANTIC* pSemantics,[InOut] unsigned int* pCount) + + + + Gets the sampler names references in the shader. + + The set of referenced sampler names. + HRESULT D3DXGetShaderSamplers([In] const void* pFunction,[In] const char** pSamplers,[In] unsigned int* pCount) + + + + Extracts the major version component of a shader version number. + + The shader version number. + The major version component. + + + + Extracts the minor version component of a shader version number. + + The shader version number. + The minor version component. + + + + Converts a shader version number into a managed object. + + The shader version number. + The parsed shader version information. + + + + Loads from the specified stream. + + The stream. + A shader bytecode + + + + Saves to the specified file name. + + Name of the file. + + + + Saves this bytecode to the specified stream. + + The stream. + + + + Create a ShaderBytecode from a pointer. + + The pointer. + + + + + Preprocesses the provided shader or effect source. + + A string containing the source of the shader or effect to preprocess. + A set of macros to define during preprocessing. + An interface for handling include files. + The preprocessed shader source. + HRESULT D3DXPreprocessShader([In] const void* pSrcData,[In] unsigned int SrcDataSize,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) + + + + Preprocesses the provided shader or effect source. + + An array of bytes containing the raw source of the shader or effect to preprocess. + A set of macros to define during preprocessing. + An interface for handling include files. + The preprocessed shader source. + HRESULT D3DXPreprocessShader([In] const void* pSrcData,[In] unsigned int SrcDataSize,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) + + + + Preprocesses the provided shader or effect source. + + An array of bytes containing the raw source of the shader or effect to preprocess. + A set of macros to define during preprocessing. + An interface for handling include files. + When the method completes, contains a string of compilation errors, or an empty string if preprocessing succeeded. + The preprocessed shader source. + HRESULT D3DXPreprocessShader([In] const void* pSrcData,[In] unsigned int SrcDataSize,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) + + + + Preprocesses the provided shader or effect source. + + The shader source PTR. + Length of the shader source. + A set of macros to define during preprocessing. + An interface for handling include files. + When the method completes, contains a string of compilation errors, or an empty string if preprocessing succeeded. + + The preprocessed shader source. + + HRESULT D3DXPreprocessShader([In] const void* pSrcData,[In] unsigned int SrcDataSize,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) + + + + Preprocesses the provided shader or effect source. + + A string containing the source of the shader or effect to preprocess. + A set of macros to define during preprocessing. + An interface for handling include files. + When the method completes, contains a string of compilation errors, or an empty string if preprocessing succeeded. + The preprocessed shader source. + HRESULT D3DXPreprocessShader([In] const void* pSrcData,[In] unsigned int SrcDataSize,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) + + + + Preprocesses a shader or effect from a file on disk. + + The name of the source file to compile. + The preprocessed shader source. + HRESULT D3DXPreprocessShader([In] const void* pSrcData,[In] unsigned int SrcDataSize,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) + + + + Preprocesses a shader or effect from a file on disk. + + The name of the source file to compile. + A set of macros to define during preprocessing. + An interface for handling include files. + The preprocessed shader source. + HRESULT D3DXPreprocessShader([In] const void* pSrcData,[In] unsigned int SrcDataSize,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) + + + + Preprocesses a shader or effect from a file on disk. + + The name of the source file to compile. + A set of macros to define during preprocessing. + An interface for handling include files. + When the method completes, contains a string of compilation errors, or an empty string if preprocessing succeeded. + The preprocessed shader source. + HRESULT D3DXPreprocessShader([In] const void* pSrcData,[In] unsigned int SrcDataSize,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) + + + + Gets the raw data of the compiled bytecode. + + + + + Read a compiled shader bytecode from a Stream and return a ShaderBytecode + + + + + + + Read a compiled shader bytecode from a Stream and return a ShaderBytecode + + + + + + + Width of the texture. + + + + + Height of the texture. + + + + + Format of the texture. + + + + + Mip level count of the texture. + + + + + Helper methods to create special . + + + + + Calculates a specific TEXCOORDSIZEN . + + The size of the texcoord. The value must be in the range [1,4] (Number of floating point values) + Index of the coord. + The + If size is not in the range [1,4] + + + + + + Contains requested texture creation parameters for volume textures. + + None + + + + The requested width of the texture, in pixels. + + + + + The requested height of the texture, in pixels. + + + + + The requested depth of the texture, in pixels. + + + + + The requested surface format. + + + + + The requested mip level count. + + + + + Internal class to interact with Native Message + + +
+
diff --git a/Test/dll/SharpDX.DirectInput.dll b/Test/dll/SharpDX.DirectInput.dll new file mode 100644 index 00000000..458a2243 Binary files /dev/null and b/Test/dll/SharpDX.DirectInput.dll differ diff --git a/Test/dll/SharpDX.DirectInput.xml b/Test/dll/SharpDX.DirectInput.xml new file mode 100644 index 00000000..b720a239 --- /dev/null +++ b/Test/dll/SharpDX.DirectInput.xml @@ -0,0 +1,11661 @@ + + + + SharpDX.DirectInput + + + + + The assembly provides managed DirectInput API. + + ee416842 + DirectInput + DirectInput + + + + Describes a DirectInput device's capabilities. This structure is used with theIDirectInputDevice8::GetCapabilitiesmethod. + + +

The semantics of version numbers are left to the manufacturer of the device. The only guarantee is that newer versions have larger numbers.

+
+ + microsoft.directx_sdk.reference.didevcaps + DIDEVCAPS + DIDEVCAPS +
+ + + Initializes a new instance of the class. + + + + + Gets the type of this device. + + The type. + + + + Gets the subtype of the device. + + The subtype. + + + + Gets a value indicating whether this instance is human interface device. + + + true if this instance is human interface device; otherwise, false. + + + + + No documentation. + + + microsoft.directx_sdk.reference.didevcaps + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + microsoft.directx_sdk.reference.didevcaps + DIDC dwFlags + DIDC dwFlags + + + + No documentation. + + + microsoft.directx_sdk.reference.didevcaps + unsigned int dwDevType + unsigned int dwDevType + + + + No documentation. + + + microsoft.directx_sdk.reference.didevcaps + unsigned int dwAxes + unsigned int dwAxes + + + + No documentation. + + + microsoft.directx_sdk.reference.didevcaps + unsigned int dwButtons + unsigned int dwButtons + + + + No documentation. + + + microsoft.directx_sdk.reference.didevcaps + unsigned int dwPOVs + unsigned int dwPOVs + + + + No documentation. + + + microsoft.directx_sdk.reference.didevcaps + unsigned int dwFFSamplePeriod + unsigned int dwFFSamplePeriod + + + + No documentation. + + + microsoft.directx_sdk.reference.didevcaps + unsigned int dwFFMinTimeResolution + unsigned int dwFFMinTimeResolution + + + + No documentation. + + + microsoft.directx_sdk.reference.didevcaps + unsigned int dwFirmwareRevision + unsigned int dwFirmwareRevision + + + + No documentation. + + + microsoft.directx_sdk.reference.didevcaps + unsigned int dwHardwareRevision + unsigned int dwHardwareRevision + + + + No documentation. + + + microsoft.directx_sdk.reference.didevcaps + unsigned int dwFFDriverVersion + unsigned int dwFFDriverVersion + + + + This class describes a set of effect. + It is passed in the of the structure. + + + + + Marshal this class from an unmanaged buffer. + + The size of the unmanaged buffer. + The pointer to the unmanaged buffer. + An instance of TypeSpecificParameters or null + + + + Marshals this class to its native/unmanaged counterpart. + + A pointer to an allocated buffer containing the unmanaged structure. + + + + Gets or sets the conditions. + + The conditions. + + + + Gets the size of this specific parameter. + + The size. + + + + This class describes a Constant force effect. + It is passed in the of the structure. + + + + + Gets or sets the magnitude. + The magnitude of the effect, in the range from - 10,000 through 10,000. If an envelope is applied to this effect, the value represents the magnitude of the sustain. If no envelope is applied, the value represents the amplitude of the entire effect. + + The magnitude. + + + + Marshal this class from an unmanaged buffer. + + The size of the unmanaged buffer. + The pointer to the unmanaged buffer. + An instance of TypeSpecificParameters or null + + + + Marshals this class to its native/unmanaged counterpart. + + A pointer to an allocated buffer containing the unmanaged structure. + + + + Gets the size of this specific parameter. + + The size. + + + + Retrieves buffered data from the device. + + A collection of buffered input events. + + + + Dumps the DataFormat in native form in order to verify it against the unmanaged version. + + The format. + + + + This class describes a Custom force effect. + It is passed in the of the structure. + + + + + Gets or sets the number of channels (axes) affected by this force. + The first channel is applied to the first axis associated with the effect, the second to the second, and so on. If there are fewer channels than axes, nothing is associated with the extra axes. + If there is only a single channel, the effect is rotated in the direction specified by the of the structure. If there is more than one channel, rotation is not allowed. + Not all devices support rotation of custom effects. + + The channel count. + + + + Gets or sets the sample period, in microseconds. + + The sample period. + + + + Gets or sets the total number of samples in the . It must be an integral multiple of the . + + The sample count. + + + + Gets or sets an array of force values representing the custom force. If multiple channels are provided, the values are interleaved. For example, if is 3, the first element of the array belongs to the first channel, the second to the second, and the third to the third. + + The force data. + + + + Marshal this class from an unmanaged buffer. + + The size of the unmanaged buffer. + The pointer to the unmanaged buffer. + An instance of TypeSpecificParameters or null + + + + Marshals this class to its native/unmanaged counterpart. + + A pointer to an allocated buffer containing the unmanaged structure. + + + + Free a previously allocated buffer. + + The buffer pointer. + + + + Gets the size of this specific parameter. + + The size. + + + + Describes a device's data format. This structure is used with theIDirectInputDevice8::SetDataFormatmethod. + + +

Applications do not typically need to create a structure. An application can use one of the predefined global data format variables, c_dfDIMouse, c_dfDIMouse2, c_dfDIKeyboard, c_dfDIJoystick, or c_dfDIJoystick2.

Applications that need to create a structure must first call to determine the available objects for the current device. This is because the method will return if an object is described in the structure but does not exist on the current device.

The following code example sets a data format for a device that has an X-axis and a Y-axis:

 // Suppose an application uses the following 	
+            // structure to read device data.  typedef struct MYDATA {  LONG  lX;                   // X-axis goes here.  LONG  lY;                   // Y-axis goes here.  BYTE  bButtonA;             // One button goes here.  BYTE  bButtonB;             // Another button goes here.  BYTE  bPadding[2];          // Must be DWORD multiple in size. 	
+            } MYDATA;  // Then, it can use the following data format.  DIOBJECTDATAFORMAT rgodf[ ] = {  { &, FIELD_OFFSET(MYDATA, lX),  | , 0, },  { &, FIELD_OFFSET(MYDATA, lY),   | , 0, },  { &, FIELD_OFFSET(MYDATA, bButtonA),  | , 0, },  { &, FIELD_OFFSET(MYDATA, bButtonB),   | , 0, }, 	
+            }; 	
+            #define numObjects (sizeof(rgodf) / sizeof(rgodf[0]))   df = {  sizeof(),       // Size of this structure  sizeof(DIOBJECTDATAFORMAT), // Size of object data format  ,               // Absolute axis coordinates  sizeof(MYDATA),             // Size of device data  numObjects,                 // Number of objects  rgodf,                      // And here they are 	
+            }; 
+
+ + microsoft.directx_sdk.reference.didataformat + DIDATAFORMAT + DIDATAFORMAT +
+ + + No documentation. + + + microsoft.directx_sdk.reference.didataformat + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + microsoft.directx_sdk.reference.didataformat + unsigned int dwObjSize + unsigned int dwObjSize + + + +Flags describing other attributes of the data format. + + microsoft.directx_sdk.reference.didataformat + DIDF dwFlags + DIDF dwFlags + + + + No documentation. + + + microsoft.directx_sdk.reference.didataformat + unsigned int dwDataSize + unsigned int dwDataSize + + + + No documentation. + + + microsoft.directx_sdk.reference.didataformat + unsigned int dwNumObjs + unsigned int dwNumObjs + + + + No documentation. + + + microsoft.directx_sdk.reference.didataformat + void* rgodf + void rgodf + + + + Attributes that describes a device data format specification. + + + + + Gets or sets the data format flags. + + The flags. + + + + Name of this DataObjectFormat. Default is using field name. + + + + + Gets or sets Guid for the axis, button, or other input source. When requesting a data format, making this member empty indicates that any type of object is permissible. + + The GUID. + + + + Gets or sets the field offset. This is used internally. + + The offset. + + + + Gets or sets the device type that describes the object. + + The type. + + + + Gets or sets the instance number. Setting -1 is applied to any object instance. + + The instance number. + + + + Gets or sets the extra flags used to describe the data format. + + The flags. + + + + Attribute to describe a custom format for a field. + + + + + Gets or sets the name of the field. Default is using the field name. + + + + + Gets or sets Guid for the axis, button, or other input source. When requesting a data format, making this member empty indicates that any type of object is permissible. + + The GUID. + + + + Gets or sets the array count. + + The array count. + + + + Gets or sets the device type that describes the object. + + The type. + + + + Gets or sets the extra flags used to describe the data format. + + The flags. + + + + Gets or sets the instance number. + + The instance number. + + + +

Applications use the methods of the interface to gain and release access to Microsoft DirectInput devices, manage device properties and information, set behavior, perform initialization, create and play force-feedback effects, and invoke a device's control panel.

IDirectInputDevice8 Members
Method + Description +
Obtains access to the input device. +
Builds an action map for the device and retrieves information about it. +
Creates and initializes an instance of an effect identified by the effect globally unique identifier (). +
Enumerates all the currently created effects for this device. +
Enumerates all the effects supported by the force-feedback system on the device. +
Enumerates all the effects in a file created by the Force Editor utility or another application using the same file format. +
Enumerates the input and output objects available on a device. +
Sends a hardware-specific command to the force-feedback driver. +
Obtains the capabilities of the DirectInputDevice object. +
Retrieves buffered data from the device. +
Obtains information about the device's identity. +
Retrieves immediate data from the device. +
Obtains information about an effect. +
Retrieves the state of the device's force-feedback system. +
Retrieves information about a device image for use in a configuration property sheet. +
Retrieves information about a device object, such as a button or axis. +
Retrieves information about the input device. +
Initializes a DirectInputDevice object. +
Retrieves data from polled objects on a DirectInput device. +
Runs the DirectInput control panel associated with this device. +
Sends data to a device that accepts output. +
Sends a command to the device's force-feedback system. +
Sets the data format for a device and maps application-defined actions to device objects. +
Establishes the cooperative level for this instance of the device. +
Sets the data format for the DirectInput device. +
Specifies an event that is to be set when the device state changes. +
Sets properties that define the device behavior. +
Releases access to the device. +
Saves information about one or more force-feedback effects to a file that can be read by using EnumEffectsInFile. +
+
+ +

The interface is obtained by using the method. For an example, see Creating a DirectInput Device.

supersedes the IDirectInputDevice, IDirectInputDevice2, and IDirectInputDevice7 interfaces used in previous versions of Microsoft DirectX, but does not inherit from them. Methods that share names with those from older interfaces perform similar services, but may not have exactly the same functionality or behavior. You cannot obtain the earlier interfaces by using QueryInterface.

The LPDIRECTINPUTDEVICE8 type is defined as a reference to the interface:

 typedef struct     *LPDIRECTINPUTDEVICE8;	
+            
+
+ + ee417816 + IDirectInputDevice8W + IDirectInputDevice8W +
+ + + Initializes a new instance of the class based on a given globally unique identifier (Guid). + + The direct input. + The device GUID. + + + + Gets the device properties. + + The device properties. + + + + Sends a hardware-specific command to the force-feedback driver. + + Driver-specific command number. Consult the driver documentation for a list of valid commands. + Buffer containing the data required to perform the operation. + Buffer in which the operation's output data is returned. + Number of bytes written to the output buffer + + Because each driver implements different escapes, it is the application's responsibility to ensure that it is sending the escape to the correct driver by comparing the value of the guidFFDriver member of the structure against the value the application is expecting. + + + + + Gets information about a device image for use in a configuration property sheet. + + A structure that receives information about the device image. + + + + Gets all effects. + + A collection of + + + + Gets the effects for a particular . + + Effect type. + A collection of + + + + Gets the effects stored in a RIFF Force Feedback file. + + Name of the file. + A collection of + + + + Gets the effects stored in a RIFF Force Feedback file. + + Name of the file. + Flags used to filter effects. + A collection of + + + + Gets information about a device object, such as a button or axis. + + The object type/instance identifier. This identifier is returned in the member of the structure returned from a previous call to the method. + A information + + + + Gets information about a device object, such as a button or axis. + + the HID Usage Page and Usage values. + A information + + + + Gets the properties about a device object, such as a button or axis. + + The object type/instance identifier. This identifier is returned in the member of the structure returned from a previous call to the method. + an ObjectProperties + + + + Gets the properties about a device object, such as a button or axis. + + the HID Usage Page and Usage values. + an ObjectProperties + + + + Retrieves a collection of objects on the device. + + A collection of all device objects on the device. + + + + Retrieves a collection of objects on the device. + + A filter for the returned device objects collection. + A collection of device objects matching the specified filter. + + + + Runs the DirectInput control panel associated with this device. If the device does not have a control panel associated with it, the default device control panel is launched. + + A object describing the result of the operation. + + + + Runs the DirectInput control panel associated with this device. If the device does not have a control panel associated with it, the default device control panel is launched. + + The parent control. + A object describing the result of the operation. + + + + Specifies an event that is to be set when the device state changes. It is also used to turn off event notification. + + Handle to the event that is to be set when the device state changes. DirectInput uses the Microsoft Win32 SetEvent function on the handle when the state of the device changes. If the eventHandle parameter is null, notification is disabled. + A object describing the result of the operation. + + + + Writes the effects to a file. + + Name of the file. + The effects. + A object describing the result of the operation. + + + + Writes the effects to file. + + Name of the file. + The effects. + if set to true [include nonstandard effects]. + A object describing the result of the operation. + + + + Gets the created effects. + + The created effects. + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + Obtains the capabilities of the DirectInputDevice object. + + +

For compatibility with DirectX 3, it is also valid to pass a DIDEVCAPS_DX3 structure with the dwSize member initialized to sizeof(DIDEVCAPS_DX3).

The number of objects returned in the structure is the maximum number of objects that could be enumerated. However, all of these objects are not necessarily returned during a call to .

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getcapabilities + GetCapabilities + GetCapabilities + HRESULT IDirectInputDevice8W::GetCapabilities([Out] DIDEVCAPS* arg0) +
+ + + Obtains information about the device's identity. + + +

For compatibility with DirectX 3, it is also valid to pass a DIDEVICEINSTANCE_DX3 structure with the dwSize member initialized to sizeof(DIDEVICEINSTANCE_DX3).

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getdeviceinfo + GetDeviceInfo + GetDeviceInfo + HRESULT IDirectInputDevice8W::GetDeviceInfo([Out] DIDEVICEINSTANCEW* arg0) +
+ + + Obtains the capabilities of the DirectInputDevice object. + +
Address of a structure to be filled with the device capabilities. The dwSize member of this structure must be initialized before calling this method.
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following error values: , , E_POINTER.

+ +

For compatibility with DirectX 3, it is also valid to pass a DIDEVCAPS_DX3 structure with the dwSize member initialized to sizeof(DIDEVCAPS_DX3).

The number of objects returned in the structure is the maximum number of objects that could be enumerated. However, all of these objects are not necessarily returned during a call to .

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getcapabilities + HRESULT IDirectInputDevice8W::GetCapabilities([Out] DIDEVCAPS* arg0) + IDirectInputDevice8W::GetCapabilities +
+ + + Enumerates the input and output objects available on a device. + +
Address of a callback function that receives DirectInputDevice objects. DirectInput provides a prototype of this function as DIEnumDeviceObjectsCallback.
+
Reference data (context) for callback.
+
Flags that specify the types of object to be enumerated. Each of the following values restricts the enumeration to objects of the described type:
An absolute axis.
Controls identified by a Human Interface Device (HID) usage alias. This flag applies only to HID-compliant USB devices.
All objects.
An axis, either absolute or relative.
A push button or a toggle button.
A HID link collection. HID link collections do not generate data of their own.
DIDFT_ENUMCOLLECTION(n)
An object that belongs to HID link collection number n.
An object that contains a force-feedback actuator. In other words, forces can be applied to this object.
An object that can be used to trigger force-feedback effects.
DIDFT_NOCOLLECTION
An object that does not belong to any HID link collection; in other words, an object for which the wCollectionNumber member of the structure is 0.
An object that does not generate data.
An object that supports output. For details, see Remarks in .
A point-of-view controller.
A push button. A push button is reported as down when the user presses it, and as up when the user releases it.
A relative axis.
A toggle button. A toggle button is reported as down when the user presses it and remains so until the user presses the button a second time.
An object of a type defined by the manufacturer.
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following error values:.

+ +

The and flags in the dwFlags parameter restrict enumeration to objects that meet all the criteria defined by the included flags. For all the other flags, an object is enumerated if it meets the criterion defined by any included flag in this category. For example, ( | ) restricts enumeration to force-feedback trigger objects, and ( | | ) restricts enumeration to buttons of any kind that can be used as effect triggers.

Applications should not rely on this method to determine whether certain keyboard keys or indicator lights are present, as these objects might be enumerated even though they are not present. Although the basic set of available objects can be determined from the device subtype, there is no reliable way of determining whether extra objects such as the menu key are available.

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.enumobjects + HRESULT IDirectInputDevice8W::EnumObjects([In] __function__stdcall* arg0,[In] void* arg1,[In] unsigned int arg2) + IDirectInputDevice8W::EnumObjects +
+ + + Retrieves information about the input device. + +
Reference to (C++) or address of (C) the globally unique identifier () identifying the property to be retrieved. This can be one of the predefined values or a reference to a that identifies the property. The following properties are predefined for an input device.
Retrieves the application-defined value associated with an in-game action, as a .
Determines whether device objects are self centering. The value returned can be DIPROPAUTOCENTER_OFF or DIPROPAUTOCENTER_ON. See for more information.
Retrieves the axis mode. The retrieved value can be or .
Retrieves the input buffer size. The buffer size determines the amount of data that the buffer can hold between calls to the method before data is lost. You can set this value to 0 to indicate that the application does not read buffered data from the device. If the buffer size in the dwData member of the structure is too large for the device to support it, then the largest possible buffer size is set. However, this property always returns the buffer size set using the method, even if the buffer cannot be supported because it is too large.

Predefined property that allows the application to access the information that DirectInput uses to manipulate axes that require calibration. This property exists primarily for applications of the control panel type. Normal applications should not need to deal with calibration information.

You can access the calibration mode property for a particular axis by setting the dwHow member of the structure to or to and setting the dwObj member to the object ID or offset, respectively.

Control panel applications that set new calibration data must also invoke the IDirectInputJoyConfig::SendNotify method to notify other applications of the change in calibration. For more information about IDirectInputJoyConfig::SendNotify, see the DirectInput Driver Development Kit (DDK).

For use by device drivers; not used by applications.
This property is unsupported. Retrieves calibration points used for the adjustment of incoming raw data as a DIPROPCPOINTS structure.
Retrieves a value for the dead zone of a joystick, in the range from 0 through 10,000, where 0 indicates that there is no dead zone, 5,000 indicates that the dead zone extends over 50 percent of the physical range of the axis on both sides of center, and 10,000 indicates that the entire physical range of the axis is dead. When the axis is within the dead zone, it is reported as being at the center of its range.
Retrieves the gain of the device. This property always returns even if the device does not support force feedback. See for more information.
Retrieves the memory load for the device. This setting applies to the entire device, rather than to any particular object, so the dwHow member of the associated structure must be . The retrieved value is in the range from 0 through 100, indicating the percentage of device memory in use. The device must be acquired in exclusive mode. If it is not, the method will fail with a return value of .
Retrieves the human-readable display name of the port to which this device is connected. Not generally used by applications.
Retrieves the input granularity. Granularity represents the smallest distance over which the object reports movement. Most axis objects have a granularity of one; that is, all values are possible. Some axes have a larger granularity. For example, the wheel axis on a mouse can have a granularity of 20; that is, all reported changes in position are multiples of 20. In other words, when the user turns the wheel slowly, the device reports a position of 0, then 20, then 40, and so on. This is a read-only property.
Retrieves the class and device interface (path) for the device. This property lets advanced applications perform operations on a human interface device that are not supported by DirectInput. For more information, see the structure.
Retrieves the friendly instance name of the device. For more information, see .
Retrieves the instance number of a joystick. This property is not implemented for the mouse or keyboard.
Retrieves the localized key name for a keyboard key, as a . Using this property on devices other than a keyboard will return unexpected names.
Retrieves the range of the raw data returned for axes on a human interface device. Devices can return negative values.
Retrieves the range of data for axes as suggested by the manufacturer of a human interface device. Values can be negative. Normally DirectInput returns values from 0 through 0xFFFF, but the range can be made to conform to the manufacturer's suggested range by using .
Retrieves the friendly product name of the device. For more information, see .
Retrieves the range of values an object can possibly report. For some devices, this is a read-only property.
Retrieves a value for the saturation zones of a joystick, in the range from 0 through 10,000. The saturation level is the point at which the axis is considered to be at its most extreme position. For example, if the saturation level is set to 9,500, the axis reaches the extreme of its range when it has moved 95 percent of the physical distance from its center position (or from the dead zone).
Retrieves the scan code for a keyboard key, as a . If successful, is returned. E_FAIL is returned if the property cannot resolve specialized keys on USB keyboards because they do not exist in scan code form. For all other failures, E_INVALIDARG is returned.
Predefined property that retrieves the type name of a device. For most game controllers, this is the registry key name under REGSTR_PATH_JOYOEM from which static device settings can be retrieved, but predefined joystick types have special names consisting of a number sign (&Sharp;) followed by a character dependent on the type. This value might not be available for all devices.
Retrieves the user name for a user currently assigned to a device, as a . User names are set by calling . If no user name is set, the method returns S_FALSE.
Read-only device property that retrieves the vendor identity (ID) and product ID of a HID device. This property is of type and contains both values. These two WORD values are combined in the dwData member of the structure. See Examples. This property applies to the entire device, rather than to any particular object, so the dwHow member of the structure must be set to .
+
Address of the portion of a larger property-dependent structure that contains the structure as a member. The following structures are used for properties:
  • is used for properties represented by a single numerical value.

  • is used for .

  • is used for properties represented by a pair of numerical values. Currently, the only such property is .

  • is used for string properties.

+ No documentation. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getproperty + HRESULT IDirectInputDevice8W::GetProperty([In] const void& arg0,[In] void* arg1) + IDirectInputDevice8W::GetProperty +
+ + + Sets properties that define the device behavior. These properties include input buffer size and axis mode. + +
Reference to (C++) or address of (C) the globally unique identifier () identifying the property to be set. This can be one of the predefined values, or a reference to a that identifies the property. The following property values are predefined for an input device:
Sets the application-defined value associated with an in-game action, as a .

Specifies whether device objects are self centering. This setting applies to the entire device, rather than to any particular object, so the dwHow member of the associated structure must be .

The dwData member can be one of the following values.

DIPROPAUTOCENTER_OFF: The device should not automatically center when the user releases the device. An application that uses force feedback should disable autocentering before playing effects.

DIPROPAUTOCENTER_ON: The device should automatically center when the user releases the device.

Not all devices support the autocenter property.

Sets the axis mode. The value being set ( or ) must be specified in the dwData member of the associated structure. See the description of the pdiph parameter for more information. This setting applies to the entire device, so the dwHow member of the associated structure must be set to .
Sets the input buffer size. The value being set must be specified in the dwData member of the associated structure. See Remarks. This setting applies to the entire device, so the dwHow member of the associated structure must be set to .

Predefined property that allows the application to access the information that DirectInput uses to manipulate axes that require calibration. This property exists primarily for applications of the control panel type. Normal applications should not need to deal with calibration information.

You can access the calibration mode property for an axis by setting the dwHow member of the structure to or to and setting the dwObj member to the object ID or offset, respectively.

Control panel applications that set new calibration data must also invoke the IDirectInputJoyConfig::SendNotify method to notify other applications of the change in calibration. For more information about IDirectInputJoyConfig::SendNotify, see the DirectX Driver Development Kit (DDK).

Enables the application to specify whether DirectInput should retrieve calibrated or uncalibrated data from an axis. By default, DirectInput retrieves calibrated data.

Setting the calibration mode for the entire device is equivalent to setting it for each axis individually.

The dwData member of the structure can be one of the following values:

DIPROPCALIBRATIONMODE_COOKED: DirectInput should return data after applying calibration information. This is the default mode.

DIPROPCALIBRATIONMODE_RAW: DirectInput should return raw, uncalibrated data. This mode is typically used only by applications of the control panel type. Note that raw data might include negative values.

Setting a device into raw mode causes the dead zone, saturation, and range settings to be ignored.

This property is unsupported. Sets calibration points used for the adjustment of incoming raw data. The values being set must be specified as CPOINT types in the cp array of the associated DIPROPCPOINTS structure. This setting applies to individual device objects, so the dwHow member of the associated structure must be set to either or .
Sets the value for the dead zone of a joystick, in the range from 0 through 10,000, where 0 indicates that there is no dead zone, 5,000 indicates that the dead zone extends over 50 percent of the physical range of the axis on both sides of center, and 10,000 indicates that the entire physical range of the axis is dead. When the axis is within the dead zone, it is reported as being at the center of its range. This setting can be applied to either the entire device or to a specific axis.
Sets the gain for the device. This setting applies to the entire device, rather than to any particular object, so the dwHow member of the associated structure must be .

The dwData member contains a gain value that is applied to all effects created on the device. The value is an integer in the range from 0 through 10,000, specifying the amount by which effect magnitudes should be scaled for the device. For example, a value of 10,000 indicates that all effect magnitudes are to be taken at face value. A value of 9,000 indicates that all effect magnitudes are to be reduced to 90 percent of their nominal magnitudes.

DirectInput always checks the gain value before setting the gain property. If the gain is outside of the range (less than zero or greater than 10,000), will return . Otherwise, if successful, it will return , even if the device does not support force feedback.

Setting a gain value is useful when an application wants to scale down the strength of all force-feedback effects uniformly, based on user preferences.

Unlike other properties, the gain can be set when the device is in an acquired state.

This property exists for advanced applications that want to change the friendly instance name of a device (as returned in the tszInstanceName member of the structure) to distinguish it from similar devices that are plugged in simultaneously. Most applications should have no need to change the friendly name.

This setting applies to the entire device, so the dwHow member of the associated structure must be set to .

The pdiph parameter must be a reference to the diph member of a structure.

This property exists for advanced applications that want to change the friendly product name of a device (as returned in the tszProductName member of the structure) to distinguish it from similar devices which are plugged in simultaneously. Most applications should have no need to change the friendly name.

This setting applies to the entire device, so the dwHow member of the associated structure must be set to .

The pdiph parameter must be a reference to the diph member of a structure.

Setting the product name is only useful for changing the user-defined name of an analog joystick on Microsoft Windows 98, Windows 2000, and Windows Millennium Edition (Windows Me) computers. In other cases, attempting to set this property will still return . However, the name is not stored in a location used by .

Sets the range of values an object can possibly report. The minimum and maximum values are taken from the lmin and lmax members of the associated structure.

For some devices, this is a read-only property.

You cannot set a reverse range; lmax must be greater than lmin.

Sets the value for the saturation zones of a joystick, in the range from 0 through 10,000. The saturation level is the point at which the axis is considered to be at its most extreme position. For example, if the saturation level is set to 9,500, the axis reaches the extreme of its range when it has moved 95 percent of the physical distance from its center position (or from the dead zone). This setting can be applied to either the entire device or a specific axis.
+
Address of the structure contained within the type-specific property structure.
+

If the method succeeds, the return value is or . If the method fails, the return value can be one of the following error values: , , .

+ +

The buffer size determines the amount of data that the buffer can hold between calls to the method before data is lost. This value may be set to 0 to indicate that the application does not read buffered data from the device. If the buffer size in the dwData member of the structure is too large for the device to support it, then the largest possible buffer size is set.

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.setproperty + HRESULT IDirectInputDevice8W::SetProperty([In] const void& arg0,[In] const void* arg1) + IDirectInputDevice8W::SetProperty +
+ + + Obtains access to the input device. + +

If the method succeeds, the return value is , or S_FALSE if the device was already acquired. If the method fails, the return value can be one of the following error values: , , .

+ +

Before a device can be acquired, a data format must be set by using the method or method. If the data format has not been set, Interface returns .

Devices must be acquired before calling the or methods for that device.

Device acquisition does not use a reference count. Therefore, if an application calls the Interface method twice, then calls the Interface method once, the device is unacquired.

If succeeds but no actions have been mapped, a subsequent call to will return but a call to Interface will fail with .

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.acquire + HRESULT IDirectInputDevice8W::Acquire() + IDirectInputDevice8W::Acquire +
+ + + Releases access to the device. + +

The return value is is the device was unacquired, or if the device was not in an acquired state.

+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.unacquire + HRESULT IDirectInputDevice8W::Unacquire() + IDirectInputDevice8W::Unacquire +
+ + + Retrieves immediate data from the device. + +
Size of the buffer in the lpvData parameter, in bytes.
+
Address of a structure that receives the current state of the device. The format of the data is established by a prior call to the method.
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following error values: , , , , E_PENDING.

+ +

Before device data can be obtained, set the cooperative level by using the method, then set the data format by using , and acquire the device by using the Interface method.

The five predefined data formats require corresponding device state structures according to the following table:

Data format + State structure +
c_dfDIMouse DIMOUSESTATE
c_dfDIMouse2 DIMOUSESTATE2
c_dfDIKeyboard array of 256 bytes +
c_dfDIJoystick DIJOYSTATE
c_dfDIJoystick2 DIJOYSTATE2

For example, if you passed the c_dfDIMouse format to the method, you must pass a DIMOUSESTATE structure to the method.

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getdevicestate + HRESULT IDirectInputDevice8W::GetDeviceState([In] unsigned int arg0,[In] void* arg1) + IDirectInputDevice8W::GetDeviceState +
+ + + Retrieves buffered data from the device. + +
Size of the structure, in bytes.
+
Array of structures to receive the buffered data. The number of elements in this array must be equal to the value of the pdwInOut parameter. If this parameter is null, the buffered data is not stored anywhere, but all other side effects take place.
+
On entry, the number of elements in the array pointed to by the rgdod parameter. On exit, the number of elements actually obtained.
+
Flags that control the manner in which data is obtained. This value can be 0 or the following flag.
DIGDD_PEEK
Do not remove the items from the buffer. A subsequent call will read the same data. Normally, data is removed from the buffer after it is read.
+

If the method succeeds, the return value is or . If the method fails, the return value can be one of the following error values: , , , , .

+ +
Note
If the method returns , the data in the rgdod array has been truncated.

In the debug version of DirectInput, if a call is made to and the device has been unacquired, then random bytes will be sent to the device data buffer. To make sure you are not using random device data, always check for the DIERR_UNACQUIRED return code.

Before device data can be obtained, you must set the data format and the buffer size by using the and methods, or by using the method. You must also acquire the device by using the Interface method.

The maximum number of events that the buffer will hold is one less than the buffer size set with the method.

The following code example reads up to ten buffered data elements, removing them from the device buffer as they are read.

  rgdod[10]; 	
+            DWORD dwItems = 10; 	
+            hres = idirectinputdevice9_GetDeviceData(  sizeof(),  rgdod,  &dwItems,  0); 	
+            if (SUCCEEDED(hres)) {  // dwItems = Number of elements read (could be zero). if (hres == ) {  // Buffer had overflowed.  } 	
+            } 	
+            

Your application can flush the buffer and retrieve the number of flushed items by specifying null for the rgdod parameter and a reference to a variable containing INFINITE for the pdwInOut parameter. The following code example illustrates how this can be done.

 dwItems = INFINITE; 	
+            hres = idirectinputdevice9_GetDeviceData(  pdid,  sizeof(),  null,  &dwItems,  0); 	
+            if (SUCCEEDED(hres)) {  // Buffer successfully flushed.  // dwItems = Number of elements flushed.  if (hres == ) {  // Buffer had overflowed.  } 	
+            }	
+            

Your application can query for the number of elements in the device buffer by setting the rgdod parameter to null, setting pdwInOut to INFINITE and setting dwFlags to DIGDD_PEEK. The following code example illustrates how this can be done.

 dwItems = INFINITE; 	
+            hres = idirectinputdevice9_GetDeviceData(  pdid,  sizeof(),  null,  &dwItems,  DIGDD_PEEK); 	
+            if (SUCCEEDED(hres)) {  // dwItems = Number of elements in buffer.  if (hres == ) {  // Buffer overflow occurred; not all data  //   was successfully captured.  } 	
+            } 	
+            

To query about whether a buffer overflow has occurred, set the rgdod parameter to null and the pdwInOut parameter to 0. The following code example illustrates how this can be done.

 dwItems = 0; 	
+            hres = idirectinputdevice9_GetDeviceData(  pdid,  sizeof(),  null,  &dwItems,  0); 	
+            if (hres == ) {  // Buffer overflow occurred. 	
+            } 	
+            
+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getdevicedata + HRESULT IDirectInputDevice8W::GetDeviceData([In] unsigned int arg0,[In, Buffer] void* arg1,[InOut] unsigned int* arg2,[In] unsigned int arg3) + IDirectInputDevice8W::GetDeviceData +
+ + + Sets the data format for the DirectInput device. + +
Address of a structure that describes the format of the data that the DirectInputDevice should return. An application can define its own structure or use one of the following predefined global variables:
  • c_dfDIKeyboard

  • c_dfDIMouse

  • c_dfDIMouse2

  • c_dfDIJoystick

  • c_dfDIJoystick2

+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following error values: , , .

+ +

The data format must be set before the device can be acquired by using the Interface method. It is necessary to set the data format only once. The data format cannot be changed while the device is acquired.

If the application is using action mapping, the data format is set instead by the call to .

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.setdataformat + HRESULT IDirectInputDevice8W::SetDataFormat([In] const DIDATAFORMAT* arg0) + IDirectInputDevice8W::SetDataFormat +
+ + + Specifies an event that is to be set when the device state changes. It is also used to turn off event notification. + +
Handle to the event that is to be set when the device state changes. DirectInput uses the Microsoft Win32 SetEvent function on the handle when the state of the device changes. If the hEvent parameter is null, notification is disabled.

The application can create the handle as either a manual-reset or autoreset event by using the Win32 CreateEvent function. If the event is created as an autoreset event, the operating system automatically resets the event when a wait has been satisfied. If the event is created as a manual-reset event, it is the application's responsibility to call the Win32 ResetEvent function to reset it. DirectInput does not call the Win32 ResetEvent function for event notification handles. Most applications create the event as an automatic-reset event.

+ No documentation. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.seteventnotification + HRESULT IDirectInputDevice8W::SetEventNotification([In] void* arg0) + IDirectInputDevice8W::SetEventNotification +
+ + +Requests the cooperative level for this instance of the inpute device. The cooperative level determines how this instance of the device interacts with other instances of the device and the rest of the system. +Window handle to be associated with the device. This parameter must be a valid top-level window handle that belongs to the process. The window associated with the device must not be destroyed while it is still active in a DirectInput device.Flags that specify the cooperative level to associate with the input device.If the method succeeds, the return value is . If the method fails, a is raised with the following error code values: , , . +Applications cannot specify and at the same time. This apply as well to and . + When the mouse is acquired with exclusive access, the mouse pointer is removed from the screen until the device is unacquired. + Applications that select the background exclusive mode cooperative level are not guaranteed to retain access to the device if another application requests exclusive access. When a background exclusive mode application loses access, calls to DirectInput device methods will fail and return . The application can regain access to the device by manually unacquiring the device and reaquiring it. + Applications must call this method before acquiring the device by using the method. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.setcooperativelevel + HRESULT IDirectInputDevice8W::SetCooperativeLevel([In] HWND arg0,[In] DISCL arg1) + IDirectInputDevice8W::SetCooperativeLevel + + + + Retrieves information about a device object, such as a button or axis. + +
Value that identifies the object whose information is to be retrieved. The value set for this parameter depends on the value specified in the dwHow parameter.
+
Value that specifies how the dwObj parameter should be interpreted. The dwHow value can be one of the following:
The dwObj parameter is the offset into the current data format of the object whose information is being accessed.
The dwObj parameter is the object type/instance identifier. This identifier is returned in the dwType member of the structure returned from a previous call to the method.
The dwObj parameter contains the HID Usage Page and Usage values of the object, combined by the DIMAKEUSAGEDWORD macro.
+
Address of a structure to be filled with information about the object. The structure's dwSize member must be initialized before this method is called.
+ +

For compatibility with DirectX 3, it is also valid to pass a DIDEVICEOBJECTINSTANCE_DX3 structure with the dwSize member initialized to sizeof(DIDEVICEOBJECTINSTANCE_DX3).

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getobjectinfo + HRESULT IDirectInputDevice8W::GetObjectInfo([Out] DIDEVICEOBJECTINSTANCEW* arg0,[In] unsigned int arg1,[In] DIPH arg2) + IDirectInputDevice8W::GetObjectInfo +
+ + + Obtains information about the device's identity. + +
Address of a structure to be filled with information about the device's identity. An application must initialize the structure's dwSize member before calling this method.
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following error values: , , E_POINTER.

+ +

For compatibility with DirectX 3, it is also valid to pass a DIDEVICEINSTANCE_DX3 structure with the dwSize member initialized to sizeof(DIDEVICEINSTANCE_DX3).

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getdeviceinfo + HRESULT IDirectInputDevice8W::GetDeviceInfo([Out] DIDEVICEINSTANCEW* arg0) + IDirectInputDevice8W::GetDeviceInfo +
+ + + Runs the DirectInput control panel associated with this device. If the device does not have a control panel associated with it, the default device control panel is launched. + +
Parent window handle. If this parameter is null , no parent window is used.
+
Not currently used. Zero is the only valid value.
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following error values:

+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.runcontrolpanel + HRESULT IDirectInputDevice8W::RunControlPanel([In] HWND arg0,[In] unsigned int arg1) + IDirectInputDevice8W::RunControlPanel +
+ + + Initializes a DirectInputDevice object. TheIDirectInput8::CreateDevicemethod automatically initializes a device after creating it; applications normally do not need to call this method. + + No documentation. + No documentation. + No documentation. +

If the method succeeds, the return value is or S_FALSE. If the method returns S_FALSE, the device had already been initialized with the instance passed in though rGUID. If the method fails, the return value can be one of the following error values: , .

+ +

If this method fails, the underlying object should be considered to be in an indeterminate state and must be reinitialized before use.

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.initialize + HRESULT IDirectInputDevice8W::Initialize([In] HINSTANCE arg0,[In] unsigned int arg1,[In] const GUID& arg2) + IDirectInputDevice8W::Initialize +
+ + + Creates and initializes an instance of an effect identified by the effect globally unique identifier (). + +
Reference to (C++) or address of (C) the identifying the effect to be created. This can be a predefined effect , or it can be a obtained from . The following standard effect GUIDs are defined:
+
structure that provides parameters for the created effect. This parameter is optional. If it is null, the effect object is created without parameters. The application must then call the method to set the parameters of the effect before it can download the effect.
+
Address of a variable to receive a reference to the Interface interface if successful.
+
Controlling unknown for COM aggregation. The value is null if the interface is not aggregated. Most calling applications pass null.
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following error values: , ,, .

+ +

If the return value is , the effect was created, and the parameters of the effect were updated, but the effect was not necessarily downloaded. For it to be downloaded, the device must be acquired in exclusive mode.

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.createeffect + HRESULT IDirectInputDevice8W::CreateEffect([In] const GUID& arg0,[In] const DIEFFECT* arg1,[Out, Fast] IDirectInputEffect** arg2,[In] IUnknown* arg3) + IDirectInputDevice8W::CreateEffect +
+ + + Enumerates all the effects supported by the force-feedback system on the device. The enumerated GUIDs can represent predefined effects, as well as effects peculiar to the device manufacturer. + +
Address of an application-defined callback function. The declaration of this function must conform to that of the DIEnumEffectsCallback prototype.
+
A 32-bit application-defined value to be passed to the callback function. This parameter can be any 32-bit type; it is declared as LPVOID for convenience.
+
Effect type filter. Use one of the DIEFT_* values to indicate the effect type to be enumerated, or to enumerate all effect types. For a list of these values, see DIEffectInfo.
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following error values:

+ +

If the callback stops the enumeration prematurely, the enumeration is considered to have succeeded.

An application can use the dwEffType member of the DIEffectInfo structure to obtain general information about the effect, such as its type and which envelope and condition parameters are supported by the effect.

To exploit an effect to its fullest, contact the device manufacturer to obtain information about the semantics of the effect and its effect-specific parameters.

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.enumeffects + HRESULT IDirectInputDevice8W::EnumEffects([In] __function__stdcall* arg0,[In] void* arg1,[In] DIEFT arg2) + IDirectInputDevice8W::EnumEffects +
+ + + Obtains information about an effect. + +
Reference to (C++) or address of (C) the globally unique identifier () identifying the effect for which information is being requested.
+
DIEffectInfo structure that receives information about the effect. The calling application must initialize the dwSize member of the structure before calling this method.
+ +
Note
If this method is called on an non-Force Feedback device, E_POINTER will be returned.
+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.geteffectinfo + HRESULT IDirectInputDevice8W::GetEffectInfo([Out] DIEFFECTINFOW* arg0,[In] const GUID& arg1) + IDirectInputDevice8W::GetEffectInfo +
+ + + Retrieves the state of the device's force-feedback system. + +
Location for flags that describe the current state of the device's force-feedback system.

The value is a combination of the following constants.

The device's force-feedback actuators are disabled. If the device cannot report the actuator state, neither nor is returned.
The device's force-feedback actuators are enabled. If the device cannot report the actuator state, neither nor is returned.
The device suffered an unexpected failure and is in an indeterminate state. It must be reset either by unacquiring and reacquiring the device, or by sending a command.
The device has no downloaded effects.
Playback of all active effects has been paused.
The force-feedback system is not currently available. If the device cannot report the power state, neither nor is returned.
Power to the force-feedback system is currently available. If the device cannot report the power state, neither nor is returned.
The safety switch is currently off; that is, the device cannot operate. If the device cannot report the state of the safety switch, neither nor is returned.
The safety switch is currently on; that is, the device can operate. If the device cannot report the state of the safety switch, neither nor is returned.
No effects are playing, and the device is not paused.
The user force-feedback switch is currently off; that is, the device cannot operate. If the device cannot report the state of the user force-feedback switch, neither nor is returned.
The user force-feedback switch is currently on; that is, the device can operate. If the device cannot report the state of the user force-feedback switch, neither nor is returned.

Applications should ignore any flags that are not currently defined.

+ +

The device must be acquired at the exclusive cooperative level for this method to succeed.

The and flags may not always be reported correctly because there is no mechanism for the drivers to report that they support these flags.

Note
When calling , it is possible for the state of the device returned not to match the expected state. This might happen if commands recently sent by are still pending. Wait a short time and then check the device state again.
+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getforcefeedbackstate + HRESULT IDirectInputDevice8W::GetForceFeedbackState([Out] DIGFFS* arg0) + IDirectInputDevice8W::GetForceFeedbackState +
+ + + Sends a command to the device's force-feedback system. + +
Single value indicating the desired change in state. The value can be one of the following.
Paused playback of all active effects is to be continued. It is an error to send this command when the device is not in a paused state.
Playback of all active effects is to be paused. This command also stops the clock-on effects so that they continue playing to their full duration when restarted.

While the device is paused, new effects cannot be started, and existing ones cannot be modified. Doing so can cause the subsequent command to fail to perform properly.

To abandon a pause and stop all effects, use the or DISFCC_RESET commands.

The device's force-feedback system is to be put in its startup state. All effects are removed from the device, are no longer valid, and must be re-created if they are to be used again. The device's actuators are disabled.
The device's force-feedback actuators are to be disabled. While the actuators are off, effects continue to play but are ignored by the device. Using the analogy of a sound playback device, they are muted, rather than paused.
The device's force-feedback actuators are to be enabled.
Playback of any active effects is to be stopped. All active effects are reset, but are still being maintained by the device and are still valid. If the device is in a paused state, that state is lost. This command is equivalent to calling the method for each effect playing.
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following error values: , , , , .

+ +

The device must be acquired at the exclusive cooperative level for this method to succeed.

Note
When calling , it is possible for the state of the device returned not to match the expected state. This might happen if commands recently sent by are still pending. Wait a short time and then check the device state again.
+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.sendforcefeedbackcommand + HRESULT IDirectInputDevice8W::SendForceFeedbackCommand([In] DISFFC arg0) + IDirectInputDevice8W::SendForceFeedbackCommand +
+ + + Enumerates all the currently created effects for this device. Effects created byIDirectInputDevice8::CreateEffectare enumerated. + + No documentation. + No documentation. + No documentation. +

If the method succeeds, the return value is . If the method fails, the return value can be one of the following error values: , .

+ +

The results are unpredictable if you create or destroy an effect while an enumeration is in progress. However, the callback function can safely release the effect passed to it.

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.enumcreatedeffectobjects + HRESULT IDirectInputDevice8W::EnumCreatedEffectObjects([In] __function__stdcall* arg0,[In] void* arg1,[In] unsigned int arg2) + IDirectInputDevice8W::EnumCreatedEffectObjects +
+ + + Sends a hardware-specific command to the force-feedback driver. + +
structure that describes the command to be sent. On success, the cbOutBuffer member contains the number of bytes of the output buffer actually used.
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following error values: , .

+ +

Other device-specific error codes are also possible. Ask the hardware manufacturer for details.

Because each driver implements different escapes, it is the application's responsibility to ensure that it is sending the escape to the correct driver by comparing the value of the guidFFDriver member of the structure against the value the application is expecting.

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.escape + HRESULT IDirectInputDevice8W::Escape([In] DIEFFESCAPE* arg0) + IDirectInputDevice8W::Escape +
+ + + Retrieves data from polled objects on a DirectInput device. If the device does not require polling, calling this method has no effect. If a device that requires polling is not polled periodically, no new data is received from the device. Calling this method causes DirectInput to update the device state, generate input events (if buffered data is enabled), and set notification events (if notification is enabled). + +

If the method succeeds, the return value is , or if the device does not require polling. If the method fails, the return value can be one of the following error values: , , .

+ +

Before a device data can be polled, the data format must be set by using the or method, and the device must be acquired by using the Interface method.

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.poll + HRESULT IDirectInputDevice8W::Poll() + IDirectInputDevice8W::Poll +
+ + + Sends data to a device that accepts output.
Note
There are no devices that accept output from . See Remarks.
+
+ No documentation. + No documentation. + No documentation. + No documentation. +

If the method succeeds, the return value is . If the method fails, the return value can be one of the following error values: , , , .

+ +

Applications should not use . Force Feedback is the recommended way to send data to a device. If you want to send other data to a device, such as changing LED or internal device states, the HID application programming interface (API) is the recommended way.

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.senddevicedata + HRESULT IDirectInputDevice8W::SendDeviceData([In] unsigned int arg0,[In, Buffer] const DIDEVICEOBJECTDATA* arg1,[InOut] unsigned int* arg2,[In] unsigned int arg3) + IDirectInputDevice8W::SendDeviceData +
+ + + Enumerates all the effects in a file created by the Force Editor utility or another application using the same file format. + +
Name of the RIFF file.
+
Address of an application-defined callback function. The declaration of this function must conform to that of the DIEnumEffectsInFileCallback prototype.
+
Application-defined value to be passed to the callback function. This parameter can be any 32-bit type.
+
Can be ( = 0) or one or both of the following values:
Include effect types that are not defined by DirectInput.
Instruct DirectInput to modify the authored effect, if necessary, so that it plays on the current device. For example, by default, an effect authored for two axes does not play on a single-axis device. Setting this flag allows the effect to play on a single axis. The parameters are modified in the structure pointed to by the lpDiEffect member of the structure passed to the callback.
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following error values:

+ +

If the callback stops the enumeration prematurely, the enumeration is considered to have succeeded.

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.enumeffectsinfile + HRESULT IDirectInputDevice8W::EnumEffectsInFile([In] const wchar_t* arg0,[In] __function__stdcall* arg1,[In] void* arg2,[In] DIFEF arg3) + IDirectInputDevice8W::EnumEffectsInFile +
+ + + Saves information about one or more force-feedback effects to a file that can be read by usingIDirectInputDevice8::EnumEffectsInFile. This method is chiefly of interest to those wanting to write their own force-authoring applications. + + No documentation. + No documentation. + No documentation. + No documentation. +

If the method succeeds, it returns . If it fails, the return value can be .

+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.writeeffecttofile + HRESULT IDirectInputDevice8W::WriteEffectToFile([In] const wchar_t* arg0,[In] unsigned int arg1,[In, Buffer] DIFILEEFFECT* arg2,[In] unsigned int arg3) + IDirectInputDevice8W::WriteEffectToFile +
+ + + Builds an action map for the device and retrieves information about it. + +
Address of a structure that receives information about the action map.
+
Pointer to a string that specifies the name of the user for whom mapping is requested. When using ANSI compiler settings, pass null and DirectInput will assume the current user name. When using Unicode compiler settings, do not pass null because the mappings will not be saved.
+
Flags to control the mapping. This can be one of the following values.
DIDBAM_DEFAULT
Overwrite all mappings except application-specified mappings; that is, mappings that have the DIA_APPMAPPED flag in the structure.
DIDBAM_HWDEFAULTS
Overwrite all mappings, including application-specified mappings. This flag is similar to DIDBAM_INITIALIZE, but automatically overrides user-mapped actions with the defaults specified by the device driver or DirectInput.
DIDBAM_INITIALIZE
Overwrite all mappings, including application-specified mappings.
DIDBAM_PRESERVE
Preserve current mappings assigned for this device or any other configured device.
+

If the method succeeds, the return value is , , or >. See Remarks. If the method fails, the return value can be one of the following error values: , .

+ +

The method returns if no mappings were created for the device. For example, a keyboard or mouse will not provide mappings for genre-specific actions.

If is returned, one or more of the mappings was not valid. The dwHow member of the structure is set to DIAH_ERROR. The application can iterate through the action map to find and correct errors.

If DIEFF_MAPFILEFAIL is returned, an error has occurred either reading the vendor supplied file for the device or reading or writing the user configuration file for the device.

> is returned if the mappings were not configurable. For example, the buttons on a voice controller cannot be reconfigured because each button causes a specific hardware action to occur. > overrides other success codes, so a check of the return codes will not reveal if any actions have been mapped.

If succeeds but no actions have been mapped, a subsequent call to will return but a call to Interface will fail with .

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.buildactionmap + HRESULT IDirectInputDevice8W::BuildActionMap([In] DIACTIONFORMATW* arg0,[In] const wchar_t* arg1,[In] unsigned int arg2) + IDirectInputDevice8W::BuildActionMap +
+ + + Sets the data format for a device and maps application-defined actions to device objects. It also sets the buffer size for buffered data. + +
Address of a structure containing information about the action map to be applied.
+
Unicode string that specifies the name of the user for which the action map is being set. A value of null specifies the user currently logged into the system.
+
DWORD value that specifies how the action map is applied. This can be one of the following values.
DIDSAM_DEFAULT
Set the action map for this user. If the map differs from the current map, the new settings are saved to disk.
DIDSAM_FORCESAVE
Always save the configuration to disk.
DIDSAM_NOUSER
Reset user ownership for this device in the default configuration property sheet. Resetting user ownership does not remove the current action map.
+

If the method succeeds, the return value can be one of the following error values: , , or . If the method fails, the return value can be one of the following error values: or , , , , .

+ +

This method provides the mechanism to change action-to-control mapping from the device defaults. An application must use this method to map its in-game actions to virtual controls.

The user name passed to this method binds a set of action mappings for a device to a specific user. Settings are automatically saved to disk when they differ from the currently applied map. Applications that accept input from multiple users should be very careful when applying action maps to the system mouse or keyboard, as the action maps for each user may conflict.

The method can be called only when the device is not acquired.

If succeeds but no actions have been mapped, a subsequent call to will return but a call to Interface will fail with .

+
+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.setactionmap + HRESULT IDirectInputDevice8W::SetActionMap([In] DIACTIONFORMATW* arg0,[In] const wchar_t* arg1,[In] unsigned int arg2) + IDirectInputDevice8W::SetActionMap +
+ + + Retrieves information about a device image for use in a configuration property sheet. + +
Address of a structure that receives information about the device image.
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following error values: , , , , .

+ + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getimageinfo + HRESULT IDirectInputDevice8W::GetImageInfo([InOut] DIDEVICEIMAGEINFOHEADERW* arg0) + IDirectInputDevice8W::GetImageInfo +
+ + + DirectInput device data format. + + + + + Contains information about device images. Used in theIDirectInputDevice8::GetImageInfomethod. + + +

The buffer at lprgImageInfoArray must be large enough to hold all required image information structures. Applications can query for the required size by calling the method with the dwBufferSize member set to zero. After the call, dwBufferUsed contains the amount of memory, in bytes, that was modified.

+
+ + microsoft.directx_sdk.reference.dideviceimageinfoheader + DIDEVICEIMAGEINFOHEADERW + DIDEVICEIMAGEINFOHEADERW +
+ + + Initializes a new instance of the class. + + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfoheader + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfoheader + unsigned int dwSizeImageInfo + unsigned int dwSizeImageInfo + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfoheader + unsigned int dwcViews + unsigned int dwcViews + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfoheader + unsigned int dwcButtons + unsigned int dwcButtons + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfoheader + unsigned int dwcAxes + unsigned int dwcAxes + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfoheader + unsigned int dwcPOVs + unsigned int dwcPOVs + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfoheader + unsigned int dwBufferSize + unsigned int dwBufferSize + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfoheader + unsigned int dwBufferUsed + unsigned int dwBufferUsed + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfoheader + DIDEVICEIMAGEINFOW* lprgImageInfoArray + DIDEVICEIMAGEINFOW lprgImageInfoArray + + + + Describes an instance of a DirectInput device. This structure is used with theIDirectInput8::EnumDevices,IDirectInput8::EnumDevicesBySemantics, andIDirectInputDevice8::GetDeviceInfomethods. + + +

The following device types and subtypes are defined for use in the dwDevType member.

  • First-person action game device. The following subtypes are defined.

    • Device that does not provide the minimum number of device objects for action mapping.

    • Device designed for first-person shooter games.

    • Device with six degrees of freedom; that is, three lateral axes and three rotational axes.

    • Unknown subtype.

  • Device that does not fall into another category.

  • Input device used to control another type of device from within the context of the application. The following subtypes are defined.

    • Control used to make communications selections.

    • Device that must use its default configuration and cannot be remapped.

    • Unknown subtype.

  • Device for steering. The following subtypes are defined.

    • Steering device that reports acceleration and brake pedal values from a single axis.

    • Steering device that reports acceleration and brake pedal values from separate axes.

    • Hand-held steering device.

    • Steering device that does not provide the minimum number of device objects for action mapping.

    • Steering device that reports acceleration, brake, and clutch pedal values from separate axes.

  • Controller for flight simulation. The following subtypes are defined.

    • Flight controller that does not provide the minimum number of device objects for action mapping.

    • Flight device based on a remote control for model aircraft.

    • Joystick.

    • Yoke.

  • Gamepad. The following subtypes are defined.

    • Gamepad that does not provide the minimum number of device objects for action mapping.

    • Standard gamepad that provides the minimum number of device objects for action mapping.

    • Gamepad that can report x-axis and y-axis data based on the attitude of the controller.

  • Joystick. The following subtypes are defined.

    • Joystick that does not provide the minimum number of device objects for action mapping.

    • Standard joystick that provides the minimum number of device objects for action mapping.

  • Keyboard or keyboard-like device. The following subtypes are defined.

    • Subtype could not be determined.

    • IBM PC/XT 83-key keyboard.

    • Olivetti 102-key keyboard.

    • IBM PC/AT 84-key keyboard.

    • IBM PC Enhanced 101/102-key or Microsoft Natural keyboard.

    • Nokia 1050 keyboard.

    • Nokia 9140 keyboard.

    • Japanese NEC PC98 keyboard.

    • Japanese NEC PC98 laptop keyboard.

    • Japanese NEC PC98 106-key keyboard.

    • Japanese 106-key keyboard.

    • Japanese AX keyboard.

    • Japanese J3100 keyboard.

  • A mouse or mouse-like device (such as a trackball). The following subtypes are defined.

    • Mouse that returns absolute axis data.

    • Fingerstick.

    • Touchpad.

    • Trackball.

    • Traditional mouse.

    • Subtype could not be determined.

  • Remote-control device. The following subtype is defined.

    • Subtype could not be determined.

  • Screen reference. The following subtypes are defined.

    • Unknown subtype.

    • Light gun.

    • Light pen.

    • Touch screen.

  • Specialized device with functionality unsuitable for the main control of an application, such as pedals used with a wheel. The following subtypes are defined.

    • Secondary handheld controller.

    • Device whose primary function is to report acceleration and brake pedal values from a single axis.

    • Device whose primary function is to report acceleration and brake pedal values from separate axes.

    • Device that tracks hand movement.

    • Device that tracks head movement.

    • Device with rudder pedals.

    • Device that reports gear selection from an axis.

    • Device that reports gear selection from button states.

    • Device whose primary function is to report at least two throttle values. It may have other controls.

    • Device whose primary function is to report acceleration, brake, and clutch pedal values from separate axes.

    • Device whose primary function is to report a single throttle value. It may have other controls.

    • Unknown subtype.

Versions of DirectInput earlier than DirectX 8.0 have a somewhat different scheme of device types and subtypes. See the DIDEVTYPExxx defines in Dinput.h.

+
+ + microsoft.directx_sdk.reference.dideviceinstance + DIDEVICEINSTANCEW + DIDEVICEINSTANCEW +
+ + + Initializes a new instance of the class. + + + + + Gets the type of this device. + + The type. + + + + Gets the subtype of the device. + + The subtype. + + + + Gets a value indicating whether this instance is human interface device. + + + true if this instance is human interface device; otherwise, false. + + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceinstance + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceinstance + GUID guidInstance + GUID guidInstance + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceinstance + GUID guidProduct + GUID guidProduct + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceinstance + unsigned int dwDevType + unsigned int dwDevType + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceinstance + wchar_t tszInstanceName[260] + wchar_t tszInstanceName + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceinstance + wchar_t tszProductName[260] + wchar_t tszProductName + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceinstance + GUID guidFFDriver + GUID guidFFDriver + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceinstance + HID_USAGE_PAGE wUsagePage + HID_USAGE_PAGE wUsagePage + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceinstance + HID_USAGE_ID wUsage + HID_USAGE_ID wUsage + + + + Describes a device object instance. This structure is used with theIDirectInputDevice8::EnumObjectsmethod to provide theDIEnumDeviceObjectsCallbackcallback function with information about a particular object associated with a device, such as an axis or button. It is also used with theIDirectInputDevice8::GetObjectInfomethod to retrieve information about a device object. + + +
Note
The value in dwOfs is the offset within the raw data returned by the device, regardless of whether the data format has been set for the device.

Applications can use the wUsagePage and wUsage members to obtain additional information about how the object was designed to be used. For example, if wUsagePage has the value 0x02 (vehicle controls) and wUsage has the value 0xB9 (elevator trim), the object was designed to be the elevator trim control on a flight stick. A flight simulator application can use this information to provide more reasonable defaults for objects on the device. HID usage codes are determined by the USB standards committee.

+
+ + microsoft.directx_sdk.reference.dideviceobjectinstance + DIDEVICEOBJECTINSTANCEW + DIDEVICEOBJECTINSTANCEW +
+ + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectinstance + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectinstance + GUID guidType + GUID guidType + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectinstance + unsigned int dwOfs + unsigned int dwOfs + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectinstance + DIDFT dwType + DIDFT dwType + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectinstance + DIDOI dwFlags + DIDOI dwFlags + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectinstance + wchar_t tszName[260] + wchar_t tszName + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectinstance + unsigned int dwFFMaxForce + unsigned int dwFFMaxForce + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectinstance + unsigned int dwFFForceResolution + unsigned int dwFFForceResolution + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectinstance + unsigned short wCollectionNumber + unsigned short wCollectionNumber + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectinstance + unsigned short wDesignatorIndex + unsigned short wDesignatorIndex + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectinstance + unsigned short wUsagePage + unsigned short wUsagePage + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectinstance + unsigned short wUsage + unsigned short wUsage + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectinstance + unsigned int dwDimension + unsigned int dwDimension + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectinstance + unsigned short wExponent + unsigned short wExponent + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectinstance + unsigned short wReportId + unsigned short wReportId + + + + Properties for a . + + + + + Gets the key code for a keyboard key. An exception is raised if the property cannot resolve specialized keys on USB keyboards because they do not exist in scan code form. For all other failures, an exception is also returned. + + The key id. + The key code + + + + Gets the localized key name for a keyboard key. Using this property on devices other than a keyboard will return unexpected names. + + The key. + + + + + Gets or sets a value indicating whether device objects are self centering. + + true if device objects are self centering; otherwise, false. + + + + Gets or sets the axis mode. + + The axis mode. + + + + Gets or sets the input buffer size. The buffer size determines the amount of data that the buffer can hold between calls to the method before data is lost. You can set this value to 0 to indicate that the application does not read buffered data from the device. If the buffer size is too large for the device to support it, then the largest possible buffer size is set. However, this property always returns the buffer size set using the property, even if the buffer cannot be supported because it is too large. + + The size of the buffer. + + + + Gets the class GUID for the device. This property lets advanced applications perform operations on a human interface device that are not supported by DirectInput. + + The class GUID. + + + + Gets or sets the dead zone of a joystick, in the range from 0 through 10,000, where 0 indicates that there is no dead zone, 5,000 indicates that the dead zone extends over 50 percent of the physical range of the axis on both sides of center, and 10,000 indicates that the entire physical range of the axis is dead. When the axis is within the dead zone, it is reported as being at the center of its range. + + The dead zone. + + + + Gets or sets the force feedback gain of the device. + The gain value is applied to all effects created on the device. The value is an integer in the range from 0 through 10,000, specifying the amount by which effect magnitudes should be scaled for the device. For example, a value of 10,000 indicates that all effect magnitudes are to be taken at face value. A value of 9,000 indicates that all effect magnitudes are to be reduced to 90 percent of their nominal magnitudes. + DirectInput always checks the gain value before setting the gain property. If the gain is outside of the range (less than zero or greater than 10,000), setting this property will raise an exception. Otherwise, no exception if successful, even if the device does not support force feedback. + Setting a gain value is useful when an application wants to scale down the strength of all force-feedback effects uniformly, based on user preferences. + Unlike other properties, the gain can be set when the device is in an acquired state. + + The force feedback gain. + + + + Gets the input granularity. Granularity represents the smallest distance over which the object reports movement. Most axis objects have a granularity of one; that is, all values are possible. Some axes have a larger granularity. For example, the wheel axis on a mouse can have a granularity of 20; that is, all reported changes in position are multiples of 20. In other words, when the user turns the wheel slowly, the device reports a position of 0, then 20, then 40, and so on. This is a read-only property. + + The granularity. + + + + Gets or sets the friendly instance name of the device. + This property exists for advanced applications that want to change the friendly instance name of a device (as returned in the tszInstanceName member of the structure) to distinguish it from similar devices that are plugged in simultaneously. Most applications should have no need to change the friendly name. + + The name of the instance. + + + + Gets the device interface path for the device. This property lets advanced applications perform operations on a human interface device that are not supported by DirectInput. + + The interface path. + + + + Gets the instance number of a joystick. This property is not implemented for the mouse or keyboard. + + The joystick id. + + + + Gets the memory load for the device. This setting applies to the entire device, rather than to any particular object. The retrieved value is in the range from 0 through 100, indicating the percentage of device memory in use. The device must be acquired in exclusive mode. If it is not, the method will fail with an exception. + + The memory load. + + + + Gets the human-readable display name of the port to which this device is connected. Not generally used by applications. + + The human-readable display name of the port to which this device is connected. + + + + Gets the vendor identity (ID) and product ID of a HID device. This property is of type int and contains both values. These two short values are combined. This property applies to the entire device, rather than to any particular object. + + The product id. + + + + Gets or sets the friendly product name of the device. + This property exists for advanced applications that want to change the friendly product name of a device (as returned in the tszProductName member of the structure) to distinguish it from similar devices which are plugged in simultaneously. Most applications should have no need to change the friendly name. + This setting applies to the entire device. + Setting the product name is only useful for changing the user-defined name of an analog joystick on Microsoft Windows 98, Windows 2000, and Windows Millennium Edition (Windows Me) computers. In other cases, attempting to set this property will still return ok. However, the name is not stored in a location used by the getter of this property. + + The name of the product. + + + + Gets or sets the range of values an object can possibly report. + + The range. + For some devices, this is a read-only property. + + + + Gets or sets the saturation zones of a joystick, in the range from 0 through 10,000. The saturation level is the point at which the axis is considered to be at its most extreme position. For example, if the saturation level is set to 9,500, the axis reaches the extreme of its range when it has moved 95 percent of the physical distance from its center position (or from the dead zone). + + The saturation. + + + + + Gets the user name for a user currently assigned to a device. User names are set by calling . If no user name is set, the method throws an exception. + + The name of the user. + + + + Gets the vendor identity (ID) and product ID of a HID device. This property is of type int and contains both values. These two short values are combined. This property applies to the entire device, rather than to any particular object. + + The product id. + + + +

Applications use the methods of the interface to enumerate, create, and retrieve the status of Microsoft DirectInput devices, initialize the DirectInput object, and invoke an instance of the Microsoft Windows Control Panel.

IDirectInput8 Members
Method + Description +
IDirectInput8::ConfigureDevices Displays property pages for connected input devices and enables the user to map actions to device controls. +
Creates and initializes an instance of a device based on a given globally unique identifier (), and obtains an Interface interface. +
Enumerates available devices. +
Enumerates devices that most closely match the application-specified action map. +
Retrieves the instance globally unique identifier () of a device that has been newly attached to the system. It is called in response to a Microsoft Win32 device management notification. +
Retrieves the status of a specified device. +
Initializes a DirectInput object. Applications normally do not need to call this method. The DirectInput8Create function automatically initializes the DirectInput object after creating it. +
Runs Control Panel to enable the user to install a new input device or modify configurations. +
+
+ +

supersedes the IDirectInput, IDirectInput2, and IDirectInput7 interfaces used in earlier versions of Microsoft DirectX.

is an interface to a new class of object, represented by the class identifier CLSID_DirectInput8, and cannot be obtained by calling QueryInterface on an interface to objects of class CLSID_DirectInput. Instead, obtain the interface by using the DirectInput8Create function.

The LPDIRECTINPUT8 type is defined as a reference to the interface:

 typedef struct     *LPDIRECTINPUT8;	
+            
+
+ + ee417799 + IDirectInput8W + IDirectInput8W +
+ + + Initializes a new instance of the class. + + + + + Gets all devices. + + A collection of + + + + Gets the devices for a particular and . + + Class of the device. + The device enum flags. + A collection of + + + + Gets the devices for a particular and . + + Type of the device. + The device enum flags. + A collection of + + + + Determines whether a device with the specified Guid is attached. + + The device Guid. + + true if the device with the specified device Guid is attached ; otherwise, false. + + + + + Runs Control Panel to enable the user to install a new input device or modify configurations. + + + + + Runs Control Panel to enable the user to install a new input device or modify configurations. + + Handle of the window to be used as the parent window for the subsequent user interface. If this parameter is NULL, no parent window is used. + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + Creates and initializes an instance of a device based on a given globally unique identifier (), and obtains anIDirectInputDevice8 Interfaceinterface. + + No documentation. + No documentation. + No documentation. +

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , , , .

+ +

Calling this method with pUnkOuter = null is equivalent to creating the object by CoCreateInstance (&CLSID_DirectInputDevice, null, CLSCTX_INPROC_SERVER, riid, lplpDirectInputDevice) and then initializing it with Initialize.

Calling this method with pUnkOuter != null is equivalent to creating the object by CoCreateInstance (&CLSID_DirectInputDevice, punkOuter, CLSCTX_INPROC_SERVER, &IID_IUnknown, lplpDirectInputDevice). The aggregated object must be initialized manually.

+
+ + microsoft.directx_sdk.idirectinput8.idirectinput8.createdevice + HRESULT IDirectInput8W::CreateDevice([In] const GUID& arg0,[Out] void** arg1,[In] IUnknown* arg2) + IDirectInput8W::CreateDevice +
+ + + Enumerates available devices. + +
Device type filter.

To restrict the enumeration to a particular type of device, set this parameter to a DI8DEVTYPE_* value. See .

To enumerate a class of devices, use one of the following values.

All devices.
All devices that do not fall into another class.
All game controllers.
All keyboards. Equivalent to .
All devices of type and .
+
Address of a callback function to be called once for each device enumerated. See DIEnumDevicesCallback.
+
Application-defined 32-bit value to be passed to the enumeration callback each time it is called.
+
Flag value that specifies the scope of the enumeration. This parameter can be one or more of the following values:
All installed devices are enumerated. This is the default behavior.
Only attached and installed devices.
Only devices that support force feedback.
Include devices that are aliases for other devices.
Include hidden devices. For more information about hidden devices, see .
Include phantom (placeholder) devices.
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following error values: , .

+ +

All installed devices can be enumerated, even if they are not present. For example, a flight stick might be installed on the system but not currently plugged into the computer. Set the dwFlags parameter to indicate whether only attached or all installed devices should be enumerated. If the flag is not present, all installed devices are enumerated.

A preferred device type can be passed as a dwDevType filter so that only the devices of that type are enumerated.

On Microsoft Windows XP, DirectInput enumerates only one mouse and one keyboard device, referred to as the system mouse and the system keyboard. These devices represent the combined output of all mice and keyboards respectively on a system. For information about how to read from multiple mice or keyboards individually on Windows XP, see the WM_INPUT documentation.

Note
The order in which devices are enumerated by DirectInput is not guaranteed.
+
+ + microsoft.directx_sdk.idirectinput8.idirectinput8.enumdevices + HRESULT IDirectInput8W::EnumDevices([In] unsigned int arg0,[In] __function__stdcall* arg1,[In] void* arg2,[In] DIEDFL arg3) + IDirectInput8W::EnumDevices +
+ + + Retrieves the status of a specified device. + +
Reference to (C++) or address of (C) the globally unique identifier () identifying the instance of the device whose status is being checked.
+

If the method succeeds, the return value is if the device is attached to the system, or otherwise. If the method fails, the return value can be one of the following error values: , , .

+ + microsoft.directx_sdk.idirectinput8.idirectinput8.getdevicestatus + HRESULT IDirectInput8W::GetDeviceStatus([In] const GUID& arg0) + IDirectInput8W::GetDeviceStatus +
+ + + Runs Control Panel to enable the user to install a new input device or modify configurations. + +
Handle of the window to be used as the parent window for the subsequent user interface. If this parameter is null, no parent window is used.
+
Currently not used and must be set to 0.
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following error values: , .

+ + microsoft.directx_sdk.idirectinput8.idirectinput8.runcontrolpanel + HRESULT IDirectInput8W::RunControlPanel([In] HWND arg0,[In] unsigned int arg1) + IDirectInput8W::RunControlPanel +
+ + + Initializes a + DirectInput object. Applications normally do not need to call this method. TheDirectInput8Createfunction automatically initializes the DirectInput object after creating it. + + No documentation. + No documentation. +

If the method succeeds, the return value is . If the method fails, the return value can be one of the following error values: , .

+ + microsoft.directx_sdk.idirectinput8.idirectinput8.initialize + HRESULT IDirectInput8W::Initialize([In] HINSTANCE arg0,[In] unsigned int arg1) + IDirectInput8W::Initialize +
+ + + Retrieves the instance globally unique identifier () of a device that has been newly attached to the system. It is called in response to a Microsoft Win32 device management notification. + +
Unique identifier of the device class for the device that the application is to locate. The application obtains the class from the device arrival notification. For more information, see the documentation on the DBT_DEVICEARRIVAL event in the Microsoft Platform Software Development Kit (SDK).
+
Name of the device. The application obtains the name from the device arrival notification.
+
Address of a variable to receive the instance for the device, if the device is found. This value can be passed to .
+ + microsoft.directx_sdk.idirectinput8.idirectinput8.finddevice + HRESULT IDirectInput8W::FindDevice([In] const GUID& arg0,[In] const wchar_t* arg1,[Out] GUID* arg2) + IDirectInput8W::FindDevice +
+ + + Enumerates devices that most closely match the application-specified action map. + +
String identifying the current user, or null to specify the user logged onto the system. The user name is taken into account when enumerating devices. A device with user mappings is preferred to a device without any user mappings. By default, devices in use by other users are not enumerated for this user.
+
Address of a structure that specifies the action map for which suitable devices are enumerated.
+
Address of a callback function to be called once for each device enumerated. See DIEnumDevicesBySemanticsCallback.
+
Application-defined 32-bit value to pass to the enumeration callback each time it is called.
+
Flag value that specifies the scope of the enumeration. This parameter can be one or more of the following values.
DIEDBSFL_ATTACHEDONLY
Only attached and installed devices are enumerated.
DIEDBSFL_AVAILABLEDEVICES
Only unowned, installed devices are enumerated.
DIEDBSFL_FORCEFEEDBACK
Only devices that support force feedback are enumerated.
DIEDBSFL_MULTIMICEKEYBOARDS
Only secondary (non-system) keyboard and mouse devices.
DIEDBSFL_NONGAMINGDEVICES
Only HID-compliant devices whose primary purpose is not as a gaming device. Devices such as USB speakers and multimedia buttons on some keyboards would fall within this value.
DIEDBSFL_THISUSER
All installed devices for the user identified by ptszUserName, and all unowned devices, are enumerated.
DIEDBSFL_VALID
DIEDBSFL_VALID is also defined in Dinput.h, but is not used by applications.
+

If the method succeeds, the return value is . If the method fails, the return value can be one of the following error values: , .

+ +

The keyboard and mouse are enumerated last.

Note
The order in which devices are enumerated by DirectInput is not guaranteed.
+
+ + microsoft.directx_sdk.idirectinput8.idirectinput8.enumdevicesbysemantics + HRESULT IDirectInput8W::EnumDevicesBySemantics([In] const wchar_t* arg0,[In] DIACTIONFORMATW* arg1,[In] __function__stdcall* arg2,[In] void* arg3,[In] unsigned int arg4) + IDirectInput8W::EnumDevicesBySemantics +
+ + + No documentation. + + + IDirectInputEffect + IDirectInputEffect + + + + Initializes a new instance of the class. + + The device. + The GUID. + The parameters. + + + + Sends a hardware-specific command to the force-feedback driver. + + Driver-specific command number. Consult the driver documentation for a list of valid commands. + Buffer containing the data required to perform the operation. + Buffer in which the operation's output data is returned. + Number of bytes written to the output buffer + + Because each driver implements different escapes, it is the application's responsibility to ensure that it is sending the escape to the correct driver by comparing the value of the guidFFDriver member of the structure against the value the application is expecting. + + + + + Gets the characteristics of an effect. + + The current parameters of this effect. + + + + Sets the characteristics of an effect. + + The parameters of this effect. + A object describing the result of the operation. + + + + Begins playing an effect infinitely. If the effect is already playing, it is restarted from the beginning. If the effect has not been downloaded or has been modified since its last download, it is downloaded before being started. This default behavior can be suppressed by passing the flag. + + A object describing the result of the operation. + + + + Begins playing an effect infinitely. If the effect is already playing, it is restarted from the beginning. If the effect has not been downloaded or has been modified since its last download, it is downloaded before being started. This default behavior can be suppressed by passing the flag. + + Flags that describe how the effect should be played by the device. + A object describing the result of the operation. + + + + Begins playing an effect. If the effect is already playing, it is restarted from the beginning. If the effect has not been downloaded or has been modified since its last download, it is downloaded before being started. This default behavior can be suppressed by passing the flag. + + Number of times to play the effect in sequence. The envelope is re-articulated with each iteration. To play the effect exactly once, pass 1. To play the effect repeatedly until explicitly stopped, pass -1. To play the effect until explicitly stopped without re-articulating the envelope, modify the effect parameters with the method, and change the Duration member to -1. + A object describing the result of the operation. + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + No documentation. + + + GetEffectGuid + GetEffectGuid + HRESULT IDirectInputEffect::GetEffectGuid([Out] GUID* arg0) + + + + No documentation. + + + GetEffectStatus + GetEffectStatus + HRESULT IDirectInputEffect::GetEffectStatus([Out] DIEGES* arg0) + + + + No documentation. + + No documentation. + No documentation. + No documentation. + No documentation. + + HRESULT IDirectInputEffect::Initialize([In] HINSTANCE arg0,[In] unsigned int arg1,[In] const GUID& arg2) + IDirectInputEffect::Initialize + + + + No documentation. + + No documentation. + No documentation. + + HRESULT IDirectInputEffect::GetEffectGuid([Out] GUID* arg0) + IDirectInputEffect::GetEffectGuid + + + + No documentation. + + No documentation. + No documentation. + + HRESULT IDirectInputEffect::GetParameters([Out] DIEFFECT* arg0,[In] DIEP arg1) + IDirectInputEffect::GetParameters + + + + No documentation. + + No documentation. + No documentation. + No documentation. + + HRESULT IDirectInputEffect::SetParameters([In] const DIEFFECT* arg0,[In] DIEP arg1) + IDirectInputEffect::SetParameters + + + + No documentation. + + No documentation. + No documentation. + No documentation. + + HRESULT IDirectInputEffect::Start([In] unsigned int arg0,[In] DIES arg1) + IDirectInputEffect::Start + + + + No documentation. + + No documentation. + + HRESULT IDirectInputEffect::Stop() + IDirectInputEffect::Stop + + + + No documentation. + + No documentation. + No documentation. + + HRESULT IDirectInputEffect::GetEffectStatus([Out] DIEGES* arg0) + IDirectInputEffect::GetEffectStatus + + + + No documentation. + + No documentation. + + HRESULT IDirectInputEffect::Download() + IDirectInputEffect::Download + + + + No documentation. + + No documentation. + + HRESULT IDirectInputEffect::Unload() + IDirectInputEffect::Unload + + + + No documentation. + + No documentation. + No documentation. + + HRESULT IDirectInputEffect::Escape([In] DIEFFESCAPE* arg0) + IDirectInputEffect::Escape + + + + Describes data for a force-feedback effect stored in a file. It is used in conjunction with theIDirectInputDevice8::EnumEffectsInFileandIDirectInputDevice8::WriteEffectToFilemethods. + + + microsoft.directx_sdk.reference.difileeffect + DIFILEEFFECT + DIFILEEFFECT + + + + Initializes a new instance of the class. + + + + + Gets or sets the parameters. + + The parameters. + + + + No documentation. + + + microsoft.directx_sdk.reference.difileeffect + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + microsoft.directx_sdk.reference.difileeffect + GUID GuidEffect + GUID GuidEffect + + + + No documentation. + + + microsoft.directx_sdk.reference.difileeffect + const DIEFFECT* lpDiEffect + DIEFFECT lpDiEffect + + + + No documentation. + + + microsoft.directx_sdk.reference.difileeffect + char szFriendlyName[260] + char szFriendlyName + + + + Used by theIDirectInputDevice8::EnumEffectsandIDirectInputDevice8::GetEffectInfomethods to return information about a particular effect supported by a device. + + +

Use the DIDFT_GETTYPE macro to extract the effect type from the dwEffType flags.

+
+ + microsoft.directx_sdk.reference.dieffectinfo + DIEFFECTINFOW + DIEFFECTINFOW +
+ + + Initializes a new instance of the class. + + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffectinfo + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffectinfo + GUID guid + GUID guid + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffectinfo + DIEFT dwEffType + DIEFT dwEffType + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffectinfo + DIEP dwStaticParams + DIEP dwStaticParams + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffectinfo + DIEP dwDynamicParams + DIEP dwDynamicParams + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffectinfo + wchar_t tszName[260] + wchar_t tszName + + + + Used by theIDirectInputDevice8::CreateEffectmethod to initialize a newIDirectInputEffect Interfaceobject. It is also used by theIDirectInputEffect::SetParametersandIDirectInputEffect::GetParametersmethods. + + +
Note
The rglDirection array must contain cAxes entries, even if polar or spherical coordinates are given. In these cases, the last element in the rglDirection array is reserved and must be 0.
+
+ + microsoft.directx_sdk.reference.dieffect + DIEFFECT + DIEFFECT +
+ + + Initializes a new instance of the class. + + + + + Optional Envelope structure that describes the envelope to be used by this effect. Not all effect types use envelope. If no envelope is to be applied, the member should be set to null. + + + + + Gets or sets an array containing identifiers or offsets identifying the axes to which the effect is to be applied. + The flags and determine the semantics of the values in the array. + The list of axes associated with an effect cannot be changed once it has been set. + No more than 32 axes can be associated with a single effect. + + The axes. + + + + Gets or sets an array containing either Cartesian coordinates, polar coordinates, or spherical coordinates. + The flags , , and determine the semantics of the values in the array. + If Cartesian, each value in Directions is associated with the corresponding axis in Axes. + If polar, the angle is measured in hundredths of degrees from the (0, - 1) direction, rotated in the direction of (1, 0). This usually means that north is away from the user, and east is to the user's right. The last element is not used. + If spherical, the first angle is measured in hundredths of a degree from the (1, 0) direction, rotated in the direction of (0, 1). The second angle (if the number of axes is three or more) is measured in hundredths of a degree toward (0, 0, 1). The third angle (if the number of axes is four or more) is measured in hundredths of a degree toward (0, 0, 0, 1), and so on. The last element is not used. + + The directions. + + + + Gets the axes. See and . + + The axes. + The directions. + + + + Sets the axes. See and . + + The axes. + The directions. + + + + Gets or sets the type specific parameter. + Reference to a type-specific parameters, or null if there are no type-specific parameters. + If the effect is of type , this member contains an indirect reference to a ConditionSet structures that define the parameters for the condition. A single structure may be used, in which case the condition is applied in the direction specified in the Directions array. Otherwise, there must be one structure for each axis, in the same order as the axes in rgdwAxes array. If a structure is supplied for each axis, the effect should not be rotated; you should use the following values in the Directions array: : 0, 0, ... / : 9000, 0, ... / : 1, 0, ... + If the effect is of type , this member contains an indirect reference to a that defines the parameters for the custom force. + If the effect is of type , this member contains a pointer to a that defines the parameters for the effect. + If the effect is of type , this member contains a pointer to a that defines the parameters for the constant force. + If the effect is of type , this member contains a pointer to a that defines the parameters for the ramp force. + To gain access to the underlying structure, you need to call the method . + + The type specific parameter. + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffect + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffect + DIEFF dwFlags + DIEFF dwFlags + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffect + unsigned int dwDuration + unsigned int dwDuration + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffect + unsigned int dwSamplePeriod + unsigned int dwSamplePeriod + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffect + unsigned int dwGain + unsigned int dwGain + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffect + unsigned int dwTriggerButton + unsigned int dwTriggerButton + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffect + unsigned int dwTriggerRepeatInterval + unsigned int dwTriggerRepeatInterval + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffect + unsigned int cAxes + unsigned int cAxes + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffect + unsigned int* rgdwAxes + unsigned int rgdwAxes + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffect + int* rglDirection + int rglDirection + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffect + DIENVELOPE* lpEnvelope + DIENVELOPE lpEnvelope + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffect + unsigned int cbTypeSpecificParams + unsigned int cbTypeSpecificParams + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffect + void* lpvTypeSpecificParams + void lpvTypeSpecificParams + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffect + unsigned int dwStartDelay + unsigned int dwStartDelay + + + + Enumerator callback for DirectInput EnumCreatedEffects. + + + + + Initializes a new instance of the class. + + + + + Natives the pointer. + + + + + + Gets or sets the effects. + + The effects. + + + + Enumerator callback for DirectInput EnumDevices. + + + + + Initializes a new instance of the class. + + + + + Natives the pointer. + + + + + + Gets or sets the device instances. + + The device instances. + + + + Enumerator callback for DirectInput EnumEffects. + + + + + Initializes a new instance of the class. + + + + + Natives the pointer. + + + + + + Gets or sets the effect infos. + + The effect infos. + + + + Enumerator callback for DirectInput EnumEffectsInFile. + + + + + Initializes a new instance of the class. + + + + + Natives the pointer. + + + + + + Gets or sets the effects in file. + + The effects in file. + + + + Enumerator callback for DirectInput EnumObjects. + + + + + Initializes a new instance of the class. + + + + + Natives the pointer. + + + + + + Gets or sets the device object instances. + + The device object instances. + + + + Used by theDIEFFECTstructure to specify the optional envelope parameters for an effect. The sustain level for the envelope is represented by the dwMagnitude member of theDIPERIODICstructure and the lMagnitude member of theDICONSTANTFORCEstructure. The sustain time is represented by dwDuration member of theDIEFFECTstructure. + + + microsoft.directx_sdk.reference.dienvelope + DIENVELOPE + DIENVELOPE + + + + No documentation. + + + microsoft.directx_sdk.reference.dienvelope + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + microsoft.directx_sdk.reference.dienvelope + unsigned int dwAttackLevel + unsigned int dwAttackLevel + + + + No documentation. + + + microsoft.directx_sdk.reference.dienvelope + unsigned int dwAttackTime + unsigned int dwAttackTime + + + + No documentation. + + + microsoft.directx_sdk.reference.dienvelope + unsigned int dwFadeLevel + unsigned int dwFadeLevel + + + + No documentation. + + + microsoft.directx_sdk.reference.dienvelope + unsigned int dwFadeTime + unsigned int dwFadeTime + + + +Flags that specify the cooperative level to associate with the input device. This flag is used by method. + + ee416848 + DISCL + DISCL + + + +The application is requesting an exclusive access to the device. If the exclusive access is authorized, no other instance of the device can get an exclusive access to the device while it is acquired. Note that non-exclusive access to the input device is always authorized, even when another application has an exclusive access. In exclusive mode, an application that acquires the mouse or keyboard device must unacquire the input device when it receives a windows event message WM_ENTERSIZEMOVE or WM_ENTERMENULOOP. Otherwise, the user won't be able to access to the menu or move and resize the window. + + ee416848 + DISCL_EXCLUSIVE + DISCL_EXCLUSIVE + + + +The application is requesting a non-exclusive access to the device. There is no interference even if another application is using the same device. + + ee416848 + DISCL_NONEXCLUSIVE + DISCL_NONEXCLUSIVE + + + +The application is requesting a foreground access to the device. If the foreground access is authorized and the associated window moves to the background, the device is automatically unacquired. + + ee416848 + DISCL_FOREGROUND + DISCL_FOREGROUND + + + +The application is requesting a background access to the device. If background access is authorized, the device can be acquired even when the associated window is not the active window. + + ee416848 + DISCL_BACKGROUND + DISCL_BACKGROUND + + + +The application is requesting to disable the Windows logo key effect. When this flag is set, the user cannot perturbate the application. However, when the default action mapping UI is displayed, the Windows logo key is operating as long as that UI is opened. Consequently, this flag has no effect in this situation. + + ee416848 + DISCL_NOWINKEY + DISCL_NOWINKEY + + + +Flags describing other attributes of the . + + DIDF + DIDF + + + +The axes are specified in absolute mode. Specifying this flag in equals to manually setting the axis mode property, using the property on the . +xUsage of this flag is exclusive with flag. + + DIDF_ABSAXIS + DIDF_ABSAXIS + + + +The axes are specified in relative mode. Specifying this flag in equals to manually setting the axis mode property using the property on the . +Usage of this flag is exclusive with flag. + + DIDF_RELAXIS + DIDF_RELAXIS + + + +Device Axis mode. This flag is used by the property on the . + + DIPROPAXISMODE + DIPROPAXISMODE + + + +The axes are specified in absolute mode for the whole device. + + DIPROPAXISMODE_ABS + DIPROPAXISMODE_ABS + + + +The axes are specified in relative mode for the whole device. + + DIPROPAXISMODE_REL + DIPROPAXISMODE_REL + + + +Device class filter used by method. + + microsoft.directx_sdk.idirectinput8.idirectinput8.enumdevices + DI8DEVCLASS + DI8DEVCLASS + + + +All devices. + + microsoft.directx_sdk.idirectinput8.idirectinput8.enumdevices + DI8DEVCLASS_ALL + DI8DEVCLASS_ALL + + + +All devices that do not fall into another class. + + microsoft.directx_sdk.idirectinput8.idirectinput8.enumdevices + DI8DEVCLASS_DEVICE + DI8DEVCLASS_DEVICE + + + +All devices of type and . + + microsoft.directx_sdk.idirectinput8.idirectinput8.enumdevices + DI8DEVCLASS_POINTER + DI8DEVCLASS_POINTER + + + +All keyboards. Equivalent to . + + microsoft.directx_sdk.idirectinput8.idirectinput8.enumdevices + DI8DEVCLASS_KEYBOARD + DI8DEVCLASS_KEYBOARD + + + +All game controllers. + + microsoft.directx_sdk.idirectinput8.idirectinput8.enumdevices + DI8DEVCLASS_GAMECTRL + DI8DEVCLASS_GAMECTRL + + + +Flags that refine the scope of the enumeration used by +and methods. + + microsoft.directx_sdk.idirectinput8.idirectinput8.enumdevices + DIEDFL + DIEDFL + + + +All installed devices are enumerated. This is the default behavior. + + microsoft.directx_sdk.idirectinput8.idirectinput8.enumdevices + DIEDFL_ALLDEVICES + DIEDFL_ALLDEVICES + + + +Only attached and installed devices. + + microsoft.directx_sdk.idirectinput8.idirectinput8.enumdevices + DIEDFL_ATTACHEDONLY + DIEDFL_ATTACHEDONLY + + + +Only devices that support force feedback. + + microsoft.directx_sdk.idirectinput8.idirectinput8.enumdevices + DIEDFL_FORCEFEEDBACK + DIEDFL_FORCEFEEDBACK + + + +Include devices that are aliases for other devices. + + microsoft.directx_sdk.idirectinput8.idirectinput8.enumdevices + DIEDFL_INCLUDEALIASES + DIEDFL_INCLUDEALIASES + + + +Include hidden devices. For more information about hidden devices, see . + + microsoft.directx_sdk.idirectinput8.idirectinput8.enumdevices + DIEDFL_INCLUDEPHANTOMS + DIEDFL_INCLUDEPHANTOMS + + + +Include phantom (placeholder) devices. + + microsoft.directx_sdk.idirectinput8.idirectinput8.enumdevices + DIEDFL_INCLUDEHIDDEN + DIEDFL_INCLUDEHIDDEN + + + +Flags associated with the device. + + DIDC + DIDC + + + +The device is physically attached to the user's computer. + + DIDC_ATTACHED + DIDC_ATTACHED + + + +At least one object on the device is polled, rather than interrupt-driven. For these objects, the application must explicitly call the Interface method to obtain data. HID devices can contain a mixture of polled and nonpolled objects. + + DIDC_POLLEDDEVICE + DIDC_POLLEDDEVICE + + + +If this flag is set, the data is coming from a user mode device interface, such as a Human Interface Device (human interface device), or by some other ring 3 means. If it is not set, the data is coming directly from a kernel mode driver. + + DIDC_EMULATED + DIDC_EMULATED + + + +At least one object in the current data format is polled, rather than interrupt-driven. For these objects, the application must explicitly call the Interface method to obtain data. + + DIDC_POLLEDDATAFORMAT + DIDC_POLLEDDATAFORMAT + + + +The device supports force feedback. + + DIDC_FORCEFEEDBACK + DIDC_FORCEFEEDBACK + + + +The force-feedback system supports the attack parameter for at least one effect. +If the device does not support attack, the attack level and attack time members of the structure are ignored by the device. +After a call to the method, an individual effect sets the flag if attack is supported for that effect. + + DIDC_FFATTACK + DIDC_FFATTACK + + + +The force-feedback system supports the fade parameter for at least one effect. +If the device does not support fade, the fade level and fade time members of the structure are ignored by the device. +After a call to the method, an individual effect sets the flag if fade is supported for that effect. + + DIDC_FFFADE + DIDC_FFFADE + + + +The force-feedback system supports the saturation of condition effects for at least one condition. If the device does not support saturation, the force generated by a condition is limited only by the maximum force that the device can generate. +After a call to the method, an individual condition sets the flag if saturation is supported for that condition. + + DIDC_SATURATION + DIDC_SATURATION + + + +The force-feedback system supports two coefficient values for conditions (one for the positive displacement of the axis and one for the negative displacement of the axis) for at least one condition. If the device does not support both coefficients, the negative coefficient in the structure is ignored. +After a call to the method, an individual condition sets the flag if separate positive and negative coefficients are supported for that condition. + + DIDC_POSNEGCOEFFICIENTS + DIDC_POSNEGCOEFFICIENTS + + + +The force-feedback system supports a maximum saturation for both positive and negative force output for at least one condition. If the device does not support both saturation values, the negative saturation in the structure is ignored. +After a call to the IDirectInputDevice8::GetEffectInfo method, an individual condition sets the flag if separate positive and negative saturation are supported for that condition. + + DIDC_POSNEGSATURATION + DIDC_POSNEGSATURATION + + + +The device supports deadband for at least one force-feedback condition. + + DIDC_DEADBAND + DIDC_DEADBAND + + + +The force-feedback system supports the start delay parameter for at least one effect. If the device does not support start delays, the member of the structure is ignored. + + DIDC_STARTDELAY + DIDC_STARTDELAY + + + +The device is a alias to another DirectInput device. Alias devices are by default not returned by . + + DIDC_ALIAS + DIDC_ALIAS + + + +Placeholder. Phantom devices are by default not enumerated by . + + DIDC_PHANTOM + DIDC_PHANTOM + + + +Fictitious device created by a device driver so that it can generate keyboard and mouse events. Such devices are not normally returned by . + + DIDC_HIDDEN + DIDC_HIDDEN + + + + No documentation. + + + bb152032 + DIDFT_FLAGS + DIDFT_FLAGS + + + +All objects. + + bb152032 + DIDFT_ALL + DIDFT_ALL + + + +A relative axis. + + bb152032 + DIDFT_RELAXIS + DIDFT_RELAXIS + + + +An absolute axis. + + bb152032 + DIDFT_ABSAXIS + DIDFT_ABSAXIS + + + +An axis, either absolute or relative. + + bb152032 + DIDFT_AXIS + DIDFT_AXIS + + + +A push button. A push button is reported as down when the user presses it, and as up when the user releases it. + + bb152032 + DIDFT_PSHBUTTON + DIDFT_PSHBUTTON + + + +A toggle button. A toggle button is reported as down when the user presses it and remains so until the user presses the button a second time. + + bb152032 + DIDFT_TGLBUTTON + DIDFT_TGLBUTTON + + + +A push button or a toggle button. + + bb152032 + DIDFT_BUTTON + DIDFT_BUTTON + + + +A point-of-view controller. + + bb152032 + DIDFT_POV + DIDFT_POV + + + +A HID link collection. HID link collections do not generate data of their own. + + bb152032 + DIDFT_COLLECTION + DIDFT_COLLECTION + + + +An object that does not generate any data. + + bb152032 + DIDFT_NODATA + DIDFT_NODATA + + + +Any instance mask. + + bb152032 + DIDFT_ANYINSTANCE + DIDFT_ANYINSTANCE + + + +An object that contains a force-feedback actuator. In other words, forces can be applied to this object. + + bb152032 + DIDFT_FFACTUATOR + DIDFT_FFACTUATOR + + + +An object that can be used to trigger force-feedback effects. + + bb152032 + DIDFT_FFEFFECTTRIGGER + DIDFT_FFEFFECTTRIGGER + + + +An object that supports output. Not supported. + + bb152032 + DIDFT_OUTPUT + DIDFT_OUTPUT + + + +An object of a type defined by the manufacturer. + + bb152032 + DIDFT_VENDORDEFINED + DIDFT_VENDORDEFINED + + + +Controls identified by a Human Interface Device alias. This flag applies only to HID-compliant USB devices. + + bb152032 + DIDFT_ALIAS + DIDFT_ALIAS + + + +Specify that this type is optional. + + bb152032 + DIDFT_OPTIONAL + DIDFT_OPTIONAL + + + +

The DIJOYTYPEINFO structure contains information about a joystick type.

+
+ +

A "joystick type" describes how DirectInput should communicate with the device and how it should report device data. For example, "A Frobozz Industries SuperStick 5X is a three-axis, five-button joystick with the third axis reported as the first bit on the second port."

DirectInput comes with the following predefined joystick types, all with axes in their default locations:

  • Two-axis, two-button joystick.

  • Two-button game pad.

  • Two-button flight yoke.

  • Two-button flight yoke with throttle.

  • Three-axis, two-button joystick.

  • Three-axis, four-button joystick.

  • Four-button game pad.

  • Four-button flight yoke.

  • Four-button flight yoke with throttle.

If the joystick type has the JOY_HWS_ISGAMEPORTDRIVER flag set in the dwFlags member of the JOYHWSETTINGS structure, then the wszCallout member of the DIJOYTYPEINFO structure contains the name of a driver that can be used as a global driver. The joystick type should be shown on the list of global drivers and not shown on the list of joystick types that can be assigned.

New in DirectX 8.0

The dwFlags2 member was added to the DIJOYCONFIG structure. This member carries information that controls how DirectInput enumerates the device to applications. The dwFlags2 member carries device type and subtype override flags in the low word, and device enumeration "hiding" flags in the high word. The device type and subtype override flags control how DirectInput portrays your device to applications that use DirectInput. These are the same flags that applications receive from DirectInput during device enumeration. For example, if your device is described in its firmware as a telephony device, it would not normally be enumerated to games because telephony devices aren't considered relevant to games. However, if you used and DI8DEVTYPEDEVICECONTROL_COMMSSELECTION to describe this device, DirectInput overrides the data it retrieves from the firmware and enumerates the device to games.

The high word of dwFlags2 can be set to contain flags that scope how DirectInput enumerates the device to DirectInput applications. For example, some devices declare multiple top-level HID collections. Such a device might declare that it can act as a keyboard, a mouse, and a joystick all in one. Generally, one or more of these top-level collections is merely a phantom device, which shouldn't be enumerated to games. For this device, the high word of dwFlags2 could be set to a combination of the JOYTYPE_HIDEACTIVE, JOYTYPE_MOUSEHIDE, and JOYTYPE_KEYBHIDE flags. The JOYTYPE_HIDEACTIVE flag indicates that DirectInput should not enumerate the device by all its types. The JOYTYPE_MOUSEHIDE and JOYTYPE_KEYBHIDE flags also present in the high word indicate to DirectInput that enumeration of the phantom mouse and keyboard on the device should be suppressed. Note that applications can include the (described in the Microsoft Windows SDK documentation) flag to enumerate devices, even if they are hidden.

+
+ + ff538513 + DI8DEVTYPE + DI8DEVTYPE +
+ + +

Specifies the size of the structure in bytes. This member must be initialized before the structure is used.

+
+ + ff538513 + DI8DEVTYPE_DEVICE + DI8DEVTYPE_DEVICE +
+ + +

Joystick hardware settings.

+
+ + ff538513 + DI8DEVTYPE_MOUSE + DI8DEVTYPE_MOUSE +
+ + +

Specifies a CLSID for the joystick type configuration object. Pass this CLSID to CoCreateInstance to create a configuration object. This field is zero if the type does not have custom configuration.

+
+ + ff538513 + DI8DEVTYPE_KEYBOARD + DI8DEVTYPE_KEYBOARD +
+ + +

The display name for the joystick type. The display name is the name that should be used to display the name of the joystick type to the end user.

+
+ + ff538513 + DI8DEVTYPE_JOYSTICK + DI8DEVTYPE_JOYSTICK +
+ + +

The device responsible for handling polling for devices of this type. This is a null string if the global polling callout is to be used.

+
+ + ff538513 + DI8DEVTYPE_GAMEPAD + DI8DEVTYPE_GAMEPAD +
+ + +

The hardware ID for the joystick type. The hardware ID is used by Plug and Play on Windows 2000 and Windows 98 (DirectX 7.0 only) to find the drivers for the joystick.

+
+ + ff538513 + DI8DEVTYPE_DRIVING + DI8DEVTYPE_DRIVING +
+ + +

Joystick type flags. This member can be set to a combination of the following flags.

JOYTYPE_ZEROGAMEENUMOEMDATA

Zero GameEnum's OEM data field.

JOYTYPE_NOAUTODETECTGAMEPORT

Device does not support Autodetect gameport.

JOYTYPE_NOHIDDIRECT

Do not use HID directly for this device. (Windows 98 only.)

JOYTYPE_DEFAULTPROPSHEET

CPL overrides custom property sheet.

+
+ + ff538513 + DI8DEVTYPE_FLIGHT + DI8DEVTYPE_FLIGHT +
+ + +First-person action game device. The following subtypes are defined. + + ff538513 + DI8DEVTYPE_1STPERSON + DI8DEVTYPE_1STPERSON + + + + No documentation. + + + ff538513 + DI8DEVTYPE_DEVICECTRL + DI8DEVTYPE_DEVICECTRL + + + + No documentation. + + + ff538513 + DI8DEVTYPE_SCREENPOINTER + DI8DEVTYPE_SCREENPOINTER + + + + No documentation. + + + ff538513 + DI8DEVTYPE_REMOTE + DI8DEVTYPE_REMOTE + + + + No documentation. + + + ff538513 + DI8DEVTYPE_SUPPLEMENTAL + DI8DEVTYPE_SUPPLEMENTAL + + + +

To load effects, call the method. By default, the enumeration is limited to the standard Microsoft DirectInput effects, but you can enumerate other effects by setting the flag. By setting the flag, you can also instruct DirectInput to modify the parameters of effects, if necessary, so that they work on the device. (For example, an effect authored for two axes can be made to work on a single-axis steering wheel.)

In the following code example, the first three standard effects are loaded from a file and created as DirectInputEffect objects.

 // g_lpdid is a valid  reference to a 	
+            // force feedback device. 	
+            // The array of effect references is declared globally. 	
+            LPDIRECTINPUTEFFECT pEff[3];	
+            .	
+            .	
+            .	
+            g_lpdid->EnumEffectsInFile("FEdit1.ffe",  EnumEffectsInFileProc, null,  );	
+            .	
+            .	
+            .	
+            

The following callback function is called once for each effect in the file or until it returns DIENUM_STOP. Note that because the flag was passed, the effect parameters may have been modified in lpdife->lpDiEffect. The callback creates the effect with these modified parameters.

  CALLBACK EnumEffectsInFileProc(LPCDIFILEEFFECT lpdife,  LPVOID pvRef) {      hr; static int  i; hr = g_lpdid->CreateEffect(lpdife->GuidEffect,  lpdife->lpDiEffect, &pEff[i],  null); if (FAILED(hr)) { // Error handling } if (++i > 2) return DIENUM_STOP; else return DIENUM_CONTINUE;	
+            }	
+            
+
+ + ee418645 + DIFEF + DIFEF +
+ + + No documentation. + + + ee418645 + DIFEF_DEFAULT + DIFEF_DEFAULT + + + + No documentation. + + + ee418645 + DIFEF_INCLUDENONSTANDARD + DIFEF_INCLUDENONSTANDARD + + + + No documentation. + + + ee418645 + DIFEF_MODIFYIFNEEDED + DIFEF_MODIFYIFNEEDED + + + + Used by theIDirectInputDevice8::CreateEffectmethod to initialize a newIDirectInputEffect Interfaceobject. It is also used by theIDirectInputEffect::SetParametersandIDirectInputEffect::GetParametersmethods. + + +
Note
The rglDirection array must contain cAxes entries, even if polar or spherical coordinates are given. In these cases, the last element in the rglDirection array is reserved and must be 0.
+
+ + microsoft.directx_sdk.reference.dieffect + DIEFF + DIEFF +
+ + + No documentation. + + + microsoft.directx_sdk.reference.dieffect + DIEFF_OBJECTIDS + DIEFF_OBJECTIDS + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffect + DIEFF_OBJECTOFFSETS + DIEFF_OBJECTOFFSETS + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffect + DIEFF_CARTESIAN + DIEFF_CARTESIAN + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffect + DIEFF_POLAR + DIEFF_POLAR + + + + No documentation. + + + microsoft.directx_sdk.reference.dieffect + DIEFF_SPHERICAL + DIEFF_SPHERICAL + + + + None. + + + None + None + + + +

You can modify the basic magnitude of some effects by applying an envelope and an offset. For an overview, see Basic Concepts of Force Feedback.

To apply an envelope when creating or modifying an effect, initialize a structure and put a reference to it in the lpEnvelope member of the structure.

The device driver determines which effects support envelopes. Typically, you can apply an envelope to a constant force, a ramp force, or a periodic effect, but not to a condition. To determine whether a particular effect supports an envelope, call the method and check for the flag in the dwStaticParams member of the DIEffectInfo structure.

To apply an offset, set the lOffset member of the or structure pointed to by the lpvTypeSpecificParams member of the structure. For periodic effects, the absolute value of the offset plus the magnitude of the effect must not exceed DI_FFNOMINALMAX.

You cannot apply an offset to a constant force or ramp force. In these cases, you can achieve the same effect by altering the magnitude.

+
+ + ee417546 + DIEP + DIEP +
+ + + No documentation. + + + ee417546 + DIEP_DURATION + DIEP_DURATION + + + + No documentation. + + + ee417546 + DIEP_SAMPLEPERIOD + DIEP_SAMPLEPERIOD + + + + No documentation. + + + ee417546 + DIEP_GAIN + DIEP_GAIN + + + + No documentation. + + + ee417546 + DIEP_TRIGGERBUTTON + DIEP_TRIGGERBUTTON + + + + No documentation. + + + ee417546 + DIEP_TRIGGERREPEATINTERVAL + DIEP_TRIGGERREPEATINTERVAL + + + + No documentation. + + + ee417546 + DIEP_AXES + DIEP_AXES + + + + No documentation. + + + ee417546 + DIEP_DIRECTION + DIEP_DIRECTION + + + + No documentation. + + + ee417546 + DIEP_ENVELOPE + DIEP_ENVELOPE + + + + No documentation. + + + ee417546 + DIEP_TYPESPECIFICPARAMS + DIEP_TYPESPECIFICPARAMS + + + + No documentation. + + + ee417546 + DIEP_STARTDELAY + DIEP_STARTDELAY + + + + No documentation. + + + ee417546 + DIEP_ALLPARAMS_DX5 + DIEP_ALLPARAMS_DX5 + + + + No documentation. + + + ee417546 + DIEP_ALLPARAMS + DIEP_ALLPARAMS + + + + No documentation. + + + ee417546 + DIEP_START + DIEP_START + + + + No documentation. + + + ee417546 + DIEP_NORESTART + DIEP_NORESTART + + + + No documentation. + + + ee417546 + DIEP_NODOWNLOAD + DIEP_NODOWNLOAD + + + + None. + + + None + None + + + + No documentation. + + + DIES + DIES + + + + No documentation. + + + DIES_SOLO + DIES_SOLO + + + + No documentation. + + + DIES_NODOWNLOAD + DIES_NODOWNLOAD + + + + None. + + + None + None + + + + Retrieves the status of an effect. + + + microsoft.directx_sdk.idirectinputeffect.idirectinputeffect.geteffectstatus + DIEGES + DIEGES + + + +
Status flags for the effect. The value can be 0 or one or more of the following constants:
The effect is playing.
The effect is emulated.
+
+ + microsoft.directx_sdk.idirectinputeffect.idirectinputeffect.geteffectstatus + DIEGES_PLAYING + DIEGES_PLAYING +
+ + + No documentation. + + + microsoft.directx_sdk.idirectinputeffect.idirectinputeffect.geteffectstatus + DIEGES_EMULATED + DIEGES_EMULATED + + + + None. + + + None + None + + + + No documentation. + + + ff542434 + DIEFT + DIEFT + + + + No documentation. + + + ff542434 + DIEFT_ALL + DIEFT_ALL + + + + No documentation. + + + ff542434 + DIEFT_CONSTANTFORCE + DIEFT_CONSTANTFORCE + + + + No documentation. + + + ff542434 + DIEFT_RAMPFORCE + DIEFT_RAMPFORCE + + + + No documentation. + + + ff542434 + DIEFT_PERIODIC + DIEFT_PERIODIC + + + + No documentation. + + + ff542434 + DIEFT_CONDITION + DIEFT_CONDITION + + + + No documentation. + + + ff542434 + DIEFT_CUSTOMFORCE + DIEFT_CUSTOMFORCE + + + + No documentation. + + + ff542434 + DIEFT_HARDWARE + DIEFT_HARDWARE + + + + No documentation. + + + ff542434 + DIEFT_FFATTACK + DIEFT_FFATTACK + + + + No documentation. + + + ff542434 + DIEFT_FFFADE + DIEFT_FFFADE + + + + No documentation. + + + ff542434 + DIEFT_SATURATION + DIEFT_SATURATION + + + + No documentation. + + + ff542434 + DIEFT_POSNEGCOEFFICIENTS + DIEFT_POSNEGCOEFFICIENTS + + + + No documentation. + + + ff542434 + DIEFT_POSNEGSATURATION + DIEFT_POSNEGSATURATION + + + + No documentation. + + + ff542434 + DIEFT_DEADBAND + DIEFT_DEADBAND + + + + No documentation. + + + ff542434 + DIEFT_STARTDELAY + DIEFT_STARTDELAY + + + + None. + + + None + None + + + + Sends a command to the device's force-feedback system. The device must be acquired at the exclusive cooperative level for this method to succeed. + This flag is used by method. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.sendforcefeedbackcommand + DISFFC + DISFFC + + + + Paused playback of all active effects is to be continued. It is an error to send this command when the device is not in a paused state. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.sendforcefeedbackcommand + DISFFC_RESET + DISFFC_RESET + + + + Paused playback of all active effects is to be continued. It is an error to send this command when the device is not in a paused state. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.sendforcefeedbackcommand + DISFFC_STOPALL + DISFFC_STOPALL + + + + Paused playback of all active effects is to be continued. It is an error to send this command when the device is not in a paused state. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.sendforcefeedbackcommand + DISFFC_PAUSE + DISFFC_PAUSE + + + + Paused playback of all active effects is to be continued. It is an error to send this command when the device is not in a paused state. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.sendforcefeedbackcommand + DISFFC_CONTINUE + DISFFC_CONTINUE + + + + Paused playback of all active effects is to be continued. It is an error to send this command when the device is not in a paused state. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.sendforcefeedbackcommand + DISFFC_SETACTUATORSON + DISFFC_SETACTUATORSON + + + + Paused playback of all active effects is to be continued. It is an error to send this command when the device is not in a paused state. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.sendforcefeedbackcommand + DISFFC_SETACTUATORSOFF + DISFFC_SETACTUATORSOFF + + + + Retrieves the state of the device's force-feedback system. The device must be acquired at the exclusive cooperative level for this method to succeed. + The method can return any valid combination of these flags. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getforcefeedbackstate + DIGFFS + DIGFFS + + + + The device has no downloaded effects. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getforcefeedbackstate + DIGFFS_EMPTY + DIGFFS_EMPTY + + + + No effects are playing, and the device is not paused. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getforcefeedbackstate + DIGFFS_STOPPED + DIGFFS_STOPPED + + + + Playback of all active effects has been paused. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getforcefeedbackstate + DIGFFS_PAUSED + DIGFFS_PAUSED + + + + The device's force-feedback actuators are enabled. If the device cannot report the actuator state, neither nor is returned. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getforcefeedbackstate + DIGFFS_ACTUATORSON + DIGFFS_ACTUATORSON + + + + The device's force-feedback actuators are disabled. If the device cannot report the actuator state, neither nor is returned. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getforcefeedbackstate + DIGFFS_ACTUATORSOFF + DIGFFS_ACTUATORSOFF + + + + Power to the force-feedback system is currently available. If the device cannot report the power state, neither nor is returned. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getforcefeedbackstate + DIGFFS_POWERON + DIGFFS_POWERON + + + + The force-feedback system is not currently available. If the device cannot report the power state, neither nor is returned. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getforcefeedbackstate + DIGFFS_POWEROFF + DIGFFS_POWEROFF + + + + The safety switch is currently on; that is, the device can operate. If the device cannot report the state of the safety switch, neither nor is returned. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getforcefeedbackstate + DIGFFS_SAFETYSWITCHON + DIGFFS_SAFETYSWITCHON + + + + The safety switch is currently off; that is, the device cannot operate. If the device cannot report the state of the safety switch, neither nor is returned. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getforcefeedbackstate + DIGFFS_SAFETYSWITCHOFF + DIGFFS_SAFETYSWITCHOFF + + + + The user force-feedback switch is currently off; that is, the device cannot operate. If the device cannot report the state of the user force-feedback switch, neither + nor is returned. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getforcefeedbackstate + DIGFFS_USERFFSWITCHON + DIGFFS_USERFFSWITCHON + + + + The user force-feedback switch is currently off; that is, the device cannot operate. If the device cannot report the state of the user force-feedback switch, neither + nor is returned. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getforcefeedbackstate + DIGFFS_USERFFSWITCHOFF + DIGFFS_USERFFSWITCHOFF + + + + The device suffered an unexpected failure and is in an indeterminate state. It must be reset either by unacquiring and reacquiring the device, or by sending a command. + + microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getforcefeedbackstate + DIGFFS_DEVICELOST + DIGFFS_DEVICELOST + + + + Carries information required to display a device image or an overlay image with a callout. This structure is passed to theIDirectInputDevice8::GetImageInfomethod as an array within aDIDEVICEIMAGEINFOHEADERstructure. + + + microsoft.directx_sdk.reference.dideviceimageinfo + DIDIFT + DIDIFT + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfo + DIDIFT_CONFIGURATION + DIDIFT_CONFIGURATION + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfo + DIDIFT_OVERLAY + DIDIFT_OVERLAY + + + +

Joystick device constants represent offsets within a joystick device's data packet, the DIJOYSTATE structure. The data at a given offset is associated with a device object; that is, a button or axis. Typically, these values are used in the dwOfs member of the , DIOBJECTDATAFORMAT or structures. +

The following macros return a constant indicating the offset of the data for a particular button or axis relative to the beginning of the DIJOYSTATE structure. +

+
+ + ee418634 + DIJOFS + DIJOFS +
+ + + No documentation. + + + ee418634 + DIJOFS_X + DIJOFS_X + + + + No documentation. + + + ee418634 + DIJOFS_Y + DIJOFS_Y + + + + No documentation. + + + ee418634 + DIJOFS_Z + DIJOFS_Z + + + + No documentation. + + + ee418634 + DIJOFS_RX + DIJOFS_RX + + + + No documentation. + + + ee418634 + DIJOFS_RY + DIJOFS_RY + + + + No documentation. + + + ee418634 + DIJOFS_RZ + DIJOFS_RZ + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON0 + DIJOFS_BUTTON0 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON1 + DIJOFS_BUTTON1 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON2 + DIJOFS_BUTTON2 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON3 + DIJOFS_BUTTON3 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON4 + DIJOFS_BUTTON4 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON5 + DIJOFS_BUTTON5 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON6 + DIJOFS_BUTTON6 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON7 + DIJOFS_BUTTON7 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON8 + DIJOFS_BUTTON8 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON9 + DIJOFS_BUTTON9 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON10 + DIJOFS_BUTTON10 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON11 + DIJOFS_BUTTON11 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON12 + DIJOFS_BUTTON12 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON13 + DIJOFS_BUTTON13 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON14 + DIJOFS_BUTTON14 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON15 + DIJOFS_BUTTON15 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON16 + DIJOFS_BUTTON16 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON17 + DIJOFS_BUTTON17 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON18 + DIJOFS_BUTTON18 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON19 + DIJOFS_BUTTON19 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON20 + DIJOFS_BUTTON20 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON21 + DIJOFS_BUTTON21 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON22 + DIJOFS_BUTTON22 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON23 + DIJOFS_BUTTON23 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON24 + DIJOFS_BUTTON24 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON25 + DIJOFS_BUTTON25 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON26 + DIJOFS_BUTTON26 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON27 + DIJOFS_BUTTON27 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON28 + DIJOFS_BUTTON28 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON29 + DIJOFS_BUTTON29 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON30 + DIJOFS_BUTTON30 + + + + No documentation. + + + ee418634 + DIJOFS_BUTTON31 + DIJOFS_BUTTON31 + + + + No documentation. + + + ee418634 + DIJOFS_SLIDER0 + DIJOFS_SLIDER0 + + + + No documentation. + + + ee418634 + DIJOFS_SLIDER1 + DIJOFS_SLIDER1 + + + + No documentation. + + + ee418634 + DIJOFS_POINT_OF_VIEW0 + DIJOFS_POINT_OF_VIEW0 + + + + No documentation. + + + ee418634 + DIJOFS_POINT_OF_VIEW1 + DIJOFS_POINT_OF_VIEW1 + + + + No documentation. + + + ee418634 + DIJOFS_POINT_OF_VIEW2 + DIJOFS_POINT_OF_VIEW2 + + + + No documentation. + + + ee418634 + DIJOFS_POINT_OF_VIEW3 + DIJOFS_POINT_OF_VIEW3 + + + + Keyboard device constants, defined in Dinput.h, represent offsets within a keyboard device's data packet, a 256-byte array. + + +

The following alternate names are available:

Alternate name Regular name Note
DIK_BACKSPACE BACKSPACE
DIK_CAPSLOCK CAPS LOCK
DIK_CIRCUMFLEX On Japanese keyboard
DIK_DOWNARROW On arrow keypad
DIK_LALT Left ALT
DIK_LEFTARROW On arrow keypad
DIK_NUMPADMINUS DIK__SUBTRACT MINUS SIGN (-) on numeric keypad
DIK_NUMPADPERIOD PERIOD (decimal point) on numeric keypad
DIK_NUMPADPLUS PLUS SIGN (+) on numeric keypad
DIK_NUMPADSLASH DIK__DIVIDE Forward slash (/) on numeric keypad
DIK_NUMPADSTAR Asterisk (*) on numeric keypad
DIK_PGDN On arrow keypad
DIK_PGUP On arrow keypad
DIK_RALT Right ALT
DIK_RIGHTARROW On arrow keypad
DIK_UPARROW On arrow keypad

For information about Japanese keyboards, see DirectInput and Japanese Keyboards.

The data at a given offset is associated with a keyboard key. Typically, these values are used in the dwOfs member of the , DIOBJECTDATAFORMAT or structures, or as indices when accessing data within the array using array notation.

+
+ + ee418641 + DIK + DIK +
+ + + No documentation. + + + ee418641 + DIK_ESCAPE + DIK_ESCAPE + + + + No documentation. + + + ee418641 + DIK_1 + DIK_1 + + + + No documentation. + + + ee418641 + DIK_2 + DIK_2 + + + + No documentation. + + + ee418641 + DIK_3 + DIK_3 + + + + No documentation. + + + ee418641 + DIK_4 + DIK_4 + + + + No documentation. + + + ee418641 + DIK_5 + DIK_5 + + + + No documentation. + + + ee418641 + DIK_6 + DIK_6 + + + + No documentation. + + + ee418641 + DIK_7 + DIK_7 + + + + No documentation. + + + ee418641 + DIK_8 + DIK_8 + + + + No documentation. + + + ee418641 + DIK_9 + DIK_9 + + + + No documentation. + + + ee418641 + DIK_0 + DIK_0 + + + + No documentation. + + + ee418641 + DIK_MINUS + DIK_MINUS + + + + No documentation. + + + ee418641 + DIK_EQUALS + DIK_EQUALS + + + + No documentation. + + + ee418641 + DIK_BACK + DIK_BACK + + + + No documentation. + + + ee418641 + DIK_TAB + DIK_TAB + + + + No documentation. + + + ee418641 + DIK_Q + DIK_Q + + + + No documentation. + + + ee418641 + DIK_W + DIK_W + + + + No documentation. + + + ee418641 + DIK_E + DIK_E + + + + No documentation. + + + ee418641 + DIK_R + DIK_R + + + + No documentation. + + + ee418641 + DIK_T + DIK_T + + + + No documentation. + + + ee418641 + DIK_Y + DIK_Y + + + + No documentation. + + + ee418641 + DIK_U + DIK_U + + + + No documentation. + + + ee418641 + DIK_I + DIK_I + + + + No documentation. + + + ee418641 + DIK_O + DIK_O + + + + No documentation. + + + ee418641 + DIK_P + DIK_P + + + + No documentation. + + + ee418641 + DIK_LBRACKET + DIK_LBRACKET + + + + No documentation. + + + ee418641 + DIK_RBRACKET + DIK_RBRACKET + + + + No documentation. + + + ee418641 + DIK_RETURN + DIK_RETURN + + + + No documentation. + + + ee418641 + DIK_LCONTROL + DIK_LCONTROL + + + + No documentation. + + + ee418641 + DIK_A + DIK_A + + + + No documentation. + + + ee418641 + DIK_S + DIK_S + + + + No documentation. + + + ee418641 + DIK_D + DIK_D + + + + No documentation. + + + ee418641 + DIK_F + DIK_F + + + + No documentation. + + + ee418641 + DIK_G + DIK_G + + + + No documentation. + + + ee418641 + DIK_H + DIK_H + + + + No documentation. + + + ee418641 + DIK_J + DIK_J + + + + No documentation. + + + ee418641 + DIK_K + DIK_K + + + + No documentation. + + + ee418641 + DIK_L + DIK_L + + + + No documentation. + + + ee418641 + DIK_SEMICOLON + DIK_SEMICOLON + + + + No documentation. + + + ee418641 + DIK_APOSTROPHE + DIK_APOSTROPHE + + + + No documentation. + + + ee418641 + DIK_GRAVE + DIK_GRAVE + + + + No documentation. + + + ee418641 + DIK_LSHIFT + DIK_LSHIFT + + + + No documentation. + + + ee418641 + DIK_BACKSLASH + DIK_BACKSLASH + + + + No documentation. + + + ee418641 + DIK_Z + DIK_Z + + + + No documentation. + + + ee418641 + DIK_X + DIK_X + + + + No documentation. + + + ee418641 + DIK_C + DIK_C + + + + No documentation. + + + ee418641 + DIK_V + DIK_V + + + + No documentation. + + + ee418641 + DIK_B + DIK_B + + + + No documentation. + + + ee418641 + DIK_N + DIK_N + + + + No documentation. + + + ee418641 + DIK_M + DIK_M + + + + No documentation. + + + ee418641 + DIK_COMMA + DIK_COMMA + + + + No documentation. + + + ee418641 + DIK_PERIOD + DIK_PERIOD + + + + No documentation. + + + ee418641 + DIK_SLASH + DIK_SLASH + + + + No documentation. + + + ee418641 + DIK_RSHIFT + DIK_RSHIFT + + + + No documentation. + + + ee418641 + DIK_MULTIPLY + DIK_MULTIPLY + + + + No documentation. + + + ee418641 + DIK_LMENU + DIK_LMENU + + + + No documentation. + + + ee418641 + DIK_SPACE + DIK_SPACE + + + + No documentation. + + + ee418641 + DIK_CAPITAL + DIK_CAPITAL + + + + No documentation. + + + ee418641 + DIK_F1 + DIK_F1 + + + + No documentation. + + + ee418641 + DIK_F2 + DIK_F2 + + + + No documentation. + + + ee418641 + DIK_F3 + DIK_F3 + + + + No documentation. + + + ee418641 + DIK_F4 + DIK_F4 + + + + No documentation. + + + ee418641 + DIK_F5 + DIK_F5 + + + + No documentation. + + + ee418641 + DIK_F6 + DIK_F6 + + + + No documentation. + + + ee418641 + DIK_F7 + DIK_F7 + + + + No documentation. + + + ee418641 + DIK_F8 + DIK_F8 + + + + No documentation. + + + ee418641 + DIK_F9 + DIK_F9 + + + + No documentation. + + + ee418641 + DIK_F10 + DIK_F10 + + + + No documentation. + + + ee418641 + DIK_NUMLOCK + DIK_NUMLOCK + + + + No documentation. + + + ee418641 + DIK_SCROLL + DIK_SCROLL + + + + No documentation. + + + ee418641 + DIK_NUMPAD7 + DIK_NUMPAD7 + + + + No documentation. + + + ee418641 + DIK_NUMPAD8 + DIK_NUMPAD8 + + + + No documentation. + + + ee418641 + DIK_NUMPAD9 + DIK_NUMPAD9 + + + + No documentation. + + + ee418641 + DIK_SUBTRACT + DIK_SUBTRACT + + + + No documentation. + + + ee418641 + DIK_NUMPAD4 + DIK_NUMPAD4 + + + + No documentation. + + + ee418641 + DIK_NUMPAD5 + DIK_NUMPAD5 + + + + No documentation. + + + ee418641 + DIK_NUMPAD6 + DIK_NUMPAD6 + + + + No documentation. + + + ee418641 + DIK_ADD + DIK_ADD + + + + No documentation. + + + ee418641 + DIK_NUMPAD1 + DIK_NUMPAD1 + + + + No documentation. + + + ee418641 + DIK_NUMPAD2 + DIK_NUMPAD2 + + + + No documentation. + + + ee418641 + DIK_NUMPAD3 + DIK_NUMPAD3 + + + + No documentation. + + + ee418641 + DIK_NUMPAD0 + DIK_NUMPAD0 + + + + No documentation. + + + ee418641 + DIK_DECIMAL + DIK_DECIMAL + + + + No documentation. + + + ee418641 + DIK_OEM_102 + DIK_OEM_102 + + + + No documentation. + + + ee418641 + DIK_F11 + DIK_F11 + + + + No documentation. + + + ee418641 + DIK_F12 + DIK_F12 + + + + No documentation. + + + ee418641 + DIK_F13 + DIK_F13 + + + + No documentation. + + + ee418641 + DIK_F14 + DIK_F14 + + + + No documentation. + + + ee418641 + DIK_F15 + DIK_F15 + + + + No documentation. + + + ee418641 + DIK_KANA + DIK_KANA + + + + No documentation. + + + ee418641 + DIK_ABNT_C1 + DIK_ABNT_C1 + + + + No documentation. + + + ee418641 + DIK_CONVERT + DIK_CONVERT + + + + No documentation. + + + ee418641 + DIK_NOCONVERT + DIK_NOCONVERT + + + + No documentation. + + + ee418641 + DIK_YEN + DIK_YEN + + + + No documentation. + + + ee418641 + DIK_ABNT_C2 + DIK_ABNT_C2 + + + + No documentation. + + + ee418641 + DIK_NUMPADEQUALS + DIK_NUMPADEQUALS + + + + No documentation. + + + ee418641 + DIK_PREVTRACK + DIK_PREVTRACK + + + + No documentation. + + + ee418641 + DIK_AT + DIK_AT + + + + No documentation. + + + ee418641 + DIK_COLON + DIK_COLON + + + + No documentation. + + + ee418641 + DIK_UNDERLINE + DIK_UNDERLINE + + + + No documentation. + + + ee418641 + DIK_KANJI + DIK_KANJI + + + + No documentation. + + + ee418641 + DIK_STOP + DIK_STOP + + + + No documentation. + + + ee418641 + DIK_AX + DIK_AX + + + + No documentation. + + + ee418641 + DIK_UNLABELED + DIK_UNLABELED + + + + No documentation. + + + ee418641 + DIK_NEXTTRACK + DIK_NEXTTRACK + + + + No documentation. + + + ee418641 + DIK_NUMPADENTER + DIK_NUMPADENTER + + + + No documentation. + + + ee418641 + DIK_RCONTROL + DIK_RCONTROL + + + + No documentation. + + + ee418641 + DIK_MUTE + DIK_MUTE + + + + No documentation. + + + ee418641 + DIK_CALCULATOR + DIK_CALCULATOR + + + + No documentation. + + + ee418641 + DIK_PLAYPAUSE + DIK_PLAYPAUSE + + + + No documentation. + + + ee418641 + DIK_MEDIASTOP + DIK_MEDIASTOP + + + + No documentation. + + + ee418641 + DIK_VOLUMEDOWN + DIK_VOLUMEDOWN + + + + No documentation. + + + ee418641 + DIK_VOLUMEUP + DIK_VOLUMEUP + + + + No documentation. + + + ee418641 + DIK_WEBHOME + DIK_WEBHOME + + + + No documentation. + + + ee418641 + DIK_NUMPADCOMMA + DIK_NUMPADCOMMA + + + + No documentation. + + + ee418641 + DIK_DIVIDE + DIK_DIVIDE + + + + No documentation. + + + ee418641 + DIK_SYSRQ + DIK_SYSRQ + + + + No documentation. + + + ee418641 + DIK_RMENU + DIK_RMENU + + + + No documentation. + + + ee418641 + DIK_PAUSE + DIK_PAUSE + + + + No documentation. + + + ee418641 + DIK_HOME + DIK_HOME + + + + No documentation. + + + ee418641 + DIK_UP + DIK_UP + + + + No documentation. + + + ee418641 + DIK_PRIOR + DIK_PRIOR + + + + No documentation. + + + ee418641 + DIK_LEFT + DIK_LEFT + + + + No documentation. + + + ee418641 + DIK_RIGHT + DIK_RIGHT + + + + No documentation. + + + ee418641 + DIK_END + DIK_END + + + + No documentation. + + + ee418641 + DIK_DOWN + DIK_DOWN + + + + No documentation. + + + ee418641 + DIK_NEXT + DIK_NEXT + + + + No documentation. + + + ee418641 + DIK_INSERT + DIK_INSERT + + + + No documentation. + + + ee418641 + DIK_DELETE + DIK_DELETE + + + + No documentation. + + + ee418641 + DIK_LWIN + DIK_LWIN + + + + No documentation. + + + ee418641 + DIK_RWIN + DIK_RWIN + + + + No documentation. + + + ee418641 + DIK_APPS + DIK_APPS + + + + No documentation. + + + ee418641 + DIK_POWER + DIK_POWER + + + + No documentation. + + + ee418641 + DIK_SLEEP + DIK_SLEEP + + + + No documentation. + + + ee418641 + DIK_WAKE + DIK_WAKE + + + + No documentation. + + + ee418641 + DIK_WEBSEARCH + DIK_WEBSEARCH + + + + No documentation. + + + ee418641 + DIK_WEBFAVORITES + DIK_WEBFAVORITES + + + + No documentation. + + + ee418641 + DIK_WEBREFRESH + DIK_WEBREFRESH + + + + No documentation. + + + ee418641 + DIK_WEBSTOP + DIK_WEBSTOP + + + + No documentation. + + + ee418641 + DIK_WEBFORWARD + DIK_WEBFORWARD + + + + No documentation. + + + ee418641 + DIK_WEBBACK + DIK_WEBBACK + + + + No documentation. + + + ee418641 + DIK_MYCOMPUTER + DIK_MYCOMPUTER + + + + No documentation. + + + ee418641 + DIK_MAIL + DIK_MAIL + + + + No documentation. + + + ee418641 + DIK_MEDIASELECT + DIK_MEDIASELECT + + + + No documentation. + + + ee418641 + DIK_UNKNOWN + DIK_UNKNOWN + + + + Mouse device constants, defined in Dinput.h, represent offsets within a mouse device's data packet, theDIMOUSESTATEorDIMOUSESTATE2structure. + + +

The data at a given offset is associated with a device object (button or axis). Typically, these values are used in the dwOfs member of the , DIOBJECTDATAFORMAT or structures.

+
+ + ee418674 + DIMOFS + DIMOFS +
+ + + No documentation. + + + ee418674 + DIMOFS_X + DIMOFS_X + + + + No documentation. + + + ee418674 + DIMOFS_Y + DIMOFS_Y + + + + No documentation. + + + ee418674 + DIMOFS_Z + DIMOFS_Z + + + + No documentation. + + + ee418674 + DIMOFS_BUTTON0 + DIMOFS_BUTTON0 + + + + No documentation. + + + ee418674 + DIMOFS_BUTTON1 + DIMOFS_BUTTON1 + + + + No documentation. + + + ee418674 + DIMOFS_BUTTON2 + DIMOFS_BUTTON2 + + + + No documentation. + + + ee418674 + DIMOFS_BUTTON3 + DIMOFS_BUTTON3 + + + + No documentation. + + + ee418674 + DIMOFS_BUTTON4 + DIMOFS_BUTTON4 + + + + No documentation. + + + ee418674 + DIMOFS_BUTTON5 + DIMOFS_BUTTON5 + + + + No documentation. + + + ee418674 + DIMOFS_BUTTON6 + DIMOFS_BUTTON6 + + + + No documentation. + + + ee418674 + DIMOFS_BUTTON7 + DIMOFS_BUTTON7 + + + +

Before you begin asking for input from a device, you need to know something about its capabilities. Does the joystick have a point-of-view hat? Is the mouse currently attached to the user's computer?

   DIMouseCaps;	
+                hr; 	
+            BOOLEAN    WheelAvailable;  DIMouseCaps.dwSize = sizeof(); 	
+            hr = lpdiMouse->GetCapabilities(&DIMouseCaps); 	
+            WheelAvailable = ((DIMouseCaps.dwFlags & )  && (DIMouseCaps.dwAxes > 2)); 	
+            

Another way to check for a button or axis is to call for that object. If the call returns , the object is not present. The following code determines whether there is a z-axis, even if it is not the third axis:

   didoi;  didoi.dwSize = sizeof(); 	
+            hr = lpdiMouse->GetObjectInfo(&didoi, , );  WheelAvailable = SUCCEEDED(hr);	
+            
+
+ + ee416850 + DIDOI + DIDOI +
+ + + No documentation. + + + ee416850 + DIDOI_FFACTUATOR + DIDOI_FFACTUATOR + + + + No documentation. + + + ee416850 + DIDOI_FFEFFECTTRIGGER + DIDOI_FFEFFECTTRIGGER + + + + No documentation. + + + ee416850 + DIDOI_POLLED + DIDOI_POLLED + + + + No documentation. + + + ee416850 + DIDOI_ASPECTPOSITION + DIDOI_ASPECTPOSITION + + + + No documentation. + + + ee416850 + DIDOI_ASPECTVELOCITY + DIDOI_ASPECTVELOCITY + + + + No documentation. + + + ee416850 + DIDOI_ASPECTACCEL + DIDOI_ASPECTACCEL + + + + No documentation. + + + ee416850 + DIDOI_ASPECTFORCE + DIDOI_ASPECTFORCE + + + + No documentation. + + + ee416850 + DIDOI_ASPECTMASK + DIDOI_ASPECTMASK + + + + No documentation. + + + ee416850 + DIDOI_GUIDISUSAGE + DIDOI_GUIDISUSAGE + + + + Serves as a header for all property structures. + + + microsoft.directx_sdk.reference.dipropheader + DIPH + DIPH + + + +
Size of the enclosing structure. This member must be initialized before the structure is used.
+
+ + microsoft.directx_sdk.reference.dipropheader + DIPH_DEVICE + DIPH_DEVICE +
+ + +
Size of the structure.
+
+ + microsoft.directx_sdk.reference.dipropheader + DIPH_BYOFFSET + DIPH_BYOFFSET +
+ + +
Object for which the property is to be accessed. The value set for this member depends on the value specified in the dwHow member.
+
+ + microsoft.directx_sdk.reference.dipropheader + DIPH_BYID + DIPH_BYID +
+ + +
Value that specifies how the dwObj member should be interpreted. This value can be one of the following:
The dwObj member must be 0.
The dwObj member is the offset into the current data format of the object whose property is being accessed.
The dwObj member is the human interface device usage page and usage values in packed form.
The dwObj member is the object type/instance identifier. This identifier is returned in the dwType member of the structure returned from a previous call to the member.
+
+ + microsoft.directx_sdk.reference.dipropheader + DIPH_BYUSAGE + DIPH_BYUSAGE +
+ + + Carries information required to display a device image or an overlay image with a callout. This structure is passed to theIDirectInputDevice8::GetImageInfomethod as an array within aDIDEVICEIMAGEINFOHEADERstructure. + + + microsoft.directx_sdk.reference.dideviceimageinfo + DIDAL + DIDAL + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfo + DIDAL_CENTERED + DIDAL_CENTERED + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfo + DIDAL_LEFTALIGNED + DIDAL_LEFTALIGNED + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfo + DIDAL_RIGHTALIGNED + DIDAL_RIGHTALIGNED + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfo + DIDAL_MIDDLE + DIDAL_MIDDLE + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfo + DIDAL_TOPALIGNED + DIDAL_TOPALIGNED + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfo + DIDAL_BOTTOMALIGNED + DIDAL_BOTTOMALIGNED + + + + Functions + + + + + Constant AirCombatGenre. + DIVIRTUAL_FLYING_MILITARY + + + Constant Flaps. + DIAXIS_FLYINGM_FLAPS + + + Constant Throttle. + DIAXIS_FLYINGM_THROTTLE + + + Constant Bank. + DIAXIS_FLYINGM_BANK + + + Constant Pitch. + DIAXIS_FLYINGM_PITCH + + + Constant Brake. + DIAXIS_FLYINGM_BRAKE + + + Constant Rudder. + DIAXIS_FLYINGM_RUDDER + + + Constant FireSecondary. + DIBUTTON_FLYINGM_FIRESECONDARY + + + Constant Menu. + DIBUTTON_FLYINGM_MENU + + + Constant Display. + DIBUTTON_FLYINGM_DISPLAY + + + Constant Pause. + DIBUTTON_FLYINGM_PAUSE + + + Constant Gear. + DIBUTTON_FLYINGM_GEAR + + + Constant Fire. + DIBUTTON_FLYINGM_FIRE + + + Constant GlanceDownLink. + DIBUTTON_FLYINGM_GLANCE_DOWN_LINK + + + Constant FasterLink. + DIBUTTON_FLYINGM_FASTER_LINK + + + Constant GlanceLeftLink. + DIBUTTON_FLYINGM_GLANCE_LEFT_LINK + + + Constant Target. + DIBUTTON_FLYINGM_TARGET + + + Constant Counter. + DIBUTTON_FLYINGM_COUNTER + + + Constant Flapsup. + DIBUTTON_FLYINGM_FLAPSUP + + + Constant SlowerLink. + DIBUTTON_FLYINGM_SLOWER_LINK + + + Constant GlanceUpLink. + DIBUTTON_FLYINGM_GLANCE_UP_LINK + + + Constant Weapons. + DIBUTTON_FLYINGM_WEAPONS + + + Constant View. + DIBUTTON_FLYINGM_VIEW + + + Constant Device. + DIBUTTON_FLYINGM_DEVICE + + + Constant Flapsdown. + DIBUTTON_FLYINGM_FLAPSDOWN + + + Constant BrakeLink. + DIBUTTON_FLYINGM_BRAKE_LINK + + + Constant GlanceRightLink. + DIBUTTON_FLYINGM_GLANCE_RIGHT_LINK + + + Constant Glance. + DIHATSWITCH_FLYINGM_GLANCE + + + + Functions + + + + + Constant XAxis1. + DIAXIS_ANY_X_1 + + + Constant XAxis2. + DIAXIS_ANY_X_2 + + + Constant YAxis1. + DIAXIS_ANY_Y_1 + + + Constant YAxis2. + DIAXIS_ANY_Y_2 + + + Constant ZAxis1. + DIAXIS_ANY_Z_1 + + + Constant ZAxis2. + DIAXIS_ANY_Z_2 + + + Constant RAxis1. + DIAXIS_ANY_R_1 + + + Constant RAxis2. + DIAXIS_ANY_R_2 + + + Constant UAxis1. + DIAXIS_ANY_U_1 + + + Constant UAxis2. + DIAXIS_ANY_U_2 + + + Constant VAxis1. + DIAXIS_ANY_V_1 + + + Constant VAxis2. + DIAXIS_ANY_V_2 + + + Constant Accelerator1. + DIAXIS_ANY_A_1 + + + Constant Accelerator2. + DIAXIS_ANY_A_2 + + + Constant Brake1. + DIAXIS_ANY_B_1 + + + Constant Brake2. + DIAXIS_ANY_B_2 + + + Constant Clutch1. + DIAXIS_ANY_C_1 + + + Constant Clutch2. + DIAXIS_ANY_C_2 + + + Constant SAxis1. + DIAXIS_ANY_S_1 + + + Constant SAxis2. + DIAXIS_ANY_S_2 + + + Constant Axis1. + DIAXIS_ANY_1 + + + Constant Axis2. + DIAXIS_ANY_2 + + + Constant Axis3. + DIAXIS_ANY_3 + + + Constant Axis4. + DIAXIS_ANY_4 + + + Constant PointOfView1. + DIPOV_ANY_1 + + + Constant PointOfView2. + DIPOV_ANY_2 + + + Constant PointOfView3. + DIPOV_ANY_3 + + + Constant PointOfView4. + DIPOV_ANY_4 + + + + Functions + + + + + Constant BaseballBattingGenre. + DIVIRTUAL_SPORTS_BASEBALL_BAT + + + Constant Lateral. + DIAXIS_BASEBALLB_LATERAL + + + Constant Move. + DIAXIS_BASEBALLB_MOVE + + + Constant RightLink. + DIBUTTON_BASEBALLB_RIGHT_LINK + + + Constant LeftLink. + DIBUTTON_BASEBALLB_LEFT_LINK + + + Constant Bunt. + DIBUTTON_BASEBALLB_BUNT + + + Constant Power. + DIBUTTON_BASEBALLB_POWER + + + Constant Nosteal. + DIBUTTON_BASEBALLB_NOSTEAL + + + Constant Select. + DIBUTTON_BASEBALLB_SELECT + + + Constant Box. + DIBUTTON_BASEBALLB_BOX + + + Constant Device. + DIBUTTON_BASEBALLB_DEVICE + + + Constant Pause. + DIBUTTON_BASEBALLB_PAUSE + + + Constant Burst. + DIBUTTON_BASEBALLB_BURST + + + Constant Normal. + DIBUTTON_BASEBALLB_NORMAL + + + Constant Contact. + DIBUTTON_BASEBALLB_CONTACT + + + Constant BackLink. + DIBUTTON_BASEBALLB_BACK_LINK + + + Constant Menu. + DIBUTTON_BASEBALLB_MENU + + + Constant Slide. + DIBUTTON_BASEBALLB_SLIDE + + + Constant Steal. + DIBUTTON_BASEBALLB_STEAL + + + Constant ForwardLink. + DIBUTTON_BASEBALLB_FORWARD_LINK + + + + Functions + + + + + Constant BaseballFieldingGenre. + DIVIRTUAL_SPORTS_BASEBALL_FIELD + + + Constant Lateral. + DIAXIS_BASEBALLF_LATERAL + + + Constant Move. + DIAXIS_BASEBALLF_MOVE + + + Constant Throw1. + DIBUTTON_BASEBALLF_THROW1 + + + Constant AimLeftLink. + DIBUTTON_BASEBALLF_AIM_LEFT_LINK + + + Constant AimRightLink. + DIBUTTON_BASEBALLF_AIM_RIGHT_LINK + + + Constant ForwardLink. + DIBUTTON_BASEBALLF_FORWARD_LINK + + + Constant Jump. + DIBUTTON_BASEBALLF_JUMP + + + Constant Nearest. + DIBUTTON_BASEBALLF_NEAREST + + + Constant Dive. + DIBUTTON_BASEBALLF_DIVE + + + Constant BackLink. + DIBUTTON_BASEBALLF_BACK_LINK + + + Constant Shiftin. + DIBUTTON_BASEBALLF_SHIFTIN + + + Constant Device. + DIBUTTON_BASEBALLF_DEVICE + + + Constant Pause. + DIBUTTON_BASEBALLF_PAUSE + + + Constant Shiftout. + DIBUTTON_BASEBALLF_SHIFTOUT + + + Constant Throw2. + DIBUTTON_BASEBALLF_THROW2 + + + Constant Burst. + DIBUTTON_BASEBALLF_BURST + + + Constant Menu. + DIBUTTON_BASEBALLF_MENU + + + + Functions + + + + + Constant BaseballPitchingGenre. + DIVIRTUAL_SPORTS_BASEBALL_PITCH + + + Constant Lateral. + DIAXIS_BASEBALLP_LATERAL + + + Constant Move. + DIAXIS_BASEBALLP_MOVE + + + Constant Device. + DIBUTTON_BASEBALLP_DEVICE + + + Constant Base. + DIBUTTON_BASEBALLP_BASE + + + Constant Fake. + DIBUTTON_BASEBALLP_FAKE + + + Constant Pause. + DIBUTTON_BASEBALLP_PAUSE + + + Constant Throw. + DIBUTTON_BASEBALLP_THROW + + + Constant BackLink. + DIBUTTON_BASEBALLP_BACK_LINK + + + Constant Walk. + DIBUTTON_BASEBALLP_WALK + + + Constant Menu. + DIBUTTON_BASEBALLP_MENU + + + Constant Select. + DIBUTTON_BASEBALLP_SELECT + + + Constant Pitch. + DIBUTTON_BASEBALLP_PITCH + + + Constant RightLink. + DIBUTTON_BASEBALLP_RIGHT_LINK + + + Constant LeftLink. + DIBUTTON_BASEBALLP_LEFT_LINK + + + Constant Look. + DIBUTTON_BASEBALLP_LOOK + + + Constant ForwardLink. + DIBUTTON_BASEBALLP_FORWARD_LINK + + + + Functions + + + + + Constant BasketballDefenseGenre. + DIVIRTUAL_SPORTS_BASKETBALL_DEFENSE + + + Constant Move. + DIAXIS_BBALLD_MOVE + + + Constant Lateral. + DIAXIS_BBALLD_LATERAL + + + Constant Play. + DIBUTTON_BBALLD_PLAY + + + Constant Timeout. + DIBUTTON_BBALLD_TIMEOUT + + + Constant Burst. + DIBUTTON_BBALLD_BURST + + + Constant Fake. + DIBUTTON_BBALLD_FAKE + + + Constant Steal. + DIBUTTON_BBALLD_STEAL + + + Constant Special. + DIBUTTON_BBALLD_SPECIAL + + + Constant Player. + DIBUTTON_BBALLD_PLAYER + + + Constant LeftLink. + DIBUTTON_BBALLD_LEFT_LINK + + + Constant SubStitute. + DIBUTTON_BBALLD_SUBSTITUTE + + + Constant BackLink. + DIBUTTON_BBALLD_BACK_LINK + + + Constant RightLink. + DIBUTTON_BBALLD_RIGHT_LINK + + + Constant Menu. + DIBUTTON_BBALLD_MENU + + + Constant ForwardLink. + DIBUTTON_BBALLD_FORWARD_LINK + + + Constant Device. + DIBUTTON_BBALLD_DEVICE + + + Constant Jump. + DIBUTTON_BBALLD_JUMP + + + Constant Pause. + DIBUTTON_BBALLD_PAUSE + + + Constant Glance. + DIHATSWITCH_BBALLD_GLANCE + + + + Functions + + + + + Constant BasketballOffenseGenre. + DIVIRTUAL_SPORTS_BASKETBALL_OFFENSE + + + Constant Lateral. + DIAXIS_BBALLO_LATERAL + + + Constant Move. + DIAXIS_BBALLO_MOVE + + + Constant RightLink. + DIBUTTON_BBALLO_RIGHT_LINK + + + Constant Shoot. + DIBUTTON_BBALLO_SHOOT + + + Constant BackLink. + DIBUTTON_BBALLO_BACK_LINK + + + Constant ForwardLink. + DIBUTTON_BBALLO_FORWARD_LINK + + + Constant Post. + DIBUTTON_BBALLO_POST + + + Constant Special. + DIBUTTON_BBALLO_SPECIAL + + + Constant Pause. + DIBUTTON_BBALLO_PAUSE + + + Constant Timeout. + DIBUTTON_BBALLO_TIMEOUT + + + Constant Call. + DIBUTTON_BBALLO_CALL + + + Constant Burst. + DIBUTTON_BBALLO_BURST + + + Constant Pass. + DIBUTTON_BBALLO_PASS + + + Constant Fake. + DIBUTTON_BBALLO_FAKE + + + Constant Screen. + DIBUTTON_BBALLO_SCREEN + + + Constant Play. + DIBUTTON_BBALLO_PLAY + + + Constant LeftLink. + DIBUTTON_BBALLO_LEFT_LINK + + + Constant Dunk. + DIBUTTON_BBALLO_DUNK + + + Constant Jab. + DIBUTTON_BBALLO_JAB + + + Constant Device. + DIBUTTON_BBALLO_DEVICE + + + Constant Menu. + DIBUTTON_BBALLO_MENU + + + Constant SubStitute. + DIBUTTON_BBALLO_SUBSTITUTE + + + Constant Player. + DIBUTTON_BBALLO_PLAYER + + + Constant Glance. + DIHATSWITCH_BBALLO_GLANCE + + + + Functions + + + + + Constant BrowserGenre. + DIVIRTUAL_BROWSER_CONTROL + + + Constant Lateral. + DIAXIS_BROWSER_LATERAL + + + Constant Move. + DIAXIS_BROWSER_MOVE + + + Constant View. + DIAXIS_BROWSER_VIEW + + + Constant Print. + DIBUTTON_BROWSER_PRINT + + + Constant Home. + DIBUTTON_BROWSER_HOME + + + Constant Pause. + DIBUTTON_BROWSER_PAUSE + + + Constant Select. + DIBUTTON_BROWSER_SELECT + + + Constant Menu. + DIBUTTON_BROWSER_MENU + + + Constant Refresh. + DIBUTTON_BROWSER_REFRESH + + + Constant History. + DIBUTTON_BROWSER_HISTORY + + + Constant Next. + DIBUTTON_BROWSER_NEXT + + + Constant Favorites. + DIBUTTON_BROWSER_FAVORITES + + + Constant Device. + DIBUTTON_BROWSER_DEVICE + + + Constant Stop. + DIBUTTON_BROWSER_STOP + + + Constant Previous. + DIBUTTON_BROWSER_PREVIOUS + + + Constant Search. + DIBUTTON_BROWSER_SEARCH + + + + Functions + + + + + Constant CivilianFlightGenre. + DIVIRTUAL_FLYING_CIVILIAN + + + Constant Pitch. + DIAXIS_FLYINGC_PITCH + + + Constant Brake. + DIAXIS_FLYINGC_BRAKE + + + Constant Flaps. + DIAXIS_FLYINGC_FLAPS + + + Constant Throttle. + DIAXIS_FLYINGC_THROTTLE + + + Constant Bank. + DIAXIS_FLYINGC_BANK + + + Constant Rudder. + DIAXIS_FLYINGC_RUDDER + + + Constant SlowerLink. + DIBUTTON_FLYINGC_SLOWER_LINK + + + Constant FasterLink. + DIBUTTON_FLYINGC_FASTER_LINK + + + Constant BrakeLink. + DIBUTTON_FLYINGC_BRAKE_LINK + + + Constant Gear. + DIBUTTON_FLYINGC_GEAR + + + Constant View. + DIBUTTON_FLYINGC_VIEW + + + Constant Display. + DIBUTTON_FLYINGC_DISPLAY + + + Constant Flapsdown. + DIBUTTON_FLYINGC_FLAPSDOWN + + + Constant GlanceDownLink. + DIBUTTON_FLYINGC_GLANCE_DOWN_LINK + + + Constant GlanceLeftLink. + DIBUTTON_FLYINGC_GLANCE_LEFT_LINK + + + Constant GlanceRightLink. + DIBUTTON_FLYINGC_GLANCE_RIGHT_LINK + + + Constant Pause. + DIBUTTON_FLYINGC_PAUSE + + + Constant Menu. + DIBUTTON_FLYINGC_MENU + + + Constant Device. + DIBUTTON_FLYINGC_DEVICE + + + Constant Flapsup. + DIBUTTON_FLYINGC_FLAPSUP + + + Constant GlanceUpLink. + DIBUTTON_FLYINGC_GLANCE_UP_LINK + + + Constant Glance. + DIHATSWITCH_FLYINGC_GLANCE + + + + Functions + + + + + Constant AirCombatGenre. + DIVIRTUAL_DRIVING_COMBAT + + + Constant Steer. + DIAXIS_DRIVINGC_STEER + + + Constant Accelerate. + DIAXIS_DRIVINGC_ACCELERATE + + + Constant BrakeAxis. + DIAXIS_DRIVINGC_BRAKE + + + Constant AccelerateAndBrake. + DIAXIS_DRIVINGC_ACCEL_AND_BRAKE + + + Constant Fire. + DIBUTTON_DRIVINGC_FIRE + + + Constant GlanceRightLink. + DIBUTTON_DRIVINGC_GLANCE_RIGHT_LINK + + + Constant Weapons. + DIBUTTON_DRIVINGC_WEAPONS + + + Constant Pause. + DIBUTTON_DRIVINGC_PAUSE + + + Constant SteerRightLink. + DIBUTTON_DRIVINGC_STEER_RIGHT_LINK + + + Constant Aids. + DIBUTTON_DRIVINGC_AIDS + + + Constant Dashboard. + DIBUTTON_DRIVINGC_DASHBOARD + + + Constant Target. + DIBUTTON_DRIVINGC_TARGET + + + Constant Menu. + DIBUTTON_DRIVINGC_MENU + + + Constant GlanceLeftLink. + DIBUTTON_DRIVINGC_GLANCE_LEFT_LINK + + + Constant Shiftup. + DIBUTTON_DRIVINGC_SHIFTUP + + + Constant SteerLeftLink. + DIBUTTON_DRIVINGC_STEER_LEFT_LINK + + + Constant AccelerateLink. + DIBUTTON_DRIVINGC_ACCELERATE_LINK + + + Constant Shiftdown. + DIBUTTON_DRIVINGC_SHIFTDOWN + + + Constant Firesecondary. + DIBUTTON_DRIVINGC_FIRESECONDARY + + + Constant Brake. + DIBUTTON_DRIVINGC_BRAKE + + + Constant Device. + DIBUTTON_DRIVINGC_DEVICE + + + Constant Glance. + DIHATSWITCH_DRIVINGC_GLANCE + + + + Functions + + + + + Constant SysMouse. + GUID_SysMouse + + + Constant SysKeyboard. + GUID_SysKeyboard + + + Constant Joystick. + GUID_Joystick + + + Constant SysMouseEm. + GUID_SysMouseEm + + + Constant SysMouseEm2. + GUID_SysMouseEm2 + + + Constant SysKeyboardEm. + GUID_SysKeyboardEm + + + Constant SysKeyboardEm2. + GUID_SysKeyboardEm2 + + + + Functions + + + + + Constant MouseUnknown. + DI8DEVTYPEMOUSE_UNKNOWN + + + Constant MouseAbsolute. + DI8DEVTYPEMOUSE_ABSOLUTE + + + Constant MouseTrackball. + DI8DEVTYPEMOUSE_TRACKBALL + + + Constant MouseTraditional. + DI8DEVTYPEMOUSE_TRADITIONAL + + + Constant MouseTouchpad. + DI8DEVTYPEMOUSE_TOUCHPAD + + + Constant MouseFingerstick. + DI8DEVTYPEMOUSE_FINGERSTICK + + + Constant KeyboardNec98106. + DI8DEVTYPEKEYBOARD_NEC98106 + + + Constant KeyboardJapanax. + DI8DEVTYPEKEYBOARD_JAPANAX + + + Constant KeyboardJapan106. + DI8DEVTYPEKEYBOARD_JAPAN106 + + + Constant KeyboardPcxt. + DI8DEVTYPEKEYBOARD_PCXT + + + Constant KeyboardNokia9140. + DI8DEVTYPEKEYBOARD_NOKIA9140 + + + Constant KeyboardNec98laptop. + DI8DEVTYPEKEYBOARD_NEC98LAPTOP + + + Constant KeyboardOlivetti. + DI8DEVTYPEKEYBOARD_OLIVETTI + + + Constant KeyboardNec98. + DI8DEVTYPEKEYBOARD_NEC98 + + + Constant KeyboardPcat. + DI8DEVTYPEKEYBOARD_PCAT + + + Constant KeyboardPcenh. + DI8DEVTYPEKEYBOARD_PCENH + + + Constant KeyboardUnknown. + DI8DEVTYPEKEYBOARD_UNKNOWN + + + Constant KeyboardNokia1050. + DI8DEVTYPEKEYBOARD_NOKIA1050 + + + Constant KeyboardJ3100. + DI8DEVTYPEKEYBOARD_J3100 + + + Constant JoystickStandard. + DI8DEVTYPEJOYSTICK_STANDARD + + + Constant JoystickLimited. + DI8DEVTYPEJOYSTICK_LIMITED + + + Constant GamepadStandard. + DI8DEVTYPEGAMEPAD_STANDARD + + + Constant GamepadLimited. + DI8DEVTYPEGAMEPAD_LIMITED + + + Constant GamepadTilt. + DI8DEVTYPEGAMEPAD_TILT + + + Constant DrivingHandheld. + DI8DEVTYPEDRIVING_HANDHELD + + + Constant DrivingThreepedals. + DI8DEVTYPEDRIVING_THREEPEDALS + + + Constant DrivingCombinedpedals. + DI8DEVTYPEDRIVING_COMBINEDPEDALS + + + Constant DrivingDualpedals. + DI8DEVTYPEDRIVING_DUALPEDALS + + + Constant DrivingLimited. + DI8DEVTYPEDRIVING_LIMITED + + + Constant FlightLimited. + DI8DEVTYPEFLIGHT_LIMITED + + + Constant FlightYoke. + DI8DEVTYPEFLIGHT_YOKE + + + Constant FlightStick. + DI8DEVTYPEFLIGHT_STICK + + + Constant FlightRc. + DI8DEVTYPEFLIGHT_RC + + + Constant FirstPersonSixdof. + DI8DEVTYPE1STPERSON_SIXDOF + + + Constant FirstPersonLimited. + DI8DEVTYPE1STPERSON_LIMITED + + + Constant FirstPersonShooter. + DI8DEVTYPE1STPERSON_SHOOTER + + + Constant FirstPersonUnknown. + DI8DEVTYPE1STPERSON_UNKNOWN + + + Constant ScreenPointerUnknown. + DI8DEVTYPESCREENPTR_UNKNOWN + + + Constant ScreenPointerLightpen. + DI8DEVTYPESCREENPTR_LIGHTPEN + + + Constant ScreenPointerTouch. + DI8DEVTYPESCREENPTR_TOUCH + + + Constant ScreenPointerLightgun. + DI8DEVTYPESCREENPTR_LIGHTGUN + + + Constant RemoteUnknown. + DI8DEVTYPEREMOTE_UNKNOWN + + + Constant DeviceControlCommsselection. + DI8DEVTYPEDEVICECTRL_COMMSSELECTION + + + Constant DeviceControlCommsselectionHardwired. + DI8DEVTYPEDEVICECTRL_COMMSSELECTION_HARDWIRED + + + Constant DeviceControlUnknown. + DI8DEVTYPEDEVICECTRL_UNKNOWN + + + Constant SupplementalThrottle. + DI8DEVTYPESUPPLEMENTAL_THROTTLE + + + Constant SupplementalHandtracker. + DI8DEVTYPESUPPLEMENTAL_HANDTRACKER + + + Constant SupplementalHeadtracker. + DI8DEVTYPESUPPLEMENTAL_HEADTRACKER + + + Constant Supplemental2ndhandcontroller. + DI8DEVTYPESUPPLEMENTAL_2NDHANDCONTROLLER + + + Constant SupplementalShiftstickgate. + DI8DEVTYPESUPPLEMENTAL_SHIFTSTICKGATE + + + Constant SupplementalDualpedals. + DI8DEVTYPESUPPLEMENTAL_DUALPEDALS + + + Constant SupplementalCombinedpedals. + DI8DEVTYPESUPPLEMENTAL_COMBINEDPEDALS + + + Constant SupplementalShifter. + DI8DEVTYPESUPPLEMENTAL_SHIFTER + + + Constant SupplementalRudderpedals. + DI8DEVTYPESUPPLEMENTAL_RUDDERPEDALS + + + Constant SupplementalUnknown. + DI8DEVTYPESUPPLEMENTAL_UNKNOWN + + + Constant SupplementalThreepedals. + DI8DEVTYPESUPPLEMENTAL_THREEPEDALS + + + Constant SupplementalSplitthrottle. + DI8DEVTYPESUPPLEMENTAL_SPLITTHROTTLE + + + + Functions + + + + + Constant SdkVersion. + DIRECTINPUT_VERSION + + + + Creates a DirectInput object and returns anIDirectInput8 Interfaceor later interface. + + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If the function succeeds, the return value is . If the function fails, the return value can be one of the following error values: , , , .

+ +

The DirectInput object created by this function is implemented in Dinput8.dll. Versions of interfaces earlier than DirectX 8.0 cannot be obtained in this implementation.

To create a DirectX 8.x interface with the latest DirectX SDK without using CoCreateInstance:

  1. Set "#define 0x0800" before the include statement for Dinput8.h.

  2. Call DirectInput8Create instead of DirectInputCreateEx.

  3. Link to the Dinput8.lib library instead of Dinput.lib.

To create a DirectX 8.x interface with the DirectX 8.x SDK without using CoCreateInstance:

  1. Call DirectInput8Create instead of DirectInputCreateEx.

  2. Link to the Dinput8.lib library instead of Dinput.lib.

To create a DirectX 7.0 interface from the DirectX 8.x or latest DirectX SDK without using CoCreateInstance:

  1. Set "#define 0x0700" before the include statement for dinput.h.

  2. Call DirectInputCreateEx instead of DirectInput8Create.

  3. Link to the Dinput.lib library instead of Dinput8.lib.

To create a DirectX 7.0 interface from the DirectX 8.x or latest DirectX SDK using CoCreateInstance:

  1. Call CoInitializeEx.

  2. Call CoCreateInstance using CLISID_DirectInput.

  3. Use IDirectInput7::Initialize to initialize the DirectInput object.

To create a DirectX 8.x or DirectX 9.0 interface from the DirectX 8.x or latest DirectX SDK using CoCreateInstance:

  1. Call CoInitializeEx.

  2. Call CoCreateInstance using CLISID_DirectInput8.

  3. Use to initialize the DirectInput object.

Calling the function with pUnkOuter = null is equivalent to creating the object through CoCreateInstance( &CLSID_DirectInput8, punkOuter, CLSCTX_INPROC_SERVER, &IID_IDirectInput8W, lplpDirectInput), then initializing it with .

Calling the function with pUnkOuter != null is equivalent to creating the object through CoCreateInstance( &CLSID_DirectInput8, punkOuter, CLSCTX_INPROC_SERVER, &IID_IUnknown, lplpDirectInput). The aggregated object must be initialized manually.

+
+ + microsoft.directx_sdk.reference.directinput8create + HRESULT DirectInput8Create([In] HINSTANCE hinst,[In] unsigned int dwVersion,[In] const GUID& riidltf,[Out] void** ppvOut,[In] IUnknown* punkOuter) + DirectInput8Create +
+ + + Functions + + + + + Constant ConstantForce. + GUID_ConstantForce + + + Constant RampForce. + GUID_RampForce + + + Constant Square. + GUID_Square + + + Constant Sine. + GUID_Sine + + + Constant Triangle. + GUID_Triangle + + + Constant SawtoothUp. + GUID_SawtoothUp + + + Constant SawtoothDown. + GUID_SawtoothDown + + + Constant Spring. + GUID_Spring + + + Constant Damper. + GUID_Damper + + + Constant Inertia. + GUID_Inertia + + + Constant Friction. + GUID_Friction + + + Constant CustomForce. + GUID_CustomForce + + + + Functions + + + + + Constant FishingGenre. + DIVIRTUAL_SPORTS_FISHING + + + Constant Lateral. + DIAXIS_FISHING_LATERAL + + + Constant Move. + DIAXIS_FISHING_MOVE + + + Constant Rotate. + DIAXIS_FISHING_ROTATE + + + Constant Glance. + DIHATSWITCH_FISHING_GLANCE + + + + Functions + + + + + Constant FootballDefenseGenre. + DIVIRTUAL_SPORTS_FOOTBALL_DEFENSE + + + Constant Move. + DIAXIS_FOOTBALLD_MOVE + + + Constant Lateral. + DIAXIS_FOOTBALLD_LATERAL + + + Constant Swim. + DIBUTTON_FOOTBALLD_SWIM + + + Constant Audible. + DIBUTTON_FOOTBALLD_AUDIBLE + + + Constant Menu. + DIBUTTON_FOOTBALLD_MENU + + + Constant LeftLink. + DIBUTTON_FOOTBALLD_LEFT_LINK + + + Constant SubStitute. + DIBUTTON_FOOTBALLD_SUBSTITUTE + + + Constant BackLink. + DIBUTTON_FOOTBALLD_BACK_LINK + + + Constant RightLink. + DIBUTTON_FOOTBALLD_RIGHT_LINK + + + Constant ForwardLink. + DIBUTTON_FOOTBALLD_FORWARD_LINK + + + Constant Zoom. + DIBUTTON_FOOTBALLD_ZOOM + + + Constant Spin. + DIBUTTON_FOOTBALLD_SPIN + + + Constant Tackle. + DIBUTTON_FOOTBALLD_TACKLE + + + Constant Jump. + DIBUTTON_FOOTBALLD_JUMP + + + Constant Play. + DIBUTTON_FOOTBALLD_PLAY + + + Constant Supertackle. + DIBUTTON_FOOTBALLD_SUPERTACKLE + + + Constant Pause. + DIBUTTON_FOOTBALLD_PAUSE + + + Constant Rip. + DIBUTTON_FOOTBALLD_RIP + + + Constant Fake. + DIBUTTON_FOOTBALLD_FAKE + + + Constant Device. + DIBUTTON_FOOTBALLD_DEVICE + + + Constant Select. + DIBUTTON_FOOTBALLD_SELECT + + + Constant Bullrush. + DIBUTTON_FOOTBALLD_BULLRUSH + + + + Functions + + + + + Constant FootballOffenseGenre. + DIVIRTUAL_SPORTS_FOOTBALL_OFFENSE + + + Constant Move. + DIAXIS_FOOTBALLO_MOVE + + + Constant Lateral. + DIAXIS_FOOTBALLO_LATERAL + + + Constant Jump. + DIBUTTON_FOOTBALLO_JUMP + + + Constant BackLink. + DIBUTTON_FOOTBALLO_BACK_LINK + + + Constant Pause. + DIBUTTON_FOOTBALLO_PAUSE + + + Constant Rightarm. + DIBUTTON_FOOTBALLO_RIGHTARM + + + Constant Device. + DIBUTTON_FOOTBALLO_DEVICE + + + Constant Turbo. + DIBUTTON_FOOTBALLO_TURBO + + + Constant Menu. + DIBUTTON_FOOTBALLO_MENU + + + Constant SubStitute. + DIBUTTON_FOOTBALLO_SUBSTITUTE + + + Constant Leftarm. + DIBUTTON_FOOTBALLO_LEFTARM + + + Constant RightLink. + DIBUTTON_FOOTBALLO_RIGHT_LINK + + + Constant LeftLink. + DIBUTTON_FOOTBALLO_LEFT_LINK + + + Constant Dive. + DIBUTTON_FOOTBALLO_DIVE + + + Constant Zoom. + DIBUTTON_FOOTBALLO_ZOOM + + + Constant Shoulder. + DIBUTTON_FOOTBALLO_SHOULDER + + + Constant ForwardLink. + DIBUTTON_FOOTBALLO_FORWARD_LINK + + + Constant Juke. + DIBUTTON_FOOTBALLO_JUKE + + + Constant Throw. + DIBUTTON_FOOTBALLO_THROW + + + Constant Spin. + DIBUTTON_FOOTBALLO_SPIN + + + + Functions + + + + + Constant FootballPlayGenre. + DIVIRTUAL_SPORTS_FOOTBALL_FIELD + + + Constant Help. + DIBUTTON_FOOTBALLP_HELP + + + Constant Select. + DIBUTTON_FOOTBALLP_SELECT + + + Constant Pause. + DIBUTTON_FOOTBALLP_PAUSE + + + Constant Device. + DIBUTTON_FOOTBALLP_DEVICE + + + Constant Menu. + DIBUTTON_FOOTBALLP_MENU + + + Constant Play. + DIBUTTON_FOOTBALLP_PLAY + + + + Functions + + + + + Constant FootballQuarterbackGenre. + DIVIRTUAL_SPORTS_FOOTBALL_QBCK + + + Constant Lateral. + DIAXIS_FOOTBALLQ_LATERAL + + + Constant Move. + DIAXIS_FOOTBALLQ_MOVE + + + Constant Pass. + DIBUTTON_FOOTBALLQ_PASS + + + Constant Fake. + DIBUTTON_FOOTBALLQ_FAKE + + + Constant Pause. + DIBUTTON_FOOTBALLQ_PAUSE + + + Constant Slide. + DIBUTTON_FOOTBALLQ_SLIDE + + + Constant LeftLink. + DIBUTTON_FOOTBALLQ_LEFT_LINK + + + Constant Snap. + DIBUTTON_FOOTBALLQ_SNAP + + + Constant ForwardLink. + DIBUTTON_FOOTBALLQ_FORWARD_LINK + + + Constant Menu. + DIBUTTON_FOOTBALLQ_MENU + + + Constant Fakesnap. + DIBUTTON_FOOTBALLQ_FAKESNAP + + + Constant RightLink. + DIBUTTON_FOOTBALLQ_RIGHT_LINK + + + Constant Audible. + DIBUTTON_FOOTBALLQ_AUDIBLE + + + Constant Motion. + DIBUTTON_FOOTBALLQ_MOTION + + + Constant Jump. + DIBUTTON_FOOTBALLQ_JUMP + + + Constant BackLink. + DIBUTTON_FOOTBALLQ_BACK_LINK + + + Constant Select. + DIBUTTON_FOOTBALLQ_SELECT + + + Constant Device. + DIBUTTON_FOOTBALLQ_DEVICE + + + + Functions + + + + + Constant GolfGenre. + DIVIRTUAL_SPORTS_GOLF + + + Constant Lateral. + DIAXIS_GOLF_LATERAL + + + Constant Move. + DIAXIS_GOLF_MOVE + + + Constant Menu. + DIBUTTON_GOLF_MENU + + + Constant BackLink. + DIBUTTON_GOLF_BACK_LINK + + + Constant Device. + DIBUTTON_GOLF_DEVICE + + + Constant Select. + DIBUTTON_GOLF_SELECT + + + Constant Down. + DIBUTTON_GOLF_DOWN + + + Constant Timeout. + DIBUTTON_GOLF_TIMEOUT + + + Constant Zoom. + DIBUTTON_GOLF_ZOOM + + + Constant SubStitute. + DIBUTTON_GOLF_SUBSTITUTE + + + Constant ForwardLink. + DIBUTTON_GOLF_FORWARD_LINK + + + Constant RightLink. + DIBUTTON_GOLF_RIGHT_LINK + + + Constant Flyby. + DIBUTTON_GOLF_FLYBY + + + Constant LeftLink. + DIBUTTON_GOLF_LEFT_LINK + + + Constant Up. + DIBUTTON_GOLF_UP + + + Constant Swing. + DIBUTTON_GOLF_SWING + + + Constant Terrain. + DIBUTTON_GOLF_TERRAIN + + + Constant Pause. + DIBUTTON_GOLF_PAUSE + + + + Functions + + + + + Constant HandToHandGenre. + DIVIRTUAL_FIGHTING_HAND2HAND + + + Constant Move. + DIAXIS_FIGHTINGH_MOVE + + + Constant Lateral. + DIAXIS_FIGHTINGH_LATERAL + + + Constant Rotate. + DIAXIS_FIGHTINGH_ROTATE + + + Constant Device. + DIBUTTON_FIGHTINGH_DEVICE + + + Constant LeftLink. + DIBUTTON_FIGHTINGH_LEFT_LINK + + + Constant Display. + DIBUTTON_FIGHTINGH_DISPLAY + + + Constant RightLink. + DIBUTTON_FIGHTINGH_RIGHT_LINK + + + Constant Select. + DIBUTTON_FIGHTINGH_SELECT + + + Constant BackwardLink. + DIBUTTON_FIGHTINGH_BACKWARD_LINK + + + Constant Crouch. + DIBUTTON_FIGHTINGH_CROUCH + + + Constant Dodge. + DIBUTTON_FIGHTINGH_DODGE + + + Constant Pause. + DIBUTTON_FIGHTINGH_PAUSE + + + Constant Block. + DIBUTTON_FIGHTINGH_BLOCK + + + Constant ForwardLink. + DIBUTTON_FIGHTINGH_FORWARD_LINK + + + Constant Menu. + DIBUTTON_FIGHTINGH_MENU + + + Constant Punch. + DIBUTTON_FIGHTINGH_PUNCH + + + Constant Jump. + DIBUTTON_FIGHTINGH_JUMP + + + Constant Kick. + DIBUTTON_FIGHTINGH_KICK + + + Constant Special2. + DIBUTTON_FIGHTINGH_SPECIAL2 + + + Constant Special1. + DIBUTTON_FIGHTINGH_SPECIAL1 + + + Constant Slide. + DIHATSWITCH_FIGHTINGH_SLIDE + + + + Functions + + + + + Constant HelicopterCombatGenre. + DIVIRTUAL_FLYING_HELICOPTER + + + Constant Torque. + DIAXIS_FLYINGH_TORQUE + + + Constant Pitch. + DIAXIS_FLYINGH_PITCH + + + Constant Collective. + DIAXIS_FLYINGH_COLLECTIVE + + + Constant Throttle. + DIAXIS_FLYINGH_THROTTLE + + + Constant Bank. + DIAXIS_FLYINGH_BANK + + + Constant Firesecondary. + DIBUTTON_FLYINGH_FIRESECONDARY + + + Constant Gear. + DIBUTTON_FLYINGH_GEAR + + + Constant FasterLink. + DIBUTTON_FLYINGH_FASTER_LINK + + + Constant Weapons. + DIBUTTON_FLYINGH_WEAPONS + + + Constant GlanceRightLink. + DIBUTTON_FLYINGH_GLANCE_RIGHT_LINK + + + Constant GlanceUpLink. + DIBUTTON_FLYINGH_GLANCE_UP_LINK + + + Constant Menu. + DIBUTTON_FLYINGH_MENU + + + Constant Target. + DIBUTTON_FLYINGH_TARGET + + + Constant Fire. + DIBUTTON_FLYINGH_FIRE + + + Constant Device. + DIBUTTON_FLYINGH_DEVICE + + + Constant SlowerLink. + DIBUTTON_FLYINGH_SLOWER_LINK + + + Constant Pause. + DIBUTTON_FLYINGH_PAUSE + + + Constant GlanceLeftLink. + DIBUTTON_FLYINGH_GLANCE_LEFT_LINK + + + Constant View. + DIBUTTON_FLYINGH_VIEW + + + Constant Counter. + DIBUTTON_FLYINGH_COUNTER + + + Constant GlanceDownLink. + DIBUTTON_FLYINGH_GLANCE_DOWN_LINK + + + Constant Glance. + DIHATSWITCH_FLYINGH_GLANCE + + + + Functions + + + + + Constant HockeyDefenseGenre. + DIVIRTUAL_SPORTS_HOCKEY_DEFENSE + + + Constant Move. + DIAXIS_HOCKEYD_MOVE + + + Constant Lateral. + DIAXIS_HOCKEYD_LATERAL + + + Constant Menu. + DIBUTTON_HOCKEYD_MENU + + + Constant Player. + DIBUTTON_HOCKEYD_PLAYER + + + Constant BackLink. + DIBUTTON_HOCKEYD_BACK_LINK + + + Constant LeftLink. + DIBUTTON_HOCKEYD_LEFT_LINK + + + Constant Zoom. + DIBUTTON_HOCKEYD_ZOOM + + + Constant Pause. + DIBUTTON_HOCKEYD_PAUSE + + + Constant RightLink. + DIBUTTON_HOCKEYD_RIGHT_LINK + + + Constant Block. + DIBUTTON_HOCKEYD_BLOCK + + + Constant Burst. + DIBUTTON_HOCKEYD_BURST + + + Constant Strategy. + DIBUTTON_HOCKEYD_STRATEGY + + + Constant Device. + DIBUTTON_HOCKEYD_DEVICE + + + Constant SubStitute. + DIBUTTON_HOCKEYD_SUBSTITUTE + + + Constant Fake. + DIBUTTON_HOCKEYD_FAKE + + + Constant Steal. + DIBUTTON_HOCKEYD_STEAL + + + Constant ForwardLink. + DIBUTTON_HOCKEYD_FORWARD_LINK + + + Constant Timeout. + DIBUTTON_HOCKEYD_TIMEOUT + + + Constant Scroll. + DIHATSWITCH_HOCKEYD_SCROLL + + + + Functions + + + + + Constant HockeyGoalieGenre. + DIVIRTUAL_SPORTS_HOCKEY_GOALIE + + + Constant Move. + DIAXIS_HOCKEYG_MOVE + + + Constant Lateral. + DIAXIS_HOCKEYG_LATERAL + + + Constant Pass. + DIBUTTON_HOCKEYG_PASS + + + Constant Block. + DIBUTTON_HOCKEYG_BLOCK + + + Constant Zoom. + DIBUTTON_HOCKEYG_ZOOM + + + Constant RightLink. + DIBUTTON_HOCKEYG_RIGHT_LINK + + + Constant Strategy. + DIBUTTON_HOCKEYG_STRATEGY + + + Constant LeftLink. + DIBUTTON_HOCKEYG_LEFT_LINK + + + Constant Steal. + DIBUTTON_HOCKEYG_STEAL + + + Constant Pause. + DIBUTTON_HOCKEYG_PAUSE + + + Constant Device. + DIBUTTON_HOCKEYG_DEVICE + + + Constant SubStitute. + DIBUTTON_HOCKEYG_SUBSTITUTE + + + Constant BackLink. + DIBUTTON_HOCKEYG_BACK_LINK + + + Constant ForwardLink. + DIBUTTON_HOCKEYG_FORWARD_LINK + + + Constant Poke. + DIBUTTON_HOCKEYG_POKE + + + Constant Menu. + DIBUTTON_HOCKEYG_MENU + + + Constant Timeout. + DIBUTTON_HOCKEYG_TIMEOUT + + + Constant Scroll. + DIHATSWITCH_HOCKEYG_SCROLL + + + + Functions + + + + + Constant HockeyOffenseGenre. + DIVIRTUAL_SPORTS_HOCKEY_OFFENSE + + + Constant Move. + DIAXIS_HOCKEYO_MOVE + + + Constant Lateral. + DIAXIS_HOCKEYO_LATERAL + + + Constant Pass. + DIBUTTON_HOCKEYO_PASS + + + Constant Fake. + DIBUTTON_HOCKEYO_FAKE + + + Constant LeftLink. + DIBUTTON_HOCKEYO_LEFT_LINK + + + Constant Shoot. + DIBUTTON_HOCKEYO_SHOOT + + + Constant Timeout. + DIBUTTON_HOCKEYO_TIMEOUT + + + Constant RightLink. + DIBUTTON_HOCKEYO_RIGHT_LINK + + + Constant ForwardLink. + DIBUTTON_HOCKEYO_FORWARD_LINK + + + Constant Menu. + DIBUTTON_HOCKEYO_MENU + + + Constant BackLink. + DIBUTTON_HOCKEYO_BACK_LINK + + + Constant Zoom. + DIBUTTON_HOCKEYO_ZOOM + + + Constant SubStitute. + DIBUTTON_HOCKEYO_SUBSTITUTE + + + Constant Special. + DIBUTTON_HOCKEYO_SPECIAL + + + Constant Strategy. + DIBUTTON_HOCKEYO_STRATEGY + + + Constant Pause. + DIBUTTON_HOCKEYO_PAUSE + + + Constant Device. + DIBUTTON_HOCKEYO_DEVICE + + + Constant Burst. + DIBUTTON_HOCKEYO_BURST + + + Constant Scroll. + DIHATSWITCH_HOCKEYO_SCROLL + + + + Functions + + + + + Constant HuntingGenre. + DIVIRTUAL_SPORTS_HUNTING + + + Constant Move. + DIAXIS_HUNTING_MOVE + + + Constant Rotate. + DIAXIS_HUNTING_ROTATE + + + Constant Lateral. + DIAXIS_HUNTING_LATERAL + + + Constant BackLink. + DIBUTTON_HUNTING_BACK_LINK + + + Constant RightLink. + DIBUTTON_HUNTING_RIGHT_LINK + + + Constant Pause. + DIBUTTON_HUNTING_PAUSE + + + Constant Crouch. + DIBUTTON_HUNTING_CROUCH + + + Constant Fire. + DIBUTTON_HUNTING_FIRE + + + Constant Binocular. + DIBUTTON_HUNTING_BINOCULAR + + + Constant ForwardLink. + DIBUTTON_HUNTING_FORWARD_LINK + + + Constant Device. + DIBUTTON_HUNTING_DEVICE + + + Constant RotateLeftLink. + DIBUTTON_HUNTING_ROTATE_LEFT_LINK + + + Constant Map. + DIBUTTON_HUNTING_MAP + + + Constant Jump. + DIBUTTON_HUNTING_JUMP + + + Constant Weapon. + DIBUTTON_HUNTING_WEAPON + + + Constant Special. + DIBUTTON_HUNTING_SPECIAL + + + Constant RotateRightLink. + DIBUTTON_HUNTING_ROTATE_RIGHT_LINK + + + Constant Menu. + DIBUTTON_HUNTING_MENU + + + Constant Display. + DIBUTTON_HUNTING_DISPLAY + + + Constant Firesecondary. + DIBUTTON_HUNTING_FIRESECONDARY + + + Constant Call. + DIBUTTON_HUNTING_CALL + + + Constant LeftLink. + DIBUTTON_HUNTING_LEFT_LINK + + + Constant Aim. + DIBUTTON_HUNTING_AIM + + + Constant Glance. + DIHATSWITCH_HUNTING_GLANCE + + + + Functions + + + + + Constant MechanicalFightingGenre. + DIVIRTUAL_DRIVING_MECHA + + + Constant Torso. + DIAXIS_MECHA_TORSO + + + Constant Throttle. + DIAXIS_MECHA_THROTTLE + + + Constant Steer. + DIAXIS_MECHA_STEER + + + Constant Rotate. + DIAXIS_MECHA_ROTATE + + + Constant FasterLink. + DIBUTTON_MECHA_FASTER_LINK + + + Constant ForwardLink. + DIBUTTON_MECHA_FORWARD_LINK + + + Constant Jump. + DIBUTTON_MECHA_JUMP + + + Constant Reverse. + DIBUTTON_MECHA_REVERSE + + + Constant Pause. + DIBUTTON_MECHA_PAUSE + + + Constant RotateRightLink. + DIBUTTON_MECHA_ROTATE_RIGHT_LINK + + + Constant RightLink. + DIBUTTON_MECHA_RIGHT_LINK + + + Constant LeftLink. + DIBUTTON_MECHA_LEFT_LINK + + + Constant View. + DIBUTTON_MECHA_VIEW + + + Constant SlowerLink. + DIBUTTON_MECHA_SLOWER_LINK + + + Constant Menu. + DIBUTTON_MECHA_MENU + + + Constant Target. + DIBUTTON_MECHA_TARGET + + + Constant Center. + DIBUTTON_MECHA_CENTER + + + Constant Fire. + DIBUTTON_MECHA_FIRE + + + Constant RotateLeftLink. + DIBUTTON_MECHA_ROTATE_LEFT_LINK + + + Constant Firesecondary. + DIBUTTON_MECHA_FIRESECONDARY + + + Constant Device. + DIBUTTON_MECHA_DEVICE + + + Constant BackLink. + DIBUTTON_MECHA_BACK_LINK + + + Constant Zoom. + DIBUTTON_MECHA_ZOOM + + + Constant Weapons. + DIBUTTON_MECHA_WEAPONS + + + Constant Glance. + DIHATSWITCH_MECHA_GLANCE + + + + Functions + + + + + Constant Models3DGenre. + DIVIRTUAL_CAD_MODEL + + + Constant Inout. + DIAXIS_CADM_INOUT + + + Constant Rotatex. + DIAXIS_CADM_ROTATEX + + + Constant Move. + DIAXIS_CADM_MOVE + + + Constant Rotatez. + DIAXIS_CADM_ROTATEZ + + + Constant Rotatey. + DIAXIS_CADM_ROTATEY + + + Constant Lateral. + DIAXIS_CADM_LATERAL + + + Constant Special2. + DIBUTTON_CADM_SPECIAL2 + + + Constant Display. + DIBUTTON_CADM_DISPLAY + + + Constant Pause. + DIBUTTON_CADM_PAUSE + + + Constant Special. + DIBUTTON_CADM_SPECIAL + + + Constant Special1. + DIBUTTON_CADM_SPECIAL1 + + + Constant Select. + DIBUTTON_CADM_SELECT + + + Constant Device. + DIBUTTON_CADM_DEVICE + + + Constant Menu. + DIBUTTON_CADM_MENU + + + Constant Hatswitch. + DIHATSWITCH_CADM_HATSWITCH + + + + Functions + + + + + Constant MountainBikingGenre. + DIVIRTUAL_SPORTS_BIKING_MOUNTAIN + + + Constant Pedal. + DIAXIS_BIKINGM_PEDAL + + + Constant Brake. + DIAXIS_BIKINGM_BRAKE + + + Constant Turn. + DIAXIS_BIKINGM_TURN + + + Constant Special1. + DIBUTTON_BIKINGM_SPECIAL1 + + + Constant BrakeButtonLink. + DIBUTTON_BIKINGM_BRAKE_BUTTON_LINK + + + Constant Pause. + DIBUTTON_BIKINGM_PAUSE + + + Constant RightLink. + DIBUTTON_BIKINGM_RIGHT_LINK + + + Constant SlowerLink. + DIBUTTON_BIKINGM_SLOWER_LINK + + + Constant Menu. + DIBUTTON_BIKINGM_MENU + + + Constant Camera. + DIBUTTON_BIKINGM_CAMERA + + + Constant Zoom. + DIBUTTON_BIKINGM_ZOOM + + + Constant Jump. + DIBUTTON_BIKINGM_JUMP + + + Constant Special2. + DIBUTTON_BIKINGM_SPECIAL2 + + + Constant Select. + DIBUTTON_BIKINGM_SELECT + + + Constant Device. + DIBUTTON_BIKINGM_DEVICE + + + Constant LeftLink. + DIBUTTON_BIKINGM_LEFT_LINK + + + Constant FasterLink. + DIBUTTON_BIKINGM_FASTER_LINK + + + Constant Scroll. + DIHATSWITCH_BIKINGM_SCROLL + + + + Functions + + + + + Constant Navigation3DGenre. + DIVIRTUAL_CAD_FLYBY + + + Constant Rotatey. + DIAXIS_CADF_ROTATEY + + + Constant Inout. + DIAXIS_CADF_INOUT + + + Constant Lateral. + DIAXIS_CADF_LATERAL + + + Constant Rotatex. + DIAXIS_CADF_ROTATEX + + + Constant Move. + DIAXIS_CADF_MOVE + + + Constant Rotatez. + DIAXIS_CADF_ROTATEZ + + + Constant Device. + DIBUTTON_CADF_DEVICE + + + Constant Pause. + DIBUTTON_CADF_PAUSE + + + Constant Special2. + DIBUTTON_CADF_SPECIAL2 + + + Constant Menu. + DIBUTTON_CADF_MENU + + + Constant Special1. + DIBUTTON_CADF_SPECIAL1 + + + Constant Special. + DIBUTTON_CADF_SPECIAL + + + Constant Select. + DIBUTTON_CADF_SELECT + + + Constant Display. + DIBUTTON_CADF_DISPLAY + + + Constant Hatswitch. + DIHATSWITCH_CADF_HATSWITCH + + + + Functions + + + + + Constant XAxisStr. + GUID_XAxis + + + Constant YAxisStr. + GUID_YAxis + + + Constant ZAxisStr. + GUID_ZAxis + + + Constant RxAxisStr. + GUID_RxAxis + + + Constant RyAxisStr. + GUID_RyAxis + + + Constant RzAxisStr. + GUID_RzAxis + + + Constant ButtonStr. + GUID_Button + + + Constant KeyStr. + GUID_Key + + + Constant SliderStr. + GUID_Slider + + + Constant PovControllerStr. + GUID_POV + + + Constant UnknownStr. + GUID_Unknown + + + Constant XAxis. + GUID_XAxis + + + Constant YAxis. + GUID_YAxis + + + Constant ZAxis. + GUID_ZAxis + + + Constant RxAxis. + GUID_RxAxis + + + Constant RyAxis. + GUID_RyAxis + + + Constant RzAxis. + GUID_RzAxis + + + Constant Button. + GUID_Button + + + Constant Key. + GUID_Key + + + Constant Slider. + GUID_Slider + + + Constant PovController. + GUID_POV + + + Constant Unknown. + GUID_Unknown + + + + Functions + + + + + Constant Objects2DGenre. + DIVIRTUAL_CAD_2DCONTROL + + + Constant Lateral. + DIAXIS_2DCONTROL_LATERAL + + + Constant Inout. + DIAXIS_2DCONTROL_INOUT + + + Constant Move. + DIAXIS_2DCONTROL_MOVE + + + Constant Rotatez. + DIAXIS_2DCONTROL_ROTATEZ + + + Constant Special2. + DIBUTTON_2DCONTROL_SPECIAL2 + + + Constant Device. + DIBUTTON_2DCONTROL_DEVICE + + + Constant Special1. + DIBUTTON_2DCONTROL_SPECIAL1 + + + Constant Special. + DIBUTTON_2DCONTROL_SPECIAL + + + Constant Menu. + DIBUTTON_2DCONTROL_MENU + + + Constant Display. + DIBUTTON_2DCONTROL_DISPLAY + + + Constant Pause. + DIBUTTON_2DCONTROL_PAUSE + + + Constant Select. + DIBUTTON_2DCONTROL_SELECT + + + Constant Hatswitch. + DIHATSWITCH_2DCONTROL_HATSWITCH + + + + Functions + + + + + Constant Objects3DGenre. + DIVIRTUAL_CAD_3DCONTROL + + + Constant Rotatex. + DIAXIS_3DCONTROL_ROTATEX + + + Constant Rotatey. + DIAXIS_3DCONTROL_ROTATEY + + + Constant Rotatez. + DIAXIS_3DCONTROL_ROTATEZ + + + Constant Inout. + DIAXIS_3DCONTROL_INOUT + + + Constant Lateral. + DIAXIS_3DCONTROL_LATERAL + + + Constant Move. + DIAXIS_3DCONTROL_MOVE + + + Constant Special1. + DIBUTTON_3DCONTROL_SPECIAL1 + + + Constant Pause. + DIBUTTON_3DCONTROL_PAUSE + + + Constant Select. + DIBUTTON_3DCONTROL_SELECT + + + Constant Display. + DIBUTTON_3DCONTROL_DISPLAY + + + Constant Special. + DIBUTTON_3DCONTROL_SPECIAL + + + Constant Device. + DIBUTTON_3DCONTROL_DEVICE + + + Constant Special2. + DIBUTTON_3DCONTROL_SPECIAL2 + + + Constant Menu. + DIBUTTON_3DCONTROL_MENU + + + Constant Hatswitch. + DIHATSWITCH_3DCONTROL_HATSWITCH + + + + Functions + + + + + Constant PlatformGenre. + DIVIRTUAL_ARCADE_PLATFORM + + + Constant Lateral. + DIAXIS_ARCADEP_LATERAL + + + Constant Move. + DIAXIS_ARCADEP_MOVE + + + Constant Special. + DIBUTTON_ARCADEP_SPECIAL + + + Constant LeftLink. + DIBUTTON_ARCADEP_LEFT_LINK + + + Constant Fire. + DIBUTTON_ARCADEP_FIRE + + + Constant Menu. + DIBUTTON_ARCADEP_MENU + + + Constant BackLink. + DIBUTTON_ARCADEP_BACK_LINK + + + Constant Jump. + DIBUTTON_ARCADEP_JUMP + + + Constant RightLink. + DIBUTTON_ARCADEP_RIGHT_LINK + + + Constant Device. + DIBUTTON_ARCADEP_DEVICE + + + Constant ViewLeftLink. + DIBUTTON_ARCADEP_VIEW_LEFT_LINK + + + Constant Firesecondary. + DIBUTTON_ARCADEP_FIRESECONDARY + + + Constant ForwardLink. + DIBUTTON_ARCADEP_FORWARD_LINK + + + Constant ViewUpLink. + DIBUTTON_ARCADEP_VIEW_UP_LINK + + + Constant Pause. + DIBUTTON_ARCADEP_PAUSE + + + Constant Select. + DIBUTTON_ARCADEP_SELECT + + + Constant Crouch. + DIBUTTON_ARCADEP_CROUCH + + + Constant ViewRightLink. + DIBUTTON_ARCADEP_VIEW_RIGHT_LINK + + + Constant ViewDownLink. + DIBUTTON_ARCADEP_VIEW_DOWN_LINK + + + Constant View. + DIHATSWITCH_ARCADEP_VIEW + + + + Functions + + + + + Constant GetPortdisplayname. + DIPROP_GETPORTDISPLAYNAME + + + Constant LogicalRange. + DIPROP_LOGICALRANGE + + + Constant Appdata. + DIPROP_APPDATA + + + Constant Ffgain. + DIPROP_FFGAIN + + + Constant Keyname. + DIPROP_KEYNAME + + + Constant Ffload. + DIPROP_FFLOAD + + + Constant Username. + DIPROP_USERNAME + + + Constant Physicalrange. + DIPROP_PHYSICALRANGE + + + Constant Autocenter. + DIPROP_AUTOCENTER + + + Constant Calibrationmode. + DIPROP_CALIBRATIONMODE + + + Constant Saturation. + DIPROP_SATURATION + + + Constant Calibration. + DIPROP_CALIBRATION + + + Constant Productname. + DIPROP_PRODUCTNAME + + + Constant Vidpid. + DIPROP_VIDPID + + + Constant BufferSize. + DIPROP_BUFFERSIZE + + + Constant Range. + DIPROP_RANGE + + + Constant Cpoints. + DIPROP_CPOINTS + + + Constant Scancode. + DIPROP_SCANCODE + + + Constant Granularity. + DIPROP_GRANULARITY + + + Constant Joystickid. + DIPROP_JOYSTICKID + + + Constant InstanceName. + DIPROP_INSTANCENAME + + + Constant Deadzone. + DIPROP_DEADZONE + + + Constant Guidandpath. + DIPROP_GUIDANDPATH + + + Constant Axismode. + DIPROP_AXISMODE + + + Constant Typename. + DIPROP_TYPENAME + + + + Functions + + + + + Constant RacingGenre. + DIVIRTUAL_DRIVING_RACE + + + Constant Steer. + DIAXIS_DRIVINGR_STEER + + + Constant Accelerate. + DIAXIS_DRIVINGR_ACCELERATE + + + Constant BrakeAxis. + DIAXIS_DRIVINGR_BRAKE + + + Constant AccelerateAndBrake. + DIAXIS_DRIVINGR_ACCEL_AND_BRAKE + + + Constant Map. + DIBUTTON_DRIVINGR_MAP + + + Constant AccelerateLink. + DIBUTTON_DRIVINGR_ACCELERATE_LINK + + + Constant Shiftdown. + DIBUTTON_DRIVINGR_SHIFTDOWN + + + Constant View. + DIBUTTON_DRIVINGR_VIEW + + + Constant Menu. + DIBUTTON_DRIVINGR_MENU + + + Constant Dashboard. + DIBUTTON_DRIVINGR_DASHBOARD + + + Constant GlanceRightLink. + DIBUTTON_DRIVINGR_GLANCE_RIGHT_LINK + + + Constant Pit. + DIBUTTON_DRIVINGR_PIT + + + Constant Shiftup. + DIBUTTON_DRIVINGR_SHIFTUP + + + Constant SteerRightLink. + DIBUTTON_DRIVINGR_STEER_RIGHT_LINK + + + Constant Pause. + DIBUTTON_DRIVINGR_PAUSE + + + Constant GlanceLeftLink. + DIBUTTON_DRIVINGR_GLANCE_LEFT_LINK + + + Constant Device. + DIBUTTON_DRIVINGR_DEVICE + + + Constant Brake. + DIBUTTON_DRIVINGR_BRAKE + + + Constant Boost. + DIBUTTON_DRIVINGR_BOOST + + + Constant SteerLeftLink. + DIBUTTON_DRIVINGR_STEER_LEFT_LINK + + + Constant Aids. + DIBUTTON_DRIVINGR_AIDS + + + Constant Glance. + DIHATSWITCH_DRIVINGR_GLANCE + + + + Functions + + + + + Constant RacquetGenre. + DIVIRTUAL_SPORTS_RACQUET + + + Constant Lateral. + DIAXIS_RACQUET_LATERAL + + + Constant Move. + DIAXIS_RACQUET_MOVE + + + Constant Special. + DIBUTTON_RACQUET_SPECIAL + + + Constant Pause. + DIBUTTON_RACQUET_PAUSE + + + Constant RightLink. + DIBUTTON_RACQUET_RIGHT_LINK + + + Constant BackLink. + DIBUTTON_RACQUET_BACK_LINK + + + Constant SubStitute. + DIBUTTON_RACQUET_SUBSTITUTE + + + Constant LeftLink. + DIBUTTON_RACQUET_LEFT_LINK + + + Constant Device. + DIBUTTON_RACQUET_DEVICE + + + Constant Select. + DIBUTTON_RACQUET_SELECT + + + Constant Timeout. + DIBUTTON_RACQUET_TIMEOUT + + + Constant Smash. + DIBUTTON_RACQUET_SMASH + + + Constant ForwardLink. + DIBUTTON_RACQUET_FORWARD_LINK + + + Constant Backswing. + DIBUTTON_RACQUET_BACKSWING + + + Constant Swing. + DIBUTTON_RACQUET_SWING + + + Constant Menu. + DIBUTTON_RACQUET_MENU + + + Constant Glance. + DIHATSWITCH_RACQUET_GLANCE + + + + Functions + + + + + Constant RacquetGenre. + DIVIRTUAL_REMOTE_CONTROL + + + Constant Slider2. + DIAXIS_REMOTE_SLIDER2 + + + Constant Slider. + DIAXIS_REMOTE_SLIDER + + + Constant Cd. + DIBUTTON_REMOTE_CD + + + Constant Select. + DIBUTTON_REMOTE_SELECT + + + Constant Digit9. + DIBUTTON_REMOTE_DIGIT9 + + + Constant Digit6. + DIBUTTON_REMOTE_DIGIT6 + + + Constant Device. + DIBUTTON_REMOTE_DEVICE + + + Constant Digit3. + DIBUTTON_REMOTE_DIGIT3 + + + Constant Digit0. + DIBUTTON_REMOTE_DIGIT0 + + + Constant Play. + DIBUTTON_REMOTE_PLAY + + + Constant Pause. + DIBUTTON_REMOTE_PAUSE + + + Constant Cable. + DIBUTTON_REMOTE_CABLE + + + Constant ReverseIew. + DIBUTTON_REMOTE_REVIEW + + + Constant Cue. + DIBUTTON_REMOTE_CUE + + + Constant Mute. + DIBUTTON_REMOTE_MUTE + + + Constant Digit8. + DIBUTTON_REMOTE_DIGIT8 + + + Constant Digit5. + DIBUTTON_REMOTE_DIGIT5 + + + Constant Tv. + DIBUTTON_REMOTE_TV + + + Constant Vcr. + DIBUTTON_REMOTE_VCR + + + Constant Menu. + DIBUTTON_REMOTE_MENU + + + Constant Adjust. + DIBUTTON_REMOTE_ADJUST + + + Constant Digit4. + DIBUTTON_REMOTE_DIGIT4 + + + Constant Record. + DIBUTTON_REMOTE_RECORD + + + Constant Change. + DIBUTTON_REMOTE_CHANGE + + + Constant Digit2. + DIBUTTON_REMOTE_DIGIT2 + + + Constant Dvd. + DIBUTTON_REMOTE_DVD + + + Constant Digit1. + DIBUTTON_REMOTE_DIGIT1 + + + Constant Digit7. + DIBUTTON_REMOTE_DIGIT7 + + + Constant Tuner. + DIBUTTON_REMOTE_TUNER + + + + Functions + + + + + Constant Ok. + DI_OK + + + Constant NotAttached. + DI_NOTATTACHED + + + Constant BufferOverflow. + DI_BUFFEROVERFLOW + + + Constant PropertyHadNoEffect. + DI_PROPNOEFFECT + + + Constant NoEffect. + DI_NOEFFECT + + + Constant PolledDevice. + DI_POLLEDDEVICE + + + Constant DownloadSkipped. + DI_DOWNLOADSKIPPED + + + Constant EffectRestarted. + DI_EFFECTRESTARTED + + + Constant Truncated. + DI_TRUNCATED + + + Constant SettingsNotSaved. + DI_SETTINGSNOTSAVED + + + Constant TruncatedAndRestarted. + DI_TRUNCATEDANDRESTARTED + + + Constant WriteProtect. + DI_WRITEPROTECT + + + Constant ReadOnly. + DIERR_READONLY + + + Constant NotFound. + DIERR_NOTFOUND + + + Constant MapFileFail. + DIERR_MAPFILEFAIL + + + Constant AlreadyInitialized. + DIERR_ALREADYINITIALIZED + + + Constant IncompleteEffect. + DIERR_INCOMPLETEEFFECT + + + Constant InvalidParam. + DIERR_INVALIDPARAM + + + Constant EffectPlaying. + DIERR_EFFECTPLAYING + + + Constant NotInitialized. + DIERR_NOTINITIALIZED + + + Constant NotAcquired. + DIERR_NOTACQUIRED + + + Constant HandleExists. + DIERR_HANDLEEXISTS + + + Constant HasEffects. + DIERR_HASEFFECTS + + + Constant OldDirectInputVersion. + DIERR_OLDDIRECTINPUTVERSION + + + Constant NoAggregation. + DIERR_NOAGGREGATION + + + Constant MoreData. + DIERR_MOREDATA + + + Constant DeviceFull. + DIERR_DEVICEFULL + + + Constant ReportFull. + DIERR_REPORTFULL + + + Constant NotDownloaded. + DIERR_NOTDOWNLOADED + + + Constant NotBuffered. + DIERR_NOTBUFFERED + + + Constant ObjectNotFound. + DIERR_OBJECTNOTFOUND + + + Constant InsufficientPrivileges. + DIERR_INSUFFICIENTPRIVS + + + Constant NoInterface. + DIERR_NOINTERFACE + + + Constant OutOfMemory. + DIERR_OUTOFMEMORY + + + Constant DeviceNotRegistered. + DIERR_DEVICENOTREG + + + Constant Generic. + DIERR_GENERIC + + + Constant OtherApplicationHasPriority. + DIERR_OTHERAPPHASPRIO + + + Constant NotExclusiveAcquired. + DIERR_NOTEXCLUSIVEACQUIRED + + + Constant InputLost. + DIERR_INPUTLOST + + + Constant BetaDirectInputVersion. + DIERR_BETADIRECTINPUTVERSION + + + Constant BadDriverVersion. + DIERR_BADDRIVERVER + + + Constant Acquired. + DIERR_ACQUIRED + + + Constant Unplugged. + DIERR_UNPLUGGED + + + Constant Unsupported. + DIERR_UNSUPPORTED + + + + Functions + + + + + Constant RolePlayingGenre. + DIVIRTUAL_STRATEGY_ROLEPLAYING + + + Constant Lateral. + DIAXIS_STRATEGYR_LATERAL + + + Constant Move. + DIAXIS_STRATEGYR_MOVE + + + Constant Rotate. + DIAXIS_STRATEGYR_ROTATE + + + Constant Map. + DIBUTTON_STRATEGYR_MAP + + + Constant Crouch. + DIBUTTON_STRATEGYR_CROUCH + + + Constant Cast. + DIBUTTON_STRATEGYR_CAST + + + Constant Get. + DIBUTTON_STRATEGYR_GET + + + Constant RotateLeftLink. + DIBUTTON_STRATEGYR_ROTATE_LEFT_LINK + + + Constant Display. + DIBUTTON_STRATEGYR_DISPLAY + + + Constant LeftLink. + DIBUTTON_STRATEGYR_LEFT_LINK + + + Constant Pause. + DIBUTTON_STRATEGYR_PAUSE + + + Constant ForwardLink. + DIBUTTON_STRATEGYR_FORWARD_LINK + + + Constant Select. + DIBUTTON_STRATEGYR_SELECT + + + Constant RightLink. + DIBUTTON_STRATEGYR_RIGHT_LINK + + + Constant RotateRightLink. + DIBUTTON_STRATEGYR_ROTATE_RIGHT_LINK + + + Constant Jump. + DIBUTTON_STRATEGYR_JUMP + + + Constant Device. + DIBUTTON_STRATEGYR_DEVICE + + + Constant BackLink. + DIBUTTON_STRATEGYR_BACK_LINK + + + Constant Menu. + DIBUTTON_STRATEGYR_MENU + + + Constant Apply. + DIBUTTON_STRATEGYR_APPLY + + + Constant Attack. + DIBUTTON_STRATEGYR_ATTACK + + + Constant Glance. + DIHATSWITCH_STRATEGYR_GLANCE + + + + Functions + + + + + Constant Sidestep. + DIAXIS_FPS_SIDESTEP + + + Constant Move. + DIAXIS_FPS_MOVE + + + Constant Rotate. + DIAXIS_FPS_ROTATE + + + Constant Lookupdown. + DIAXIS_FPS_LOOKUPDOWN + + + Constant Firesecondary. + DIBUTTON_FPS_FIRESECONDARY + + + Constant GlanceDownLink. + DIBUTTON_FPS_GLANCE_DOWN_LINK + + + Constant StepRightLink. + DIBUTTON_FPS_STEP_RIGHT_LINK + + + Constant GlanceUpLink. + DIBUTTON_FPS_GLANCE_UP_LINK + + + Constant Jump. + DIBUTTON_FPS_JUMP + + + Constant Strafe. + DIBUTTON_FPS_STRAFE + + + Constant BackwardLink. + DIBUTTON_FPS_BACKWARD_LINK + + + Constant Weapons. + DIBUTTON_FPS_WEAPONS + + + Constant Dodge. + DIBUTTON_FPS_DODGE + + + Constant Apply. + DIBUTTON_FPS_APPLY + + + Constant StepLeftLink. + DIBUTTON_FPS_STEP_LEFT_LINK + + + Constant Crouch. + DIBUTTON_FPS_CROUCH + + + Constant Pause. + DIBUTTON_FPS_PAUSE + + + Constant Menu. + DIBUTTON_FPS_MENU + + + Constant Glancer. + DIBUTTON_FPS_GLANCER + + + Constant RotateLeftLink. + DIBUTTON_FPS_ROTATE_LEFT_LINK + + + Constant Glancel. + DIBUTTON_FPS_GLANCEL + + + Constant ForwardLink. + DIBUTTON_FPS_FORWARD_LINK + + + Constant Fire. + DIBUTTON_FPS_FIRE + + + Constant Device. + DIBUTTON_FPS_DEVICE + + + Constant Select. + DIBUTTON_FPS_SELECT + + + Constant Display. + DIBUTTON_FPS_DISPLAY + + + Constant RotateRightLink. + DIBUTTON_FPS_ROTATE_RIGHT_LINK + + + Constant Glance. + DIHATSWITCH_FPS_GLANCE + + + + Functions + + + + + Constant SideToSideGenre. + DIVIRTUAL_ARCADE_SIDE2SIDE + + + Constant Lateral. + DIAXIS_ARCADES_LATERAL + + + Constant Move. + DIAXIS_ARCADES_MOVE + + + Constant ViewDownLink. + DIBUTTON_ARCADES_VIEW_DOWN_LINK + + + Constant Carry. + DIBUTTON_ARCADES_CARRY + + + Constant LeftLink. + DIBUTTON_ARCADES_LEFT_LINK + + + Constant Select. + DIBUTTON_ARCADES_SELECT + + + Constant ViewRightLink. + DIBUTTON_ARCADES_VIEW_RIGHT_LINK + + + Constant Device. + DIBUTTON_ARCADES_DEVICE + + + Constant Pause. + DIBUTTON_ARCADES_PAUSE + + + Constant Throw. + DIBUTTON_ARCADES_THROW + + + Constant BackLink. + DIBUTTON_ARCADES_BACK_LINK + + + Constant Attack. + DIBUTTON_ARCADES_ATTACK + + + Constant ViewLeftLink. + DIBUTTON_ARCADES_VIEW_LEFT_LINK + + + Constant ForwardLink. + DIBUTTON_ARCADES_FORWARD_LINK + + + Constant ViewUpLink. + DIBUTTON_ARCADES_VIEW_UP_LINK + + + Constant RightLink. + DIBUTTON_ARCADES_RIGHT_LINK + + + Constant Special. + DIBUTTON_ARCADES_SPECIAL + + + Constant Menu. + DIBUTTON_ARCADES_MENU + + + Constant View. + DIHATSWITCH_ARCADES_VIEW + + + + Functions + + + + + Constant SkiingGenre. + DIVIRTUAL_SPORTS_SKIING + + + Constant Turn. + DIAXIS_SKIING_TURN + + + Constant Speed. + DIAXIS_SKIING_SPEED + + + Constant Device. + DIBUTTON_SKIING_DEVICE + + + Constant Menu. + DIBUTTON_SKIING_MENU + + + Constant FasterLink. + DIBUTTON_SKIING_FASTER_LINK + + + Constant SlowerLink. + DIBUTTON_SKIING_SLOWER_LINK + + + Constant Pause. + DIBUTTON_SKIING_PAUSE + + + Constant Crouch. + DIBUTTON_SKIING_CROUCH + + + Constant Special2. + DIBUTTON_SKIING_SPECIAL2 + + + Constant LeftLink. + DIBUTTON_SKIING_LEFT_LINK + + + Constant RightLink. + DIBUTTON_SKIING_RIGHT_LINK + + + Constant Zoom. + DIBUTTON_SKIING_ZOOM + + + Constant Camera. + DIBUTTON_SKIING_CAMERA + + + Constant Jump. + DIBUTTON_SKIING_JUMP + + + Constant Select. + DIBUTTON_SKIING_SELECT + + + Constant Special1. + DIBUTTON_SKIING_SPECIAL1 + + + Constant Glance. + DIHATSWITCH_SKIING_GLANCE + + + + Functions + + + + + Constant SoccerDefenseGenre. + DIVIRTUAL_SPORTS_SOCCER_DEFENSE + + + Constant Lateral. + DIAXIS_SOCCERD_LATERAL + + + Constant Move. + DIAXIS_SOCCERD_MOVE + + + Constant Head. + DIBUTTON_SOCCERD_HEAD + + + Constant Slide. + DIBUTTON_SOCCERD_SLIDE + + + Constant Foul. + DIBUTTON_SOCCERD_FOUL + + + Constant Fake. + DIBUTTON_SOCCERD_FAKE + + + Constant Steal. + DIBUTTON_SOCCERD_STEAL + + + Constant Pause. + DIBUTTON_SOCCERD_PAUSE + + + Constant LeftLink. + DIBUTTON_SOCCERD_LEFT_LINK + + + Constant Block. + DIBUTTON_SOCCERD_BLOCK + + + Constant Select. + DIBUTTON_SOCCERD_SELECT + + + Constant Device. + DIBUTTON_SOCCERD_DEVICE + + + Constant RightLink. + DIBUTTON_SOCCERD_RIGHT_LINK + + + Constant SubStitute. + DIBUTTON_SOCCERD_SUBSTITUTE + + + Constant Clear. + DIBUTTON_SOCCERD_CLEAR + + + Constant BackLink. + DIBUTTON_SOCCERD_BACK_LINK + + + Constant Player. + DIBUTTON_SOCCERD_PLAYER + + + Constant ForwardLink. + DIBUTTON_SOCCERD_FORWARD_LINK + + + Constant Menu. + DIBUTTON_SOCCERD_MENU + + + Constant Goaliecharge. + DIBUTTON_SOCCERD_GOALIECHARGE + + + Constant Special. + DIBUTTON_SOCCERD_SPECIAL + + + Constant Glance. + DIHATSWITCH_SOCCERD_GLANCE + + + + Functions + + + + + Constant SoccerOffenceGenre. + DIVIRTUAL_SPORTS_SOCCER_OFFENSE + + + Constant Lateral. + DIAXIS_SOCCERO_LATERAL + + + Constant Move. + DIAXIS_SOCCERO_MOVE + + + Constant Bend. + DIAXIS_SOCCERO_BEND + + + Constant LeftLink. + DIBUTTON_SOCCERO_LEFT_LINK + + + Constant Player. + DIBUTTON_SOCCERO_PLAYER + + + Constant Sprint. + DIBUTTON_SOCCERO_SPRINT + + + Constant ForwardLink. + DIBUTTON_SOCCERO_FORWARD_LINK + + + Constant Shootlow. + DIBUTTON_SOCCERO_SHOOTLOW + + + Constant Control. + DIBUTTON_SOCCERO_CONTROL + + + Constant Device. + DIBUTTON_SOCCERO_DEVICE + + + Constant Shoot. + DIBUTTON_SOCCERO_SHOOT + + + Constant RightLink. + DIBUTTON_SOCCERO_RIGHT_LINK + + + Constant Menu. + DIBUTTON_SOCCERO_MENU + + + Constant BackLink. + DIBUTTON_SOCCERO_BACK_LINK + + + Constant Pass. + DIBUTTON_SOCCERO_PASS + + + Constant SubStitute. + DIBUTTON_SOCCERO_SUBSTITUTE + + + Constant Fake. + DIBUTTON_SOCCERO_FAKE + + + Constant Head. + DIBUTTON_SOCCERO_HEAD + + + Constant Pause. + DIBUTTON_SOCCERO_PAUSE + + + Constant Passthru. + DIBUTTON_SOCCERO_PASSTHRU + + + Constant Shoothigh. + DIBUTTON_SOCCERO_SHOOTHIGH + + + Constant Select. + DIBUTTON_SOCCERO_SELECT + + + Constant Special1. + DIBUTTON_SOCCERO_SPECIAL1 + + + Constant Glance. + DIHATSWITCH_SOCCERO_GLANCE + + + + Functions + + + + + Constant SpaceCombatGenre. + DIVIRTUAL_SPACESIM + + + Constant Rotate. + DIAXIS_SPACESIM_ROTATE + + + Constant Climb. + DIAXIS_SPACESIM_CLIMB + + + Constant Lateral. + DIAXIS_SPACESIM_LATERAL + + + Constant Throttle. + DIAXIS_SPACESIM_THROTTLE + + + Constant Move. + DIAXIS_SPACESIM_MOVE + + + Constant TurnRightLink. + DIBUTTON_SPACESIM_TURN_RIGHT_LINK + + + Constant FasterLink. + DIBUTTON_SPACESIM_FASTER_LINK + + + Constant Gear. + DIBUTTON_SPACESIM_GEAR + + + Constant Fire. + DIBUTTON_SPACESIM_FIRE + + + Constant RightLink. + DIBUTTON_SPACESIM_RIGHT_LINK + + + Constant Device. + DIBUTTON_SPACESIM_DEVICE + + + Constant GlanceDownLink. + DIBUTTON_SPACESIM_GLANCE_DOWN_LINK + + + Constant GlanceLeftLink. + DIBUTTON_SPACESIM_GLANCE_LEFT_LINK + + + Constant Menu. + DIBUTTON_SPACESIM_MENU + + + Constant Pause. + DIBUTTON_SPACESIM_PAUSE + + + Constant Lower. + DIBUTTON_SPACESIM_LOWER + + + Constant GlanceRightLink. + DIBUTTON_SPACESIM_GLANCE_RIGHT_LINK + + + Constant BackwardLink. + DIBUTTON_SPACESIM_BACKWARD_LINK + + + Constant TurnLeftLink. + DIBUTTON_SPACESIM_TURN_LEFT_LINK + + + Constant LeftLink. + DIBUTTON_SPACESIM_LEFT_LINK + + + Constant GlanceUpLink. + DIBUTTON_SPACESIM_GLANCE_UP_LINK + + + Constant SlowerLink. + DIBUTTON_SPACESIM_SLOWER_LINK + + + Constant Weapons. + DIBUTTON_SPACESIM_WEAPONS + + + Constant View. + DIBUTTON_SPACESIM_VIEW + + + Constant ForwardLink. + DIBUTTON_SPACESIM_FORWARD_LINK + + + Constant Firesecondary. + DIBUTTON_SPACESIM_FIRESECONDARY + + + Constant Display. + DIBUTTON_SPACESIM_DISPLAY + + + Constant Raise. + DIBUTTON_SPACESIM_RAISE + + + Constant Target. + DIBUTTON_SPACESIM_TARGET + + + Constant Glance. + DIHATSWITCH_SPACESIM_GLANCE + + + + Functions + + + + + Constant TankDrivingGenre. + DIVIRTUAL_DRIVING_TANK + + + Constant BrakeAxis. + DIAXIS_DRIVINGT_BRAKE + + + Constant AccelerateAndBrake. + DIAXIS_DRIVINGT_ACCEL_AND_BRAKE + + + Constant Rotate. + DIAXIS_DRIVINGT_ROTATE + + + Constant Accelerate. + DIAXIS_DRIVINGT_ACCELERATE + + + Constant Steer. + DIAXIS_DRIVINGT_STEER + + + Constant Barrel. + DIAXIS_DRIVINGT_BARREL + + + Constant BarrelDownLink. + DIBUTTON_DRIVINGT_BARREL_DOWN_LINK + + + Constant GlanceRightLink. + DIBUTTON_DRIVINGT_GLANCE_RIGHT_LINK + + + Constant RotateRightLink. + DIBUTTON_DRIVINGT_ROTATE_RIGHT_LINK + + + Constant View. + DIBUTTON_DRIVINGT_VIEW + + + Constant AccelerateLink. + DIBUTTON_DRIVINGT_ACCELERATE_LINK + + + Constant Dashboard. + DIBUTTON_DRIVINGT_DASHBOARD + + + Constant Device. + DIBUTTON_DRIVINGT_DEVICE + + + Constant SteerLeftLink. + DIBUTTON_DRIVINGT_STEER_LEFT_LINK + + + Constant Weapons. + DIBUTTON_DRIVINGT_WEAPONS + + + Constant Firesecondary. + DIBUTTON_DRIVINGT_FIRESECONDARY + + + Constant BarrelUpLink. + DIBUTTON_DRIVINGT_BARREL_UP_LINK + + + Constant Brake. + DIBUTTON_DRIVINGT_BRAKE + + + Constant SteerRightLink. + DIBUTTON_DRIVINGT_STEER_RIGHT_LINK + + + Constant Fire. + DIBUTTON_DRIVINGT_FIRE + + + Constant GlanceLeftLink. + DIBUTTON_DRIVINGT_GLANCE_LEFT_LINK + + + Constant RotateLeftLink. + DIBUTTON_DRIVINGT_ROTATE_LEFT_LINK + + + Constant Pause. + DIBUTTON_DRIVINGT_PAUSE + + + Constant Menu. + DIBUTTON_DRIVINGT_MENU + + + Constant Target. + DIBUTTON_DRIVINGT_TARGET + + + Constant Glance. + DIHATSWITCH_DRIVINGT_GLANCE + + + + Functions + + + + + Constant TankDrivingGenre. + DIVIRTUAL_FIGHTING_THIRDPERSON + + + Constant Step. + DIAXIS_TPS_STEP + + + Constant Move. + DIAXIS_TPS_MOVE + + + Constant Turn. + DIAXIS_TPS_TURN + + + Constant Dodge. + DIBUTTON_TPS_DODGE + + + Constant InverseEntory. + DIBUTTON_TPS_INVENTORY + + + Constant ForwardLink. + DIBUTTON_TPS_FORWARD_LINK + + + Constant GlanceRightLink. + DIBUTTON_TPS_GLANCE_RIGHT_LINK + + + Constant GlanceUpLink. + DIBUTTON_TPS_GLANCE_UP_LINK + + + Constant Stepleft. + DIBUTTON_TPS_STEPLEFT + + + Constant Pause. + DIBUTTON_TPS_PAUSE + + + Constant GlanceLeftLink. + DIBUTTON_TPS_GLANCE_LEFT_LINK + + + Constant Menu. + DIBUTTON_TPS_MENU + + + Constant Run. + DIBUTTON_TPS_RUN + + + Constant Jump. + DIBUTTON_TPS_JUMP + + + Constant BackwardLink. + DIBUTTON_TPS_BACKWARD_LINK + + + Constant TurnLeftLink. + DIBUTTON_TPS_TURN_LEFT_LINK + + + Constant Use. + DIBUTTON_TPS_USE + + + Constant Action. + DIBUTTON_TPS_ACTION + + + Constant TurnRightLink. + DIBUTTON_TPS_TURN_RIGHT_LINK + + + Constant View. + DIBUTTON_TPS_VIEW + + + Constant Select. + DIBUTTON_TPS_SELECT + + + Constant Stepright. + DIBUTTON_TPS_STEPRIGHT + + + Constant Device. + DIBUTTON_TPS_DEVICE + + + Constant GlanceDownLink. + DIBUTTON_TPS_GLANCE_DOWN_LINK + + + Constant Glance. + DIHATSWITCH_TPS_GLANCE + + + + Functions + + + + + Constant TankDrivingGenre. + DIVIRTUAL_STRATEGY_TURN + + + Constant Lateral. + DIAXIS_STRATEGYT_LATERAL + + + Constant Move. + DIAXIS_STRATEGYT_MOVE + + + Constant Zoom. + DIBUTTON_STRATEGYT_ZOOM + + + Constant RightLink. + DIBUTTON_STRATEGYT_RIGHT_LINK + + + Constant Display. + DIBUTTON_STRATEGYT_DISPLAY + + + Constant Menu. + DIBUTTON_STRATEGYT_MENU + + + Constant LeftLink. + DIBUTTON_STRATEGYT_LEFT_LINK + + + Constant Pause. + DIBUTTON_STRATEGYT_PAUSE + + + Constant Team. + DIBUTTON_STRATEGYT_TEAM + + + Constant Device. + DIBUTTON_STRATEGYT_DEVICE + + + Constant Select. + DIBUTTON_STRATEGYT_SELECT + + + Constant BackLink. + DIBUTTON_STRATEGYT_BACK_LINK + + + Constant Apply. + DIBUTTON_STRATEGYT_APPLY + + + Constant ForwardLink. + DIBUTTON_STRATEGYT_FORWARD_LINK + + + Constant Map. + DIBUTTON_STRATEGYT_MAP + + + Constant Instruct. + DIBUTTON_STRATEGYT_INSTRUCT + + + Constant Turn. + DIBUTTON_STRATEGYT_TURN + + + +

Describes a mapping of one game action to one device semantic. An array of structures is contained by a structure.

Syntax
 typedef struct _DIACTION {     uAppData; DWORD       dwSemantic; DWORD       dwFlags; union { LPCTSTR lptszActionName; UINT    uResIdString; };         guidInstance; DWORD       dwObjID; DWORD       dwHow;	
+            } , *LPDIACTION; typedef const  *LPCDIACTION;	
+            
Members
uAppData
Address of an application-defined UINT value to be returned to the application by when the state of the control associated with the action changes. This value is returned in the uAppData member of the structure. It is typically an identifier for the application-specific action associated with the device object, but can also be a function reference.
dwSemantic
For a joystick, a predefined action mapping constant for this application genre representing a virtual control or a constant for a control not defined in the genre. For a keyboard or mouse, a constant that represents a particular device object. See Action Mapping Constants.
dwFlags

Flags used to request specific attributes or processing. Can be zero or one or more of the following values.

DIA_APPFIXED
The action cannot be remapped by DirectInput.
DIA_APPMAPPED
The dwObjID member is valid, and will not override the application-defined mapping.
DIA_APPNOMAP
This action is not to be mapped.
DIA_FORCEFEEDBACK
The action must be mapped to an actuator or trigger.
DIA_NORANGE
The default range is not to be set for this action. This flag can be set only for absolute axis actions.
lptszActionName
Application-defined name of the action. This string is displayed by the device property sheet when IDirectInput8::ConfigureDevices is called.
uResIdString
Resource identifier for the string for this action. The module instance for this resource is specified in the hInstString member of the structure that contains this structure.
guidInstance
Device instance globally unique identifier () if a specific device is requested. Otherwise GUID_NULL.
dwObjID
Control identifier. Use the DIDFT_GETINSTANCE and DIDFT_GetType macros to retrieve the instance and type from this value.
dwHow

When the structure is returned by , this member receives a value to indicate the mapping mechanism used by DirectInput to configure the action. This member is ignored when the action map is passed to . The following values are defined.

DIAH_APPREQUESTED
The mapping was configured by the application, which specified the device (guidInstance) and device object (dwObjID) when calling .
DIAH_DEFAULT
The mapping was determined by DirectInput in the absence of other mapping information.
DIAH_ERROR
An error occurred. The action cannot be matched to a control on the device. The action will be ignored when the action map is set.
DIAH_HWAPP
The mapping was specified by the hardware manufacturer for this game.
DIAH_HWDEFAULT
The mapping was specified by the hardware manufacturer for this genre.
DIAH_UNMAPPED
No suitable device object was found.
DIAH_USERCONFIG
The mapping was configured by the user.
+
+ + ee416598 + DIACTIONW + DIACTIONW +
+ + + No documentation. + + + ee416598 + UINT_PTR uAppData + UINT_PTR uAppData + + + + No documentation. + + + ee416598 + unsigned int dwSemantic + unsigned int dwSemantic + + + + No documentation. + + + ee416598 + unsigned int dwFlags + unsigned int dwFlags + + + + No documentation. + + + ee416598 + const void* lptszActionName + void lptszActionName + + + + No documentation. + + + ee416598 + GUID guidInstance + GUID guidInstance + + + + No documentation. + + + ee416598 + unsigned int dwObjID + unsigned int dwObjID + + + + No documentation. + + + ee416598 + unsigned int dwHow + unsigned int dwHow + + + + Contains information about the calling application and acts as a container for an array ofDIACTIONstructures that define action-to-control mappings for a genre. + + +

The ftTimeStamp member can contain special values that apply to new and unused devices. New devices have never been enumerated for this application and have never had an action map applied to them. Unused devices have been enumerated for the application before but have never had an action map applied. New devices always have DIAFTS_NEWDEVICELOW and DIAFTS_NEWDEVICEHIGH in the low and high DWORDs respectively of the structure. Unused devices have DIAFTS_UNUSEDDEVICELOW and DIAFTS_UNUSEDDEVICEHIGH in these positions.

Applications should not use ftTimeStamp to check for new devices. Instead, they should look for the DIEDBS_RECENTDEVICE and DIEDBS_NEWDEVICE flags in the enumeration callback. For more information, see DIEnumDevicesBySemanticsCallback.

+
+ + microsoft.directx_sdk.reference.diactionformat + DIACTIONFORMATW + DIACTIONFORMATW +
+ + + No documentation. + + + microsoft.directx_sdk.reference.diactionformat + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + microsoft.directx_sdk.reference.diactionformat + unsigned int dwActionSize + unsigned int dwActionSize + + + + No documentation. + + + microsoft.directx_sdk.reference.diactionformat + unsigned int dwDataSize + unsigned int dwDataSize + + + + No documentation. + + + microsoft.directx_sdk.reference.diactionformat + unsigned int dwNumActions + unsigned int dwNumActions + + + + No documentation. + + + microsoft.directx_sdk.reference.diactionformat + DIACTIONW* rgoAction + DIACTIONW rgoAction + + + + No documentation. + + + microsoft.directx_sdk.reference.diactionformat + GUID guidActionMap + GUID guidActionMap + + + + No documentation. + + + microsoft.directx_sdk.reference.diactionformat + unsigned int dwGenre + unsigned int dwGenre + + + + No documentation. + + + microsoft.directx_sdk.reference.diactionformat + unsigned int dwBufferSize + unsigned int dwBufferSize + + + + No documentation. + + + microsoft.directx_sdk.reference.diactionformat + int lAxisMin + int lAxisMin + + + + No documentation. + + + microsoft.directx_sdk.reference.diactionformat + int lAxisMax + int lAxisMax + + + + No documentation. + + + microsoft.directx_sdk.reference.diactionformat + HINSTANCE hInstString + HINSTANCE hInstString + + + + No documentation. + + + microsoft.directx_sdk.reference.diactionformat + FILETIME ftTimeStamp + FILETIME ftTimeStamp + + + + No documentation. + + + microsoft.directx_sdk.reference.diactionformat + unsigned int dwCRC + unsigned int dwCRC + + + + No documentation. + + + microsoft.directx_sdk.reference.diactionformat + wchar_t tszActionMap[260] + wchar_t tszActionMap + + + + Contains type-specific information for effects that are marked as .

A reference to an array of structures for an effect is passed in the lpvTypeSpecificParams member of the structure. The number of elements in the array must be either one, or equal to the number of axes associated with the effect.

+
+ +

Different types of conditions interpret the parameters differently, but the basic idea is that force resulting from a condition is equal to A(q - q0) where A is a scaling coefficient, q is some metric, and q0 is the neutral value for that metric.

The preceding simplified formula must be adjusted if a nonzero deadband is provided. If the metric is less than lOffset - lDeadBand, the resulting force is given by the following formula:

force = lNegativeCoefficient * ( q - ( lOffset - lDeadBand))

Similarly, if the metric is greater than lOffset + lDeadBand, the resulting force is given by the following formula:

force = lPositiveCoefficient * ( q - ( lOffset + lDeadBand))

A spring condition uses axis position as the metric.

A damper condition uses axis velocity as the metric.

An inertia condition uses axis acceleration as the metric.

If the number of structures in the array is equal to the number of axes for the effect, the first structure applies to the first axis, the second applies to the second axis, and so on. For example, a two-axis spring condition with lOffset set to 0 in both structures would have the same effect as the joystick self-centering spring. When a condition is defined for each axis in this way, the effect must not be rotated.

If there is a single structure for an effect with more than one axis, the direction along which the parameters of the structure are in effect is determined by the direction parameters passed in the rglDirection field of the structure. For example, a friction condition rotated 45 degrees (in polar coordinates) would resist joystick motion in the northeast-southwest direction but would have no effect on joystick motion in the northwest-southeast direction.

+
+ + microsoft.directx_sdk.reference.dicondition + DICONDITION + DICONDITION +
+ + + No documentation. + + + microsoft.directx_sdk.reference.dicondition + int lOffset + int lOffset + + + + No documentation. + + + microsoft.directx_sdk.reference.dicondition + int lPositiveCoefficient + int lPositiveCoefficient + + + + No documentation. + + + microsoft.directx_sdk.reference.dicondition + int lNegativeCoefficient + int lNegativeCoefficient + + + + No documentation. + + + microsoft.directx_sdk.reference.dicondition + unsigned int dwPositiveSaturation + unsigned int dwPositiveSaturation + + + + No documentation. + + + microsoft.directx_sdk.reference.dicondition + unsigned int dwNegativeSaturation + unsigned int dwNegativeSaturation + + + + No documentation. + + + microsoft.directx_sdk.reference.dicondition + int lDeadBand + int lDeadBand + + + + Carries information required to display a device image or an overlay image with a callout. This structure is passed to theIDirectInputDevice8::GetImageInfomethod as an array within aDIDEVICEIMAGEINFOHEADERstructure. + + + microsoft.directx_sdk.reference.dideviceimageinfo + DIDEVICEIMAGEINFOW + DIDEVICEIMAGEINFOW + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfo + wchar_t tszImagePath[260] + wchar_t tszImagePath + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfo + unsigned int dwFlags + unsigned int dwFlags + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfo + unsigned int dwViewID + unsigned int dwViewID + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfo + RECT rcOverlay + RECT rcOverlay + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfo + unsigned int dwObjID + unsigned int dwObjID + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfo + unsigned int dwcValidPts + unsigned int dwcValidPts + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfo + POINT rgptCalloutLine[5] + POINT rgptCalloutLine + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfo + RECT rcCalloutRect + RECT rcCalloutRect + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceimageinfo + unsigned int dwTextAlign + unsigned int dwTextAlign + + + + No documentation. + + + bb280505 + DIEFFESCAPE + DIEFFESCAPE + + + + No documentation. + + + bb280505 + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + bb280505 + unsigned int dwCommand + unsigned int dwCommand + + + + No documentation. + + + bb280505 + void* lpvInBuffer + void lpvInBuffer + + + + No documentation. + + + bb280505 + unsigned int cbInBuffer + unsigned int cbInBuffer + + + + No documentation. + + + bb280505 + void* lpvOutBuffer + void lpvOutBuffer + + + + No documentation. + + + bb280505 + unsigned int cbOutBuffer + unsigned int cbOutBuffer + + + + Contains buffered device information. This structure is used with theIDirectInputDevice8::GetDeviceDataand theIDirectInputDevice8::SendDeviceDatamethods. + + +

The system time returned in dwTimeStamp comes from the same clock used by the Microsoft Win32 GetTickCount or timeGetTime functions, but it produces potentially more precise values. For example, on Microsoft Windows 95, the GetTickCount timer is updated only every 55 milliseconds, but the dwTimeStamp value is accurate to within 1 millisecond. Therefore, if you call GetTickCount and it returns n, and you then receive an event with a timestamp of n + n1, you cannot assume that the event took place exactly n1 milliseconds after the call to GetTickCount.

+
+ + microsoft.directx_sdk.reference.dideviceobjectdata + DIDEVICEOBJECTDATA + DIDEVICEOBJECTDATA +
+ + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectdata + unsigned int dwOfs + unsigned int dwOfs + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectdata + unsigned int dwData + unsigned int dwData + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectdata + unsigned int dwTimeStamp + unsigned int dwTimeStamp + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectdata + unsigned int dwSequence + unsigned int dwSequence + + + + No documentation. + + + microsoft.directx_sdk.reference.dideviceobjectdata + UINT_PTR uAppData + UINT_PTR uAppData + + + + No documentation. + + + DIPROPCAL + DIPROPCAL + + + + No documentation. + + + DIPROPHEADER diph + DIPROPHEADER diph + + + + No documentation. + + + int lMin + int lMin + + + + No documentation. + + + int lCenter + int lCenter + + + + No documentation. + + + int lMax + int lMax + + + + Used to access properties whose values represent a globally unique identifier () and a path. + + +

The diph member must be initialized as follows:

Member + Value +
dwSize + sizeof(). +
dwHeaderSize + sizeof(). +
dwObj + For this structure, this member must be set to 0. +
dwHow + Specifies how the dwObj member should be interpreted. For this structure, dwHow should be . +

The property associated with the structure enables advanced applications to perform operations on a Human Interface Device (human interface device) that are not supported by DirectInput.

The application calls the method with as the rguidProp parameter. The class of the device is returned in the guidClass member of the structure, and the device interface path is returned in the wszPath member. The application can then call the CreateFile function on this path to access the device directly.

+
+ + microsoft.directx_sdk.reference.dipropguidandpath + DIPROPGUIDANDPATH + DIPROPGUIDANDPATH +
+ + +
structure.
+
+ + microsoft.directx_sdk.reference.dipropguidandpath + DIPROPHEADER diph + DIPROPHEADER diph +
+ + +
Class for the object.
+
+ + microsoft.directx_sdk.reference.dipropguidandpath + GUID guidClass + GUID guidClass +
+ + +
Returned path for the object. This is a Unicode string.
+
+ + microsoft.directx_sdk.reference.dipropguidandpath + wchar_t wszPath[260] + wchar_t wszPath +
+ + + No documentation. + + + bb280498 + DIPROPHEADER + DIPROPHEADER + + + + No documentation. + + + bb280498 + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + bb280498 + unsigned int dwHeaderSize + unsigned int dwHeaderSize + + + + No documentation. + + + bb280498 + unsigned int dwObj + unsigned int dwObj + + + + No documentation. + + + bb280498 + DIPH dwHow + DIPH dwHow + + + + No documentation. + + + bb280499 + DIPROPDWORD + DIPROPDWORD + + + + No documentation. + + + bb280499 + DIPROPHEADER diph + DIPROPHEADER diph + + + + No documentation. + + + bb280499 + unsigned int dwData + unsigned int dwData + + + + No documentation. + + + bb280497 + DIPROPPOINTER + DIPROPPOINTER + + + + No documentation. + + + bb280497 + DIPROPHEADER diph + DIPROPHEADER diph + + + + No documentation. + + + bb280497 + UINT_PTR uData + UINT_PTR uData + + + + Contains information about the range of an object within a device. This structure is used with the flag set in theIDirectInputDevice8::GetPropertyandIDirectInputDevice8::SetPropertymethods. + + +

The diph member must be initialized as follows:

Member + Value +
dwSize + sizeof() +
dwHeaderSize + sizeof() +
dwObj +

If the dwHow member is , this member must be 0.

If the dwHow member is , this member must be the identifier for the object whose property setting is to be set or retrieved.

If the dwHow member is , this member must be a data format offset for the object whose property setting is to be set or retrieved. For example, if the c_dfDIMouse data format is selected, it must be one of the DIMOFS_* values.Identifier of the object whose property is being retrieved or set.

If the dwHow member is , the device must be a Human Interface Device (human interface device). The device object will be identified by the HID usage page and usage values in packed form.

dwHow + Specifies how the dwObj member should be interpreted. See the preceding description of the dwObj member for details. +

The range values for devices whose ranges are unrestricted wraparound.

+
+ + microsoft.directx_sdk.reference.diproprange + DIPROPRANGE + DIPROPRANGE +
+ + + No documentation. + + + microsoft.directx_sdk.reference.diproprange + DIPROPHEADER diph + DIPROPHEADER diph + + + + No documentation. + + + microsoft.directx_sdk.reference.diproprange + int lMin + int lMin + + + + No documentation. + + + microsoft.directx_sdk.reference.diproprange + int lMax + int lMax + + + + No documentation. + + + bb280495 + DIPROPSTRING + DIPROPSTRING + + + + No documentation. + + + bb280495 + DIPROPHEADER diph + DIPROPHEADER diph + + + + No documentation. + + + bb280495 + wchar_t wsz[260] + wchar_t wsz + + + + Contains type-specific information for effects that are marked as .

The structure describes a constant force effect.

A reference to a single structure for an effect is passed in the lpvTypeSpecificParams member of the structure.

+
+ + microsoft.directx_sdk.reference.diconstantforce + DICONSTANTFORCE + DICONSTANTFORCE +
+ + + No documentation. + + + microsoft.directx_sdk.reference.diconstantforce + int lMagnitude + int lMagnitude + + + + No documentation. + + + bb280512 + DICUSTOMFORCE + DICUSTOMFORCE + + + + No documentation. + + + bb280512 + unsigned int cChannels + unsigned int cChannels + + + + No documentation. + + + bb280512 + unsigned int dwSamplePeriod + unsigned int dwSamplePeriod + + + + No documentation. + + + bb280512 + unsigned int cSamples + unsigned int cSamples + + + + No documentation. + + + bb280512 + int* rglForceData + int rglForceData + + + + No documentation. + + + bb280501 + DIPERIODIC + DIPERIODIC + + + + No documentation. + + + bb280501 + unsigned int dwMagnitude + unsigned int dwMagnitude + + + + No documentation. + + + bb280501 + int lOffset + int lOffset + + + + No documentation. + + + bb280501 + unsigned int dwPhase + unsigned int dwPhase + + + + No documentation. + + + bb280501 + unsigned int dwPeriod + unsigned int dwPeriod + + + + No documentation. + + + bb280494 + DIRAMPFORCE + DIRAMPFORCE + + + + No documentation. + + + bb280494 + int lStart + int lStart + + + + No documentation. + + + bb280494 + int lEnd + int lEnd + + + + Gets or sets the data format flags. + + The flags. + + + + Gets the defined data format objects. + + The objects. + + + + Structure that describes a range value between a minimum and a maximum + + + + + Minimum value of this range + + + + + Maximum value of this range + + + + + Enumeration of identifiers for Joystick updatable objects. + + + + + No documentation. + + DIJOYSTATE2 + + + + No documentation. + + int lX + + + + No documentation. + + int lY + + + + No documentation. + + int lZ + + + + No documentation. + + int lRx + + + + No documentation. + + int lRy + + + + No documentation. + + int lRz + + + + No documentation. + + int rglSlider[2] + + + + No documentation. + + unsigned int rgdwPOV[4] + + + + No documentation. + + unsigned char rgbButtons[128] + + + + No documentation. + + int lVX + + + + No documentation. + + int lVY + + + + No documentation. + + int lVZ + + + + No documentation. + + int lVRx + + + + No documentation. + + int lVRy + + + + No documentation. + + int lVRz + + + + No documentation. + + int rglVSlider[2] + + + + No documentation. + + int lAX + + + + No documentation. + + int lAY + + + + No documentation. + + int lAZ + + + + No documentation. + + int lARx + + + + No documentation. + + int lARy + + + + No documentation. + + int lARz + + + + No documentation. + + int rglASlider[2] + + + + No documentation. + + int lFX + + + + No documentation. + + int lFY + + + + No documentation. + + int lFZ + + + + No documentation. + + int lFRx + + + + No documentation. + + int lFRy + + + + No documentation. + + int lFRz + + + + No documentation. + + int rglFSlider[2] + + + + Internal class used to initialize this assembly. + + + + + Initializes this assembly. + + + This method is called when the assembly is loaded. + + + + + No documentation. + + DIMOUSESTATE2 + + + + The namespace provides a managed DirectInput API. + + ee416842 + DirectInput + DirectInput + + + + Flags for a data format. + + + + + The data format doesn't report any specific information. + + + + + The data format must report acceleration information. + + + + + The data format must report force information. + + + + + The data format must report position information. + + + + + The data format must report velocity information. + + + + + Properties associated to an Object. + + + + + Gets or sets the dead zone of a joystick, in the range from 0 through 10,000, where 0 indicates that there is no dead zone, 5,000 indicates that the dead zone extends over 50 percent of the physical range of the axis on both sides of center, and 10,000 indicates that the entire physical range of the axis is dead. When the axis is within the dead zone, it is reported as being at the center of its range. + + The dead zone. + + + + Gets the input granularity. Granularity represents the smallest distance over which the object reports movement. Most axis objects have a granularity of one; that is, all values are possible. Some axes have a larger granularity. For example, the wheel axis on a mouse can have a granularity of 20; that is, all reported changes in position are multiples of 20. In other words, when the user turns the wheel slowly, the device reports a position of 0, then 20, then 40, and so on. This is a read-only property. + + The granularity. + + + + Gets the range of the raw data returned for axes on a human interface device. Devices can return negative values. + + The logical range. + + + + Gets Retrieves the range of data for axes as suggested by the manufacturer of a human interface device. Values can be negative. Normally DirectInput returns values from 0 through 0xFFFF, but the range can be made to conform to the manufacturer's suggested range by using . + + The physical range. + + + + Gets the range of values an object can possibly report. For some devices, this is a read-only property. + + The range. + + + + Gets or sets the saturation zones of a joystick, in the range from 0 through 10,000. The saturation level is the point at which the axis is considered to be at its most extreme position. For example, if the saturation level is set to 9,500, the axis reaches the extreme of its range when it has moved 95 percent of the physical distance from its center position (or from the dead zone). + + The saturation. + + + + This class describes a Periodic force effect. + It is passed in the of the structure. + + + + + Gets or sets the magnitude. + Magnitude of the effect, in the range from 0 through 10,000. If an envelope is applied to this effect, the value represents the magnitude of the sustain. If no envelope is applied, the value represents the amplitude of the entire effect. + + The magnitude. + + + + Gets or sets the offset of the effect. + The range of forces generated by the effect is lOffset minus dwMagnitude to lOffset plus dwMagnitude. The value of the lOffset member is also the baseline for any envelope that is applied to the effect. + + The offset. + + + + Gets or sets the phase. + Position in the cycle of the periodic effect at which playback begins, in the range from 0 through 35,999. A device driver cannot provide support for all values in the dwPhase member. In this case, the value is rounded off to the nearest supported value. + + The phase. + + + + Gets or sets the period of the effect, in microseconds. + + The period. + + + + Marshal this class from an unmanaged buffer. + + The size of the unmanaged buffer. + The pointer to the unmanaged buffer. + An instance of TypeSpecificParameters or null + + + + Marshals this class to its native/unmanaged counterpart. + + A pointer to an allocated buffer containing the unmanaged structure. + + + + Gets the size of this specific parameter. + + The size. + + + + + + + + + Gets or sets the device. + + The device. + + + + Gets or sets the code. + + The code. + + + + Gets or sets the how type. + + The how type. + + + + Initializes a new instance of the class. + + The device. + The code. + The property type. + + + + Initializes a new instance of the class by offset inside a structure. + + The device. + The name of the property inside dataFormat type. + The data format. + + + + This class describes a Ramp force effect. + It is passed in the of the structure. + + + + + Gets or sets the magnitude at the start of the effect, in the range from - 10,000 through 10,000. + + The start. + + + + Gets or sets the magnitude at the end of the effect, in the range from - 10,000 through 10,000. + + The end. + + + + Marshal this class from an unmanaged buffer. + + The size of the unmanaged buffer. + The pointer to the unmanaged buffer. + An instance of TypeSpecificParameters or null + + + + Marshals this class to its native/unmanaged counterpart. + + A pointer to an allocated buffer containing the unmanaged structure. + + + + Gets the size of this specific parameter. + + The size. + + + + Custom data stored in . + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + Size of the buffer. + The buffer pointer. + + + + Initializes this instance from the specified buffer. + + Size of the buffer. + The buffer pointer. + + + + Marshal this class from an unmanaged buffer. + + The size of the unmanaged buffer. + The pointer to the unmanaged buffer. + An instance of TypeSpecificParameters or null + + + + Free a previously allocated buffer. + + The buffer pointer. + + + + Marshals this class to its native/unmanaged counterpart. + + A pointer to an allocated buffer containing the unmanaged structure. + + + + Convert this instance to another typed instance: , , , . + + A class + An instance of the T class + + + + Gets the size of this specific parameter. + + The size. + + + + Internal class to interact with Native Message + + +
+
diff --git a/Test/dll/SharpDX.DirectSound.dll b/Test/dll/SharpDX.DirectSound.dll new file mode 100644 index 00000000..5112655a Binary files /dev/null and b/Test/dll/SharpDX.DirectSound.dll differ diff --git a/Test/dll/SharpDX.DirectSound.xml b/Test/dll/SharpDX.DirectSound.xml new file mode 100644 index 00000000..8173b402 --- /dev/null +++ b/Test/dll/SharpDX.DirectSound.xml @@ -0,0 +1,6976 @@ + + + + SharpDX.DirectSound + + + + + The assembly provides managed DirectSound API. + + ee416960 + DirectSound + DirectSound + + + + The structure contains all information necessary to uniquely describe the location, orientation, and motion of a 3D sound buffer. This structure is used with theIDirectSound3DBuffer8::GetAllParametersandIDirectSound3DBuffer8::SetAllParametersmethods. + + + microsoft.directx_sdk.reference.ds3dbuffer + DS3DBUFFER + DS3DBUFFER + + + + Initializes a new instance of the class. + + + + + No documentation. + + + microsoft.directx_sdk.reference.ds3dbuffer + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + microsoft.directx_sdk.reference.ds3dbuffer + D3DVECTOR vPosition + D3DVECTOR vPosition + + + + No documentation. + + + microsoft.directx_sdk.reference.ds3dbuffer + D3DVECTOR vVelocity + D3DVECTOR vVelocity + + + + No documentation. + + + microsoft.directx_sdk.reference.ds3dbuffer + unsigned int dwInsideConeAngle + unsigned int dwInsideConeAngle + + + + No documentation. + + + microsoft.directx_sdk.reference.ds3dbuffer + unsigned int dwOutsideConeAngle + unsigned int dwOutsideConeAngle + + + + No documentation. + + + microsoft.directx_sdk.reference.ds3dbuffer + D3DVECTOR vConeOrientation + D3DVECTOR vConeOrientation + + + + No documentation. + + + microsoft.directx_sdk.reference.ds3dbuffer + int lConeOutsideVolume + int lConeOutsideVolume + + + + No documentation. + + + microsoft.directx_sdk.reference.ds3dbuffer + float flMinDistance + float flMinDistance + + + + No documentation. + + + microsoft.directx_sdk.reference.ds3dbuffer + float flMaxDistance + float flMaxDistance + + + + No documentation. + + + microsoft.directx_sdk.reference.ds3dbuffer + unsigned int dwMode + unsigned int dwMode + + + + The structure describes the capabilities of a device. It is used by theIDirectSound8::GetCapsmethod. + + +

Some audio cards may be unable to report accurately the number of available or free hardware buffers. This can happen, for example, when the card can play more sounds at lower sampling rates than at higher rates. In general, a nonzero value in any of the members relating to number of free hardware buffers signifies that at least one hardware resource of the appropriate type is available.

The unlock transfer rate for software buffers is 0, because the data need not be transferred anywhere. Similarly, the play processing overhead for hardware buffers is 0 because the mixing is done by the sound device.

+
+ + microsoft.directx_sdk.reference.dscaps + DSCAPS + DSCAPS +
+ + + Initializes a new instance of the class. + + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + DSCAPS_FLAGS dwFlags + DSCAPS_FLAGS dwFlags + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwMinSecondarySampleRate + unsigned int dwMinSecondarySampleRate + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwMaxSecondarySampleRate + unsigned int dwMaxSecondarySampleRate + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwPrimaryBuffers + unsigned int dwPrimaryBuffers + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwMaxHwMixingAllBuffers + unsigned int dwMaxHwMixingAllBuffers + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwMaxHwMixingStaticBuffers + unsigned int dwMaxHwMixingStaticBuffers + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwMaxHwMixingStreamingBuffers + unsigned int dwMaxHwMixingStreamingBuffers + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwFreeHwMixingAllBuffers + unsigned int dwFreeHwMixingAllBuffers + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwFreeHwMixingStaticBuffers + unsigned int dwFreeHwMixingStaticBuffers + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwFreeHwMixingStreamingBuffers + unsigned int dwFreeHwMixingStreamingBuffers + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwMaxHw3DAllBuffers + unsigned int dwMaxHw3DAllBuffers + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwMaxHw3DStaticBuffers + unsigned int dwMaxHw3DStaticBuffers + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwMaxHw3DStreamingBuffers + unsigned int dwMaxHw3DStreamingBuffers + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwFreeHw3DAllBuffers + unsigned int dwFreeHw3DAllBuffers + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwFreeHw3DStaticBuffers + unsigned int dwFreeHw3DStaticBuffers + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwFreeHw3DStreamingBuffers + unsigned int dwFreeHw3DStreamingBuffers + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwTotalHwMemBytes + unsigned int dwTotalHwMemBytes + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwFreeHwMemBytes + unsigned int dwFreeHwMemBytes + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwMaxContigFreeHwMemBytes + unsigned int dwMaxContigFreeHwMemBytes + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwUnlockTransferRateHwBuffers + unsigned int dwUnlockTransferRateHwBuffers + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwPlayCpuOverheadSwBuffers + unsigned int dwPlayCpuOverheadSwBuffers + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwReserved1 + unsigned int dwReserved1 + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + unsigned int dwReserved2 + unsigned int dwReserved2 + + + +

The interface is used to manipulate sound capture buffers.

To obtain the interface, call the IDirectSoundCapture8::CreateCaptureBuffer method to obtain , then pass IID_IDirectSoundCaptureBuffer8 to IDirectSoundCaptureBuffer::QueryInterface.

In addition to the methods inherited from , the interface exposes the following methods, arranged by category.

Capture Management
Method + Description +
IDirectSoundCaptureBuffer8::Lock The Lock method locks a portion of the buffer. Locking the buffer returns references into the buffer, allowing the application to read or write audio data into memory. +
IDirectSoundCaptureBuffer8::Start The Start method begins capturing data into the buffer. If the buffer is already capturing, the method has no effect. +
IDirectSoundCaptureBuffer8::Stop The Stop method stops the buffer so that it is no longer capturing data. If the buffer is not capturing, the method has no effect. +
IDirectSoundCaptureBuffer8::Unlock The Unlock method unlocks the buffer. +
Effects
Method + Description +
The GetFXStatus method retrieves the status of capture effects. +
The GetObjectInPath method retrieves an interface to an effect object associated with the buffer. +
Initialization
Method + Description +
IDirectSoundCaptureBuffer8::Initialize The Initialize method initializes a capture buffer object. Because the IDirectSoundCapture8::CreateCaptureBufferIDirectSoundCapture8::CreateCaptureBuffer +
Information
Method + Description +
IDirectSoundCaptureBuffer8::GetCaps The GetCaps method retrieves the capabilities of the buffer. +
IDirectSoundCaptureBuffer8::GetCurrentPosition Address of a variable that receives the offset from the start of the buffer, in bytes, of the capture cursor. The parameter can be null if this value is not wanted. +
IDirectSoundCaptureBuffer8::GetFormat The GetFormat method retrieves the waveform format of the capture buffer. +
IDirectSoundCaptureBuffer8::GetStatus The GetStatus method retrieves the status of the capture buffer. +

The LPDIRECTSOUNDCaptureBuffer8 type is defined as a reference to the interface:

 typedef struct  *LPDIRECTSOUNDCaptureBuffer8;	
+            
+
+ + ee418162 + IDirectSoundCaptureBuffer8 + IDirectSoundCaptureBuffer8 +
+ + + Creates a buffer for capturing waveform audio. + + a reference to an instance of + a structure containing values for the capture buffer being created. + No documentation. + HRESULT IDirectSoundCapture::CreateCaptureBuffer([In] LPCDSCBUFFERDESC pcDSCBufferDesc,[Out] LPDIRECTSOUNDCAPTUREBUFFER* ppDSCBuffer,[None] IUnknown* pUnkOuter) + + + + Retrieves an interface to an effect object associated with the buffer. + + Index of the object within objects of that class in the path. See Remarks. + an effect object associated with the buffer + HRESULT IDirectSoundCaptureBuffer8::GetObjectInPath([In] GUID* rguidObject,[None] int dwIndex,[In] GUID* rguidInterface,[Out] void** ppObject) + + + + Retrieves the status of capture effects. + + + + + + + Sets the notification positions. + + The positions. + + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The GetObjectInPath method retrieves an interface to an effect object associated with the buffer. + +
Value of type REFGUID that specifies the unique class identifier of the object being searched for, such as .
+
Index of the object within objects of that class in the path. See Remarks.
+
Unique identifier of the desired interface, such as IID_IDirectSoundCaptureFXAec8.
+
Address of a variable that receives the desired interface reference.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_CONTROLUNAVAIL
DSERR_INVALIDPARAM
DSERR_OBJECTNOTFOUND
+ +

The value in dwIndex is the index of the object within the array of effects in the structure passed to DirectSoundFullDuplexCreate8 or IDirectSoundCapture8::CreateCaptureBuffer.

+
+ + microsoft.directx_sdk.idirectsoundcapturebuffer8.idirectsoundcapturebuffer8.getobjectinpath + HRESULT IDirectSoundCaptureBuffer8::GetObjectInPath([In] const GUID& rguidObject,[In] unsigned int dwIndex,[In] const GUID& rguidInterface,[Out] void** ppObject) + IDirectSoundCaptureBuffer8::GetObjectInPath +
+ + + The GetFXStatus method retrieves the status of capture effects. + +
Number of elements in the pdwFXStatus array.
+
Address of an array of DWORD variables that receive the status of each effect. This should contain the same number of elements as the array passed in the dwFXCount member of the structure passed to DirectSoundFullDuplexCreate8 or IDirectSoundCapture8::CreateCaptureBuffer. The possible values returned in the array are as follows:
ValueDescription
DSCFXR_LOCHARDWAREEffect is instantiated in hardware.
DSCFXR_LOCSOFTWAREEffect is instantiated in software.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsoundcapturebuffer8.idirectsoundcapturebuffer8.getfxstatus + HRESULT IDirectSoundCaptureBuffer8::GetFXStatus([In] unsigned int dwEffectsCount,[Out, Buffer] DSCFX_ENUM* pdwFXStatus) + IDirectSoundCaptureBuffer8::GetFXStatus +
+ + +

The interface is used to manipulate sound capture buffers.

To obtain the interface, call the IDirectSoundCapture8::CreateCaptureBuffer method to obtain , then pass IID_IDirectSoundCaptureBuffer8 to IDirectSoundCaptureBuffer::QueryInterface.

In addition to the methods inherited from , the interface exposes the following methods, arranged by category.

Capture Management
Method + Description +
IDirectSoundCaptureBuffer8::Lock The Lock method locks a portion of the buffer. Locking the buffer returns references into the buffer, allowing the application to read or write audio data into memory. +
IDirectSoundCaptureBuffer8::Start The Start method begins capturing data into the buffer. If the buffer is already capturing, the method has no effect. +
IDirectSoundCaptureBuffer8::Stop The Stop method stops the buffer so that it is no longer capturing data. If the buffer is not capturing, the method has no effect. +
IDirectSoundCaptureBuffer8::Unlock The Unlock method unlocks the buffer. +
Effects
Method + Description +
The GetFXStatus method retrieves the status of capture effects. +
The GetObjectInPath method retrieves an interface to an effect object associated with the buffer. +
Initialization
Method + Description +
IDirectSoundCaptureBuffer8::Initialize The Initialize method initializes a capture buffer object. Because the IDirectSoundCapture8::CreateCaptureBufferIDirectSoundCapture8::CreateCaptureBuffer +
Information
Method + Description +
IDirectSoundCaptureBuffer8::GetCaps The GetCaps method retrieves the capabilities of the buffer. +
IDirectSoundCaptureBuffer8::GetCurrentPosition Address of a variable that receives the offset from the start of the buffer, in bytes, of the capture cursor. The parameter can be null if this value is not wanted. +
IDirectSoundCaptureBuffer8::GetFormat The GetFormat method retrieves the waveform format of the capture buffer. +
IDirectSoundCaptureBuffer8::GetStatus The GetStatus method retrieves the status of the capture buffer. +

The LPDIRECTSOUNDCaptureBuffer8 type is defined as a reference to the interface:

 typedef struct  *LPDIRECTSOUNDCaptureBuffer8;	
+            
+
+ + ee418162 + IDirectSoundCaptureBuffer + IDirectSoundCaptureBuffer +
+ + + True if the buffer is currently capturing. + + + + + The offset from the start of the buffer, in bytes, of the capture cursor. + + + + + The offset from the start of the buffer, in bytes, of the read cursor. + + + + + True if the capture buffer is looping. + + + + + Gets the waveform format of the capture buffer. + + The format. + + + + The Lock method locks a portion of the buffer. Locking the buffer returns references into the buffer, allowing the application to read or write audio data into memory. + + Offset, in bytes, from the start of the buffer to the point where the lock begins. + Size, in bytes, of the portion of the buffer to lock. Because the buffer is conceptually circular, this number can exceed the number of bytes between dwOffset and the end of the buffer. + Flags modifying the lock event. The following flags are defined: ValueDescription DSBLOCK_FROMWRITECURSORStart the lock at the write cursor. The dwOffset parameter is ignored. DSBLOCK_ENTIREBUFFERLock the entire buffer. The dwBytes parameter is ignored. + Address of a variable that receives a pointer to the second locked part of the capture buffer. If NULL is returned, the ppvAudioPtr1 parameter points to the entire locked portion of the capture buffer. + Address of a variable that receives a pointer to the first locked part of the buffer. + HRESULT IDirectSoundCaptureBuffer::Lock([None] int dwOffset,[None] int dwBytes,[Out] void** ppvAudioPtr1,[Out] int* pdwAudioBytes1,[Out] void** ppvAudioPtr2,[Out, Optional] int* pdwAudioBytes2,[None] int dwFlags) + + + + The Unlock method releases a locked sound buffer. + + Address of the value retrieved in the ppvAudioPtr1 parameter of the {{Lock}} method. + Address of the value retrieved in the ppvAudioPtr2 parameter of the IDirectSoundBuffer8::Lock method. + No documentation. + HRESULT IDirectSoundBuffer::Unlock([In, Buffer] void* pvAudioPtr1,[None] int dwAudioBytes1,[In, Buffer, Optional] void* pvAudioPtr2,[None] int dwAudioBytes2) + + + + Writes data to the buffer. + + + + + + Writes data to the buffer. + + + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The GetCaps method retrieves the capabilities of the buffer. + + + microsoft.directx_sdk.idirectsoundcapturebuffer8.idirectsoundcapturebuffer8.getcaps + GetCaps + GetCaps + HRESULT IDirectSoundCaptureBuffer::GetCaps([Out] DSCBCAPS* pDSCBCaps) + + + + The GetStatus method retrieves the status of the capture buffer. + + + microsoft.directx_sdk.idirectsoundcapturebuffer8.idirectsoundcapturebuffer8.getstatus + GetStatus + GetStatus + HRESULT IDirectSoundCaptureBuffer::GetStatus([Out] DSCBSTATUS_FLAGS* pdwStatus) + + + + The GetCaps method retrieves the capabilities of the buffer. + +
Pointer to a structure that receives information about the capture buffer. On input, the dwSize member must specify the size of the structure in bytes.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_INVALIDPARAM
DSERR_UNSUPPORTED
DSERR_OUTOFMEMORY
+ + microsoft.directx_sdk.idirectsoundcapturebuffer8.idirectsoundcapturebuffer8.getcaps + HRESULT IDirectSoundCaptureBuffer::GetCaps([Out] DSCBCAPS* pDSCBCaps) + IDirectSoundCaptureBuffer::GetCaps +
+ + + The GetCurrentPosition method retrieves the positions of the capture and read cursors in the buffer.

The capture cursor is ahead of the read cursor. The data after the read position up to and including the capture position is not necessarily valid data.

+
+
Address of a variable that receives the offset from the start of the buffer, in bytes, of the capture cursor. The parameter can be null if this value is not wanted.
+
Address of a variable that receives the offset from the start of the buffer, in bytes, of the read cursor.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_INVALIDPARAM
DSERR_NODRIVER
DSERR_OUTOFMEMORY
+ + microsoft.directx_sdk.idirectsoundcapturebuffer8.idirectsoundcapturebuffer8.getcurrentposition + HRESULT IDirectSoundCaptureBuffer::GetCurrentPosition([Out, Optional] unsigned int* pdwCapturePosition,[Out, Optional] unsigned int* pdwReadPosition) + IDirectSoundCaptureBuffer::GetCurrentPosition +
+ + + The GetFormat method retrieves the waveform format of the capture buffer. + +
Address of a structure that receives a description of the sound data in the capture buffer. To retrieve the buffer size needed to contain the format description, specify null.; in this case, the DWORD pointed to by the pdwSizeWritten parameter receives the size of the structure needed to receive complete format information.
+
Size, in bytes, of the structure. DirectSoundCapture writes, at most, dwSizeAllocated bytes to the structure.
+
Address of a variable that receives the number of bytes written to the structure; or, if pwfxFormat is null, the size of the structure that would be necessary to receive the information. This parameter can be null if the value is not wanted.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsoundcapturebuffer8.idirectsoundcapturebuffer8.getformat + HRESULT IDirectSoundCaptureBuffer::GetFormat([In] void* pwfxFormat,[In] unsigned int dwSizeAllocated,[Out, Optional] unsigned int* pdwSizeWritten) + IDirectSoundCaptureBuffer::GetFormat +
+ + + The GetStatus method retrieves the status of the capture buffer. + +
Address of a variable that receives the status of the capture buffer. The status can be set to one or more of the following:
ValueDescription
The buffer is capturing audio data.
The buffer is looping.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsoundcapturebuffer8.idirectsoundcapturebuffer8.getstatus + HRESULT IDirectSoundCaptureBuffer::GetStatus([Out] DSCBSTATUS_FLAGS* pdwStatus) + IDirectSoundCaptureBuffer::GetStatus +
+ + + The Lock method locks a portion of the buffer. Locking the buffer returns references into the buffer, allowing the application to read or write audio data into memory. + +
Offset, in bytes, from the start of the buffer to the point where the lock begins.
+
Size, in bytes, of the portion of the buffer to lock. Because the buffer is conceptually circular, this number can exceed the number of bytes between dwOffset and the end of the buffer.
+
Address of a variable that receives a reference to the first locked part of the buffer.
+
Address of a variable that receives the number of bytes in the block at ppvAudioPtr1. If this value is less than dwBytes, the lock has wrapped and ppvAudioPtr2 points to a second block of data at the beginning of the buffer.
+
Address of a variable that receives a reference to the second locked part of the capture buffer. If null is returned, the ppvAudioPtr1 parameter points to the entire locked portion of the capture buffer.
+
Address of a variable that receives the number of bytes in the block at ppvAudioPtr2. If ppvAudioPtr2 is null, this value is zero.
+
Flags modifying the lock event. This value can be zero or the following flag:
ValueDescription
DSCBLOCK_ENTIREBUFFERIgnore dwBytes and lock the entire capture buffer.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following values:

Return code
DSERR_INVALIDPARAM
DSERR_INVALIDCALL
+ +

This method accepts an offset and a byte count, and returns two read references and their associated sizes. If the locked portion does not extend to the end of the buffer and wrap to the beginning, the second reference, ppvAudioBytes2, receives null. If the lock does wrap, ppvAudioBytes2 points to the beginning of the buffer.

If the application passes null for the ppvAudioPtr2 and pdwAudioBytes2 parameters, the lock extends no further than the end of the buffer and does not wrap.

The application should read data from the references returned by this method and then immediately call Unlock. The sound buffer should not remain locked while it is running; if it does, the capture cursor will reach the locked bytes and audio problems may result.

+
+ + microsoft.directx_sdk.idirectsoundcapturebuffer8.idirectsoundcapturebuffer8.lock + HRESULT IDirectSoundCaptureBuffer::Lock([In] unsigned int dwOffset,[In] unsigned int dwBytes,[Out] void** ppvAudioPtr1,[Out] unsigned int* pdwAudioBytes1,[Out] void** ppvAudioPtr2,[Out, Optional] unsigned int* pdwAudioBytes2,[In] unsigned int dwFlags) + IDirectSoundCaptureBuffer::Lock +
+ + + The Start method begins capturing data into the buffer. If the buffer is already capturing, the method has no effect. + +
Flags that specify the behavior of the buffer when capturing sound data. The following flag is defined:
ValueDescription
DSCBSTART_LOOPINGAfter the end of the buffer is reached, capture restarts at the beginning and continues until explicitly stopped.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_INVALIDPARAM
DSERR_NODRIVER
DSERR_OUTOFMEMORY
+ +

If the buffer is already capturing, a call to this method using a different value in dwFlags might not change the value returned by GetStatus.

If the application is multithreaded, the thread that starts the buffer must continue to exist as long as the buffer is capturing. Buffers created on WDM drivers stop capturing when the thread is terminated.

+
+ + microsoft.directx_sdk.idirectsoundcapturebuffer8.idirectsoundcapturebuffer8.start + HRESULT IDirectSoundCaptureBuffer::Start([In] BOOL dwFlags) + IDirectSoundCaptureBuffer::Start +
+ + + The Stop method stops the buffer so that it is no longer capturing data. If the buffer is not capturing, the method has no effect. + +

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

+ + microsoft.directx_sdk.idirectsoundcapturebuffer8.idirectsoundcapturebuffer8.stop + HRESULT IDirectSoundCaptureBuffer::Stop() + IDirectSoundCaptureBuffer::Stop +
+ + + The Unlock method unlocks the buffer. + +
Address of the value retrieved in the ppvAudioPtr1 parameter of the Lock method.
+
Number of bytes read from the pvAudioPtr1 parameter. See Remarks.
+
Address of the value retrieved in the ppvAudioPtr2 parameter of the IDirectSoundCaptureBuffer8::Lock method.
+
Number of bytes read from the pvAudioPtr2 parameter. See Remarks.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following values:

Return code
DSERR_INVALIDPARAM
DSERR_INVALIDCALL
+ +

An application must pass both references, pvAudioPtr1 and pvAudioPtr2, returned by the IDirectSoundCaptureBuffer8::Lock method to ensure the correct pairing of IDirectSoundCaptureBuffer8::Lock and IDirectSoundCaptureBuffer8::Unlock. The second reference is needed even if zero bytes were written to the second reference.

The values in dwAudioBytes1 and dwAudioBytes2 must specify the number of bytes actually read from each part of the buffer, which might be less than the size of the lock. DirectSound uses these values to determine how much data to transfer from the device.

Make sure that the capture buffer does not remain locked for long periods of time.

+
+ + microsoft.directx_sdk.idirectsoundcapturebuffer8.idirectsoundcapturebuffer8.unlock + HRESULT IDirectSoundCaptureBuffer::Unlock([In, Buffer] void* pvAudioPtr1,[In] unsigned int dwAudioBytes1,[In, Buffer, Optional] void* pvAudioPtr2,[In] unsigned int dwAudioBytes2) + IDirectSoundCaptureBuffer::Unlock +
+ + + The structure describes the capabilities of a capture buffer. It is used by theIDirectSoundCaptureBuffer8::GetCapsmethod. + + + microsoft.directx_sdk.reference.dscbcaps + DSCBCAPS + DSCBCAPS + + + + Initializes a new instance of the class. + + + + + No documentation. + + + microsoft.directx_sdk.reference.dscbcaps + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + microsoft.directx_sdk.reference.dscbcaps + DSCBCAPS_FLAGS dwFlags + DSCBCAPS_FLAGS dwFlags + + + + No documentation. + + + microsoft.directx_sdk.reference.dscbcaps + unsigned int dwBufferBytes + unsigned int dwBufferBytes + + + + No documentation. + + + microsoft.directx_sdk.reference.dscbcaps + unsigned int dwReserved + unsigned int dwReserved + + + + The structure describes a capture buffer. It is used by theIDirectSoundCapture8::CreateCaptureBuffermethod and by theDirectSoundFullDuplexCreate8function.

An earlier version of this structure, DSCBUFFERDESC1, is maintained in Dsound.h for compatibility with DirectX 7 and earlier.

+
+ +

The flag is supported only on buffers created by an object of class CLSID_DirectSoundCapture8. If the IDirectSoundCapture8 interface was obtained from the DirectSoundCaptureCreate8 function, this flag is supported; if it was obtained from the earlier DirectSoundCaptureCreate function, it is not supported.

Capture effects require Microsoft Windows XP.

+
+ + microsoft.directx_sdk.reference.dscbufferdesc + DSCBUFFERDESC + DSCBUFFERDESC +
+ + + Initializes a new instance of the class. + + + + + Gets a value indicating whether [wave mapped]. + + true if [wave mapped]; otherwise, false. + + + + Gets a value indicating whether [control effects]. + + true if [control effects]; otherwise, false. + + + + Gets or sets the format. + + The format. + + + + Describes effects supported by hardware for the buffer. + + + + + No documentation. + + + microsoft.directx_sdk.reference.dscbufferdesc + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + microsoft.directx_sdk.reference.dscbufferdesc + DSCBCAPS_FLAGS dwFlags + DSCBCAPS_FLAGS dwFlags + + + + No documentation. + + + microsoft.directx_sdk.reference.dscbufferdesc + unsigned int dwBufferBytes + unsigned int dwBufferBytes + + + + No documentation. + + + microsoft.directx_sdk.reference.dscbufferdesc + unsigned int dwReserved + unsigned int dwReserved + + + + No documentation. + + + microsoft.directx_sdk.reference.dscbufferdesc + WAVEFORMATEX* lpwfxFormat + WAVEFORMATEX lpwfxFormat + + + + No documentation. + + + microsoft.directx_sdk.reference.dscbufferdesc + unsigned int dwFXCount + unsigned int dwFXCount + + + + No documentation. + + + microsoft.directx_sdk.reference.dscbufferdesc + DSCEFFECTDESC* lpDSCFXDesc + DSCEFFECTDESC lpDSCFXDesc + + + + The structure describes the capabilities of the capture device. It is used by theIDirectSoundCapture8::GetCapsmethod. + + + microsoft.directx_sdk.reference.dsccaps + DSCCAPS + DSCCAPS + + + + Initializes a new instance of the class. + + + + + No documentation. + + + microsoft.directx_sdk.reference.dsccaps + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + microsoft.directx_sdk.reference.dsccaps + unsigned int dwFlags + unsigned int dwFlags + + + + No documentation. + + + microsoft.directx_sdk.reference.dsccaps + unsigned int dwFormats + unsigned int dwFormats + + + + No documentation. + + + microsoft.directx_sdk.reference.dsccaps + unsigned int dwChannels + unsigned int dwChannels + + + + The structure contains parameters for an effect associated with a capture buffer. + + + microsoft.directx_sdk.reference.dsceffectdesc + DSCEFFECTDESC + DSCEFFECTDESC + + + + Initializes a new instance of the class. + + + + +
Size of the structure, in bytes.
+
+ + microsoft.directx_sdk.reference.dsceffectdesc + unsigned int dwSize + unsigned int dwSize +
+ + +
Flags that specify desired parameters of the effect. When this structure is passed to DirectSoundFullDuplexCreate8, or IDirectSoundCapture8::CreateCaptureBuffer, this member must be one of the values shown in the following table. +
Value + Description +
+ Effect specified by guidDSCFXInstance must be in hardware. +
+ Effect specified by guidDSCFXInstance must be in software. +

On return, this member can contain one of the values shown in the following table.

Value + Description +
+ Effect was created in hardware. +
+ Effect was created in software. +
+
+ + microsoft.directx_sdk.reference.dsceffectdesc + DSCFX_ENUM dwFlags + DSCFX_ENUM dwFlags +
+ + +
Value of type that specifies the class identifier of the effect. The following standard identifiers are defined. +
Value + Description +
+ Acoustic echo cancellation. +
+ Noise suppression. +
+
+ + microsoft.directx_sdk.reference.dsceffectdesc + GUID guidDSCFXClass + GUID guidDSCFXClass +
+ + +
Value of type that specifies the unique identifier of the preferred effect. The following standard identifiers are defined. +
Value + Description +
+ Microsoft acoustic echo cancellation. Available in software only. +
+ Microsoft noise suppression. Available in software only. +
+ System default acoustic echo cancellation. +
+ System default noise suppression. +
+
+ + microsoft.directx_sdk.reference.dsceffectdesc + GUID guidDSCFXInstance + GUID guidDSCFXInstance +
+ + +
Reserved. Must be zero.
+
+ + microsoft.directx_sdk.reference.dsceffectdesc + unsigned int dwReserved1 + unsigned int dwReserved1 +
+ + +
Reserved. Must be zero.
+
+ + microsoft.directx_sdk.reference.dsceffectdesc + unsigned int dwReserved2 + unsigned int dwReserved2 +
+ + +

The IDirectSoundFXChorus8 interface is used to set and retrieve effect parameters on a buffer that supports chorus.

This interface is obtained by calling GetObjectInPath on the buffer that supports the effect.

In addition to the methods inherited from , the IDirectSoundFXChorus8 interface exposes the following methods.

IDirectSoundFXChorus8 Members
Method + Description +
IDirectSoundFXChorus8::GetAllParameters The GetAllParameters method retrieves the chorus parameters of a buffer. +
IDirectSoundFXChorus8::SetAllParameters The SetAllParameters method sets the chorus parameters of a buffer. +
+
+ + ee418208 + IDirectSoundFXChorus + IDirectSoundFXChorus +
+ + + Default number of milliseconds the input is delayed before it is played back. The default value is 50. + + + + + Maximum number of milliseconds the input is delayed before it is played back. + + + + + Minimum number of milliseconds the input is delayed before it is played back. + + + + + Default percentage by which the delay time is modulated by the low-frequency oscillator, in hundredths of a percentage point. The default value is 10. + + + + + Maximum percentage by which the delay time is modulated by the low-frequency oscillator, in hundredths of a percentage point. + + + + + Minimum percentage by which the delay time is modulated by the low-frequency oscillator, in hundredths of a percentage point. + + + + + Default percentage of output signal to feed back into the effect's input. The default value is 25. + + + + + Maximum percentage of output signal to feed back into the effect's input. + + + + + Minimum percentage of output signal to feed back into the effect's input. + + + + + Default frequency of the LFO. The default value is 1.1. + + + + + Maximum frequency of the LFO. + + + + + Minimum frequency of the LFO. + + + + + Positive 180 phase differential between left and right LFOs. + + + + + Positive 90 phase differential between left and right LFOs. + + + + + Default phase differential between left and right LFOs. The default value is Phase90. + + + + + Maximum phase differential between left and right LFOs. + + + + + Minimum phase differential between left and right LFOs. + + + + + Negative 180 phase differential between left and right LFOs. + + + + + Negative 90 phase differential between left and right LFOs. + + + + + Zero phase differential between left and right LFOs. + + + + + Default waveform shape of the LFO. By default, the waveform is a sine. + + + + + Sine waveform shape of the LFO. + + + + + Triangle waveform shape of the LFO. + + + + + Default ratio of wet (processed) signal to dry (unprocessed) signal. + + + + + Maximum ratio of wet (processed) signal to dry (unprocessed) signal. + + + + + Minimum ratio of wet (processed) signal to dry (unprocessed) signal. + + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The GetAllParameters method retrieves the chorus parameters of a buffer. + + + microsoft.directx_sdk.idirectsoundfxchorus8.idirectsoundfxchorus8.getallparameters + GetAllParameters / SetAllParameters + GetAllParameters + HRESULT IDirectSoundFXChorus::GetAllParameters([Out] DSFXChorus* pDsFxChorus) + + + + The SetAllParameters method sets the chorus parameters of a buffer. + +
Address of a structure that specifies the effect parameters.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsoundfxchorus8.idirectsoundfxchorus8.setallparameters + HRESULT IDirectSoundFXChorus::SetAllParameters([In] const DSFXChorus* pcDsFxChorus) + IDirectSoundFXChorus::SetAllParameters +
+ + + The GetAllParameters method retrieves the chorus parameters of a buffer. + +
Address of a structure that receives the effect parameters.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsoundfxchorus8.idirectsoundfxchorus8.getallparameters + HRESULT IDirectSoundFXChorus::GetAllParameters([Out] DSFXChorus* pDsFxChorus) + IDirectSoundFXChorus::GetAllParameters +
+ + +

The IDirectSoundFXCompressor8 interface is used to set and retrieve effect parameters on a buffer that supports compression.

This interface is obtained by calling GetObjectInPath on the buffer that supports the effect.

In addition to the methods inherited from , the IDirectSoundFXCompressor8 interface exposes the following methods.

IDirectSoundFXCompressor8 Members
Method + Description +
IDirectSoundFXCompressor8::GetAllParameters The GetAllParameters method retrieves the compression parameters of a buffer. +
IDirectSoundFXCompressor8::SetAllParameters The SetAllParameters method sets the compression parameters of a buffer. +
+
+ + ee418215 + IDirectSoundFXCompressor + IDirectSoundFXCompressor +
+ + + Default time before compression reaches its full value, in decibels (dB). The default value is 10 ms. + + + + + Maximum time before compression reaches its full value, in decibels (dB). + + + + + Minimum time before compression reaches its full value, in decibels (dB). + + + + + Default output gain of signal after compression, in decibels (dB). The default value is 0 dB. + + + + + Maximum output gain of signal after compression, in decibels (dB). + + + + + Minimum output gain of signal after compression, in decibels (dB). + + + + + Default time after threshold is reached before attack phase is started, in milliseconds. The default value is 4 ms. + + + + + Maximum time after threshold is reached before attack phase is started, in milliseconds. + + + + + Minimum time after threshold is reached before attack phase is started, in milliseconds. + + + + + Default compression ratio. The default value is 3, which means 3:1 compression. + + + + + Maximum compression ratio. + + + + + Minimum compression ratio. + + + + + Default speed at which compression is stopped after input drops below Threshold, in milliseconds. The default value is 200 ms. + + + + + Maximum speed at which compression is stopped after input drops below Threshold, in milliseconds. + + + + + Minimum speed at which compression is stopped after input drops below Threshold, in milliseconds. + + + + + Default point at which compression begins, in decibels, in decibels (dB). The default value is -20 dB. + + + + + Maximum point at which compression begins, in decibels, in decibels (dB). + + + + + Minimum point at which compression begins, in decibels, in decibels (dB). + + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The GetAllParameters method retrieves the compression parameters of a buffer. + + + microsoft.directx_sdk.idirectsoundfxcompressor8.idirectsoundfxcompressor8.getallparameters + GetAllParameters / SetAllParameters + GetAllParameters + HRESULT IDirectSoundFXCompressor::GetAllParameters([Out] DSFXCompressor* pDsFxCompressor) + + + + The SetAllParameters method sets the compression parameters of a buffer. + +
Address of a structure that specifies the effect parameters.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsoundfxcompressor8.idirectsoundfxcompressor8.setallparameters + HRESULT IDirectSoundFXCompressor::SetAllParameters([In] const DSFXCompressor* pcDsFxCompressor) + IDirectSoundFXCompressor::SetAllParameters +
+ + + The GetAllParameters method retrieves the compression parameters of a buffer. + +
Address of a structure that receives the effect parameters.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsoundfxcompressor8.idirectsoundfxcompressor8.getallparameters + HRESULT IDirectSoundFXCompressor::GetAllParameters([Out] DSFXCompressor* pDsFxCompressor) + IDirectSoundFXCompressor::GetAllParameters +
+ + + Contains information about a DirectSound device. + + + + + Initializes a new instance of the class. + + The driver GUID. + The description. + Name of the module. + + + + Identifies the DirectSound driver being enumerated + + + + + String that provides a textual description of the DirectSound device. + + + + + String that specifies the module name of the DirectSound driver corresponding to this device. + + + + +

The interface is used to create buffer objects, manage devices, and set up the environment. This interface supersedes and adds new methods.

Obtain this interface by using the DirectSoundCreate8 or DirectSoundFullDuplexCreate8 function, or by using CoCreateInstance or CoCreateInstanceEx to create an object of class CLSID_DirectSound8.

In addition to the methods inherited from , the interface exposes the following methods.

IDirectSound8 Members
Method + Description +
IDirectSound8::Compact The Compact method has no effect. +
IDirectSound8::CreateSoundBuffer The CreateSoundBuffer method creates a sound buffer object to manage audio samples. +
IDirectSound8::DuplicateSoundBuffer The DuplicateSoundBuffer method creates a new secondary buffer that shares the original buffer's memory. +
IDirectSound8::GetCaps The GetCaps method retrieves the capabilities of the hardware device that is represented by the device object. +
IDirectSound8::GetSpeakerConfig The GetSpeakerConfig method retrieves the speaker configuration. +
IDirectSound8::Initialize The Initialize method initializes a device object that was created by using the CoCreateInstance function. +
IDirectSound8::SetCooperativeLevel The SetCooperativeLevel method sets the cooperative level of the application for this sound device. +
IDirectSound8::SetSpeakerConfig The SetSpeakerConfig method specifies the speaker configuration of the device. +
The VerifyCertification method ascertains whether the device driver is certified for DirectX. +

The LPDIRECTSOUND8 type is defined as a reference to the interface:

 typedef struct   *LPDIRECTSOUND8;	
+            
+
+ +

Only objects of class CLSID_DirectSound8 support this interface. All device objects created by DirectSoundCreate8 and DirectSoundFullDuplexCreate8 fall into this category. Objects of class CLSID_DirectSound, which include all those created by using the earlier DirectSoundCreate function, support only the earlier interface.

The behavior of CLSID_DirectSound8 objects is somewhat different from that of CLSID_DirectSound objects. These differences are found in the interface as well as the interface. Specific differences in the behavior of the newer object include the following:

  • In calls to and CreateSoundBuffer, cannot be set on a buffer with a non-mono format, and cannot be combined with .

  • New buffer creation flags are supported.

  • Buffers are not filled with silence on creation.

  • The interface returned by CreateSoundBuffer can be queried for the interface.

  • WAV formats in the structure that have the format tag are checked more strictly for validity.

+
+ + ee418035 + IDirectSound8 + IDirectSound8 +
+ + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The driver GUID. + + + + Verifies the certification. + + Return true if the driver is certified + + + + Retrieves the speaker configuration of the device. + + + + + + + Sets the speaker configuration of the device. + + + + + + + Enumerates the DirectSound devices installed in the system. + + A collection of the devices found. + + + + Duplicates the sound buffer. + + The source buffer. + A duplicate of this soundBuffer. + HRESULT IDirectSound::DuplicateSoundBuffer([In] IDirectSoundBuffer* pDSBufferOriginal,[Out] void** ppDSBufferDuplicate) + IDirectSound::DuplicateSoundBuffer + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The VerifyCertification method ascertains whether the device driver is certified for DirectX. + +
Address of a DWORD variable that receives one of the values shown in the following table.
ValueDescription
DS_CERTIFIEDDriver is certified for DirectSound.
DS_UNCERTIFIEDDriver is not certified for DirectSound.
+

If the function succeeds, the return value is DS_OK.

If the function fails, the return value may be one of the error values shown in the following table.

Return code
DSERR_INVALIDPARAM
DSERR_UNSUPPORTED
+ +

This method may attempt to retrieve certification information from the Internet.

On emulated devices, the method returns DSERR_UNSUPPORTED. Emulated devices are identified by the flag in the dwFlags member of .

+
+ + microsoft.directx_sdk.idirectsound8.idirectsound8.verifycertification + HRESULT IDirectSound8::VerifyCertification([Out] unsigned int* pdwCertified) + IDirectSound8::VerifyCertification +
+ + +

The IDirectSoundCapture8 interface is used to create sound capture buffers.

The interface is obtained by using the DirectSoundCaptureCreate8 or DirectSoundFullDuplexCreate8 functions, or by using CoCreateInstance or CoCreateInstanceEx to create an object of class CLSID_DirectSoundCapture8.

IDirectSoundCapture8 is a define for . The two interface names are interchangeable. However, objects supporting this interface can have different functionality, depending on their class. For more information, see DirectSoundCaptureCreate8 and IDirectSoundCapture8::CreateCaptureBuffer.

In addition to the methods inherited from , the IDirectSoundCapture8 interface exposes the following methods.

IDirectSoundCapture8 Members
Method + Description +
IDirectSoundCapture8::CreateCaptureBuffer The CreateCaptureBuffer method creates a buffer for capturing waveform audio. +
IDirectSoundCapture8::GetCaps The GetCaps method retrieves the capabilities of the capture device. +
IDirectSoundCapture8::Initialize The Initialize method initializes a capture device object created by using CoCreateInstance. Calling this method is not required when the DirectSoundCaptureCreate8 or DirectSoundFullDuplexCreate8 function is used to create the object. +

The LPDIRECTSOUNDCAPTURE type is defined as a reference to the interface:

 typedef struct  *LPDIRECTSOUNDCAPTURE;	
+            
+
+ + ee418154 + IDirectSoundCapture + IDirectSoundCapture +
+ + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + + + + + + Enumerates the DirectSoundCapture devices installed in the system. + + A collection of the devices found. + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The GetCaps method retrieves the capabilities of the capture device. + + + microsoft.directx_sdk.idirectsoundcapture8.idirectsoundcapture8.getcaps + GetCaps + GetCaps + HRESULT IDirectSoundCapture::GetCaps([Out] DSCCAPS* pDSCCaps) + + + + The CreateCaptureBuffer method creates a buffer for capturing waveform audio. + +
Pointer to a structure containing values for the capture buffer being created.
+
Address of a variable that receives an interface reference. Use QueryInterface to obtain . See Remarks.
+
Address of the controlling object's interface for COM aggregation. Must be null.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values.

Return code
DSERR_INVALIDPARAM
DSERR_BADFORMAT
DSERR_GENERIC
DSERR_NODRIVER
DSERR_OUTOFMEMORY
DSERR_UNINITIALIZED
+ +

On Microsoft Windows98 and Windows2000, each capture device supports a single buffer.

The interface is supported only on buffers created by an object of class CLSID_DirectSoundCapture8. If the IDirectSoundCapture8 interface was obtained from DirectSoundCaptureCreate8, is supported. If IDirectSoundCapture8 was obtained from the earlier DirectSoundCaptureCreate function, only is supported.

+
+ + microsoft.directx_sdk.idirectsoundcapture8.idirectsoundcapture8.createcapturebuffer + HRESULT IDirectSoundCapture::CreateCaptureBuffer([In] const DSCBUFFERDESC* pcDSCBufferDesc,[Out] IDirectSoundCaptureBuffer** ppDSCBuffer,[In] IUnknown* pUnkOuter) + IDirectSoundCapture::CreateCaptureBuffer +
+ + + The GetCaps method retrieves the capabilities of the capture device. + +
Pointer to a structure to be receive information about the capture device. When the method is called, the dwSize member must specify the size of the structure in bytes.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_INVALIDPARAM
DSERR_UNSUPPORTED
DSERR_NODRIVER
DSERR_OUTOFMEMORY
DSERR_UNINITIALIZED
+ + microsoft.directx_sdk.idirectsoundcapture8.idirectsoundcapture8.getcaps + HRESULT IDirectSoundCapture::GetCaps([Out] DSCCAPS* pDSCCaps) + IDirectSoundCapture::GetCaps +
+ + +

The IDirectSoundFXDistortion8 interface is used to set and retrieve effect parameters on a buffer that supports distortion.

This interface is obtained by calling GetObjectInPath on the buffer that supports the effect.

In addition to the methods inherited from , the IDirectSoundFXDistortion8 interface exposes the following methods.

IDirectSoundFXDistortion8 Members
Method + Description +
IDirectSoundFXDistortion8::GetAllParameters The GetAllParameters method retrieves the distortion parameters of a buffer. +
IDirectSoundFXDistortion8::SetAllParameters The SetAllParameters method sets the distortion parameters of a buffer. +
+
+ + ee418218 + IDirectSoundFXDistortion + IDirectSoundFXDistortion +
+ + + Default percentage of distortion intensity. + + + + + Maximum percentage of distortion intensity. + + + + + Minimum percentage of distortion intensity. + + + + + Default amount of signal change after distortion. + + + + + Maximum amount of signal change after distortion. + + + + + Minimum amount of signal change after distortion. + + + + + Default width of frequency band that determines range of harmonic content addition. + + + + + Maximum width of frequency band that determines range of harmonic content addition. + + + + + Minimum width of frequency band that determines range of harmonic content addition. + + + + + Default center frequency of harmonic content addition. + + + + + Maximum center frequency of harmonic content addition. + + + + + Minimum center frequency of harmonic content addition. + + + + + Default filter cutoff for high-frequency harmonics attenuation. + + + + + Maximum filter cutoff for high-frequency harmonics attenuation. + + + + + Minimum filter cutoff for high-frequency harmonics attenuation. + + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The GetAllParameters method retrieves the distortion parameters of a buffer. + + + microsoft.directx_sdk.idirectsoundfxdistortion8.idirectsoundfxdistortion8.getallparameters + GetAllParameters / SetAllParameters + GetAllParameters + HRESULT IDirectSoundFXDistortion::GetAllParameters([Out] DSFXDistortion* pDsFxDistortion) + + + + The SetAllParameters method sets the distortion parameters of a buffer. + +
Address of a structure that specifies the effect parameters.
+

If the method succeeds, the return value is DS_OK or S_FALSE. See the Remarks for . If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsoundfxdistortion8.idirectsoundfxdistortion8.setallparameters + HRESULT IDirectSoundFXDistortion::SetAllParameters([In] const DSFXDistortion* pcDsFxDistortion) + IDirectSoundFXDistortion::SetAllParameters +
+ + + The GetAllParameters method retrieves the distortion parameters of a buffer. + +
Address of a structure that receives the effect parameters.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsoundfxdistortion8.idirectsoundfxdistortion8.getallparameters + HRESULT IDirectSoundFXDistortion::GetAllParameters([Out] DSFXDistortion* pDsFxDistortion) + IDirectSoundFXDistortion::GetAllParameters +
+ + +

The IDirectSoundFXEcho8 interface is used to set and retrieve effect parameters on a buffer that supports echo.

This interface is obtained by calling GetObjectInPath on the buffer that supports the effect.

In addition to the methods inherited from , the IDirectSoundFXEcho8 interface exposes the following methods.

IDirectSoundFXEcho8 Members
Method + Description +
IDirectSoundFXEcho8::GetAllParameters The GetAllParameters method retrieves the echo parameters of a buffer. +
IDirectSoundFXEcho8::SetAllParameters The SetAllParameters method sets the echo parameters of a buffer. +
+
+ + ee418221 + IDirectSoundFXEcho + IDirectSoundFXEcho +
+ + + Default percentage of output fed back into input. + + + + + Maximum percentage of output fed back into input. + + + + + Minimum percentage of output fed back into input. + + + + + Default delay for left channel, in milliseconds. + + + + + Maximum delay for left channel, in milliseconds. + + + + + Minimum delay for left channel, in milliseconds. + + + + + Default value that specifies whether to swap left and right delays with each successive echo. The default value is zero, meaning no swap. + + + + + Maximum value that specifies whether to swap left and right delays with each successive echo. The default value is zero, meaning no swap. + + + + + Minimum value that specifies whether to swap left and right delays with each successive echo. The default value is zero, meaning no swap. + + + + + Default delay for right channel, in milliseconds. + + + + + Maximum delay for right channel, in milliseconds. + + + + + Minimum delay for right channel, in milliseconds. + + + + + Default ratio of wet (processed) signal to dry (unprocessed) signal. + + + + + Maximum ratio of wet (processed) signal to dry (unprocessed) signal. + + + + + Minimum ratio of wet (processed) signal to dry (unprocessed) signal. + + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The GetAllParameters method retrieves the echo parameters of a buffer. + + + microsoft.directx_sdk.idirectsoundfxecho8.idirectsoundfxecho8.getallparameters + GetAllParameters / SetAllParameters + GetAllParameters + HRESULT IDirectSoundFXEcho::GetAllParameters([Out] DSFXEcho* pDsFxEcho) + + + + The SetAllParameters method sets the echo parameters of a buffer. + +
Address of a structure that specifies the effect parameters.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsoundfxecho8.idirectsoundfxecho8.setallparameters + HRESULT IDirectSoundFXEcho::SetAllParameters([In] const DSFXEcho* pcDsFxEcho) + IDirectSoundFXEcho::SetAllParameters +
+ + + The GetAllParameters method retrieves the echo parameters of a buffer. + +
Address of a structure that receives the effect parameters.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsoundfxecho8.idirectsoundfxecho8.getallparameters + HRESULT IDirectSoundFXEcho::GetAllParameters([Out] DSFXEcho* pDsFxEcho) + IDirectSoundFXEcho::GetAllParameters +
+ + + Enumerator callback for DirectSound and DirectCaptureSound. + + + + + Initializes a new instance of the class. + + + + + Natives the pointer. + + + + + + Gets or sets the device informations. + + The device informations. + + + +

The IDirectSoundFXFlanger8 interface is used to set and retrieve effect parameters on a buffer that supports flange.

This interface is obtained by calling GetObjectInPath on the buffer that supports the effect.

In addition to the methods inherited from , the IDirectSoundFXFlanger8 interface exposes the following methods.

IDirectSoundFXFlanger8 Members
Method + Description +
IDirectSoundFXFlanger8::GetAllParameters The GetAllParameters method retrieves the flange parameters of a buffer. +
IDirectSoundFXFlanger8::SetAllParameters The SetAllParameters method sets the flange parameters of a buffer. +
+
+ + ee418225 + IDirectSoundFXFlanger + IDirectSoundFXFlanger +
+ + + Default number of milliseconds the input is delayed before it is played back. + + + + + Maximum number of milliseconds the input is delayed before it is played back. + + + + + Minimum number of milliseconds the input is delayed before it is played back. + + + + + Default percentage by which the delay time is modulated by the low-frequency oscillator (LFO), in hundredths of a percentage point. + + + + + Maximum percentage by which the delay time is modulated by the low-frequency oscillator (LFO), in hundredths of a percentage point. + + + + + Minimum percentage by which the delay time is modulated by the low-frequency oscillator (LFO), in hundredths of a percentage point. + + + + + Default percentage of output signal to feed back into the effect's input. + + + + + Maximum percentage of output signal to feed back into the effect's input. + + + + + Minimum percentage of output signal to feed back into the effect's input. + + + + + Default frequency of the LFO(low-frequency oscillator). + + + + + Maximum frequency of the LFO(low-frequency oscillator). + + + + + Minimum frequency of the LFO(low-frequency oscillator). + + + + + Positive 180 phase differential between left and right LFOs. + + + + + Positive 90 phase differential between left and right LFOs. + + + + + Default phase differential between left and right LFOs. + + + + + Maximum phase differential between left and right LFOs. + + + + + Minimum phase differential between left and right LFOs. + + + + + Negative 180 phase differential between left and right LFOs. + + + + + Negative 90 phase differential between left and right LFOs. + + + + + Zero phase differential between left and right LFOs. + + + + + Default waveform shape of the LFO. By default, the waveform is a sine. + + + + + Sine waveform shape of the LFO. By default, the waveform is a sine. + + + + + Triangular waveform shape of the LFO. By default, the waveform is a sine. + + + + + Default ratio of wet (processed) signal to dry (unprocessed) signal. + + + + + Maximum ratio of wet (processed) signal to dry (unprocessed) signal. + + + + + Minimum ratio of wet (processed) signal to dry (unprocessed) signal. + + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The GetAllParameters method retrieves the flange parameters of a buffer. + + + microsoft.directx_sdk.idirectsoundfxflanger8.idirectsoundfxflanger8.getallparameters + GetAllParameters / SetAllParameters + GetAllParameters + HRESULT IDirectSoundFXFlanger::GetAllParameters([Out] DSFXFlanger* pDsFxFlanger) + + + + The SetAllParameters method sets the flange parameters of a buffer. + +
Address of a structure that specifies the effect parameters.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsoundfxflanger8.idirectsoundfxflanger8.setallparameters + HRESULT IDirectSoundFXFlanger::SetAllParameters([In] const DSFXFlanger* pcDsFxFlanger) + IDirectSoundFXFlanger::SetAllParameters +
+ + + The GetAllParameters method retrieves the flange parameters of a buffer. + +
Address of a structure that receives the effect parameters.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsoundfxflanger8.idirectsoundfxflanger8.getallparameters + HRESULT IDirectSoundFXFlanger::GetAllParameters([Out] DSFXFlanger* pDsFxFlanger) + IDirectSoundFXFlanger::GetAllParameters +
+ + +

The IDirectSoundFullDuplex8 interface represents a full-duplex stream.

The interface is obtained by using the DirectSoundFullDuplexCreate8 function. This function initializes DirectSound capture and playback.

The interface can also be obtained by using CoCreateInstance or CoCreateInstanceEx to create an object of class CLSID_DirectSoundFullDuplex8.

IDirectSoundFullDuplex8 is a define for . The interface names are interchangeable.

In addition to the methods inherited from , the IDirectSoundFullDuplex8 interface exposes the following method.

IDirectSoundFullDuplex8 Members
Method + Description +
IDirectSoundFullDuplex8::Initialize The Initialize method initializes a full duplex object that was created by using CoCreateInstance. +

The LPDIRECTSOUNDFULLDUPLEX type is defined as a reference to .

 typedef struct  *LPDIRECTSOUNDFULLDUPLEX;	
+            
Info

Operating System: Requires Microsoft Windows XP or later.

Windows

Important Note for Windows Vista

Existing applications that access Windows XP Acoustic Echo Cancellation (AEC) features via the DirectSound API will no longer obtain AEC when running on Windows Vista. These applications will still run, but their calls to AEC-specific DirectSound API calls will have no effect on the captured audio.

To learn how to obtain AEC in Windows Vista, See the Windows Vista AEC topics in the Windows SDK.

+
+ + ee418204 + IDirectSoundFullDuplex + IDirectSoundFullDuplex +
+ + + Initializes a new instance of the class. + + + + + + + + + + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + +

The IDirectSoundFXGargle8 interface is used to set and retrieve effect parameters on a buffer that supports amplitude modulation.

This interface is obtained by calling GetObjectInPath on the buffer that supports the effect.

In addition to the methods inherited from , the IDirectSoundFXGargle8 interface exposes the following methods.

IDirectSoundFXGargle8 Members
Method + Description +
IDirectSoundFXGargle8::GetAllParameters The GetAllParameters method retrieves the amplitude modulation parameters of a buffer. +
IDirectSoundFXGargle8::SetAllParameters The SetAllParameters method sets the amplitude modulation parameters of a buffer. +
+
+ + ee418228 + IDirectSoundFXGargle + IDirectSoundFXGargle +
+ + + Default rate of modulation, in Hertz. + + + + + Maximum rate of modulation, in Hertz. + + + + + Minimum rate of modulation, in Hertz. + + + + + Default shape of the modulation waveform. + + + + + Square shape of the modulation waveform. + + + + + Triangular shape of the modulation waveform. + + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The GetAllParameters method retrieves the amplitude modulation parameters of a buffer. + + + microsoft.directx_sdk.idirectsoundfxgargle8.idirectsoundfxgargle8.getallparameters + GetAllParameters / SetAllParameters + GetAllParameters + HRESULT IDirectSoundFXGargle::GetAllParameters([Out] DSFXGargle* pDsFxGargle) + + + + The SetAllParameters method sets the amplitude modulation parameters of a buffer. + +
Address of a structure that specifies the effect parameters.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value can be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsoundfxgargle8.idirectsoundfxgargle8.setallparameters + HRESULT IDirectSoundFXGargle::SetAllParameters([In] const DSFXGargle* pcDsFxGargle) + IDirectSoundFXGargle::SetAllParameters +
+ + + The GetAllParameters method retrieves the amplitude modulation parameters of a buffer. + +
Address of a structure that receives the effect parameters.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value can be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsoundfxgargle8.idirectsoundfxgargle8.getallparameters + HRESULT IDirectSoundFXGargle::GetAllParameters([Out] DSFXGargle* pDsFxGargle) + IDirectSoundFXGargle::GetAllParameters +
+ + + The structure contains parameters for acoustic echo cancellation in a capture buffer. + + +

The dwMode member is ignored when this structure is passed to IDirectSoundCaptureFXAec8::SetAllParameters.

Windows

Important Note for Windows Vista

Existing applications that access Windows XP Acoustic Echo Cancellation (AEC) features via the DirectSound API will no longer obtain AEC when running on Windows Vista. These applications will still run, but their calls to AEC-specific DirectSound API calls will have no effect on the captured audio.

To learn how to obtain AEC in Windows Vista, See the Windows Vista AEC topics in the Windows SDK.

+
+ + microsoft.directx_sdk.reference.dscfxaec + DSCFX_AEC_MODE + DSCFX_AEC_MODE +
+ + +
Boolean value that specifies whether the effect is enabled.
+
+ + microsoft.directx_sdk.reference.dscfxaec + DSCFX_AEC_MODE_PASS_THROUGH + DSCFX_AEC_MODE_PASS_THROUGH +
+ + +
Boolean value that specifies whether to enable background comfort noise, which makes the capture signal sound more natural by preventing periods of dead silence. By default, background comfort noise is not enabled.
+
+ + microsoft.directx_sdk.reference.dscfxaec + DSCFX_AEC_MODE_HALF_DUPLEX + DSCFX_AEC_MODE_HALF_DUPLEX +
+ + +
Operation mode. This member contains one of the following values.
Value + Description +
+ The effect is passing capture and render data through without modifying it. +
+ The effect is running in half duplex mode. Not presently supported. +
+ The effect is running in full duplex mode. +
+
+ + microsoft.directx_sdk.reference.dscfxaec + DSCFX_AEC_MODE_FULL_DUPLEX + DSCFX_AEC_MODE_FULL_DUPLEX +
+ + +

The KSPROPERTY_AEC_STATUS property is used to monitor the status of an AEC node (KSNODETYPE_ACOUSTIC_ECHO_CANCEL). This is an optional property of an AEC node.

+
+ +

The three least significant bits in the AEC status flags (see preceding table) represent the convergence history (CH) of the AEC algorithm. The CH status bits can be used by a Microsoft DirectSound application to determine whether the algorithm has converged and also whether it has remained in the converged state since the time that it started processing data. Depending on the audio hardware, the AEC algorithm might fail to converge, in which case the resulting capture buffer is likely to include the echo from the speakers.

When the filter containing the AEC node is created or the node is reset, the AEC algorithm initially sets the three CH status bits to zero. This setting represents the uninitialized state, AEC_STATUS_FD_HISTORY_UNINITIALIZED.

After the AEC algorithm converges, the CH status switches to the converged state, AEC_STATUS_FD_HISTORY_CONTINUOUSLY_CONVERGED. If the AEC algorithm ever loses convergence, the CH status switches to the diverged state, AEC_STATUS_FD_HISTORY_PREVIOUSLY_DIVERGED. Although the status is most likely to switch to the diverged state from the converged state, it might also switch directly from the uninitialized state to the diverged state. After the CH status has switched to the diverged state, it will remain in that state until the algorithm is reset or starvation is detected.

When the AEC system filter detects starvation at any of its four pins--capture in, capture out, render in, or render out--it resets its internal state, including the convergence history.

Note that bit 2 of the three CH status bits is not currently used.

As an alternative to using the CH status bits, the application can monitor the real-time convergence status by checking the AEC_STATUS_FD_CURRENTLY_CONVERGED flag bit. If this bit is set, the algorithm is currently converged. The algorithm can lose convergence temporarily when changes occur in the acoustic path. The real-time convergence flag is filtered to prevent such momentary losses from inappropriately switching the CH status bits to the DSCFX_AEC_STATUS_FD_HISTORY_PREVIOUSLY_DIVERGED state.

+
+ + ff537230 + DSCFX_AEC_STATUS + DSCFX_AEC_STATUS +
+ + + No documentation. + + + ff537230 + DSCFX_AEC_STATUS_HISTORY_UNINITIALIZED + DSCFX_AEC_STATUS_HISTORY_UNINITIALIZED + + + + No documentation. + + + ff537230 + DSCFX_AEC_STATUS_HISTORY_CONTINUOUSLY_CONVERGED + DSCFX_AEC_STATUS_HISTORY_CONTINUOUSLY_CONVERGED + + + + No documentation. + + + ff537230 + DSCFX_AEC_STATUS_HISTORY_PREVIOUSLY_DIVERGED + DSCFX_AEC_STATUS_HISTORY_PREVIOUSLY_DIVERGED + + + + No documentation. + + + ff537230 + DSCFX_AEC_STATUS_CURRENTLY_CONVERGED + DSCFX_AEC_STATUS_CURRENTLY_CONVERGED + + + + No documentation. + + + DSBCAPS_FLAGS + DSBCAPS_FLAGS + + + + No documentation. + + + DSBCAPS_PRIMARYBUFFER + DSBCAPS_PRIMARYBUFFER + + + + No documentation. + + + DSBCAPS_STATIC + DSBCAPS_STATIC + + + + No documentation. + + + DSBCAPS_LOCHARDWARE + DSBCAPS_LOCHARDWARE + + + + No documentation. + + + DSBCAPS_LOCSOFTWARE + DSBCAPS_LOCSOFTWARE + + + + No documentation. + + + DSBCAPS_CTRL3D + DSBCAPS_CTRL3D + + + + No documentation. + + + DSBCAPS_CTRLFREQUENCY + DSBCAPS_CTRLFREQUENCY + + + + No documentation. + + + DSBCAPS_CTRLPAN + DSBCAPS_CTRLPAN + + + + No documentation. + + + DSBCAPS_CTRLVOLUME + DSBCAPS_CTRLVOLUME + + + + No documentation. + + + DSBCAPS_CTRLPOSITIONNOTIFY + DSBCAPS_CTRLPOSITIONNOTIFY + + + + No documentation. + + + DSBCAPS_CTRLFX + DSBCAPS_CTRLFX + + + + No documentation. + + + DSBCAPS_STICKYFOCUS + DSBCAPS_STICKYFOCUS + + + + No documentation. + + + DSBCAPS_GLOBALFOCUS + DSBCAPS_GLOBALFOCUS + + + + No documentation. + + + DSBCAPS_GETCURRENTPOSITION2 + DSBCAPS_GETCURRENTPOSITION2 + + + + No documentation. + + + DSBCAPS_MUTE3DATMAXDISTANCE + DSBCAPS_MUTE3DATMAXDISTANCE + + + + No documentation. + + + DSBCAPS_LOCDEFER + DSBCAPS_LOCDEFER + + + + No documentation. + + + DSBCAPS_TRUEPLAYPOSITION + DSBCAPS_TRUEPLAYPOSITION + + + + None. + + + None + None + + + + No documentation. + + + DSBSTATUS_FLAGS + DSBSTATUS_FLAGS + + + + No documentation. + + + DSBSTATUS_PLAYING + DSBSTATUS_PLAYING + + + + No documentation. + + + DSBSTATUS_BUFFERLOST + DSBSTATUS_BUFFERLOST + + + + No documentation. + + + DSBSTATUS_LOOPING + DSBSTATUS_LOOPING + + + + No documentation. + + + DSBSTATUS_LOCHARDWARE + DSBSTATUS_LOCHARDWARE + + + + No documentation. + + + DSBSTATUS_LOCSOFTWARE + DSBSTATUS_LOCSOFTWARE + + + + No documentation. + + + DSBSTATUS_TERMINATED + DSBSTATUS_TERMINATED + + + + None. + + + None + None + + + + The structure describes the capabilities of a device. It is used by theIDirectSound8::GetCapsmethod. + + +

Some audio cards may be unable to report accurately the number of available or free hardware buffers. This can happen, for example, when the card can play more sounds at lower sampling rates than at higher rates. In general, a nonzero value in any of the members relating to number of free hardware buffers signifies that at least one hardware resource of the appropriate type is available.

The unlock transfer rate for software buffers is 0, because the data need not be transferred anywhere. Similarly, the play processing overhead for hardware buffers is 0 because the mixing is done by the sound device.

+
+ + microsoft.directx_sdk.reference.dscaps + DSCAPS_FLAGS + DSCAPS_FLAGS +
+ + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + DSCAPS_PRIMARYMONO + DSCAPS_PRIMARYMONO + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + DSCAPS_PRIMARYSTEREO + DSCAPS_PRIMARYSTEREO + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + DSCAPS_PRIMARY8BIT + DSCAPS_PRIMARY8BIT + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + DSCAPS_PRIMARY16BIT + DSCAPS_PRIMARY16BIT + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + DSCAPS_CONTINUOUSRATE + DSCAPS_CONTINUOUSRATE + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + DSCAPS_EMULDRIVER + DSCAPS_EMULDRIVER + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + DSCAPS_CERTIFIED + DSCAPS_CERTIFIED + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + DSCAPS_SECONDARYMONO + DSCAPS_SECONDARYMONO + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + DSCAPS_SECONDARYSTEREO + DSCAPS_SECONDARYSTEREO + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + DSCAPS_SECONDARY8BIT + DSCAPS_SECONDARY8BIT + + + + No documentation. + + + microsoft.directx_sdk.reference.dscaps + DSCAPS_SECONDARY16BIT + DSCAPS_SECONDARY16BIT + + + + None. + + + None + None + + + + No documentation. + + + DSCBCAPS_FLAGS + DSCBCAPS_FLAGS + + + + No documentation. + + + DSCBCAPS_WAVEMAPPED + DSCBCAPS_WAVEMAPPED + + + + No documentation. + + + DSCBCAPS_CTRLFX + DSCBCAPS_CTRLFX + + + + None. + + + None + None + + + + No documentation. + + + DSCBSTATUS_FLAGS + DSCBSTATUS_FLAGS + + + + No documentation. + + + DSCBSTATUS_CAPTURING + DSCBSTATUS_CAPTURING + + + + No documentation. + + + DSCBSTATUS_LOOPING + DSCBSTATUS_LOOPING + + + + None. + + + None + None + + + + The structure describes the capabilities of the capture device. It is used by theIDirectSoundCapture8::GetCapsmethod. + + + microsoft.directx_sdk.reference.dsccaps + DSCCAPS_FLAGS + DSCCAPS_FLAGS + + + + No documentation. + + + microsoft.directx_sdk.reference.dsccaps + DSCCAPS_EMULDRIVER + DSCCAPS_EMULDRIVER + + + + No documentation. + + + microsoft.directx_sdk.reference.dsccaps + DSCCAPS_CERTIFIED + DSCCAPS_CERTIFIED + + + + No documentation. + + + microsoft.directx_sdk.reference.dsccaps + DSCCAPS_MULTIPLECAPTURE + DSCCAPS_MULTIPLECAPTURE + + + + None. + + + None + None + + + + The structure contains parameters for an effect associated with a capture buffer. + + + microsoft.directx_sdk.reference.dsceffectdesc + DSCFX_ENUM + DSCFX_ENUM + + + +
Size of the structure, in bytes.
+
+ + microsoft.directx_sdk.reference.dsceffectdesc + DSCFX_LOCHARDWARE + DSCFX_LOCHARDWARE +
+ + +
Flags that specify desired parameters of the effect. When this structure is passed to DirectSoundFullDuplexCreate8, or IDirectSoundCapture8::CreateCaptureBuffer, this member must be one of the values shown in the following table. +
Value + Description +
+ Effect specified by guidDSCFXInstance must be in hardware. +
+ Effect specified by guidDSCFXInstance must be in software. +

On return, this member can contain one of the values shown in the following table.

Value + Description +
+ Effect was created in hardware. +
+ Effect was created in software. +
+
+ + microsoft.directx_sdk.reference.dsceffectdesc + DSCFX_LOCSOFTWARE + DSCFX_LOCSOFTWARE +
+ + + No documentation. + + + DSSCL_ENUM + DSSCL_ENUM + + + + No documentation. + + + DSSCL_NORMAL + DSSCL_NORMAL + + + + No documentation. + + + DSSCL_PRIORITY + DSSCL_PRIORITY + + + + No documentation. + + + DSSCL_EXCLUSIVE + DSSCL_EXCLUSIVE + + + + No documentation. + + + DSSCL_WRITEPRIMARY + DSSCL_WRITEPRIMARY + + + + No documentation. + + + DSOUND_ENUM_1 + DSOUND_ENUM_1 + + + + No documentation. + + + DSFXR_PRESENT + DSFXR_PRESENT + + + + No documentation. + + + DSFXR_LOCHARDWARE + DSFXR_LOCHARDWARE + + + + No documentation. + + + DSFXR_LOCSOFTWARE + DSFXR_LOCSOFTWARE + + + + No documentation. + + + DSFXR_UNALLOCATED + DSFXR_UNALLOCATED + + + + No documentation. + + + DSFXR_FAILED + DSFXR_FAILED + + + + No documentation. + + + DSFXR_UNKNOWN + DSFXR_UNKNOWN + + + + No documentation. + + + DSFXR_SENDLOOP + DSFXR_SENDLOOP + + + + No documentation. + + + DSOUND_ENUM_2 + DSOUND_ENUM_2 + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_DEFAULT + DSFX_I3DL2_ENVIRONMENT_PRESET_DEFAULT + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_GENERIC + DSFX_I3DL2_ENVIRONMENT_PRESET_GENERIC + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_PADDEDCELL + DSFX_I3DL2_ENVIRONMENT_PRESET_PADDEDCELL + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_ROOM + DSFX_I3DL2_ENVIRONMENT_PRESET_ROOM + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_BATHROOM + DSFX_I3DL2_ENVIRONMENT_PRESET_BATHROOM + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_LIVINGROOM + DSFX_I3DL2_ENVIRONMENT_PRESET_LIVINGROOM + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_STONEROOM + DSFX_I3DL2_ENVIRONMENT_PRESET_STONEROOM + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_AUDITORIUM + DSFX_I3DL2_ENVIRONMENT_PRESET_AUDITORIUM + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_CONCERTHALL + DSFX_I3DL2_ENVIRONMENT_PRESET_CONCERTHALL + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_CAVE + DSFX_I3DL2_ENVIRONMENT_PRESET_CAVE + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_ARENA + DSFX_I3DL2_ENVIRONMENT_PRESET_ARENA + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_HANGAR + DSFX_I3DL2_ENVIRONMENT_PRESET_HANGAR + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY + DSFX_I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_HALLWAY + DSFX_I3DL2_ENVIRONMENT_PRESET_HALLWAY + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR + DSFX_I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_ALLEY + DSFX_I3DL2_ENVIRONMENT_PRESET_ALLEY + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_FOREST + DSFX_I3DL2_ENVIRONMENT_PRESET_FOREST + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_CITY + DSFX_I3DL2_ENVIRONMENT_PRESET_CITY + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_MOUNTAINS + DSFX_I3DL2_ENVIRONMENT_PRESET_MOUNTAINS + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_QUARRY + DSFX_I3DL2_ENVIRONMENT_PRESET_QUARRY + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_PLAIN + DSFX_I3DL2_ENVIRONMENT_PRESET_PLAIN + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_PARKINGLOT + DSFX_I3DL2_ENVIRONMENT_PRESET_PARKINGLOT + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_SEWERPIPE + DSFX_I3DL2_ENVIRONMENT_PRESET_SEWERPIPE + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_UNDERWATER + DSFX_I3DL2_ENVIRONMENT_PRESET_UNDERWATER + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_SMALLROOM + DSFX_I3DL2_ENVIRONMENT_PRESET_SMALLROOM + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM + DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEROOM + DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEROOM + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL + DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEHALL + DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEHALL + + + + No documentation. + + + DSFX_I3DL2_ENVIRONMENT_PRESET_PLATE + DSFX_I3DL2_ENVIRONMENT_PRESET_PLATE + + + + No documentation. + + + DSBLOCK_ENUM + DSBLOCK_ENUM + + + + No documentation. + + + DSBLOCK_FROMWRITECURSOR + DSBLOCK_FROMWRITECURSOR + + + + No documentation. + + + DSBLOCK_ENTIREBUFFER + DSBLOCK_ENTIREBUFFER + + + + None. + + + None + None + + + + The GetMode method retrieves the operation mode for 3D sound processing. + + + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.getmode + DS3DMODE + DS3DMODE + + + +
Address of a variable that receives the mode setting. This value will be one of those in the following table.
Value + Description +
+ Processing of 3D sound is disabled. The sound seems to originate from the center of the listener's head. +
+ Sound parameters (position, velocity, and orientation) are relative to the listener's parameters. In this mode, the absolute parameters of the sound are updated automatically as the listener's parameters change, so that the relative parameters remain constant. +
+ Normal processing. This is the default mode. +
+
+ + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.getmode + DS3DMODE_NORMAL + DS3DMODE_NORMAL +
+ + + No documentation. + + + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.getmode + DS3DMODE_HEADRELATIVE + DS3DMODE_HEADRELATIVE + + + + No documentation. + + + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.getmode + DS3DMODE_DISABLE + DS3DMODE_DISABLE + + + + No documentation. + + + DSBPLAY_FLAGS + DSBPLAY_FLAGS + + + + No documentation. + + + DSBPLAY_LOOPING + DSBPLAY_LOOPING + + + + No documentation. + + + DSBPLAY_LOCHARDWARE + DSBPLAY_LOCHARDWARE + + + + No documentation. + + + DSBPLAY_LOCSOFTWARE + DSBPLAY_LOCSOFTWARE + + + + No documentation. + + + DSBPLAY_TERMINATEBY_TIME + DSBPLAY_TERMINATEBY_TIME + + + + No documentation. + + + DSBPLAY_TERMINATEBY_DISTANCE + DSBPLAY_TERMINATEBY_DISTANCE + + + + No documentation. + + + DSBPLAY_TERMINATEBY_PRIORITY + DSBPLAY_TERMINATEBY_PRIORITY + + + + None. + + + None + None + + + + No documentation. + + + DSOUND_ENUM_0 + DSOUND_ENUM_0 + + + + No documentation. + + + DSFX_I3DL2_MATERIAL_PRESET_SINGLEWINDOW + DSFX_I3DL2_MATERIAL_PRESET_SINGLEWINDOW + + + + No documentation. + + + DSFX_I3DL2_MATERIAL_PRESET_DOUBLEWINDOW + DSFX_I3DL2_MATERIAL_PRESET_DOUBLEWINDOW + + + + No documentation. + + + DSFX_I3DL2_MATERIAL_PRESET_THINDOOR + DSFX_I3DL2_MATERIAL_PRESET_THINDOOR + + + + No documentation. + + + DSFX_I3DL2_MATERIAL_PRESET_THICKDOOR + DSFX_I3DL2_MATERIAL_PRESET_THICKDOOR + + + + No documentation. + + + DSFX_I3DL2_MATERIAL_PRESET_WOODWALL + DSFX_I3DL2_MATERIAL_PRESET_WOODWALL + + + + No documentation. + + + DSFX_I3DL2_MATERIAL_PRESET_BRICKWALL + DSFX_I3DL2_MATERIAL_PRESET_BRICKWALL + + + + No documentation. + + + DSFX_I3DL2_MATERIAL_PRESET_STONEWALL + DSFX_I3DL2_MATERIAL_PRESET_STONEWALL + + + + No documentation. + + + DSFX_I3DL2_MATERIAL_PRESET_CURTAIN + DSFX_I3DL2_MATERIAL_PRESET_CURTAIN + + + + No documentation. + + + DSSPEAKER_ENUM + DSSPEAKER_ENUM + + + + No documentation. + + + DSSPEAKER_DIRECTOUT + DSSPEAKER_DIRECTOUT + + + + No documentation. + + + DSSPEAKER_HEADPHONE + DSSPEAKER_HEADPHONE + + + + No documentation. + + + DSSPEAKER_MONO + DSSPEAKER_MONO + + + + No documentation. + + + DSSPEAKER_QUAD + DSSPEAKER_QUAD + + + + No documentation. + + + DSSPEAKER_STEREO + DSSPEAKER_STEREO + + + + No documentation. + + + DSSPEAKER_SURROUND + DSSPEAKER_SURROUND + + + + No documentation. + + + DSSPEAKER_5POINT1 + DSSPEAKER_5POINT1 + + + + No documentation. + + + DSSPEAKER_7POINT1 + DSSPEAKER_7POINT1 + + + + No documentation. + + + DSSPEAKER_7POINT1_SURROUND + DSSPEAKER_7POINT1_SURROUND + + + + No documentation. + + + DSSPEAKER_5POINT1_SURROUND + DSSPEAKER_5POINT1_SURROUND + + + + No documentation. + + + DSSPEAKER_7POINT1_WIDE + DSSPEAKER_7POINT1_WIDE + + + + No documentation. + + + DSSPEAKER_5POINT1_BACK + DSSPEAKER_5POINT1_BACK + + + + No documentation. + + + DSSPEAKER_GEOMETRY_ENUM + DSSPEAKER_GEOMETRY_ENUM + + + + No documentation. + + + DSSPEAKER_GEOMETRY_MIN + DSSPEAKER_GEOMETRY_MIN + + + + No documentation. + + + DSSPEAKER_GEOMETRY_NARROW + DSSPEAKER_GEOMETRY_NARROW + + + + No documentation. + + + DSSPEAKER_GEOMETRY_WIDE + DSSPEAKER_GEOMETRY_WIDE + + + + No documentation. + + + DSSPEAKER_GEOMETRY_MAX + DSSPEAKER_GEOMETRY_MAX + + + + Functions + + + + + Constant AcousticEchoCancellationCaptureEffect. + GUID_DSCFX_CLASS_AEC + + + Constant MicrosoftAcousticEchoCancellationCaptureEffect. + GUID_DSCFX_MS_AEC + + + Constant SystemAcousticEchoCancellationCaptureEffect. + GUID_DSCFX_SYSTEM_AEC + + + Constant NoiseSuppressionCaptureEffect. + GUID_DSCFX_CLASS_NS + + + Constant MicrosoftNoiseSuppressionCaptureEffect. + GUID_DSCFX_MS_NS + + + Constant SystemNoiseSuppressionCaptureEffect. + GUID_DSCFX_SYSTEM_NS + + + + Functions + + + + + Constant FullHrt3DAlgorithm. + DS3DALG_HRTF_FULL + + + Constant LightHrt3DAlgorithm. + DS3DALG_HRTF_LIGHT + + + Constant NoVirtualization3DAlgorithm. + DS3DALG_NO_VIRTUALIZATION + + + + Functions + + + + + Constant AllObjects. + GUID_All_Objects + + + + The DirectSoundCaptureCreate8 function creates and initializes an object that supports the IDirectSoundCapture8 interface. Although the olderDirectSoundCaptureCreatefunction can also be used to obtain theIDirectSoundCapture8interface, the object created by that function cannot be used to create capture buffers that support theIDirectSoundCaptureBuffer8interface. + + No documentation. + No documentation. + No documentation. +

If the function succeeds, it returns DS_OK. If it fails, the return value may be one of the following values.

Return Code
DSERR_ALLOCATED
DSERR_INVALIDPARAM
DSERR_NOAGGREGATION
DSERR_OUTOFMEMORY
+ +

On sound cards that do not support full duplex, this method will fail and return DSERR_ALLOCATED.

+
+ + microsoft.directx_sdk.reference.directsoundcapturecreate8 + HRESULT DirectSoundCaptureCreate8([In, Optional] const GUID* pcGuidDevice,[Out, Fast] IDirectSoundCapture** ppDSC8,[In] IUnknown* pUnkOuter) + DirectSoundCaptureCreate8 +
+ + + The DirectSoundEnumerate function enumerates the DirectSound drivers installed in the system. + +
Address of the DSEnumCallback function that will be called for each device installed in the system.
+
Address of the user-defined context passed to the enumeration callback function every time that function is called.
+

If the function succeeds, it returns DS_OK. If it fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.reference.directsoundenumerate + HRESULT DirectSoundEnumerateA([In] __function__stdcall* pDSEnumCallback,[In, Optional] void* pContext) + DirectSoundEnumerateA +
+ + + The DirectSoundEnumerate function enumerates the DirectSound drivers installed in the system. + +
Address of the DSEnumCallback function that will be called for each device installed in the system.
+
Address of the user-defined context passed to the enumeration callback function every time that function is called.
+

If the function succeeds, it returns DS_OK. If it fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.reference.directsoundenumerate + HRESULT DirectSoundEnumerateW([In] __function__stdcall* pDSEnumCallback,[In, Optional] void* pContext) + DirectSoundEnumerateW +
+ + + The DirectSoundCaptureCreate8 function creates and initializes an object that supports the IDirectSoundCapture8 interface. Although the olderDirectSoundCaptureCreatefunction can also be used to obtain theIDirectSoundCapture8interface, the object created by that function cannot be used to create capture buffers that support theIDirectSoundCaptureBuffer8interface. + + No documentation. + No documentation. + No documentation. +

If the function succeeds, it returns DS_OK. If it fails, the return value may be one of the following values.

Return Code
DSERR_ALLOCATED
DSERR_INVALIDPARAM
DSERR_NOAGGREGATION
DSERR_OUTOFMEMORY
+ +

On sound cards that do not support full duplex, this method will fail and return DSERR_ALLOCATED.

+
+ + microsoft.directx_sdk.reference.directsoundcapturecreate8 + HRESULT DirectSoundCaptureCreate([In, Optional] const GUID* pcGuidDevice,[Out] IDirectSoundCapture** ppDSC,[In] IUnknown* pUnkOuter) + DirectSoundCaptureCreate +
+ + +

The DirectSoundFullDuplexCreate function is documented under a different name. For complete documentation of this function, see DirectSoundFullDuplexCreate8.

+
+ No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. + No documentation. +

If this function succeeds, it returns . Otherwise, it returns an error code.

+ + bb432248 + HRESULT DirectSoundFullDuplexCreate([In, Optional] const GUID* pcGuidCaptureDevice,[In, Optional] const GUID* pcGuidRenderDevice,[In] const DSCBUFFERDESC* pcDSCBufferDesc,[In] const DSBUFFERDESC* pcDSBufferDesc,[In] HWND hWnd,[In] unsigned int dwLevel,[Out, Fast] IDirectSoundFullDuplex** ppDSFD,[Out] IDirectSoundCaptureBuffer8** ppDSCBuffer8,[Out] IDirectSoundBuffer8** ppDSBuffer8,[In] IUnknown* pUnkOuter) + DirectSoundFullDuplexCreate +
+ + + No documentation. + + No documentation. + No documentation. + No documentation. + No documentation. + + HRESULT DirectSoundCreate([In, Optional] const GUID* pcGuidDevice,[Out] IDirectSound** ppDS,[In] IUnknown* pUnkOuter) + DirectSoundCreate + + + + The GetDeviceID function retrieves the unique device identifier of the default playback and capture devices selected by the user in Control Panel. + +
Address of a variable that specifies a valid device identifier, or the address of one of the following predefined variables.
ValueDescription
DSDEVID_DefaultPlaybackSystem-wide default audio playback device.
DSDEVID_DefaultCaptureSystem-wide default audio capture device.
DSDEVID_DefaultVoicePlaybackDefault voice playback device.
DSDEVID_DefaultVoiceCaptureDefault voice capture device.
+
Address of a variable that receives the unique identifier of the device.
+

If the function succeeds, it returns DS_OK. If it fails, the return value may be DSERR_INVALIDPARAM.

+ +

If pGuidSrc points to a valid device identifier, the same value is returned in pGuidDest. If pGuidSrc is one of the listed constants, pGuidDest returns the address of the corresponding device .

+
+ + microsoft.directx_sdk.reference.getdeviceid + HRESULT GetDeviceID([In, Optional] const GUID* pGuidSrc,[Out] GUID* pGuidDest) + GetDeviceID +
+ + + The DirectSoundCaptureEnumerate function enumerates the DirectSoundCapture objects installed in the system. + +
Address of the DSEnumCallback function that will be called for each DirectSoundCapture object installed in the system.
+
Address of the user-defined context passed to the enumeration callback function every time that function is called.
+

If the function succeeds, it returns DS_OK. If it fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.reference.directsoundcaptureenumerate + HRESULT DirectSoundCaptureEnumerateA([In] __function__stdcall* pDSEnumCallback,[In, Optional] void* pContext) + DirectSoundCaptureEnumerateA +
+ + + The DirectSoundCaptureEnumerate function enumerates the DirectSoundCapture objects installed in the system. + +
Address of the DSEnumCallback function that will be called for each DirectSoundCapture object installed in the system.
+
Address of the user-defined context passed to the enumeration callback function every time that function is called.
+

If the function succeeds, it returns DS_OK. If it fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.reference.directsoundcaptureenumerate + HRESULT DirectSoundCaptureEnumerateW([In] __function__stdcall* pDSEnumCallback,[In, Optional] void* pContext) + DirectSoundCaptureEnumerateW +
+ + + The DirectSoundCreate8 function creates and initializes an object that supports theIDirectSound8interface. + + No documentation. + No documentation. + No documentation. +

If the function succeeds, it returns DS_OK. If it fails, the return value may be one of the following.

Return Code
DSERR_ALLOCATED
DSERR_INVALIDPARAM
DSERR_NOAGGREGATION
DSERR_NODRIVER
DSERR_OUTOFMEMORY
+ +

The application must call the IDirectSound8::SetCooperativeLevel method immediately after creating a device object.

+
+ + microsoft.directx_sdk.reference.directsoundcreate8 + HRESULT DirectSoundCreate8([In, Optional] const GUID* pcGuidDevice,[Out, Fast] IDirectSound8** ppDS8,[In] IUnknown* pUnkOuter) + DirectSoundCreate8 +
+ + + Functions + + + + + Constant StandardFlanger. + GUID_DSFX_STANDARD_FLANGER + + + Constant StandardChorus. + GUID_DSFX_STANDARD_CHORUS + + + Constant StandardCompressor. + GUID_DSFX_STANDARD_COMPRESSOR + + + Constant StandardI3DL2REVERB. + GUID_DSFX_STANDARD_I3DL2REVERB + + + Constant WavesReverb. + GUID_DSFX_WAVES_REVERB + + + Constant StandardGargle. + GUID_DSFX_STANDARD_GARGLE + + + Constant StandardEcho. + GUID_DSFX_STANDARD_ECHO + + + Constant StandardParameq. + GUID_DSFX_STANDARD_PARAMEQ + + + Constant StandardDistortion. + GUID_DSFX_STANDARD_DISTORTION + + + + Functions + + + + + Constant Minimum. + DSBVOLUME_MIN + + + Constant Maximum. + DSBVOLUME_MAX + + + +

The IDirectSoundCaptureFXAec8 interface is used to set and retrieve parameters on a capture buffer that supports acoustic echo cancellation. This interface requires Microsoft Windows XP or later operating systems.

IDirectSoundCaptureFXAec8 is a define for . The interface names are interchangeable.

This interface is obtained by calling GetObjectInPath on the buffer that supports the effect.

In addition to the methods inherited from , the IDirectSoundCaptureFXAec8 interface exposes the following methods.

IDirectSoundCaptureFXAec8 Members
Method + Description +
IDirectSoundCaptureFXAec8::GetAllParameters The IDirectSoundCaptureFXAec8::GetAllParameters method retrieves the acoustic echo cancellation parameters of a buffer. +
IDirectSoundCaptureFXAec8::GetStatus The IDirectSoundCaptureFXAec8::GetStatus method retrieves the status of the effect. +
IDirectSoundCaptureFXAec8::Reset The IDirectSoundCaptureFXAec8::Reset method resets the effect to its initial state. +
IDirectSoundCaptureFXAec8::SetAllParameters The IDirectSoundCaptureFXAec8::SetAllParameters method sets the acoustic echo cancellation parameters of a buffer. +

The LPDIRECTSOUNDCAPTUREFXAEC8 type is defined as a reference to the IDirectSoundCaptureFXAec8 interface:

 typedef struct IDirectSoundCaptureFXAec8 *LPDIRECTSOUNDCAPTUREFXAEC8;	
+            
Info

Operating System: Requires Microsoft WindowsXP or later.

Windows

Important Note for Windows Vista

Existing applications that access Windows XP Acoustic Echo Cancellation (AEC) features via the DirectSound API will no longer obtain AEC when running on Windows Vista. These applications will still run, but their calls to AEC-specific DirectSound API calls will have no effect on the captured audio.

To learn how to obtain AEC in Windows Vista, See the Windows Vista AEC topics in the Windows SDK.

+
+ + ee418187 + IDirectSoundCaptureFXAec + IDirectSoundCaptureFXAec +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The GetAllParameters method retrieves the acoustic echo cancellation parameters of a buffer. + + +
Windows

Important Note for Windows Vista

Existing applications that access Windows XP Acoustic Echo Cancellation (AEC) features via the DirectSound API will no longer obtain AEC when running on Windows Vista. These applications will still run, but their calls to AEC-specific DirectSound API calls will have no effect on the captured audio.

To learn how to obtain AEC in Windows Vista, See the Windows Vista AEC topics in the Windows SDK.

+
+ + microsoft.directx_sdk.idirectsoundcapturefxaec8.idirectsoundcapturefxaec8.getallparameters + GetAllParameters / SetAllParameters + GetAllParameters + HRESULT IDirectSoundCaptureFXAec::GetAllParameters([Out] DSCFXAec* pDscFxAec) +
+ + + The IDirectSoundCaptureFXAec8::GetStatus method retrieves the status of the effect. + + +
Windows

Important Note for Windows Vista

Existing applications that access Windows XP Acoustic Echo Cancellation (AEC) features via the DirectSound API will no longer obtain AEC when running on Windows Vista. These applications will still run, but their calls to AEC-specific DirectSound API calls will have no effect on the captured audio.

To learn how to obtain AEC in Windows Vista, See the Windows Vista AEC topics in the Windows SDK.

The three least significant bits in *pdwStatus describe the convergence history; that is, the success of the effect in canceling the echo. The convergence history can be used by the application to determine if the algorithm has converged and remained in the converged state since it started processing data.

Initially, the AEC algorithm sets the three lower bits to 0 for the uninitialized state (). When the AEC algorithm has converged, the convergence history is switched to the state. If the AEC algorithm ever loses convergence, the convergence history is then transitioned to the state. A transition from to is also possible. The convergence history remains in the state until the algorithm is reset or timely data is no longer arriving on the capture or render stream.

+
+ + microsoft.directx_sdk.idirectsoundcapturefxaec8.idirectsoundcapturefxaec8.getstatus + GetStatus + GetStatus + HRESULT IDirectSoundCaptureFXAec::GetStatus([Out] DSCFX_AEC_STATUS* pdwStatus) +
+ + + The SetAllParameters method sets the acoustic echo cancellation parameters of a buffer. + +
Address of a structure that specifies the effect parameters.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following values.

Return code
DSERR_INVALIDPARAM
DSERR_OUTOFMEMORY
+ +
Windows

Important Note for Windows Vista

Existing applications that access Windows XP Acoustic Echo Cancellation (AEC) features via the DirectSound API will no longer obtain AEC when running on Windows Vista. These applications will still run, but their calls to AEC-specific DirectSound API calls will have no effect on the captured audio.

To learn how to obtain AEC in Windows Vista, See the Windows Vista AEC topics in the Windows SDK.

+
+ + microsoft.directx_sdk.idirectsoundcapturefxaec8.idirectsoundcapturefxaec8.setallparameters + HRESULT IDirectSoundCaptureFXAec::SetAllParameters([In] const DSCFXAec* pDscFxAec) + IDirectSoundCaptureFXAec::SetAllParameters +
+ + + The GetAllParameters method retrieves the acoustic echo cancellation parameters of a buffer. + +
Address of a structure that receives the effect parameters.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following values.

Return code
DSERR_INVALIDPARAM
DSERR_OUTOFMEMORY

If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +
Windows

Important Note for Windows Vista

Existing applications that access Windows XP Acoustic Echo Cancellation (AEC) features via the DirectSound API will no longer obtain AEC when running on Windows Vista. These applications will still run, but their calls to AEC-specific DirectSound API calls will have no effect on the captured audio.

To learn how to obtain AEC in Windows Vista, See the Windows Vista AEC topics in the Windows SDK.

+
+ + microsoft.directx_sdk.idirectsoundcapturefxaec8.idirectsoundcapturefxaec8.getallparameters + HRESULT IDirectSoundCaptureFXAec::GetAllParameters([Out] DSCFXAec* pDscFxAec) + IDirectSoundCaptureFXAec::GetAllParameters +
+ + + The IDirectSoundCaptureFXAec8::GetStatus method retrieves the status of the effect. + +
Address of a DWORD variable to receive the status. The following flags are defined. See Remarks.
ConstantValue
0x0
0x1
0x2
0x8
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following values.

Return code
DSERR_INVALIDPARAM
DSERR_OUTOFMEMORY
+ +
Windows

Important Note for Windows Vista

Existing applications that access Windows XP Acoustic Echo Cancellation (AEC) features via the DirectSound API will no longer obtain AEC when running on Windows Vista. These applications will still run, but their calls to AEC-specific DirectSound API calls will have no effect on the captured audio.

To learn how to obtain AEC in Windows Vista, See the Windows Vista AEC topics in the Windows SDK.

The three least significant bits in *pdwStatus describe the convergence history; that is, the success of the effect in canceling the echo. The convergence history can be used by the application to determine if the algorithm has converged and remained in the converged state since it started processing data.

Initially, the AEC algorithm sets the three lower bits to 0 for the uninitialized state (). When the AEC algorithm has converged, the convergence history is switched to the state. If the AEC algorithm ever loses convergence, the convergence history is then transitioned to the state. A transition from to is also possible. The convergence history remains in the state until the algorithm is reset or timely data is no longer arriving on the capture or render stream.

+
+ + microsoft.directx_sdk.idirectsoundcapturefxaec8.idirectsoundcapturefxaec8.getstatus + HRESULT IDirectSoundCaptureFXAec::GetStatus([Out] DSCFX_AEC_STATUS* pdwStatus) + IDirectSoundCaptureFXAec::GetStatus +
+ + + The IDirectSoundCaptureFXAec8::Reset method resets the effect to its initial state. + +

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_OUTOFMEMORY.

+ +
Windows

Important Note for Windows Vista

Existing applications that access Windows XP Acoustic Echo Cancellation (AEC) features via the DirectSound API will no longer obtain AEC when running on Windows Vista. These applications will still run, but their calls to AEC-specific DirectSound API calls will have no effect on the captured audio.

To learn how to obtain AEC in Windows Vista, See the Windows Vista AEC topics in the Windows SDK.

Applications should not reset an effect except when necessary because it has entered an incorrect state. This might be done in response to user input. An effect must not be reset arbitrarily at startup, because another application might be using the same effect.

+
+ + microsoft.directx_sdk.idirectsoundcapturefxaec8.idirectsoundcapturefxaec8.reset + HRESULT IDirectSoundCaptureFXAec::Reset() + IDirectSoundCaptureFXAec::Reset +
+ + +

The interface is used to create buffer objects, manage devices, and set up the environment. This interface supersedes and adds new methods.

Obtain this interface by using the DirectSoundCreate8 or DirectSoundFullDuplexCreate8 function, or by using CoCreateInstance or CoCreateInstanceEx to create an object of class CLSID_DirectSound8.

In addition to the methods inherited from , the interface exposes the following methods.

IDirectSound8 Members
Method + Description +
IDirectSound8::Compact The Compact method has no effect. +
IDirectSound8::CreateSoundBuffer The CreateSoundBuffer method creates a sound buffer object to manage audio samples. +
IDirectSound8::DuplicateSoundBuffer The DuplicateSoundBuffer method creates a new secondary buffer that shares the original buffer's memory. +
IDirectSound8::GetCaps The GetCaps method retrieves the capabilities of the hardware device that is represented by the device object. +
IDirectSound8::GetSpeakerConfig The GetSpeakerConfig method retrieves the speaker configuration. +
IDirectSound8::Initialize The Initialize method initializes a device object that was created by using the CoCreateInstance function. +
IDirectSound8::SetCooperativeLevel The SetCooperativeLevel method sets the cooperative level of the application for this sound device. +
IDirectSound8::SetSpeakerConfig The SetSpeakerConfig method specifies the speaker configuration of the device. +
The VerifyCertification method ascertains whether the device driver is certified for DirectX. +

The LPDIRECTSOUND8 type is defined as a reference to the interface:

 typedef struct   *LPDIRECTSOUND8;	
+            
+
+ +

Only objects of class CLSID_DirectSound8 support this interface. All device objects created by DirectSoundCreate8 and DirectSoundFullDuplexCreate8 fall into this category. Objects of class CLSID_DirectSound, which include all those created by using the earlier DirectSoundCreate function, support only the earlier interface.

The behavior of CLSID_DirectSound8 objects is somewhat different from that of CLSID_DirectSound objects. These differences are found in the interface as well as the interface. Specific differences in the behavior of the newer object include the following:

  • In calls to and CreateSoundBuffer, cannot be set on a buffer with a non-mono format, and cannot be combined with .

  • New buffer creation flags are supported.

  • Buffers are not filled with silence on creation.

  • The interface returned by CreateSoundBuffer can be queried for the interface.

  • WAV formats in the structure that have the format tag are checked more strictly for validity.

+
+ + ee418035 + IDirectSound + IDirectSound +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The GetCaps method retrieves the capabilities of the hardware device that is represented by the device object. + + +

Information retrieved in the structure describes the maximum capabilities of the sound device and those currently available, such as the number of hardware mixing channels and the amount of on-board sound memory. You can use this information to fine-tune performance and optimize resource allocation.

Because of resource-sharing requirements, the maximum capabilities in one area might be available only at the cost of another area.

+
+ + microsoft.directx_sdk.idirectsound8.idirectsound8.getcaps + GetCaps + GetCaps + HRESULT IDirectSound::GetCaps([Out] DSCAPS* pDSCaps) +
+ + + The CreateSoundBuffer method creates a sound buffer object to manage audio samples. + +
Address of a structure that describes the sound buffer to create.
+
Address of a variable that receives the interface of the new buffer object. Use QueryInterface to obtain . is not available for the primary buffer.
+
Address of the controlling object's interface for COM aggregation. Must be null.
+

If the method succeeds, the return value is DS_OK, or DS_NO_VIRTUALIZATION if a requested 3D algorithm was not available and stereo panning was substituted. See the description of the guid3DAlgorithm member of . If the method fails, the return value may be one of the error values shown in the following table.

Return code
DSERR_ALLOCATED
DSERR_BADFORMAT
DSERR_BUFFERTOOSMALL
DSERR_CONTROLUNAVAIL
DSERR_DS8_REQUIRED
DSERR_INVALIDCALL
DSERR_INVALIDPARAM
DSERR_NOAGGREGATION
DSERR_OUTOFMEMORY
DSERR_UNINITIALIZED
DSERR_UNSUPPORTED
+ +

DirectSound does not initialize the contents of the buffer, and the application cannot assume that it contains silence.

If an attempt is made to create a buffer with the flag on a system where hardware acceleration is not available, the method fails with either DSERR_CONTROLUNAVAIL or DSERR_INVALIDCALL, depending on the operating system.

+
+ + microsoft.directx_sdk.idirectsound8.idirectsound8.createsoundbuffer + HRESULT IDirectSound::CreateSoundBuffer([In] const DSBUFFERDESC* pcDSBufferDesc,[Out] void** ppDSBuffer,[In] IUnknown* pUnkOuter) + IDirectSound::CreateSoundBuffer +
+ + + The GetCaps method retrieves the capabilities of the hardware device that is represented by the device object. + +
Address of a structure that receives the capabilities of this sound device.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the error values shown in the following table.

Return code
DSERR_GENERIC
DSERR_INVALIDPARAM
DSERR_UNINITIALIZED
+ +

Information retrieved in the structure describes the maximum capabilities of the sound device and those currently available, such as the number of hardware mixing channels and the amount of on-board sound memory. You can use this information to fine-tune performance and optimize resource allocation.

Because of resource-sharing requirements, the maximum capabilities in one area might be available only at the cost of another area.

+
+ + microsoft.directx_sdk.idirectsound8.idirectsound8.getcaps + HRESULT IDirectSound::GetCaps([Out] DSCAPS* pDSCaps) + IDirectSound::GetCaps +
+ + + The DuplicateSoundBuffer method creates a new secondary buffer that shares the original buffer's memory. + +
Address of the or interface of the buffer to duplicate.
+
Address of a variable that receives the interface reference for the new buffer.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_ALLOCATED
DSERR_INVALIDCALL
DSERR_INVALIDPARAM
DSERR_OUTOFMEMORY
DSERR_UNINITIALIZED
+ +

This method is not valid for buffers created with the flag.

Initially, the duplicate buffer will have the same parameters as the original buffer. However, the application can change the parameters of each buffer independently, and each can be played or stopped without affecting the other.

The buffer memory is released when the last object referencing it is released.

There is a known issue with volume levels of duplicated buffers. The duplicated buffer will play at full volume unless you change the volume to a different value than the original buffer's volume setting. If the volume stays the same (even if you explicitly set the same volume in the duplicated buffer with a IDirectSoundBuffer8::SetVolume call), the buffer will play at full volume regardless. To work around this problem, immediately set the volume of the duplicated buffer to something slightly different than what it was, even if you change it one millibel. The volume may then be immediately set back again to the original desired value.

+
+ + microsoft.directx_sdk.idirectsound8.idirectsound8.duplicatesoundbuffer + HRESULT IDirectSound::DuplicateSoundBuffer([In] IDirectSoundBuffer* pDSBufferOriginal,[Out] void** ppDSBufferDuplicate) + IDirectSound::DuplicateSoundBuffer +
+ + + The SetCooperativeLevel method sets the cooperative level of the application for this sound device. + +
Handle to the application window.
+
Requested level. Specify one of the values shown in the following table.
ValueDescription
For DirectX 8.0 and later, has the same effect as . For previous versions, sets the application to the exclusive level. This means that when it has the input focus, the application will be the only one audible; sounds from applications with the flag set will be muted. With this level, it also has all the privileges of the level. DirectSound will restore the hardware format, as specified by the most recent call to the SetFormat method, after the application gains the input focus.
Sets the normal level. This level has the smoothest multitasking and resource-sharing behavior, but because it does not allow the primary buffer format to change, output is restricted to the default 8-bit format.
Sets the priority level. Applications with this cooperative level can call the SetFormat and Compact methods.
Sets the write-primary level. The application has write access to the primary buffer. No secondary buffers can be played. This level cannot be set if the DirectSound driver is being emulated for the device; that is, if the GetCaps method returns the flag in the structure.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the error values shown in the following table.

Return code
DSERR_ALLOCATED
DSERR_INVALIDPARAM
DSERR_UNINITIALIZED
DSERR_UNSUPPORTED
+ +

The application must set the cooperative level by calling this method before its buffers can be played. The recommended cooperative level is .

Do not call this method if any buffers are locked.

+
+ + microsoft.directx_sdk.idirectsound8.idirectsound8.setcooperativelevel + HRESULT IDirectSound::SetCooperativeLevel([In] HWND hwnd,[In] DSSCL_ENUM dwLevel) + IDirectSound::SetCooperativeLevel +
+ + + The Compact method has no effect. + +

The return value is DS_OK.

+ +

This method was formerly used for compacting the on-board memory of ISA sound cards.

+
+ + microsoft.directx_sdk.idirectsound8.idirectsound8.compact + HRESULT IDirectSound::Compact() + IDirectSound::Compact +
+ + + The GetSpeakerConfig method retrieves the speaker configuration. + +
Address of the speaker configuration (see remarks in IDirectSound8::SetSpeakerConfig).
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the error values shown in the following table.

Return code
DSERR_INVALIDPARAM
DSERR_UNINITIALIZED
+ +

The value returned at pdwSpeakerConfig can be a packed DWORD containing both configuration and geometry information. Use the DSSPEAKER_CONFIG and DSSPEAKER_GEOMETRY macros to unpack the DWORD, as in the following example:

 if (DSSPEAKER_CONFIG(dwSpeakerConfig) == ) { if (DSSPEAKER_GEOMETRY(dwSpeakerConfig) == ) { // Configuration is wide stereo. ...} } 

To use #defines implemented in Windows Vista, set the DIRECTSOUND_VERSION to 0x1000 before including dsound.h.

+
+ + microsoft.directx_sdk.idirectsound8.idirectsound8.getspeakerconfig + HRESULT IDirectSound::GetSpeakerConfig([Out] unsigned int* pdwSpeakerConfig) + IDirectSound::GetSpeakerConfig +
+ + + TheSetSpeakerConfigmethod specifies the speaker configuration of the device. + +
The speaker configuration. See the following remarks.
+ No documentation. + + microsoft.directx_sdk.idirectsound8.idirectsound8.setspeakerconfig + HRESULT IDirectSound::SetSpeakerConfig([In] unsigned int dwSpeakerConfig) + IDirectSound::SetSpeakerConfig +
+ + + No documentation. + + + bb280379 + IDirectSoundFXI3DL2Reverb + IDirectSoundFXI3DL2Reverb + + + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + No documentation. + + + GetAllParameters / SetAllParameters + GetAllParameters + HRESULT IDirectSoundFXI3DL2Reverb::GetAllParameters([Out] DSFXI3DL2Reverb* pDsFxI3DL2Reverb) + + + + No documentation. + + + GetPreset / SetPreset + GetPreset + HRESULT IDirectSoundFXI3DL2Reverb::GetPreset([Out] unsigned int* pdwPreset) + + + + No documentation. + + + GetQuality / SetQuality + GetQuality + HRESULT IDirectSoundFXI3DL2Reverb::GetQuality([Out] int* plQuality) + + + + No documentation. + + No documentation. + No documentation. + + HRESULT IDirectSoundFXI3DL2Reverb::SetAllParameters([In] const DSFXI3DL2Reverb* pcDsFxI3DL2Reverb) + IDirectSoundFXI3DL2Reverb::SetAllParameters + + + + No documentation. + + No documentation. + No documentation. + + HRESULT IDirectSoundFXI3DL2Reverb::GetAllParameters([Out] DSFXI3DL2Reverb* pDsFxI3DL2Reverb) + IDirectSoundFXI3DL2Reverb::GetAllParameters + + + + No documentation. + + No documentation. + No documentation. + + HRESULT IDirectSoundFXI3DL2Reverb::SetPreset([In] unsigned int dwPreset) + IDirectSoundFXI3DL2Reverb::SetPreset + + + + No documentation. + + No documentation. + No documentation. + + HRESULT IDirectSoundFXI3DL2Reverb::GetPreset([Out] unsigned int* pdwPreset) + IDirectSoundFXI3DL2Reverb::GetPreset + + + + No documentation. + + No documentation. + No documentation. + + HRESULT IDirectSoundFXI3DL2Reverb::SetQuality([In] int lQuality) + IDirectSoundFXI3DL2Reverb::SetQuality + + + + No documentation. + + No documentation. + No documentation. + + HRESULT IDirectSoundFXI3DL2Reverb::GetQuality([Out] int* plQuality) + IDirectSoundFXI3DL2Reverb::GetQuality + + + + Default ratio of the decay time at high frequencies to the decay time at low frequencies. + + + + + Maximum ratio of the decay time at high frequencies to the decay time at low frequencies. + + + + + Minimum ratio of the decay time at high frequencies to the decay time at low frequencies. + + + + + Default decay time, in seconds. + + + + + Maximum decay time, in seconds. + + + + + Minimum decay time, in seconds. + + + + + Default modal density in the late reverberation decay, in percent. + + + + + Maximum modal density in the late reverberation decay, in percent. + + + + + Minimum modal density in the late reverberation decay, in percent. + + + + + Default echo density in the late reverberation decay, in percent. + + + + + Maximum echo density in the late reverberation decay, in percent. + + + + + Minimum echo density in the late reverberation decay, in percent. + + + + + Default reference high frequency, in hertz. + + + + + Maximum reference high frequency, in hertz. + + + + + Minimum reference high frequency, in hertz. + + + + + Default attenuation of early reflections relative to Room, in mB. + + + + + Default delay time of the first reflection relative to the direct path, in seconds. + + + + + Maximum delay time of the first reflection relative to the direct path, in seconds. + + + + + Minimum delay time of the first reflection relative to the direct path, in seconds. + + + + + Maximum attenuation of early reflections relative to Room, in mB. + + + + + Minimum attenuation of early reflections relative to Room, in mB. + + + + + Default attenuation of late reverberation relative to Room, in mB. + + + + + Default time limit between the early reflections and the late reverberation relative to the time of the first reflection, in seconds. + + + + + Maximum time limit between the early reflections and the late reverberation relative to the time of the first reflection, in seconds. + + + + + Minimum time limit between the early reflections and the late reverberation relative to the time of the first reflection, in seconds. + + + + + Maximum attenuation of late reverberation relative to Room, in mB. + + + + + Minimum attenuation of late reverberation relative to Room, in mB. + + + + + Default attenuation of the room effect, in millibels (mB). + + + + + Default attenuation of the room high-frequency effect, in mB. + + + + + Maximum attenuation of the room high-frequency effect, in mB. + + + + + Minimum attenuation of the room high-frequency effect, in mB. + + + + + Maximum attenuation of the room effect, in millibels (mB). + + + + + Minimum attenuation of the room effect, in millibels (mB). + + + + + Default rolloff factor for the reflected signals. The rolloff factor for the direct path is controlled by the DirectSound listener. + + + + + Maximum rolloff factor for the reflected signals. The rolloff factor for the direct path is controlled by the DirectSound listener. + + + + + Minimum rolloff factor for the reflected signals. The rolloff factor for the direct path is controlled by the DirectSound listener. + + + + +

The IDirectSoundCaptureFXNoiseSuppress8 interface is used to set and retrieve parameters on a capture buffer that supports noise suppression. This interface requires Microsoft WindowsXP or later.

IDirectSoundCaptureFXNoiseSuppress8 is a define for . The interface names are interchangeable.

This interface is obtained by calling GetObjectInPath on the buffer that supports the effect.

In addition to the methods inherited from , the IDirectSoundCaptureFXNoiseSuppress8 interface exposes the following methods.

IDirectSoundCaptureFXNoiseSuppress8 Members
Method + Description +
IDirectSoundCaptureFXNoiseSuppress8::GetAllParameters The IDirectSoundCaptureFXNoiseSuppress8::GetAllParameters method retrieves the noise suppression parameters of a buffer. +
IDirectSoundCaptureFXNoiseSuppress8::Reset The IDirectSoundCaptureFXNoiseSuppress8::Reset method resets the effect to its initial state. +
IDirectSoundCaptureFXNoiseSuppress8::SetAllParameters The IDirectSoundCaptureFXNoiseSuppress8::SetAllParameters method sets the noise suppression parameters of a buffer. +

The LPDIRECTSOUNDNOISESUPPRESS8 type is defined as a reference to the IDirectSoundNoiseSuppress8 interface:

 typedef struct IDirectSoundCaptureFXNoiseSuppress8  *LPDIRECTSOUNDCAPTUREFXNOISESUPPRESS8;	
+            
Info

Operating System: Requires Microsoft WindowsXP or later.

Windows

Important Note for Windows Vista

Existing applications that access Windows XP Acoustic Echo Cancellation (AEC) features via the DirectSound API will no longer obtain AEC when running on Windows Vista. These applications will still run, but their calls to AEC-specific DirectSound API calls will have no effect on the captured audio.

To learn how to obtain AEC in Windows Vista, See the Windows Vista AEC topics in the Windows SDK.

+
+ + ee418197 + IDirectSoundCaptureFXNoiseSuppress + IDirectSoundCaptureFXNoiseSuppress +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The GetAllParameters method retrieves the noise suppression parameters of a buffer. + + +
Windows

Important Note for Windows Vista

Existing applications that access Windows XP Acoustic Echo Cancellation (AEC) features via the DirectSound API will no longer obtain AEC when running on Windows Vista. These applications will still run, but their calls to AEC-specific DirectSound API calls will have no effect on the captured audio.

To learn how to obtain AEC in Windows Vista, See the Windows Vista AEC topics in the Windows SDK.

+
+ + microsoft.directx_sdk.idirectsoundcapturefxnoisesuppress8.idirectsoundcapturefxnoisesuppress8.getallparameters + GetAllParameters / SetAllParameters + GetAllParameters + HRESULT IDirectSoundCaptureFXNoiseSuppress::GetAllParameters([Out] DSCFXNoiseSuppress* pDscFxNoiseSuppress) +
+ + + The SetAllParameters method sets the noise suppression parameters of a buffer. + +
Address of a structure that specifies the effect parameters.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following values:

Return code
DSERR_INVALIDPARAM
DSERR_OUTOFMEMORY
+ +
Windows

Important Note for Windows Vista

Existing applications that access Windows XP Acoustic Echo Cancellation (AEC) features via the DirectSound API will no longer obtain AEC when running on Windows Vista. These applications will still run, but their calls to AEC-specific DirectSound API calls will have no effect on the captured audio.

To learn how to obtain AEC in Windows Vista, See the Windows Vista AEC topics in the Windows SDK.

+
+ + microsoft.directx_sdk.idirectsoundcapturefxnoisesuppress8.idirectsoundcapturefxnoisesuppress8.setallparameters + HRESULT IDirectSoundCaptureFXNoiseSuppress::SetAllParameters([In] const DSCFXNoiseSuppress* pcDscFxNoiseSuppress) + IDirectSoundCaptureFXNoiseSuppress::SetAllParameters +
+ + + The GetAllParameters method retrieves the noise suppression parameters of a buffer. + +
Address of a structure that receives the effect parameters.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following values:

Return code
DSERR_INVALIDPARAM
DSERR_OUTOFMEMORY
+ +
Windows

Important Note for Windows Vista

Existing applications that access Windows XP Acoustic Echo Cancellation (AEC) features via the DirectSound API will no longer obtain AEC when running on Windows Vista. These applications will still run, but their calls to AEC-specific DirectSound API calls will have no effect on the captured audio.

To learn how to obtain AEC in Windows Vista, See the Windows Vista AEC topics in the Windows SDK.

+
+ + microsoft.directx_sdk.idirectsoundcapturefxnoisesuppress8.idirectsoundcapturefxnoisesuppress8.getallparameters + HRESULT IDirectSoundCaptureFXNoiseSuppress::GetAllParameters([Out] DSCFXNoiseSuppress* pDscFxNoiseSuppress) + IDirectSoundCaptureFXNoiseSuppress::GetAllParameters +
+ + + The IDirectSoundCaptureFXNoiseSuppress8::Reset method resets the effect to its initial state. + +

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_OUTOFMEMORY.

+ +
Windows

Important Note for Windows Vista

Existing applications that access Windows XP Acoustic Echo Cancellation (AEC) features via the DirectSound API will no longer obtain AEC when running on Windows Vista. These applications will still run, but their calls to AEC-specific DirectSound API calls will have no effect on the captured audio.

To learn how to obtain AEC in Windows Vista, See the Windows Vista AEC topics in the Windows SDK.

Applications should not reset an effect except when necessary because it has entered an incorrect state. This might be done in response to user input. An effect must not be reset arbitrarily at startup, because another application might be using the same effect.

+
+ + microsoft.directx_sdk.idirectsoundcapturefxnoisesuppress8.idirectsoundcapturefxnoisesuppress8.reset + HRESULT IDirectSoundCaptureFXNoiseSuppress::Reset() + IDirectSoundCaptureFXNoiseSuppress::Reset +
+ + + Gets or sets he noise suppression parameters of a buffer. + + + + +

The IDirectSoundFXParamEq8 interface is used to set and retrieve effect parameters on a buffer that supports parametric equalizer effects.

In addition to the methods inherited from , the IDirectSoundFXParamEq8 interface exposes the following methods.

IDirectSoundFXParamEq8 Members
Method + Description +
IDirectSoundFXParamEq8::GetAllParameters The GetAllParameters method retrieves the parametric equalizer parameters of a buffer. +
IDirectSoundFXParamEq8::SetAllParameters The SetAllParameters method sets the parametric equalizer parameters of a buffer. +
+
+ + ee418238 + IDirectSoundFXParamEq + IDirectSoundFXParamEq +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The GetAllParameters method retrieves the parametric equalizer parameters of a buffer. + + + microsoft.directx_sdk.idirectsoundfxparameq8.idirectsoundfxparameq8.getallparameters + GetAllParameters / SetAllParameters + GetAllParameters + HRESULT IDirectSoundFXParamEq::GetAllParameters([Out] DSFXParamEq* pDsFxParamEq) + + + + The SetAllParameters method sets the parametric equalizer parameters of a buffer. + +
Address of a structure that specifies the effect parameters.
+

If the method succeeds, the return value is DS_OK or S_FALSE. See the Remarks for . If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsoundfxparameq8.idirectsoundfxparameq8.setallparameters + HRESULT IDirectSoundFXParamEq::SetAllParameters([In] const DSFXParamEq* pcDsFxParamEq) + IDirectSoundFXParamEq::SetAllParameters +
+ + + The GetAllParameters method retrieves the parametric equalizer parameters of a buffer. + +
Address of a structure that receives the effect parameters.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsoundfxparameq8.idirectsoundfxparameq8.getallparameters + HRESULT IDirectSoundFXParamEq::GetAllParameters([Out] DSFXParamEq* pDsFxParamEq) + IDirectSoundFXParamEq::GetAllParameters +
+ + + Default bandwidth, in semitones. + + + + + Maximum bandwidth, in semitones. + + + + + Minimum bandwidth, in semitones. + + + + + Default center frequency, in hertz. + + + + + Maximum center frequency, in hertz. + + + + + Minimum center frequency, in hertz. + + + + + Default gain. + + + + + Maximum gain. + + + + + Minimum gain. + + + + +

The interface is used to manage sound buffers.

The interface supersedes and adds new methods.

To obtain the interface, use the CreateSoundBuffer method to retrieve , and then pass IID_IDirectSoundBuffer8 to IDirectSoundBuffer::QueryInterface.

For the primary buffer, you must use the interface; is not available. is not documented separately. For documentation, see the corresponding methods.

Not all methods of are valid for primary buffers. For example, SetCurrentPosition will fail. See the reference topics for individual methods.

In addition to the methods inherited from , the interface exposes the following methods, arranged by category.

Effects
Method + Description +
The GetObjectInPath method retrieves an interface for an effect object associated with the buffer. +
Number of elements in the pDSFXDesc and pdwResultCodes arrays. If this value is 0, pDSFXDesc and pdwResultCodes must both be null. Set to 0 to remove all effects from the buffer. +
Resource Management
Method + Description +
The AcquireResources method allocates resources for a buffer that was created with the flag in the DSBUFFERDESCDSBUFFERDESC +
IDirectSoundBuffer8::Restore The Restore method restores the memory allocation for a lost sound buffer. +
Play Management
Method + Description +
IDirectSoundBuffer8::GetCurrentPosition The GetCurrentPosition method retrieves the position of the play and write cursors in the sound buffer. +
IDirectSoundBuffer8::Lock The Lock method readies all or part of the buffer for a data write and returns references to which data can be written. +
IDirectSoundBuffer8::Play The Play method causes the sound buffer to play, starting at the play cursor. +
IDirectSoundBuffer8::SetCurrentPosition The SetCurrentPosition method sets the position of the play cursor, which is the point at which the next byte of data is read from the buffer. +
IDirectSoundBuffer8::Stop The Stop method causes the sound buffer to stop playing. +
IDirectSoundBuffer8::Unlock The Unlock method releases a locked sound buffer. +
Sound Parameters
Method + Description +
IDirectSoundBuffer8::GetFrequency The GetFrequency method retrieves the frequency, in samples per second, at which the buffer is playing. +
IDirectSoundBuffer8::GetPan The GetPan method retrieves the relative volume of the left and right audio channels. +
IDirectSoundBuffer8::GetVolume The GetVolume method retrieves the attenuation of the sound. +
IDirectSoundBuffer8::SetFrequency The SetFrequency method sets the frequency at which the audio samples are played. +
IDirectSoundBuffer8::SetPan The SetPan method sets the relative volume of the left and right channels. +
IDirectSoundBuffer8::SetVolume The SetVolume method sets the attenuation of the sound. +
Miscellaneous
Method + Description +
IDirectSoundBuffer8::GetCaps The GetCaps method retrieves the capabilities of the buffer object. +
IDirectSoundBuffer8::GetFormat The GetFormat method retrieves a description of the format of the sound data in the buffer, or the buffer size needed to retrieve the format description. +
IDirectSoundBuffer8::GetStatus The GetStatus method retrieves the status of the sound buffer. +
IDirectSoundBuffer8::Initialize The Initialize method initializes a sound buffer object if it has not yet been initialized. +
IDirectSoundBuffer8::SetFormat The SetFormat method sets the format of the primary buffer. Whenever this application has the input focus, DirectSound will set the primary buffer to the specified format. +

The LPDIRECTSOUNDBUFFER8 type is defined as a reference to the interface:

 typedef struct   *LPDIRECTSOUNDBUFFER8; 	
+            
+
+ + ee418055 + IDirectSoundBuffer8 + IDirectSoundBuffer8 +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The SetFX method enables effects on a buffer.

For this method to succeed, CoInitialize must have been called. Additionally, the buffer must not be playing or locked.

+
+
Number of elements in the pDSFXDesc and pdwResultCodes arrays. If this value is 0, pDSFXDesc and pdwResultCodes must both be null. Set to 0 to remove all effects from the buffer.
+
Address of an array of structures, of size dwEffectsCount, that specifies the effects wanted on the buffer. Must be null if dwEffectsCount is 0.
+
Address of an array of DWORD elements, of size dwEffectsCount. Each element receives one of the values shown in the following table, indicating the result of the attempt to create the corresponding effect in the pDSFXDesc array.
Note
This parameter must be null if dwEffectsCount is 0, or can be null if results are not wanted.
ValueDescription
Effect is instantiated in hardware.
Effect is instantiated in software.
Effect has not yet been assigned to hardware or software. This value is returned if the buffer was created with the flag in .
No effect was created because resources weren't available.
Effect is available but was not created because one of the other effects requested could not be created. If any of the effects requested cannot be created, none of them are, and the call fails.
Effect is not registered on the system, and the method failed as a result.
+

If the method succeeds, the return value is DS_OK or DS_INCOMPLETE. If the method fails, the return value may be one of the error values shown in the following table.

Return code
CO_E_NOTINITIALIZED
DSERR_CONTROLUNAVAIL
DSERR_GENERIC
DSERR_INVALIDPARAM
DSERR_INVALIDCALL
DSERR_NOINTERFACE
DSERR_PRIOLEVELNEEDED

In addition, the method can return an error value from DMO methods, including and . See the DirectShow documentation for possible error values.

+ +

If the method fails, the value for each effect in pdwResultCodes is either DSFXF_PRESENT or . Check these values to determine which effects caused the failure.

For the method to succeed, the buffer must have been created with the flag and must not be playing or locked.

If the method returns DSERR_NOINTERFACE or another COM error, check the result code array for or to ascertain which effect caused the error. If the method returns DSERR_INVALIDPARAM, check the result codes for to see which effects failed to acquire resources.

An effect must be set on a buffer before the effect interface can be obtained. To obtain the effect interface, use GetObjectInPath.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.setfx + HRESULT IDirectSoundBuffer8::SetFX([In] unsigned int dwEffectsCount,[In, Buffer, Optional] DSEFFECTDESC* pDSFXDesc,[InOut, Buffer] DSOUND_ENUM_0* pdwResultCodes) + IDirectSoundBuffer8::SetFX +
+ + + The AcquireResources method allocates resources for a buffer that was created with the flag in theDSBUFFERDESCstructure. + + No documentation. + No documentation. + No documentation. +

If the method succeeds, the return value is DS_OK or DS_INCOMPLETE. If the method fails, the return value may be one of the error values shown in the following table.

Return code
DSERR_CONTROLUNAVAIL
DSERR_INVALIDCALL
DSERR_INVALIDPARAM
+ +

Normally, buffers created with are not allocated resources until Play is called. can be used to allocate resources for a deferred buffer before it is played. By doing so, the application can retrieve information about effects processing and set effect parameters. If the method fails, check the values in pdwResultCodes to determine which effects caused the failure.

A buffer with acquired resources that is not yet playing is not a candidate for premature termination by the voice management flags passed to the Play method.

Resources that have been acquired by AcquireResources are released when playback is stopped.

If the method is called on a buffer on which it has already been called, the status of the effects is returned but no additional resources are allocated.

The dwEffectsCount parameter to this function must be the same as the one passed in the call to SetFX.

If an attempt is made to acquire resources for a buffer with the flag on a system where hardware acceleration is not available, the method fails with either DSERR_CONTROLUNAVAIL or DSERR_INVALIDCALL, depending on the operating system.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.acquireresources + HRESULT IDirectSoundBuffer8::AcquireResources([In] unsigned int dwFlags,[In] unsigned int dwEffectsCount,[Out, Buffer] unsigned int* pdwResultCodes) + IDirectSoundBuffer8::AcquireResources +
+ + + The GetObjectInPath method retrieves an interface for an effect object associated with the buffer. + +
Unique class identifier of the object being searched for, such as . Set this parameter to to search for objects of any class.
+
Index of the object within objects of that class in the path. See Remarks.
+
Unique identifier of the desired interface. See Remarks.
+
Address of a variable that receives the desired interface reference.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_CONTROLUNAVAIL
DSERR_INVALIDPARAM
DSERR_OBJECTNOTFOUND
+ +

Any DMO that has been set on a buffer by using SetFX can be retrieved, even it has not been allocated resources.

The following interfaces can be retrieved for the various DMOs supplied with DirectX.

rguidInterface + *ppObject +
IID_IDirectSoundFXGargle8 + IDirectSoundFXGargle8
IID_IDirectSoundFXChorus8 + IDirectSoundFXChorus8
IID_IDirectSoundFXFlanger8 + IDirectSoundFXFlanger8
IID_IDirectSoundFXEcho8 + IDirectSoundFXEcho8
IID_IDirectSoundFXDistortion8 + IDirectSoundFXDistortion8
IID_IDirectSoundFXCompressor8 + IDirectSoundFXCompressor8
IID_IDirectSoundFXParamEq8 + IDirectSoundFXParamEq8
IID_IDirectSoundFXWavesReverb8 + IDirectSoundFXWavesReverb8
IID_IDirectSoundFXI3DL2Reverb8 + IDirectSoundFXI3DL2Reverb8

In addition, the following interfaces are available for any of the standard DMOs. For information on these interfaces, see the Help for DirectX Media Objects.

rguidInterface + *ppObject +
IID_IMediaObject + +
IID_IMediaObjectInPlace + +
IID_IMediaParams + IMediaParams +

NoteWhen the DirectSound API is used to play buffers, parameter curves (envelopes) set by using the IMediaParams interface do not work, because DirectSound does not timestamp the DMO buffers.

The value in dwIndex is the index of the object within the array of effects passed to SetFX. This is not necessarily the actual position of the object in the effects chain, because some effects might not have been created.

An object is returned solely on the basis of whether it matches rguidObject and dwIndex. It is up to the application to ensure that rguidInterface specifies an interface that can be expected to be found on the object.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.getobjectinpath + HRESULT IDirectSoundBuffer8::GetObjectInPath([In] const GUID& rguidObject,[In] unsigned int dwIndex,[In] const GUID& rguidInterface,[Out] void** ppObject) + IDirectSoundBuffer8::GetObjectInPath +
+ + + Initializes a new instance of the class. + + an instance of the + The buffer description. + + + + Retrieves an interface to an effect object associated with the buffer. + + Index of the object within objects of that class in the path. See Remarks. + an effect object associated with the buffer + HRESULT IDirectSoundCaptureBuffer8::GetObjectInPath([In] GUID* rguidObject,[None] int dwIndex,[In] GUID* rguidInterface,[Out] void** ppObject) + + + + Enables effects on a buffer. + + Effects guids + No documentation. + HRESULT IDirectSoundBuffer8::SetFX([None] int dwEffectsCount,[In, Buffer, Optional] LPDSEFFECTDESC pDSFXDesc,[Out, Buffer, Optional] int* pdwResultCodes) + + + +

The interface is used to manage sound buffers.

The interface supersedes and adds new methods.

To obtain the interface, use the CreateSoundBuffer method to retrieve , and then pass IID_IDirectSoundBuffer8 to IDirectSoundBuffer::QueryInterface.

For the primary buffer, you must use the interface; is not available. is not documented separately. For documentation, see the corresponding methods.

Not all methods of are valid for primary buffers. For example, SetCurrentPosition will fail. See the reference topics for individual methods.

In addition to the methods inherited from , the interface exposes the following methods, arranged by category.

Effects
Method + Description +
The GetObjectInPath method retrieves an interface for an effect object associated with the buffer. +
Number of elements in the pDSFXDesc and pdwResultCodes arrays. If this value is 0, pDSFXDesc and pdwResultCodes must both be null. Set to 0 to remove all effects from the buffer. +
Resource Management
Method + Description +
The AcquireResources method allocates resources for a buffer that was created with the flag in the DSBUFFERDESCDSBUFFERDESC +
IDirectSoundBuffer8::Restore The Restore method restores the memory allocation for a lost sound buffer. +
Play Management
Method + Description +
IDirectSoundBuffer8::GetCurrentPosition The GetCurrentPosition method retrieves the position of the play and write cursors in the sound buffer. +
IDirectSoundBuffer8::Lock The Lock method readies all or part of the buffer for a data write and returns references to which data can be written. +
IDirectSoundBuffer8::Play The Play method causes the sound buffer to play, starting at the play cursor. +
IDirectSoundBuffer8::SetCurrentPosition The SetCurrentPosition method sets the position of the play cursor, which is the point at which the next byte of data is read from the buffer. +
IDirectSoundBuffer8::Stop The Stop method causes the sound buffer to stop playing. +
IDirectSoundBuffer8::Unlock The Unlock method releases a locked sound buffer. +
Sound Parameters
Method + Description +
IDirectSoundBuffer8::GetFrequency The GetFrequency method retrieves the frequency, in samples per second, at which the buffer is playing. +
IDirectSoundBuffer8::GetPan The GetPan method retrieves the relative volume of the left and right audio channels. +
IDirectSoundBuffer8::GetVolume The GetVolume method retrieves the attenuation of the sound. +
IDirectSoundBuffer8::SetFrequency The SetFrequency method sets the frequency at which the audio samples are played. +
IDirectSoundBuffer8::SetPan The SetPan method sets the relative volume of the left and right channels. +
IDirectSoundBuffer8::SetVolume The SetVolume method sets the attenuation of the sound. +
Miscellaneous
Method + Description +
IDirectSoundBuffer8::GetCaps The GetCaps method retrieves the capabilities of the buffer object. +
IDirectSoundBuffer8::GetFormat The GetFormat method retrieves a description of the format of the sound data in the buffer, or the buffer size needed to retrieve the format description. +
IDirectSoundBuffer8::GetStatus The GetStatus method retrieves the status of the sound buffer. +
IDirectSoundBuffer8::Initialize The Initialize method initializes a sound buffer object if it has not yet been initialized. +
IDirectSoundBuffer8::SetFormat The SetFormat method sets the format of the primary buffer. Whenever this application has the input focus, DirectSound will set the primary buffer to the specified format. +

The LPDIRECTSOUNDBUFFER8 type is defined as a reference to the interface:

 typedef struct   *LPDIRECTSOUNDBUFFER8; 	
+            
+
+ + ee418055 + IDirectSoundBuffer + IDirectSoundBuffer +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The GetCaps method retrieves the capabilities of the buffer object. + + +

The structure contains similar information to the structure passed to the CreateSoundBuffer method, with some additional information. This additional information can include the buffer's location, either in hardware or software, and performance measures.

The flags specified in the dwFlags member of the structure are the same flags used by the structure. The only difference is that in the structure, either or will be specified according to the location of the buffer memory. In the structure, these flags are optional and, depending on which flag is specified, force the buffer to be located in either hardware or software.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.getcaps + GetCaps + GetCaps + HRESULT IDirectSoundBuffer::GetCaps([Out] DSBCAPS* pDSBufferCaps) +
+ + + The GetVolume method retrieves the attenuation of the sound. + + +

The return value is between and . These values are defined as 0 and ?10,000, respectively. The value represents the original, unadjusted volume of the sound. The value indicates an audio volume attenuated by 100 dB, which, for practical purposes, is silence.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.getvolume + GetVolume / SetVolume + GetVolume + HRESULT IDirectSoundBuffer::GetVolume([Out] int* plVolume) +
+ + + The GetPan method retrieves the relative volume of the left and right audio channels. + + +

The returned value is measured in hundredths of a decibel (dB), in the range of DSBPAN_LEFT to DSBPAN_RIGHT. These values are defined in Dsound.h as -10,000 and 10,000 respectively. The value DSBPAN_LEFT means the right channel is effectively silent. The value DSBPAN_RIGHT means the left channel is effectively silent. The neutral value is DSBPAN_CENTER, defined as 0, which means that both channels are at full volume. When one channel is attenuated, the other remains at full volume.

The pan control acts cumulatively with the volume control.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.getpan + GetPan / SetPan + GetPan + HRESULT IDirectSoundBuffer::GetPan([Out] int* plPan) +
+ + + The GetFrequency method retrieves the frequency, in samples per second, at which the buffer is playing. + + +

The frequency value for software buffers is in the range of DSBFREQUENCY_MIN to DSBFREQUENCY_MAX, defined in Dsound.h. Hardware buffers can return other values.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.getfrequency + GetFrequency / SetFrequency + GetFrequency + HRESULT IDirectSoundBuffer::GetFrequency([Out] unsigned int* pdwFrequency) +
+ + + The GetStatus method retrieves the status of the sound buffer. + + +

is set if the buffer is being heard. Because of latency, a call to Play or Stop might not immediately change the status.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.getstatus + GetStatus + GetStatus + HRESULT IDirectSoundBuffer::GetStatus([Out] unsigned int* pdwStatus) +
+ + + The SetCurrentPosition method sets the position of the play cursor, which is the point at which the next byte of data is read from the buffer. + + +

This method cannot be called on the primary buffer.

If the buffer is playing, the cursor immediately moves to the new position and play continues from that point. If it is not playing, playback will begin from the new position the next time the Play method is called.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.setcurrentposition + SetCurrentPosition + SetCurrentPosition + HRESULT IDirectSoundBuffer::SetCurrentPosition([In] unsigned int dwNewPosition) +
+ + + The GetCaps method retrieves the capabilities of the buffer object. + +
Address of a structure to contain the capabilities of this sound buffer.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

The structure contains similar information to the structure passed to the CreateSoundBuffer method, with some additional information. This additional information can include the buffer's location, either in hardware or software, and performance measures.

The flags specified in the dwFlags member of the structure are the same flags used by the structure. The only difference is that in the structure, either or will be specified according to the location of the buffer memory. In the structure, these flags are optional and, depending on which flag is specified, force the buffer to be located in either hardware or software.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.getcaps + HRESULT IDirectSoundBuffer::GetCaps([Out] DSBCAPS* pDSBufferCaps) + IDirectSoundBuffer::GetCaps +
+ + + The GetCurrentPosition method retrieves the position of the play and write cursors in the sound buffer. + +
Address of a variable that receives the offset, in bytes, of the play cursor. This parameter can be null if the value is not wanted.
+
Address of a variable that receives the offset, in bytes, of the write cursor. This parameter can be null if the value is not wanted.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED
+ +

The write cursor is the point in the buffer ahead of which it is safe to write data to the buffer. Data should not be written to the part of the buffer after the play cursor and before the write cursor.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.getcurrentposition + HRESULT IDirectSoundBuffer::GetCurrentPosition([Out, Optional] unsigned int* pdwCurrentPlayCursor,[Out, Optional] unsigned int* pdwCurrentWriteCursor) + IDirectSoundBuffer::GetCurrentPosition +
+ + + The GetFormat method retrieves a description of the format of the sound data in the buffer, or the buffer size needed to retrieve the format description. + +
Address of a or structure that receives a description of the sound data in the buffer. To retrieve the buffer size needed to contain the format description, specify null. In this case the variable at pdwSizeWritten receives the size of the structure needed to receive the data.
+
Size, in bytes, of the structure at pwfxFormat. If pwfxFormat is not null, this value must be equal to or greater than the size of the expected data.
+
Address of a variable that receives the number of bytes written to the structure at pwfxFormat. This parameter can be null.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

The format structure can have a variable length that depends on the format. Before retrieving the format description, the application should query the buffer object for the size of the format by calling this method and specifying null for the pwfxFormat parameter. The necessary size of the structure is returned in the pdwSizeWritten parameter. The application can then allocate sufficient memory and call GetFormat again to retrieve the format description.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.getformat + HRESULT IDirectSoundBuffer::GetFormat([Out, Buffer, Optional] WAVEFORMATEX* pwfxFormat,[In] unsigned int dwSizeAllocated,[Out, Optional] unsigned int* pdwSizeWritten) + IDirectSoundBuffer::GetFormat +
+ + + The GetVolume method retrieves the attenuation of the sound. + +
Address of a variable that receives the attenuation, in hundredths of a decibel.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_CONTROLUNAVAIL
DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED
+ +

The return value is between and . These values are defined as 0 and ?10,000, respectively. The value represents the original, unadjusted volume of the sound. The value indicates an audio volume attenuated by 100 dB, which, for practical purposes, is silence.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.getvolume + HRESULT IDirectSoundBuffer::GetVolume([Out] int* plVolume) + IDirectSoundBuffer::GetVolume +
+ + + The GetPan method retrieves the relative volume of the left and right audio channels. + +
Address of a variable that receives the relative volume, in hundredths of a decibel.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_CONTROLUNAVAIL
DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED
+ +

The returned value is measured in hundredths of a decibel (dB), in the range of DSBPAN_LEFT to DSBPAN_RIGHT. These values are defined in Dsound.h as -10,000 and 10,000 respectively. The value DSBPAN_LEFT means the right channel is effectively silent. The value DSBPAN_RIGHT means the left channel is effectively silent. The neutral value is DSBPAN_CENTER, defined as 0, which means that both channels are at full volume. When one channel is attenuated, the other remains at full volume.

The pan control acts cumulatively with the volume control.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.getpan + HRESULT IDirectSoundBuffer::GetPan([Out] int* plPan) + IDirectSoundBuffer::GetPan +
+ + + The GetFrequency method retrieves the frequency, in samples per second, at which the buffer is playing. + +
Address of a variable that receives the frequency at which the audio buffer is being played, in hertz.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_CONTROLUNAVAIL
DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED
+ +

The frequency value for software buffers is in the range of DSBFREQUENCY_MIN to DSBFREQUENCY_MAX, defined in Dsound.h. Hardware buffers can return other values.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.getfrequency + HRESULT IDirectSoundBuffer::GetFrequency([Out] unsigned int* pdwFrequency) + IDirectSoundBuffer::GetFrequency +
+ + + The GetStatus method retrieves the status of the sound buffer. + +
Address of a variable that receives the status of the sound buffer. The status can be a combination of the following flags:
ValueDescription
The buffer is lost and must be restored before it can be played or locked.
The buffer is being looped. If this value is not set, the buffer will stop when it reaches the end of the sound data. This value is returned only in combination with .
The buffer is playing. If this value is not set, the buffer is stopped.
The buffer is playing in software. Set only for buffers created with the flag.
The buffer is playing in hardware. Set only for buffers created with the flag.
The buffer was prematurely terminated by the voice manager and is not playing. Set only for buffers created with the flag.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

is set if the buffer is being heard. Because of latency, a call to Play or Stop might not immediately change the status.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.getstatus + HRESULT IDirectSoundBuffer::GetStatus([Out] unsigned int* pdwStatus) + IDirectSoundBuffer::GetStatus +
+ + + The Initialize method initializes a sound buffer object if it has not yet been initialized. + +
Address of the device object associated with this buffer.
+
Address of a structure that contains the values used to initialize this sound buffer.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values.

Return code
DSERR_INVALIDPARAM
DSERR_ALREADYINITIALIZED
+ +

Because the CreateSoundBuffer method calls Initialize internally, applications do not need to call this method.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.initialize + HRESULT IDirectSoundBuffer::Initialize([In] IDirectSound* pDirectSound,[In] const DSBUFFERDESC* pcDSBufferDesc) + IDirectSoundBuffer::Initialize +
+ + + The Lock method readies all or part of the buffer for a data write and returns references to which data can be written. + +
Offset, in bytes, from the start of the buffer to the point where the lock begins. This parameter is ignored if is specified in the dwFlags parameter.
+
Size, in bytes, of the portion of the buffer to lock. The buffer is conceptually circular, so this number can exceed the number of bytes between dwOffset and the end of the buffer.
+
Address of a variable that receives a reference to the first locked part of the buffer.
+
Address of a variable that receives the number of bytes in the block at ppvAudioPtr1. If this value is less than dwBytes, the lock has wrapped and ppvAudioPtr2 points to a second block of data at the beginning of the buffer.
+
Address of a variable that receives a reference to the second locked part of the capture buffer. If null is returned, the ppvAudioPtr1 parameter points to the entire locked portion of the capture buffer.
+
Address of a variable that receives the number of bytes in the block at ppvAudioPtr2. If ppvAudioPtr2 is null, this value is zero.
+
Flags modifying the lock event. The following flags are defined:
ValueDescription
Start the lock at the write cursor. The dwOffset parameter is ignored.
Lock the entire buffer. The dwBytes parameter is ignored.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_BUFFERLOST
DSERR_INVALIDCALL
DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED
+ +

This method accepts an offset and a byte count, and returns two write references and their associated sizes. If the locked portion does not extend to the end of the buffer and wrap to the beginning, the second reference, ppvAudioBytes2, receives null. If the lock does wrap, ppvAudioBytes2 points to the beginning of the buffer.

If the application passes null for the ppvAudioPtr2 and pdwAudioBytes2 parameters, the lock extends no further than the end of the buffer and does not wrap.

After writing data to the references returned by this method, the application must immediately call Unlock to notify DirectSound that the data is ready for playback. Failure to do so can cause audio breakup or silence on some sound device configurations.

This method returns write references only. The application should not try to read sound data from this reference, because the data might not be valid. For example, if the buffer is located in on-card memory, the reference might be an address to a temporary buffer in system memory. When IDirectSoundBuffer8::Unlock is called, the contents of this temporary buffer are transferred to the on-card memory.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.lock + HRESULT IDirectSoundBuffer::Lock([In] unsigned int dwOffset,[In] unsigned int dwBytes,[Out] void** ppvAudioPtr1,[Out] unsigned int* pdwAudioBytes1,[Out] void** ppvAudioPtr2,[Out, Optional] unsigned int* pdwAudioBytes2,[In] DSBLOCK_ENUM dwFlags) + IDirectSoundBuffer::Lock +
+ + + The Play method causes the sound buffer to play, starting at the play cursor. + +
Reserved. Must be 0.
+
Priority for the sound, used by the voice manager when assigning hardware mixing resources. The lowest priority is 0, and the highest priority is 0xFFFFFFFF. If the buffer was not created with the flag, this value must be 0.
+
Flags specifying how to play the buffer. The following flags are defined:

Looping flag

ValueDescription
After the end of the audio buffer is reached, play restarts at the beginning of the buffer. Play continues until explicitly stopped. This flag must be set when playing a primary buffer.

Voice allocation flags

The voice allocation flags are valid only for buffers created with the flag. One of the following flags can be used to force the processing of the sound into hardware or software. If neither DBSPLAY_LOCHARDWARE nor DBSPLAY_LOCSOFTWARE is set, the sound is played in either software or hardware, depending on the availability of resources at the time the method is called. See Remarks.

ValueDescription
Play this voice in a hardware buffer only. If the hardware has no available voices and no voice management flags are set, the call to IDirectSoundBuffer8::Play fails. This flag cannot be combined with .
Play this voice in a software buffer only. This flag cannot be combined with or any voice management flag.

Voice management flags

The voice management flags are valid only for buffers created with the flag, and are used for sounds that are to play in hardware. These flags enable hardware resources that are already in use to be yielded to the current sound. Only buffers created with the flag are candidates for premature termination. See Remarks.

ValueDescription
If the hardware has no available voices, a currently playing nonlooping buffer will be stopped to make room for the new buffer. The buffer prematurely terminated is the one with the least time left to play.
If the hardware has no available voices, a currently playing buffer will be stopped to make room for the new buffer. The buffer prematurely terminated will be selected from buffers that have the buffer's DSBCAPS_ MUTE3DATMAXDISTANCE flag set and are beyond their maximum distance. If there are no such buffers, the method fails.
If the hardware has no available voices, a currently playing buffer will be stopped to make room for the new buffer. The buffer prematurely terminated will be the one with the lowest priority as set by the dwPriority parameter passed to IDirectSoundBuffer8::Play for the buffer.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_BUFFERLOST
DSERR_INVALIDCALL
DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED
+ +

If SetCooperativeLevel has not been called, the method returns DS_OK, but no sound will be produced until a cooperative level has been set.

If the application is multithreaded, the thread that plays the buffer must continue to exist as long as the buffer is playing. Buffers created on WDM drivers stop playing when the thread is terminated.

If the buffer specified in the method is already playing, the call to the method succeeds and the buffer continues to play. However, the flags defined in the most recent call supersede flags defined in previous calls.

When called on the primary buffer, this method causes the buffer to start playing to the sound device. If the application has set the cooperative level, any audio data put in the primary buffer by the application is sent to the sound device. Under any other cooperative level, the primary buffer plays silence if no secondary buffers are playing. Primary buffers must be played with the flag set.

If the method is called with a voice allocation or voice management flag set on a buffer that was not created with the flag, the call fails with DSERR_INVALIDPARAM.

and cannot be combined, but either may be combined with , in which case the or flag is used to determine which buffer should be terminated in the event of a priority tie.

The following table shows the behavior of the method under various combinations of the voice allocation and voice management flags when no free hardware voices are available.

+ Neither nor + +
+ Sound with least time left to play is terminated and the new sound plays on the released voice. + Sound with least time left to play is terminated and the new sound plays on the released voice. + New sound plays in software. +
+ If any sounds currently playing in hardware are beyond their maximum distance and have the flag set, one of them is terminated and the new sound plays in hardware. Otherwise, the call fails. + If any sounds currently playing in hardware are beyond their maximum distance and have the flag set, one of them is terminated and the new sound plays in hardware. Otherwise, the new sound plays in software. + New sound plays in software. +
+ If the new sound's priority is higher than or equal to that of any sound currently playing in hardware, one of the lowest-priority sounds is terminated and the new sound plays in hardware. Otherwise, the call fails. + If the new sound's priority is higher than or equal to that of any sound currently playing in hardware, one of the lowest-priority sounds is terminated and the new sound plays in hardware. Otherwise, the new sound plays in software. + New sound plays in software. +
+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.play + HRESULT IDirectSoundBuffer::Play([In] unsigned int dwReserved1,[In] unsigned int dwPriority,[In] DSBPLAY_FLAGS dwFlags) + IDirectSoundBuffer::Play +
+ + + The SetCurrentPosition method sets the position of the play cursor, which is the point at which the next byte of data is read from the buffer. + +
Offset of the play cursor, in bytes, from the beginning of the buffer.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_INVALIDCALL
DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED
+ +

This method cannot be called on the primary buffer.

If the buffer is playing, the cursor immediately moves to the new position and play continues from that point. If it is not playing, playback will begin from the new position the next time the Play method is called.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.setcurrentposition + HRESULT IDirectSoundBuffer::SetCurrentPosition([In] unsigned int dwNewPosition) + IDirectSoundBuffer::SetCurrentPosition +
+ + + The SetFormat method sets the format of the primary buffer. Whenever this application has the input focus, DirectSound will set the primary buffer to the specified format. + +
Address of a structure that describes the new format for the primary sound buffer.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_BADFORMAT
DSERR_INVALIDCALL
DSERR_INVALIDPARAM
DSERR_OUTOFMEMORY
DSERR_PRIOLEVELNEEDED
DSERR_UNSUPPORTED
+ +

The format of the primary buffer should be set before secondary buffers are created.

The method fails if the application has the cooperative level.

If the application is using DirectSound at the cooperative level, and the format is not supported, the method fails.

If the cooperative level is , DirectSound stops the primary buffer, changes the format, and restarts the buffer. The method succeeds even if the hardware does not support the requested format; DirectSound sets the buffer to the closest supported format. To determine whether this has happened, an application can call the GetFormat method for the primary buffer and compare the result with the format that was requested with the SetFormat method.

This method is not available for secondary sound buffers. If a new format is required, the application must create a new DirectSoundBuffer object.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.setformat + HRESULT IDirectSoundBuffer::SetFormat([In] const void* pcfxFormat) + IDirectSoundBuffer::SetFormat +
+ + + The SetVolume method sets the attenuation of the sound. + +
Attenuation, in hundredths of a decibel (dB).
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_CONTROLUNAVAIL
DSERR_GENERIC
DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED
+ +

Allowable values are between (no attenuation) and (silence). These values are defined in Dsound.h as 0 and ?10,000 respectively. The value represents the original, unadjusted volume of the stream. The value indicates an audio volume attenuated by 100 dB, which, for all practical purposes, is silence. DirectSound does not support amplification.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.setvolume + HRESULT IDirectSoundBuffer::SetVolume([In] int lVolume) + IDirectSoundBuffer::SetVolume +
+ + + The SetPan method sets the relative volume of the left and right channels. + +
Relative volume between the left and right channels.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_CONTROLUNAVAIL
DSERR_GENERIC
DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED
+ +

The returned value is measured in hundredths of a decibel (dB), in the range of DSBPAN_LEFT to DSBPAN_RIGHT. These values are defined in Dsound.h as -10,000 and 10,000 respectively. The value DSBPAN_LEFT means the right channel is attenuated by 100 dB and is effectively silent. The value DSBPAN_RIGHT means the left channel is silent. The neutral value is DSBPAN_CENTER, defined as 0, which means that both channels are at full volume. When one channel is attenuated, the other remains at full volume.

The pan control acts cumulatively with the volume control.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.setpan + HRESULT IDirectSoundBuffer::SetPan([In] int lPan) + IDirectSoundBuffer::SetPan +
+ + + The SetFrequency method sets the frequency at which the audio samples are played. + +
Frequency, in hertz (Hz), at which to play the audio samples. A value of DSBFREQUENCY_ORIGINAL resets the frequency to the default value of the buffer format.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_CONTROLUNAVAIL
DSERR_GENERIC
DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED
+ +

Increasing or decreasing the frequency changes the perceived pitch of the audio data. This method does not affect the format of the buffer.

Before setting the frequency, you should ascertain whether the frequency is supported by checking the dwMinSecondarySampleRate and dwMaxSecondarySampleRate members of the structure for the device. Some operating systems do not support frequencies greater than 100,000 Hz.

This method is not valid for the primary buffer.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.setfrequency + HRESULT IDirectSoundBuffer::SetFrequency([In] unsigned int dwFrequency) + IDirectSoundBuffer::SetFrequency +
+ + + The Stop method causes the sound buffer to stop playing. + +

If the method succeeds, the return value is DS_OK. Returns an error code if the method fails.

+ +

For secondary sound buffers, IDirectSoundBuffer8::Stop sets the play cursor to the sample that follows the last sample played. This means that when the Play method is next called on the buffer, it will continue playing where it left off.

For the primary buffer, if an application has the level, this method will stop the buffer and reset the play cursor to 0 (the beginning of the buffer). This is necessary because the primary buffers on most sound cards can play only from the beginning of the buffer.

However, if IDirectSoundBuffer8::Stop is called on a primary buffer and the application has a cooperative level other than , this method simply reverses the effects of IDirectSoundBuffer8::Play. It configures the primary buffer to stop if no secondary buffers are playing. If other buffers are playing in this or other applications, the primary buffer will not actually stop until they are stopped. This method is useful because playing the primary buffer consumes processing overhead even if the buffer is playing sound data with the amplitude of 0 decibels.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.stop + HRESULT IDirectSoundBuffer::Stop() + IDirectSoundBuffer::Stop +
+ + + The Unlock method releases a locked sound buffer. + +
Address of the value retrieved in the ppvAudioPtr1 parameter of the Lock method.
+
Number of bytes written to the portion of the buffer at pvAudioPtr1. See Remarks.
+
Address of the value retrieved in the ppvAudioPtr2 parameter of the IDirectSoundBuffer8::Lock method.
+
Number of bytes written to the portion of the buffer at pvAudioPtr2. See Remarks.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_INVALIDCALL
DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED
+ +

An application must pass both references, pvAudioPtr1 and pvAudioPtr2, returned by the IDirectSoundBuffer8::Lock method to ensure the correct pairing of IDirectSoundBuffer8::Lock and IDirectSoundBuffer8::Unlock. The second reference is needed even if nothing was written to the second reference.

The values in dwAudioBytes1 and dwAudioBytes2 must specify the number of bytes actually written to each part of the buffer, which might be less than the size of the lock. DirectSound uses these values to determine how much data to commit to the device.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.unlock + HRESULT IDirectSoundBuffer::Unlock([In, Buffer] void* pvAudioPtr1,[In] unsigned int dwAudioBytes1,[In, Buffer, Optional] void* pvAudioPtr2,[In] unsigned int dwAudioBytes2) + IDirectSoundBuffer::Unlock +
+ + + The Restore method restores the memory allocation for a lost sound buffer. + +

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code

  • DSERR_BUFFERLOST

  • DSERR_INVALIDCALL

  • DSERR_PRIOLEVELNEEDED

+ +

If the application does not have the input focus, IDirectSoundBuffer8::Restore might not succeed. For example, if the application with the input focus has the cooperative level, no other application will be able to restore its buffers. Similarly, an application with the cooperative level must have the input focus to restore its primary buffer.

After DirectSound restores the buffer memory, the application must rewrite the buffer with valid sound data. DirectSound cannot restore the contents of the memory, only the memory itself.

The application can receive notification that a buffer is lost when it specifies that buffer in a call to the Lock or Play method. These methods return DSERR_BUFFERLOST to indicate a lost buffer. The GetStatus method can also be used to retrieve the status of the sound buffer and test for the flag.

+
+ + microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.restore + HRESULT IDirectSoundBuffer::Restore() + IDirectSoundBuffer::Restore +
+ + HRESULT IDirectSoundBuffer::Play([None] int dwReserved1,[None] int dwPriority,[None] int dwFlags) + + + + The Lock method readies all or part of the buffer for a data write and returns pointers to which data can be written. + + Offset, in bytes, from the start of the buffer to the point where the lock begins. This parameter is ignored if DSBLOCK_FROMWRITECURSOR is specified in the dwFlags parameter. + Size, in bytes, of the portion of the buffer to lock. The buffer is conceptually circular, so this number can exceed the number of bytes between dwOffset and the end of the buffer. + Flags modifying the lock event. The following flags are defined: ValueDescription DSBLOCK_FROMWRITECURSORStart the lock at the write cursor. The dwOffset parameter is ignored. DSBLOCK_ENTIREBUFFERLock the entire buffer. The dwBytes parameter is ignored. + Address of a variable that receives a pointer to the second locked part of the capture buffer. If NULL is returned, the ppvAudioPtr1 parameter points to the entire locked portion of the capture buffer. + Address of a variable that receives a pointer to the first locked part of the buffer. + HRESULT IDirectSoundBuffer::Lock([None] int dwOffset,[None] int dwBytes,[Out] void** ppvAudioPtr1,[Out] int* pdwAudioBytes1,[Out] void** ppvAudioPtr2,[Out, Optional] int* pdwAudioBytes2,[None] int dwFlags) + + + + The Unlock method releases a locked sound buffer. + + Address of the value retrieved in the ppvAudioPtr1 parameter of the {{Lock}} method. + Address of the value retrieved in the ppvAudioPtr2 parameter of the IDirectSoundBuffer8::Lock method. + No documentation. + HRESULT IDirectSoundBuffer::Unlock([In, Buffer] void* pvAudioPtr1,[None] int dwAudioBytes1,[In, Buffer, Optional] void* pvAudioPtr2,[None] int dwAudioBytes2) + + + + Writes data to the buffer. + + + The data. + The buffer offset. + The flags. + + + + Writes data to the buffer. + + + The data. + The start index. + The count. + The buffer offset. + The flags. + + + + Sets the notification positions. + + The positions. + + + + + Sets the new format for the primary sound buffer. + + + The wave format. + + + HRESULT IDirectSoundBuffer::SetFormat([In] const WAVEFORMATEX* pcfxFormat) + + + +

The IDirectSound3DBuffer8 interface is used to retrieve and set parameters that describe the position, orientation, and environment of a sound buffer in 3D space.

IDirectSound3DBuffer8 is a define for . The two interface names are interchangeable.

The IDirectSound3DBuffer8 interface is obtained from a buffer that was created with the flag. You can get it from the interface by using the QueryInterface method.

In addition to the methods inherited from , the IDirectSound3DBuffer8 interface exposes the following methods, arranged by category.

3D mode
Method + Description +
IDirectSound3DBuffer8::GetMode The GetMode method retrieves the operation mode for 3D sound processing. +
IDirectSound3DBuffer8::SetMode The SetMode method sets the operation mode for 3D sound processing. +
Batch Parameters
Method + Description +
IDirectSound3DBuffer8::GetAllParameters The GetAllParameters method retrieves the 3D properties of the sound buffer. +
IDirectSound3DBuffer8::SetAllParameters The SetAllParameters method sets all 3D sound buffer properties. +
Minimum and Maximum Distance
Method + Description +
IDirectSound3DBuffer8::GetMaxDistance The GetMaxDistance method retrieves the maximum distance, which is the distance from the listener beyond which sounds in this buffer are no longer attenuated. +
IDirectSound3DBuffer8::GetMinDistance The GetMinDistance method retrieves the minimum distance, which is the distance from the listener at which sounds in this buffer begin to be attenuated. +
IDirectSound3DBuffer8::SetMaxDistance The SetMaxDistance method sets the maximum distance, which is the distance from the listener beyond which sounds in this buffer are no longer attenuated. +
IDirectSound3DBuffer8::SetMinDistance The SetMinDistance method sets the minimum distance, which is the distance from the listener at which sounds in this buffer begin to be attenuated. +
Position
Method + Description +
IDirectSound3DBuffer8::GetPosition The GetPosition method retrieves the position of the sound source. +
IDirectSound3DBuffer8::SetPosition The SetPosition method sets the position of the sound source. +
Sound Projection Cone
Method + Description +
IDirectSound3DBuffer8::GetConeAngles The GetConeAngles method retrieves the inside and outside angles of the sound projection cone. +
IDirectSound3DBuffer8::GetConeOrientation The GetConeOrientation method retrieves the orientation of the sound projection cone. +
IDirectSound3DBuffer8::GetConeOutsideVolume The GetConeOutsideVolume method retrieves the volume of the sound outside the outside angle of the sound projection cone. +
IDirectSound3DBuffer8::SetConeAngles The SetConeAngles method sets the inside and outside angles of the sound projection cone. +
IDirectSound3DBuffer8::SetConeOrientation The SetConeOrientation method sets the orientation of the sound projection cone. +
IDirectSound3DBuffer8::SetConeOutsideVolume The SetConeOutsideVolume method sets the volume of the sound outside the outside angle of the sound projection cone. +
Velocity
Method + Description +
IDirectSound3DBuffer8::GetVelocity The GetVelocity method retrieves the velocity of the sound source. +
IDirectSound3DBuffer8::SetVelocity The SetVelocity method sets the velocity of the sound source. +

The LPDIRECTSOUND3DBUFFER type is defined as a reference to the IDirectSound3DBuffer8 interface:

 typedef struct   *LPDIRECTSOUND3DBUFFER;	
+            
+
+ + ee417960 + IDirectSound3DBuffer + IDirectSound3DBuffer +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The GetAllParameters method retrieves the 3D properties of the sound buffer. + +
Address of a structure that receives the information describing the 3D characteristics of the sound buffer.
+

If the method succeeds, the return value is DS_OK.

If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.getallparameters + HRESULT IDirectSound3DBuffer::GetAllParameters([Out] DS3DBUFFER* pDs3dBuffer) + IDirectSound3DBuffer::GetAllParameters +
+ + + The GetConeAngles method retrieves the inside and outside angles of the sound projection cone. + +
Addresses of a variable that receives the inside angle of the sound projection cone, in degrees. This is the angle within which the sound is at its normal volume.
+
Addresses of a variable that receives the outside angle of the sound projection cone, in degrees. This is the angle outside of which the sound is at its outside volume.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

The minimum, maximum, and default cone angles are defined in Dsound.h as DS3D_MINCONEANGLE, DS3D_MAXCONEANGLE, and DS3D_DEFAULTCONEANGLE.

+
+ + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.getconeangles + HRESULT IDirectSound3DBuffer::GetConeAngles([Out] unsigned int* pdwInsideConeAngle,[Out] unsigned int* pdwOutsideConeAngle) + IDirectSound3DBuffer::GetConeAngles +
+ + + The GetConeOrientation method retrieves the orientation of the sound projection cone. + +
Address of a structure that receives the orientation of the sound projection cone. The vector information represents the center of the sound cone.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

The values returned are not necessarily the same as those set by using the SetConeOrientation method. DirectSound normalizes orientation vectors so that all axes have a magnitude of less than or equal to 1.0.

+
+ + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.getconeorientation + HRESULT IDirectSound3DBuffer::GetConeOrientation([Out] D3DVECTOR* pvOrientation) + IDirectSound3DBuffer::GetConeOrientation +
+ + + The GetConeOutsideVolume method retrieves the volume of the sound outside the outside angle of the sound projection cone. + +
Address of a variable that receives the cone outside volume for this buffer.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

Volume levels are expressed as attenuation, in hundredths of a decibel. Allowable values are between (no attenuation) and (silence). The default value is DS3D_DEFAULTCONEOUTSIDEVOLUME (no attenuation). These values are defined in Dsound.h. DirectSound does not support amplification.

+
+ + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.getconeoutsidevolume + HRESULT IDirectSound3DBuffer::GetConeOutsideVolume([Out] int* plConeOutsideVolume) + IDirectSound3DBuffer::GetConeOutsideVolume +
+ + + The GetMaxDistance method retrieves the maximum distance, which is the distance from the listener beyond which sounds in this buffer are no longer attenuated. + +
Address of a variable that receives the maximum distance, in meters by default. D3DVALUE is defined as float.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

The default maximum distance, defined as DS3D_DEFAULTMAXDISTANCE, is effectively infinite.

+
+ + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.getmaxdistance + HRESULT IDirectSound3DBuffer::GetMaxDistance([Out] float* pflMaxDistance) + IDirectSound3DBuffer::GetMaxDistance +
+ + + The GetMinDistance method retrieves the minimum distance, which is the distance from the listener at which sounds in this buffer begin to be attenuated. + +
Address of a variable that receives the minimum distance, in meters by default. D3DVALUE is defined as float.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

By default, the minimum distance value is DS3D_DEFAULTMINDISTANCE, defined as 1.0 (corresponding to 1.0 meter at the default distance factor of 1.0 meters per unit).

+
+ + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.getmindistance + HRESULT IDirectSound3DBuffer::GetMinDistance([Out] float* pflMinDistance) + IDirectSound3DBuffer::GetMinDistance +
+ + + The GetMode method retrieves the operation mode for 3D sound processing. + +
Address of a variable that receives the mode setting. This value will be one of those in the following table.
ValueDescription
Processing of 3D sound is disabled. The sound seems to originate from the center of the listener's head.
Sound parameters (position, velocity, and orientation) are relative to the listener's parameters. In this mode, the absolute parameters of the sound are updated automatically as the listener's parameters change, so that the relative parameters remain constant.
Normal processing. This is the default mode.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.getmode + HRESULT IDirectSound3DBuffer::GetMode([Out] unsigned int* pdwMode) + IDirectSound3DBuffer::GetMode +
+ + + The GetPosition method retrieves the position of the sound source. + +
Address of a structure that receives the position of the sound buffer.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

By default, distance units are meters, but the units can be changed by using the SetDistanceFactor method.

+
+ + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.getposition + HRESULT IDirectSound3DBuffer::GetPosition([Out] D3DVECTOR* pvPosition) + IDirectSound3DBuffer::GetPosition +
+ + + The GetVelocity method retrieves the velocity of the sound source. + +
Address of a structure that receives the sound buffer's velocity, in meters per second by default.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

Velocity is used for Doppler effects only. It does not actually move the buffer. For more information, see Doppler Effect.

The default unit of measurement is meters per second, but this can be changed by using the SetDistanceFactor method.

+
+ + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.getvelocity + HRESULT IDirectSound3DBuffer::GetVelocity([Out] D3DVECTOR* pvVelocity) + IDirectSound3DBuffer::GetVelocity +
+ + + The SetAllParameters method sets all 3D sound buffer properties. + +
Address of a structure that describes the 3D characteristics of the sound buffer.
+
Value that specifies when the setting should be applied. This value must be one of the following:
ValueDescription
DS3D_DEFERREDSettings are not applied until the application calls the CommitDeferredSettings method. This allows the application to change several settings and generate a single recalculation.
DS3D_IMMEDIATESettings are applied immediately, causing the system to recalculate the 3D coordinates for all 3D sound buffers.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.setallparameters + HRESULT IDirectSound3DBuffer::SetAllParameters([In] const DS3DBUFFER* pcDs3dBuffer,[In] unsigned int dwApply) + IDirectSound3DBuffer::SetAllParameters +
+ + + The SetConeAngles method sets the inside and outside angles of the sound projection cone. + +
Inside cone angle, in degrees. This is the angle within which the sound is at its normal volume.
+
Outside cone angle, in degrees. This is the angle outside of which the sound is at its outside volume.
+
Value that indicates when the setting should be applied. Must be one of the following:
ValueDescription
DS3D_DEFERREDSettings are not applied until the application calls the CommitDeferredSettings method. This allows the application to change several settings and generate a single recalculation.
DS3D_IMMEDIATESettings are applied immediately, causing the system to recalculate the 3D coordinates for all 3D sound buffers.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

The minimum, maximum, and default cone angles are defined in Dsound.h as DS3D_MINCONEANGLE, DS3D_MAXCONEANGLE, and DS3D_DEFAULTCONEANGLE. Each angle must be in the range of 0 degrees (no cone) to 360 degrees (the full sphere). The default value is 360.

+
+ + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.setconeangles + HRESULT IDirectSound3DBuffer::SetConeAngles([In] unsigned int dwInsideConeAngle,[In] unsigned int dwOutsideConeAngle,[In] unsigned int dwApply) + IDirectSound3DBuffer::SetConeAngles +
+ + + The SetConeOrientation method sets the orientation of the sound projection cone. + +
Value that specifies the x coordinate of the sound cone orientation vector. D3DVALUE is defined as float.
+
Value that specifies the y coordinate of the sound cone orientation vector. D3DVALUE is defined as float.
+
Value that specifies the z coordinate of the sound cone orientation vector. D3DVALUE is defined as float.
+
Value that specifies when the setting should be applied. This value must be one of the following:
ValueDescription
DS3D_DEFERREDSettings are not applied until the application calls the CommitDeferredSettings method. This allows the application to change several settings and generate a single recalculation.
DS3D_IMMEDIATESettings are applied immediately, causing the system to recalculate the 3D coordinates for all 3D sound buffers.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

This method has no effect unless the cone angle and cone outside volume have also been set to values other than the default.

+
+ + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.setconeorientation + HRESULT IDirectSound3DBuffer::SetConeOrientation([In] float x,[In] float y,[In] float z,[In] unsigned int dwApply) + IDirectSound3DBuffer::SetConeOrientation +
+ + + The SetConeOutsideVolume method sets the volume of the sound outside the outside angle of the sound projection cone. + +
Cone outside volume, in hundredths of a decibel.
+
Value that specifies when the setting should be applied. This value must be one of the those shown in the following table.
ValueDescription
DS3D_DEFERREDSettings are not applied until the application calls the CommitDeferredSettings method. This allows the application to change several settings and generate a single recalculation.
DS3D_IMMEDIATESettings are applied immediately, causing the system to recalculate the 3D coordinates for all 3D sound buffers.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

Volume levels are represented by attenuation. Allowable values are between (no attenuation) and (silence). The default value is DS3D_DEFAULTCONEOUTSIDEVOLUME (no attenuation). These values are defined in Dsound.h. DirectSound does not support amplification.

+
+ + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.setconeoutsidevolume + HRESULT IDirectSound3DBuffer::SetConeOutsideVolume([In] int lConeOutsideVolume,[In] unsigned int dwApply) + IDirectSound3DBuffer::SetConeOutsideVolume +
+ + + The SetMaxDistance method sets the maximum distance, which is the distance from the listener beyond which sounds in this buffer are no longer attenuated. + +
Maximum distance, in meters by default. D3DVALUE is defined as float.
+
Value that specifies when the setting should be applied. This value must be one of the following:
ValueDescription
DS3D_DEFERREDSettings are not applied until the application calls the CommitDeferredSettings method. This allows the application to change several settings and generate a single recalculation.
DS3D_IMMEDIATESettings are applied immediately, causing the system to recalculate the 3D coordinates for all 3D sound buffers.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

The default maximum distance, defined as DS3D_DEFAULTMAXDISTANCE, is effectively infinite.

The default unit of measurement is meters, but this can be changed by using the SetDistanceFactor method.

+
+ + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.setmaxdistance + HRESULT IDirectSound3DBuffer::SetMaxDistance([In] float flMaxDistance,[In] unsigned int dwApply) + IDirectSound3DBuffer::SetMaxDistance +
+ + + The SetMinDistance method sets the minimum distance, which is the distance from the listener at which sounds in this buffer begin to be attenuated. + +
Minimum distance, in meters by default. D3DVALUE is defined as float.
+
Value that specifies when the setting should be applied. This value must be one of the following:
ValueDescription
DS3D_DEFERREDSettings are not applied until the application calls the CommitDeferredSettings method. This allows the application to change several settings and generate a single recalculation.
DS3D_IMMEDIATESettings are applied immediately, causing the system to recalculate the 3D coordinates for all 3D sound buffers.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

By default, the minimum distance value is DS3D_DEFAULTMINDISTANCE, defined as 1.0 (corresponding to 1.0 meter at the default distance factor of 1.0 meters per unit).

The default unit of measurement is meters, but this can be changed by using the SetDistanceFactor method.

+
+ + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.setmindistance + HRESULT IDirectSound3DBuffer::SetMinDistance([In] float flMinDistance,[In] unsigned int dwApply) + IDirectSound3DBuffer::SetMinDistance +
+ + + The SetMode method sets the operation mode for 3D sound processing. + +
Flag specifying the 3D sound processing mode to be set. The flags in the following table are defined.
ValueDescription
Processing of 3D sound is disabled. The sound seems to originate from the center of the listener's head.
Sound parameters (position, velocity, and orientation) are relative to the listener's parameters. In this mode, the absolute parameters of the sound are updated automatically as the listener's parameters change, so that the relative parameters remain constant.
Normal processing. This is the default mode.
+
Value that specifies when the setting should be applied. This value must be one of those in the following table.
ValueDescription
DS3D_DEFERREDSettings are not applied until the application calls the CommitDeferredSettings method. This allows the application to change several settings and generate a single recalculation.
DS3D_IMMEDIATESettings are applied immediately, causing the system to recalculate the 3D coordinates for all 3D sound buffers.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.setmode + HRESULT IDirectSound3DBuffer::SetMode([In] unsigned int dwMode,[In] unsigned int dwApply) + IDirectSound3DBuffer::SetMode +
+ + + The SetPosition method sets the position of the sound source. + +
Value that specifies the x coordinate of the position vector. DirectSound may adjust these values to prevent floating-point overflow. D3DVALUE is defined as float.
+
Value that specifies the y coordinate of the position vector. DirectSound may adjust these values to prevent floating-point overflow. D3DVALUE is defined as float.
+
Value that specifies the z coordinate of the position vector. DirectSound may adjust these values to prevent floating-point overflow. D3DVALUE is defined as float.
+
Value that specifies when the setting should be applied. This value must be one of the following:
ValueDescription
DS3D_DEFERREDSettings are not applied until the application calls the CommitDeferredSettings method. This allows the application to change several settings and generate a single recalculation.
DS3D_IMMEDIATESettings are applied immediately, causing the system to recalculate the 3D coordinates for all 3D sound buffers.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

The default unit of measurement is meters, but this can be changed by using the SetDistanceFactor method.

+
+ + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.setposition + HRESULT IDirectSound3DBuffer::SetPosition([In] float x,[In] float y,[In] float z,[In] unsigned int dwApply) + IDirectSound3DBuffer::SetPosition +
+ + + The SetVelocity method sets the velocity of the sound source. + +
Value that specifies the x coordinate of the velocity vector, in meters per second by default. DirectSound may adjust these values to prevent floating-point overflow. D3DVALUE is defined as float.
+
Value that specifies the y coordinate of the velocity vector, in meters per second by default. DirectSound may adjust these values to prevent floating-point overflow. D3DVALUE is defined as float.
+
Value that specifies the z coordinate of the velocity vector, in meters per second by default. DirectSound may adjust these values to prevent floating-point overflow. D3DVALUE is defined as float.
+
Value that specifies when the setting should be applied. This value must be one of the following:
ValueDescription
DS3D_DEFERREDSettings are not applied until the application calls the CommitDeferredSettings method. This allows the application to change several settings and generate a single recalculation.
DS3D_IMMEDIATESettings are applied immediately, causing the system to recalculate the 3D coordinates for all 3D sound buffers.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

Velocity is used only for calculating Doppler effect. It does not change the position of the buffer. For more information, see Doppler Effect.

The default unit of measurement is meters per second, but this can be changed by using the SetDistanceFactor method.

+
+ + microsoft.directx_sdk.idirectsound3dbuffer8.idirectsound3dbuffer8.setvelocity + HRESULT IDirectSound3DBuffer::SetVelocity([In] float x,[In] float y,[In] float z,[In] unsigned int dwApply) + IDirectSound3DBuffer::SetVelocity +
+ + + Default cone angle, in degrees. + + + + + Default outside cone volume. Volume levels are expressed as attenuation, in hundredths of a decibel. + + + + + Default maximum distance, in meters. + + + + + Default minimum distance, in meters. + + + + + Maximum cone angle, in degrees. + + + + + Minimum cone angle, in degrees. + + + + + Initializes a new instance of the class. + + + + + + + Gets or sets all the parameters of a buffer + + + + + The orientation of the sound projection cone. + + + + + The volume of the sound outside the outside angle of the sound projection cone. + + + + + Settings are not applied until the application calls the SoundListener3D.CommitDeferredSettings() if true. + + + + + The inside angle of the sound projection cone. + + + + + The maximum distance, which is the distance from the listener beyond which sounds in this buffer are no longer attenuated. + + + + + The minimum distance, which is the distance from the listener at which sounds in this buffer begin to be attenuated. + + + + + The operation mode for 3-D sound processing. + + + + + The outside angle of the sound projection cone. + + + + + The position of the sound source. + + + + + The velocity of the sound source. + + + + +

The IDirectSoundNotify8 interface sets up notification events for a playback or capture buffer.

IDirectSoundNotify8 is a define for . The two interface names are interchangeable.

The interface is obtained by calling the QueryInterface method of an existing interface on a DirectSound buffer object. Secondary buffers support notifications only if they are created with the flag.

In addition to the methods inherited from , the IDirectSoundNotify8 interface exposes the following method.

IDirectSoundNotify8 Member
Method + Description +
IDirectSoundNotify8::SetNotificationPositions The SetNotificationPositions method sets the notification positions. During capture or playback, whenever the read or play cursor reaches one of the specified offsets, the associated event is signaled. +

The LPDIRECTSOUNDNOTIFY type is defined as a reference to the interface:

 typedef struct   *LPDIRECTSOUNDNOTIFY;	
+            
+
+ + ee418244 + IDirectSoundNotify + IDirectSoundNotify +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The SetNotificationPositions method sets the notification positions. During capture or playback, whenever the read or play cursor reaches one of the specified offsets, the associated event is signaled. + +
Number of structures.
+
Pointer to an array of structures (the maximum array size is DSBNOTIFICATIONS_MAX).
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values:

Return code
DSERR_INVALIDPARAM
DSERR_OUTOFMEMORY
+ +

The value DSBPN_OFFSETSTOP can be specified in the dwOffset member to tell DirectSound to signal the associated event when the Stop or Stop method is called or when the end of the buffer has been reached and the playback is not looping. If it is used, this should be the last item in the position-notify array.

If a position-notify array has already been set, the method replaces the previous array.

The buffer must be stopped when this method is called.

+
+ + microsoft.directx_sdk.idirectsoundnotify8.idirectsoundnotify8.setnotificationpositions + HRESULT IDirectSoundNotify::SetNotificationPositions([In] unsigned int dwPositionNotifies,[In, Buffer] const DSBPOSITIONNOTIFY* pcPositionNotifies) + IDirectSoundNotify::SetNotificationPositions +
+ + +

The IDirectSound3DListener8 interface is used to retrieve and set parameters that describe a listener's position, orientation, and listening environment in 3D space.

The interface can be obtained by calling the IDirectSoundBuffer8::QueryInterface method on a primary buffer created with the flag.

In addition to the methods inherited from , the IDirectSound3DListener8 interface exposes the following methods, arranged by category.

Batch Parameters
Method + Description +
IDirectSound3DListener8::CommitDeferredSettings The CommitDeferredSettings method commits any deferred settings made since the last call to this method. +
IDirectSound3DListener8::GetAllParameters The GetAllParameters method retrieves all 3D parameters of the sound environment and the listener. +
IDirectSound3DListener8::SetAllParameters The SetAllParameters method sets all 3D parameters of the sound environment and the listener. +
Global Sound Properties
Method + Description +
IDirectSound3DListener8::GetDistanceFactor The GetDistanceFactor method retrieves the distance factor, which is the number of meters in a vector unit. +
IDirectSound3DListener8::GetDopplerFactor The GetDopplerFactor method retrieves the multiplier for the Doppler effect. +
IDirectSound3DListener8::GetRolloffFactor The GetRolloffFactor method retrieves the rolloff factor, which determines the rate of attenuation over distance. +
IDirectSound3DListener8::SetDistanceFactor The SetDistanceFactor method sets the distance factor, which is the number of meters in a vector unit. +
IDirectSound3DListener8::SetDopplerFactor The SetDopplerFactor method sets the multiplier for the Doppler effect. +
IDirectSound3DListener8::SetRolloffFactor The SetRolloffFactor method sets the rolloff factor, which determines the rate of attenuation over distance. +
Listener Properties
Method + Description +
IDirectSound3DListener8::GetOrientation The GetOrientation method retrieves the orientation of the listener's head. +
IDirectSound3DListener8::GetPosition The GetPosition method retrieves the listener's position. +
IDirectSound3DListener8::GetVelocity The GetVelocity method retrieves the listener's velocity. +
IDirectSound3DListener8::SetOrientation The SetOrientation method sets the orientation of the listener's head. +
IDirectSound3DListener8::SetPosition The SetPosition method sets the listener's position. +
IDirectSound3DListener8::SetVelocity The SetVelocity method sets the listener's velocity. +

The LPDIRECTSOUND3DLISTENER type is defined as a reference to the interface:

 typedef struct   *LPDIRECTSOUND3DLISTENER;	
+            
+
+ + ee418003 + IDirectSound3DListener + IDirectSound3DListener +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The GetAllParameters method retrieves all 3D parameters of the sound environment and the listener. + +
Address of a structure that receives the state of the 3D world and listener.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsound3dlistener8.idirectsound3dlistener8.getallparameters + HRESULT IDirectSound3DListener::GetAllParameters([Out] DS3DLISTENER* pListener) + IDirectSound3DListener::GetAllParameters +
+ + + The GetDistanceFactor method retrieves the distance factor, which is the number of meters in a vector unit. + +
Address of a variable that receives the distance factor value. D3DVALUE is defined as float.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsound3dlistener8.idirectsound3dlistener8.getdistancefactor + HRESULT IDirectSound3DListener::GetDistanceFactor([Out] float* pflDistanceFactor) + IDirectSound3DListener::GetDistanceFactor +
+ + + The GetDopplerFactor method retrieves the multiplier for the Doppler effect. + +
Address of a variable that receives the Doppler factor value. D3DVALUE is defined as float.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

The Doppler factor has a range of DS3D_MINDOPPLERFACTOR (no Doppler effects) to DS3D_MAXDOPPLERFACTOR (defined as 10 times the Doppler effects found in the real world). The default value is DS3D_DEFAULTDOPPLERFACTOR (1.0).

+
+ + microsoft.directx_sdk.idirectsound3dlistener8.idirectsound3dlistener8.getdopplerfactor + HRESULT IDirectSound3DListener::GetDopplerFactor([Out] float* pflDopplerFactor) + IDirectSound3DListener::GetDopplerFactor +
+ + + The GetOrientation method retrieves the orientation of the listener's head. + +
Address of a structure that receives the listener's front orientation vector.
+
Address of a structure that receives the listener's top orientation vector.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

The front vector points in the direction of the listener's nose, and the top vector points up from the top of the listener's head. By default, the front vector is (0,0,1.0) and the top vector is (0,1.0,0).

The values returned are not necessarily the same as those set by using SetOrientation. DirectSound normalizes orientation vectors so that they are at right angles and have a magnitude of less than or equal to 1.0.

+
+ + microsoft.directx_sdk.idirectsound3dlistener8.idirectsound3dlistener8.getorientation + HRESULT IDirectSound3DListener::GetOrientation([Out] D3DVECTOR* pvOrientFront,[Out] D3DVECTOR* pvOrientTop) + IDirectSound3DListener::GetOrientation +
+ + + The GetPosition method retrieves the listener's position. + +
Address of a structure that receives the listener's position vector.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

By default, measurement units are meters, but this can be changed by calling the SetDistanceFactor method.

+
+ + microsoft.directx_sdk.idirectsound3dlistener8.idirectsound3dlistener8.getposition + HRESULT IDirectSound3DListener::GetPosition([Out] D3DVECTOR* pvPosition) + IDirectSound3DListener::GetPosition +
+ + + The GetRolloffFactor method retrieves the rolloff factor, which determines the rate of attenuation over distance. + +
Address of a variable that receives the rolloff factor. D3DVALUE is defined as float.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

The rolloff factor has a range of DS3D_MINROLLOFFFACTOR (no rolloff) to DS3D_MAXROLLOFFFACTOR (defined as 10 times the rolloff found in the real world). The default value is DS3D_DEFAULTROLLOFFFACTOR (1.0). For more information, see Rolloff Factor.

+
+ + microsoft.directx_sdk.idirectsound3dlistener8.idirectsound3dlistener8.getrollofffactor + HRESULT IDirectSound3DListener::GetRolloffFactor([Out] float* pflRolloffFactor) + IDirectSound3DListener::GetRolloffFactor +
+ + + The GetVelocity method retrieves the listener's velocity. + +
Address of a structure that receives the listener's velocity.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

Velocity is used only for calculating Doppler effect. It does not change the listener's position. To move the listener, use the SetPosition method.

The default velocity is (0,0,0).

By default, measurement units are meters per second, but this can be changed by calling the SetDistanceFactor method.

+
+ + microsoft.directx_sdk.idirectsound3dlistener8.idirectsound3dlistener8.getvelocity + HRESULT IDirectSound3DListener::GetVelocity([Out] D3DVECTOR* pvVelocity) + IDirectSound3DListener::GetVelocity +
+ + + The SetAllParameters method sets all 3D parameters of the sound environment and the listener. + +
Address of a structure that contains information describing all 3D listener parameters.
+
Value that specifies when the setting should be applied. This value must be one of the following:
ValueDescription
DS3D_DEFERREDSettings are not applied until the application calls the CommitDeferredSettings method. This allows the application to change several settings and generate a single recalculation.
DS3D_IMMEDIATESettings are applied immediately, causing the system to recalculate the 3D coordinates for all 3D sound buffers.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsound3dlistener8.idirectsound3dlistener8.setallparameters + HRESULT IDirectSound3DListener::SetAllParameters([In] const DS3DLISTENER* pcListener,[In] unsigned int dwApply) + IDirectSound3DListener::SetAllParameters +
+ + + The SetDistanceFactor method sets the distance factor, which is the number of meters in a vector unit. + +
Distance factor. D3DVALUE is defined as float.
+
Value that specifies when the setting should be applied. This value must be one of the following:
ValueDescription
DS3D_DEFERREDSettings are not applied until the application calls the CommitDeferredSettings method. This allows the application to change several settings and generate a single recalculation.
DS3D_IMMEDIATESettings are applied immediately, causing the system to recalculate the 3D coordinates for all 3D sound buffers.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

The distance factor has a range of DS3D_MINDISTANCEFACTOR to DS3D_MAXDISTANCEFACTOR, defined in Dsound.h as FLT_MIN and FLT_MAX respectively. The default value is DS3D_DEFAULTDISTANCEFACTOR, or 1.0.

+
+ + microsoft.directx_sdk.idirectsound3dlistener8.idirectsound3dlistener8.setdistancefactor + HRESULT IDirectSound3DListener::SetDistanceFactor([In] float flDistanceFactor,[In] unsigned int dwApply) + IDirectSound3DListener::SetDistanceFactor +
+ + + The SetDopplerFactor method sets the multiplier for the Doppler effect. + +
Doppler factor. D3DVALUE is defined as float.
+
Value that specifies when the setting should be applied. This value must be one of the following:
ValueDescription
DS3D_DEFERREDSettings are not applied until the application calls the CommitDeferredSettings method. This allows the application to change several settings and generate a single recalculation.
DS3D_IMMEDIATESettings are applied immediately, causing the system to recalculate the 3D coordinates for all 3D sound buffers.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

The Doppler factor has a range of DS3D_MINDOPPLERFACTOR (no Doppler effects) to DS3D_MAXDOPPLERFACTOR (defined as 10 times the Doppler effects found in the real world). The default value is DS3D_DEFAULTDOPPLERFACTOR (1.0).

+
+ + microsoft.directx_sdk.idirectsound3dlistener8.idirectsound3dlistener8.setdopplerfactor + HRESULT IDirectSound3DListener::SetDopplerFactor([In] float flDopplerFactor,[In] unsigned int dwApply) + IDirectSound3DListener::SetDopplerFactor +
+ + + The SetOrientation method sets the orientation of the listener's head. + +
Value that specifies the x coordinate of the front orientation vector. D3DVALUE is defined as float.
+
Value that specifies the y coordinate of the front orientation vector. D3DVALUE is defined as float.
+
Value that specifies the z coordinate of the front orientation vector. D3DVALUE is defined as float.
+
Value that specifies the x coordinates of the top orientation vector.
+
Value that specifies the y coordinates of the top orientation vector.
+
Value that specifies the z coordinates of the top orientation vector.
+
Value that specifies when the setting should be applied. This value must be one of the following:
ValueDescription
DS3D_DEFERREDSettings are not applied until the application calls the CommitDeferredSettings method. This allows the application to change several settings and generate a single recalculation.
DS3D_IMMEDIATESettings are applied immediately, causing the system to recalculate the 3D coordinates for all 3D sound buffers.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

The front vector points in the direction of the listener's nose, and the top vector points up from the top of the listener's head. By default, the front vector is (0,0,1.0) and the top vector is (0,1.0,0).

The top vector must be at right angles to the front vector. If necessary, DirectSound adjusts the top vector after setting the front vector.

+
+ + microsoft.directx_sdk.idirectsound3dlistener8.idirectsound3dlistener8.setorientation + HRESULT IDirectSound3DListener::SetOrientation([In] float xFront,[In] float yFront,[In] float zFront,[In] float xTop,[In] float yTop,[In] float zTop,[In] unsigned int dwApply) + IDirectSound3DListener::SetOrientation +
+ + + The SetPosition method sets the listener's position. + +
Value that specifies the x coordinate of the listener's position vector. Note that DirectSound may adjust this value to prevent floating-point overflow. D3DVALUE is defined as float.
+
Value that specifies the y coordinate of the listener's position vector. Note that DirectSound may adjust this value to prevent floating-point overflow. D3DVALUE is defined as float.
+
Value that specifies the z coordinate of the listener's position vector. Note that DirectSound may adjust this value to prevent floating-point overflow. D3DVALUE is defined as float.
+
Value that specifies when the setting should be applied. This value must be one of the following:
ValueDescription
DS3D_DEFERREDSettings are not applied until the application calls the CommitDeferredSettings method. This allows the application to change several settings and generate a single recalculation.
DS3D_IMMEDIATESettings are applied immediately, causing the system to recalculate the 3D coordinates for all 3D sound buffers.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

By default, measurement units are meters, but this can be changed by calling the SetDistanceFactor method.

+
+ + microsoft.directx_sdk.idirectsound3dlistener8.idirectsound3dlistener8.setposition + HRESULT IDirectSound3DListener::SetPosition([In] float x,[In] float y,[In] float z,[In] unsigned int dwApply) + IDirectSound3DListener::SetPosition +
+ + + The SetRolloffFactor method sets the rolloff factor, which determines the rate of attenuation over distance. + +
Rolloff factor. D3DVALUE is defined as float.
+
Value that specifies when the setting should be applied. This value must be one of the following:
ValueDescription
DS3D_DEFERREDSettings are not applied until the application calls the CommitDeferredSettings method. This allows the application to change several settings and generate a single recalculation.
DS3D_IMMEDIATESettings are applied immediately, causing the system to recalculate the 3D coordinates for all 3D sound buffers.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

The rolloff factor has a range of DS3D_MINROLLOFFFACTOR (no rolloff) to DS3D_MAXROLLOFFFACTOR (defined as 10 times the rolloff found in the real world). The default value is DS3D_DEFAULTROLLOFFFACTOR (1.0). For more information, see Rolloff Factor.

+
+ + microsoft.directx_sdk.idirectsound3dlistener8.idirectsound3dlistener8.setrollofffactor + HRESULT IDirectSound3DListener::SetRolloffFactor([In] float flRolloffFactor,[In] unsigned int dwApply) + IDirectSound3DListener::SetRolloffFactor +
+ + + The SetVelocity method sets the listener's velocity. + +
Value that specifies the x coordinate of the listener's velocity vector. DirectSound may adjust this value to prevent floating-point overflow. D3DVALUE is defined as float.
+
Value that specifies the y coordinate of the listener's velocity vector. DirectSound may adjust this value to prevent floating-point overflow. D3DVALUE is defined as float.
+
Value that specifies the z coordinate of the listener's velocity vector. DirectSound may adjust this value to prevent floating-point overflow. D3DVALUE is defined as float.
+
Value that specifies when the setting should be applied. This value must be one of the following:
ValueDescription
DS3D_DEFERREDSettings are not applied until the application calls the CommitDeferredSettings method. This allows the application to change several settings and generate a single recalculation.
DS3D_IMMEDIATESettings are applied immediately, causing the system to recalculate the 3D coordinates for all 3D sound buffers.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ +

Velocity is used only for Doppler effects. It does not actually move the listener. To change the listener's position, use the SetPosition method. The default velocity is (0,0,0).

By default, measurement units are meters per second, but this can be changed by calling the SetDistanceFactor method.

+
+ + microsoft.directx_sdk.idirectsound3dlistener8.idirectsound3dlistener8.setvelocity + HRESULT IDirectSound3DListener::SetVelocity([In] float x,[In] float y,[In] float z,[In] unsigned int dwApply) + IDirectSound3DListener::SetVelocity +
+ + + The CommitDeferredSettings method commits any deferred settings made since the last call to this method. + +

If the method succeeds, the return value is DS_OK.

+ + microsoft.directx_sdk.idirectsound3dlistener8.idirectsound3dlistener8.commitdeferredsettings + HRESULT IDirectSound3DListener::CommitDeferredSettings() + IDirectSound3DListener::CommitDeferredSettings +
+ + + Default distance factor. The default value is (1.0). + + + + + Default Doppler factor. The default value is (1.0). + + + + + Default rolloff factor. The default value is (1.0). + + + + + Maximum distance factor. The default value is (1.0). + + + + + Maximum Doppler factor. The default value is (1.0). + + + + + Maximum rolloff factor. The default value is (1.0). + + + + + Minimum distance factor. The default value is (1.0). + + + + + Minimum Doppler factor. The default value is (1.0). + + + + + Minimum rolloff factor. The default value is (1.0). + + + + + Initializes a new instance of the class + with a previously created sound buffer. + + The SlimDX::DirectSound::SoundBuffer object. + + + + Determines if settings are set immediately or deferred. + + + + + Gets or sets the distance factor, which is the number of meters in a vector unit. + + + + + Gets or sets the multiplier for the Doppler effect. + + + + + Describes the listener's front orientation. + + + + + Gets or sets the listener's position. + + + + + Gets or sets the rolloff factor, which determines the rate of attenuation over distance. + + + + + Describes the listener's top orientation. + + + + + Gets or sets the listener's velocity. + + + + +

The IDirectSoundFXWavesReverb8 interface is used to set and retrieve effect parameters on a buffer that supports Waves reverberation.

This interface is obtained by calling GetObjectInPath on the buffer that supports the effect.

In addition to the methods inherited from , the IDirectSoundFXWavesReverb8 interface exposes the following methods.

IDirectSoundFXWavesReverb8 Members
Method + Description +
IDirectSoundFXWavesReverb8::GetAllParameters The GetAllParameters method retrieves the music reverberation parameters of a buffer. +
IDirectSoundFXWavesReverb8::SetAllParameters The SetAllParameters method sets the music reverberation parameters of a buffer. +

The Waves reverberation DMO is based on the Waves MaxxVerb technology, which is licenced to Microsoft.

+
+ + ee418241 + IDirectSoundFXWavesReverb + IDirectSoundFXWavesReverb +
+ + + Initializes a new instance of the class. + + The native pointer. + + + + Performs an explicit conversion from to . (This method is a shortcut to ) + + The native pointer. + + The result of the conversion. + + + + + The GetAllParameters method retrieves the music reverberation parameters of a buffer. + + + microsoft.directx_sdk.idirectsoundfxwavesreverb8.idirectsoundfxwavesreverb8.getallparameters + GetAllParameters / SetAllParameters + GetAllParameters + HRESULT IDirectSoundFXWavesReverb::GetAllParameters([Out] DSFXWavesReverb* pDsFxWavesReverb) + + + + The SetAllParameters method sets the music reverberation parameters of a buffer. + +
Address of a structure that specifies the effect parameters.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsoundfxwavesreverb8.idirectsoundfxwavesreverb8.setallparameters + HRESULT IDirectSoundFXWavesReverb::SetAllParameters([In] const DSFXWavesReverb* pcDsFxWavesReverb) + IDirectSoundFXWavesReverb::SetAllParameters +
+ + + The GetAllParameters method retrieves the music reverberation parameters of a buffer. + +
Address of a structure that receives the effect parameters.
+

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.

+ + microsoft.directx_sdk.idirectsoundfxwavesreverb8.idirectsoundfxwavesreverb8.getallparameters + HRESULT IDirectSoundFXWavesReverb::GetAllParameters([Out] DSFXWavesReverb* pDsFxWavesReverb) + IDirectSoundFXWavesReverb::GetAllParameters +
+ + + Default high-frequency reverb time ratio. + + + + + Maximum high-frequency reverb time ratio. + + + + + Minimum high-frequency reverb time ratio. + + + + + Default input gain of signal, in decibels (dB). + + + + + Maximum input gain of signal, in decibels (dB). + + + + + Minimum input gain of signal, in decibels (dB). + + + + + Default reverb mix, in dB. + + + + + Maximum reverb mix, in dB. + + + + + Minimum reverb mix, in dB. + + + + + Default reverb time, in milliseconds. + + + + + Maximum reverb time, in milliseconds. + + + + + Minimum reverb time, in milliseconds. + + + + + The structure contains parameters for acoustic echo cancellation in a capture buffer. + + +

The dwMode member is ignored when this structure is passed to IDirectSoundCaptureFXAec8::SetAllParameters.

Windows

Important Note for Windows Vista

Existing applications that access Windows XP Acoustic Echo Cancellation (AEC) features via the DirectSound API will no longer obtain AEC when running on Windows Vista. These applications will still run, but their calls to AEC-specific DirectSound API calls will have no effect on the captured audio.

To learn how to obtain AEC in Windows Vista, See the Windows Vista AEC topics in the Windows SDK.

+
+ + microsoft.directx_sdk.reference.dscfxaec + DSCFXAec + DSCFXAec +
+ + +
Boolean value that specifies whether the effect is enabled.
+
+ + microsoft.directx_sdk.reference.dscfxaec + BOOL fEnable + BOOL fEnable +
+ + +
Boolean value that specifies whether to enable background comfort noise, which makes the capture signal sound more natural by preventing periods of dead silence. By default, background comfort noise is not enabled.
+
+ + microsoft.directx_sdk.reference.dscfxaec + BOOL fNoiseFill + BOOL fNoiseFill +
+ + +
Operation mode. This member contains one of the following values.
Value + Description +
+ The effect is passing capture and render data through without modifying it. +
+ The effect is running in half duplex mode. Not presently supported. +
+ The effect is running in full duplex mode. +
+
+ + microsoft.directx_sdk.reference.dscfxaec + DSCFX_AEC_MODE dwMode + DSCFX_AEC_MODE dwMode +
+ + + No documentation. + + + DSBCAPS + DSBCAPS + + + + No documentation. + + + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + DSBCAPS_FLAGS dwFlags + DSBCAPS_FLAGS dwFlags + + + + No documentation. + + + unsigned int dwBufferBytes + unsigned int dwBufferBytes + + + + No documentation. + + + unsigned int dwUnlockTransferRate + unsigned int dwUnlockTransferRate + + + + No documentation. + + + unsigned int dwPlayCpuOverhead + unsigned int dwPlayCpuOverhead + + + + Initializes a new instance of the class. + + + + + The structure contains parameters for a chorus effect. + + + microsoft.directx_sdk.reference.dsfxchorus + DSFXChorus + DSFXChorus + + + +
Ratio of wet (processed) signal to dry (unprocessed) signal. Must be in the range from DSFXCHORUS_WETDRYMIX_MIN through DSFXCHORUS_WETDRYMIX_MAX (all wet). The default value is 50.
+
+ + microsoft.directx_sdk.reference.dsfxchorus + float fWetDryMix + float fWetDryMix +
+ + +
Percentage by which the delay time is modulated by the low-frequency oscillator, in hundredths of a percentage point. Must be in the range from DSFXCHORUS_DEPTH_MIN through DSFXCHORUS_DEPTH_MAX. The default value is 10.
+
+ + microsoft.directx_sdk.reference.dsfxchorus + float fDepth + float fDepth +
+ + +
Percentage of output signal to feed back into the effect's input, in the range from DSFXCHORUS_FEEDBACK_MIN to DSFXCHORUS_FEEDBACK_MAX. The default value is 25.
+
+ + microsoft.directx_sdk.reference.dsfxchorus + float fFeedback + float fFeedback +
+ + +
Frequency of the LFO, in the range from DSFXCHORUS_FREQUENCY_MIN to DSFXCHORUS_FREQUENCY_MAX. The default value is 1.1.
+
+ + microsoft.directx_sdk.reference.dsfxchorus + float fFrequency + float fFrequency +
+ + +
Waveform shape of the LFO. Defined values are DSFXCHORUS_WAVE_TRIANGLE and DSFXCHORUS_WAVE_SIN. By default, the waveform is a sine.
+
+ + microsoft.directx_sdk.reference.dsfxchorus + int lWaveform + int lWaveform +
+ + +
Number of milliseconds the input is delayed before it is played back, in the range from DSFXCHORUS_DELAY_MIN to DSFXCHORUS_DELAY_MAX. The default value is 16 ms.
+
+ + microsoft.directx_sdk.reference.dsfxchorus + float fDelay + float fDelay +
+ + +
Phase differential between left and right LFOs, in the range from DSFXCHORUS_PHASE_MIN through DSFXCHORUS_PHASE_MAX. Possible values are defined as follows. +
Value +
DSFXCHORUS_PHASE_NEG_180 +
DSFXCHORUS_PHASE_NEG_90 +
DSFXCHORUS_PHASE_ZERO +
DSFXCHORUS_PHASE_90 +
DSFXCHORUS_PHASE_180 +

The default value is DSFXCHORUS_PHASE_90.

+
+ + microsoft.directx_sdk.reference.dsfxchorus + int lPhase + int lPhase +
+ + + The structure contains parameters for a compression effect. + + + microsoft.directx_sdk.reference.dsfxcompressor + DSFXCompressor + DSFXCompressor + + + +
Output gain of signal after compression, in the range from DSFXCOMPRESSOR_GAIN_MIN to DSFXCOMPRESSOR_GAIN_MAX. The default value is 0 dB.
+
+ + microsoft.directx_sdk.reference.dsfxcompressor + float fGain + float fGain +
+ + +
Time before compression reaches its full value, in the range from DSFXCOMPRESSOR_ATTACK_MIN to DSFXCOMPRESSOR_ATTACK_MAX. The default value is 10 ms.
+
+ + microsoft.directx_sdk.reference.dsfxcompressor + float fAttack + float fAttack +
+ + +
Speed at which compression is stopped after input drops below fThreshold, in the range from DSFXCOMPRESSOR_RELEASE_MIN to DSFXCOMPRESSOR_RELEASE_MAX. The default value is 200 ms.
+
+ + microsoft.directx_sdk.reference.dsfxcompressor + float fRelease + float fRelease +
+ + +
Point at which compression begins, in decibels, in the range from DSFXCOMPRESSOR_THRESHOLD_MIN to DSFXCOMPRESSOR_THRESHOLD_MAX. The default value is -20 dB.
+
+ + microsoft.directx_sdk.reference.dsfxcompressor + float fThreshold + float fThreshold +
+ + +
Compression ratio, in the range from DSFXCOMPRESSOR_RATIO_MIN to DSFXCOMPRESSOR_RATIO_MAX. The default value is 3, which means 3:1 compression.
+
+ + microsoft.directx_sdk.reference.dsfxcompressor + float fRatio + float fRatio +
+ + +
Time after lThreshold is reached before attack phase is started, in milliseconds, in the range from DSFXCOMPRESSOR_PREDELAY_MIN to DSFXCOMPRESSOR_PREDELAY_MAX. The default value is 4 ms.
+
+ + microsoft.directx_sdk.reference.dsfxcompressor + float fPredelay + float fPredelay +
+ + + The structure contains parameters for a distortion effect. + + +

The values in fPostEQBandwidth, fPostEQCenterFrequency, and fPreLowpassCutoff cannot exceed one-third of the frequency of the buffer. If an attempt is made to set a value greater than this, but within the range of accepted values, the parameter is set to the nearest supported value and S_FALSE is returned by IDirectSoundFXDistortion8::SetAllParameters.

+
+ + microsoft.directx_sdk.reference.dsfxdistortion + DSFXDistortion + DSFXDistortion +
+ + +
Amount of signal change after distortion, in the range from DSFXDISTORTION_GAIN_MIN through DSFXDISTORTION_GAIN_MAX. The default value is -18 dB.
+
+ + microsoft.directx_sdk.reference.dsfxdistortion + float fGain + float fGain +
+ + +
Percentage of distortion intensity, in the range in the range from DSFXDISTORTION_EDGE_MIN through DSFXDISTORTION_EDGE_MAX. The default value is 15 percent.
+
+ + microsoft.directx_sdk.reference.dsfxdistortion + float fEdge + float fEdge +
+ + +
Center frequency of harmonic content addition, in the range from DSFXDISTORTION_POSTEQCENTERFREQUENCY_MIN through DSFXDISTORTION_POSTEQCENTERFREQUENCY_MAX. The default value is 2400 Hz.
+
+ + microsoft.directx_sdk.reference.dsfxdistortion + float fPostEQCenterFrequency + float fPostEQCenterFrequency +
+ + +
Width of frequency band that determines range of harmonic content addition, in the range from DSFXDISTORTION_POSTEQBANDWIDTH_MIN through DSFXDISTORTION_POSTEQBANDWIDTH_MAX. The default value is 2400 Hz.
+
+ + microsoft.directx_sdk.reference.dsfxdistortion + float fPostEQBandwidth + float fPostEQBandwidth +
+ + +
Filter cutoff for high-frequency harmonics attenuation, in the range from DSFXDISTORTION_PRELOWPASSCUTOFF_MIN through DSFXDISTORTION_PRELOWPASSCUTOFF_MAX. The default value is 8000 Hz.
+
+ + microsoft.directx_sdk.reference.dsfxdistortion + float fPreLowpassCutoff + float fPreLowpassCutoff +
+ + + The structure contains parameters for an echo effect. + + + microsoft.directx_sdk.reference.dsfxecho + DSFXEcho + DSFXEcho + + + +
Ratio of wet (processed) signal to dry (unprocessed) signal. Must be in the range from DSFXECHO_WETDRYMIX_MIN through DSFXECHO_WETDRYMIX_MAX (all wet). The default value is 50.
+
+ + microsoft.directx_sdk.reference.dsfxecho + float fWetDryMix + float fWetDryMix +
+ + +
Percentage of output fed back into input, in the range from DSFXECHO_FEEDBACK_MIN through DSFXECHO_FEEDBACK_MAX. The default value is 50.
+
+ + microsoft.directx_sdk.reference.dsfxecho + float fFeedback + float fFeedback +
+ + +
Delay for left channel, in milliseconds, in the range from DSFXECHO_LEFTDELAY_MIN through DSFXECHO_LEFTDELAY_MAX. The default value is 500 ms.
+
+ + microsoft.directx_sdk.reference.dsfxecho + float fLeftDelay + float fLeftDelay +
+ + +
Delay for right channel, in milliseconds, in the range from DSFXECHO_RIGHTDELAY_MIN through DSFXECHO_RIGHTDELAY_MAX. The default value is 500 ms.
+
+ + microsoft.directx_sdk.reference.dsfxecho + float fRightDelay + float fRightDelay +
+ + +
Value that specifies whether to swap left and right delays with each successive echo. The default value is zero, meaning no swap. Possible values are defined as DSFXECHO_PANDELAY_MIN (equivalent to ) and DSFXECHO_PANDELAY_MAX (equivalent to TRUE).
+
+ + microsoft.directx_sdk.reference.dsfxecho + int lPanDelay + int lPanDelay +
+ + + The structure contains parameters for a flange effect. + + + microsoft.directx_sdk.reference.dsfxflanger + DSFXFlanger + DSFXFlanger + + + +
Ratio of wet (processed) signal to dry (unprocessed) signal. Must be in the range from DSFXFLANGER_WETDRYMIX_MIN through DSFXFLANGER_WETDRYMIX_MAX (all wet). The default value is 50.
+
+ + microsoft.directx_sdk.reference.dsfxflanger + float fWetDryMix + float fWetDryMix +
+ + +
Percentage by which the delay time is modulated by the low-frequency oscillator (LFO), in hundredths of a percentage point. Must be in the range from DSFXFLANGER_DEPTH_MIN through DSFXFLANGER_DEPTH_MAX. The default value is 100.
+
+ + microsoft.directx_sdk.reference.dsfxflanger + float fDepth + float fDepth +
+ + +
Percentage of output signal to feed back into the effect's input, in the range from DSFXFLANGER_FEEDBACK_MIN to DSFXFLANGER_FEEDBACK_MAX. The default value is -50.
+
+ + microsoft.directx_sdk.reference.dsfxflanger + float fFeedback + float fFeedback +
+ + +
Frequency of the LFO, in the range from DSFXFLANGER_FREQUENCY_MIN to DSFXFLANGER_FREQUENCY_MAX. The default value is 0.25.
+
+ + microsoft.directx_sdk.reference.dsfxflanger + float fFrequency + float fFrequency +
+ + +
Waveform shape of the LFO. By default, the waveform is a sine. Possible values are defined in the following table. +
Value + Description +
DSFXFLANGER_WAVE_TRIANGLE + Triangle. +
DSFXFLANGER_WAVE_SIN + Sine. +
+
+ + microsoft.directx_sdk.reference.dsfxflanger + int lWaveform + int lWaveform +
+ + +
Number of milliseconds the input is delayed before it is played back, in the range from DSFXFLANGER_DELAY_MIN to DSFXFLANGER_DELAY_MAX. The default value is 2 ms.
+
+ + microsoft.directx_sdk.reference.dsfxflanger + float fDelay + float fDelay +
+ + +
Phase differential between left and right LFOs, in the range from DSFXFLANGER_PHASE_MIN through DSFXFLANGER_PHASE_MAX. Possible values are defined in the following table. +
Value +
DSFXFLANGER_PHASE_NEG_180 +
DSFXFLANGER_PHASE_NEG_90 +
DSFXFLANGER_PHASE_ZERO +
DSFXFLANGER_PHASE_90 +
DSFXFLANGER_PHASE_180 +

The default value is DSFXFLANGER_PHASE_ZERO.

+
+ + microsoft.directx_sdk.reference.dsfxflanger + int lPhase + int lPhase +
+ + + The structure contains parameters for an amplitude modulation effect. + + + microsoft.directx_sdk.reference.dsfxgargle + DSFXGargle + DSFXGargle + + + +
Rate of modulation, in Hertz. Must be in the range from DSFXGARGLE_RATEHZ_MIN through DSFXGARGLE_RATEHZ_MAX. The default value is 20.
+
+ + microsoft.directx_sdk.reference.dsfxgargle + unsigned int dwRateHz + unsigned int dwRateHz +
+ + +
Shape of the modulation waveform. The following values are defined.
Value + Description +
DSFXGARGLE_WAVE_TRIANGLE + Triangular waveform. +
DSFXGARGLE_WAVE_SQUARE + Square waveform. +

The default value is DSFXGARGLE_WAVE_TRIANGLE.

+
+ + microsoft.directx_sdk.reference.dsfxgargle + unsigned int dwWaveShape + unsigned int dwWaveShape +
+ + + The structure contains parameters for an I3DL2 (Interactive 3D Audio Level 2) reverberation effect. + + + microsoft.directx_sdk.reference.dsfxi3dl2reverb + DSFXI3DL2Reverb + DSFXI3DL2Reverb + + + +
Attenuation of the room effect, in millibels (mB), in the range from DSFX_I3DL2REVERB_ROOM_MIN to DSFX_I3DL2REVERB_ROOM_MAX. The default value is DSFX_I3DL2REVERB_ROOM_DEFAULT, or -1000 mB.
+
+ + microsoft.directx_sdk.reference.dsfxi3dl2reverb + int lRoom + int lRoom +
+ + +
Attenuation of the room high-frequency effect, in mB, in the range from DSFX_I3DL2REVERB_ROOMHF_MIN to DSFX_I3DL2REVERB_ROOMHF_MAX. The default value is DSFX_I3DL2REVERB_ROOMHF_DEFAULT, or -100 mB.
+
+ + microsoft.directx_sdk.reference.dsfxi3dl2reverb + int lRoomHF + int lRoomHF +
+ + +
Rolloff factor for the reflected signals, in the range from DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MIN to DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MAX. The default value is DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_DEFAULT, or 0.0. The rolloff factor for the direct path is controlled by the DirectSound listener.
+
+ + microsoft.directx_sdk.reference.dsfxi3dl2reverb + float flRoomRolloffFactor + float flRoomRolloffFactor +
+ + +
Decay time, in seconds, in the range from DSFX_I3DL2REVERB_DECAYTIME_MIN to DSFX_I3DL2REVERB_DECAYTIME_MAX. The default value is DSFX_I3DL2REVERB_DECAYTIME_DEFAULT, or 1.49 second.
+
+ + microsoft.directx_sdk.reference.dsfxi3dl2reverb + float flDecayTime + float flDecayTime +
+ + +
Ratio of the decay time at high frequencies to the decay time at low frequencies, in the range from DSFX_I3DL2REVERB_DECAYHFRATIO_MIN to DSFX_I3DL2REVERB_DECAYHFRATIO_MAX. The default value is DSFX_I3DL2REVERB_DECAYHFRATIO_DEFAULT, or 0.83.
+
+ + microsoft.directx_sdk.reference.dsfxi3dl2reverb + float flDecayHFRatio + float flDecayHFRatio +
+ + +
Attenuation of early reflections relative to lRoom, in mB, in the range from DSFX_I3DL2REVERB_REFLECTIONS_MIN to DSFX_I3DL2REVERB_REFLECTIONS_MAX. The default value is DSFX_I3DL2REVERB_REFLECTIONS_DEFAULT, or -2602 mB.
+
+ + microsoft.directx_sdk.reference.dsfxi3dl2reverb + int lReflections + int lReflections +
+ + +
Delay time of the first reflection relative to the direct path, in seconds, in the range from DSFX_I3DL2REVERB_REFLECTIONSDELAY_MIN to DSFX_I3DL2REVERB_REFLECTIONSDELAY_DEFAULT. The default value is 0.007 seconds.
+
+ + microsoft.directx_sdk.reference.dsfxi3dl2reverb + float flReflectionsDelay + float flReflectionsDelay +
+ + +
Attenuation of late reverberation relative to lRoom, in mB, in the range -from DSFX_I3DL2REVERB_REVERB_MIN to DSFX_I3DL2REVERB_REVERB_MAX. The default value is DSFX_I3DL2REVERB_REVERB_DEFAULT, or 200 mB.
+
+ + microsoft.directx_sdk.reference.dsfxi3dl2reverb + int lReverb + int lReverb +
+ + +
Time limit between the early reflections and the late reverberation relative to the time of the first reflection, in seconds, in the range from DSFX_I3DL2REVERB_REVERBDELAY_MIN to DSFX_I3DL2REVERB_REVERBDELAY_MAX. The default value is DSFX_I3DL2REVERB_REVERBDELAY_DEFAULT, or 0.011 seconds.
+
+ + microsoft.directx_sdk.reference.dsfxi3dl2reverb + float flReverbDelay + float flReverbDelay +
+ + +
Echo density in the late reverberation decay, in percent, in the range from DSFX_I3DL2REVERB_DIFFUSION_MIN to DSFX_I3DL2REVERB_DIFFUSION_MAX. The default value is DSFX_I3DL2REVERB_DIFFUSION_DEFAULT, or 100.0 percent.
+
+ + microsoft.directx_sdk.reference.dsfxi3dl2reverb + float flDiffusion + float flDiffusion +
+ + +
Modal density in the late reverberation decay, in percent, in the range from DSFX_I3DL2REVERB_DENSITY_MIN to DSFX_I3DL2REVERB_DENSITY_MAX. The default value is DSFX_I3DL2REVERB_DENSITY_DEFAULT, or 100.0 percent.
+
+ + microsoft.directx_sdk.reference.dsfxi3dl2reverb + float flDensity + float flDensity +
+ + +
Reference high frequency, in hertz, in the range from DSFX_I3DL2REVERB_HFREFERENCE_MIN to DSFX_I3DL2REVERB_HFREFERENCE_MAX. The default value is DSFX_I3DL2REVERB_HFREFERENCE_DEFAULT, or 5000.0 Hz.
+
+ + microsoft.directx_sdk.reference.dsfxi3dl2reverb + float flHFReference + float flHFReference +
+ + + The structure describes the 3D world parameters and the position of the listener. This structure is used with theIDirectSound3DListener8::GetAllParametersandIDirectSound3DListener8::SetAllParametersmethods. + + + microsoft.directx_sdk.reference.ds3dlistener + DS3DLISTENER + DS3DLISTENER + + + + No documentation. + + + microsoft.directx_sdk.reference.ds3dlistener + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + microsoft.directx_sdk.reference.ds3dlistener + D3DVECTOR vPosition + D3DVECTOR vPosition + + + + No documentation. + + + microsoft.directx_sdk.reference.ds3dlistener + D3DVECTOR vVelocity + D3DVECTOR vVelocity + + + + No documentation. + + + microsoft.directx_sdk.reference.ds3dlistener + D3DVECTOR vOrientFront + D3DVECTOR vOrientFront + + + + No documentation. + + + microsoft.directx_sdk.reference.ds3dlistener + D3DVECTOR vOrientTop + D3DVECTOR vOrientTop + + + + No documentation. + + + microsoft.directx_sdk.reference.ds3dlistener + float flDistanceFactor + float flDistanceFactor + + + + No documentation. + + + microsoft.directx_sdk.reference.ds3dlistener + float flRolloffFactor + float flRolloffFactor + + + + No documentation. + + + microsoft.directx_sdk.reference.ds3dlistener + float flDopplerFactor + float flDopplerFactor + + + + Initializes a new instance of the class. + + + + + The structure contains parameters for noise suppression in a capture buffer. + + +
Windows

Important Note for Windows Vista

Existing applications that access Windows XP Acoustic Echo Cancellation (AEC) features via the DirectSound API will no longer obtain AEC when running on Windows Vista. These applications will still run, but their calls to AEC-specific DirectSound API calls will have no effect on the captured audio.

To learn how to obtain AEC in Windows Vista, See the Windows Vista AEC topics in the Windows SDK.

+
+ + microsoft.directx_sdk.reference.dscfxnoisesuppress + DSCFXNoiseSuppress + DSCFXNoiseSuppress +
+ + +
Boolean value that specifies whether the effect is enabled.
+
+ + microsoft.directx_sdk.reference.dscfxnoisesuppress + BOOL fEnable + BOOL fEnable +
+ + + No documentation. + + + DSBPOSITIONNOTIFY + DSBPOSITIONNOTIFY + + + + No documentation. + + + unsigned int dwOffset + unsigned int dwOffset + + + + No documentation. + + + void* hEventNotify + void hEventNotify + + + + Gets or sets the wait handle. + + The wait handle. + + + + The structure contains parameters for a parametric equalizer effect. + + +

The value in fCenter cannot exceed one-third of the sampling frequency of the buffer. If an attempt is made to set a value greater than this, but within the range of accepted values, the parameter is set to the nearest supported value and S_FALSE is returned by IDirectSoundFXParamEq8::SetAllParameters.

+
+ + microsoft.directx_sdk.reference.dsfxparameq + DSFXParamEq + DSFXParamEq +
+ + +
Center frequency, in hertz, in the range from DSFXPARAMEQ_CENTER_MIN to DSFXPARAMEQ_CENTER_MAX. The default value is 8000.
+
+ + microsoft.directx_sdk.reference.dsfxparameq + float fCenter + float fCenter +
+ + +
Bandwidth, in semitones, in the range from DSFXPARAMEQ_BANDWIDTH_MIN to DSFXPARAMEQ_BANDWIDTH_MAX. The default value is 12.
+
+ + microsoft.directx_sdk.reference.dsfxparameq + float fBandwidth + float fBandwidth +
+ + +
Gain, in the range from DSFXPARAMEQ_GAIN_MIN to DSFXPARAMEQ_GAIN_MAX. The default value is 0.
+
+ + microsoft.directx_sdk.reference.dsfxparameq + float fGain + float fGain +
+ + + The structure describes the characteristics of a new buffer object. It is used by theIDirectSound8::CreateSoundBuffermethod and by theDirectSoundFullDuplexCreate8function.

An earlier version of this structure, DSBUFFERDESC1, is maintained in Dsound.h for compatibility with DirectX 7 and earlier.

+
+ +

When creating a primary buffer, applications must set the dwBufferBytes member to zero. DirectSound will determine the best buffer size for the particular sound device in use. To determine the size of a created primary buffer, call IDirectSoundBuffer8::GetCaps.

The DSBCAPS_CTRLDEFAULT flag is no longer supported. This flag was defined as | | . By specifying only the flags you need, you cut down on unnecessary resource usage.

On VXD drivers, a sound buffer created with is always a software buffer, because the VXD driver model does not support notifications. With WDM drivers, a notification-enabled buffer can be in hardware, if hardware resources are available.

The and flags are optional and mutually exclusive. forces the buffer to reside in hardware, meaning that it will be mixed by the sound card. forces the buffer to reside in software, where it is mixed by the CPU. These flags are also defined for the dwFlags member .

The 3D algorithms represent selection of the software emulation layer only: that is, the software algorithm that is used when no hardware is present for acceleration. In order to maximize hardware utilization, is treated as a special case. If no free 3D hardware voices are available, the buffer is then treated as a 2D buffer, but with 3D control. Specifically, when a sound buffer is created with , or when the buffer is played if the buffer was created with DSBPLAY_LOCDEFER, the following procedure is followed:

  1. If a free hardware 3D voice is available, that 3D hardware voice is used.

  2. If no free hardware 3D voices are available and a 2D hardware voice is available, that 2D hardware voice will be used. This is possible because the algorithm is a simple stereo pan algorithm

  3. If no free 2D or 3D hardware voices are available, the voice will be played in software using the algorithm.

If a speaker configuration other than or is in effect, the processing will be done as if for a two-speaker configuration.

If a buffer is created using one of the HRTF algorithms, and the HRTF algorithm is not available on the system (for example, a non-WDM system), a success code, DS_NO_VIRTUALIZATION, is returned. The sound buffer created will use instead. For this reason, applications should use the SUCCEEDED or FAILED macros rather than checking explicitly for DS_OK when calling CreateSoundBuffer.

+
+ + microsoft.directx_sdk.reference.dsbufferdesc + DSBUFFERDESC + DSBUFFERDESC +
+ + + No documentation. + + + microsoft.directx_sdk.reference.dsbufferdesc + unsigned int dwSize + unsigned int dwSize + + + + No documentation. + + + microsoft.directx_sdk.reference.dsbufferdesc + DSBCAPS_FLAGS dwFlags + DSBCAPS_FLAGS dwFlags + + + + No documentation. + + + microsoft.directx_sdk.reference.dsbufferdesc + unsigned int dwBufferBytes + unsigned int dwBufferBytes + + + + No documentation. + + + microsoft.directx_sdk.reference.dsbufferdesc + unsigned int dwReserved + unsigned int dwReserved + + + + No documentation. + + + microsoft.directx_sdk.reference.dsbufferdesc + WAVEFORMATEX* lpwfxFormat + WAVEFORMATEX lpwfxFormat + + + + No documentation. + + + microsoft.directx_sdk.reference.dsbufferdesc + GUID guid3DAlgorithm + GUID guid3DAlgorithm + + + + Initializes a new instance of the class. + + + + + WaveFormat of this sound buffer description + + + + + The structure describes an effect associated with a buffer. + + +

Custom effects can be implemented as DMOs. Effect DMOs must implement the and interfaces.

If dwFlags is zero, the effect is placed in hardware if possible. If the hardware does not support the effect (always the case since DirectX 9.0), software is used. If the effect is not available at all, the call to SetFX fails.

+
+ + microsoft.directx_sdk.reference.dseffectdesc + DSEFFECTDESC + DSEFFECTDESC +
+ + +
Size of the structure, in bytes.
+
+ + microsoft.directx_sdk.reference.dseffectdesc + unsigned int dwSize + unsigned int dwSize +
+ + +
Flags. Can be zero or one of the following values.
Value + Description +
DSFX_LOCHARDWARE + Effect must be in hardware. If the effect is not available in hardware, raises an error. Since DirectX 9.0, DirectX does not support hardware acceleration of effects, so this flag should not be used. +
DSFX_LOCSOFTWARE + Effect must be in software, even if the hardware supports acceleration of guidDSFXClass. If the effect is not available in software, SetFX raises an error. Since DirectX 9.0, all effects are in software regardless of whether this flag is set. +
+
+ + microsoft.directx_sdk.reference.dseffectdesc + unsigned int dwFlags + unsigned int dwFlags +
+ + +
Class identifier of the effect. The following standard effect classes are defined.
Value + Description +
+ Chorus +
+ Compressor +
+ Distortion +
+ Echo +
+ Flanger +
+ Gargle +
+ Interactive 3D Level 2 reverb +
+ Parametric equalizer +
+ Waves reverb +
+
+ + microsoft.directx_sdk.reference.dseffectdesc + GUID guidDSFXClass + GUID guidDSFXClass +
+ + +
Reserved for future use.
+
+ + microsoft.directx_sdk.reference.dseffectdesc + ULONG_PTR dwReserved1 + ULONG_PTR dwReserved1 +
+ + +
Reserved for future use.
+
+ + microsoft.directx_sdk.reference.dseffectdesc + ULONG_PTR dwReserved2 + ULONG_PTR dwReserved2 +
+ + + Initializes a new instance of the class. + + + + + The structure contains parameters for a Waves reverberation effect. + + + microsoft.directx_sdk.reference.dsfxwavesreverb + DSFXWavesReverb + DSFXWavesReverb + + + +
Input gain of signal, in decibels (dB), in the range from DSFX_WAVESREVERB_INGAIN_MIN through DSFX_WAVESREVERB_INGAIN_MAX. The default value is DSFX_WAVESREVERB_INGAIN_DEFAULT, or 0 dB.
+
+ + microsoft.directx_sdk.reference.dsfxwavesreverb + float fInGain + float fInGain +
+ + +
Reverb mix, in dB, in the range from DSFX_WAVESREVERB_REVERBMIX_MIN through DSFX_WAVESREVERB_REVERBMIX_MAX. The default value is DSFX_WAVESREVERB_REVERBMIX_DEFAULT, or 0 dB.
+
+ + microsoft.directx_sdk.reference.dsfxwavesreverb + float fReverbMix + float fReverbMix +
+ + +
Reverb time, in milliseconds, in the range from DSFX_WAVESREVERB_REVERBTIME_MIN through DSFX_WAVESREVERB_REVERBTIME_MAX. The default value is DSFX_WAVESREVERB_REVERBTIME_DEFAULT, or 1000.
+
+ + microsoft.directx_sdk.reference.dsfxwavesreverb + float fReverbTime + float fReverbTime +
+ + +
High-frequency reverb time ratio, in the range from DSFX_WAVESREVERB_HIGHFREQRTRATIO_MIN through DSFX_WAVESREVERB_HIGHFREQRTRATIO_MAX. The default value is DSFX_WAVESREVERB_HIGHFREQRTRATIO_DEFAULT, or 0.001.
+
+ + microsoft.directx_sdk.reference.dsfxwavesreverb + float fHighFreqRTRatio + float fHighFreqRTRatio +
+ + + The namespace provides a managed DirectSound API. + + ee416960 + DirectSound + DirectSound + + + + A Primary DirectSound Buffer. + + + + + Initializes a new instance of the class. + + The base PTR. + + + + Initializes a new instance of the class. + + an instance of the + The buffer description. + +
+
diff --git a/Test/dll/SharpDX.Mathematics.dll b/Test/dll/SharpDX.Mathematics.dll new file mode 100644 index 00000000..79120421 Binary files /dev/null and b/Test/dll/SharpDX.Mathematics.dll differ diff --git a/Test/dll/SharpDX.Mathematics.xml b/Test/dll/SharpDX.Mathematics.xml new file mode 100644 index 00000000..bf5a42b8 --- /dev/null +++ b/Test/dll/SharpDX.Mathematics.xml @@ -0,0 +1,16449 @@ + + + + SharpDX.Mathematics + + + + + Represents a unit independent angle using a single-precision floating-point + internal representation. + + + + + A value that specifies the size of a single degree. + + + + + A value that specifies the size of a single minute. + + + + + A value that specifies the size of a single second. + + + + + A value that specifies the size of a single radian. + + + + + A value that specifies the size of a single milliradian. + + + + + A value that specifies the size of a single gradian. + + + + + The internal representation of the angle. + + + + + Initializes a new instance of the SharpDX.AngleSingle structure with the + given unit dependant angle and unit type. + + A unit dependant measure of the angle. + The type of unit the angle argument is. + + + + Initializes a new instance of the SharpDX.AngleSingle structure using the + arc length formula (ホク = s/r). + + The measure of the arc. + The radius of the circle. + + + + Wraps this SharpDX.AngleSingle to be in the range [マ, -マ]. + + + + + Wraps this SharpDX.AngleSingle to be in the range [0, 2マ). + + + + + Gets or sets the total number of revolutions this SharpDX.AngleSingle represents. + + + + + Gets or sets the total number of degrees this SharpDX.AngleSingle represents. + + + + + Gets or sets the minutes component of the degrees this SharpDX.AngleSingle represents. + When setting the minutes, if the value is in the range (-60, 60) the whole degrees are + not changed; otherwise, the whole degrees may be changed. Fractional values may set + the seconds component. + + + + + Gets or sets the seconds of the degrees this SharpDX.AngleSingle represents. + When setting the seconds, if the value is in the range (-60, 60) the whole minutes + or whole degrees are not changed; otherwise, the whole minutes or whole degrees + may be changed. + + + + + Gets or sets the total number of radians this SharpDX.AngleSingle represents. + + + + + Gets or sets the total number of milliradians this SharpDX.AngleSingle represents. + One milliradian is equal to 1/(2000マ). + + + + + Gets or sets the total number of gradians this SharpDX.AngleSingle represents. + + + + + Gets a System.Boolean that determines whether this SharpDX.Angle + is a right angle (i.e. 90ツー or マ/2). + + + + + Gets a System.Boolean that determines whether this SharpDX.Angle + is a straight angle (i.e. 180ツー or マ). + + + + + Gets a System.Boolean that determines whether this SharpDX.Angle + is a full rotation angle (i.e. 360ツー or 2マ). + + + + + Gets a System.Boolean that determines whether this SharpDX.Angle + is an oblique angle (i.e. is not 90ツー or a multiple of 90ツー). + + + + + Gets a System.Boolean that determines whether this SharpDX.Angle + is an acute angle (i.e. less than 90ツー but greater than 0ツー). + + + + + Gets a System.Boolean that determines whether this SharpDX.Angle + is an obtuse angle (i.e. greater than 90ツー but less than 180ツー). + + + + + Gets a System.Boolean that determines whether this SharpDX.Angle + is a reflex angle (i.e. greater than 180ツー but less than 360ツー). + + + + + Gets a SharpDX.AngleSingle instance that complements this angle (i.e. the two angles add to 90ツー). + + + + + Gets a SharpDX.AngleSingle instance that supplements this angle (i.e. the two angles add to 180ツー). + + + + + Wraps the SharpDX.AngleSingle given in the value argument to be in the range [マ, -マ]. + + A SharpDX.AngleSingle to wrap. + The SharpDX.AngleSingle that is wrapped. + + + + Wraps the SharpDX.AngleSingle given in the value argument to be in the range [0, 2マ). + + A SharpDX.AngleSingle to wrap. + The SharpDX.AngleSingle that is wrapped. + + + + Compares two SharpDX.AngleSingle instances and returns the smaller angle. + + The first SharpDX.AngleSingle instance to compare. + The second SharpDX.AngleSingle instance to compare. + The smaller of the two given SharpDX.AngleSingle instances. + + + + Compares two SharpDX.AngleSingle instances and returns the greater angle. + + The first SharpDX.AngleSingle instance to compare. + The second SharpDX.AngleSingle instance to compare. + The greater of the two given SharpDX.AngleSingle instances. + + + + Adds two SharpDX.AngleSingle objects and returns the result. + + The first object to add. + The second object to add. + The value of the two objects added together. + + + + Subtracts two SharpDX.AngleSingle objects and returns the result. + + The first object to subtract. + The second object to subtract. + The value of the two objects subtracted. + + + + Multiplies two SharpDX.AngleSingle objects and returns the result. + + The first object to multiply. + The second object to multiply. + The value of the two objects multiplied together. + + + + Divides two SharpDX.AngleSingle objects and returns the result. + + The numerator object. + The denominator object. + The value of the two objects divided. + + + + Gets a new SharpDX.AngleSingle instance that represents the zero angle (i.e. 0ツー). + + + + + Gets a new SharpDX.AngleSingle instance that represents the right angle (i.e. 90ツー or マ/2). + + + + + Gets a new SharpDX.AngleSingle instance that represents the straight angle (i.e. 180ツー or マ). + + + + + Gets a new SharpDX.AngleSingle instance that represents the full rotation angle (i.e. 360ツー or 2マ). + + + + + Returns a System.Boolean that indicates whether the values of two SharpDX.Angle + objects are equal. + + The first object to compare. + The second object to compare. + True if the left and right parameters have the same value; otherwise, false. + + + + Returns a System.Boolean that indicates whether the values of two SharpDX.Angle + objects are not equal. + + The first object to compare. + The second object to compare. + True if the left and right parameters do not have the same value; otherwise, false. + + + + Returns a System.Boolean that indicates whether a SharpDX.Angle + object is less than another SharpDX.AngleSingle object. + + The first object to compare. + The second object to compare. + True if left is less than right; otherwise, false. + + + + Returns a System.Boolean that indicates whether a SharpDX.Angle + object is greater than another SharpDX.AngleSingle object. + + The first object to compare. + The second object to compare. + True if left is greater than right; otherwise, false. + + + + Returns a System.Boolean that indicates whether a SharpDX.Angle + object is less than or equal to another SharpDX.AngleSingle object. + + The first object to compare. + The second object to compare. + True if left is less than or equal to right; otherwise, false. + + + + Returns a System.Boolean that indicates whether a SharpDX.Angle + object is greater than or equal to another SharpDX.AngleSingle object. + + The first object to compare. + The second object to compare. + True if left is greater than or equal to right; otherwise, false. + + + + Returns the value of the SharpDX.AngleSingle operand. (The sign of + the operand is unchanged.) + + A SharpDX.AngleSingle object. + The value of the value parameter. + + + + Returns the the negated value of the SharpDX.AngleSingle operand. + + A SharpDX.AngleSingle object. + The negated value of the value parameter. + + + + Adds two SharpDX.AngleSingle objects and returns the result. + + The first object to add. + The second object to add. + The value of the two objects added together. + + + + Subtracts two SharpDX.AngleSingle objects and returns the result. + + The first object to subtract + The second object to subtract. + The value of the two objects subtracted. + + + + Multiplies two SharpDX.AngleSingle objects and returns the result. + + The first object to multiply. + The second object to multiply. + The value of the two objects multiplied together. + + + + Divides two SharpDX.AngleSingle objects and returns the result. + + The numerator object. + The denominator object. + The value of the two objects divided. + + + + Compares this instance to a specified object and returns an integer that + indicates whether the value of this instance is less than, equal to, or greater + than the value of the specified object. + + The object to compare. + + A signed integer that indicates the relationship of the current instance + to the obj parameter. If the value is less than zero, the current instance + is less than the other. If the value is zero, the current instance is equal + to the other. If the value is greater than zero, the current instance is + greater than the other. + + + + + Compares this instance to a second SharpDX.AngleSingle and returns + an integer that indicates whether the value of this instance is less than, + equal to, or greater than the value of the specified object. + + The object to compare. + + A signed integer that indicates the relationship of the current instance + to the obj parameter. If the value is less than zero, the current instance + is less than the other. If the value is zero, the current instance is equal + to the other. If the value is greater than zero, the current instance is + greater than the other. + + + + + Returns a value that indicates whether the current instance and a specified + SharpDX.AngleSingle object have the same value. + + The object to compare. + + Returns true if this SharpDX.AngleSingle object and another have the same value; + otherwise, false. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this SharpDX.AngleSingle instance. + + A 32-bit signed integer hash code. + + + + Returns a value that indicates whether the current instance and a specified + object have the same value. + + The object to compare. + + Returns true if the obj parameter is a SharpDX.AngleSingle object or a type + capable of implicit conversion to a SharpDX.AngleSingle value, and + its value is equal to the value of the current SharpDX.Angle + object; otherwise, false. + + + + + The assembly is a managed Math API. + + + + + The namespace provides managed Direct3D Compiler API. + + dd607340 + Math + Math + + + + Represents a four dimensional mathematical vector of bool (32 bits per bool value). + + + + + The size of the type, in bytes. + + + + + A with all of its components set to false. + + + + + The X unit (true, 0, 0, 0). + + + + + The Y unit (0, true, 0, 0). + + + + + The Z unit (0, 0, true, 0). + + + + + The W unit (0, 0, 0, true). + + + + + A with all of its components set to true. + + + + + The X component of the vector. + + + + + The Y component of the vector. + + + + + The Z component of the vector. + + + + + The W component of the vector. + + + + + The X component of the vector. + + + + + The Y component of the vector. + + + + + The Z component of the vector. + + + + + The W component of the vector. + + + + + Initializes a new instance of the struct. + + The value that will be assigned to all components. + + + + Initializes a new instance of the struct. + + Initial value for the X component of the vector. + Initial value for the Y component of the vector. + Initial value for the Z component of the vector. + Initial value for the W component of the vector. + + + + Initializes a new instance of the struct. + + The values to assign to the X, Y, Z, and W components of the vector. This must be an array with four elements. + Thrown when is null. + Thrown when contains more or less than four elements. + + + + Gets or sets the component at the specified index. + + The value of the X, Y, Z, or W component, depending on the index. + The index of the component to access. Use 0 for the X component, 1 for the Y component, 2 for the Z component, and 3 for the W component. + The value of the component at the specified index. + Thrown when the is out of the range [0, 3]. + + + + Creates an array containing the elements of the vector. + + A four-element array containing the components of the vector. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Performs an implicit conversion from array to . + + The input. + The result of the conversion. + + + + Performs an implicit conversion from to array. + + The input. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Represents an axis-aligned bounding box in three dimensional space. + + + + + The minimum point of the box. + + + + + The maximum point of the box. + + + + + Initializes a new instance of the struct. + + The minimum vertex of the bounding box. + The maximum vertex of the bounding box. + + + + Returns the width of the bounding box + + + + + Returns the height of the bounding box + + + + + Returns the height of the bounding box + + + + + Returns the size of the bounding box + + + + + Returns the size of the bounding box + + + + + Retrieves the eight corners of the bounding box. + + An array of points representing the eight corners of the bounding box. + + + + Retrieves the eight corners of the bounding box. + + An array of points representing the eight corners of the bounding box. + + + + Determines if there is an intersection between the current object and a . + + The ray to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The ray to test. + When the method completes, contains the distance of the intersection, + or 0 if there was no intersection. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The ray to test. + When the method completes, contains the point of intersection, + or if there was no intersection. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The plane to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The box to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The box to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The sphere to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The sphere to test. + Whether the two objects intersected. + + + + Determines whether the current objects contains a point. + + The point to test. + The type of containment the two objects have. + + + + Determines whether the current objects contains a point. + + The point to test. + The type of containment the two objects have. + + + + Determines whether the current objects contains a . + + The box to test. + The type of containment the two objects have. + + + + Determines whether the current objects contains a . + + The box to test. + The type of containment the two objects have. + + + + Determines whether the current objects contains a . + + The sphere to test. + The type of containment the two objects have. + + + + Determines whether the current objects contains a . + + The sphere to test. + The type of containment the two objects have. + + + + Constructs a that fully contains the given points. + + The points that will be contained by the box. + When the method completes, contains the newly constructed bounding box. + Thrown when is null. + + + + Constructs a that fully contains the given points. + + The points that will be contained by the box. + The newly constructed bounding box. + Thrown when is null. + + + + Constructs a from a given sphere. + + The sphere that will designate the extents of the box. + When the method completes, contains the newly constructed bounding box. + + + + Constructs a from a given sphere. + + The sphere that will designate the extents of the box. + The newly constructed bounding box. + + + + Constructs a that is as large as the total combined area of the two specified boxes. + + The first box to merge. + The second box to merge. + When the method completes, contains the newly constructed bounding box. + + + + Constructs a that is as large as the total combined area of the two specified boxes. + + The first box to merge. + The second box to merge. + The newly constructed bounding box. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Defines a frustum which can be used in frustum culling, zoom to Extents (zoom to fit) operations, + (matrix, frustum, camera) interchange, and many kind of intersection testing. + + + + + Gets or sets the Matrix that describes this bounding frustum. + + + + + Gets the near plane of the BoundingFrustum. + + + + + Gets the far plane of the BoundingFrustum. + + + + + Gets the left plane of the BoundingFrustum. + + + + + Gets the right plane of the BoundingFrustum. + + + + + Gets the top plane of the BoundingFrustum. + + + + + Gets the bottom plane of the BoundingFrustum. + + + + + Creates a new instance of BoundingFrustum. + + Combined matrix that usually takes view テ projection matrix. + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Implements the operator ==. + + The left. + The right. + + The result of the operator. + + + + + Implements the operator !=. + + The left. + The right. + + The result of the operator. + + + + + Returns one of the 6 planes related to this frustum. + + Plane index where 0 fro Left, 1 for Right, 2 for Top, 3 for Bottom, 4 for Near, 5 for Far + + + + + Creates a new frustum relaying on perspective camera parameters + + The camera pos. + The look dir. + Up dir. + The fov. + The znear. + The zfar. + The aspect. + The bounding frustum calculated from perspective camera + + + + Creates a new frustum relaying on perspective camera parameters + + The camera params. + The bounding frustum from camera params + + + + Returns the 8 corners of the frustum, element0 is Near1 (near right down corner) + , element1 is Near2 (near right top corner) + , element2 is Near3 (near Left top corner) + , element3 is Near4 (near Left down corner) + , element4 is Far1 (far right down corner) + , element5 is Far2 (far right top corner) + , element6 is Far3 (far left top corner) + , element7 is Far4 (far left down corner) + + The 8 corners of the frustum + + + + Returns the 8 corners of the frustum, element0 is Near1 (near right down corner) + , element1 is Near2 (near right top corner) + , element2 is Near3 (near Left top corner) + , element3 is Near4 (near Left down corner) + , element4 is Far1 (far right down corner) + , element5 is Far2 (far right top corner) + , element6 is Far3 (far left top corner) + , element7 is Far4 (far left down corner) + + The 8 corners of the frustum + + + + Extracts perspective camera parameters from the frustum, doesn't work with orthographic frustums. + + Perspective camera parameters from the frustum + + + + Checks whether a point lay inside, intersects or lay outside the frustum. + + The point. + Type of the containment + + + + Checks whether a point lay inside, intersects or lay outside the frustum. + + The point. + Type of the containment + + + + Checks whether a group of points lay totally inside the frustum (Contains), or lay partially inside the frustum (Intersects), or lay outside the frustum (Disjoint). + + The points. + Type of the containment + + + + Checks whether a group of points lay totally inside the frustum (Contains), or lay partially inside the frustum (Intersects), or lay outside the frustum (Disjoint). + + The points. + Type of the containment. + + + + Determines the intersection relationship between the frustum and a bounding box. + + The box. + Type of the containment + + + + Determines the intersection relationship between the frustum and a bounding box. + + The box. + Type of the containment + + + + Determines the intersection relationship between the frustum and a bounding box. + + The box. + Type of the containment. + + + + Determines the intersection relationship between the frustum and a bounding sphere. + + The sphere. + Type of the containment + + + + Determines the intersection relationship between the frustum and a bounding sphere. + + The sphere. + Type of the containment + + + + Determines the intersection relationship between the frustum and a bounding sphere. + + The sphere. + Type of the containment. + + + + Determines the intersection relationship between the frustum and another bounding frustum. + + The frustum. + Type of the containment + + + + Determines the intersection relationship between the frustum and another bounding frustum. + + The frustum. + Type of the containment + + + + Determines the intersection relationship between the frustum and another bounding frustum. + + The frustum. + Type of the containment. + + + + Checks whether the current BoundingFrustum intersects a BoundingSphere. + + The sphere. + Type of the containment + + + + Checks whether the current BoundingFrustum intersects a BoundingSphere. + + The sphere. + Set to true if the current BoundingFrustum intersects a BoundingSphere. + + + + Checks whether the current BoundingFrustum intersects a BoundingBox. + + The box. + true if the current BoundingFrustum intersects a BoundingSphere. + + + + Checks whether the current BoundingFrustum intersects a BoundingBox. + + The box. + true if the current BoundingFrustum intersects a BoundingSphere. + + + + Checks whether the current BoundingFrustum intersects the specified Plane. + + The plane. + Plane intersection type. + + + + Checks whether the current BoundingFrustum intersects the specified Plane. + + The plane. + Plane intersection type. + + + + Get the width of the frustum at specified depth. + + the depth at which to calculate frustum width. + With of the frustum at the specified depth + + + + Get the height of the frustum at specified depth. + + the depth at which to calculate frustum height. + Height of the frustum at the specified depth + + + + Checks whether the current BoundingFrustum intersects the specified Ray. + + The ray. + true if the current BoundingFrustum intersects the specified Ray. + + + + Checks whether the current BoundingFrustum intersects the specified Ray. + + The Ray to check for intersection with. + The distance at which the ray enters the frustum if there is an intersection and the ray starts outside the frustum. + The distance at which the ray exits the frustum if there is an intersection. + true if the current BoundingFrustum intersects the specified Ray. + + + + Get the distance which when added to camera position along the lookat direction will do the effect of zoom to extents (zoom to fit) operation, + so all the passed points will fit in the current view. + if the returned value is positive, the camera will move toward the lookat direction (ZoomIn). + if the returned value is negative, the camera will move in the reverse direction of the lookat direction (ZoomOut). + + The points. + The zoom to fit distance + + + + Get the distance which when added to camera position along the lookat direction will do the effect of zoom to extents (zoom to fit) operation, + so all the passed points will fit in the current view. + if the returned value is positive, the camera will move toward the lookat direction (ZoomIn). + if the returned value is negative, the camera will move in the reverse direction of the lookat direction (ZoomOut). + + The bounding box. + The zoom to fit distance + + + + Get the vector shift which when added to camera position will do the effect of zoom to extents (zoom to fit) operation, + so all the passed points will fit in the current view. + + The points. + The zoom to fit vector + + + + Get the vector shift which when added to camera position will do the effect of zoom to extents (zoom to fit) operation, + so all the passed points will fit in the current view. + + The bounding box. + The zoom to fit vector + + + + Indicate whether the current BoundingFrustrum is Orthographic. + + + true if the current BoundingFrustrum is Orthographic; otherwise, false. + + + + + Represents a bounding sphere in three dimensional space. + + + + + The center of the sphere in three dimensional space. + + + + + The radius of the sphere. + + + + + Initializes a new instance of the struct. + + The center of the sphere in three dimensional space. + The radius of the sphere. + + + + Determines if there is an intersection between the current object and a . + + The ray to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The ray to test. + When the method completes, contains the distance of the intersection, + or 0 if there was no intersection. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The ray to test. + When the method completes, contains the point of intersection, + or if there was no intersection. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The plane to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a triangle. + + The first vertex of the triangle to test. + The second vertex of the triangle to test. + The third vertex of the triangle to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The box to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The box to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The sphere to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The sphere to test. + Whether the two objects intersected. + + + + Determines whether the current objects contains a point. + + The point to test. + The type of containment the two objects have. + + + + Determines whether the current objects contains a triangle. + + The first vertex of the triangle to test. + The second vertex of the triangle to test. + The third vertex of the triangle to test. + The type of containment the two objects have. + + + + Determines whether the current objects contains a . + + The box to test. + The type of containment the two objects have. + + + + Determines whether the current objects contains a . + + The sphere to test. + The type of containment the two objects have. + + + + Constructs a that fully contains the given points. + + The points that will be contained by the sphere. + The start index from points array to start compute the bounding sphere. + The count of points to process to compute the bounding sphere. + When the method completes, contains the newly constructed bounding sphere. + points + + start + or + count + + + + + Constructs a that fully contains the given points. + + The points that will be contained by the sphere. + When the method completes, contains the newly constructed bounding sphere. + + + + Constructs a that fully contains the given points. + + The points that will be contained by the sphere. + The newly constructed bounding sphere. + + + + Constructs a from a given box. + + The box that will designate the extents of the sphere. + When the method completes, the newly constructed bounding sphere. + + + + Constructs a from a given box. + + The box that will designate the extents of the sphere. + The newly constructed bounding sphere. + + + + Constructs a that is the as large as the total combined area of the two specified spheres. + + The first sphere to merge. + The second sphere to merge. + When the method completes, contains the newly constructed bounding sphere. + + + + Constructs a that is the as large as the total combined area of the two specified spheres. + + The first sphere to merge. + The second sphere to merge. + The newly constructed bounding sphere. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Contains static methods to help in determining intersections, containment, etc. + + + + + Determines the closest point between a point and a triangle. + + The point to test. + The first vertex to test. + The second vertex to test. + The third vertex to test. + When the method completes, contains the closest point between the two objects. + + + + Determines the closest point between a and a point. + + The plane to test. + The point to test. + When the method completes, contains the closest point between the two objects. + + + + Determines the closest point between a and a point. + + The box to test. + The point to test. + When the method completes, contains the closest point between the two objects. + + + + Determines the closest point between a and a point. + + + The point to test. + When the method completes, contains the closest point between the two objects; + or, if the point is directly in the center of the sphere, contains . + + + + Determines the closest point between a and a . + + The first sphere to test. + The second sphere to test. + When the method completes, contains the closest point between the two objects; + or, if the point is directly in the center of the sphere, contains . + + If the two spheres are overlapping, but not directly on top of each other, the closest point + is the 'closest' point of intersection. This can also be considered is the deepest point of + intersection. + + + + + Determines the distance between a and a point. + + The plane to test. + The point to test. + The distance between the two objects. + + + + Determines the distance between a and a point. + + The box to test. + The point to test. + The distance between the two objects. + + + + Determines the distance between a and a . + + The first box to test. + The second box to test. + The distance between the two objects. + + + + Determines the distance between a and a point. + + The sphere to test. + The point to test. + The distance between the two objects. + + + + Determines the distance between a and a . + + The first sphere to test. + The second sphere to test. + The distance between the two objects. + + + + Determines whether there is an intersection between a and a point. + + The ray to test. + The point to test. + Whether the two objects intersect. + + + + Determines whether there is an intersection between a and a . + + The first ray to test. + The second ray to test. + When the method completes, contains the point of intersection, + or if there was no intersection. + Whether the two objects intersect. + + This method performs a ray vs ray intersection test based on the following formula + from Goldman. + s = det([o_2 - o_1, d_2, d_1 x d_2]) / ||d_1 x d_2||^2 + t = det([o_2 - o_1, d_1, d_1 x d_2]) / ||d_1 x d_2||^2 + Where o_1 is the position of the first ray, o_2 is the position of the second ray, + d_1 is the normalized direction of the first ray, d_2 is the normalized direction + of the second ray, det denotes the determinant of a matrix, x denotes the cross + product, [ ] denotes a matrix, and || || denotes the length or magnitude of a vector. + + + + + Determines whether there is an intersection between a and a . + + The ray to test. + The plane to test. + When the method completes, contains the distance of the intersection, + or 0 if there was no intersection. + Whether the two objects intersect. + + + + Determines whether there is an intersection between a and a . + + The ray to test. + The plane to test + When the method completes, contains the point of intersection, + or if there was no intersection. + Whether the two objects intersected. + + + + Determines whether there is an intersection between a and a triangle. + + The ray to test. + The first vertex of the triangle to test. + The second vertex of the triangle to test. + The third vertex of the triangle to test. + When the method completes, contains the distance of the intersection, + or 0 if there was no intersection. + Whether the two objects intersected. + + This method tests if the ray intersects either the front or back of the triangle. + If the ray is parallel to the triangle's plane, no intersection is assumed to have + happened. If the intersection of the ray and the triangle is behind the origin of + the ray, no intersection is assumed to have happened. In both cases of assumptions, + this method returns false. + + + + + Determines whether there is an intersection between a and a triangle. + + The ray to test. + The first vertex of the triangle to test. + The second vertex of the triangle to test. + The third vertex of the triangle to test. + When the method completes, contains the point of intersection, + or if there was no intersection. + Whether the two objects intersected. + + + + Determines whether there is an intersection between a and a . + + The ray to test. + The box to test. + When the method completes, contains the distance of the intersection, + or 0 if there was no intersection. + Whether the two objects intersected. + + + + Determines whether there is an intersection between a and a . + + The ray to test. + The box to test. + When the method completes, contains the point of intersection, + or if there was no intersection. + Whether the two objects intersected. + + + + Determines whether there is an intersection between a and a . + + The ray to test. + The sphere to test. + When the method completes, contains the distance of the intersection, + or 0 if there was no intersection. + Whether the two objects intersected. + + + + Determines whether there is an intersection between a and a . + + The ray to test. + The sphere to test. + When the method completes, contains the point of intersection, + or if there was no intersection. + Whether the two objects intersected. + + + + Determines whether there is an intersection between a and a point. + + The plane to test. + The point to test. + Whether the two objects intersected. + + + + Determines whether there is an intersection between a and a . + + The first plane to test. + The second plane to test. + Whether the two objects intersected. + + + + Determines whether there is an intersection between a and a . + + The first plane to test. + The second plane to test. + When the method completes, contains the line of intersection + as a , or a zero ray if there was no intersection. + Whether the two objects intersected. + + Although a ray is set to have an origin, the ray returned by this method is really + a line in three dimensions which has no real origin. The ray is considered valid when + both the positive direction is used and when the negative direction is used. + + + + + Determines whether there is an intersection between a and a triangle. + + The plane to test. + The first vertex of the triangle to test. + The second vertex of the triangle to test. + The third vertex of the triangle to test. + Whether the two objects intersected. + + + + Determines whether there is an intersection between a and a . + + The plane to test. + The box to test. + Whether the two objects intersected. + + + + Determines whether there is an intersection between a and a . + + The plane to test. + The sphere to test. + Whether the two objects intersected. + + + + Determines whether there is an intersection between a and a . + + The first box to test. + The second box to test. + Whether the two objects intersected. + + + + Determines whether there is an intersection between a and a . + + The box to test. + The sphere to test. + Whether the two objects intersected. + + + + Determines whether there is an intersection between a and a triangle. + + The sphere to test. + The first vertex of the triangle to test. + The second vertex of the triangle to test. + The third vertex of the triangle to test. + Whether the two objects intersected. + + + + Determines whether there is an intersection between a and a . + + First sphere to test. + Second sphere to test. + Whether the two objects intersected. + + + + Determines whether a contains a point. + + The box to test. + The point to test. + The type of containment the two objects have. + + + + Determines whether a contains a . + + The first box to test. + The second box to test. + The type of containment the two objects have. + + + + Determines whether a contains a . + + The box to test. + The sphere to test. + The type of containment the two objects have. + + + + Determines whether a contains a point. + + The sphere to test. + The point to test. + The type of containment the two objects have. + + + + Determines whether a contains a triangle. + + The sphere to test. + The first vertex of the triangle to test. + The second vertex of the triangle to test. + The third vertex of the triangle to test. + The type of containment the two objects have. + + + + Determines whether a contains a . + + The sphere to test. + The box to test. + The type of containment the two objects have. + + + + Determines whether a contains a . + + The first sphere to test. + The second sphere to test. + The type of containment the two objects have. + + + + Represents a 32-bit color (4 bytes) in the form of RGBA (in byte order: R, G, B, A). + + + List of predefined . + + + + + The red component of the color. + + + + + The green component of the color. + + + + + The blue component of the color. + + + + + The alpha component of the color. + + + + + Initializes a new instance of the struct. + + The value that will be assigned to all components. + + + + Initializes a new instance of the struct. + + The value that will be assigned to all components. + + + + Initializes a new instance of the struct. + + The red component of the color. + The green component of the color. + The blue component of the color. + The alpha component of the color. + + + + Initializes a new instance of the struct. Alpha is set to 255. + + The red component of the color. + The green component of the color. + The blue component of the color. + + + + Initializes a new instance of the struct. Passed values are clamped within byte range. + + The red component of the color. + The green component of the color. + The blue component of the color. + The alpha component of the color + + + + Initializes a new instance of the struct. Alpha is set to 255. Passed values are clamped within byte range. + + The red component of the color. + The green component of the color. + The blue component of the color. + + + + Initializes a new instance of the struct. + + The red component of the color. + The green component of the color. + The blue component of the color. + The alpha component of the color. + + + + Initializes a new instance of the struct. Alpha is set to 255. + + The red component of the color. + The green component of the color. + The blue component of the color. + + + + Initializes a new instance of the struct. + + The red, green, blue, and alpha components of the color. + + + + Initializes a new instance of the struct. + + The red, green, and blue components of the color. + The alpha component of the color. + + + + Initializes a new instance of the struct. Alpha is set to 255. + + The red, green, and blue components of the color. + + + + Initializes a new instance of the struct. + + A packed integer containing all four color components in RGBA order. + + + + Initializes a new instance of the struct. + + A packed integer containing all four color components in RGBA order. + + + + Initializes a new instance of the struct. + + The values to assign to the red, green, and blue, alpha components of the color. This must be an array with four elements. + Thrown when is null. + Thrown when contains more or less than four elements. + + + + Initializes a new instance of the struct. + + The values to assign to the alpha, red, green, and blue components of the color. This must be an array with four elements. + Thrown when is null. + Thrown when contains more or less than four elements. + + + + Gets or sets the component at the specified index. + + The value of the alpha, red, green, or blue component, depending on the index. + The index of the component to access. Use 0 for the alpha component, 1 for the red component, 2 for the green component, and 3 for the blue component. + The value of the component at the specified index. + Thrown when the is out of the range [0, 3]. + + + + Converts the color into a packed integer. + + A packed integer containing all four color components. + + + + Converts the color into a packed integer. + + A packed integer containing all four color components. + + + + Converts the color into a packed integer. + + A packed integer containing all four color components. + + + + Converts the color into a three component vector. + + A three component vector containing the red, green, and blue components of the color. + + + + Converts the color into a three component color. + + A three component color containing the red, green, and blue components of the color. + + + + Converts the color into a four component vector. + + A four component vector containing all four color components. + + + + Creates an array containing the elements of the color. + + A four-element array containing the components of the color in RGBA order. + + + + Gets the brightness. + + The Hue-Saturation-Brightness (HSB) brightness for this + + + + Gets the hue. + + The Hue-Saturation-Brightness (HSB) hue for this + + + + Gets the saturation. + + The Hue-Saturation-Brightness (HSB) saturation for this + + + + Adds two colors. + + The first color to add. + The second color to add. + When the method completes, completes the sum of the two colors. + + + + Adds two colors. + + The first color to add. + The second color to add. + The sum of the two colors. + + + + Subtracts two colors. + + The first color to subtract. + The second color to subtract. + WHen the method completes, contains the difference of the two colors. + + + + Subtracts two colors. + + The first color to subtract. + The second color to subtract + The difference of the two colors. + + + + Modulates two colors. + + The first color to modulate. + The second color to modulate. + When the method completes, contains the modulated color. + + + + Modulates two colors. + + The first color to modulate. + The second color to modulate. + The modulated color. + + + + Scales a color. + + The color to scale. + The amount by which to scale. + When the method completes, contains the scaled color. + + + + Scales a color. + + The color to scale. + The amount by which to scale. + The scaled color. + + + + Negates a color. + + The color to negate. + When the method completes, contains the negated color. + + + + Negates a color. + + The color to negate. + The negated color. + + + + Restricts a value to be within a specified range. + + The value to clamp. + The minimum value. + The maximum value. + When the method completes, contains the clamped value. + + + + Computes the premultiplied value of the provided color. + + The non-premultiplied value. + The premultiplied result. + + + + Computes the premultiplied value of the provided color. + + The non-premultiplied value. + The premultiplied result. + + + + Converts the color from a packed BGRA integer. + + A packed integer containing all four color components in BGRA order + A color. + + + + Converts the color from a packed BGRA integer. + + A packed integer containing all four color components in BGRA order + A color. + + + + Converts the color from a packed ABGR integer. + + A packed integer containing all four color components in ABGR order + A color. + + + + Converts the color from a packed ABGR integer. + + A packed integer containing all four color components in ABGR order + A color. + + + + Converts the color from a packed BGRA integer. + + A packed integer containing all four color components in RGBA order + A color. + + + + Converts the color from a packed BGRA integer. + + A packed integer containing all four color components in RGBA order + A color. + + + + Restricts a value to be within a specified range. + + The value to clamp. + The minimum value. + The maximum value. + The clamped value. + + + + Performs a linear interpolation between two colors. + + Start color. + End color. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the linear interpolation of the two colors. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a linear interpolation between two colors. + + Start color. + End color. + Value between 0 and 1 indicating the weight of . + The linear interpolation of the two colors. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a cubic interpolation between two colors. + + Start color. + End color. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the cubic interpolation of the two colors. + + + + Performs a cubic interpolation between two colors. + + Start color. + End color. + Value between 0 and 1 indicating the weight of . + The cubic interpolation of the two colors. + + + + Returns a color containing the smallest components of the specified colors. + + The first source color. + The second source color. + When the method completes, contains an new color composed of the largest components of the source colors. + + + + Returns a color containing the largest components of the specified colorss. + + The first source color. + The second source color. + A color containing the largest components of the source colors. + + + + Returns a color containing the smallest components of the specified colors. + + The first source color. + The second source color. + When the method completes, contains an new color composed of the smallest components of the source colors. + + + + Returns a color containing the smallest components of the specified colors. + + The first source color. + The second source color. + A color containing the smallest components of the source colors. + + + + Adjusts the contrast of a color. + + The color whose contrast is to be adjusted. + The amount by which to adjust the contrast. + When the method completes, contains the adjusted color. + + + + Adjusts the contrast of a color. + + The color whose contrast is to be adjusted. + The amount by which to adjust the contrast. + The adjusted color. + + + + Adjusts the saturation of a color. + + The color whose saturation is to be adjusted. + The amount by which to adjust the saturation. + When the method completes, contains the adjusted color. + + + + Adjusts the saturation of a color. + + The color whose saturation is to be adjusted. + The amount by which to adjust the saturation. + The adjusted color. + + + + Adds two colors. + + The first color to add. + The second color to add. + The sum of the two colors. + + + + Assert a color (return it unchanged). + + The color to assert (unchanged). + The asserted (unchanged) color. + + + + Subtracts two colors. + + The first color to subtract. + The second color to subtract. + The difference of the two colors. + + + + Negates a color. + + The color to negate. + A negated color. + + + + Scales a color. + + The factor by which to scale the color. + The color to scale. + The scaled color. + + + + Scales a color. + + The factor by which to scale the color. + The color to scale. + The scaled color. + + + + Modulates two colors. + + The first color to modulate. + The second color to modulate. + The modulated color. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Convert this instance to a + + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to nullable . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + + The result of the conversion. + + + + + Performs an explicit conversion from to . + + The value. + + The result of the conversion. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format to apply to each channel element (byte). + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format to apply to each channel element (byte). + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Zero color. + + + + + Transparent color. + + + + + AliceBlue color. + + + + + AntiqueWhite color. + + + + + Aqua color. + + + + + Aquamarine color. + + + + + Azure color. + + + + + Beige color. + + + + + Bisque color. + + + + + Black color. + + + + + BlanchedAlmond color. + + + + + Blue color. + + + + + BlueViolet color. + + + + + Brown color. + + + + + BurlyWood color. + + + + + CadetBlue color. + + + + + Chartreuse color. + + + + + Chocolate color. + + + + + Coral color. + + + + + CornflowerBlue color. + + + + + Cornsilk color. + + + + + Crimson color. + + + + + Cyan color. + + + + + DarkBlue color. + + + + + DarkCyan color. + + + + + DarkGoldenrod color. + + + + + DarkGray color. + + + + + DarkGreen color. + + + + + DarkKhaki color. + + + + + DarkMagenta color. + + + + + DarkOliveGreen color. + + + + + DarkOrange color. + + + + + DarkOrchid color. + + + + + DarkRed color. + + + + + DarkSalmon color. + + + + + DarkSeaGreen color. + + + + + DarkSlateBlue color. + + + + + DarkSlateGray color. + + + + + DarkTurquoise color. + + + + + DarkViolet color. + + + + + DeepPink color. + + + + + DeepSkyBlue color. + + + + + DimGray color. + + + + + DodgerBlue color. + + + + + Firebrick color. + + + + + FloralWhite color. + + + + + ForestGreen color. + + + + + Fuchsia color. + + + + + Gainsboro color. + + + + + GhostWhite color. + + + + + Gold color. + + + + + Goldenrod color. + + + + + Gray color. + + + + + Green color. + + + + + GreenYellow color. + + + + + Honeydew color. + + + + + HotPink color. + + + + + IndianRed color. + + + + + Indigo color. + + + + + Ivory color. + + + + + Khaki color. + + + + + Lavender color. + + + + + LavenderBlush color. + + + + + LawnGreen color. + + + + + LemonChiffon color. + + + + + LightBlue color. + + + + + LightCoral color. + + + + + LightCyan color. + + + + + LightGoldenrodYellow color. + + + + + LightGray color. + + + + + LightGreen color. + + + + + LightPink color. + + + + + LightSalmon color. + + + + + LightSeaGreen color. + + + + + LightSkyBlue color. + + + + + LightSlateGray color. + + + + + LightSteelBlue color. + + + + + LightYellow color. + + + + + Lime color. + + + + + LimeGreen color. + + + + + Linen color. + + + + + Magenta color. + + + + + Maroon color. + + + + + MediumAquamarine color. + + + + + MediumBlue color. + + + + + MediumOrchid color. + + + + + MediumPurple color. + + + + + MediumSeaGreen color. + + + + + MediumSlateBlue color. + + + + + MediumSpringGreen color. + + + + + MediumTurquoise color. + + + + + MediumVioletRed color. + + + + + MidnightBlue color. + + + + + MintCream color. + + + + + MistyRose color. + + + + + Moccasin color. + + + + + NavajoWhite color. + + + + + Navy color. + + + + + OldLace color. + + + + + Olive color. + + + + + OliveDrab color. + + + + + Orange color. + + + + + OrangeRed color. + + + + + Orchid color. + + + + + PaleGoldenrod color. + + + + + PaleGreen color. + + + + + PaleTurquoise color. + + + + + PaleVioletRed color. + + + + + PapayaWhip color. + + + + + PeachPuff color. + + + + + Peru color. + + + + + Pink color. + + + + + Plum color. + + + + + PowderBlue color. + + + + + Purple color. + + + + + Red color. + + + + + RosyBrown color. + + + + + RoyalBlue color. + + + + + SaddleBrown color. + + + + + Salmon color. + + + + + SandyBrown color. + + + + + SeaGreen color. + + + + + SeaShell color. + + + + + Sienna color. + + + + + Silver color. + + + + + SkyBlue color. + + + + + SlateBlue color. + + + + + SlateGray color. + + + + + Snow color. + + + + + SpringGreen color. + + + + + SteelBlue color. + + + + + Tan color. + + + + + Teal color. + + + + + Thistle color. + + + + + Tomato color. + + + + + Turquoise color. + + + + + Violet color. + + + + + Wheat color. + + + + + White color. + + + + + WhiteSmoke color. + + + + + Yellow color. + + + + + YellowGreen color. + + + + + Represents a color in the form of rgb. + + + + + The Black color (0, 0, 0). + + + + + The White color (1, 1, 1, 1). + + + + + The red component of the color. + + + + + The green component of the color. + + + + + The blue component of the color. + + + + + Initializes a new instance of the struct. + + The value that will be assigned to all components. + + + + Initializes a new instance of the struct. + + The red component of the color. + The green component of the color. + The blue component of the color. + + + + Initializes a new instance of the struct. + + The red, green, and blue components of the color. + + + + Initializes a new instance of the struct. + + A packed integer containing all three color components in RGB order. + The alpha component is ignored. + + + + Initializes a new instance of the struct. + + The values to assign to the red, green, and blue components of the color. This must be an array with three elements. + Thrown when is null. + Thrown when contains more or less than four elements. + + + + Gets or sets the component at the specified index. + + The value of the red, green, or blue component, depending on the index. + The index of the component to access. Use 0 for the red component, 1 for the green component, and 2 for the blue component. + The value of the component at the specified index. + Thrown when the is out of the range [0, 2]. + + + + Converts the color into a packed integer. + + A packed integer containing all three color components. + The alpha channel is set to 255. + + + + Converts the color into a packed integer. + + A packed integer containing all three color components. + The alpha channel is set to 255. + + + + Converts the color into a three component vector. + + A three component vector containing the red, green, and blue components of the color. + + + + Creates an array containing the elements of the color. + + A three-element array containing the components of the color. + + + + Adds two colors. + + The first color to add. + The second color to add. + When the method completes, completes the sum of the two colors. + + + + Adds two colors. + + The first color to add. + The second color to add. + The sum of the two colors. + + + + Subtracts two colors. + + The first color to subtract. + The second color to subtract. + WHen the method completes, contains the difference of the two colors. + + + + Subtracts two colors. + + The first color to subtract. + The second color to subtract + The difference of the two colors. + + + + Modulates two colors. + + The first color to modulate. + The second color to modulate. + When the method completes, contains the modulated color. + + + + Modulates two colors. + + The first color to modulate. + The second color to modulate. + The modulated color. + + + + Scales a color. + + The color to scale. + The amount by which to scale. + When the method completes, contains the scaled color. + + + + Scales a color. + + The color to scale. + The amount by which to scale. + The scaled color. + + + + Negates a color. + + The color to negate. + When the method completes, contains the negated color. + + + + Negates a color. + + The color to negate. + The negated color. + + + + Restricts a value to be within a specified range. + + The value to clamp. + The minimum value. + The maximum value. + When the method completes, contains the clamped value. + + + + Restricts a value to be within a specified range. + + The value to clamp. + The minimum value. + The maximum value. + The clamped value. + + + + Performs a linear interpolation between two colors. + + Start color. + End color. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the linear interpolation of the two colors. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a linear interpolation between two colors. + + Start color. + End color. + Value between 0 and 1 indicating the weight of . + The linear interpolation of the two colors. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a cubic interpolation between two colors. + + Start color. + End color. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the cubic interpolation of the two colors. + + + + Performs a cubic interpolation between two colors. + + Start color. + End color. + Value between 0 and 1 indicating the weight of . + The cubic interpolation of the two colors. + + + + Returns a color containing the smallest components of the specified colors. + + The first source color. + The second source color. + When the method completes, contains an new color composed of the largest components of the source colors. + + + + Returns a color containing the largest components of the specified colors. + + The first source color. + The second source color. + A color containing the largest components of the source colors. + + + + Returns a color containing the smallest components of the specified colors. + + The first source color. + The second source color. + When the method completes, contains an new color composed of the smallest components of the source colors. + + + + Returns a color containing the smallest components of the specified colors. + + The first source color. + The second source color. + A color containing the smallest components of the source colors. + + + + Adjusts the contrast of a color. + + The color whose contrast is to be adjusted. + The amount by which to adjust the contrast. + When the method completes, contains the adjusted color. + + + + Adjusts the contrast of a color. + + The color whose contrast is to be adjusted. + The amount by which to adjust the contrast. + The adjusted color. + + + + Adjusts the saturation of a color. + + The color whose saturation is to be adjusted. + The amount by which to adjust the saturation. + When the method completes, contains the adjusted color. + + + + Adjusts the saturation of a color. + + The color whose saturation is to be adjusted. + The amount by which to adjust the saturation. + The adjusted color. + + + + Computes the premultiplied value of the provided color. + + The non-premultiplied value. + The color alpha. + The premultiplied result. + + + + Computes the premultiplied value of the provided color. + + The non-premultiplied value. + The color alpha. + The premultiplied color. + + + + Adds two colors. + + The first color to add. + The second color to add. + The sum of the two colors. + + + + Assert a color (return it unchanged). + + The color to assert (unchanged). + The asserted (unchanged) color. + + + + Subtracts two colors. + + The first color to subtract. + The second color to subtract. + The difference of the two colors. + + + + Negates a color. + + The color to negate. + A negated color. + + + + Scales a color. + + The factor by which to scale the color. + The color to scale. + The scaled color. + + + + Scales a color. + + The factor by which to scale the color. + The color to scale. + The scaled color. + + + + Modulates two colors. + + The first color to modulate. + The second color to modulate. + The modulated color. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format to apply to each channel element (float) + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format to apply to each channel element (float). + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Represents a color in the form of rgba. + + + + + The Black color (0, 0, 0, 1). + + + + + The White color (1, 1, 1, 1). + + + + + The red component of the color. + + + + + The green component of the color. + + + + + The blue component of the color. + + + + + The alpha component of the color. + + + + + Initializes a new instance of the struct. + + The value that will be assigned to all components. + + + + Initializes a new instance of the struct. + + The red component of the color. + The green component of the color. + The blue component of the color. + The alpha component of the color. + + + + Initializes a new instance of the struct. + + The red, green, blue, and alpha components of the color. + + + + Initializes a new instance of the struct. + + The red, green, and blue components of the color. + The alpha component of the color. + + + + Initializes a new instance of the struct. + + A packed integer containing all four color components in RGBA order. + + + + Initializes a new instance of the struct. + + A packed integer containing all four color components in RGBA order. + + + + Initializes a new instance of the struct. + + The values to assign to the red, green, blue, and alpha components of the color. This must be an array with four elements. + Thrown when is null. + Thrown when contains more or less than four elements. + + + + Initializes a new instance of the struct. + + used to initialize the color. + + + + Initializes a new instance of the struct. + + used to initialize the color. + The alpha component of the color. + + + + Gets or sets the component at the specified index. + + The value of the red, green, blue, and alpha components, depending on the index. + The index of the component to access. Use 0 for the alpha component, 1 for the red component, 2 for the green component, and 3 for the blue component. + The value of the component at the specified index. + Thrown when the is out of the range [0, 3]. + + + + Converts the color into a packed integer. + + A packed integer containing all four color components. + + + + Converts the color into a packed integer. + + A packed integer containing all four color components. + + + + Converts the color into a packed integer. + + A packed integer containing all four color components. + + + + Converts the color into a three component vector. + + A three component vector containing the red, green, and blue components of the color. + + + + Converts the color into a four component vector. + + A four component vector containing all four color components. + + + + Creates an array containing the elements of the color. + + A four-element array containing the components of the color. + + + + Adds two colors. + + The first color to add. + The second color to add. + When the method completes, completes the sum of the two colors. + + + + Adds two colors. + + The first color to add. + The second color to add. + The sum of the two colors. + + + + Subtracts two colors. + + The first color to subtract. + The second color to subtract. + WHen the method completes, contains the difference of the two colors. + + + + Subtracts two colors. + + The first color to subtract. + The second color to subtract + The difference of the two colors. + + + + Modulates two colors. + + The first color to modulate. + The second color to modulate. + When the method completes, contains the modulated color. + + + + Modulates two colors. + + The first color to modulate. + The second color to modulate. + The modulated color. + + + + Scales a color. + + The color to scale. + The amount by which to scale. + When the method completes, contains the scaled color. + + + + Scales a color. + + The color to scale. + The amount by which to scale. + The scaled color. + + + + Negates a color. + + The color to negate. + When the method completes, contains the negated color. + + + + Negates a color. + + The color to negate. + The negated color. + + + + Restricts a value to be within a specified range. + + The value to clamp. + The minimum value. + The maximum value. + When the method completes, contains the clamped value. + + + + Restricts a value to be within a specified range. + + The value to clamp. + The minimum value. + The maximum value. + The clamped value. + + + + Performs a linear interpolation between two colors. + + Start color. + End color. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the linear interpolation of the two colors. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a linear interpolation between two colors. + + Start color. + End color. + Value between 0 and 1 indicating the weight of . + The linear interpolation of the two colors. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a cubic interpolation between two colors. + + Start color. + End color. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the cubic interpolation of the two colors. + + + + Performs a cubic interpolation between two colors. + + Start color. + End color. + Value between 0 and 1 indicating the weight of . + The cubic interpolation of the two colors. + + + + Returns a color containing the smallest components of the specified colors. + + The first source color. + The second source color. + When the method completes, contains an new color composed of the largest components of the source colors. + + + + Returns a color containing the largest components of the specified colors. + + The first source color. + The second source color. + A color containing the largest components of the source colors. + + + + Returns a color containing the smallest components of the specified colors. + + The first source color. + The second source color. + When the method completes, contains an new color composed of the smallest components of the source colors. + + + + Returns a color containing the smallest components of the specified colors. + + The first source color. + The second source color. + A color containing the smallest components of the source colors. + + + + Adjusts the contrast of a color. + + The color whose contrast is to be adjusted. + The amount by which to adjust the contrast. + When the method completes, contains the adjusted color. + + + + Adjusts the contrast of a color. + + The color whose contrast is to be adjusted. + The amount by which to adjust the contrast. + The adjusted color. + + + + Adjusts the saturation of a color. + + The color whose saturation is to be adjusted. + The amount by which to adjust the saturation. + When the method completes, contains the adjusted color. + + + + Adjusts the saturation of a color. + + The color whose saturation is to be adjusted. + The amount by which to adjust the saturation. + The adjusted color. + + + + Computes the premultiplied value of the provided color. + + The non-premultiplied value. + The premultiplied result. + + + + Computes the premultiplied value of the provided color. + + The non-premultiplied value. + The premultiplied result. + + + + Adds two colors. + + The first color to add. + The second color to add. + The sum of the two colors. + + + + Assert a color (return it unchanged). + + The color to assert (unchanged). + The asserted (unchanged) color. + + + + Subtracts two colors. + + The first color to subtract. + The second color to subtract. + The difference of the two colors. + + + + Negates a color. + + The color to negate. + A negated color. + + + + Scales a color. + + The factor by which to scale the color. + The color to scale. + The scaled color. + + + + Scales a color. + + The factor by which to scale the color. + The color to scale. + The scaled color. + + + + Modulates two colors. + + The first color to modulate. + The second color to modulate. + The modulated color. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + + The result of the conversion. + + + + + Performs an explicit conversion from to . + + The value. + + The result of the conversion. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format to apply to each channel (float). + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format to apply to each channel (float). + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Represents a 32-bit color (4 bytes) in the form of BGRA (in byte order: B, G, B, A). + + + + + The blue component of the color. + + + + + The green component of the color. + + + + + The red component of the color. + + + + + The alpha component of the color. + + + + + Initializes a new instance of the struct. + + The value that will be assigned to all components. + + + + Initializes a new instance of the struct. + + The value that will be assigned to all components. + + + + Initializes a new instance of the struct. + + The red component of the color. + The green component of the color. + The blue component of the color. + The alpha component of the color. + + + + Initializes a new instance of the struct. + + The red component of the color. + The green component of the color. + The blue component of the color. + The alpha component of the color. + + + + Initializes a new instance of the struct. + + The red, green, blue, and alpha components of the color. + + + + Initializes a new instance of the struct. + + The red, green, and blue components of the color. + The alpha component of the color. + + + + Initializes a new instance of the struct. + + A packed integer containing all four color components in BGRA order. + + + + Initializes a new instance of the struct. + + A packed integer containing all four color components in BGRA. + + + + Initializes a new instance of the struct. + + The values to assign to the red, green, and blue, alpha components of the color. This must be an array with four elements. + Thrown when is null. + Thrown when contains more or less than four elements. + + + + Initializes a new instance of the struct. + + The values to assign to the red, green, and blue, alpha components of the color. This must be an array with four elements. + Thrown when is null. + Thrown when contains more or less than four elements. + + + + Gets or sets the component at the specified index. + + The value of the alpha, red, green, or blue component, depending on the index. + The index of the component to access. Use 0 for the alpha component, 1 for the red component, 2 for the green component, and 3 for the blue component. + The value of the component at the specified index. + Thrown when the is out of the range [0, 3]. + + + + Converts the color into a packed integer. + + A packed integer containing all four color components. + + + + Converts the color into a packed integer. + + A packed integer containing all four color components. + + + + Converts the color into a three component vector. + + A three component vector containing the red, green, and blue components of the color. + + + + Converts the color into a three component color. + + A three component color containing the red, green, and blue components of the color. + + + + Converts the color into a four component vector. + + A four component vector containing all four color components. + + + + Creates an array containing the elements of the color. + + A four-element array containing the components of the color in BGRA order. + + + + Gets the brightness. + + The Hue-Saturation-Brightness (HSB) saturation for this + + + + Gets the hue. + + The Hue-Saturation-Brightness (HSB) saturation for this + + + + Gets the saturation. + + The Hue-Saturation-Brightness (HSB) saturation for this + + + + Converts the color from a packed BGRA integer. + + A packed integer containing all four color components in BGRA order + A color. + + + + Converts the color from a packed BGRA integer. + + A packed integer containing all four color components in BGRA order + A color. + + + + Converts the color from a packed RGBA integer. + + A packed integer containing all four color components in RGBA order + A color. + + + + Converts the color from a packed RGBA integer. + + A packed integer containing all four color components in RGBA order + A color. + + + + Adds two colors. + + The first color to add. + The second color to add. + When the method completes, completes the sum of the two colors. + + + + Adds two colors. + + The first color to add. + The second color to add. + The sum of the two colors. + + + + Subtracts two colors. + + The first color to subtract. + The second color to subtract. + WHen the method completes, contains the difference of the two colors. + + + + Subtracts two colors. + + The first color to subtract. + The second color to subtract + The difference of the two colors. + + + + Modulates two colors. + + The first color to modulate. + The second color to modulate. + When the method completes, contains the modulated color. + + + + Modulates two colors. + + The first color to modulate. + The second color to modulate. + The modulated color. + + + + Scales a color. + + The color to scale. + The amount by which to scale. + When the method completes, contains the scaled color. + + + + Scales a color. + + The color to scale. + The amount by which to scale. + The scaled color. + + + + Negates a color. + + The color to negate. + When the method completes, contains the negated color. + + + + Negates a color. + + The color to negate. + The negated color. + + + + Restricts a value to be within a specified range. + + The value to clamp. + The minimum value. + The maximum value. + When the method completes, contains the clamped value. + + + + Restricts a value to be within a specified range. + + The value to clamp. + The minimum value. + The maximum value. + The clamped value. + + + + Performs a linear interpolation between two colors. + + Start color. + End color. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the linear interpolation of the two colors. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a linear interpolation between two colors. + + Start color. + End color. + Value between 0 and 1 indicating the weight of . + The linear interpolation of the two colors. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a cubic interpolation between two colors. + + Start color. + End color. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the cubic interpolation of the two colors. + + + + Performs a cubic interpolation between two colors. + + Start color. + End color. + Value between 0 and 1 indicating the weight of . + The cubic interpolation of the two colors. + + + + Returns a color containing the smallest components of the specified colorss. + + The first source color. + The second source color. + When the method completes, contains an new color composed of the largest components of the source colorss. + + + + Returns a color containing the largest components of the specified colorss. + + The first source color. + The second source color. + A color containing the largest components of the source colors. + + + + Returns a color containing the smallest components of the specified colors. + + The first source color. + The second source color. + When the method completes, contains an new color composed of the smallest components of the source colors. + + + + Returns a color containing the smallest components of the specified colors. + + The first source color. + The second source color. + A color containing the smallest components of the source colors. + + + + Adjusts the contrast of a color. + + The color whose contrast is to be adjusted. + The amount by which to adjust the contrast. + When the method completes, contains the adjusted color. + + + + Adjusts the contrast of a color. + + The color whose contrast is to be adjusted. + The amount by which to adjust the contrast. + The adjusted color. + + + + Adjusts the saturation of a color. + + The color whose saturation is to be adjusted. + The amount by which to adjust the saturation. + When the method completes, contains the adjusted color. + + + + Adjusts the saturation of a color. + + The color whose saturation is to be adjusted. + The amount by which to adjust the saturation. + The adjusted color. + + + + Computes the premultiplied value of the provided color. + + The non-premultiplied value. + The premultiplied result. + + + + Computes the premultiplied value of the provided color. + + The non-premultiplied value. + The premultiplied result. + + + + Adds two colors. + + The first color to add. + The second color to add. + The sum of the two colors. + + + + Assert a color (return it unchanged). + + The color to assert (unchange). + The asserted (unchanged) color. + + + + Subtracts two colors. + + The first color to subtract. + The second color to subtract. + The difference of the two colors. + + + + Negates a color. + + The color to negate. + A negated color. + + + + Scales a color. + + The factor by which to scale the color. + The color to scale. + The scaled color. + + + + Scales a color. + + The factor by which to scale the color. + The color to scale. + The scaled color. + + + + Modulates two colors. + + The first color to modulate. + The second color to modulate. + The modulated color. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + + The result of the conversion. + + + + + Performs an explicit conversion from to . + + The value. + + The result of the conversion. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format to apply to each channel (byte). + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format to apply to each channel (byte). + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Describes the type of angle. + + + + + Specifies an angle measurement in revolutions. + + + + + Specifies an angle measurement in degrees. + + + + + Specifies an angle measurement in radians. + + + + + Specifies an angle measurement in gradians. + + + + + Describes how one bounding volume contains another. + + + + + The two bounding volumes don't intersect at all. + + + + + One bounding volume completely contains another. + + + + + The two bounding volumes overlap. + + + + + Describes the result of an intersection with a plane in three dimensions. + + + + + The object is behind the plane. + + + + + The object is in front of the plane. + + + + + The object is intersecting the plane. + + + + + Frustum camera parameters. + + + + + Position of the camera. + + + + + Looking at direction of the camera. + + + + + Up direction. + + + + + Field of view. + + + + + Z near distance. + + + + + Z far distance. + + + + + Aspect ratio. + + + + + A half precision (16 bit) floating point value. + + + + + Number of decimal digits of precision. + + + + + Number of bits in the mantissa. + + + + + Maximum decimal exponent. + + + + + Maximum binary exponent. + + + + + Minimum decimal exponent. + + + + + Minimum binary exponent. + + + + + Exponent radix. + + + + + Additional rounding. + + + + + Smallest such that 1.0 + epsilon != 1.0 + + + + + Maximum value of the number. + + + + + Minimum value of the number. + + + + + Initializes a new instance of the structure. + + The floating point value that should be stored in 16 bit format. + + + + Initializes a new instance of the structure. + + The floating point value that should be stored in 16 bit format. + + + + Gets or sets the raw 16 bit value used to back this half-float. + + + + + Converts an array of half precision values into full precision values. + + The values to be converted. + An array of converted values. + + + + Converts an array of full precision values into half precision values. + + The values to be converted. + An array of converted values. + + + + Performs an explicit conversion from to . + + The value to be converted. + The converted value. + + + + Performs an implicit conversion from to . + + The value to be converted. + The converted value. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + + true if has a different value than ; otherwise, false. + + + + Converts the value of the object to its equivalent string representation. + + The string representation of the value of this instance. + + + + Returns the hash code for this instance. + + A 32-bit signed integer hash code. + + + + Determines whether the specified object instances are considered equal. + + + + + true if is the same instance as or + if both are null references or if value1.Equals(value2) returns true; otherwise, false. + + + + Returns a value that indicates whether the current instance is equal to the specified object. + + Object to make the comparison with. + + true if the current instance is equal to the specified object; false otherwise. + + + + Returns a value that indicates whether the current instance is equal to a specified object. + + Object to make the comparison with. + + true if the current instance is equal to the specified object; false otherwise. + + + + Defines a two component vector, using half precision floating point coordinates. + + + + + Gets or sets the X component of the vector. + + The X component of the vector. + + + + Gets or sets the Y component of the vector. + + The Y component of the vector. + + + + Initializes a new instance of the structure. + + The X component. + The Y component. + + + + Initializes a new instance of the structure. + + The X component. + The Y component. + + + + Initializes a new instance of the structure. + + The X component. + The Y component. + + + + Initializes a new instance of the structure. + + The value to set for both the X and Y components. + + + + Initializes a new instance of the structure. + + Value to initialize X and Y components with. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + + true if has a different value than ; otherwise, false. + + + + Returns the hash code for this instance. + + A 32-bit signed integer hash code. + + + + Determines whether the specified object instances are considered equal. + + + + + true if is the same instance as or + if both are null references or if value1.Equals(value2) returns true; otherwise, false. + + + + Returns a value that indicates whether the current instance is equal to the specified object. + + Object to make the comparison with. + + true if the current instance is equal to the specified object; false otherwise. + + + + Returns a value that indicates whether the current instance is equal to a specified object. + + Object to make the comparison with. + + true if the current instance is equal to the specified object; false otherwise. + + + + Defines a three component vector, using half precision floating point coordinates. + + + + + Gets or sets the X component of the vector. + + The X component of the vector. + + + + Gets or sets the Y component of the vector. + + The Y component of the vector. + + + + Gets or sets the Z component of the vector. + + The Z component of the vector. + + + + Initializes a new instance of the structure. + + The X component. + The Y component. + The Z component. + + + + Initializes a new instance of the structure. + + The X component. + The Y component. + The Z component. + + + + Initializes a new instance of the structure. + + The X component. + The Y component. + The Z component. + + + + Initializes a new instance of the structure. + + The value to set for the X, Y, and Z components. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + + true if has a different value than ; otherwise, false. + + + + Returns the hash code for this instance. + + A 32-bit signed integer hash code. + + + + Determines whether the specified object instances are considered equal. + + + + + true if is the same instance as or + if both are null references or if value1.Equals(value2) returns true; otherwise, false. + + + + Returns a value that indicates whether the current instance is equal to the specified object. + + Object to make the comparison with. + + true if the current instance is equal to the specified object; false otherwise. + + + + Returns a value that indicates whether the current instance is equal to a specified object. + + Object to make the comparison with. + + true if the current instance is equal to the specified object; false otherwise. + + + + Defines a four component vector, using half precision floating point coordinates. + + + + + Gets or sets the X component of the vector. + + The X component of the vector. + + + + Gets or sets the Y component of the vector. + + The Y component of the vector. + + + + Gets or sets the Z component of the vector. + + The Z component of the vector. + + + + Gets or sets the W component of the vector. + + The W component of the vector. + + + + Initializes a new instance of the structure. + + The X component. + The Y component. + The Z component. + The W component. + + + + Initializes a new instance of the structure. + + The X component. + The Y component. + The Z component. + The W component. + + + + Initializes a new instance of the structure. + + The X component. + The Y component. + The Z component. + The W component. + + + + Initializes a new instance of the structure. + + The value to set for the X, Y, Z, and W components. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + + true if has a different value than ; otherwise, false. + + + + Returns the hash code for this instance. + + A 32-bit signed integer hash code. + + + + Determines whether the specified object instances are considered equal. + + + + + true if is the same instance as or + if both are null references or if value1.Equals(value2) returns true; otherwise, false. + + + + Returns a value that indicates whether the current instance is equal to the specified object. + + Object to make the comparison with. + + true if the current instance is equal to the specified object; false otherwise. + + + + Returns a value that indicates whether the current instance is equal to a specified object. + + Object to make the comparison with. + + true if the current instance is equal to the specified object; false otherwise. + + + + Helper class to perform Half/Float conversion. + Code extract from paper : www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf by Jeroen van der Zijp + + + + + Unpacks the specified h. + + The h. + + + + + Packs the specified f. + + The f. + + + + + Represents a three dimensional mathematical int vector. + + + + + The size of the type, in bytes. + + + + + A with all of its components set to zero. + + + + + The X unit (1, 0, 0). + + + + + The Y unit (0, 1, 0). + + + + + The Z unit (0, 0, 1). + + + + + A with all of its components set to one. + + + + + The X component of the vector. + + + + + The Y component of the vector. + + + + + The Z component of the vector. + + + + + Initializes a new instance of the struct. + + The value that will be assigned to all components. + + + + Initializes a new instance of the struct. + + Initial value for the X component of the vector. + Initial value for the Y component of the vector. + Initial value for the Z component of the vector. + + + + Initializes a new instance of the struct. + + The values to assign to the X, Y, Z, and W components of the vector. This must be an array with four elements. + Thrown when is null. + Thrown when contains more or less than four elements. + + + + Gets or sets the component at the specified index. + + The value of the X, Y, Z, or W component, depending on the index. + The index of the component to access. Use 0 for the X component, 1 for the Y component, 2 for the Z component, and 3 for the W component. + The value of the component at the specified index. + Thrown when the is out of the range [0, 3]. + + + + Creates an array containing the elements of the vector. + + A four-element array containing the components of the vector. + + + + Adds two vectors. + + The first vector to add. + The second vector to add. + When the method completes, contains the sum of the two vectors. + + + + Adds two vectors. + + The first vector to add. + The second vector to add. + The sum of the two vectors. + + + + Subtracts two vectors. + + The first vector to subtract. + The second vector to subtract. + When the method completes, contains the difference of the two vectors. + + + + Subtracts two vectors. + + The first vector to subtract. + The second vector to subtract. + The difference of the two vectors. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + When the method completes, contains the scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Modulates a vector with another by performing component-wise multiplication. + + The first vector to modulate. + The second vector to modulate. + When the method completes, contains the modulated vector. + + + + Modulates a vector with another by performing component-wise multiplication. + + The first vector to modulate. + The second vector to modulate. + The modulated vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + When the method completes, contains the scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Reverses the direction of a given vector. + + The vector to negate. + When the method completes, contains a vector facing in the opposite direction. + + + + Reverses the direction of a given vector. + + The vector to negate. + A vector facing in the opposite direction. + + + + Restricts a value to be within a specified range. + + The value to clamp. + The minimum value. + The maximum value. + When the method completes, contains the clamped value. + + + + Restricts a value to be within a specified range. + + The value to clamp. + The minimum value. + The maximum value. + The clamped value. + + + + Returns a vector containing the smallest components of the specified vectors. + + The first source vector. + The second source vector. + When the method completes, contains an new vector composed of the largest components of the source vectors. + + + + Returns a vector containing the largest components of the specified vectors. + + The first source vector. + The second source vector. + A vector containing the largest components of the source vectors. + + + + Returns a vector containing the smallest components of the specified vectors. + + The first source vector. + The second source vector. + When the method completes, contains an new vector composed of the smallest components of the source vectors. + + + + Returns a vector containing the smallest components of the specified vectors. + + The first source vector. + The second source vector. + A vector containing the smallest components of the source vectors. + + + + Adds two vectors. + + The first vector to add. + The second vector to add. + The sum of the two vectors. + + + + Assert a vector (return it unchanged). + + The vector to assert (unchanged). + The asserted (unchanged) vector. + + + + Subtracts two vectors. + + The first vector to subtract. + The second vector to subtract. + The difference of the two vectors. + + + + Reverses the direction of a given vector. + + The vector to negate. + A vector facing in the opposite direction. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Performs an implicit conversion from array to . + + The input. + The result of the conversion. + + + + Performs an implicit conversion from to array. + + The input. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Represents a four dimensional mathematical vector. + + + + + The size of the type, in bytes. + + + + + A with all of its components set to zero. + + + + + The X unit (1, 0, 0, 0). + + + + + The Y unit (0, 1, 0, 0). + + + + + The Z unit (0, 0, 1, 0). + + + + + The W unit (0, 0, 0, 1). + + + + + A with all of its components set to one. + + + + + The X component of the vector. + + + + + The Y component of the vector. + + + + + The Z component of the vector. + + + + + The W component of the vector. + + + + + Initializes a new instance of the struct. + + The value that will be assigned to all components. + + + + Initializes a new instance of the struct. + + Initial value for the X component of the vector. + Initial value for the Y component of the vector. + Initial value for the Z component of the vector. + Initial value for the W component of the vector. + + + + Initializes a new instance of the struct. + + The values to assign to the X, Y, Z, and W components of the vector. This must be an array with four elements. + Thrown when is null. + Thrown when contains more or less than four elements. + + + + Gets or sets the component at the specified index. + + The value of the X, Y, Z, or W component, depending on the index. + The index of the component to access. Use 0 for the X component, 1 for the Y component, 2 for the Z component, and 3 for the W component. + The value of the component at the specified index. + Thrown when the is out of the range [0, 3]. + + + + Creates an array containing the elements of the vector. + + A four-element array containing the components of the vector. + + + + Adds two vectors. + + The first vector to add. + The second vector to add. + When the method completes, contains the sum of the two vectors. + + + + Adds two vectors. + + The first vector to add. + The second vector to add. + The sum of the two vectors. + + + + Subtracts two vectors. + + The first vector to subtract. + The second vector to subtract. + When the method completes, contains the difference of the two vectors. + + + + Subtracts two vectors. + + The first vector to subtract. + The second vector to subtract. + The difference of the two vectors. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + When the method completes, contains the scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Modulates a vector with another by performing component-wise multiplication. + + The first vector to modulate. + The second vector to modulate. + When the method completes, contains the modulated vector. + + + + Modulates a vector with another by performing component-wise multiplication. + + The first vector to modulate. + The second vector to modulate. + The modulated vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + When the method completes, contains the scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Reverses the direction of a given vector. + + The vector to negate. + When the method completes, contains a vector facing in the opposite direction. + + + + Reverses the direction of a given vector. + + The vector to negate. + A vector facing in the opposite direction. + + + + Restricts a value to be within a specified range. + + The value to clamp. + The minimum value. + The maximum value. + When the method completes, contains the clamped value. + + + + Restricts a value to be within a specified range. + + The value to clamp. + The minimum value. + The maximum value. + The clamped value. + + + + Returns a vector containing the smallest components of the specified vectors. + + The first source vector. + The second source vector. + When the method completes, contains an new vector composed of the largest components of the source vectors. + + + + Returns a vector containing the largest components of the specified vectors. + + The first source vector. + The second source vector. + A vector containing the largest components of the source vectors. + + + + Returns a vector containing the smallest components of the specified vectors. + + The first source vector. + The second source vector. + When the method completes, contains an new vector composed of the smallest components of the source vectors. + + + + Returns a vector containing the smallest components of the specified vectors. + + The first source vector. + The second source vector. + A vector containing the smallest components of the source vectors. + + + + Adds two vectors. + + The first vector to add. + The second vector to add. + The sum of the two vectors. + + + + Assert a vector (return it unchanged). + + The vector to assert (unchanged). + The asserted (unchanged) vector. + + + + Subtracts two vectors. + + The first vector to subtract. + The second vector to subtract. + The difference of the two vectors. + + + + Reverses the direction of a given vector. + + The vector to negate. + A vector facing in the opposite direction. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Performs an implicit conversion from array to . + + The input. + The result of the conversion. + + + + Performs an implicit conversion from to array. + + The input. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + The value for which all absolute numbers smaller than are considered equal to zero. + + + + + A value specifying the approximation of マ which is 180 degrees. + + + + + A value specifying the approximation of 2マ which is 360 degrees. + + + + + A value specifying the approximation of マ/2 which is 90 degrees. + + + + + A value specifying the approximation of マ/4 which is 45 degrees. + + + + + Checks if a and b are almost equals, taking into account the magnitude of floating point numbers (unlike method). See Remarks. + See remarks. + + The left value to compare. + The right value to compare. + true if a almost equal to b, false otherwise + + The code is using the technique described by Bruce Dawson in + Comparing Floating point numbers 2012 edition. + + + + + Determines whether the specified value is close to zero (0.0f). + + The floating value. + true if the specified value is close to zero (0.0f); otherwise, false. + + + + Determines whether the specified value is close to one (1.0f). + + The floating value. + true if the specified value is close to one (1.0f); otherwise, false. + + + + Checks if a - b are almost equals within a float epsilon. + + The left value to compare. + The right value to compare. + Epsilon value + true if a almost equal to b within a float epsilon, false otherwise + + + + Converts revolutions to degrees. + + The value to convert. + The converted value. + + + + Converts revolutions to radians. + + The value to convert. + The converted value. + + + + Converts revolutions to gradians. + + The value to convert. + The converted value. + + + + Converts degrees to revolutions. + + The value to convert. + The converted value. + + + + Converts degrees to radians. + + The value to convert. + The converted value. + + + + Converts radians to revolutions. + + The value to convert. + The converted value. + + + + Converts radians to gradians. + + The value to convert. + The converted value. + + + + Converts gradians to revolutions. + + The value to convert. + The converted value. + + + + Converts gradians to degrees. + + The value to convert. + The converted value. + + + + Converts gradians to radians. + + The value to convert. + The converted value. + + + + Converts radians to degrees. + + The value to convert. + The converted value. + + + + Clamps the specified value. + + The value. + The min. + The max. + The result of clamping a value between min and max + + + + Clamps the specified value. + + The value. + The min. + The max. + The result of clamping a value between min and max + + + + Interpolates between two values using a linear function by a given amount. + + + See http://www.encyclopediaofmath.org/index.php/Linear_interpolation and + http://fgiesen.wordpress.com/2012/08/15/linear-interpolation-past-present-and-future/ + + Value to interpolate from. + Value to interpolate to. + Interpolation amount. + The result of linear interpolation of values based on the amount. + + + + Interpolates between two values using a linear function by a given amount. + + + See http://www.encyclopediaofmath.org/index.php/Linear_interpolation and + http://fgiesen.wordpress.com/2012/08/15/linear-interpolation-past-present-and-future/ + + Value to interpolate from. + Value to interpolate to. + Interpolation amount. + The result of linear interpolation of values based on the amount. + + + + Interpolates between two values using a linear function by a given amount. + + + See http://www.encyclopediaofmath.org/index.php/Linear_interpolation and + http://fgiesen.wordpress.com/2012/08/15/linear-interpolation-past-present-and-future/ + + Value to interpolate from. + Value to interpolate to. + Interpolation amount. + The result of linear interpolation of values based on the amount. + + + + Performs smooth (cubic Hermite) interpolation between 0 and 1. + + + See https://en.wikipedia.org/wiki/Smoothstep + + Value between 0 and 1 indicating interpolation amount. + + + + Performs a smooth(er) interpolation between 0 and 1 with 1st and 2nd order derivatives of zero at endpoints. + + + See https://en.wikipedia.org/wiki/Smoothstep + + Value between 0 and 1 indicating interpolation amount. + + + + Calculates the modulo of the specified value. + + The value. + The modulo. + The result of the modulo applied to value + + + + Calculates the modulo 2*PI of the specified value. + + The value. + The result of the modulo applied to value + + + + Wraps the specified value into a range [min, max] + + The value to wrap. + The min. + The max. + Result of the wrapping. + Is thrown when is greater than . + + + + Wraps the specified value into a range [min, max[ + + The value. + The min. + The max. + Result of the wrapping. + Is thrown when is greater than . + + + + Gauss function. + http://en.wikipedia.org/wiki/Gaussian_function#Two-dimensional_Gaussian_function + + Curve amplitude. + Position X. + Position Y + Center X. + Center Y. + Curve sigma X. + Curve sigma Y. + The result of Gaussian function. + + + + Gauss function. + http://en.wikipedia.org/wiki/Gaussian_function#Two-dimensional_Gaussian_function + + Curve amplitude. + Position X. + Position Y + Center X. + Center Y. + Curve sigma X. + Curve sigma Y. + The result of Gaussian function. + + + + Represents a 4x4 mathematical matrix. + + + + + The size of the type, in bytes. + + + + + A with all of its components set to zero. + + + + + The identity . + + + + + Value at row 1 column 1 of the matrix. + + + + + Value at row 1 column 2 of the matrix. + + + + + Value at row 1 column 3 of the matrix. + + + + + Value at row 1 column 4 of the matrix. + + + + + Value at row 2 column 1 of the matrix. + + + + + Value at row 2 column 2 of the matrix. + + + + + Value at row 2 column 3 of the matrix. + + + + + Value at row 2 column 4 of the matrix. + + + + + Value at row 3 column 1 of the matrix. + + + + + Value at row 3 column 2 of the matrix. + + + + + Value at row 3 column 3 of the matrix. + + + + + Value at row 3 column 4 of the matrix. + + + + + Value at row 4 column 1 of the matrix. + + + + + Value at row 4 column 2 of the matrix. + + + + + Value at row 4 column 3 of the matrix. + + + + + Value at row 4 column 4 of the matrix. + + + + + Gets or sets the up of the matrix; that is M21, M22, and M23. + + + + + Gets or sets the down of the matrix; that is -M21, -M22, and -M23. + + + + + Gets or sets the right of the matrix; that is M11, M12, and M13. + + + + + Gets or sets the left of the matrix; that is -M11, -M12, and -M13. + + + + + Gets or sets the forward of the matrix; that is -M31, -M32, and -M33. + + + + + Gets or sets the backward of the matrix; that is M31, M32, and M33. + + + + + Initializes a new instance of the struct. + + The value that will be assigned to all components. + + + + Initializes a new instance of the struct. + + The value to assign at row 1 column 1 of the matrix. + The value to assign at row 1 column 2 of the matrix. + The value to assign at row 1 column 3 of the matrix. + The value to assign at row 1 column 4 of the matrix. + The value to assign at row 2 column 1 of the matrix. + The value to assign at row 2 column 2 of the matrix. + The value to assign at row 2 column 3 of the matrix. + The value to assign at row 2 column 4 of the matrix. + The value to assign at row 3 column 1 of the matrix. + The value to assign at row 3 column 2 of the matrix. + The value to assign at row 3 column 3 of the matrix. + The value to assign at row 3 column 4 of the matrix. + The value to assign at row 4 column 1 of the matrix. + The value to assign at row 4 column 2 of the matrix. + The value to assign at row 4 column 3 of the matrix. + The value to assign at row 4 column 4 of the matrix. + + + + Initializes a new instance of the struct. + + The values to assign to the components of the matrix. This must be an array with sixteen elements. + Thrown when is null. + Thrown when contains more or less than sixteen elements. + + + + Gets or sets the first row in the matrix; that is M11, M12, M13, and M14. + + + + + Gets or sets the second row in the matrix; that is M21, M22, M23, and M24. + + + + + Gets or sets the third row in the matrix; that is M31, M32, M33, and M34. + + + + + Gets or sets the fourth row in the matrix; that is M41, M42, M43, and M44. + + + + + Gets or sets the first column in the matrix; that is M11, M21, M31, and M41. + + + + + Gets or sets the second column in the matrix; that is M12, M22, M32, and M42. + + + + + Gets or sets the third column in the matrix; that is M13, M23, M33, and M43. + + + + + Gets or sets the fourth column in the matrix; that is M14, M24, M34, and M44. + + + + + Gets or sets the translation of the matrix; that is M41, M42, and M43. + + + + + Gets or sets the scale of the matrix; that is M11, M22, and M33. + + + + + Gets a value indicating whether this instance is an identity matrix. + + + true if this instance is an identity matrix; otherwise, false. + + + + + Gets or sets the component at the specified index. + + The value of the matrix component, depending on the index. + The zero-based index of the component to access. + The value of the component at the specified index. + Thrown when the is out of the range [0, 15]. + + + + Gets or sets the component at the specified index. + + The value of the matrix component, depending on the index. + The row of the matrix to access. + The column of the matrix to access. + The value of the component at the specified index. + Thrown when the or is out of the range [0, 3]. + + + + Calculates the determinant of the matrix. + + The determinant of the matrix. + + + + Inverts the matrix. + + + + + Transposes the matrix. + + + + + Orthogonalizes the specified matrix. + + + Orthogonalization is the process of making all rows orthogonal to each other. This + means that any given row in the matrix will be orthogonal to any other given row in the + matrix. + Because this method uses the modified Gram-Schmidt process, the resulting matrix + tends to be numerically unstable. The numeric stability decreases according to the rows + so that the first row is the most stable and the last row is the least stable. + This operation is performed on the rows of the matrix rather than the columns. + If you wish for this operation to be performed on the columns, first transpose the + input and than transpose the output. + + + + + Orthonormalizes the specified matrix. + + + Orthonormalization is the process of making all rows and columns orthogonal to each + other and making all rows and columns of unit length. This means that any given row will + be orthogonal to any other given row and any given column will be orthogonal to any other + given column. Any given row will not be orthogonal to any given column. Every row and every + column will be of unit length. + Because this method uses the modified Gram-Schmidt process, the resulting matrix + tends to be numerically unstable. The numeric stability decreases according to the rows + so that the first row is the most stable and the last row is the least stable. + This operation is performed on the rows of the matrix rather than the columns. + If you wish for this operation to be performed on the columns, first transpose the + input and than transpose the output. + + + + + Decomposes a matrix into an orthonormalized matrix Q and a right triangular matrix R. + + When the method completes, contains the orthonormalized matrix of the decomposition. + When the method completes, contains the right triangular matrix of the decomposition. + + + + Decomposes a matrix into a lower triangular matrix L and an orthonormalized matrix Q. + + When the method completes, contains the lower triangular matrix of the decomposition. + When the method completes, contains the orthonormalized matrix of the decomposition. + + + + Decomposes a matrix into a scale, rotation, and translation. + + When the method completes, contains the scaling component of the decomposed matrix. + When the method completes, contains the rotation component of the decomposed matrix. + When the method completes, contains the translation component of the decomposed matrix. + + This method is designed to decompose an SRT transformation matrix only. + + + + + Decomposes a uniform scale matrix into a scale, rotation, and translation. + A uniform scale matrix has the same scale in every axis. + + When the method completes, contains the scaling component of the decomposed matrix. + When the method completes, contains the rotation component of the decomposed matrix. + When the method completes, contains the translation component of the decomposed matrix. + + This method is designed to decompose only an SRT transformation matrix that has the same scale in every axis. + + + + + Exchanges two rows in the matrix. + + The first row to exchange. This is an index of the row starting at zero. + The second row to exchange. This is an index of the row starting at zero. + + + + Exchanges two columns in the matrix. + + The first column to exchange. This is an index of the column starting at zero. + The second column to exchange. This is an index of the column starting at zero. + + + + Creates an array containing the elements of the matrix. + + A sixteen-element array containing the components of the matrix. + + + + Determines the sum of two matrices. + + The first matrix to add. + The second matrix to add. + When the method completes, contains the sum of the two matrices. + + + + Determines the sum of two matrices. + + The first matrix to add. + The second matrix to add. + The sum of the two matrices. + + + + Determines the difference between two matrices. + + The first matrix to subtract. + The second matrix to subtract. + When the method completes, contains the difference between the two matrices. + + + + Determines the difference between two matrices. + + The first matrix to subtract. + The second matrix to subtract. + The difference between the two matrices. + + + + Scales a matrix by the given value. + + The matrix to scale. + The amount by which to scale. + When the method completes, contains the scaled matrix. + + + + Scales a matrix by the given value. + + The matrix to scale. + The amount by which to scale. + The scaled matrix. + + + + Determines the product of two matrices. + + The first matrix to multiply. + The second matrix to multiply. + The product of the two matrices. + + + + Determines the product of two matrices. + + The first matrix to multiply. + The second matrix to multiply. + The product of the two matrices. + + + + Scales a matrix by the given value. + + The matrix to scale. + The amount by which to scale. + When the method completes, contains the scaled matrix. + + + + Scales a matrix by the given value. + + The matrix to scale. + The amount by which to scale. + The scaled matrix. + + + + Determines the quotient of two matrices. + + The first matrix to divide. + The second matrix to divide. + When the method completes, contains the quotient of the two matrices. + + + + Determines the quotient of two matrices. + + The first matrix to divide. + The second matrix to divide. + The quotient of the two matrices. + + + + Performs the exponential operation on a matrix. + + The matrix to perform the operation on. + The exponent to raise the matrix to. + When the method completes, contains the exponential matrix. + Thrown when the is negative. + + + + Performs the exponential operation on a matrix. + + The matrix to perform the operation on. + The exponent to raise the matrix to. + The exponential matrix. + Thrown when the is negative. + + + + Negates a matrix. + + The matrix to be negated. + When the method completes, contains the negated matrix. + + + + Negates a matrix. + + The matrix to be negated. + The negated matrix. + + + + Performs a linear interpolation between two matrices. + + Start matrix. + End matrix. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the linear interpolation of the two matrices. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a linear interpolation between two matrices. + + Start matrix. + End matrix. + Value between 0 and 1 indicating the weight of . + The linear interpolation of the two matrices. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a cubic interpolation between two matrices. + + Start matrix. + End matrix. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the cubic interpolation of the two matrices. + + + + Performs a cubic interpolation between two matrices. + + Start matrix. + End matrix. + Value between 0 and 1 indicating the weight of . + The cubic interpolation of the two matrices. + + + + Calculates the transpose of the specified matrix. + + The matrix whose transpose is to be calculated. + When the method completes, contains the transpose of the specified matrix. + + + + Calculates the transpose of the specified matrix. + + The matrix whose transpose is to be calculated. + When the method completes, contains the transpose of the specified matrix. + + + + Calculates the transpose of the specified matrix. + + The matrix whose transpose is to be calculated. + The transpose of the specified matrix. + + + + Calculates the inverse of the specified matrix. + + The matrix whose inverse is to be calculated. + When the method completes, contains the inverse of the specified matrix. + + + + Calculates the inverse of the specified matrix. + + The matrix whose inverse is to be calculated. + The inverse of the specified matrix. + + + + Orthogonalizes the specified matrix. + + The matrix to orthogonalize. + When the method completes, contains the orthogonalized matrix. + + Orthogonalization is the process of making all rows orthogonal to each other. This + means that any given row in the matrix will be orthogonal to any other given row in the + matrix. + Because this method uses the modified Gram-Schmidt process, the resulting matrix + tends to be numerically unstable. The numeric stability decreases according to the rows + so that the first row is the most stable and the last row is the least stable. + This operation is performed on the rows of the matrix rather than the columns. + If you wish for this operation to be performed on the columns, first transpose the + input and than transpose the output. + + + + + Orthogonalizes the specified matrix. + + The matrix to orthogonalize. + The orthogonalized matrix. + + Orthogonalization is the process of making all rows orthogonal to each other. This + means that any given row in the matrix will be orthogonal to any other given row in the + matrix. + Because this method uses the modified Gram-Schmidt process, the resulting matrix + tends to be numerically unstable. The numeric stability decreases according to the rows + so that the first row is the most stable and the last row is the least stable. + This operation is performed on the rows of the matrix rather than the columns. + If you wish for this operation to be performed on the columns, first transpose the + input and than transpose the output. + + + + + Orthonormalizes the specified matrix. + + The matrix to orthonormalize. + When the method completes, contains the orthonormalized matrix. + + Orthonormalization is the process of making all rows and columns orthogonal to each + other and making all rows and columns of unit length. This means that any given row will + be orthogonal to any other given row and any given column will be orthogonal to any other + given column. Any given row will not be orthogonal to any given column. Every row and every + column will be of unit length. + Because this method uses the modified Gram-Schmidt process, the resulting matrix + tends to be numerically unstable. The numeric stability decreases according to the rows + so that the first row is the most stable and the last row is the least stable. + This operation is performed on the rows of the matrix rather than the columns. + If you wish for this operation to be performed on the columns, first transpose the + input and than transpose the output. + + + + + Orthonormalizes the specified matrix. + + The matrix to orthonormalize. + The orthonormalized matrix. + + Orthonormalization is the process of making all rows and columns orthogonal to each + other and making all rows and columns of unit length. This means that any given row will + be orthogonal to any other given row and any given column will be orthogonal to any other + given column. Any given row will not be orthogonal to any given column. Every row and every + column will be of unit length. + Because this method uses the modified Gram-Schmidt process, the resulting matrix + tends to be numerically unstable. The numeric stability decreases according to the rows + so that the first row is the most stable and the last row is the least stable. + This operation is performed on the rows of the matrix rather than the columns. + If you wish for this operation to be performed on the columns, first transpose the + input and than transpose the output. + + + + + Brings the matrix into upper triangular form using elementary row operations. + + The matrix to put into upper triangular form. + When the method completes, contains the upper triangular matrix. + + If the matrix is not invertible (i.e. its determinant is zero) than the result of this + method may produce Single.Nan and Single.Inf values. When the matrix represents a system + of linear equations, than this often means that either no solution exists or an infinite + number of solutions exist. + + + + + Brings the matrix into upper triangular form using elementary row operations. + + The matrix to put into upper triangular form. + The upper triangular matrix. + + If the matrix is not invertible (i.e. its determinant is zero) than the result of this + method may produce Single.Nan and Single.Inf values. When the matrix represents a system + of linear equations, than this often means that either no solution exists or an infinite + number of solutions exist. + + + + + Brings the matrix into lower triangular form using elementary row operations. + + The matrix to put into lower triangular form. + When the method completes, contains the lower triangular matrix. + + If the matrix is not invertible (i.e. its determinant is zero) than the result of this + method may produce Single.Nan and Single.Inf values. When the matrix represents a system + of linear equations, than this often means that either no solution exists or an infinite + number of solutions exist. + + + + + Brings the matrix into lower triangular form using elementary row operations. + + The matrix to put into lower triangular form. + The lower triangular matrix. + + If the matrix is not invertible (i.e. its determinant is zero) than the result of this + method may produce Single.Nan and Single.Inf values. When the matrix represents a system + of linear equations, than this often means that either no solution exists or an infinite + number of solutions exist. + + + + + Brings the matrix into row echelon form using elementary row operations; + + The matrix to put into row echelon form. + When the method completes, contains the row echelon form of the matrix. + + + + Brings the matrix into row echelon form using elementary row operations; + + The matrix to put into row echelon form. + When the method completes, contains the row echelon form of the matrix. + + + + Brings the matrix into reduced row echelon form using elementary row operations. + + The matrix to put into reduced row echelon form. + The fifth column of the matrix. + When the method completes, contains the resultant matrix after the operation. + When the method completes, contains the resultant fifth column of the matrix. + + The fifth column is often called the augmented part of the matrix. This is because the fifth + column is really just an extension of the matrix so that there is a place to put all of the + non-zero components after the operation is complete. + Often times the resultant matrix will the identity matrix or a matrix similar to the identity + matrix. Sometimes, however, that is not possible and numbers other than zero and one may appear. + This method can be used to solve systems of linear equations. Upon completion of this method, + the will contain the solution for the system. It is up to the user + to analyze both the input and the result to determine if a solution really exists. + + + + + Creates a left-handed spherical billboard that rotates around a specified object position. + + The position of the object around which the billboard will rotate. + The position of the camera. + The up vector of the camera. + The forward vector of the camera. + When the method completes, contains the created billboard matrix. + + + + Creates a left-handed spherical billboard that rotates around a specified object position. + + The position of the object around which the billboard will rotate. + The position of the camera. + The up vector of the camera. + The forward vector of the camera. + The created billboard matrix. + + + + Creates a right-handed spherical billboard that rotates around a specified object position. + + The position of the object around which the billboard will rotate. + The position of the camera. + The up vector of the camera. + The forward vector of the camera. + When the method completes, contains the created billboard matrix. + + + + Creates a right-handed spherical billboard that rotates around a specified object position. + + The position of the object around which the billboard will rotate. + The position of the camera. + The up vector of the camera. + The forward vector of the camera. + The created billboard matrix. + + + + Creates a left-handed, look-at matrix. + + The position of the viewer's eye. + The camera look-at target. + The camera's up vector. + When the method completes, contains the created look-at matrix. + + + + Creates a left-handed, look-at matrix. + + The position of the viewer's eye. + The camera look-at target. + The camera's up vector. + The created look-at matrix. + + + + Creates a right-handed, look-at matrix. + + The position of the viewer's eye. + The camera look-at target. + The camera's up vector. + When the method completes, contains the created look-at matrix. + + + + Creates a right-handed, look-at matrix. + + The position of the viewer's eye. + The camera look-at target. + The camera's up vector. + The created look-at matrix. + + + + Creates a left-handed, orthographic projection matrix. + + Width of the viewing volume. + Height of the viewing volume. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + When the method completes, contains the created projection matrix. + + + + Creates a left-handed, orthographic projection matrix. + + Width of the viewing volume. + Height of the viewing volume. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + The created projection matrix. + + + + Creates a right-handed, orthographic projection matrix. + + Width of the viewing volume. + Height of the viewing volume. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + When the method completes, contains the created projection matrix. + + + + Creates a right-handed, orthographic projection matrix. + + Width of the viewing volume. + Height of the viewing volume. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + The created projection matrix. + + + + Creates a left-handed, customized orthographic projection matrix. + + Minimum x-value of the viewing volume. + Maximum x-value of the viewing volume. + Minimum y-value of the viewing volume. + Maximum y-value of the viewing volume. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + When the method completes, contains the created projection matrix. + + + + Creates a left-handed, customized orthographic projection matrix. + + Minimum x-value of the viewing volume. + Maximum x-value of the viewing volume. + Minimum y-value of the viewing volume. + Maximum y-value of the viewing volume. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + The created projection matrix. + + + + Creates a right-handed, customized orthographic projection matrix. + + Minimum x-value of the viewing volume. + Maximum x-value of the viewing volume. + Minimum y-value of the viewing volume. + Maximum y-value of the viewing volume. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + When the method completes, contains the created projection matrix. + + + + Creates a right-handed, customized orthographic projection matrix. + + Minimum x-value of the viewing volume. + Maximum x-value of the viewing volume. + Minimum y-value of the viewing volume. + Maximum y-value of the viewing volume. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + The created projection matrix. + + + + Creates a left-handed, perspective projection matrix. + + Width of the viewing volume. + Height of the viewing volume. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + When the method completes, contains the created projection matrix. + + + + Creates a left-handed, perspective projection matrix. + + Width of the viewing volume. + Height of the viewing volume. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + The created projection matrix. + + + + Creates a right-handed, perspective projection matrix. + + Width of the viewing volume. + Height of the viewing volume. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + When the method completes, contains the created projection matrix. + + + + Creates a right-handed, perspective projection matrix. + + Width of the viewing volume. + Height of the viewing volume. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + The created projection matrix. + + + + Creates a left-handed, perspective projection matrix based on a field of view. + + Field of view in the y direction, in radians. + Aspect ratio, defined as view space width divided by height. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + When the method completes, contains the created projection matrix. + + + + Creates a left-handed, perspective projection matrix based on a field of view. + + Field of view in the y direction, in radians. + Aspect ratio, defined as view space width divided by height. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + The created projection matrix. + + + + Creates a right-handed, perspective projection matrix based on a field of view. + + Field of view in the y direction, in radians. + Aspect ratio, defined as view space width divided by height. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + When the method completes, contains the created projection matrix. + + + + Creates a right-handed, perspective projection matrix based on a field of view. + + Field of view in the y direction, in radians. + Aspect ratio, defined as view space width divided by height. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + The created projection matrix. + + + + Creates a left-handed, customized perspective projection matrix. + + Minimum x-value of the viewing volume. + Maximum x-value of the viewing volume. + Minimum y-value of the viewing volume. + Maximum y-value of the viewing volume. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + When the method completes, contains the created projection matrix. + + + + Creates a left-handed, customized perspective projection matrix. + + Minimum x-value of the viewing volume. + Maximum x-value of the viewing volume. + Minimum y-value of the viewing volume. + Maximum y-value of the viewing volume. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + The created projection matrix. + + + + Creates a right-handed, customized perspective projection matrix. + + Minimum x-value of the viewing volume. + Maximum x-value of the viewing volume. + Minimum y-value of the viewing volume. + Maximum y-value of the viewing volume. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + When the method completes, contains the created projection matrix. + + + + Creates a right-handed, customized perspective projection matrix. + + Minimum x-value of the viewing volume. + Maximum x-value of the viewing volume. + Minimum y-value of the viewing volume. + Maximum y-value of the viewing volume. + Minimum z-value of the viewing volume. + Maximum z-value of the viewing volume. + The created projection matrix. + + + + Creates a matrix that scales along the x-axis, y-axis, and y-axis. + + Scaling factor for all three axes. + When the method completes, contains the created scaling matrix. + + + + Creates a matrix that scales along the x-axis, y-axis, and y-axis. + + Scaling factor for all three axes. + The created scaling matrix. + + + + Creates a matrix that scales along the x-axis, y-axis, and y-axis. + + Scaling factor that is applied along the x-axis. + Scaling factor that is applied along the y-axis. + Scaling factor that is applied along the z-axis. + When the method completes, contains the created scaling matrix. + + + + Creates a matrix that scales along the x-axis, y-axis, and y-axis. + + Scaling factor that is applied along the x-axis. + Scaling factor that is applied along the y-axis. + Scaling factor that is applied along the z-axis. + The created scaling matrix. + + + + Creates a matrix that uniformly scales along all three axis. + + The uniform scale that is applied along all axis. + When the method completes, contains the created scaling matrix. + + + + Creates a matrix that uniformly scales along all three axis. + + The uniform scale that is applied along all axis. + The created scaling matrix. + + + + Creates a matrix that rotates around the x-axis. + + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. + When the method completes, contains the created rotation matrix. + + + + Creates a matrix that rotates around the x-axis. + + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. + The created rotation matrix. + + + + Creates a matrix that rotates around the y-axis. + + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. + When the method completes, contains the created rotation matrix. + + + + Creates a matrix that rotates around the y-axis. + + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. + The created rotation matrix. + + + + Creates a matrix that rotates around the z-axis. + + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. + When the method completes, contains the created rotation matrix. + + + + Creates a matrix that rotates around the z-axis. + + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. + The created rotation matrix. + + + + Creates a matrix that rotates around an arbitrary axis. + + The axis around which to rotate. This parameter is assumed to be normalized. + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. + When the method completes, contains the created rotation matrix. + + + + Creates a matrix that rotates around an arbitrary axis. + + The axis around which to rotate. This parameter is assumed to be normalized. + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. + The created rotation matrix. + + + + Creates a rotation matrix from a quaternion. + + The quaternion to use to build the matrix. + The created rotation matrix. + + + + Creates a rotation matrix from a quaternion. + + The quaternion to use to build the matrix. + The created rotation matrix. + + + + Creates a rotation matrix with a specified yaw, pitch, and roll. + + Yaw around the y-axis, in radians. + Pitch around the x-axis, in radians. + Roll around the z-axis, in radians. + When the method completes, contains the created rotation matrix. + + + + Creates a rotation matrix with a specified yaw, pitch, and roll. + + Yaw around the y-axis, in radians. + Pitch around the x-axis, in radians. + Roll around the z-axis, in radians. + The created rotation matrix. + + + + Creates a translation matrix using the specified offsets. + + The offset for all three coordinate planes. + When the method completes, contains the created translation matrix. + + + + Creates a translation matrix using the specified offsets. + + The offset for all three coordinate planes. + The created translation matrix. + + + + Creates a translation matrix using the specified offsets. + + X-coordinate offset. + Y-coordinate offset. + Z-coordinate offset. + When the method completes, contains the created translation matrix. + + + + Creates a translation matrix using the specified offsets. + + X-coordinate offset. + Y-coordinate offset. + Z-coordinate offset. + The created translation matrix. + + + + Creates a skew/shear matrix by means of a translation vector, a rotation vector, and a rotation angle. + shearing is performed in the direction of translation vector, where translation vector and rotation vector define the shearing plane. + The effect is such that the skewed rotation vector has the specified angle with rotation itself. + + The rotation angle. + The rotation vector + The translation vector + Contains the created skew/shear matrix. + + + + Creates a 3D affine transformation matrix. + + Scaling factor. + The rotation of the transformation. + The translation factor of the transformation. + When the method completes, contains the created affine transformation matrix. + + + + Creates a 3D affine transformation matrix. + + Scaling factor. + The rotation of the transformation. + The translation factor of the transformation. + The created affine transformation matrix. + + + + Creates a 3D affine transformation matrix. + + Scaling factor. + The center of the rotation. + The rotation of the transformation. + The translation factor of the transformation. + When the method completes, contains the created affine transformation matrix. + + + + Creates a 3D affine transformation matrix. + + Scaling factor. + The center of the rotation. + The rotation of the transformation. + The translation factor of the transformation. + The created affine transformation matrix. + + + + Creates a 2D affine transformation matrix. + + Scaling factor. + The rotation of the transformation. + The translation factor of the transformation. + When the method completes, contains the created affine transformation matrix. + + + + Creates a 2D affine transformation matrix. + + Scaling factor. + The rotation of the transformation. + The translation factor of the transformation. + The created affine transformation matrix. + + + + Creates a 2D affine transformation matrix. + + Scaling factor. + The center of the rotation. + The rotation of the transformation. + The translation factor of the transformation. + When the method completes, contains the created affine transformation matrix. + + + + Creates a 2D affine transformation matrix. + + Scaling factor. + The center of the rotation. + The rotation of the transformation. + The translation factor of the transformation. + The created affine transformation matrix. + + + + Creates a transformation matrix. + + Center point of the scaling operation. + Scaling rotation amount. + Scaling factor. + The center of the rotation. + The rotation of the transformation. + The translation factor of the transformation. + When the method completes, contains the created transformation matrix. + + + + Creates a transformation matrix. + + Center point of the scaling operation. + Scaling rotation amount. + Scaling factor. + The center of the rotation. + The rotation of the transformation. + The translation factor of the transformation. + The created transformation matrix. + + + + Creates a 2D transformation matrix. + + Center point of the scaling operation. + Scaling rotation amount. + Scaling factor. + The center of the rotation. + The rotation of the transformation. + The translation factor of the transformation. + When the method completes, contains the created transformation matrix. + + + + Creates a 2D transformation matrix. + + Center point of the scaling operation. + Scaling rotation amount. + Scaling factor. + The center of the rotation. + The rotation of the transformation. + The translation factor of the transformation. + The created transformation matrix. + + + + Adds two matrices. + + The first matrix to add. + The second matrix to add. + The sum of the two matrices. + + + + Assert a matrix (return it unchanged). + + The matrix to assert (unchanged). + The asserted (unchanged) matrix. + + + + Subtracts two matrices. + + The first matrix to subtract. + The second matrix to subtract. + The difference between the two matrices. + + + + Negates a matrix. + + The matrix to negate. + The negated matrix. + + + + Scales a matrix by a given value. + + The matrix to scale. + The amount by which to scale. + The scaled matrix. + + + + Scales a matrix by a given value. + + The matrix to scale. + The amount by which to scale. + The scaled matrix. + + + + Multiplies two matrices. + + The first matrix to multiply. + The second matrix to multiply. + The product of the two matrices. + + + + Scales a matrix by a given value. + + The matrix to scale. + The amount by which to scale. + The scaled matrix. + + + + Divides two matrices. + + The first matrix to divide. + The second matrix to divide. + The quotient of the two matrices. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Direct2D Matrix3x2. Supports implicit cast from . + + + + + Gets the identity matrix. + + The identity matrix. + + + + Element (1,1) + + + + + Element (1,2) + + + + + Element (2,1) + + + + + Element (2,2) + + + + + Element (3,1) + + + + + Element (3,2) + + + + + Initializes a new instance of the struct. + + The value that will be assigned to all components. + + + + Initializes a new instance of the struct. + + The value to assign at row 1 column 1 of the matrix. + The value to assign at row 1 column 2 of the matrix. + The value to assign at row 2 column 1 of the matrix. + The value to assign at row 2 column 2 of the matrix. + The value to assign at row 3 column 1 of the matrix. + The value to assign at row 3 column 2 of the matrix. + + + + Initializes a new instance of the struct. + + The values to assign to the components of the matrix. This must be an array with six elements. + Thrown when is null. + Thrown when contains more or less than six elements. + + + + Gets or sets the first row in the matrix; that is M11 and M12. + + + + + Gets or sets the second row in the matrix; that is M21 and M22. + + + + + Gets or sets the third row in the matrix; that is M31 and M32. + + + + + Gets or sets the first column in the matrix; that is M11, M21, and M31. + + + + + Gets or sets the second column in the matrix; that is M12, M22, and M32. + + + + + Gets or sets the translation of the matrix; that is M31 and M32. + + + + + Gets or sets the scale of the matrix; that is M11 and M22. + + + + + Gets a value indicating whether this instance is an identity matrix. + + + true if this instance is an identity matrix; otherwise, false. + + + + + Gets or sets the component at the specified index. + + The value of the matrix component, depending on the index. + The zero-based index of the component to access. + The value of the component at the specified index. + Thrown when the is out of the range [0, 5]. + + + + Gets or sets the component at the specified index. + + The value of the matrix component, depending on the index. + The row of the matrix to access. + The column of the matrix to access. + The value of the component at the specified index. + Thrown when the or is out of the range [0, 3]. + + + + Creates an array containing the elements of the matrix. + + A sixteen-element array containing the components of the matrix. + + + + Determines the sum of two matrices. + + The first matrix to add. + The second matrix to add. + When the method completes, contains the sum of the two matrices. + + + + Determines the sum of two matrices. + + The first matrix to add. + The second matrix to add. + The sum of the two matrices. + + + + Determines the difference between two matrices. + + The first matrix to subtract. + The second matrix to subtract. + When the method completes, contains the difference between the two matrices. + + + + Determines the difference between two matrices. + + The first matrix to subtract. + The second matrix to subtract. + The difference between the two matrices. + + + + Scales a matrix by the given value. + + The matrix to scale. + The amount by which to scale. + When the method completes, contains the scaled matrix. + + + + Scales a matrix by the given value. + + The matrix to scale. + The amount by which to scale. + The scaled matrix. + + + + Determines the product of two matrices. + + The first matrix to multiply. + The second matrix to multiply. + The product of the two matrices. + + + + Determines the product of two matrices. + + The first matrix to multiply. + The second matrix to multiply. + The product of the two matrices. + + + + Scales a matrix by the given value. + + The matrix to scale. + The amount by which to scale. + When the method completes, contains the scaled matrix. + + + + Determines the quotient of two matrices. + + The first matrix to divide. + The second matrix to divide. + When the method completes, contains the quotient of the two matrices. + + + + Negates a matrix. + + The matrix to be negated. + When the method completes, contains the negated matrix. + + + + Negates a matrix. + + The matrix to be negated. + The negated matrix. + + + + Performs a linear interpolation between two matrices. + + Start matrix. + End matrix. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the linear interpolation of the two matrices. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a linear interpolation between two matrices. + + Start matrix. + End matrix. + Value between 0 and 1 indicating the weight of . + The linear interpolation of the two matrices. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a cubic interpolation between two matrices. + + Start matrix. + End matrix. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the cubic interpolation of the two matrices. + + + + Performs a cubic interpolation between two matrices. + + Start matrix. + End matrix. + Value between 0 and 1 indicating the weight of . + The cubic interpolation of the two matrices. + + + + Creates a matrix that scales along the x-axis and y-axis. + + Scaling factor for both axes. + When the method completes, contains the created scaling matrix. + + + + Creates a matrix that scales along the x-axis and y-axis. + + Scaling factor for both axes. + The created scaling matrix. + + + + Creates a matrix that scales along the x-axis and y-axis. + + Scaling factor that is applied along the x-axis. + Scaling factor that is applied along the y-axis. + When the method completes, contains the created scaling matrix. + + + + Creates a matrix that scales along the x-axis and y-axis. + + Scaling factor that is applied along the x-axis. + Scaling factor that is applied along the y-axis. + The created scaling matrix. + + + + Creates a matrix that uniformly scales along both axes. + + The uniform scale that is applied along both axes. + When the method completes, contains the created scaling matrix. + + + + Creates a matrix that uniformly scales along both axes. + + The uniform scale that is applied along both axes. + The created scaling matrix. + + + + Creates a matrix that is scaling from a specified center. + + Scaling factor that is applied along the x-axis. + Scaling factor that is applied along the y-axis. + The center of the scaling. + The created scaling matrix. + + + + Creates a matrix that is scaling from a specified center. + + Scaling factor that is applied along the x-axis. + Scaling factor that is applied along the y-axis. + The center of the scaling. + The created scaling matrix. + + + + Calculates the determinant of this matrix. + + Result of the determinant. + + + + Creates a matrix that rotates. + + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis. + When the method completes, contains the created rotation matrix. + + + + Creates a matrix that rotates. + + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis. + The created rotation matrix. + + + + Creates a matrix that rotates about a specified center. + + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis. + The center of the rotation. + The created rotation matrix. + + + + Creates a matrix that rotates about a specified center. + + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis. + The center of the rotation. + When the method completes, contains the created rotation matrix. + + + + Creates a transformation matrix. + + Scaling factor that is applied along the x-axis. + Scaling factor that is applied along the y-axis. + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis. + X-coordinate offset. + Y-coordinate offset. + When the method completes, contains the created transformation matrix. + + + + Creates a transformation matrix. + + Scaling factor that is applied along the x-axis. + Scaling factor that is applied along the y-axis. + Angle of rotation in radians. + X-coordinate offset. + Y-coordinate offset. + The created transformation matrix. + + + + Creates a translation matrix using the specified offsets. + + The offset for both coordinate planes. + When the method completes, contains the created translation matrix. + + + + Creates a translation matrix using the specified offsets. + + The offset for both coordinate planes. + The created translation matrix. + + + + Creates a translation matrix using the specified offsets. + + X-coordinate offset. + Y-coordinate offset. + When the method completes, contains the created translation matrix. + + + + Creates a translation matrix using the specified offsets. + + X-coordinate offset. + Y-coordinate offset. + The created translation matrix. + + + + Transforms a vector by this matrix. + + The matrix to use as a transformation matrix. + The original vector to apply the transformation. + The result of the transformation for the input vector. + + + + Transforms a vector by this matrix. + + The matrix to use as a transformation matrix. + The original vector to apply the transformation. + The result of the transformation for the input vector. + + + + + Calculates the inverse of this matrix instance. + + + + + Calculates the inverse of the specified matrix. + + The matrix whose inverse is to be calculated. + the inverse of the specified matrix. + + + + Creates a skew matrix. + + Angle of skew along the X-axis in radians. + Angle of skew along the Y-axis in radians. + The created skew matrix. + + + + Creates a skew matrix. + + Angle of skew along the X-axis in radians. + Angle of skew along the Y-axis in radians. + When the method completes, contains the created skew matrix. + + + + Calculates the inverse of the specified matrix. + + The matrix whose inverse is to be calculated. + When the method completes, contains the inverse of the specified matrix. + + + + Adds two matrices. + + The first matrix to add. + The second matrix to add. + The sum of the two matrices. + + + + Assert a matrix (return it unchanged). + + The matrix to assert (unchanged). + The asserted (unchanged) matrix. + + + + Subtracts two matrices. + + The first matrix to subtract. + The second matrix to subtract. + The difference between the two matrices. + + + + Negates a matrix. + + The matrix to negate. + The negated matrix. + + + + Scales a matrix by a given value. + + The matrix to scale. + The amount by which to scale. + The scaled matrix. + + + + Scales a matrix by a given value. + + The matrix to scale. + The amount by which to scale. + The scaled matrix. + + + + Multiplies two matrices. + + The first matrix to multiply. + The second matrix to multiply. + The product of the two matrices. + + + + Scales a matrix by a given value. + + The matrix to scale. + The amount by which to scale. + The scaled matrix. + + + + Divides two matrices. + + The first matrix to divide. + The second matrix to divide. + The quotient of the two matrices. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Performs an implicit conversion from to . + + The matrix. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Represents a 3x3 Matrix ( contains only Scale and Rotation ). + + + + + The size of the type, in bytes. + + + + + A with all of its components set to zero. + + + + + The identity . + + + + + Value at row 1 column 1 of the Matrix3x3. + + + + + Value at row 1 column 2 of the Matrix3x3. + + + + + Value at row 1 column 3 of the Matrix3x3. + + + + + Value at row 2 column 1 of the Matrix3x3. + + + + + Value at row 2 column 2 of the Matrix3x3. + + + + + Value at row 2 column 3 of the Matrix3x3. + + + + + Value at row 3 column 1 of the Matrix3x3. + + + + + Value at row 3 column 2 of the Matrix3x3. + + + + + Value at row 3 column 3 of the Matrix3x3. + + + + + Initializes a new instance of the struct. + + The value that will be assigned to all components. + + + + Initializes a new instance of the struct. + + The value to assign at row 1 column 1 of the Matrix3x3. + The value to assign at row 1 column 2 of the Matrix3x3. + The value to assign at row 1 column 3 of the Matrix3x3. + The value to assign at row 2 column 1 of the Matrix3x3. + The value to assign at row 2 column 2 of the Matrix3x3. + The value to assign at row 2 column 3 of the Matrix3x3. + The value to assign at row 3 column 1 of the Matrix3x3. + The value to assign at row 3 column 2 of the Matrix3x3. + The value to assign at row 3 column 3 of the Matrix3x3. + + + + Initializes a new instance of the struct. + + The values to assign to the components of the Matrix3x3. This must be an array with sixteen elements. + Thrown when is null. + Thrown when contains more or less than sixteen elements. + + + + Gets or sets the first row in the Matrix3x3; that is M11, M12, M13 + + + + + Gets or sets the second row in the Matrix3x3; that is M21, M22, M23 + + + + + Gets or sets the third row in the Matrix3x3; that is M31, M32, M33 + + + + + Gets or sets the first column in the Matrix3x3; that is M11, M21, M31 + + + + + Gets or sets the second column in the Matrix3x3; that is M12, M22, M32 + + + + + Gets or sets the third column in the Matrix3x3; that is M13, M23, M33 + + + + + Gets or sets the scale of the Matrix3x3; that is M11, M22, and M33. + + + + + Gets a value indicating whether this instance is an identity Matrix3x3. + + + true if this instance is an identity Matrix3x3; otherwise, false. + + + + + Gets or sets the component at the specified index. + + The value of the Matrix3x3 component, depending on the index. + The zero-based index of the component to access. + The value of the component at the specified index. + Thrown when the is out of the range [0, 15]. + + + + Gets or sets the component at the specified index. + + The value of the Matrix3x3 component, depending on the index. + The row of the Matrix3x3 to access. + The column of the Matrix3x3 to access. + The value of the component at the specified index. + Thrown when the or is out of the range [0, 3]. + + + + Calculates the determinant of the Matrix3x3. + + The determinant of the Matrix3x3. + + + + Inverts the Matrix3x3. + + + + + Transposes the Matrix3x3. + + + + + Orthogonalizes the specified Matrix3x3. + + + Orthogonalization is the process of making all rows orthogonal to each other. This + means that any given row in the Matrix3x3 will be orthogonal to any other given row in the + Matrix3x3. + Because this method uses the modified Gram-Schmidt process, the resulting Matrix3x3 + tends to be numerically unstable. The numeric stability decreases according to the rows + so that the first row is the most stable and the last row is the least stable. + This operation is performed on the rows of the Matrix3x3 rather than the columns. + If you wish for this operation to be performed on the columns, first transpose the + input and than transpose the output. + + + + + Orthonormalizes the specified Matrix3x3. + + + Orthonormalization is the process of making all rows and columns orthogonal to each + other and making all rows and columns of unit length. This means that any given row will + be orthogonal to any other given row and any given column will be orthogonal to any other + given column. Any given row will not be orthogonal to any given column. Every row and every + column will be of unit length. + Because this method uses the modified Gram-Schmidt process, the resulting Matrix3x3 + tends to be numerically unstable. The numeric stability decreases according to the rows + so that the first row is the most stable and the last row is the least stable. + This operation is performed on the rows of the Matrix3x3 rather than the columns. + If you wish for this operation to be performed on the columns, first transpose the + input and than transpose the output. + + + + + Decomposes a Matrix3x3 into an orthonormalized Matrix3x3 Q and a right triangular Matrix3x3 R. + + When the method completes, contains the orthonormalized Matrix3x3 of the decomposition. + When the method completes, contains the right triangular Matrix3x3 of the decomposition. + + + + Decomposes a Matrix3x3 into a lower triangular Matrix3x3 L and an orthonormalized Matrix3x3 Q. + + When the method completes, contains the lower triangular Matrix3x3 of the decomposition. + When the method completes, contains the orthonormalized Matrix3x3 of the decomposition. + + + + Decomposes a Matrix3x3 into a scale, rotation, and translation. + + When the method completes, contains the scaling component of the decomposed Matrix3x3. + When the method completes, contains the rotation component of the decomposed Matrix3x3. + + This method is designed to decompose an SRT transformation Matrix3x3 only. + + + + + Decomposes a uniform scale matrix into a scale, rotation, and translation. + A uniform scale matrix has the same scale in every axis. + + When the method completes, contains the scaling component of the decomposed matrix. + When the method completes, contains the rotation component of the decomposed matrix. + + This method is designed to decompose only an SRT transformation matrix that has the same scale in every axis. + + + + + Exchanges two rows in the Matrix3x3. + + The first row to exchange. This is an index of the row starting at zero. + The second row to exchange. This is an index of the row starting at zero. + + + + Exchanges two columns in the Matrix3x3. + + The first column to exchange. This is an index of the column starting at zero. + The second column to exchange. This is an index of the column starting at zero. + + + + Creates an array containing the elements of the Matrix3x3. + + A 9-element array containing the components of the Matrix3x3. + + + + Determines the sum of two matrices. + + The first Matrix3x3 to add. + The second Matrix3x3 to add. + When the method completes, contains the sum of the two matrices. + + + + Determines the sum of two matrices. + + The first Matrix3x3 to add. + The second Matrix3x3 to add. + The sum of the two matrices. + + + + Determines the difference between two matrices. + + The first Matrix3x3 to subtract. + The second Matrix3x3 to subtract. + When the method completes, contains the difference between the two matrices. + + + + Determines the difference between two matrices. + + The first Matrix3x3 to subtract. + The second Matrix3x3 to subtract. + The difference between the two matrices. + + + + Scales a Matrix3x3 by the given value. + + The Matrix3x3 to scale. + The amount by which to scale. + When the method completes, contains the scaled Matrix3x3. + + + + Scales a Matrix3x3 by the given value. + + The Matrix3x3 to scale. + The amount by which to scale. + The scaled Matrix3x3. + + + + Determines the product of two matrices. + + The first Matrix3x3 to multiply. + The second Matrix3x3 to multiply. + The product of the two matrices. + + + + Determines the product of two matrices. + + The first Matrix3x3 to multiply. + The second Matrix3x3 to multiply. + The product of the two matrices. + + + + Scales a Matrix3x3 by the given value. + + The Matrix3x3 to scale. + The amount by which to scale. + When the method completes, contains the scaled Matrix3x3. + + + + Scales a Matrix3x3 by the given value. + + The Matrix3x3 to scale. + The amount by which to scale. + The scaled Matrix3x3. + + + + Determines the quotient of two matrices. + + The first Matrix3x3 to divide. + The second Matrix3x3 to divide. + When the method completes, contains the quotient of the two matrices. + + + + Determines the quotient of two matrices. + + The first Matrix3x3 to divide. + The second Matrix3x3 to divide. + The quotient of the two matrices. + + + + Performs the exponential operation on a Matrix3x3. + + The Matrix3x3 to perform the operation on. + The exponent to raise the Matrix3x3 to. + When the method completes, contains the exponential Matrix3x3. + Thrown when the is negative. + + + + Performs the exponential operation on a Matrix3x3. + + The Matrix3x3 to perform the operation on. + The exponent to raise the Matrix3x3 to. + The exponential Matrix3x3. + Thrown when the is negative. + + + + Negates a Matrix3x3. + + The Matrix3x3 to be negated. + When the method completes, contains the negated Matrix3x3. + + + + Negates a Matrix3x3. + + The Matrix3x3 to be negated. + The negated Matrix3x3. + + + + Performs a linear interpolation between two matrices. + + Start Matrix3x3. + End Matrix3x3. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the linear interpolation of the two matrices. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a linear interpolation between two matrices. + + Start Matrix3x3. + End Matrix3x3. + Value between 0 and 1 indicating the weight of . + The linear interpolation of the two matrices. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a cubic interpolation between two matrices. + + Start Matrix3x3. + End Matrix3x3. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the cubic interpolation of the two matrices. + + + + Performs a cubic interpolation between two matrices. + + Start Matrix3x3. + End Matrix3x3. + Value between 0 and 1 indicating the weight of . + The cubic interpolation of the two matrices. + + + + Calculates the transpose of the specified Matrix3x3. + + The Matrix3x3 whose transpose is to be calculated. + When the method completes, contains the transpose of the specified Matrix3x3. + + + + Calculates the transpose of the specified Matrix3x3. + + The Matrix3x3 whose transpose is to be calculated. + When the method completes, contains the transpose of the specified Matrix3x3. + + + + Calculates the transpose of the specified Matrix3x3. + + The Matrix3x3 whose transpose is to be calculated. + The transpose of the specified Matrix3x3. + + + + Calculates the inverse of the specified Matrix3x3. + + The Matrix3x3 whose inverse is to be calculated. + When the method completes, contains the inverse of the specified Matrix3x3. + + + + Calculates the inverse of the specified Matrix3x3. + + The Matrix3x3 whose inverse is to be calculated. + The inverse of the specified Matrix3x3. + + + + Orthogonalizes the specified Matrix3x3. + + The Matrix3x3 to orthogonalize. + When the method completes, contains the orthogonalized Matrix3x3. + + Orthogonalization is the process of making all rows orthogonal to each other. This + means that any given row in the Matrix3x3 will be orthogonal to any other given row in the + Matrix3x3. + Because this method uses the modified Gram-Schmidt process, the resulting Matrix3x3 + tends to be numerically unstable. The numeric stability decreases according to the rows + so that the first row is the most stable and the last row is the least stable. + This operation is performed on the rows of the Matrix3x3 rather than the columns. + If you wish for this operation to be performed on the columns, first transpose the + input and than transpose the output. + + + + + Orthogonalizes the specified Matrix3x3. + + The Matrix3x3 to orthogonalize. + The orthogonalized Matrix3x3. + + Orthogonalization is the process of making all rows orthogonal to each other. This + means that any given row in the Matrix3x3 will be orthogonal to any other given row in the + Matrix3x3. + Because this method uses the modified Gram-Schmidt process, the resulting Matrix3x3 + tends to be numerically unstable. The numeric stability decreases according to the rows + so that the first row is the most stable and the last row is the least stable. + This operation is performed on the rows of the Matrix3x3 rather than the columns. + If you wish for this operation to be performed on the columns, first transpose the + input and than transpose the output. + + + + + Orthonormalizes the specified Matrix3x3. + + The Matrix3x3 to orthonormalize. + When the method completes, contains the orthonormalized Matrix3x3. + + Orthonormalization is the process of making all rows and columns orthogonal to each + other and making all rows and columns of unit length. This means that any given row will + be orthogonal to any other given row and any given column will be orthogonal to any other + given column. Any given row will not be orthogonal to any given column. Every row and every + column will be of unit length. + Because this method uses the modified Gram-Schmidt process, the resulting Matrix3x3 + tends to be numerically unstable. The numeric stability decreases according to the rows + so that the first row is the most stable and the last row is the least stable. + This operation is performed on the rows of the Matrix3x3 rather than the columns. + If you wish for this operation to be performed on the columns, first transpose the + input and than transpose the output. + + + + + Orthonormalizes the specified Matrix3x3. + + The Matrix3x3 to orthonormalize. + The orthonormalized Matrix3x3. + + Orthonormalization is the process of making all rows and columns orthogonal to each + other and making all rows and columns of unit length. This means that any given row will + be orthogonal to any other given row and any given column will be orthogonal to any other + given column. Any given row will not be orthogonal to any given column. Every row and every + column will be of unit length. + Because this method uses the modified Gram-Schmidt process, the resulting Matrix3x3 + tends to be numerically unstable. The numeric stability decreases according to the rows + so that the first row is the most stable and the last row is the least stable. + This operation is performed on the rows of the Matrix3x3 rather than the columns. + If you wish for this operation to be performed on the columns, first transpose the + input and than transpose the output. + + + + + Brings the Matrix3x3 into upper triangular form using elementary row operations. + + The Matrix3x3 to put into upper triangular form. + When the method completes, contains the upper triangular Matrix3x3. + + If the Matrix3x3 is not invertible (i.e. its determinant is zero) than the result of this + method may produce Single.Nan and Single.Inf values. When the Matrix3x3 represents a system + of linear equations, than this often means that either no solution exists or an infinite + number of solutions exist. + + + + + Brings the Matrix3x3 into upper triangular form using elementary row operations. + + The Matrix3x3 to put into upper triangular form. + The upper triangular Matrix3x3. + + If the Matrix3x3 is not invertible (i.e. its determinant is zero) than the result of this + method may produce Single.Nan and Single.Inf values. When the Matrix3x3 represents a system + of linear equations, than this often means that either no solution exists or an infinite + number of solutions exist. + + + + + Brings the Matrix3x3 into lower triangular form using elementary row operations. + + The Matrix3x3 to put into lower triangular form. + When the method completes, contains the lower triangular Matrix3x3. + + If the Matrix3x3 is not invertible (i.e. its determinant is zero) than the result of this + method may produce Single.Nan and Single.Inf values. When the Matrix3x3 represents a system + of linear equations, than this often means that either no solution exists or an infinite + number of solutions exist. + + + + + Brings the Matrix3x3 into lower triangular form using elementary row operations. + + The Matrix3x3 to put into lower triangular form. + The lower triangular Matrix3x3. + + If the Matrix3x3 is not invertible (i.e. its determinant is zero) than the result of this + method may produce Single.Nan and Single.Inf values. When the Matrix3x3 represents a system + of linear equations, than this often means that either no solution exists or an infinite + number of solutions exist. + + + + + Brings the Matrix3x3 into row echelon form using elementary row operations; + + The Matrix3x3 to put into row echelon form. + When the method completes, contains the row echelon form of the Matrix3x3. + + + + Brings the Matrix3x3 into row echelon form using elementary row operations; + + The Matrix3x3 to put into row echelon form. + When the method completes, contains the row echelon form of the Matrix3x3. + + + + Creates a left-handed spherical billboard that rotates around a specified object position. + + The position of the object around which the billboard will rotate. + The position of the camera. + The up vector of the camera. + The forward vector of the camera. + When the method completes, contains the created billboard Matrix3x3. + + + + Creates a left-handed spherical billboard that rotates around a specified object position. + + The position of the object around which the billboard will rotate. + The position of the camera. + The up vector of the camera. + The forward vector of the camera. + The created billboard Matrix3x3. + + + + Creates a right-handed spherical billboard that rotates around a specified object position. + + The position of the object around which the billboard will rotate. + The position of the camera. + The up vector of the camera. + The forward vector of the camera. + When the method completes, contains the created billboard Matrix3x3. + + + + Creates a right-handed spherical billboard that rotates around a specified object position. + + The position of the object around which the billboard will rotate. + The position of the camera. + The up vector of the camera. + The forward vector of the camera. + The created billboard Matrix3x3. + + + + Creates a left-handed, look-at Matrix3x3. + + The position of the viewer's eye. + The camera look-at target. + The camera's up vector. + When the method completes, contains the created look-at Matrix3x3. + + + + Creates a left-handed, look-at Matrix3x3. + + The position of the viewer's eye. + The camera look-at target. + The camera's up vector. + The created look-at Matrix3x3. + + + + Creates a right-handed, look-at Matrix3x3. + + The position of the viewer's eye. + The camera look-at target. + The camera's up vector. + When the method completes, contains the created look-at Matrix3x3. + + + + Creates a right-handed, look-at Matrix3x3. + + The position of the viewer's eye. + The camera look-at target. + The camera's up vector. + The created look-at Matrix3x3. + + + + Creates a Matrix3x3 that scales along the x-axis, y-axis, and y-axis. + + Scaling factor for all three axes. + When the method completes, contains the created scaling Matrix3x3. + + + + Creates a Matrix3x3 that scales along the x-axis, y-axis, and y-axis. + + Scaling factor for all three axes. + The created scaling Matrix3x3. + + + + Creates a Matrix3x3 that scales along the x-axis, y-axis, and y-axis. + + Scaling factor that is applied along the x-axis. + Scaling factor that is applied along the y-axis. + Scaling factor that is applied along the z-axis. + When the method completes, contains the created scaling Matrix3x3. + + + + Creates a Matrix3x3 that scales along the x-axis, y-axis, and y-axis. + + Scaling factor that is applied along the x-axis. + Scaling factor that is applied along the y-axis. + Scaling factor that is applied along the z-axis. + The created scaling Matrix3x3. + + + + Creates a Matrix3x3 that uniformly scales along all three axis. + + The uniform scale that is applied along all axis. + When the method completes, contains the created scaling Matrix3x3. + + + + Creates a Matrix3x3 that uniformly scales along all three axis. + + The uniform scale that is applied along all axis. + The created scaling Matrix3x3. + + + + Creates a Matrix3x3 that rotates around the x-axis. + + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. + When the method completes, contains the created rotation Matrix3x3. + + + + Creates a Matrix3x3 that rotates around the x-axis. + + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. + The created rotation Matrix3x3. + + + + Creates a Matrix3x3 that rotates around the y-axis. + + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. + When the method completes, contains the created rotation Matrix3x3. + + + + Creates a Matrix3x3 that rotates around the y-axis. + + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. + The created rotation Matrix3x3. + + + + Creates a Matrix3x3 that rotates around the z-axis. + + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. + When the method completes, contains the created rotation Matrix3x3. + + + + Creates a Matrix3x3 that rotates around the z-axis. + + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. + The created rotation Matrix3x3. + + + + Creates a Matrix3x3 that rotates around an arbitrary axis. + + The axis around which to rotate. This parameter is assumed to be normalized. + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. + When the method completes, contains the created rotation Matrix3x3. + + + + Creates a Matrix3x3 that rotates around an arbitrary axis. + + The axis around which to rotate. This parameter is assumed to be normalized. + Angle of rotation in radians. Angles are measured clockwise when looking along the rotation axis toward the origin. + The created rotation Matrix3x3. + + + + Creates a rotation Matrix3x3 from a quaternion. + + The quaternion to use to build the Matrix3x3. + The created rotation Matrix3x3. + + + + Creates a rotation Matrix3x3 from a quaternion. + + The quaternion to use to build the Matrix3x3. + The created rotation Matrix3x3. + + + + Creates a rotation Matrix3x3 with a specified yaw, pitch, and roll. + + Yaw around the y-axis, in radians. + Pitch around the x-axis, in radians. + Roll around the z-axis, in radians. + When the method completes, contains the created rotation Matrix3x3. + + + + Creates a rotation Matrix3x3 with a specified yaw, pitch, and roll. + + Yaw around the y-axis, in radians. + Pitch around the x-axis, in radians. + Roll around the z-axis, in radians. + The created rotation Matrix3x3. + + + + Adds two matrices. + + The first Matrix3x3 to add. + The second Matrix3x3 to add. + The sum of the two matrices. + + + + Assert a Matrix3x3 (return it unchanged). + + The Matrix3x3 to assert (unchanged). + The asserted (unchanged) Matrix3x3. + + + + Subtracts two matrices. + + The first Matrix3x3 to subtract. + The second Matrix3x3 to subtract. + The difference between the two matrices. + + + + Negates a Matrix3x3. + + The Matrix3x3 to negate. + The negated Matrix3x3. + + + + Scales a Matrix3x3 by a given value. + + The Matrix3x3 to scale. + The amount by which to scale. + The scaled Matrix3x3. + + + + Scales a Matrix3x3 by a given value. + + The Matrix3x3 to scale. + The amount by which to scale. + The scaled Matrix3x3. + + + + Multiplies two matrices. + + The first Matrix3x3 to multiply. + The second Matrix3x3 to multiply. + The product of the two matrices. + + + + Scales a Matrix3x3 by a given value. + + The Matrix3x3 to scale. + The amount by which to scale. + The scaled Matrix3x3. + + + + Divides two matrices. + + The first Matrix3x3 to divide. + The second Matrix3x3 to divide. + The quotient of the two matrices. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Convert the 3x3 Matrix to a 4x4 Matrix. + + A 4x4 Matrix with zero translation and M44=1 + + + + Convert the 4x4 Matrix to a 3x3 Matrix. + + A 3x3 Matrix + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified are equal. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Represents a 4x4 mathematical Matrix5x4. + + + + + The size of the type, in bytes. + + + + + A with all of its components set to zero. + + + + + The identity . + + + + + Value at row 1 column 1 of the Matrix5x4. + + + + + Value at row 1 column 2 of the Matrix5x4. + + + + + Value at row 1 column 3 of the Matrix5x4. + + + + + Value at row 1 column 4 of the Matrix5x4. + + + + + Value at row 2 column 1 of the Matrix5x4. + + + + + Value at row 2 column 2 of the Matrix5x4. + + + + + Value at row 2 column 3 of the Matrix5x4. + + + + + Value at row 2 column 4 of the Matrix5x4. + + + + + Value at row 3 column 1 of the Matrix5x4. + + + + + Value at row 3 column 2 of the Matrix5x4. + + + + + Value at row 3 column 3 of the Matrix5x4. + + + + + Value at row 3 column 4 of the Matrix5x4. + + + + + Value at row 4 column 1 of the Matrix5x4. + + + + + Value at row 4 column 2 of the Matrix5x4. + + + + + Value at row 4 column 3 of the Matrix5x4. + + + + + Value at row 4 column 4 of the Matrix5x4. + + + + + Value at row 5 column 1 of the Matrix5x4. + + + + + Value at row 5 column 2 of the Matrix5x4. + + + + + Value at row 5 column 3 of the Matrix5x4. + + + + + Value at row 5 column 4 of the Matrix5x4. + + + + + Initializes a new instance of the struct. + + The value that will be assigned to all components. + + + + Initializes a new instance of the struct. + + The value to assign at row 1 column 1 of the Matrix5x4. + The value to assign at row 1 column 2 of the Matrix5x4. + The value to assign at row 1 column 3 of the Matrix5x4. + The value to assign at row 1 column 4 of the Matrix5x4. + The value to assign at row 2 column 1 of the Matrix5x4. + The value to assign at row 2 column 2 of the Matrix5x4. + The value to assign at row 2 column 3 of the Matrix5x4. + The value to assign at row 2 column 4 of the Matrix5x4. + The value to assign at row 3 column 1 of the Matrix5x4. + The value to assign at row 3 column 2 of the Matrix5x4. + The value to assign at row 3 column 3 of the Matrix5x4. + The value to assign at row 3 column 4 of the Matrix5x4. + The value to assign at row 4 column 1 of the Matrix5x4. + The value to assign at row 4 column 2 of the Matrix5x4. + The value to assign at row 4 column 3 of the Matrix5x4. + The value to assign at row 4 column 4 of the Matrix5x4. + The value to assign at row 5 column 1 of the Matrix5x4. + The value to assign at row 5 column 2 of the Matrix5x4. + The value to assign at row 5 column 3 of the Matrix5x4. + The value to assign at row 5 column 4 of the Matrix5x4. + + + + Initializes a new instance of the struct. + + The values to assign to the components of the Matrix5x4. This must be an array with sixteen elements. + Thrown when is null. + Thrown when contains more or less than sixteen elements. + + + + Gets or sets the first row in the Matrix5x4; that is M11, M12, M13, and M14. + + + + + Gets or sets the second row in the Matrix5x4; that is M21, M22, M23, and M24. + + + + + Gets or sets the third row in the Matrix5x4; that is M31, M32, M33, and M34. + + + + + Gets or sets the fourth row in the Matrix5x4; that is M41, M42, M43, and M44. + + + + + Gets or sets the fifth row in the Matrix5x4; that is M51, M52, M53, and M54. + + + + + Gets or sets the translation of the Matrix5x4; that is M41, M42, and M43. + + + + + Gets or sets the scale of the Matrix5x4; that is M11, M22, and M33. + + + + + Gets a value indicating whether this instance is an identity Matrix5x4. + + + true if this instance is an identity Matrix5x4; otherwise, false. + + + + + Gets or sets the component at the specified index. + + The value of the Matrix5x4 component, depending on the index. + The zero-based index of the component to access. + The value of the component at the specified index. + Thrown when the is out of the range [0, 15]. + + + + Gets or sets the component at the specified index. + + The value of the Matrix5x4 component, depending on the index. + The row of the Matrix5x4 to access. + The column of the Matrix5x4 to access. + The value of the component at the specified index. + Thrown when the or is out of the range [0, 3]. + + + + Determines the sum of two matrices. + + The first Matrix5x4 to add. + The second Matrix5x4 to add. + When the method completes, contains the sum of the two matrices. + + + + Determines the sum of two matrices. + + The first Matrix5x4 to add. + The second Matrix5x4 to add. + The sum of the two matrices. + + + + Determines the difference between two matrices. + + The first Matrix5x4 to subtract. + The second Matrix5x4 to subtract. + When the method completes, contains the difference between the two matrices. + + + + Determines the difference between two matrices. + + The first Matrix5x4 to subtract. + The second Matrix5x4 to subtract. + The difference between the two matrices. + + + + Scales a Matrix5x4 by the given value. + + The Matrix5x4 to scale. + The amount by which to scale. + When the method completes, contains the scaled Matrix5x4. + + + + Scales a Matrix5x4 by the given value. + + The Matrix5x4 to scale. + The amount by which to scale. + When the method completes, contains the scaled Matrix5x4. + + + + Negates a Matrix5x4. + + The Matrix5x4 to be negated. + When the method completes, contains the negated Matrix5x4. + + + + Negates a Matrix5x4. + + The Matrix5x4 to be negated. + The negated Matrix5x4. + + + + Performs a linear interpolation between two matrices. + + Start Matrix5x4. + End Matrix5x4. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the linear interpolation of the two matrices. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a linear interpolation between two matrices. + + Start Matrix5x4. + End Matrix5x4. + Value between 0 and 1 indicating the weight of . + The linear interpolation of the two matrices. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a cubic interpolation between two matrices. + + Start Matrix5x4. + End Matrix5x4. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the cubic interpolation of the two matrices. + + + + Performs a cubic interpolation between two matrices. + + Start Matrix5x4. + End Matrix5x4. + Value between 0 and 1 indicating the weight of . + The cubic interpolation of the two matrices. + + + + Creates a Matrix5x4 that scales along the x-axis, y-axis, y-axis and w-axis + + Scaling factor for all three axes. + When the method completes, contains the created scaling Matrix5x4. + + + + Creates a Matrix5x4 that scales along the x-axis, y-axis, and y-axis. + + Scaling factor for all three axes. + The created scaling Matrix5x4. + + + + Creates a Matrix5x4 that scales along the x-axis, y-axis, z-axis and w-axis. + + Scaling factor that is applied along the x-axis. + Scaling factor that is applied along the y-axis. + Scaling factor that is applied along the z-axis. + Scaling factor that is applied along the w-axis. + When the method completes, contains the created scaling Matrix5x4. + + + + Creates a Matrix5x4 that scales along the x-axis, y-axis, z-axis and w-axis. + + Scaling factor that is applied along the x-axis. + Scaling factor that is applied along the y-axis. + Scaling factor that is applied along the z-axis. + Scaling factor that is applied along the w-axis. + The created scaling Matrix5x4. + + + + Creates a Matrix5x4 that uniformly scales along all three axis. + + The uniform scale that is applied along all axis. + When the method completes, contains the created scaling Matrix5x4. + + + + Creates a Matrix5x4 that uniformly scales along all three axis. + + The uniform scale that is applied along all axis. + The created scaling Matrix5x4. + + + + Creates a translation Matrix5x4 using the specified offsets. + + The offset for all three coordinate planes. + When the method completes, contains the created translation Matrix5x4. + + + + Creates a translation Matrix5x4 using the specified offsets. + + The offset for all three coordinate planes. + The created translation Matrix5x4. + + + + Creates a translation Matrix5x4 using the specified offsets. + + X-coordinate offset. + Y-coordinate offset. + Z-coordinate offset. + W-coordinate offset. + When the method completes, contains the created translation Matrix5x4. + + + + Creates a translation Matrix5x4 using the specified offsets. + + X-coordinate offset. + Y-coordinate offset. + Z-coordinate offset. + W-coordinate offset. + The created translation Matrix5x4. + + + + Adds two matrices. + + The first Matrix5x4 to add. + The second Matrix5x4 to add. + The sum of the two matrices. + + + + Assert a Matrix5x4 (return it unchanged). + + The Matrix5x4 to assert (unchanged). + The asserted (unchanged) Matrix5x4. + + + + Subtracts two matrices. + + The first Matrix5x4 to subtract. + The second Matrix5x4 to subtract. + The difference between the two matrices. + + + + Negates a Matrix5x4. + + The Matrix5x4 to negate. + The negated Matrix5x4. + + + + Scales a Matrix5x4 by a given value. + + The Matrix5x4 to scale. + The amount by which to scale. + The scaled Matrix5x4. + + + + Scales a Matrix5x4 by a given value. + + The Matrix5x4 to scale. + The amount by which to scale. + The scaled Matrix5x4. + + + + Scales a Matrix5x4 by a given value. + + The Matrix5x4 to scale. + The amount by which to scale. + The scaled Matrix5x4. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + OrientedBoundingBox (OBB) is a rectangular block, much like an AABB (BoundingBox) but with an arbitrary orientation. + + + + + Half lengths of the box along each axis. + + + + + The matrix which aligns and scales the box, and its translation vector represents the center of the box. + + + + + Creates an from a BoundingBox. + + The BoundingBox to create from. + + Initially, the OBB is axis-aligned box, but it can be rotated and transformed later. + + + + + Creates an which contained between two minimum and maximum points. + + The minimum vertex of the bounding box. + The maximum vertex of the bounding box. + + Initially, the OrientedBoundingBox is axis-aligned box, but it can be rotated and transformed later. + + + + + Creates an that fully contains the given points. + + The points that will be contained by the box. + + This method is not for computing the best tight-fitting OrientedBoundingBox. + And initially, the OrientedBoundingBox is axis-aligned box, but it can be rotated and transformed later. + + + + + Retrieves the eight corners of the bounding box. + + An array of points representing the eight corners of the bounding box. + + + + Transforms this box using a transformation matrix. + + The transformation matrix. + + While any kind of transformation can be applied, it is recommended to apply scaling using scale method instead, which + scales the Extents and keeps the Transformation matrix for rotation only, and that preserves collision detection accuracy. + + + + + Transforms this box using a transformation matrix. + + The transformation matrix. + + While any kind of transformation can be applied, it is recommended to apply scaling using scale method instead, which + scales the Extents and keeps the Transformation matrix for rotation only, and that preserves collision detection accuracy. + + + + + Scales the by scaling its Extents without affecting the Transformation matrix, + By keeping Transformation matrix scaling-free, the collision detection methods will be more accurate. + + + + + + Scales the by scaling its Extents without affecting the Transformation matrix, + By keeping Transformation matrix scaling-free, the collision detection methods will be more accurate. + + + + + + Scales the by scaling its Extents without affecting the Transformation matrix, + By keeping Transformation matrix scaling-free, the collision detection methods will be more accurate. + + + + + + Translates the to a new position using a translation vector; + + the translation vector. + + + + Translates the to a new position using a translation vector; + + the translation vector. + + + + The size of the if no scaling is applied to the transformation matrix. + + + The property will return the actual size even if the scaling is applied using Scale method, + but if the scaling is applied to transformation matrix, use GetSize Function instead. + + + + + Returns the size of the taking into consideration the scaling applied to the transformation matrix. + + The size of the consideration + + This method is computationally expensive, so if no scale is applied to the transformation matrix + use property instead. + + + + + Returns the square size of the taking into consideration the scaling applied to the transformation matrix. + + The size of the consideration + + + + Returns the center of the . + + + + + Determines whether a contains a point. + + The point to test. + The type of containment the two objects have. + + + + Determines whether a contains a point. + + The point to test. + The type of containment the two objects have. + + + + Determines whether a contains an array of points>. + + The points array to test. + The type of containment. + + + + Determines whether a contains a . + + The sphere to test. + Optimize the check operation by assuming that has no scaling applied + The type of containment the two objects have. + + This method is not designed for which has a non-uniform scaling applied to its transformation matrix. + But any type of scaling applied using Scale method will keep this method accurate. + + + + + Check the intersection between two + + The OrientedBoundingBoxs to test. + The type of containment the two objects have. + + For accuracy, The transformation matrix for both must not have any scaling applied to it. + Anyway, scaling using Scale method will keep this method accurate. + + + + + Check the intersection between an and a line defined by two points + + The first point in the line. + The second point in the line. + The type of containment the two objects have. + + For accuracy, The transformation matrix for the must not have any scaling applied to it. + Anyway, scaling using Scale method will keep this method accurate. + + + + + Check the intersection between an and + + The BoundingBox to test. + The type of containment the two objects have. + + For accuracy, The transformation matrix for the must not have any scaling applied to it. + Anyway, scaling using Scale method will keep this method accurate. + + + + + Determines whether there is an intersection between a and a . + + The ray to test. + When the method completes, contains the point of intersection, + or if there was no intersection. + Whether the two objects intersected. + + + + Determines whether there is an intersection between a and a . + + The ray to test. + Whether the two objects intersected. + + + + Get the axis-aligned which contains all corners. + + The axis-aligned BoundingBox of this OrientedBoundingBox. + + + + Calculates the matrix required to transfer any point from one local coordinates to another. + + The source OrientedBoundingBox. + The target OrientedBoundingBox. + + If true, the method will use a fast algorithm which is inapplicable if a scale is applied to the transformation matrix of the OrientedBoundingBox. + + + + + + Merge an OrientedBoundingBox B into another OrientedBoundingBox A, by expanding A to contain B and keeping A orientation. + + The to merge into it. + The to be merged + + If true, the method will use a fast algorithm which is inapplicable if a scale is applied to the transformation matrix of the OrientedBoundingBox. + + + Unlike merging axis aligned boxes, The operation is not interchangeable, because it keeps A orientation and merge B into it. + + + + + Merge this OrientedBoundingBox into another OrientedBoundingBox, keeping the other OrientedBoundingBox orientation. + + The other to merge into. + + If true, the method will use a fast algorithm which is inapplicable if a scale is applied to the transformation matrix of the OrientedBoundingBox. + + + + + Merge another OrientedBoundingBox into this OrientedBoundingBox. + + The other to merge into this OrientedBoundingBox. + + If true, the method will use a fast algorithm which is inapplicable if a scale is applied to the transformation matrix of the OrientedBoundingBox. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Represents a plane in three dimensional space. + + + + + The normal vector of the plane. + + + + + The distance of the plane along its normal from the origin. + + + + + Initializes a new instance of the struct. + + The value that will be assigned to all components. + + + + Initializes a new instance of the struct. + + The X component of the normal. + The Y component of the normal. + The Z component of the normal. + The distance of the plane along its normal from the origin. + + + + Initializes a new instance of the class. + + Any point that lies along the plane. + The normal vector to the plane. + + + + Initializes a new instance of the struct. + + The normal of the plane. + The distance of the plane along its normal from the origin + + + + Initializes a new instance of the struct. + + First point of a triangle defining the plane. + Second point of a triangle defining the plane. + Third point of a triangle defining the plane. + + + + Initializes a new instance of the struct. + + The values to assign to the A, B, C, and D components of the plane. This must be an array with four elements. + Thrown when is null. + Thrown when contains more or less than four elements. + + + + Gets or sets the component at the specified index. + + The value of the A, B, C, or D component, depending on the index. + The index of the component to access. Use 0 for the A component, 1 for the B component, 2 for the C component, and 3 for the D component. + The value of the component at the specified index. + Thrown when the is out of the range [0, 3]. + + + + Changes the coefficients of the normal vector of the plane to make it of unit length. + + + + + Creates an array containing the elements of the plane. + + A four-element array containing the components of the plane. + + + + Determines if there is an intersection between the current object and a point. + + The point to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The ray to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The ray to test. + When the method completes, contains the distance of the intersection, + or 0 if there was no intersection. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The ray to test. + When the method completes, contains the point of intersection, + or if there was no intersection. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The plane to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The plane to test. + When the method completes, contains the line of intersection + as a , or a zero ray if there was no intersection. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a triangle. + + The first vertex of the triangle to test. + The second vertex of the triangle to test. + The third vertex of the triangle to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The box to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The sphere to test. + Whether the two objects intersected. + + + + Builds a matrix that can be used to reflect vectors about a plane. + + The plane for which the reflection occurs. This parameter is assumed to be normalized. + When the method completes, contains the reflection matrix. + + + + Builds a matrix that can be used to reflect vectors about a plane. + + The reflection matrix. + + + + Creates a matrix that flattens geometry into a shadow from this the plane onto which to project the geometry as a shadow. + This plane is assumed to be normalized + + The light direction. If the W component is 0, the light is directional light; if the + W component is 1, the light is a point light. + When the method completes, contains the shadow matrix. + + + + Creates a matrix that flattens geometry into a shadow from this the plane onto which to project the geometry as a shadow. + This plane is assumed to be normalized + + The light direction. If the W component is 0, the light is directional light; if the + W component is 1, the light is a point light. + The shadow matrix. + + + + Builds a Matrix3x3 that can be used to reflect vectors about a plane for which the reflection occurs. + This plane is assumed to be normalized + + When the method completes, contains the reflection Matrix3x3. + + + + Builds a Matrix3x3 that can be used to reflect vectors about a plane for which the reflection occurs. + This plane is assumed to be normalized + + The reflection Matrix3x3. + + + + Creates a Matrix3x3 that flattens geometry into a shadow. + + The light direction. If the W component is 0, the light is directional light; if the + W component is 1, the light is a point light. + The plane onto which to project the geometry as a shadow. This parameter is assumed to be normalized. + When the method completes, contains the shadow Matrix3x3. + + + + Creates a Matrix3x3 that flattens geometry into a shadow. + + The light direction. If the W component is 0, the light is directional light; if the + W component is 1, the light is a point light. + The plane onto which to project the geometry as a shadow. This parameter is assumed to be normalized. + The shadow Matrix3x3. + + + + Scales the plane by the given scaling factor. + + The plane to scale. + The amount by which to scale the plane. + When the method completes, contains the scaled plane. + + + + Scales the plane by the given scaling factor. + + The plane to scale. + The amount by which to scale the plane. + The scaled plane. + + + + Calculates the dot product of the specified vector and plane. + + The source plane. + The source vector. + When the method completes, contains the dot product of the specified plane and vector. + + + + Calculates the dot product of the specified vector and plane. + + The source plane. + The source vector. + The dot product of the specified plane and vector. + + + + Calculates the dot product of a specified vector and the normal of the plane plus the distance value of the plane. + + The source plane. + The source vector. + When the method completes, contains the dot product of a specified vector and the normal of the Plane plus the distance value of the plane. + + + + Calculates the dot product of a specified vector and the normal of the plane plus the distance value of the plane. + + The source plane. + The source vector. + The dot product of a specified vector and the normal of the Plane plus the distance value of the plane. + + + + Calculates the dot product of the specified vector and the normal of the plane. + + The source plane. + The source vector. + When the method completes, contains the dot product of the specified vector and the normal of the plane. + + + + Calculates the dot product of the specified vector and the normal of the plane. + + The source plane. + The source vector. + The dot product of the specified vector and the normal of the plane. + + + + Changes the coefficients of the normal vector of the plane to make it of unit length. + + The source plane. + When the method completes, contains the normalized plane. + + + + Changes the coefficients of the normal vector of the plane to make it of unit length. + + The source plane. + The normalized plane. + + + + Transforms a normalized plane by a quaternion rotation. + + The normalized source plane. + The quaternion rotation. + When the method completes, contains the transformed plane. + + + + Transforms a normalized plane by a quaternion rotation. + + The normalized source plane. + The quaternion rotation. + The transformed plane. + + + + Transforms an array of normalized planes by a quaternion rotation. + + The array of normalized planes to transform. + The quaternion rotation. + Thrown when is null. + + + + Transforms a normalized plane by a matrix. + + The normalized source plane. + The transformation matrix. + When the method completes, contains the transformed plane. + + + + Transforms a normalized plane by a matrix. + + The normalized source plane. + The transformation matrix. + When the method completes, contains the transformed plane. + + + + Transforms an array of normalized planes by a matrix. + + The array of normalized planes to transform. + The transformation matrix. + Thrown when is null. + + + + Scales a plane by the given value. + + The amount by which to scale the plane. + The plane to scale. + The scaled plane. + + + + Scales a plane by the given value. + + The plane to scale. + The amount by which to scale the plane. + The scaled plane. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Structure using the same layout than . + + + + + A point with (0,0) coordinates. + + + + + Initializes a new instance of the struct. + + The x. + The y. + + + + Left coordinate. + + + + + Top coordinate. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + + + + + + + Implements the operator ==. + + The left. + The right. + + The result of the operator. + + + + + Implements the operator !=. + + The left. + The right. + + The result of the operator. + + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Represents a four dimensional mathematical quaternion. + + + + + The size of the type, in bytes. + + + + + A with all of its components set to zero. + + + + + A with all of its components set to one. + + + + + The identity (0, 0, 0, 1). + + + + + The X component of the quaternion. + + + + + The Y component of the quaternion. + + + + + The Z component of the quaternion. + + + + + The W component of the quaternion. + + + + + Initializes a new instance of the struct. + + The value that will be assigned to all components. + + + + Initializes a new instance of the struct. + + A vector containing the values with which to initialize the components. + + + + Initializes a new instance of the struct. + + A vector containing the values with which to initialize the X, Y, and Z components. + Initial value for the W component of the quaternion. + + + + Initializes a new instance of the struct. + + A vector containing the values with which to initialize the X and Y components. + Initial value for the Z component of the quaternion. + Initial value for the W component of the quaternion. + + + + Initializes a new instance of the struct. + + Initial value for the X component of the quaternion. + Initial value for the Y component of the quaternion. + Initial value for the Z component of the quaternion. + Initial value for the W component of the quaternion. + + + + Initializes a new instance of the struct. + + The values to assign to the X, Y, Z, and W components of the quaternion. This must be an array with four elements. + Thrown when is null. + Thrown when contains more or less than four elements. + + + + Gets a value indicating whether this instance is equivalent to the identity quaternion. + + + true if this instance is an identity quaternion; otherwise, false. + + + + + Gets a value indicting whether this instance is normalized. + + + + + Gets the angle of the quaternion. + + The quaternion's angle. + + + + Gets the axis components of the quaternion. + + The axis components of the quaternion. + + + + Gets or sets the component at the specified index. + + The value of the X, Y, Z, or W component, depending on the index. + The index of the component to access. Use 0 for the X component, 1 for the Y component, 2 for the Z component, and 3 for the W component. + The value of the component at the specified index. + Thrown when the is out of the range [0, 3]. + + + + Conjugates the quaternion. + + + + + Conjugates and renormalizes the quaternion. + + + + + Calculates the length of the quaternion. + + The length of the quaternion. + + may be preferred when only the relative length is needed + and speed is of the essence. + + + + + Calculates the squared length of the quaternion. + + The squared length of the quaternion. + + This method may be preferred to when only a relative length is needed + and speed is of the essence. + + + + + Converts the quaternion into a unit quaternion. + + + + + Creates an array containing the elements of the quaternion. + + A four-element array containing the components of the quaternion. + + + + Adds two quaternions. + + The first quaternion to add. + The second quaternion to add. + When the method completes, contains the sum of the two quaternions. + + + + Adds two quaternions. + + The first quaternion to add. + The second quaternion to add. + The sum of the two quaternions. + + + + Subtracts two quaternions. + + The first quaternion to subtract. + The second quaternion to subtract. + When the method completes, contains the difference of the two quaternions. + + + + Subtracts two quaternions. + + The first quaternion to subtract. + The second quaternion to subtract. + The difference of the two quaternions. + + + + Scales a quaternion by the given value. + + The quaternion to scale. + The amount by which to scale the quaternion. + When the method completes, contains the scaled quaternion. + + + + Scales a quaternion by the given value. + + The quaternion to scale. + The amount by which to scale the quaternion. + The scaled quaternion. + + + + Multiplies a quaternion by another. + + The first quaternion to multiply. + The second quaternion to multiply. + When the method completes, contains the multiplied quaternion. + + + + Multiplies a quaternion by another. + + The first quaternion to multiply. + The second quaternion to multiply. + The multiplied quaternion. + + + + Reverses the direction of a given quaternion. + + The quaternion to negate. + When the method completes, contains a quaternion facing in the opposite direction. + + + + Reverses the direction of a given quaternion. + + The quaternion to negate. + A quaternion facing in the opposite direction. + + + + Returns a containing the 4D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 2D triangle. + + A containing the 4D Cartesian coordinates of vertex 1 of the triangle. + A containing the 4D Cartesian coordinates of vertex 2 of the triangle. + A containing the 4D Cartesian coordinates of vertex 3 of the triangle. + Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in ). + Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in ). + When the method completes, contains a new containing the 4D Cartesian coordinates of the specified point. + + + + Returns a containing the 4D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 2D triangle. + + A containing the 4D Cartesian coordinates of vertex 1 of the triangle. + A containing the 4D Cartesian coordinates of vertex 2 of the triangle. + A containing the 4D Cartesian coordinates of vertex 3 of the triangle. + Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in ). + Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in ). + A new containing the 4D Cartesian coordinates of the specified point. + + + + Conjugates a quaternion. + + The quaternion to conjugate. + When the method completes, contains the conjugated quaternion. + + + + Conjugates a quaternion. + + The quaternion to conjugate. + The conjugated quaternion. + + + + Calculates the dot product of two quaternions. + + First source quaternion. + Second source quaternion. + When the method completes, contains the dot product of the two quaternions. + + + + Calculates the dot product of two quaternions. + + First source quaternion. + Second source quaternion. + The dot product of the two quaternions. + + + + Exponentiates a quaternion. + + The quaternion to exponentiate. + When the method completes, contains the exponentiated quaternion. + + + + Exponentiates a quaternion. + + The quaternion to exponentiate. + The exponentiated quaternion. + + + + Conjugates and renormalizes the quaternion. + + The quaternion to conjugate and renormalize. + When the method completes, contains the conjugated and renormalized quaternion. + + + + Conjugates and renormalizes the quaternion. + + The quaternion to conjugate and renormalize. + The conjugated and renormalized quaternion. + + + + Performs a linear interpolation between two quaternions. + + Start quaternion. + End quaternion. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the linear interpolation of the two quaternions. + + This method performs the linear interpolation based on the following formula. + start + (end - start) * amount + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a linear interpolation between two quaternion. + + Start quaternion. + End quaternion. + Value between 0 and 1 indicating the weight of . + The linear interpolation of the two quaternions. + + This method performs the linear interpolation based on the following formula. + start + (end - start) * amount + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Calculates the natural logarithm of the specified quaternion. + + The quaternion whose logarithm will be calculated. + When the method completes, contains the natural logarithm of the quaternion. + + + + Calculates the natural logarithm of the specified quaternion. + + The quaternion whose logarithm will be calculated. + The natural logarithm of the quaternion. + + + + Converts the quaternion into a unit quaternion. + + The quaternion to normalize. + When the method completes, contains the normalized quaternion. + + + + Converts the quaternion into a unit quaternion. + + The quaternion to normalize. + The normalized quaternion. + + + + Creates a quaternion given a rotation and an axis. + + The axis of rotation. + The angle of rotation. + When the method completes, contains the newly created quaternion. + + + + Creates a quaternion given a rotation and an axis. + + The axis of rotation. + The angle of rotation. + The newly created quaternion. + + + + Creates a quaternion given a rotation matrix. + + The rotation matrix. + When the method completes, contains the newly created quaternion. + + + + Creates a quaternion given a rotation matrix. + + The rotation matrix. + When the method completes, contains the newly created quaternion. + + + + Creates a left-handed, look-at quaternion. + + The position of the viewer's eye. + The camera look-at target. + The camera's up vector. + When the method completes, contains the created look-at quaternion. + + + + Creates a left-handed, look-at quaternion. + + The position of the viewer's eye. + The camera look-at target. + The camera's up vector. + The created look-at quaternion. + + + + Creates a left-handed, look-at quaternion. + + The camera's forward direction. + The camera's up vector. + When the method completes, contains the created look-at quaternion. + + + + Creates a left-handed, look-at quaternion. + + The camera's forward direction. + The camera's up vector. + The created look-at quaternion. + + + + Creates a right-handed, look-at quaternion. + + The position of the viewer's eye. + The camera look-at target. + The camera's up vector. + When the method completes, contains the created look-at quaternion. + + + + Creates a right-handed, look-at quaternion. + + The position of the viewer's eye. + The camera look-at target. + The camera's up vector. + The created look-at quaternion. + + + + Creates a right-handed, look-at quaternion. + + The camera's forward direction. + The camera's up vector. + When the method completes, contains the created look-at quaternion. + + + + Creates a right-handed, look-at quaternion. + + The camera's forward direction. + The camera's up vector. + The created look-at quaternion. + + + + Creates a left-handed spherical billboard that rotates around a specified object position. + + The position of the object around which the billboard will rotate. + The position of the camera. + The up vector of the camera. + The forward vector of the camera. + When the method completes, contains the created billboard quaternion. + + + + Creates a left-handed spherical billboard that rotates around a specified object position. + + The position of the object around which the billboard will rotate. + The position of the camera. + The up vector of the camera. + The forward vector of the camera. + The created billboard quaternion. + + + + Creates a right-handed spherical billboard that rotates around a specified object position. + + The position of the object around which the billboard will rotate. + The position of the camera. + The up vector of the camera. + The forward vector of the camera. + When the method completes, contains the created billboard quaternion. + + + + Creates a right-handed spherical billboard that rotates around a specified object position. + + The position of the object around which the billboard will rotate. + The position of the camera. + The up vector of the camera. + The forward vector of the camera. + The created billboard quaternion. + + + + Creates a quaternion given a rotation matrix. + + The rotation matrix. + The newly created quaternion. + + + + Creates a quaternion given a yaw, pitch, and roll value. + + The yaw of rotation. + The pitch of rotation. + The roll of rotation. + When the method completes, contains the newly created quaternion. + + + + Creates a quaternion given a yaw, pitch, and roll value. + + The yaw of rotation. + The pitch of rotation. + The roll of rotation. + The newly created quaternion. + + + + Interpolates between two quaternions, using spherical linear interpolation. + + Start quaternion. + End quaternion. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the spherical linear interpolation of the two quaternions. + + + + Interpolates between two quaternions, using spherical linear interpolation. + + Start quaternion. + End quaternion. + Value between 0 and 1 indicating the weight of . + The spherical linear interpolation of the two quaternions. + + + + Interpolates between quaternions, using spherical quadrangle interpolation. + + First source quaternion. + Second source quaternion. + Third source quaternion. + Fourth source quaternion. + Value between 0 and 1 indicating the weight of interpolation. + When the method completes, contains the spherical quadrangle interpolation of the quaternions. + + + + Interpolates between quaternions, using spherical quadrangle interpolation. + + First source quaternion. + Second source quaternion. + Third source quaternion. + Fourth source quaternion. + Value between 0 and 1 indicating the weight of interpolation. + The spherical quadrangle interpolation of the quaternions. + + + + Sets up control points for spherical quadrangle interpolation. + + First source quaternion. + Second source quaternion. + Third source quaternion. + Fourth source quaternion. + An array of three quaternions that represent control points for spherical quadrangle interpolation. + + + + Adds two quaternions. + + The first quaternion to add. + The second quaternion to add. + The sum of the two quaternions. + + + + Subtracts two quaternions. + + The first quaternion to subtract. + The second quaternion to subtract. + The difference of the two quaternions. + + + + Reverses the direction of a given quaternion. + + The quaternion to negate. + A quaternion facing in the opposite direction. + + + + Scales a quaternion by the given value. + + The quaternion to scale. + The amount by which to scale the quaternion. + The scaled quaternion. + + + + Scales a quaternion by the given value. + + The quaternion to scale. + The amount by which to scale the quaternion. + The scaled quaternion. + + + + Multiplies a quaternion by another. + + The first quaternion to multiply. + The second quaternion to multiply. + The multiplied quaternion. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Random functions on commun types. + + + + + Gets random float number within range. + + Current . + Minimum. + Maximum. + Random float number. + + + + Gets random double number within range. + + Current . + Minimum. + Maximum. + Random double number. + + + + Gets random long number. + + Current . + Random long number. + + + + Gets random long number within range. + + Current . + Minimum. + Maximum. + Random long number. + + + + Gets random within range. + + Current . + Minimum. + Maximum. + Random . + + + + Gets random within range. + + Current . + Minimum. + Maximum. + Random . + + + + Gets random within range. + + Current . + Minimum. + Maximum. + Random . + + + + Gets random opaque . + + Current . + Random . + + + + Gets random opaque . + + Current . + Minimum brightness. + Maximum brightness + Random . + + + + Gets random . + + Current . + Minimum brightness. + Maximum brightness + Alpha value. + Random . + + + + Gets random . + + Current . + Minimum brightness. + Maximum brightness + Minimum alpha. + Maximum alpha. + Random . + + + + Gets random . + + Current . + Minimum. + Maximum. + Random . + + + + Gets random . + + Current . + Minimum. + Maximum. + Random . + + + + Represents a three dimensional line based on a point in space and a direction. + + + + + The position in three dimensional space where the ray starts. + + + + + The normalized direction in which the ray points. + + + + + Initializes a new instance of the struct. + + The position in three dimensional space of the origin of the ray. + The normalized direction of the ray. + + + + Determines if there is an intersection between the current object and a point. + + The point to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The ray to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The ray to test. + When the method completes, contains the point of intersection, + or if there was no intersection. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The plane to test + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The plane to test. + When the method completes, contains the distance of the intersection, + or 0 if there was no intersection. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The plane to test. + When the method completes, contains the point of intersection, + or if there was no intersection. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a triangle. + + The first vertex of the triangle to test. + The second vertex of the triangle to test. + The third vertex of the triangle to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a triangle. + + The first vertex of the triangle to test. + The second vertex of the triangle to test. + The third vertex of the triangle to test. + When the method completes, contains the distance of the intersection, + or 0 if there was no intersection. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a triangle. + + The first vertex of the triangle to test. + The second vertex of the triangle to test. + The third vertex of the triangle to test. + When the method completes, contains the point of intersection, + or if there was no intersection. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The box to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The box to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The box to test. + When the method completes, contains the distance of the intersection, + or 0 if there was no intersection. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The box to test. + When the method completes, contains the point of intersection, + or if there was no intersection. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The sphere to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The sphere to test. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The sphere to test. + When the method completes, contains the distance of the intersection, + or 0 if there was no intersection. + Whether the two objects intersected. + + + + Determines if there is an intersection between the current object and a . + + The sphere to test. + When the method completes, contains the point of intersection, + or if there was no intersection. + Whether the two objects intersected. + + + + Calculates a world space from 2d screen coordinates. + + X coordinate on 2d screen. + Y coordinate on 2d screen. + . + Transformation . + Resulting . + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Define a Rectangle. This structure is slightly different from System.Drawing.Rectangle as it is + internally storing Left,Top,Right,Bottom instead of Left,Top,Width,Height. + + + + + The left. + + + + + The top. + + + + + The right. + + + + + The bottom. + + + + + An empty rectangle. + + + + + Initializes a new instance of the struct. + + The left. + The top. + The width. + The height. + + + + Gets or sets the X position. + + The X position. + + + + Gets or sets the Y position. + + The Y position. + + + + Gets or sets the width. + + The width. + + + + Gets or sets the height. + + The height. + + + + Gets a value that indicates whether the rectangle is empty. + + + true if [is empty]; otherwise, false. + + + + Changes the position of the rectangle. + Change in the x-position. + Change in the y-position. + + + Pushes the edges of the rectangle out by the horizontal and vertical values specified. + Value to push the sides out by. + Value to push the top and bottom out by. + + + Determines whether this rectangle contains a specified point represented by its x- and y-coordinates. + The x-coordinate of the specified point. + The y-coordinate of the specified point. + + + Determines whether this rectangle entirely contains a specified rectangle. + The rectangle to evaluate. + + + Determines whether this rectangle entirely contains a specified rectangle. + The rectangle to evaluate. + [OutAttribute] On exit, is true if this rectangle entirely contains the specified rectangle, or false if not. + + + + Checks, if specified point is inside . + + X point coordinate. + Y point coordinate. + true if point is inside , otherwise false. + + + Determines whether a specified rectangle intersects with this rectangle. + The rectangle to evaluate. + + + + Determines whether a specified rectangle intersects with this rectangle. + + The rectangle to evaluate + [OutAttribute] true if the specified rectangle intersects with this one; false otherwise. + + + + Creates a rectangle defining the area where one rectangle overlaps with another rectangle. + + The first rectangle to compare. + The second rectangle to compare. + The intersection rectangle. + + + Creates a rectangle defining the area where one rectangle overlaps with another rectangle. + The first rectangle to compare. + The second rectangle to compare. + [OutAttribute] The area where the two first parameters overlap. + + + + Creates a new rectangle that exactly contains two other rectangles. + + The first rectangle to contain. + The second rectangle to contain. + The union rectangle. + + + + Creates a new rectangle that exactly contains two other rectangles. + + The first rectangle to contain. + The second rectangle to contain. + [OutAttribute] The rectangle that must be the union of the first two rectangles. + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Implements the operator ==. + + The left. + The right. + The result of the operator. + + + + Implements the operator !=. + + The left. + The right. + The result of the operator. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Define a RectangleF. This structure is slightly different from System.Drawing.RectangleF as it is + internally storing Left,Top,Right,Bottom instead of Left,Top,Width,Height. + + + + + The left. + + + + + The top. + + + + + The right. + + + + + The bottom. + + + + + An empty rectangle. + + + + + An infinite rectangle. See remarks. + + + http://msdn.microsoft.com/en-us/library/windows/desktop/dd372261%28v=vs.85%29.aspx + Any properties that involve computations, like , or + may return incorrect results - . + + + + + Initializes a new instance of the struct. + + The left. + The top. + The width. + The height. + + + + Gets or sets the X position. + + The X position. + + + + Gets or sets the Y position. + + The Y position. + + + + Gets or sets the width. + + The width. + + + + Gets or sets the height. + + The height. + + + + Gets or sets the location. + + + The location. + + + + + Gets the Point that specifies the center of the rectangle. + + + The center. + + + + + Gets a value that indicates whether the rectangle is empty. + + + true if [is empty]; otherwise, false. + + + + + Gets or sets the size of the rectangle. + + The size of the rectangle. + + + + Gets the position of the top-left corner of the rectangle. + + The top-left corner of the rectangle. + + + + Gets the position of the top-right corner of the rectangle. + + The top-right corner of the rectangle. + + + + Gets the position of the bottom-left corner of the rectangle. + + The bottom-left corner of the rectangle. + + + + Gets the position of the bottom-right corner of the rectangle. + + The bottom-right corner of the rectangle. + + + Changes the position of the rectangle. + The values to adjust the position of the rectangle by. + + + Changes the position of the rectangle. + The values to adjust the position of the rectangle by. + + + Changes the position of the rectangle. + Change in the x-position. + Change in the y-position. + + + Pushes the edges of the rectangle out by the horizontal and vertical values specified. + Value to push the sides out by. + Value to push the top and bottom out by. + + + Determines whether this rectangle contains a specified Point. + The Point to evaluate. + [OutAttribute] true if the specified Point is contained within this rectangle; false otherwise. + + + Determines whether this rectangle entirely contains a specified rectangle. + The rectangle to evaluate. + + + Determines whether this rectangle entirely contains a specified rectangle. + The rectangle to evaluate. + [OutAttribute] On exit, is true if this rectangle entirely contains the specified rectangle, or false if not. + + + + Checks, if specified point is inside . + + X point coordinate. + Y point coordinate. + true if point is inside , otherwise false. + + + + Checks, if specified is inside . + + Coordinate . + true if is inside , otherwise false. + + + + Checks, if specified is inside . + + Coordinate . + true if is inside , otherwise false. + + + Determines whether a specified rectangle intersects with this rectangle. + The rectangle to evaluate. + + + + Determines whether a specified rectangle intersects with this rectangle. + + The rectangle to evaluate + [OutAttribute] true if the specified rectangle intersects with this one; false otherwise. + + + + Creates a rectangle defining the area where one rectangle overlaps with another rectangle. + + The first Rectangle to compare. + The second Rectangle to compare. + The intersection rectangle. + + + Creates a rectangle defining the area where one rectangle overlaps with another rectangle. + The first rectangle to compare. + The second rectangle to compare. + [OutAttribute] The area where the two first parameters overlap. + + + + Creates a new rectangle that exactly contains two other rectangles. + + The first rectangle to contain. + The second rectangle to contain. + The union rectangle. + + + + Creates a new rectangle that exactly contains two other rectangles. + + The first rectangle to contain. + The second rectangle to contain. + [OutAttribute] The rectangle that must be the union of the first two rectangles. + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Implements the operator ==. + + The left. + The right. + The result of the operator. + + + + Implements the operator !=. + + The left. + The right. + The result of the operator. + + + + Performs an explicit conversion to structure. + + Performs direct float to int conversion, any fractional data is truncated. + The source value. + A converted structure. + + + + Performs an explicit conversion to structure. + + Performs direct float to int conversion, any fractional data is truncated. + The source value. + A converted structure. + + + + Performs an explicit conversion to structure. + + Performs direct float to int conversion, any fractional data is truncated. + The source value. + A converted structure. + + + + Represents a two dimensional mathematical vector. + + + + + The size of the type, in bytes. + + + + + A with all of its components set to zero. + + + + + The X unit (1, 0). + + + + + The Y unit (0, 1). + + + + + A with all of its components set to one. + + + + + The X component of the vector. + + + + + The Y component of the vector. + + + + + Initializes a new instance of the struct. + + The value that will be assigned to all components. + + + + Initializes a new instance of the struct. + + Initial value for the X component of the vector. + Initial value for the Y component of the vector. + + + + Initializes a new instance of the struct. + + The values to assign to the X and Y components of the vector. This must be an array with two elements. + Thrown when is null. + Thrown when contains more or less than two elements. + + + + Gets a value indicting whether this instance is normalized. + + + + + Gets a value indicting whether this vector is zero + + + + + Gets or sets the component at the specified index. + + The value of the X or Y component, depending on the index. + The index of the component to access. Use 0 for the X component and 1 for the Y component. + The value of the component at the specified index. + Thrown when the is out of the range [0, 1]. + + + + Calculates the length of the vector. + + The length of the vector. + + may be preferred when only the relative length is needed + and speed is of the essence. + + + + + Calculates the squared length of the vector. + + The squared length of the vector. + + This method may be preferred to when only a relative length is needed + and speed is of the essence. + + + + + Converts the vector into a unit vector. + + + + + Creates an array containing the elements of the vector. + + A two-element array containing the components of the vector. + + + + Adds two vectors. + + The first vector to add. + The second vector to add. + When the method completes, contains the sum of the two vectors. + + + + Adds two vectors. + + The first vector to add. + The second vector to add. + The sum of the two vectors. + + + + Perform a component-wise addition + + The input vector + The scalar value to be added to elements + The vector with added scalar for each element. + + + + Perform a component-wise addition + + The input vector + The scalar value to be added to elements + The vector with added scalar for each element. + + + + Subtracts two vectors. + + The first vector to subtract. + The second vector to subtract. + When the method completes, contains the difference of the two vectors. + + + + Subtracts two vectors. + + The first vector to subtract. + The second vector to subtract. + The difference of the two vectors. + + + + Perform a component-wise subtraction + + The input vector + The scalar value to be subtraced from elements + The vector with subtracted scalar for each element. + + + + Perform a component-wise subtraction + + The input vector + The scalar value to be subtraced from elements + The vector with subtracted scalar for each element. + + + + Perform a component-wise subtraction + + The scalar value to be subtraced from elements + The input vector + The vector with subtracted scalar for each element. + + + + Perform a component-wise subtraction + + The scalar value to be subtraced from elements + The input vector + The vector with subtracted scalar for each element. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + When the method completes, contains the scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Multiplies a vector with another by performing component-wise multiplication. + + The first vector to multiply. + The second vector to multiply. + When the method completes, contains the multiplied vector. + + + + Multiplies a vector with another by performing component-wise multiplication. + + The first vector to multiply. + The second vector to multiply. + The multiplied vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + When the method completes, contains the scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Scales a vector by the given value. + + The amount by which to scale the vector. + The vector to scale. + When the method completes, contains the scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Reverses the direction of a given vector. + + The vector to negate. + When the method completes, contains a vector facing in the opposite direction. + + + + Reverses the direction of a given vector. + + The vector to negate. + A vector facing in the opposite direction. + + + + Returns per component absolute value of a vector + + Input vector + When the method completes, contains a vector with each component being the absolute value of the input component + + + + Returns per component absolute value of a vector + + Input vector + A vector with each component being the absolute value of the input component + + + + Returns a containing the 2D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 2D triangle. + + A containing the 2D Cartesian coordinates of vertex 1 of the triangle. + A containing the 2D Cartesian coordinates of vertex 2 of the triangle. + A containing the 2D Cartesian coordinates of vertex 3 of the triangle. + Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in ). + Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in ). + When the method completes, contains the 2D Cartesian coordinates of the specified point. + + + + Returns a containing the 2D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 2D triangle. + + A containing the 2D Cartesian coordinates of vertex 1 of the triangle. + A containing the 2D Cartesian coordinates of vertex 2 of the triangle. + A containing the 2D Cartesian coordinates of vertex 3 of the triangle. + Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in ). + Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in ). + A new containing the 2D Cartesian coordinates of the specified point. + + + + Restricts a value to be within a specified range. + + The value to clamp. + The minimum value. + The maximum value. + When the method completes, contains the clamped value. + + + + Restricts a value to be within a specified range. + + The value to clamp. + The minimum value. + The maximum value. + The clamped value. + + + + Saturates this instance in the range [0,1] + + + + + Calculates the distance between two vectors. + + The first vector. + The second vector. + When the method completes, contains the distance between the two vectors. + + may be preferred when only the relative distance is needed + and speed is of the essence. + + + + + Calculates the distance between two vectors. + + The first vector. + The second vector. + The distance between the two vectors. + + may be preferred when only the relative distance is needed + and speed is of the essence. + + + + + Calculates the squared distance between two vectors. + + The first vector. + The second vector + When the method completes, contains the squared distance between the two vectors. + Distance squared is the value before taking the square root. + Distance squared can often be used in place of distance if relative comparisons are being made. + For example, consider three points A, B, and C. To determine whether B or C is further from A, + compare the distance between A and B to the distance between A and C. Calculating the two distances + involves two square roots, which are computationally expensive. However, using distance squared + provides the same information and avoids calculating two square roots. + + + + + Calculates the squared distance between two vectors. + + The first vector. + The second vector. + The squared distance between the two vectors. + Distance squared is the value before taking the square root. + Distance squared can often be used in place of distance if relative comparisons are being made. + For example, consider three points A, B, and C. To determine whether B or C is further from A, + compare the distance between A and B to the distance between A and C. Calculating the two distances + involves two square roots, which are computationally expensive. However, using distance squared + provides the same information and avoids calculating two square roots. + + + + + Calculates the dot product of two vectors. + + First source vector. + Second source vector. + When the method completes, contains the dot product of the two vectors. + + + + Calculates the dot product of two vectors. + + First source vector. + Second source vector. + The dot product of the two vectors. + + + + Converts the vector into a unit vector. + + The vector to normalize. + When the method completes, contains the normalized vector. + + + + Converts the vector into a unit vector. + + The vector to normalize. + The normalized vector. + + + + Performs a linear interpolation between two vectors. + + Start vector. + End vector. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the linear interpolation of the two vectors. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a linear interpolation between two vectors. + + Start vector. + End vector. + Value between 0 and 1 indicating the weight of . + The linear interpolation of the two vectors. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a cubic interpolation between two vectors. + + Start vector. + End vector. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the cubic interpolation of the two vectors. + + + + Performs a cubic interpolation between two vectors. + + Start vector. + End vector. + Value between 0 and 1 indicating the weight of . + The cubic interpolation of the two vectors. + + + + Performs a Hermite spline interpolation. + + First source position vector. + First source tangent vector. + Second source position vector. + Second source tangent vector. + Weighting factor. + When the method completes, contains the result of the Hermite spline interpolation. + + + + Performs a Hermite spline interpolation. + + First source position vector. + First source tangent vector. + Second source position vector. + Second source tangent vector. + Weighting factor. + The result of the Hermite spline interpolation. + + + + Performs a Catmull-Rom interpolation using the specified positions. + + The first position in the interpolation. + The second position in the interpolation. + The third position in the interpolation. + The fourth position in the interpolation. + Weighting factor. + When the method completes, contains the result of the Catmull-Rom interpolation. + + + + Performs a Catmull-Rom interpolation using the specified positions. + + The first position in the interpolation. + The second position in the interpolation. + The third position in the interpolation. + The fourth position in the interpolation. + Weighting factor. + A vector that is the result of the Catmull-Rom interpolation. + + + + Returns a vector containing the largest components of the specified vectors. + + The first source vector. + The second source vector. + When the method completes, contains an new vector composed of the largest components of the source vectors. + + + + Returns a vector containing the largest components of the specified vectors. + + The first source vector. + The second source vector. + A vector containing the largest components of the source vectors. + + + + Returns a vector containing the smallest components of the specified vectors. + + The first source vector. + The second source vector. + When the method completes, contains an new vector composed of the smallest components of the source vectors. + + + + Returns a vector containing the smallest components of the specified vectors. + + The first source vector. + The second source vector. + A vector containing the smallest components of the source vectors. + + + + Returns the reflection of a vector off a surface that has the specified normal. + + The source vector. + Normal of the surface. + When the method completes, contains the reflected vector. + Reflect only gives the direction of a reflection off a surface, it does not determine + whether the original vector was close enough to the surface to hit it. + + + + Returns the reflection of a vector off a surface that has the specified normal. + + The source vector. + Normal of the surface. + The reflected vector. + Reflect only gives the direction of a reflection off a surface, it does not determine + whether the original vector was close enough to the surface to hit it. + + + + Orthogonalizes a list of vectors. + + The list of orthogonalized vectors. + The list of vectors to orthogonalize. + + Orthogonalization is the process of making all vectors orthogonal to each other. This + means that any given vector in the list will be orthogonal to any other given vector in the + list. + Because this method uses the modified Gram-Schmidt process, the resulting vectors + tend to be numerically unstable. The numeric stability decreases according to the vectors + position in the list so that the first vector is the most stable and the last vector is the + least stable. + + Thrown when or is null. + Thrown when is shorter in length than . + + + + Orthonormalizes a list of vectors. + + The list of orthonormalized vectors. + The list of vectors to orthonormalize. + + Orthonormalization is the process of making all vectors orthogonal to each + other and making all vectors of unit length. This means that any given vector will + be orthogonal to any other given vector in the list. + Because this method uses the modified Gram-Schmidt process, the resulting vectors + tend to be numerically unstable. The numeric stability decreases according to the vectors + position in the list so that the first vector is the most stable and the last vector is the + least stable. + + Thrown when or is null. + Thrown when is shorter in length than . + + + + Transforms a 2D vector by the given rotation. + + The vector to rotate. + The rotation to apply. + When the method completes, contains the transformed . + + + + Transforms a 2D vector by the given rotation. + + The vector to rotate. + The rotation to apply. + The transformed . + + + + Transforms an array of vectors by the given rotation. + + The array of vectors to transform. + The rotation to apply. + The array for which the transformed vectors are stored. + This array may be the same array as . + Thrown when or is null. + Thrown when is shorter in length than . + + + + Transforms a 2D vector by the given . + + The source vector. + The transformation . + When the method completes, contains the transformed . + + + + Transforms a 2D vector by the given . + + The source vector. + The transformation . + The transformed . + + + + Transforms an array of 2D vectors by the given . + + The array of vectors to transform. + The transformation . + The array for which the transformed vectors are stored. + Thrown when or is null. + Thrown when is shorter in length than . + + + + Performs a coordinate transformation using the given . + + The coordinate vector to transform. + The transformation . + When the method completes, contains the transformed coordinates. + + A coordinate transform performs the transformation with the assumption that the w component + is one. The four dimensional vector obtained from the transformation operation has each + component in the vector divided by the w component. This forces the w component to be one and + therefore makes the vector homogeneous. The homogeneous vector is often preferred when working + with coordinates as the w component can safely be ignored. + + + + + Performs a coordinate transformation using the given . + + The coordinate vector to transform. + The transformation . + The transformed coordinates. + + A coordinate transform performs the transformation with the assumption that the w component + is one. The four dimensional vector obtained from the transformation operation has each + component in the vector divided by the w component. This forces the w component to be one and + therefore makes the vector homogeneous. The homogeneous vector is often preferred when working + with coordinates as the w component can safely be ignored. + + + + + Performs a coordinate transformation on an array of vectors using the given . + + The array of coordinate vectors to transform. + The transformation . + The array for which the transformed vectors are stored. + This array may be the same array as . + Thrown when or is null. + Thrown when is shorter in length than . + + A coordinate transform performs the transformation with the assumption that the w component + is one. The four dimensional vector obtained from the transformation operation has each + component in the vector divided by the w component. This forces the w component to be one and + therefore makes the vector homogeneous. The homogeneous vector is often preferred when working + with coordinates as the w component can safely be ignored. + + + + + Performs a normal transformation using the given . + + The normal vector to transform. + The transformation . + When the method completes, contains the transformed normal. + + A normal transform performs the transformation with the assumption that the w component + is zero. This causes the fourth row and fourth column of the matrix to be unused. The + end result is a vector that is not translated, but all other transformation properties + apply. This is often preferred for normal vectors as normals purely represent direction + rather than location because normal vectors should not be translated. + + + + + Performs a normal transformation using the given . + + The normal vector to transform. + The transformation . + The transformed normal. + + A normal transform performs the transformation with the assumption that the w component + is zero. This causes the fourth row and fourth column of the matrix to be unused. The + end result is a vector that is not translated, but all other transformation properties + apply. This is often preferred for normal vectors as normals purely represent direction + rather than location because normal vectors should not be translated. + + + + + Performs a normal transformation on an array of vectors using the given . + + The array of normal vectors to transform. + The transformation . + The array for which the transformed vectors are stored. + This array may be the same array as . + Thrown when or is null. + Thrown when is shorter in length than . + + A normal transform performs the transformation with the assumption that the w component + is zero. This causes the fourth row and fourth column of the matrix to be unused. The + end result is a vector that is not translated, but all other transformation properties + apply. This is often preferred for normal vectors as normals purely represent direction + rather than location because normal vectors should not be translated. + + + + + Adds two vectors. + + The first vector to add. + The second vector to add. + The sum of the two vectors. + + + + Multiplies a vector with another by performing component-wise multiplication equivalent to . + + The first vector to multiply. + The second vector to multiply. + The multiplication of the two vectors. + + + + Assert a vector (return it unchanged). + + The vector to assert (unchanged). + The asserted (unchanged) vector. + + + + Subtracts two vectors. + + The first vector to subtract. + The second vector to subtract. + The difference of the two vectors. + + + + Reverses the direction of a given vector. + + The vector to negate. + A vector facing in the opposite direction. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Scales a vector by the given value. + + The amount by which to scale the vector. + The vector to scale. + The scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Perform a component-wise addition + + The input vector. + The scalar value to be added on elements + The vector with added scalar for each element. + + + + Perform a component-wise addition + + The input vector. + The scalar value to be added on elements + The vector with added scalar for each element. + + + + Perform a component-wise subtraction + + The input vector. + The scalar value to be subtraced from elements + The vector with subtraced scalar from each element. + + + + Perform a component-wise subtraction + + The input vector. + The scalar value to be subtraced from elements + The vector with subtraced scalar from each element. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Represents a three dimensional mathematical vector. + + + + + The size of the type, in bytes. + + + + + A with all of its components set to zero. + + + + + The X unit (1, 0, 0). + + + + + The Y unit (0, 1, 0). + + + + + The Z unit (0, 0, 1). + + + + + A with all of its components set to one. + + + + + A unit designating up (0, 1, 0). + + + + + A unit designating down (0, -1, 0). + + + + + A unit designating left (-1, 0, 0). + + + + + A unit designating right (1, 0, 0). + + + + + A unit designating forward in a right-handed coordinate system (0, 0, -1). + + + + + A unit designating forward in a left-handed coordinate system (0, 0, 1). + + + + + A unit designating backward in a right-handed coordinate system (0, 0, 1). + + + + + A unit designating backward in a left-handed coordinate system (0, 0, -1). + + + + + The X component of the vector. + + + + + The Y component of the vector. + + + + + The Z component of the vector. + + + + + Initializes a new instance of the struct. + + The value that will be assigned to all components. + + + + Initializes a new instance of the struct. + + Initial value for the X component of the vector. + Initial value for the Y component of the vector. + Initial value for the Z component of the vector. + + + + Initializes a new instance of the struct. + + A vector containing the values with which to initialize the X and Y components. + Initial value for the Z component of the vector. + + + + Initializes a new instance of the struct. + + The values to assign to the X, Y, and Z components of the vector. This must be an array with three elements. + Thrown when is null. + Thrown when contains more or less than three elements. + + + + Gets a value indicting whether this instance is normalized. + + + + + Gets a value indicting whether this vector is zero + + + + + Gets or sets the component at the specified index. + + The value of the X, Y, or Z component, depending on the index. + The index of the component to access. Use 0 for the X component, 1 for the Y component, and 2 for the Z component. + The value of the component at the specified index. + Thrown when the is out of the range [0, 2]. + + + + Calculates the length of the vector. + + The length of the vector. + + may be preferred when only the relative length is needed + and speed is of the essence. + + + + + Calculates the squared length of the vector. + + The squared length of the vector. + + This method may be preferred to when only a relative length is needed + and speed is of the essence. + + + + + Converts the vector into a unit vector. + + + + + Creates an array containing the elements of the vector. + + A three-element array containing the components of the vector. + + + + Adds two vectors. + + The first vector to add. + The second vector to add. + When the method completes, contains the sum of the two vectors. + + + + Adds two vectors. + + The first vector to add. + The second vector to add. + The sum of the two vectors. + + + + Perform a component-wise addition + + The input vector + The scalar value to be added to elements + The vector with added scalar for each element. + + + + Perform a component-wise addition + + The input vector + The scalar value to be added to elements + The vector with added scalar for each element. + + + + Subtracts two vectors. + + The first vector to subtract. + The second vector to subtract. + When the method completes, contains the difference of the two vectors. + + + + Subtracts two vectors. + + The first vector to subtract. + The second vector to subtract. + The difference of the two vectors. + + + + Perform a component-wise subtraction + + The input vector + The scalar value to be subtraced from elements + The vector with subtracted scalar for each element. + + + + Perform a component-wise subtraction + + The input vector + The scalar value to be subtraced from elements + The vector with subtracted scalar for each element. + + + + Perform a component-wise subtraction + + The scalar value to be subtraced from elements + The input vector. + The vector with subtracted scalar for each element. + + + + Perform a component-wise subtraction + + The scalar value to be subtraced from elements + The input vector. + The vector with subtracted scalar for each element. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + When the method completes, contains the scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Multiply a vector with another by performing component-wise multiplication. + + The first vector to multiply. + The second vector to multiply. + When the method completes, contains the multiplied vector. + + + + Multiply a vector with another by performing component-wise multiplication. + + The first vector to Multiply. + The second vector to multiply. + The multiplied vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + When the method completes, contains the scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Scales a vector by the given value. + + The amount by which to scale the vector. + The vector to scale. + When the method completes, contains the scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Reverses the direction of a given vector. + + The vector to negate. + When the method completes, contains a vector facing in the opposite direction. + + + + Reverses the direction of a given vector. + + The vector to negate. + A vector facing in the opposite direction. + + + + Returns per component absolute value of a vector + + Input vector + When the method completes, contains a vector with each component being the absolute value of the input component + + + + Returns per component absolute value of a vector + + Input vector + A vector with each component being the absolute value of the input component + + + + Returns a containing the 3D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 3D triangle. + + A containing the 3D Cartesian coordinates of vertex 1 of the triangle. + A containing the 3D Cartesian coordinates of vertex 2 of the triangle. + A containing the 3D Cartesian coordinates of vertex 3 of the triangle. + Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in ). + Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in ). + When the method completes, contains the 3D Cartesian coordinates of the specified point. + + + + Returns a containing the 3D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 3D triangle. + + A containing the 3D Cartesian coordinates of vertex 1 of the triangle. + A containing the 3D Cartesian coordinates of vertex 2 of the triangle. + A containing the 3D Cartesian coordinates of vertex 3 of the triangle. + Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in ). + Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in ). + A new containing the 3D Cartesian coordinates of the specified point. + + + + Restricts a value to be within a specified range. + + The value to clamp. + The minimum value. + The maximum value. + When the method completes, contains the clamped value. + + + + Restricts a value to be within a specified range. + + The value to clamp. + The minimum value. + The maximum value. + The clamped value. + + + + Calculates the cross product of two vectors. + + First source vector. + Second source vector. + When the method completes, contains he cross product of the two vectors. + + + + Calculates the cross product of two vectors. + + First source vector. + Second source vector. + The cross product of the two vectors. + + + + Calculates the distance between two vectors. + + The first vector. + The second vector. + When the method completes, contains the distance between the two vectors. + + may be preferred when only the relative distance is needed + and speed is of the essence. + + + + + Calculates the distance between two vectors. + + The first vector. + The second vector. + The distance between the two vectors. + + may be preferred when only the relative distance is needed + and speed is of the essence. + + + + + Calculates the squared distance between two vectors. + + The first vector. + The second vector. + When the method completes, contains the squared distance between the two vectors. + Distance squared is the value before taking the square root. + Distance squared can often be used in place of distance if relative comparisons are being made. + For example, consider three points A, B, and C. To determine whether B or C is further from A, + compare the distance between A and B to the distance between A and C. Calculating the two distances + involves two square roots, which are computationally expensive. However, using distance squared + provides the same information and avoids calculating two square roots. + + + + + Calculates the squared distance between two vectors. + + The first vector. + The second vector. + The squared distance between the two vectors. + Distance squared is the value before taking the square root. + Distance squared can often be used in place of distance if relative comparisons are being made. + For example, consider three points A, B, and C. To determine whether B or C is further from A, + compare the distance between A and B to the distance between A and C. Calculating the two distances + involves two square roots, which are computationally expensive. However, using distance squared + provides the same information and avoids calculating two square roots. + + + + + Tests whether one 3D vector is near another 3D vector. + + The left vector. + The right vector. + The epsilon. + true if left and right are near another 3D, false otherwise + + + + Tests whether one 3D vector is near another 3D vector. + + The left vector. + The right vector. + The epsilon. + true if left and right are near another 3D, false otherwise + + + + Calculates the dot product of two vectors. + + First source vector. + Second source vector. + When the method completes, contains the dot product of the two vectors. + + + + Calculates the dot product of two vectors. + + First source vector. + Second source vector. + The dot product of the two vectors. + + + + Converts the vector into a unit vector. + + The vector to normalize. + When the method completes, contains the normalized vector. + + + + Converts the vector into a unit vector. + + The vector to normalize. + The normalized vector. + + + + Performs a linear interpolation between two vectors. + + Start vector. + End vector. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the linear interpolation of the two vectors. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a linear interpolation between two vectors. + + Start vector. + End vector. + Value between 0 and 1 indicating the weight of . + The linear interpolation of the two vectors. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a cubic interpolation between two vectors. + + Start vector. + End vector. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the cubic interpolation of the two vectors. + + + + Performs a cubic interpolation between two vectors. + + Start vector. + End vector. + Value between 0 and 1 indicating the weight of . + The cubic interpolation of the two vectors. + + + + Performs a Hermite spline interpolation. + + First source position vector. + First source tangent vector. + Second source position vector. + Second source tangent vector. + Weighting factor. + When the method completes, contains the result of the Hermite spline interpolation. + + + + Performs a Hermite spline interpolation. + + First source position vector. + First source tangent vector. + Second source position vector. + Second source tangent vector. + Weighting factor. + The result of the Hermite spline interpolation. + + + + Performs a Catmull-Rom interpolation using the specified positions. + + The first position in the interpolation. + The second position in the interpolation. + The third position in the interpolation. + The fourth position in the interpolation. + Weighting factor. + When the method completes, contains the result of the Catmull-Rom interpolation. + + + + Performs a Catmull-Rom interpolation using the specified positions. + + The first position in the interpolation. + The second position in the interpolation. + The third position in the interpolation. + The fourth position in the interpolation. + Weighting factor. + A vector that is the result of the Catmull-Rom interpolation. + + + + Returns a vector containing the largest components of the specified vectors. + + The first source vector. + The second source vector. + When the method completes, contains an new vector composed of the largest components of the source vectors. + + + + Returns a vector containing the largest components of the specified vectors. + + The first source vector. + The second source vector. + A vector containing the largest components of the source vectors. + + + + Returns a vector containing the smallest components of the specified vectors. + + The first source vector. + The second source vector. + When the method completes, contains an new vector composed of the smallest components of the source vectors. + + + + Returns a vector containing the smallest components of the specified vectors. + + The first source vector. + The second source vector. + A vector containing the smallest components of the source vectors. + + + + Projects a 3D vector from object space into screen space. + + The vector to project. + The X position of the viewport. + The Y position of the viewport. + The width of the viewport. + The height of the viewport. + The minimum depth of the viewport. + The maximum depth of the viewport. + The combined world-view-projection matrix. + When the method completes, contains the vector in screen space. + + + + Projects a 3D vector from object space into screen space. + + The vector to project. + The X position of the viewport. + The Y position of the viewport. + The width of the viewport. + The height of the viewport. + The minimum depth of the viewport. + The maximum depth of the viewport. + The combined world-view-projection matrix. + The vector in screen space. + + + + Projects a 3D vector from screen space into object space. + + The vector to project. + The X position of the viewport. + The Y position of the viewport. + The width of the viewport. + The height of the viewport. + The minimum depth of the viewport. + The maximum depth of the viewport. + The combined world-view-projection matrix. + When the method completes, contains the vector in object space. + + + + Projects a 3D vector from screen space into object space. + + The vector to project. + The X position of the viewport. + The Y position of the viewport. + The width of the viewport. + The height of the viewport. + The minimum depth of the viewport. + The maximum depth of the viewport. + The combined world-view-projection matrix. + The vector in object space. + + + + Returns the reflection of a vector off a surface that has the specified normal. + + The source vector. + Normal of the surface. + When the method completes, contains the reflected vector. + Reflect only gives the direction of a reflection off a surface, it does not determine + whether the original vector was close enough to the surface to hit it. + + + + Returns the reflection of a vector off a surface that has the specified normal. + + The source vector. + Normal of the surface. + The reflected vector. + Reflect only gives the direction of a reflection off a surface, it does not determine + whether the original vector was close enough to the surface to hit it. + + + + Orthogonalizes a list of vectors. + + The list of orthogonalized vectors. + The list of vectors to orthogonalize. + + Orthogonalization is the process of making all vectors orthogonal to each other. This + means that any given vector in the list will be orthogonal to any other given vector in the + list. + Because this method uses the modified Gram-Schmidt process, the resulting vectors + tend to be numerically unstable. The numeric stability decreases according to the vectors + position in the list so that the first vector is the most stable and the last vector is the + least stable. + + Thrown when or is null. + Thrown when is shorter in length than . + + + + Orthonormalizes a list of vectors. + + The list of orthonormalized vectors. + The list of vectors to orthonormalize. + + Orthonormalization is the process of making all vectors orthogonal to each + other and making all vectors of unit length. This means that any given vector will + be orthogonal to any other given vector in the list. + Because this method uses the modified Gram-Schmidt process, the resulting vectors + tend to be numerically unstable. The numeric stability decreases according to the vectors + position in the list so that the first vector is the most stable and the last vector is the + least stable. + + Thrown when or is null. + Thrown when is shorter in length than . + + + + Transforms a 3D vector by the given rotation. + + The vector to rotate. + The rotation to apply. + When the method completes, contains the transformed . + + + + Transforms a 3D vector by the given rotation. + + The vector to rotate. + The rotation to apply. + The transformed . + + + + Transforms an array of vectors by the given rotation. + + The array of vectors to transform. + The rotation to apply. + The array for which the transformed vectors are stored. + This array may be the same array as . + Thrown when or is null. + Thrown when is shorter in length than . + + + + Transforms a 3D vector by the given . + + The source vector. + The transformation . + When the method completes, contains the transformed . + + + + Transforms a 3D vector by the given . + + The source vector. + The transformation . + The transformed . + + + + Transforms a 3D vector by the given . + + The source vector. + The transformation . + When the method completes, contains the transformed . + + + + Transforms a 3D vector by the given . + + The source vector. + The transformation . + When the method completes, contains the transformed . + + + + Transforms a 3D vector by the given . + + The source vector. + The transformation . + The transformed . + + + + Transforms an array of 3D vectors by the given . + + The array of vectors to transform. + The transformation . + The array for which the transformed vectors are stored. + Thrown when or is null. + Thrown when is shorter in length than . + + + + Performs a coordinate transformation using the given . + + The coordinate vector to transform. + The transformation . + When the method completes, contains the transformed coordinates. + + A coordinate transform performs the transformation with the assumption that the w component + is one. The four dimensional vector obtained from the transformation operation has each + component in the vector divided by the w component. This forces the w component to be one and + therefore makes the vector homogeneous. The homogeneous vector is often preferred when working + with coordinates as the w component can safely be ignored. + + + + + Performs a coordinate transformation using the given . + + The coordinate vector to transform. + The transformation . + The transformed coordinates. + + A coordinate transform performs the transformation with the assumption that the w component + is one. The four dimensional vector obtained from the transformation operation has each + component in the vector divided by the w component. This forces the w component to be one and + therefore makes the vector homogeneous. The homogeneous vector is often preferred when working + with coordinates as the w component can safely be ignored. + + + + + Performs a coordinate transformation on an array of vectors using the given . + + The array of coordinate vectors to transform. + The transformation . + The array for which the transformed vectors are stored. + This array may be the same array as . + Thrown when or is null. + Thrown when is shorter in length than . + + A coordinate transform performs the transformation with the assumption that the w component + is one. The four dimensional vector obtained from the transformation operation has each + component in the vector divided by the w component. This forces the w component to be one and + therefore makes the vector homogeneous. The homogeneous vector is often preferred when working + with coordinates as the w component can safely be ignored. + + + + + Performs a normal transformation using the given . + + The normal vector to transform. + The transformation . + When the method completes, contains the transformed normal. + + A normal transform performs the transformation with the assumption that the w component + is zero. This causes the fourth row and fourth column of the matrix to be unused. The + end result is a vector that is not translated, but all other transformation properties + apply. This is often preferred for normal vectors as normals purely represent direction + rather than location because normal vectors should not be translated. + + + + + Performs a normal transformation using the given . + + The normal vector to transform. + The transformation . + The transformed normal. + + A normal transform performs the transformation with the assumption that the w component + is zero. This causes the fourth row and fourth column of the matrix to be unused. The + end result is a vector that is not translated, but all other transformation properties + apply. This is often preferred for normal vectors as normals purely represent direction + rather than location because normal vectors should not be translated. + + + + + Performs a normal transformation on an array of vectors using the given . + + The array of normal vectors to transform. + The transformation . + The array for which the transformed vectors are stored. + This array may be the same array as . + Thrown when or is null. + Thrown when is shorter in length than . + + A normal transform performs the transformation with the assumption that the w component + is zero. This causes the fourth row and fourth column of the matrix to be unused. The + end result is a vector that is not translated, but all other transformation properties + apply. This is often preferred for normal vectors as normals purely represent direction + rather than location because normal vectors should not be translated. + + + + + Adds two vectors. + + The first vector to add. + The second vector to add. + The sum of the two vectors. + + + + Multiplies a vector with another by performing component-wise multiplication equivalent to . + + The first vector to multiply. + The second vector to multiply. + The multiplication of the two vectors. + + + + Assert a vector (return it unchanged). + + The vector to assert (unchanged). + The asserted (unchanged) vector. + + + + Subtracts two vectors. + + The first vector to subtract. + The second vector to subtract. + The difference of the two vectors. + + + + Reverses the direction of a given vector. + + The vector to negate. + A vector facing in the opposite direction. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Scales a vector by the given value. + + The amount by which to scale the vector. + The vector to scale. + The scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Perform a component-wise addition + + The input vector. + The scalar value to be added on elements + The vector with added scalar for each element. + + + + Perform a component-wise addition + + The input vector. + The scalar value to be added on elements + The vector with added scalar for each element. + + + + Perform a component-wise subtraction + + The input vector. + The scalar value to be subtraced from elements + The vector with added scalar from each element. + + + + Perform a component-wise subtraction + + The input vector. + The scalar value to be subtraced from elements + The vector with subtraced scalar from each element. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Represents a four dimensional mathematical vector. + + + + + The size of the type, in bytes. + + + + + A with all of its components set to zero. + + + + + The X unit (1, 0, 0, 0). + + + + + The Y unit (0, 1, 0, 0). + + + + + The Z unit (0, 0, 1, 0). + + + + + The W unit (0, 0, 0, 1). + + + + + A with all of its components set to one. + + + + + The X component of the vector. + + + + + The Y component of the vector. + + + + + The Z component of the vector. + + + + + The W component of the vector. + + + + + Initializes a new instance of the struct. + + The value that will be assigned to all components. + + + + Initializes a new instance of the struct. + + Initial value for the X component of the vector. + Initial value for the Y component of the vector. + Initial value for the Z component of the vector. + Initial value for the W component of the vector. + + + + Initializes a new instance of the struct. + + A vector containing the values with which to initialize the X, Y, and Z components. + Initial value for the W component of the vector. + + + + Initializes a new instance of the struct. + + A vector containing the values with which to initialize the X and Y components. + Initial value for the Z component of the vector. + Initial value for the W component of the vector. + + + + Initializes a new instance of the struct. + + The values to assign to the X, Y, Z, and W components of the vector. This must be an array with four elements. + Thrown when is null. + Thrown when contains more or less than four elements. + + + + Gets a value indicting whether this instance is normalized. + + + + + Gets a value indicting whether this vector is zero + + + + + Gets or sets the component at the specified index. + + The value of the X, Y, Z, or W component, depending on the index. + The index of the component to access. Use 0 for the X component, 1 for the Y component, 2 for the Z component, and 3 for the W component. + The value of the component at the specified index. + Thrown when the is out of the range [0, 3]. + + + + Calculates the length of the vector. + + The length of the vector. + + may be preferred when only the relative length is needed + and speed is of the essence. + + + + + Calculates the squared length of the vector. + + The squared length of the vector. + + This method may be preferred to when only a relative length is needed + and speed is of the essence. + + + + + Converts the vector into a unit vector. + + + + + Creates an array containing the elements of the vector. + + A four-element array containing the components of the vector. + + + + Adds two vectors. + + The first vector to add. + The second vector to add. + When the method completes, contains the sum of the two vectors. + + + + Adds two vectors. + + The first vector to add. + The second vector to add. + The sum of the two vectors. + + + + Perform a component-wise addition + + The input vector + The scalar value to be added to elements + The vector with added scalar for each element. + + + + Perform a component-wise addition + + The input vector + The scalar value to be added to elements + The vector with added scalar for each element. + + + + Subtracts two vectors. + + The first vector to subtract. + The second vector to subtract. + When the method completes, contains the difference of the two vectors. + + + + Subtracts two vectors. + + The first vector to subtract. + The second vector to subtract. + The difference of the two vectors. + + + + Perform a component-wise subtraction + + The input vector + The scalar value to be subtraced from elements + The vector with subtracted scalar for each element. + + + + Perform a component-wise subtraction + + The input vector + The scalar value to be subtraced from elements + The vector with subtracted scalar for each element. + + + + Perform a component-wise subtraction + + The scalar value to be subtraced from elements + The input vector. + The vector with subtracted scalar for each element. + + + + Perform a component-wise subtraction + + The scalar value to be subtraced from elements + The input vector. + The vector with subtracted scalar for each element. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + When the method completes, contains the scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Multiplies a vector with another by performing component-wise multiplication. + + The first vector to multiply. + The second vector to multiply. + When the method completes, contains the multiplied vector. + + + + Multiplies a vector with another by performing component-wise multiplication. + + The first vector to multiply. + The second vector to multiply. + The multiplied vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + When the method completes, contains the scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Scales a vector by the given value. + + The amount by which to scale the vector. + The vector to scale. + When the method completes, contains the scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Reverses the direction of a given vector. + + The vector to negate. + When the method completes, contains a vector facing in the opposite direction. + + + + Reverses the direction of a given vector. + + The vector to negate. + A vector facing in the opposite direction. + + + + Returns a containing the 4D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 4D triangle. + + A containing the 4D Cartesian coordinates of vertex 1 of the triangle. + A containing the 4D Cartesian coordinates of vertex 2 of the triangle. + A containing the 4D Cartesian coordinates of vertex 3 of the triangle. + Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in ). + Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in ). + When the method completes, contains the 4D Cartesian coordinates of the specified point. + + + + Returns a containing the 4D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 4D triangle. + + A containing the 4D Cartesian coordinates of vertex 1 of the triangle. + A containing the 4D Cartesian coordinates of vertex 2 of the triangle. + A containing the 4D Cartesian coordinates of vertex 3 of the triangle. + Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in ). + Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in ). + A new containing the 4D Cartesian coordinates of the specified point. + + + + Restricts a value to be within a specified range. + + The value to clamp. + The minimum value. + The maximum value. + When the method completes, contains the clamped value. + + + + Restricts a value to be within a specified range. + + The value to clamp. + The minimum value. + The maximum value. + The clamped value. + + + + Calculates the distance between two vectors. + + The first vector. + The second vector. + When the method completes, contains the distance between the two vectors. + + may be preferred when only the relative distance is needed + and speed is of the essence. + + + + + Calculates the distance between two vectors. + + The first vector. + The second vector. + The distance between the two vectors. + + may be preferred when only the relative distance is needed + and speed is of the essence. + + + + + Calculates the squared distance between two vectors. + + The first vector. + The second vector. + When the method completes, contains the squared distance between the two vectors. + Distance squared is the value before taking the square root. + Distance squared can often be used in place of distance if relative comparisons are being made. + For example, consider three points A, B, and C. To determine whether B or C is further from A, + compare the distance between A and B to the distance between A and C. Calculating the two distances + involves two square roots, which are computationally expensive. However, using distance squared + provides the same information and avoids calculating two square roots. + + + + + Calculates the squared distance between two vectors. + + The first vector. + The second vector. + The squared distance between the two vectors. + Distance squared is the value before taking the square root. + Distance squared can often be used in place of distance if relative comparisons are being made. + For example, consider three points A, B, and C. To determine whether B or C is further from A, + compare the distance between A and B to the distance between A and C. Calculating the two distances + involves two square roots, which are computationally expensive. However, using distance squared + provides the same information and avoids calculating two square roots. + + + + + Calculates the dot product of two vectors. + + First source vector + Second source vector. + When the method completes, contains the dot product of the two vectors. + + + + Calculates the dot product of two vectors. + + First source vector. + Second source vector. + The dot product of the two vectors. + + + + Converts the vector into a unit vector. + + The vector to normalize. + When the method completes, contains the normalized vector. + + + + Converts the vector into a unit vector. + + The vector to normalize. + The normalized vector. + + + + Performs a linear interpolation between two vectors. + + Start vector. + End vector. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the linear interpolation of the two vectors. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a linear interpolation between two vectors. + + Start vector. + End vector. + Value between 0 and 1 indicating the weight of . + The linear interpolation of the two vectors. + + Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned. + + + + + Performs a cubic interpolation between two vectors. + + Start vector. + End vector. + Value between 0 and 1 indicating the weight of . + When the method completes, contains the cubic interpolation of the two vectors. + + + + Performs a cubic interpolation between two vectors. + + Start vector. + End vector. + Value between 0 and 1 indicating the weight of . + The cubic interpolation of the two vectors. + + + + Performs a Hermite spline interpolation. + + First source position vector. + First source tangent vector. + Second source position vector. + Second source tangent vector. + Weighting factor. + When the method completes, contains the result of the Hermite spline interpolation. + + + + Performs a Hermite spline interpolation. + + First source position vector. + First source tangent vector. + Second source position vector. + Second source tangent vector. + Weighting factor. + The result of the Hermite spline interpolation. + + + + Performs a Catmull-Rom interpolation using the specified positions. + + The first position in the interpolation. + The second position in the interpolation. + The third position in the interpolation. + The fourth position in the interpolation. + Weighting factor. + When the method completes, contains the result of the Catmull-Rom interpolation. + + + + Performs a Catmull-Rom interpolation using the specified positions. + + The first position in the interpolation. + The second position in the interpolation. + The third position in the interpolation. + The fourth position in the interpolation. + Weighting factor. + A vector that is the result of the Catmull-Rom interpolation. + + + + Returns a vector containing the largest components of the specified vectors. + + The first source vector. + The second source vector. + When the method completes, contains an new vector composed of the largest components of the source vectors. + + + + Returns a vector containing the largest components of the specified vectors. + + The first source vector. + The second source vector. + A vector containing the largest components of the source vectors. + + + + Returns a vector containing the smallest components of the specified vectors. + + The first source vector. + The second source vector. + When the method completes, contains an new vector composed of the smallest components of the source vectors. + + + + Returns a vector containing the smallest components of the specified vectors. + + The first source vector. + The second source vector. + A vector containing the smallest components of the source vectors. + + + + Orthogonalizes a list of vectors. + + The list of orthogonalized vectors. + The list of vectors to orthogonalize. + + Orthogonalization is the process of making all vectors orthogonal to each other. This + means that any given vector in the list will be orthogonal to any other given vector in the + list. + Because this method uses the modified Gram-Schmidt process, the resulting vectors + tend to be numerically unstable. The numeric stability decreases according to the vectors + position in the list so that the first vector is the most stable and the last vector is the + least stable. + + Thrown when or is null. + Thrown when is shorter in length than . + + + + Orthonormalizes a list of vectors. + + The list of orthonormalized vectors. + The list of vectors to orthonormalize. + + Orthonormalization is the process of making all vectors orthogonal to each + other and making all vectors of unit length. This means that any given vector will + be orthogonal to any other given vector in the list. + Because this method uses the modified Gram-Schmidt process, the resulting vectors + tend to be numerically unstable. The numeric stability decreases according to the vectors + position in the list so that the first vector is the most stable and the last vector is the + least stable. + + Thrown when or is null. + Thrown when is shorter in length than . + + + + Transforms a 4D vector by the given rotation. + + The vector to rotate. + The rotation to apply. + When the method completes, contains the transformed . + + + + Transforms a 4D vector by the given rotation. + + The vector to rotate. + The rotation to apply. + The transformed . + + + + Transforms an array of vectors by the given rotation. + + The array of vectors to transform. + The rotation to apply. + The array for which the transformed vectors are stored. + This array may be the same array as . + Thrown when or is null. + Thrown when is shorter in length than . + + + + Transforms a 4D vector by the given . + + The source vector. + The transformation . + When the method completes, contains the transformed . + + + + Transforms a 4D vector by the given . + + The source vector. + The transformation . + The transformed . + + + + Transforms a 4D vector by the given . + + The source vector. + The transformation . + When the method completes, contains the transformed . + + + + Transforms a 4D vector by the given . + + The source vector. + The transformation . + The transformed . + + + + Transforms an array of 4D vectors by the given . + + The array of vectors to transform. + The transformation . + The array for which the transformed vectors are stored. + This array may be the same array as . + Thrown when or is null. + Thrown when is shorter in length than . + + + + Adds two vectors. + + The first vector to add. + The second vector to add. + The sum of the two vectors. + + + + Multiplies a vector with another by performing component-wise multiplication equivalent to . + + The first vector to multiply. + The second vector to multiply. + The multiplication of the two vectors. + + + + Assert a vector (return it unchanged). + + The vector to assert (unchanged). + The asserted (unchanged) vector. + + + + Subtracts two vectors. + + The first vector to subtract. + The second vector to subtract. + The difference of the two vectors. + + + + Reverses the direction of a given vector. + + The vector to negate. + A vector facing in the opposite direction. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Scales a vector by the given value. + + The amount by which to scale the vector. + The vector to scale. + The scaled vector. + + + + Scales a vector by the given value. + + The vector to scale. + The amount by which to scale the vector. + The scaled vector. + + + + Perform a component-wise addition + + The input vector. + The scalar value to be added on elements + The vector with added scalar for each element. + + + + Perform a component-wise addition + + The input vector. + The scalar value to be added on elements + The vector with added scalar for each element. + + + + Perform a component-wise subtraction + + The input vector. + The scalar value to be subtraced from elements + The vector with subtraced scalar from each element. + + + + Perform a component-wise subtraction + + The input vector. + The scalar value to be subtraced from elements + The vector with subtraced scalar from each element. + + + + Tests for equality between two objects. + + The first value to compare. + The second value to compare. + true if has the same value as ; otherwise, false. + + + + Tests for inequality between two objects. + + The first value to compare. + The second value to compare. + true if has a different value than ; otherwise, false. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format provider. + + A that represents this instance. + + + + + Returns a that represents this instance. + + The format. + The format provider. + + A that represents this instance. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Defines the viewport dimensions. + + + + + Position of the pixel coordinate of the upper-left corner of the viewport. + + + + + Position of the pixel coordinate of the upper-left corner of the viewport. + + + + + Width dimension of the viewport. + + + + + Height dimension of the viewport. + + + + + Gets or sets the minimum depth of the clip volume. + + + + + Gets or sets the maximum depth of the clip volume. + + + + + Initializes a new instance of the struct. + + The x coordinate of the upper-left corner of the viewport in pixels. + The y coordinate of the upper-left corner of the viewport in pixels. + The width of the viewport in pixels. + The height of the viewport in pixels. + + + + Initializes a new instance of the struct. + + The x coordinate of the upper-left corner of the viewport in pixels. + The y coordinate of the upper-left corner of the viewport in pixels. + The width of the viewport in pixels. + The height of the viewport in pixels. + The minimum depth of the clip volume. + The maximum depth of the clip volume. + + + + Initializes a new instance of the struct. + + A bounding box that defines the location and size of the viewport in a render target. + + + + Gets the size of this resource. + + The bounds. + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified object is equal to this instance. + + The object to compare with this instance. + + true if the specified object is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Implements the operator ==. + + The left. + The right. + The result of the operator. + + + + Implements the operator !=. + + The left. + The right. + The result of the operator. + + + + Retrieves a string representation of this object. + + A that represents this instance. + + + + Projects a 3D vector from object space into screen space. + + The vector to project. + The projection matrix. + The view matrix. + The world matrix. + The projected vector. + + + + Projects a 3D vector from object space into screen space. + + The vector to project. + A combined WorldViewProjection matrix. + The projected vector. + + + + Converts a screen space point into a corresponding point in world space. + + The vector to project. + The projection matrix. + The view matrix. + The world matrix. + The unprojected Vector. + + + + Converts a screen space point into a corresponding point in world space. + + The vector to project. + An inverted combined WorldViewProjection matrix. + The unprojected vector. + + + + Gets the aspect ratio used by the viewport. + + The aspect ratio. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Defines the viewport dimensions using float coordinates for (X,Y,Width,Height). + + + + + Position of the pixel coordinate of the upper-left corner of the viewport. + + + + + Position of the pixel coordinate of the upper-left corner of the viewport. + + + + + Width dimension of the viewport. + + + + + Height dimension of the viewport. + + + + + Gets or sets the minimum depth of the clip volume. + + + + + Gets or sets the maximum depth of the clip volume. + + + + + Initializes a new instance of the struct. + + The x coordinate of the upper-left corner of the viewport in pixels. + The y coordinate of the upper-left corner of the viewport in pixels. + The width of the viewport in pixels. + The height of the viewport in pixels. + + + + Initializes a new instance of the struct. + + The x coordinate of the upper-left corner of the viewport in pixels. + The y coordinate of the upper-left corner of the viewport in pixels. + The width of the viewport in pixels. + The height of the viewport in pixels. + The minimum depth of the clip volume. + The maximum depth of the clip volume. + + + + Initializes a new instance of the struct. + + A bounding box that defines the location and size of the viewport in a render target. + + + + Gets the size of this resource. + + The bounds. + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Determines whether the specified object is equal to this instance. + + The object to compare with this instance. + + true if the specified object is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Implements the operator ==. + + The left. + The right. + The result of the operator. + + + + Implements the operator !=. + + The left. + The right. + The result of the operator. + + + + Retrieves a string representation of this object. + + A that represents this instance. + + + + + Projects a 3D vector from object space into screen space. + + The vector to project. + A combined WorldViewProjection matrix. + The projected vector. + + + + Converts a screen space point into a corresponding point in world space. + + The vector to project. + The projection matrix. + The view matrix. + The world matrix. + The unprojected Vector. + + + + Converts a screen space point into a corresponding point in world space. + + The vector to project. + An inverted combined WorldViewProjection matrix. + The unprojected vector. + + + + Gets the aspect ratio used by the viewport. + + The aspect ratio. + + + + Performs an explicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + + Performs an implicit conversion from to . + + The value. + The result of the conversion. + + + diff --git a/Test/dll/SharpDX.dll b/Test/dll/SharpDX.dll new file mode 100644 index 00000000..d4163a84 Binary files /dev/null and b/Test/dll/SharpDX.dll differ diff --git a/Test/dll/SoundDecoder.dll b/Test/dll/SoundDecoder.dll new file mode 100644 index 00000000..f8729118 Binary files /dev/null and b/Test/dll/SoundDecoder.dll differ diff --git a/Test/dll/bass.dll b/Test/dll/bass.dll new file mode 100644 index 00000000..87cd8314 Binary files /dev/null and b/Test/dll/bass.dll differ diff --git a/Test/dll/bass_fx.dll b/Test/dll/bass_fx.dll new file mode 100644 index 00000000..381fa5f8 Binary files /dev/null and b/Test/dll/bass_fx.dll differ diff --git a/Test/dll/bassasio.dll b/Test/dll/bassasio.dll new file mode 100644 index 00000000..1edfec70 Binary files /dev/null and b/Test/dll/bassasio.dll differ diff --git a/Test/dll/bassenc.dll b/Test/dll/bassenc.dll new file mode 100644 index 00000000..dc1c5922 Binary files /dev/null and b/Test/dll/bassenc.dll differ diff --git a/Test/dll/bassmix.dll b/Test/dll/bassmix.dll new file mode 100644 index 00000000..92d080cf Binary files /dev/null and b/Test/dll/bassmix.dll differ diff --git a/Test/dll/basswasapi.dll b/Test/dll/basswasapi.dll new file mode 100644 index 00000000..9877a2b4 Binary files /dev/null and b/Test/dll/basswasapi.dll differ diff --git a/Test/dll/msvcm90.dll b/Test/dll/msvcm90.dll new file mode 100644 index 00000000..434353d8 Binary files /dev/null and b/Test/dll/msvcm90.dll differ diff --git a/Test/dll/msvcp90.dll b/Test/dll/msvcp90.dll new file mode 100644 index 00000000..af6cc3da Binary files /dev/null and b/Test/dll/msvcp90.dll differ diff --git a/Test/dll/msvcr90.dll b/Test/dll/msvcr90.dll new file mode 100644 index 00000000..ec7f83a3 Binary files /dev/null and b/Test/dll/msvcr90.dll differ diff --git a/Test/dll/xadec.dll b/Test/dll/xadec.dll new file mode 100644 index 00000000..a415cdbc Binary files /dev/null and b/Test/dll/xadec.dll differ