danoniplus 39.8.10 → 39.8.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/danoni_main.js +10 -10
- package/package.json +1 -1
package/js/danoni_main.js
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Source by tickle
|
|
6
6
|
* Created : 2018/10/08
|
|
7
|
-
* Revised : 2025/
|
|
7
|
+
* Revised : 2025/12/30
|
|
8
8
|
*
|
|
9
9
|
* https://github.com/cwtickle/danoniplus
|
|
10
10
|
*/
|
|
11
|
-
const g_version = `Ver 39.8.
|
|
11
|
+
const g_version = `Ver 39.8.11`;
|
|
12
12
|
const g_revisedDate = `2025/12/30`;
|
|
13
13
|
|
|
14
14
|
// カスタム用バージョン (danoni_custom.js 等で指定可)
|
|
@@ -68,6 +68,9 @@ window.onload = async () => {
|
|
|
68
68
|
// fps(デフォルトは60)
|
|
69
69
|
let g_fps = 60;
|
|
70
70
|
|
|
71
|
+
// プレイ画面再生時の内部スケジューリング用のマージン時間(100ms)
|
|
72
|
+
let g_scheduleLead = 0.1;
|
|
73
|
+
|
|
71
74
|
// 譜面データの&区切りを有効にするか
|
|
72
75
|
let g_enableAmpersandSplit = true;
|
|
73
76
|
|
|
@@ -2162,9 +2165,9 @@ class AudioPlayer {
|
|
|
2162
2165
|
/**
|
|
2163
2166
|
* 再生処理
|
|
2164
2167
|
* @param {number} _adjustmentTime
|
|
2165
|
-
* - 実際の再生開始時間は、
|
|
2168
|
+
* - 実際の再生開始時間は、g_scheduleLead + _adjustmentTime から開始される
|
|
2166
2169
|
* - ただしゲーム内での経過時間計算は _adjustmentTime を基準に行う
|
|
2167
|
-
* -
|
|
2170
|
+
* - g_scheduleLead は安定した再生タイミングを確保するための内部マージン
|
|
2168
2171
|
*/
|
|
2169
2172
|
play(_adjustmentTime = 0) {
|
|
2170
2173
|
this._source = this._context.createBufferSource();
|
|
@@ -2172,14 +2175,11 @@ class AudioPlayer {
|
|
|
2172
2175
|
this._source.playbackRate.value = this.playbackRate;
|
|
2173
2176
|
this._source.connect(this._gain);
|
|
2174
2177
|
|
|
2175
|
-
// 内部スケジューリング用のマージン時間(100ms)
|
|
2176
|
-
const scheduleLead = 0.1;
|
|
2177
|
-
|
|
2178
2178
|
// 実際の予約時刻(内部スケジューリング用のマージンを含む)
|
|
2179
|
-
const startAt = this._context.currentTime +
|
|
2179
|
+
const startAt = this._context.currentTime + g_scheduleLead + _adjustmentTime;
|
|
2180
2180
|
this._source.start(startAt, this._fadeinPosition);
|
|
2181
2181
|
|
|
2182
|
-
// ゲーム側の論理的開始時刻(
|
|
2182
|
+
// ゲーム側の論理的開始時刻(g_scheduleLead を含めない)
|
|
2183
2183
|
this._startTime = this._context.currentTime + _adjustmentTime;
|
|
2184
2184
|
}
|
|
2185
2185
|
|
|
@@ -11670,7 +11670,7 @@ const mainInit = () => {
|
|
|
11670
11670
|
// WebAudioAPIが使用できる場合は小数フレーム分だけ音源位置を調整
|
|
11671
11671
|
if (g_audio instanceof AudioPlayer) {
|
|
11672
11672
|
const musicStartAdjustment = (g_headerObj.blankFrame - g_stateObj.decimalAdjustment + 1) / g_fps;
|
|
11673
|
-
musicStartTime = performance.now() + musicStartAdjustment * 1000;
|
|
11673
|
+
musicStartTime = performance.now() + (musicStartAdjustment + g_scheduleLead) * 1000;
|
|
11674
11674
|
g_audio.play(musicStartAdjustment);
|
|
11675
11675
|
}
|
|
11676
11676
|
|