1
0
mirror of synced 2025-02-06 22:34:26 +01:00

0.6.0.25 - Prevent CCounter from halting due to very large BPM (#759)

- Prevent CCounter from halting due to very large BPM
This commit is contained in:
Wei-Cheng Yeh (IID) 2024-12-06 18:56:34 +08:00 committed by GitHub
parent 744370db0b
commit 7e73a8314f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
20 changed files with 159 additions and 140 deletions

View File

@ -13,6 +13,7 @@
/// ///
/// double値を使う場合、t進行db、t進行LoopDbを使うこと。 /// double値を使う場合、t進行db、t進行LoopDbを使うこと。
/// また、double版では間隔の値はミリ秒単位ではなく、通常の秒単位になります。 /// また、double版では間隔の値はミリ秒単位ではなく、通常の秒単位になります。
/// Note: For the double version, the given interval is in second only for new CCounter(), not for Start().
/// </remarks> /// </remarks>
public class CCounter { public class CCounter {
public bool IsStarted { public bool IsStarted {
@ -33,23 +34,23 @@ public class CCounter {
set; set;
} }
public double _Interval { public double _msInterval {
get { get {
return this.Interval; return this.msInterval;
} }
set { set {
this.Interval = value >= 0 ? value : value * -1; this.msInterval = Math.Max(1e-6, Math.Abs(value));
} }
} }
public double NowTime { public double msNowTime {
get; get;
set; set;
} }
// 状態プロパティ // 状態プロパティ
public bool IsTicked { public bool IsTicked {
get { return (this.NowTime != -1); } get { return (this.msNowTime != -1); }
} }
public bool IsStoped { public bool IsStoped {
get { return !this.IsTicked; } get { return !this.IsTicked; }
@ -69,19 +70,19 @@ public class CCounter {
this.EndValue = 0; this.EndValue = 0;
this.CurrentValue = 0; this.CurrentValue = 0;
this.CurrentValue = 0; this.CurrentValue = 0;
this.NowTime = CSoundTimer.UnusedNum; this.msNowTime = CSoundTimer.UnusedNum;
} }
/// <summary>生成と同時に開始する。</summary> /// <summary>生成と同時に開始する。</summary>
public CCounter(double begin, double end, double interval, CTimer timer) public CCounter(double begin, double end, double msInterval, CTimer timer)
: this() { : this() {
this.Start(begin, end, interval, timer); this.Start(begin, end, msInterval, timer);
} }
/// <summary>生成と同時に開始する。(double版)</summary> /// <summary>生成と同時に開始する。(double版)</summary>
public CCounter(double begin, double end, double interval, CSoundTimer timer) public CCounter(double begin, double end, double secInterval, CSoundTimer timer)
: this() { : this() {
this.Start(begin, end, interval * 1000.0f, timer); this.Start(begin, end, secInterval * 1000.0f, timer);
} }
@ -92,14 +93,14 @@ public class CCounter {
/// </summary> /// </summary>
/// <param name="begin">最初のカウント値。</param> /// <param name="begin">最初のカウント値。</param>
/// <param name="end">最後のカウント値。</param> /// <param name="end">最後のカウント値。</param>
/// <param name="interval">カウント値を1増加させるのにかける時間(ミリ秒単位)。</param> /// <param name="msInterval">カウント値を1増加させるのにかける時間(ミリ秒単位)。</param>
/// <param name="timer">カウントに使用するタイマ。</param> /// <param name="timer">カウントに使用するタイマ。</param>
public void Start(double begin, double end, double interval, CTimer timer) { public void Start(double begin, double end, double msInterval, CTimer timer) {
this.BeginValue = begin; this.BeginValue = begin;
this.EndValue = end; this.EndValue = end;
this._Interval = interval; this._msInterval = msInterval;
this.NormalTimer = timer; this.NormalTimer = timer;
this.NowTime = this.NormalTimer.NowTime; this.msNowTime = this.NormalTimer.NowTimeMs;
this.CurrentValue = (int)begin; this.CurrentValue = (int)begin;
this.IsStarted = true; this.IsStarted = true;
} }
@ -109,14 +110,14 @@ public class CCounter {
/// </summary> /// </summary>
/// <param name="begin">最初のカウント値。</param> /// <param name="begin">最初のカウント値。</param>
/// <param name="end">最後のカウント値。</param> /// <param name="end">最後のカウント値。</param>
/// <param name="interval">カウント値を1増加させるのにかける時間(秒単位)。</param> /// <param name="msInterval">カウント値を1増加させるのにかける時間(ミリ秒単位)。</param>
/// <param name="timer">カウントに使用するタイマ。</param> /// <param name="timer">カウントに使用するタイマ。</param>
public void Start(double begin, double end, double interval, CSoundTimer timer) { public void Start(double begin, double end, double msInterval, CSoundTimer timer) {
this.BeginValue = begin; this.BeginValue = begin;
this.EndValue = end; this.EndValue = end;
this._Interval = interval; this._msInterval = msInterval;
this.TimerDB = timer; this.TimerDB = timer;
this.NowTime = this.TimerDB.SystemTime_Double; this.msNowTime = this.TimerDB.SystemTimeMs_Double;
this.CurrentValue = (int)begin; this.CurrentValue = (int)begin;
this.IsStarted = true; this.IsStarted = true;
} }
@ -126,17 +127,21 @@ public class CCounter {
/// カウント値が終了値に達している場合は、それ以上増加しない(終了値を維持する)。 /// カウント値が終了値に達している場合は、それ以上増加しない(終了値を維持する)。
/// </summary> /// </summary>
public void Tick() { public void Tick() {
if ((this.NormalTimer != null) && (this.NowTime != CTimer.UnusedNum)) { if ((this.NormalTimer != null) && (this.msNowTime != CTimer.UnusedNum)) {
long num = this.NormalTimer.NowTime; long msNow = this.NormalTimer.NowTimeMs;
if (num < this.NowTime) if (msNow < this.msNowTime)
this.NowTime = num; this.msNowTime = msNow;
while ((num - this.NowTime) >= this.Interval) { for (int i = 0; i < 8; ++i) {
if ((msNow - this.msNowTime) < this.msInterval)
return;
if (++this.CurrentValue > this.EndValue) if (++this.CurrentValue > this.EndValue)
this.CurrentValue = (int)this.EndValue; this.CurrentValue = (int)this.EndValue;
this.NowTime += this.Interval; this.msNowTime += this.msInterval;
} }
this.TickJump(msNow);
} }
} }
@ -145,18 +150,36 @@ public class CCounter {
/// カウント値が終了値に達している場合は、それ以上増加しない(終了値を維持する)。 /// カウント値が終了値に達している場合は、それ以上増加しない(終了値を維持する)。
/// </summary> /// </summary>
public void TickDB() { public void TickDB() {
if ((this.TimerDB != null) && (this.NowTime != CSoundTimer.UnusedNum)) { if ((this.TimerDB != null) && (this.msNowTime != CSoundTimer.UnusedNum)) {
double num = this.TimerDB.NowTime; double msNow = this.TimerDB.NowTimeMs;
if (num < this.NowTime) if (msNow < this.msNowTime)
this.NowTime = num; this.msNowTime = msNow;
while ((num - this.NowTime) >= this.Interval) { for (int i = 0; i < 8; ++i) {
if ((msNow - this.msNowTime) < this.msInterval)
return;
if (++this.CurrentValue > this.EndValue) if (++this.CurrentValue > this.EndValue)
this.CurrentValue = (int)this.EndValue; this.CurrentValue = (int)this.EndValue;
this.NowTime += this.Interval; this.msNowTime += this.msInterval;
}
this.TickJump(msNow);
} }
} }
/// Jump over precalculated steps. Might be slower due to float division.
private void TickJump(double msNow) {
if ((msNow - this.msNowTime) < this.msInterval)
return;
int nStepsMax = (int)this.EndValue + 1 - (int)this.BeginValue;
long nSteps = (long)((msNow - this.msNowTime) / this.msInterval);
if (nSteps >= nStepsMax // attempt to prevent overflow
|| (this.CurrentValue += (int)nSteps) > this.EndValue
) {
this.CurrentValue = (int)this.EndValue;
}
this.msNowTime += nSteps * this.msInterval;
} }
/// <summary> /// <summary>
@ -164,17 +187,21 @@ public class CCounter {
/// カウント値が終了値に達している場合は、次の増加タイミングで開始値に戻る(値がループする)。 /// カウント値が終了値に達している場合は、次の増加タイミングで開始値に戻る(値がループする)。
/// </summary> /// </summary>
public void TickLoop() { public void TickLoop() {
if ((this.NormalTimer != null) && (this.NowTime != CTimer.UnusedNum)) { if ((this.NormalTimer != null) && (this.msNowTime != CTimer.UnusedNum)) {
long num = this.NormalTimer.NowTime; long msNow = this.NormalTimer.NowTimeMs;
if (num < this.NowTime) if (msNow < this.msNowTime)
this.NowTime = num; this.msNowTime = msNow;
while ((num - this.NowTime) >= this.Interval) { for (int i = 0; i < 8; ++i) {
if ((msNow - this.msNowTime) < this.msInterval)
return;
if (++this.CurrentValue > this.EndValue) if (++this.CurrentValue > this.EndValue)
this.CurrentValue = (int)this.BeginValue; this.CurrentValue = (int)this.BeginValue;
this.NowTime += this.Interval; this.msNowTime += this.msInterval;
} }
this.TickLoopJump(msNow);
} }
} }
@ -183,18 +210,35 @@ public class CCounter {
/// カウント値が終了値に達している場合は、次の増加タイミングで開始値に戻る(値がループする)。 /// カウント値が終了値に達している場合は、次の増加タイミングで開始値に戻る(値がループする)。
/// </summary> /// </summary>
public void TickLoopDB() { public void TickLoopDB() {
if ((this.TimerDB != null) && (this.NowTime != CSoundTimer.UnusedNum)) { if ((this.TimerDB != null) && (this.msNowTime != CSoundTimer.UnusedNum)) {
double num = this.TimerDB.NowTime; double msNow = this.TimerDB.NowTimeMs;
if (num < this.NowTime) if (msNow < this.msNowTime)
this.NowTime = num; this.msNowTime = msNow;
while ((num - this.NowTime) >= this.Interval) { for (int i = 0; i < 8; ++i) {
if ((msNow - this.msNowTime) < this.msInterval)
return;
if (++this.CurrentValue > this.EndValue) if (++this.CurrentValue > this.EndValue)
this.CurrentValue = (int)this.BeginValue; this.CurrentValue = (int)this.BeginValue;
this.NowTime += this.Interval; this.msNowTime += this.msInterval;
}
this.TickLoopJump(msNow);
} }
} }
/// Jump over precalculated steps. Might be slower due to float division.
private void TickLoopJump(double msNow) {
if ((msNow - this.msNowTime) < this.msInterval)
return;
int nStepsMax = (int)this.EndValue + 1 - (int)this.BeginValue;
long nSteps = (long)((msNow - this.msNowTime) / this.msInterval);
int dVal = (int)(nSteps % nStepsMax); // attempt to prevent overflow
if ((this.CurrentValue += dVal) > this.EndValue) {
this.CurrentValue = (int)this.BeginValue;
}
this.msNowTime += nSteps * this.msInterval;
} }
/// <summary> /// <summary>
@ -202,11 +246,11 @@ public class CCounter {
/// これ以降に t進行() や t進行Loop() を呼び出しても何も処理されない。 /// これ以降に t進行() や t進行Loop() を呼び出しても何も処理されない。
/// </summary> /// </summary>
public void Stop() { public void Stop() {
this.NowTime = CTimer.UnusedNum; this.msNowTime = CTimer.UnusedNum;
} }
public void ChangeInterval(double Value) { public void ChangeInterval(double Value) {
this._Interval = Value; this._msInterval = Value;
} }
// その他 // その他
@ -232,23 +276,23 @@ public class CCounter {
keyProcess(); keyProcess();
this.CurrentValue = second; this.CurrentValue = second;
this.NowTime = this.NormalTimer.NowTime; this.msNowTime = this.NormalTimer.NowTimeMs;
return; return;
case second: case second:
if ((this.NormalTimer.NowTime - this.NowTime) > 200) { if ((this.NormalTimer.NowTimeMs - this.msNowTime) > 200) {
keyProcess(); keyProcess();
this.NowTime = this.NormalTimer.NowTime; this.msNowTime = this.NormalTimer.NowTimeMs;
this.CurrentValue = later; this.CurrentValue = later;
} }
return; return;
case later: case later:
if ((this.NormalTimer.NowTime - this.NowTime) > 30) { if ((this.NormalTimer.NowTimeMs - this.msNowTime) > 30) {
keyProcess(); keyProcess();
this.NowTime = this.NormalTimer.NowTime; this.msNowTime = this.NormalTimer.NowTimeMs;
} }
return; return;
} }
@ -265,7 +309,7 @@ public class CCounter {
//----------------- //-----------------
private CTimer NormalTimer; private CTimer NormalTimer;
private CSoundTimer TimerDB; private CSoundTimer TimerDB;
private double Interval; private double msInterval;
//----------------- //-----------------
#endregion #endregion
} }

View File

@ -23,7 +23,7 @@ public class CFPS {
this.NowFPS = 0; this.NowFPS = 0;
this.DeltaTime = 0; this.DeltaTime = 0;
this.FPSTimer = new CTimer(CTimer.TimerType.MultiMedia); this.FPSTimer = new CTimer(CTimer.TimerType.MultiMedia);
this.BeginTime = this.FPSTimer.NowTime; this.BeginTime = this.FPSTimer.NowTimeMs;
this.CoreFPS = 0; this.CoreFPS = 0;
this.ChangedFPS = false; this.ChangedFPS = false;
} }
@ -36,9 +36,9 @@ public class CFPS {
this.ChangedFPS = false; this.ChangedFPS = false;
const long INTERVAL = 1000; const long INTERVAL = 1000;
this.DeltaTime = (this.FPSTimer.NowTime - this.PrevFrameTime) / 1000.0; this.DeltaTime = (this.FPSTimer.NowTimeMs - this.PrevFrameTime) / 1000.0;
PrevFrameTime = this.FPSTimer.NowTime; PrevFrameTime = this.FPSTimer.NowTimeMs;
while ((this.FPSTimer.NowTime - this.BeginTime) >= INTERVAL) { while ((this.FPSTimer.NowTimeMs - this.BeginTime) >= INTERVAL) {
this.NowFPS = this.CoreFPS; this.NowFPS = this.CoreFPS;
this.CoreFPS = 0; this.CoreFPS = 0;
this.ChangedFPS = true; this.ChangedFPS = true;

View File

@ -17,31 +17,6 @@ public abstract class CTimerBase : IDisposable {
} }
public abstract void Dispose(); public abstract void Dispose();
#region [ DTXMania用にmsのつかない宣言を追加 ]
public long SystemTime {
get { return SystemTimeMs; }
}
public long NowTime {
get { return NowTimeMs; }
set { NowTimeMs = value; }
}
public long PrevResetTime {
get { return PrevResetTimeMs; }
}
//double
public double SystemTime_Double {
get { return SystemTimeMs_Double; }
}
public double NowTime_Double {
get { return NowTimeMs_Double; }
set { NowTimeMs_Double = value; }
}
public double PrevResetTime_Double {
get { return PrevResetTimeMs_Double; }
}
#endregion
public long NowTimeMs { public long NowTimeMs {
get { get {
if (this.StopCount > 0) if (this.StopCount > 0)

View File

@ -1083,7 +1083,7 @@ internal class CActConfigList : CActivity {
#region [ ] #region [ ]
//----------------- //-----------------
if (base.IsFirstDraw) { if (base.IsFirstDraw) {
this.nスクロール用タイマ値 = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); this.nスクロール用タイマ値 = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed);
this.ct三角矢印アニメ.Start(0, 9, 50, OpenTaiko.Timer); this.ct三角矢印アニメ.Start(0, 9, 50, OpenTaiko.Timer);
base.IsFirstDraw = false; base.IsFirstDraw = false;
} }
@ -1094,7 +1094,7 @@ internal class CActConfigList : CActivity {
#region [ ] #region [ ]
//----------------- //-----------------
long n現在時刻 = OpenTaiko.Timer.NowTime; long n現在時刻 = OpenTaiko.Timer.NowTimeMs;
if (n現在時刻 < this.nスクロール用タイマ値) this.nスクロール用タイマ値 = n現在時刻; if (n現在時刻 < this.nスクロール用タイマ値) this.nスクロール用タイマ値 = n現在時刻;
const int INTERVAL = 2; // [ms] const int INTERVAL = 2; // [ms]

View File

@ -50,7 +50,7 @@ internal class CActSelectPreimageパネル : CActivity {
if ((this.ctDelayedDisplay.CurrentValue >= 0) && this.bNewPreimageStillLoading) { if ((this.ctDelayedDisplay.CurrentValue >= 0) && this.bNewPreimageStillLoading) {
this.tUpdatePreimage(OpenTaiko.stageSongSelect.r現在選択中のスコア); this.tUpdatePreimage(OpenTaiko.stageSongSelect.r現在選択中のスコア);
OpenTaiko.Timer.Update(); OpenTaiko.Timer.Update();
this.ctDelayedDisplay.NowTime = OpenTaiko.Timer.NowTime; this.ctDelayedDisplay.msNowTime = OpenTaiko.Timer.NowTimeMs;
this.bNewPreimageLoaded = true; this.bNewPreimageLoaded = true;
} else if (this.ctDelayedDisplay.IsEnded && this.ctDelayedDisplay.IsTicked) { } else if (this.ctDelayedDisplay.IsEnded && this.ctDelayedDisplay.IsTicked) {
this.ctDelayedDisplay.Stop(); this.ctDelayedDisplay.Stop();

View File

@ -1373,7 +1373,7 @@ internal class CStageSongSelect : CStage {
STCommandTime _stct = new STCommandTime { STCommandTime _stct = new STCommandTime {
eInst = _eInst, eInst = _eInst,
ePad = _ePad, ePad = _ePad,
time = OpenTaiko.Timer.NowTime time = OpenTaiko.Timer.NowTimeMs
}; };
if (stct.Count >= buffersize) { if (stct.Count >= buffersize) {
@ -1400,7 +1400,7 @@ internal class CStageSongSelect : CStage {
return false; return false;
} }
long curTime = OpenTaiko.Timer.NowTime; long curTime = OpenTaiko.Timer.NowTimeMs;
//Debug.WriteLine("Start checking...targetCount=" + targetCount); //Debug.WriteLine("Start checking...targetCount=" + targetCount);
for (int i = targetCount - 1, j = stciCount - 1; i >= 0; i--, j--) { for (int i = targetCount - 1, j = stciCount - 1; i >= 0; i--, j--) {
if (_ePad[i] != stct[j].ePad) { if (_ePad[i] != stct[j].ePad) {

View File

@ -140,11 +140,11 @@ internal class CStage曲読み込み : CStage {
CSkin.CSystemSound.r最後に再生した排他システムサウンド.tStop(); CSkin.CSystemSound.r最後に再生した排他システムサウンド.tStop();
} }
this.sd読み込み音.PlayStart(); this.sd読み込み音.PlayStart();
this.nBGM再生開始時刻 = SoundManager.PlayTimer.NowTime; this.nBGM再生開始時刻 = SoundManager.PlayTimer.NowTimeMs;
this.nBGMの総再生時間ms = this.sd読み込み音.TotalPlayTime; this.nBGMの総再生時間ms = this.sd読み込み音.TotalPlayTime;
} else { } else {
OpenTaiko.Skin.sound曲読込開始音.tPlay(); OpenTaiko.Skin.sound曲読込開始音.tPlay();
this.nBGM再生開始時刻 = SoundManager.PlayTimer.NowTime; this.nBGM再生開始時刻 = SoundManager.PlayTimer.NowTimeMs;
this.nBGMの総再生時間ms = OpenTaiko.Skin.sound曲読込開始音.n長さ_現在のサウンド; this.nBGMの総再生時間ms = OpenTaiko.Skin.sound曲読込開始音.n長さ_現在のサウンド;
} }
//this.actFI.tフェードイン開始(); // #27787 2012.3.10 yyagi 曲読み込み画面のフェードインの省略 //this.actFI.tフェードイン開始(); // #27787 2012.3.10 yyagi 曲読み込み画面のフェードインの省略
@ -472,7 +472,7 @@ internal class CStage曲読み込み : CStage {
} }
case CStage.EPhase.SongLoading_WaitForSoundSystemBGM: { case CStage.EPhase.SongLoading_WaitForSoundSystemBGM: {
long nCurrentTime = OpenTaiko.Timer.NowTime; long nCurrentTime = OpenTaiko.Timer.NowTimeMs;
if (nCurrentTime < this.nBGM再生開始時刻) if (nCurrentTime < this.nBGM再生開始時刻)
this.nBGM再生開始時刻 = nCurrentTime; this.nBGM再生開始時刻 = nCurrentTime;

View File

@ -31,13 +31,13 @@ internal class CActTaikoScrollSpeed : CActivity {
if (!base.IsDeActivated) { if (!base.IsDeActivated) {
if (base.IsFirstDraw) { if (base.IsFirstDraw) {
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
this.nScrollExclusiveTimer[i] = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); this.nScrollExclusiveTimer[i] = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed);
} }
base.IsFirstDraw = false; base.IsFirstDraw = false;
} }
long nNowTime = SoundManager.PlayTimer.NowTime; long nNowTime = SoundManager.PlayTimer.NowTimeMs;
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
double dbScrollSpeed = (double)OpenTaiko.ConfigIni.nScrollSpeed[OpenTaiko.GetActualPlayer(i)]; double dbScrollSpeed = (double)OpenTaiko.ConfigIni.nScrollSpeed[OpenTaiko.GetActualPlayer(i)];
if (nNowTime < this.nScrollExclusiveTimer[i]) { if (nNowTime < this.nScrollExclusiveTimer[i]) {

View File

@ -575,11 +575,11 @@ internal class CAct演奏Combo共通 : CActivity {
#region [ nジャンプインデックス値 ] #region [ nジャンプインデックス値 ]
//----------------- //-----------------
if (this.status[i].nジャンプインデックス値 < 360) { if (this.status[i].nジャンプインデックス値 < 360) {
if ((this.status[i].n前回の時刻_ジャンプ用 == -1) || (OpenTaiko.Timer.NowTime < this.status[i].n前回の時刻_ジャンプ用)) if ((this.status[i].n前回の時刻_ジャンプ用 == -1) || (OpenTaiko.Timer.NowTimeMs < this.status[i].n前回の時刻_ジャンプ用))
this.status[i].n前回の時刻_ジャンプ用 = OpenTaiko.Timer.NowTime; this.status[i].n前回の時刻_ジャンプ用 = OpenTaiko.Timer.NowTimeMs;
const long INTERVAL = 2; const long INTERVAL = 2;
while ((OpenTaiko.Timer.NowTime - this.status[i].n前回の時刻_ジャンプ用) >= INTERVAL) { while ((OpenTaiko.Timer.NowTimeMs - this.status[i].n前回の時刻_ジャンプ用) >= INTERVAL) {
if (this.status[i].nジャンプインデックス値 < 2000) if (this.status[i].nジャンプインデックス値 < 2000)
this.status[i].nジャンプインデックス値 += 3; this.status[i].nジャンプインデックス値 += 3;
@ -600,7 +600,7 @@ internal class CAct演奏Combo共通 : CActivity {
// モード変更 // モード変更
this.status[i].e現在のモード = EMode.; this.status[i].e現在のモード = EMode.;
this.status[i].nジャンプインデックス値 = 0; this.status[i].nジャンプインデックス値 = 0;
this.status[i].n前回の時刻_ジャンプ用 = OpenTaiko.Timer.NowTime; this.status[i].n前回の時刻_ジャンプ用 = OpenTaiko.Timer.NowTimeMs;
goto Retry; goto Retry;
} }
@ -617,13 +617,13 @@ internal class CAct演奏Combo共通 : CActivity {
// モード変更 // モード変更
this.status[i].e現在のモード = EMode.; this.status[i].e現在のモード = EMode.;
this.status[i].n残像表示中のCOMBO値 = this.status[i].n現在表示中のCOMBO値; this.status[i].n残像表示中のCOMBO値 = this.status[i].n現在表示中のCOMBO値;
this.status[i].nコンボが切れた時刻 = OpenTaiko.Timer.NowTime; this.status[i].nコンボが切れた時刻 = OpenTaiko.Timer.NowTimeMs;
goto Retry; goto Retry;
} }
if (e今回の状態遷移イベント == EEvent.) { if (e今回の状態遷移イベント == EEvent.) {
this.status[i].nジャンプインデックス値 = 0; this.status[i].nジャンプインデックス値 = 0;
this.status[i].n前回の時刻_ジャンプ用 = OpenTaiko.Timer.NowTime; this.status[i].n前回の時刻_ジャンプ用 = OpenTaiko.Timer.NowTimeMs;
} }
this.status[i].n現在表示中のCOMBO値 = this.status[i].nCOMBO値; this.status[i].n現在表示中のCOMBO値 = this.status[i].nCOMBO値;
@ -660,7 +660,7 @@ internal class CAct演奏Combo共通 : CActivity {
this.status[i].e現在のモード = EMode.; this.status[i].e現在のモード = EMode.;
goto Retry; goto Retry;
} }
if ((OpenTaiko.Timer.NowTime - this.status[i].nコンボが切れた時刻) > 1000) { if ((OpenTaiko.Timer.NowTimeMs - this.status[i].nコンボが切れた時刻) > 1000) {
// モード変更2 // モード変更2
this.status[i].e現在のモード = EMode.; this.status[i].e現在のモード = EMode.;
goto Retry; goto Retry;

View File

@ -62,7 +62,7 @@ internal class CAct演奏ステージ失敗 : CActivity {
// メソッド // メソッド
public void Start() { public void Start() {
this.dbFailedTime = OpenTaiko.Timer.NowTime; this.dbFailedTime = OpenTaiko.Timer.NowTimeMs;
this.ct進行 = new CCounter(0, 300, 22, OpenTaiko.Timer); this.ct進行 = new CCounter(0, 300, 22, OpenTaiko.Timer);
if (OpenTaiko.ConfigIni.eGameMode != EGame.Off) { if (OpenTaiko.ConfigIni.eGameMode != EGame.Off) {
this.ct進行 = new CCounter(0, 4000, 2, OpenTaiko.Timer); this.ct進行 = new CCounter(0, 4000, 2, OpenTaiko.Timer);

View File

@ -48,7 +48,7 @@ internal class CAct演奏演奏情報 : CActivity {
OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, string.Format("Song/G. Offset:{0:####0}/{1:####0} ms", OpenTaiko.TJA.nBGMAdjust, OpenTaiko.ConfigIni.nGlobalOffsetMs)); OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, string.Format("Song/G. Offset:{0:####0}/{1:####0} ms", OpenTaiko.TJA.nBGMAdjust, OpenTaiko.ConfigIni.nGlobalOffsetMs));
y -= 0x10; y -= 0x10;
int num = (OpenTaiko.TJA.listChip.Count > 0) ? OpenTaiko.TJA.listChip[OpenTaiko.TJA.listChip.Count - 1].n発声時刻ms : 0; int num = (OpenTaiko.TJA.listChip.Count > 0) ? OpenTaiko.TJA.listChip[OpenTaiko.TJA.listChip.Count - 1].n発声時刻ms : 0;
string str = "Time: " + ((((double)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed)) / 1000.0)).ToString("####0.00") + " / " + ((((double)num) / 1000.0)).ToString("####0.00"); string str = "Time: " + ((((double)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed)) / 1000.0)).ToString("####0.00") + " / " + ((((double)num) / 1000.0)).ToString("####0.00");
OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, str); OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, str);
y -= 0x10; y -= 0x10;
OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, string.Format("Part: {0:####0}/{1:####0}", NowMeasure[0], NowMeasure[1])); OpenTaiko.actTextConsole.Print(x, y, CTextConsole.EFontType.White, string.Format("Part: {0:####0}/{1:####0}", NowMeasure[0], NowMeasure[1]));

View File

@ -1444,7 +1444,7 @@ internal abstract class CStage演奏画面共通 : CStage {
if (this.bPAUSE == false && rollSpeed > 0) // && TJAPlayer3.ConfigIni.bAuto先生の連打) if (this.bPAUSE == false && rollSpeed > 0) // && TJAPlayer3.ConfigIni.bAuto先生の連打)
{ {
double rollSpeedScaled = rollSpeed / OpenTaiko.ConfigIni.SongPlaybackSpeed; double rollSpeedScaled = rollSpeed / OpenTaiko.ConfigIni.SongPlaybackSpeed;
if ((SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed) if ((SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed)
> (pChip.n発声時刻ms + (1000.0 / rollSpeedScaled) * pChip.nRollCount)) { > (pChip.n発声時刻ms + (1000.0 / rollSpeedScaled) * pChip.nRollCount)) {
EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(nPlayer)]; EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(nPlayer)];
int nLane = 0; int nLane = 0;
@ -1466,13 +1466,13 @@ internal abstract class CStage演奏画面共通 : CStage {
if (pChip.nChannelNo == 0x20 && _gt == EGameType.Konga) nLane = 4; if (pChip.nChannelNo == 0x20 && _gt == EGameType.Konga) nLane = 4;
else if (pChip.nChannelNo == 0x21 && _gt == EGameType.Konga) nLane = 1; else if (pChip.nChannelNo == 0x21 && _gt == EGameType.Konga) nLane = 1;
this.tRollProcess(pChip, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), 1, nLane, 0, nPlayer); this.tRollProcess(pChip, (SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed), 1, nLane, 0, nPlayer);
} }
} }
} }
if (!bAutoPlay && !rollEffectHit) { if (!bAutoPlay && !rollEffectHit) {
this.eRollState = ERollState.Roll; this.eRollState = ERollState.Roll;
this.tRollProcess(pChip, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), 1, nNowInput, 0, nPlayer); this.tRollProcess(pChip, (SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed), 1, nNowInput, 0, nPlayer);
} }
//--------------------------- //---------------------------
#endregion #endregion
@ -1526,7 +1526,7 @@ internal abstract class CStage演奏画面共通 : CStage {
int balloonDuration = bAutoPlay ? (pChip.nNoteEndTimems - pChip.n発声時刻ms) : 1000; int balloonDuration = bAutoPlay ? (pChip.nNoteEndTimems - pChip.n発声時刻ms) : 1000;
if ((SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed) > if ((SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed) >
(pChip.n発声時刻ms + (balloonDuration / (double)rollSpeed) * rollCount)) { (pChip.n発声時刻ms + (balloonDuration / (double)rollSpeed) * rollCount)) {
if (this.nHand[nPlayer] == 0) if (this.nHand[nPlayer] == 0)
this.nHand[nPlayer]++; this.nHand[nPlayer]++;
@ -1536,18 +1536,18 @@ internal abstract class CStage演奏画面共通 : CStage {
OpenTaiko.stageGameScreen.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Red); OpenTaiko.stageGameScreen.actTaikoLaneFlash.PlayerLane[nPlayer].Start(PlayerLane.FlashType.Red);
OpenTaiko.stageGameScreen.actMtaiko.tMtaikoEvent(pChip.nChannelNo, this.nHand[nPlayer], nPlayer); OpenTaiko.stageGameScreen.actMtaiko.tMtaikoEvent(pChip.nChannelNo, this.nHand[nPlayer], nPlayer);
this.tBalloonProcess(pChip, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), nPlayer); this.tBalloonProcess(pChip, (SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed), nPlayer);
} }
} }
} }
if (!bAutoPlay && !rollEffectHit) { if (!bAutoPlay && !rollEffectHit) {
if (!IsKusudama || nCurrentKusudamaCount > 0) { if (!IsKusudama || nCurrentKusudamaCount > 0) {
this.tBalloonProcess(pChip, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), nPlayer); this.tBalloonProcess(pChip, (SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed), nPlayer);
} }
} }
#endregion #endregion
} else if (NotesManager.IsRollEnd(pChip)) { } else if (NotesManager.IsRollEnd(pChip)) {
if (pChip.nNoteEndTimems <= (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed)) { if (pChip.nNoteEndTimems <= (SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed)) {
if (NotesManager.IsKusudama(pChip)) { if (NotesManager.IsKusudama(pChip)) {
for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) {
chip現在処理中の連打チップ[i].bHit = true; chip現在処理中の連打チップ[i].bHit = true;
@ -2618,12 +2618,12 @@ internal abstract class CStage演奏画面共通 : CStage {
//判定枠に一番近いチップの情報を元に一小節分の値を計算する. 2020.04.21 akasoko26 //判定枠に一番近いチップの情報を元に一小節分の値を計算する. 2020.04.21 akasoko26
var p判定枠に最も近いチップ = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), 0); var p判定枠に最も近いチップ = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed), 0);
double db一小節後 = 0.0; double db一小節後 = 0.0;
if (p判定枠に最も近いチップ != null) if (p判定枠に最も近いチップ != null)
db一小節後 = ((15000.0 / p判定枠に最も近いチップ.dbBPM * (p判定枠に最も近いチップ.fNow_Measure_s / p判定枠に最も近いチップ.fNow_Measure_m)) * 16.0); db一小節後 = ((15000.0 / p判定枠に最も近いチップ.dbBPM * (p判定枠に最も近いチップ.fNow_Measure_s / p判定枠に最も近いチップ.fNow_Measure_m)) * 16.0);
this.t分岐処理(CTja.ECourse.eNormal, 0, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed) + db一小節後); this.t分岐処理(CTja.ECourse.eNormal, 0, (SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed) + db一小節後);
OpenTaiko.stageGameScreen.actLaneTaiko.t分岐レイヤー_コース変化(OpenTaiko.stageGameScreen.actLaneTaiko.stBranch[0].nAfter, CTja.ECourse.eNormal, 0); OpenTaiko.stageGameScreen.actLaneTaiko.t分岐レイヤー_コース変化(OpenTaiko.stageGameScreen.actLaneTaiko.stBranch[0].nAfter, CTja.ECourse.eNormal, 0);
OpenTaiko.stageGameScreen.actMtaiko.tBranchEvent(OpenTaiko.stageGameScreen.actMtaiko.After[0], CTja.ECourse.eNormal, 0); OpenTaiko.stageGameScreen.actMtaiko.tBranchEvent(OpenTaiko.stageGameScreen.actMtaiko.After[0], CTja.ECourse.eNormal, 0);
@ -2643,13 +2643,13 @@ internal abstract class CStage演奏画面共通 : CStage {
//rc演奏用タイマ.n現在時刻msから引っ張ることに //rc演奏用タイマ.n現在時刻msから引っ張ることに
//判定枠に一番近いチップの情報を元に一小節分の値を計算する. 2020.04.21 akasoko26 //判定枠に一番近いチップの情報を元に一小節分の値を計算する. 2020.04.21 akasoko26
var p判定枠に最も近いチップ = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), 0); var p判定枠に最も近いチップ = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed), 0);
double db一小節後 = 0.0; double db一小節後 = 0.0;
if (p判定枠に最も近いチップ != null) if (p判定枠に最も近いチップ != null)
db一小節後 = ((15000.0 / p判定枠に最も近いチップ.dbBPM * (p判定枠に最も近いチップ.fNow_Measure_s / p判定枠に最も近いチップ.fNow_Measure_m)) * 16.0); db一小節後 = ((15000.0 / p判定枠に最も近いチップ.dbBPM * (p判定枠に最も近いチップ.fNow_Measure_s / p判定枠に最も近いチップ.fNow_Measure_m)) * 16.0);
this.t分岐処理(CTja.ECourse.eExpert, 0, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed) + db一小節後); this.t分岐処理(CTja.ECourse.eExpert, 0, (SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed) + db一小節後);
OpenTaiko.stageGameScreen.actLaneTaiko.t分岐レイヤー_コース変化(OpenTaiko.stageGameScreen.actLaneTaiko.stBranch[0].nAfter, CTja.ECourse.eExpert, 0); OpenTaiko.stageGameScreen.actLaneTaiko.t分岐レイヤー_コース変化(OpenTaiko.stageGameScreen.actLaneTaiko.stBranch[0].nAfter, CTja.ECourse.eExpert, 0);
OpenTaiko.stageGameScreen.actMtaiko.tBranchEvent(OpenTaiko.stageGameScreen.actMtaiko.After[0], CTja.ECourse.eExpert, 0); OpenTaiko.stageGameScreen.actMtaiko.tBranchEvent(OpenTaiko.stageGameScreen.actMtaiko.After[0], CTja.ECourse.eExpert, 0);
@ -2669,13 +2669,13 @@ internal abstract class CStage演奏画面共通 : CStage {
//rc演奏用タイマ.n現在時刻msから引っ張ることに //rc演奏用タイマ.n現在時刻msから引っ張ることに
//判定枠に一番近いチップの情報を元に一小節分の値を計算する. 2020.04.21 akasoko26 //判定枠に一番近いチップの情報を元に一小節分の値を計算する. 2020.04.21 akasoko26
var p判定枠に最も近いチップ = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), 0); var p判定枠に最も近いチップ = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed), 0);
double db一小節後 = 0.0; double db一小節後 = 0.0;
if (p判定枠に最も近いチップ != null) if (p判定枠に最も近いチップ != null)
db一小節後 = ((15000.0 / p判定枠に最も近いチップ.dbBPM * (p判定枠に最も近いチップ.fNow_Measure_s / p判定枠に最も近いチップ.fNow_Measure_m)) * 16.0); db一小節後 = ((15000.0 / p判定枠に最も近いチップ.dbBPM * (p判定枠に最も近いチップ.fNow_Measure_s / p判定枠に最も近いチップ.fNow_Measure_m)) * 16.0);
this.t分岐処理(CTja.ECourse.eMaster, 0, (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed) + db一小節後); this.t分岐処理(CTja.ECourse.eMaster, 0, (SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed) + db一小節後);
OpenTaiko.stageGameScreen.actLaneTaiko.t分岐レイヤー_コース変化(OpenTaiko.stageGameScreen.actLaneTaiko.stBranch[0].nAfter, CTja.ECourse.eMaster, 0); OpenTaiko.stageGameScreen.actLaneTaiko.t分岐レイヤー_コース変化(OpenTaiko.stageGameScreen.actLaneTaiko.stBranch[0].nAfter, CTja.ECourse.eMaster, 0);
OpenTaiko.stageGameScreen.actMtaiko.tBranchEvent(OpenTaiko.stageGameScreen.actMtaiko.After[0], CTja.ECourse.eMaster, 0); OpenTaiko.stageGameScreen.actMtaiko.tBranchEvent(OpenTaiko.stageGameScreen.actMtaiko.After[0], CTja.ECourse.eMaster, 0);
@ -2940,7 +2940,7 @@ internal abstract class CStage演奏画面共通 : CStage {
if (!pChip.bHit && time < 0) { if (!pChip.bHit && time < 0) {
pChip.bHit = true; pChip.bHit = true;
if (configIni.bBGMPlayVoiceSound) { if (configIni.bBGMPlayVoiceSound) {
dTX.tチップの再生(pChip, SoundManager.PlayTimer.PrevResetTime + (long)(pChip.n発声時刻ms / OpenTaiko.ConfigIni.SongPlaybackSpeed)); dTX.tチップの再生(pChip, SoundManager.PlayTimer.PrevResetTimeMs + (long)(pChip.n発声時刻ms / OpenTaiko.ConfigIni.SongPlaybackSpeed));
} }
} }
break; break;
@ -4059,7 +4059,7 @@ internal abstract class CStage演奏画面共通 : CStage {
break; break;
} }
var n現在時刻ms = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); var n現在時刻ms = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed);
//for ( int nCurrentTopChip = this.n現在のトップChip; nCurrentTopChip < dTX.listChip.Count; nCurrentTopChip++ ) //for ( int nCurrentTopChip = this.n現在のトップChip; nCurrentTopChip < dTX.listChip.Count; nCurrentTopChip++ )
for (int nCurrentTopChip = dTX.listChip.Count - 1; nCurrentTopChip > 0; nCurrentTopChip--) { for (int nCurrentTopChip = dTX.listChip.Count - 1; nCurrentTopChip > 0; nCurrentTopChip--) {
@ -4550,7 +4550,7 @@ internal abstract class CStage演奏画面共通 : CStage {
//{ //{
SoundManager.PlayTimer.Pause(); SoundManager.PlayTimer.Pause();
//} //}
SoundManager.PlayTimer.NowTime = nStartTime; SoundManager.PlayTimer.NowTimeMs = nStartTime;
#endregion #endregion
List<CSound> pausedCSound = new List<CSound>(); List<CSound> pausedCSound = new List<CSound>();
@ -4569,7 +4569,7 @@ internal abstract class CStage演奏画面共通 : CStage {
if (!b) continue; if (!b) continue;
if ((wc.bIsBGMSound && OpenTaiko.ConfigIni.bBGMPlayVoiceSound) || (!wc.bIsBGMSound)) { if ((wc.bIsBGMSound && OpenTaiko.ConfigIni.bBGMPlayVoiceSound) || (!wc.bIsBGMSound)) {
OpenTaiko.TJA.tチップの再生(pChip, (long)(SoundManager.PlayTimer.PrevResetTime) + (long)(pChip.n発声時刻ms / OpenTaiko.ConfigIni.SongPlaybackSpeed)); OpenTaiko.TJA.tチップの再生(pChip, (long)(SoundManager.PlayTimer.PrevResetTimeMs) + (long)(pChip.n発声時刻ms / OpenTaiko.ConfigIni.SongPlaybackSpeed));
#region [ PAUSEする ] #region [ PAUSEする ]
int j = wc.n現在再生中のサウンド番号; int j = wc.n現在再生中のサウンド番号;
if (wc.rSound[j] != null) { if (wc.rSound[j] != null) {
@ -4608,9 +4608,9 @@ internal abstract class CStage演奏画面共通 : CStage {
#endregion #endregion
pausedCSound.Clear(); pausedCSound.Clear();
#region [ PAUSEから復帰する ] #region [ PAUSEから復帰する ]
SoundManager.PlayTimer.NowTime = nStartTime; SoundManager.PlayTimer.NowTimeMs = nStartTime;
OpenTaiko.Timer.Reset(); // これでPAUSE解除されるので、3行先の再開()は不要 OpenTaiko.Timer.Reset(); // これでPAUSE解除されるので、3行先の再開()は不要
OpenTaiko.Timer.NowTime = nStartTime; // Debug表示のTime: 表記を正しくするために必要 OpenTaiko.Timer.NowTimeMs = nStartTime; // Debug表示のTime: 表記を正しくするために必要
SoundManager.PlayTimer.Resume(); SoundManager.PlayTimer.Resume();
//CDTXMania.Timer.t再開(); //CDTXMania.Timer.t再開();
this.bPAUSE = false; // システムがPAUSE状態だったら、強制解除 this.bPAUSE = false; // システムがPAUSE状態だったら、強制解除

View File

@ -53,7 +53,7 @@ internal class CActImplLaneTaiko : CActivity {
public override int Draw() { public override int Draw() {
if (base.IsFirstDraw) { if (base.IsFirstDraw) {
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
this.stBranch[i].nフラッシュ制御タイマ = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); this.stBranch[i].nフラッシュ制御タイマ = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed);
base.IsFirstDraw = false; base.IsFirstDraw = false;
} }
@ -93,7 +93,7 @@ internal class CActImplLaneTaiko : CActivity {
for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) {
#region[ ] #region[ ]
long num = FDK.SoundManager.PlayTimer.NowTime; long num = FDK.SoundManager.PlayTimer.NowTimeMs;
if (num < this.stBranch[i].nフラッシュ制御タイマ) { if (num < this.stBranch[i].nフラッシュ制御タイマ) {
this.stBranch[i].nフラッシュ制御タイマ = num; this.stBranch[i].nフラッシュ制御タイマ = num;
} }
@ -581,7 +581,7 @@ internal class CActImplLaneTaiko : CActivity {
} }
*/ */
} }
var nTime = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); var nTime = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed);
for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) {
if (this.n総移動時間[i] != -1) { if (this.n総移動時間[i] != -1) {
@ -791,7 +791,7 @@ internal class CActImplLaneTaiko : CActivity {
} }
public void t判定枠移動(double db移動時間, int n移動px, int n移動方向, int nPlayer, int vJs) { public void t判定枠移動(double db移動時間, int n移動px, int n移動方向, int nPlayer, int vJs) {
this.n移動開始時刻[nPlayer] = (int)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); this.n移動開始時刻[nPlayer] = (int)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed);
this.n移動開始X[nPlayer] = OpenTaiko.stageGameScreen.JPOSCROLLX[nPlayer]; this.n移動開始X[nPlayer] = OpenTaiko.stageGameScreen.JPOSCROLLX[nPlayer];
this.n移動開始Y[nPlayer] = OpenTaiko.stageGameScreen.JPOSCROLLY[nPlayer]; this.n移動開始Y[nPlayer] = OpenTaiko.stageGameScreen.JPOSCROLLY[nPlayer];
this.n総移動時間[nPlayer] = (int)(db移動時間 * 1000); this.n総移動時間[nPlayer] = (int)(db移動時間 * 1000);

View File

@ -48,11 +48,11 @@ internal class CActImplMtaiko : CActivity {
public override int Draw() { public override int Draw() {
if (base.IsFirstDraw) { if (base.IsFirstDraw) {
this.nフラッシュ制御タイマ = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); this.nフラッシュ制御タイマ = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed);
base.IsFirstDraw = false; base.IsFirstDraw = false;
} }
long num = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); long num = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed);
if (num < this.nフラッシュ制御タイマ) { if (num < this.nフラッシュ制御タイマ) {
this.nフラッシュ制御タイマ = num; this.nフラッシュ制御タイマ = num;
} }

View File

@ -43,11 +43,11 @@ internal class CActImplPad : CActivity {
public override int Draw() { public override int Draw() {
if (!base.IsDeActivated) { if (!base.IsDeActivated) {
if (base.IsFirstDraw) { if (base.IsFirstDraw) {
this.nフラッシュ制御タイマ = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); this.nフラッシュ制御タイマ = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed);
this.nY座標制御タイマ = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); this.nY座標制御タイマ = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed);
base.IsFirstDraw = false; base.IsFirstDraw = false;
} }
long num = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); long num = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed);
if (num < this.nフラッシュ制御タイマ) { if (num < this.nフラッシュ制御タイマ) {
this.nフラッシュ制御タイマ = num; this.nフラッシュ制御タイマ = num;
} }
@ -59,7 +59,7 @@ internal class CActImplPad : CActivity {
} }
this.nフラッシュ制御タイマ += 15; this.nフラッシュ制御タイマ += 15;
} }
long num3 = SoundManager.PlayTimer.NowTime; long num3 = SoundManager.PlayTimer.NowTimeMs;
if (num3 < this.nY座標制御タイマ) { if (num3 < this.nY座標制御タイマ) {
this.nY座標制御タイマ = num3; this.nY座標制御タイマ = num3;
} }

View File

@ -10,7 +10,7 @@ internal class CActImplScore : CAct演奏スコア共通 {
if (base.IsFirstDraw) { if (base.IsFirstDraw) {
base.IsFirstDraw = false; base.IsFirstDraw = false;
} }
long num = FDK.SoundManager.PlayTimer.NowTime; long num = FDK.SoundManager.PlayTimer.NowTimeMs;
if (!this.ctTimer.IsStoped) { if (!this.ctTimer.IsStoped) {

View File

@ -388,7 +388,7 @@ internal class CAct演奏Drumsゲームモード : CActivity {
if (this.st叩ききりまショー.bタイマー使用中) { if (this.st叩ききりまショー.bタイマー使用中) {
if (!this.st叩ききりまショー.ct残り時間.IsStoped || this.st叩ききりまショー.b加算アニメ中 == true) { if (!this.st叩ききりまショー.ct残り時間.IsStoped || this.st叩ききりまショー.b加算アニメ中 == true) {
this.st叩ききりまショー.ct残り時間.Tick(); this.st叩ききりまショー.ct残り時間.Tick();
if (!OpenTaiko.stageGameScreen.r検索範囲内にチップがあるか調べる((long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), 0, 5000, 0) || this.st叩ききりまショー.b加算アニメ中 == true) { if (!OpenTaiko.stageGameScreen.r検索範囲内にチップがあるか調べる((long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed), 0, 5000, 0) || this.st叩ききりまショー.b加算アニメ中 == true) {
this.st叩ききりまショー.bタイマー使用中 = false; this.st叩ききりまショー.bタイマー使用中 = false;
this.st叩ききりまショー.ct残り時間.Stop(); this.st叩ききりまショー.ct残り時間.Stop();
} }
@ -498,7 +498,7 @@ internal class CAct演奏Drumsゲームモード : CActivity {
double n延長する時間 = 0; double n延長する時間 = 0;
//最後に延長した時刻から11秒経過していなければ延長を行わない。 //最後に延長した時刻から11秒経過していなければ延長を行わない。
if (this.n最後に時間延長した時刻 + 11000 <= (SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed)) { if (this.n最後に時間延長した時刻 + 11000 <= (SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed)) {
//1項目につき5秒 //1項目につき5秒
//-精度 //-精度
if (this.st叩ききりまショー.nヒット数_PERFECT != 0 || this.st叩ききりまショー.nヒット数_GREAT != 0) { if (this.st叩ききりまショー.nヒット数_PERFECT != 0 || this.st叩ききりまショー.nヒット数_GREAT != 0) {
@ -590,7 +590,7 @@ internal class CAct演奏Drumsゲームモード : CActivity {
#endregion #endregion
this.n最後に時間延長した時刻 = (int)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); this.n最後に時間延長した時刻 = (int)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed);
if (n延長する時間 < 0) if (n延長する時間 < 0)
n延長する時間 = 0; n延長する時間 = 0;
if (this.st叩ききりまショー.n区間ート数 == 0) if (this.st叩ききりまショー.n区間ート数 == 0)
@ -651,7 +651,7 @@ internal class CAct演奏Drumsゲームモード : CActivity {
} }
this.n最後に時間延長した時刻 = (int)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); this.n最後に時間延長した時刻 = (int)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed);
if (n延長する時間 < 0) if (n延長する時間 < 0)
n延長する時間 = 0; n延長する時間 = 0;

View File

@ -489,7 +489,7 @@ internal class CStage演奏ドラム画面 : CStage演奏画面共通 {
this.t進行描画_演奏情報(); this.t進行描画_演奏情報();
if (OpenTaiko.TJA.listLyric2.Count > ShownLyric2 && OpenTaiko.TJA.listLyric2[ShownLyric2].Time < (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed)) { if (OpenTaiko.TJA.listLyric2.Count > ShownLyric2 && OpenTaiko.TJA.listLyric2[ShownLyric2].Time < (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed)) {
this.actPanel.t歌詞テクスチャを生成する(OpenTaiko.TJA.listLyric2[ShownLyric2++].TextTex); this.actPanel.t歌詞テクスチャを生成する(OpenTaiko.TJA.listLyric2[ShownLyric2++].TextTex);
} }
@ -1930,7 +1930,7 @@ internal class CStage演奏ドラム画面 : CStage演奏画面共通 {
for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) {
var chkChip = this.chip現在処理中の連打チップ[i]; var chkChip = this.chip現在処理中の連打チップ[i];
if (chkChip != null) { if (chkChip != null) {
long nowTime = (long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); long nowTime = (long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed);
//int n = this.chip現在処理中の連打チップ[i].nチャンネル番号; //int n = this.chip現在処理中の連打チップ[i].nチャンネル番号;
if ((NotesManager.IsGenericBalloon(chkChip) || NotesManager.IsKusudama(chkChip)) && (this.bCurrentlyDrumRoll[i] == true)) { if ((NotesManager.IsGenericBalloon(chkChip) || NotesManager.IsKusudama(chkChip)) && (this.bCurrentlyDrumRoll[i] == true)) {
//if (this.chip現在処理中の連打チップ.n発声時刻ms <= (int)CSound管理.rc演奏用タイマ.n現在時刻ms && this.chip現在処理中の連打チップ.nーツ終了時刻ms >= (int)CSound管理.rc演奏用タイマ.n現在時刻ms) //if (this.chip現在処理中の連打チップ.n発声時刻ms <= (int)CSound管理.rc演奏用タイマ.n現在時刻ms && this.chip現在処理中の連打チップ.nーツ終了時刻ms >= (int)CSound管理.rc演奏用タイマ.n現在時刻ms)
@ -1959,7 +1959,7 @@ internal class CStage演奏ドラム画面 : CStage演奏画面共通 {
//常時イベントが発生しているメソッドのほうがいいんじゃないかという予想。 //常時イベントが発生しているメソッドのほうがいいんじゃないかという予想。
//CDTX.CChip chipNoHit = this.r指定時刻に一番近い未ヒットChip((int)CSound管理.rc演奏用タイマ.n現在時刻ms, 0); //CDTX.CChip chipNoHit = this.r指定時刻に一番近い未ヒットChip((int)CSound管理.rc演奏用タイマ.n現在時刻ms, 0);
for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) { for (int i = 0; i < OpenTaiko.ConfigIni.nPlayerCount; i++) {
CChip chipNoHit = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed), i); CChip chipNoHit = r指定時刻に一番近い未ヒットChipを過去方向優先で検索する((long)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed), i);
EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(i)]; EGameType _gt = OpenTaiko.ConfigIni.nGameType[OpenTaiko.GetActualPlayer(i)];
bool _isBigKaTaiko = NotesManager.IsBigKaTaiko(chipNoHit, _gt); bool _isBigKaTaiko = NotesManager.IsBigKaTaiko(chipNoHit, _gt);
@ -1968,10 +1968,10 @@ internal class CStage演奏ドラム画面 : CStage演奏画面共通 {
if (chipNoHit != null && (_isBigDonTaiko || _isBigKaTaiko)) { if (chipNoHit != null && (_isBigDonTaiko || _isBigKaTaiko)) {
CConfigIni.CTimingZones tz = this.GetTimingZones(i); CConfigIni.CTimingZones tz = this.GetTimingZones(i);
float timeC = chipNoHit.n発声時刻ms - (float)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed); float timeC = chipNoHit.n発声時刻ms - (float)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed);
int nWaitTime = OpenTaiko.ConfigIni.nBigNoteWaitTimems; int nWaitTime = OpenTaiko.ConfigIni.nBigNoteWaitTimems;
if (chipNoHit.eNoteState == ENoteState.Wait && timeC <= tz.nBadZone if (chipNoHit.eNoteState == ENoteState.Wait && timeC <= tz.nBadZone
&& chipNoHit.nProcessTime + nWaitTime <= (int)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed)) { && chipNoHit.nProcessTime + nWaitTime <= (int)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed)) {
if (!_isSwapNote) { if (!_isSwapNote) {
this.tドラムヒット処理(chipNoHit.nProcessTime, EPad.RRed, chipNoHit, false, i); this.tドラムヒット処理(chipNoHit.nProcessTime, EPad.RRed, chipNoHit, false, i);
//this.nWaitButton = 0; //this.nWaitButton = 0;

View File

@ -267,8 +267,8 @@ internal class Dan_Cert : CActivity {
if (OpenTaiko.TJA.listChip.Count > 0) { if (OpenTaiko.TJA.listChip.Count > 0) {
if (ExamChange[i] if (ExamChange[i]
? OpenTaiko.TJA.pDan_LastChip[NowShowingNumber].n発声時刻ms <= SoundManager.PlayTimer.NowTime//TJAPlayer3.Timer.n現在時刻 ? OpenTaiko.TJA.pDan_LastChip[NowShowingNumber].n発声時刻ms <= SoundManager.PlayTimer.NowTimeMs//TJAPlayer3.Timer.n現在時刻
: OpenTaiko.TJA.listChip[OpenTaiko.TJA.listChip.Count - 1].n発声時刻ms <= SoundManager.PlayTimer.NowTime)//TJAPlayer3.Timer.n現在時刻) : OpenTaiko.TJA.listChip[OpenTaiko.TJA.listChip.Count - 1].n発声時刻ms <= SoundManager.PlayTimer.NowTimeMs)//TJAPlayer3.Timer.n現在時刻)
{ {
switch (Challenge[i].GetExamType()) { switch (Challenge[i].GetExamType()) {
case Exam.Type.Score: case Exam.Type.Score:

View File

@ -253,7 +253,7 @@ class ScriptBG : IDisposable {
double timeoffset = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan ? -2.0 : -8.2; double timeoffset = OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] != (int)Difficulty.Dan ? -2.0 : -8.2;
// Due to the fact that all Dans use DELAY to offset instead of OFFSET, Dan offset can't be properly synced. ¯\_(ツ)_/¯ // Due to the fact that all Dans use DELAY to offset instead of OFFSET, Dan offset can't be properly synced. ¯\_(ツ)_/¯
timestamp = (((double)(SoundManager.PlayTimer.NowTime * OpenTaiko.ConfigIni.SongPlaybackSpeed)) / 1000.0) + timestamp = (((double)(SoundManager.PlayTimer.NowTimeMs * OpenTaiko.ConfigIni.SongPlaybackSpeed)) / 1000.0) +
(-(OpenTaiko.ConfigIni.MusicPreTimeMs + OpenTaiko.TJA.nOFFSET) / 1000.0) + (-(OpenTaiko.ConfigIni.MusicPreTimeMs + OpenTaiko.TJA.nOFFSET) / 1000.0) +
timeoffset; timeoffset;
} }