danoniplus 39.8.9 → 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 +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 39.8.
|
|
12
|
-
const g_revisedDate = `2025/
|
|
11
|
+
const g_version = `Ver 39.8.11`;
|
|
12
|
+
const g_revisedDate = `2025/12/30`;
|
|
13
13
|
|
|
14
14
|
// カスタム用バージョン (danoni_custom.js 等で指定可)
|
|
15
15
|
let g_localVersion = ``;
|
|
@@ -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
|
|
|
@@ -2159,13 +2162,25 @@ class AudioPlayer {
|
|
|
2159
2162
|
this._eventListeners[`canplaythrough`]?.forEach(_listener => _listener());
|
|
2160
2163
|
}
|
|
2161
2164
|
|
|
2165
|
+
/**
|
|
2166
|
+
* 再生処理
|
|
2167
|
+
* @param {number} _adjustmentTime
|
|
2168
|
+
* - 実際の再生開始時間は、g_scheduleLead + _adjustmentTime から開始される
|
|
2169
|
+
* - ただしゲーム内での経過時間計算は _adjustmentTime を基準に行う
|
|
2170
|
+
* - g_scheduleLead は安定した再生タイミングを確保するための内部マージン
|
|
2171
|
+
*/
|
|
2162
2172
|
play(_adjustmentTime = 0) {
|
|
2163
2173
|
this._source = this._context.createBufferSource();
|
|
2164
2174
|
this._source.buffer = this._buffer;
|
|
2165
2175
|
this._source.playbackRate.value = this.playbackRate;
|
|
2166
2176
|
this._source.connect(this._gain);
|
|
2167
|
-
|
|
2168
|
-
|
|
2177
|
+
|
|
2178
|
+
// 実際の予約時刻(内部スケジューリング用のマージンを含む)
|
|
2179
|
+
const startAt = this._context.currentTime + g_scheduleLead + _adjustmentTime;
|
|
2180
|
+
this._source.start(startAt, this._fadeinPosition);
|
|
2181
|
+
|
|
2182
|
+
// ゲーム側の論理的開始時刻(g_scheduleLead を含めない)
|
|
2183
|
+
this._startTime = this._context.currentTime + _adjustmentTime;
|
|
2169
2184
|
}
|
|
2170
2185
|
|
|
2171
2186
|
pause() {
|
|
@@ -11655,7 +11670,7 @@ const mainInit = () => {
|
|
|
11655
11670
|
// WebAudioAPIが使用できる場合は小数フレーム分だけ音源位置を調整
|
|
11656
11671
|
if (g_audio instanceof AudioPlayer) {
|
|
11657
11672
|
const musicStartAdjustment = (g_headerObj.blankFrame - g_stateObj.decimalAdjustment + 1) / g_fps;
|
|
11658
|
-
musicStartTime = performance.now() + musicStartAdjustment * 1000;
|
|
11673
|
+
musicStartTime = performance.now() + (musicStartAdjustment + g_scheduleLead) * 1000;
|
|
11659
11674
|
g_audio.play(musicStartAdjustment);
|
|
11660
11675
|
}
|
|
11661
11676
|
|