danoniplus 42.5.4 → 42.5.6
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 +21 -6
- package/package.json +1 -1
package/js/danoni_main.js
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
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 42.5.
|
|
12
|
-
const g_revisedDate = `2025/
|
|
11
|
+
const g_version = `Ver 42.5.6`;
|
|
12
|
+
const g_revisedDate = `2025/12/30`;
|
|
13
13
|
|
|
14
14
|
// カスタム用バージョン (danoni_custom.js 等で指定可)
|
|
15
15
|
let g_localVersion = ``;
|
|
@@ -115,6 +115,9 @@ const waitUntilLoaded = () => {
|
|
|
115
115
|
// fps(デフォルトは60)
|
|
116
116
|
let g_fps = 60;
|
|
117
117
|
|
|
118
|
+
// プレイ画面再生時の内部スケジューリング用のマージン時間(100ms)
|
|
119
|
+
let g_scheduleLead = 0.1;
|
|
120
|
+
|
|
118
121
|
// 譜面データの&区切りを有効にするか
|
|
119
122
|
let g_enableAmpersandSplit = true;
|
|
120
123
|
|
|
@@ -2350,13 +2353,25 @@ class AudioPlayer {
|
|
|
2350
2353
|
this._eventListeners[`canplaythrough`]?.forEach(_listener => _listener());
|
|
2351
2354
|
}
|
|
2352
2355
|
|
|
2356
|
+
/**
|
|
2357
|
+
* 再生処理
|
|
2358
|
+
* @param {number} _adjustmentTime
|
|
2359
|
+
* - 実際の再生開始時間は、g_scheduleLead + _adjustmentTime から開始される
|
|
2360
|
+
* - ただしゲーム内での経過時間計算は _adjustmentTime を基準に行う
|
|
2361
|
+
* - g_scheduleLead は安定した再生タイミングを確保するための内部マージン
|
|
2362
|
+
*/
|
|
2353
2363
|
play(_adjustmentTime = 0) {
|
|
2354
2364
|
this._source = this._context.createBufferSource();
|
|
2355
2365
|
this._source.buffer = this._buffer;
|
|
2356
2366
|
this._source.playbackRate.value = this.playbackRate;
|
|
2357
2367
|
this._source.connect(this._gain);
|
|
2358
|
-
|
|
2359
|
-
|
|
2368
|
+
|
|
2369
|
+
// 実際の予約時刻(内部スケジューリング用のマージンを含む)
|
|
2370
|
+
const startAt = this._context.currentTime + g_scheduleLead + _adjustmentTime;
|
|
2371
|
+
this._source.start(startAt, this._fadeinPosition);
|
|
2372
|
+
|
|
2373
|
+
// ゲーム側の論理的開始時刻(g_scheduleLead を含めない)
|
|
2374
|
+
this._startTime = this._context.currentTime + _adjustmentTime;
|
|
2360
2375
|
}
|
|
2361
2376
|
|
|
2362
2377
|
pause() {
|
|
@@ -12877,7 +12892,7 @@ const mainInit = () => {
|
|
|
12877
12892
|
// WebAudioAPIが使用できる場合は小数フレーム分だけ音源位置を調整
|
|
12878
12893
|
if (g_audio instanceof AudioPlayer) {
|
|
12879
12894
|
const musicStartAdjustment = (g_headerObj.blankFrame - g_stateObj.decimalAdjustment + 1) / g_fps;
|
|
12880
|
-
musicStartTime = performance.now() + musicStartAdjustment * 1000;
|
|
12895
|
+
musicStartTime = performance.now() + (musicStartAdjustment + g_scheduleLead) * 1000;
|
|
12881
12896
|
g_audio.play(musicStartAdjustment);
|
|
12882
12897
|
}
|
|
12883
12898
|
|